-
Notifications
You must be signed in to change notification settings - Fork 20
Description
Summary
The Aggregator SDK is pinned to an ANCIENT ;) @mysten/sui (≈1.6 vs current , TransactionBlock era vs the new age @mysten/sui@1.37.1). Modern Sui projects use the new Transaction builder and updated client APIs. This mismatch causes type and runtime errors when integrating findRouters/routerSwap in current stacks.
Current behavior
-
Types expect
TransactionBlock; projects provideTransaction. -
Common breakages:
txb.pure.u64 is not a function/ differingpure()signaturesInvalid Pure type name: ...when passing raw strings- Incompatibilities around
dryRunTransactionBlockvs older inspection calls
-
Integrators are forced to pin the whole app to old Sui or write shims.
Desired behavior
- Publish a release built against the latest
@mysten/sui(Transaction API), or - Support dual compatibility: accept either
TransactionorTransactionBlock.
Why this matters
- Most Sui tooling, examples, and apps have moved to the newer builder.
- Maintaining an old Sui version in production apps introduces security/bug-fix lag and duplicate SDKs in dep trees.
Proposed changes
-
Deps: bump
@mysten/suiand related packages to latest stable. -
Types: introduce a minimal adapter interface to accept both builders:
export type TransactionLike = { object(id: string): any; splitCoins(coin: any, amounts: any[]): any; moveCall(args: { target: string; typeArguments?: string[]; arguments?: any[] }): any; pure: { u64(n: string | number | bigint): any; bool?(b: boolean): any; vec?<T>(t: string, v: T[]): any }; gas: any; };
And update public methods to accept
{ txb: TransactionLike }. -
Pure helpers: use
txb.pure.u64(...)when available; fall back to legacytxb.pure(value, 'u64')if not. -
Client calls: align on
dryRunTransactionBlock(and keep a fallback path if you must support older clients). -
Docs: update “BuildRouterSwapParamsV2” section to emphasize class APIs (
findRouters,routerSwap) and show examples with the new builder. -
Release: publish a pre-release tag (e.g.,
next) so integrators can test before GA.
Acceptance criteria
findRouters+routerSwapcompile and run with latest@mysten/sui.- No runtime errors when chaining 3 hops (A→B→C→A) using
Transaction. - Example code in docs builds without shims in a fresh project.
Optional (nice to have)
- Export a tiny
createInputCoin(txb, coinType, amount)helper to standardize coin prep for by-amount-in flows. - Provide a migration note for teams pinned to 1.6.x.
Thanks!