sui_scallop_sdk 1.3.1 copy "sui_scallop_sdk: ^1.3.1" to clipboard
sui_scallop_sdk: ^1.3.1 copied to clipboard

A Dart SDK for the Scallop lending protocol on Sui - market data, obligations, spools, lending/borrowing actions, and naming.

1.3.1 #

Changed #

  • Bump bcs_dart to ^0.2.1.

1.3.0 #

Added #

  • sCoin address coins from the on-chain scoin config are included in the coin-name and coin-type lookup maps.

Fixed #

  • Market query ValueF / NameF fields parse via fromJson, so their gRPC JSON values deserialize correctly.
  • Per-item errors in the market, portfolio, and spool fan-outs propagate instead of being swallowed, so a transient RPC failure surfaces rather than silently returning partial positions. Guarded a zero-period division in calculateBorrowIncentivePoolPointData.

Changed #

  • getSpool skips the redundant spool-object fetch when requiredObjects is already provided.
  • Bump sui_dart to ^0.8.4; its gRPC events read-mask fix is required for the event-based query reads to return data.

1.2.1 #

Fixed #

  • Obligation and borrow-incentive query events now parse when the type field arrives as a plain coin-type string instead of a {name} map. The previous cast threw and was swallowed by getObligationAccounts, so every obligation account came back empty.

1.2.0 #

Synced to ec29973.

Added #

  • ScallopTxBlock.liquidate(obligation, coin, debtCoinName, collateralCoinName) — liquidate an unhealthy obligation; returns the repaid-debt remainder and the seized collateral.
  • ScallopTxBlock.unbindReferral() — remove the caller's veSCA referrer binding.

1.1.1 #

Changed #

  • Event-emitting query reads (market, obligation, borrow-incentive) now go through gRPC simulateTransaction instead of JSON-RPC devInspectTransactionBlock; reads are gasless and need no funded wallet. This removes the last JSON-RPC usage.
  • Bump sui_dart to ^0.8.2.

1.1.0 #

Changed #

  • veSCA reads (getVeSca, treasury amount) now use the ve_sca Move getters over gRPC devInspect instead of the JSON-RPC dynamic-field object, so the per-key u64 amounts come back at full precision.
  • Pool address resolution (getPoolAddresses) now reads market tables and dynamic fields over gRPC.
  • Pyth price fetching moves to Hermes via pyth_sui_dart ^3.0.0; dropped the price_service_client dependency.
  • Bump sui_kit to ^1.1.1, sui_dart to ^0.8.1, bcs_dart to ^0.2.0.

Fixed #

  • veSCA reads no longer require the wallet to hold SUI (gasless devInspect).

1.0.5 #

Bug fixes:

  • Obligations: getObligationAccount now guards the debt-loop estimatedAvailableBorrowAmount division against a zero borrowWeight/coinPrice, mirroring the existing collateralFactor == 0 guard in the collateral loop. A debt in a coin with no resolved price (no oracle feed configured for it) previously threw Division by zero, which getObligationAccounts/getObligationAccountsByIds swallowed to null, so every obligation silently disappeared from the account list. Such positions now load with the unpriced coin valued at zero.

1.0.4 #

Bug fixes:

  • veSCA: getVescaKeys advances the pagination cursor (fixes an infinite loop); getTotalVeScaTreasuryAmount passes the treasury + clock (not the config) to treasury::total_ve_sca_amount.
  • Prices: getCoinPrices matches Pyth prices by feed id (not request position), keys the cache by the requested ids, and honors the poolAddresses feed fallback.
  • Math: empty-pool conversionRate is 1 (not 0); point timeDelta rounds to whole periods; spool divisions are guarded against zero periods; unhealthyCollateralValue/totalRequiredCollateralValue use the liquidation-threshold value; availableWithdraw caps at pool supply.
  • Builders/parsing: the borrow/takeCollateral/borrowWithReferral quick methods recover the obligation key from the sender when only an id is given; the borrow-incentive selector honors a supplied id; parseCoinNameFromType returns the right MarketCoin name; isMarketCoin no longer throws on an empty string.
  • Robustness: batch queries (getMarketPools, getSpools, getLendings, getObligationAccounts, getStakeRewardPools) skip a failing item instead of aborting; loyalty reads no longer crash; the spool indexer filter keeps the requested spools; positions survive a briefly-missing price.
  • Constants: pool addresses filtered to whitelisted keys (empty fields normalized); protocolObjectId falls back to the hardcoded id; restored the full mainnet RPC failover list.

Docs & packaging:

  • Rewrote the README and added a runnable example/, a library doc comment, and dartdoc across the public API.
  • pubspec: added topics/issue_tracker/documentation, moved dotenv to dev, dropped dependency_overrides, the unused price_service_sdk, and dio (veSCA fallback now uses sui_dart's JsonRpcClient).

1.0.3 #

  • Bump Riverpod to 3.3.x (riverpod 3.3.2, riverpod_annotation 4.0.3) and regenerate providers with riverpod_generator 4.0.4. The previous generated code targeted the pre-3.3 Notifier.runBuild signature and no longer compiled against Riverpod 3.3.x.

1.0.2 #

  • Fix borrow incentive pools reporting a stale reward APR for exhausted campaigns. Exhausted pools (all allocated points distributed) are still returned so already-accrued unclaimed rewards surface in the portfolio query, but their rewardApr is now zeroed.

1.0.1 #

  • Fix getPythPrices returning zero prices when Hermes is unreachable. Per-coin failures are now isolated.

1.0.0 #

  • Initial release.
  • Market data queries: lending market pools (supply/borrow APYs, util rates), collateral pools, TVL aggregates.
  • User-state queries: obligation accounts (collateral + debt + risk level), spools, veSCA keys, borrow incentives.
  • Obligation naming: setObligationName / removeObligationName builder methods, getObligationNames query via gRPC dynamic fields.
  • Lending action PTB builders: supply / withdraw / borrow / repay / claim, stake / unstake veSCA, deposit / withdraw collateral.
  • Dynamic-field lookups via deterministic UID derivation (no list scans).
  • In-flight request deduplication; safe cache for shared queries.
  • Built on sui_dart 0.4.0 (gRPC v2), sui_kit 1.0.0, pyth_sui_dart 2.0.0.
0
likes
160
points
678
downloads

Documentation

API reference

Publisher

verified publisherscallop.io

Weekly Downloads

A Dart SDK for the Scallop lending protocol on Sui - market data, obligations, spools, lending/borrowing actions, and naming.

Repository (GitHub)
View/report issues

Topics

#sui #scallop #defi #lending #blockchain

License

Apache-2.0 (license)

Dependencies

bcs_dart, collection, decimal, freezed_annotation, http, json_annotation, meta, pyth_sui_dart, riverpod, riverpod_annotation, sui_dart, sui_kit

More

Packages that depend on sui_scallop_sdk