[Bug] Legacy tx.pure moveCall argument syntax in account.ts and manual.ts fails under modern @mysten/sui

Open Beginner friendly
#799 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
api

Research direction

Start in packages/sdk/src/account.ts at addDelegateKey and removeDelegateKey, then inspect recallManual in packages/sdk/src/manual.ts. Compare the existing pure argument calls with the proposed @mysten/sui v2 helpers and reproduce the transaction-building flow using @mysten/sui@2.5.0 or higher. Done means the listed PTBs construct and execute cleanly without invalid pure arguments.

Written by the indexing model from the issue text.

Description

Surface

TypeScript SDK (@mysten-incubation/memwal)

Network

All networks (Mainnet / Testnet / Local)

Package version

@mysten-incubation/memwal@0.1.5 (main)

What happened?

packages/sdk/package.json specifies "@mysten/sui": ">=2.5.0". In @mysten/sui v1+ and v2+, the Transaction builder (@mysten/sui/transactions) replaced the legacy @mysten/sui.js two-argument x.pure(typeString, value) API with typed method calls (e.g. x.pure.vector('u8', value), x.pure.string(value)) or direct BCS serializations.

However, several on-chain Move call wrappers in packages/sdk/src/account.ts and packages/sdk/src/manual.ts still use the legacy two-argument form:

  1. ddDelegateKey (packages/sdk/src/account.ts:290-291):
    ypescript tx.moveCall({ target: ${opts.packageId}::account::add_delegate_key, arguments: [ tx.object(opts.accountId), tx.object(opts.registryId), tx.pure("vector<u8>", Array.from(pkBytes)), tx.pure("string", opts.label), tx.object(SUI_CLOCK), ], });

  2. **
    emoveDelegateKey** (packages/sdk/src/account.ts:341):
    ypescript tx.moveCall({ target: ${opts.packageId}::account::remove_delegate_key, arguments: [ tx.object(opts.accountId), tx.object(opts.registryId), tx.pure("vector<u8>", Array.from(pkBytes)), ], });

  3. **
    ecallManual** (packages/sdk/src/manual.ts:508):
    ypescript tx.moveCall({ target: ${this.config.sealPolicyPackageId ?? this.config.packageId}::account::seal_approve, arguments: [ tx.pure("vector<u8>", idBytes), tx.object(this.config.registryId), tx.object(this.config.accountId), ], });

Steps to reproduce
  1. Instantiate MemWalManual or call ddDelegateKey /
    emoveDelegateKey in a project with @mysten/sui@2.5.0 or higher.
  2. Execute wait addDelegateKey(...) or wait memwalManual.recallManual(...).
  3. The transaction builder fails serialization or aborts on-chain because "vector" is treated as the input argument rather than the Move type declaration.
Expected

Transaction arguments should use @mysten/sui v2+ compatible serialization helpers so PTBs construct and execute cleanly.

Actual

The call fails or generates invalid PTB pure arguments.

Proposed Fix

Update packages/sdk/src/account.ts and packages/sdk/src/manual.ts to use x.pure.vector("u8", ...) and x.pure.string(...):

` ypescript
// account.ts - addDelegateKey
arguments: [
tx.object(opts.accountId),
tx.object(opts.registryId),
tx.pure.vector("u8", Array.from(pkBytes)),
tx.pure.string(opts.label),
tx.object(SUI_CLOCK),
]

// account.ts - removeDelegateKey
arguments: [
tx.object(opts.accountId),
tx.object(opts.registryId),
tx.pure.vector("u8", Array.from(pkBytes)),
]

// manual.ts - recallManual seal_approve
arguments: [
tx.pure.vector("u8", idBytes),
tx.object(this.config.registryId),
tx.object(this.config.accountId),
]
`

Checks
  • I searched existing issues and this is not a duplicate.
  • This report contains no private keys, mnemonics, or other secrets.
Dominant language
TypeScript
Stars
107
Forks
37
Avg merge
3d 2h
Merged PRs (30d)
101

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MystenLabs/MemWal

All issues in MystenLabs/MemWal

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.