Skip to content

Please upgrade Aggregator SDK from Sui 1.6.x to latest #23

@fromcoffeeimportall

Description

@fromcoffeeimportall

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 provide Transaction.

  • Common breakages:

    • txb.pure.u64 is not a function / differing pure() signatures
    • Invalid Pure type name: ... when passing raw strings
    • Incompatibilities around dryRunTransactionBlock vs 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 Transaction or TransactionBlock.

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

  1. Deps: bump @mysten/sui and related packages to latest stable.

  2. 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 }.

  3. Pure helpers: use txb.pure.u64(...) when available; fall back to legacy txb.pure(value, 'u64') if not.

  4. Client calls: align on dryRunTransactionBlock (and keep a fallback path if you must support older clients).

  5. Docs: update “BuildRouterSwapParamsV2” section to emphasize class APIs (findRouters, routerSwap) and show examples with the new builder.

  6. Release: publish a pre-release tag (e.g., next) so integrators can test before GA.

Acceptance criteria

  • findRouters + routerSwap compile 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions