sui_scallop_sdk 1.3.1
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.0 #
Added #
- sCoin address coins from the on-chain
scoinconfig are included in the coin-name and coin-type lookup maps.
Fixed #
- Market query
ValueF/NameFfields parse viafromJson, 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 #
getSpoolskips the redundant spool-object fetch whenrequiredObjectsis already provided.- Bump
sui_dartto^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
typefield arrives as a plain coin-type string instead of a{name}map. The previous cast threw and was swallowed bygetObligationAccounts, 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
simulateTransactioninstead of JSON-RPCdevInspectTransactionBlock; reads are gasless and need no funded wallet. This removes the last JSON-RPC usage. - Bump
sui_dartto^0.8.2.
1.1.0 #
Changed #
- veSCA reads (
getVeSca, treasury amount) now use theve_scaMove 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 theprice_service_clientdependency. - Bump
sui_kitto^1.1.1,sui_dartto^0.8.1,bcs_dartto^0.2.0.
Fixed #
- veSCA reads no longer require the wallet to hold SUI (gasless devInspect).
1.0.5 #
Bug fixes:
- Obligations:
getObligationAccountnow guards the debt-loopestimatedAvailableBorrowAmountdivision against a zeroborrowWeight/coinPrice, mirroring the existingcollateralFactor == 0guard in the collateral loop. A debt in a coin with no resolved price (no oracle feed configured for it) previously threwDivision by zero, whichgetObligationAccounts/getObligationAccountsByIdsswallowed tonull, 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:
getVescaKeysadvances the pagination cursor (fixes an infinite loop);getTotalVeScaTreasuryAmountpasses the treasury + clock (not the config) totreasury::total_ve_sca_amount. - Prices:
getCoinPricesmatches Pyth prices by feed id (not request position), keys the cache by the requested ids, and honors thepoolAddressesfeed fallback. - Math: empty-pool
conversionRateis1(not0); pointtimeDeltarounds to whole periods; spool divisions are guarded against zero periods;unhealthyCollateralValue/totalRequiredCollateralValueuse the liquidation-threshold value;availableWithdrawcaps at pool supply. - Builders/parsing: the
borrow/takeCollateral/borrowWithReferralquick methods recover the obligation key from the sender when only an id is given; the borrow-incentive selector honors a supplied id;parseCoinNameFromTypereturns the rightMarketCoinname;isMarketCoinno 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);
protocolObjectIdfalls 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, moveddotenvto dev, droppeddependency_overrides, the unusedprice_service_sdk, anddio(veSCA fallback now usessui_dart'sJsonRpcClient).
1.0.3 #
- Bump Riverpod to 3.3.x (
riverpod3.3.2,riverpod_annotation4.0.3) and regenerate providers withriverpod_generator4.0.4. The previous generated code targeted the pre-3.3Notifier.runBuildsignature 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
rewardApris now zeroed.
1.0.1 #
- Fix
getPythPricesreturning 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/removeObligationNamebuilder methods,getObligationNamesquery 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_dart0.4.0 (gRPC v2),sui_kit1.0.0,pyth_sui_dart2.0.0.