scallop_deepbook_kit 5.0.0 copy "scallop_deepbook_kit: ^5.0.0" to clipboard
scallop_deepbook_kit: ^5.0.0 copied to clipboard

A Dart/Flutter toolkit for interacting with DeepBook V3 Margin Pools on the Sui blockchain.

Changelog #

5.0.0 #

Breaking #

  • Require sui_dart ^0.11.0.

4.0.0 #

Breaking #

  • Require sui_dart ^0.10.0. simulateTransaction no longer selects gas by default, SuiCoreClient implementations must add four new methods, and getTransaction throws TransactionError on an unknown digest, so consumers on sui_dart 0.9.x must migrate. This package's own API is unchanged.

3.0.0 #

Breaking #

  • Require sui_dart ^0.9.0. Its transport refactor removed the JSON-RPC surface and renamed client reads (listCoinsgetCoins, etc.), so consumers on sui_dart 0.8.x must migrate. This package's own API is unchanged.

2.0.1 #

Changed #

  • Bump bcs_dart to ^0.2.1.

2.0.0 #

Breaking #

  • Renamed the exported coinWithBalance(client, tx, owner:, coinType:, amount:) helper to resolveCoinForAmount; sui_dart 0.8 exports its own top-level coinWithBalance intent, which collided.

Changed #

  • Bump sui_dart to ^0.8.1 and bcs_dart to ^0.2.0.

1.1.1 #

  • Upgraded the sui_dart dependency to ^0.5.0 (from ^0.4.1). The public API is unchanged; this is a maintenance release that tracks the latest sui_dart.
  • Dropped the now-removed Constants.enableDebugLog toggle from the internal tool/ check scripts (it no longer exists in sui_dart 0.5.0).

1.1.0 #

  • Switched the Sui transport from JSON-RPC to gRPC (sui_dart's SuiGrpcClient).
    • All reads, simulate/devInspect, and execute now go over gRPC (fullnode.<net>.sui.io:443). No JSON-RPC client is used.
    • Writes are built server-side: simulateTransaction(doGasSelection: true) returns the canonical signable bytes (.bcs); those are signed locally and submitted via executeTransaction. Removed the JSON-RPC build dependency (ToolkitConfig.fullnodeUrl).
    • Added src/utils/grpc_exec.dart: raw simulate/execute calls with a correct FieldMask to work around sui_dart 0.4.1's wrapper readMask, which omits command_outputs/effects.
    • Added explicit in-band status checks (gRPC dry-run/execute report Move aborts via effects.status.success == false, not by throwing).
    • Added a defensive Move-field unwrap for ObjectData.json (flat gRPC shape + nested fallback).
    • Added ToolkitConfig.grpcHost override and dispose() on DeepBookMarginToolkit / DeepBookMarginPool to close the gRPC channel.
  • Live-verified read paths (mainnet + testnet pool params/APR, balances, pool discovery).
  • Added test/live_grpc_test.dart — live gRPC read integration tests (pool params + APR decode, getOnChainMarginPools); gated behind RUN_LIVE_TESTS=1, all passing against real fullnodes.
  • Hardened after a full adversarial audit: fixed the executeTransaction readMask (it omitted effects, so writes would always report failure), guarded getBalance U64 decode against short buffers, made DeepBookMarginPool.dispose() not close a caller-owned client, and made created-object detection fall back to a direct object-type read.
  • Note: gRPC uses native HTTP/2 — Flutter mobile & desktop only (Web needs a grpc-web proxy).
  • Wallet usage support (build a tx and sign with your own wallet — no private-key toolkit required):
    • DeepBookMarginPool.build* helpers (buildMintSupplierCap, buildSupply — resolves the coin from a plain amount, buildWithdraw, buildMintSupplyReferral, buildWithdrawReferralFees) that add Move calls to an unsigned Transaction.
    • Public coinWithBalance(client, tx, owner:, coinType:, amount:) resolver and signAndExecuteTransaction(client, account, tx) so any wallet/account can sign + execute a built tx.
    • DeepBookMarginPool.getSupplierCapIds([owner]) for supplier-cap discovery.
  • Fix: supplier-cap discovery. A SupplierCap's type keeps the ORIGINAL margin package id, which differs from marginPackageId after a package upgrade — the old owned-objects filter by marginPackageId found nothing, so initialize() minted a new cap on every call. Now matches by the ::margin_pool::SupplierCap type suffix (upgrade-safe). Verified on testnet.
  • Verified the full wallet flow on testnet: getSupplierCapIdsbuildSupplysignAndExecuteTransactionbuildWithdraw round-trip.

1.0.2 #

  • Initial release — a Dart/Flutter toolkit for DeepBook V3 margin pools, built on sui_dart.
  • DeepBookMarginToolkit: initialize, createSupplierCap, createSupplyReferral, supplyToMarginPool, withdrawFromMarginPool, withdrawReferralFees, getBalance, getSupplierCapId, getAddress.
  • DeepBookMarginPool: getPoolParameters / getPoolsParameters with borrow/supply APR, utilization, and kink computation.
  • MarginPoolContract: DeepBook V3 margin-pool Move-call builders.
  • DeepBookConfig + constants (package ids, coins, pools, margin pools) for testnet and mainnet.
  • getOnChainMarginPools() query.
  • Utilities: accountFromPrivateKey (hex / 0x-hex / base64 / suiprivkey), mul, normalize, getRpcUrl, convertQuantity.
  • Offline unit tests; clean dart analyze.
0
likes
160
points
170
downloads

Documentation

API reference

Publisher

verified publisherscallop.io

Weekly Downloads

A Dart/Flutter toolkit for interacting with DeepBook V3 Margin Pools on the Sui blockchain.

Repository (GitHub)

Topics

#sui #deepbook #defi #blockchain #dex

License

MIT (license)

Dependencies

bcs_dart, protobuf, sui_dart

More

Packages that depend on scallop_deepbook_kit