Skip to content

Conversation

klren0312
Copy link
Contributor

Description

the useSignTransaction doc has a error.
In the code const { bytes, signature, reportTransactionEffects } = await signTransaction, signTransaction will return void, so need to use onSuccess to get these params.

signTransaction(
  {
    transaction: new Transaction(),
    chain: 'sui:devnet',
  },
  {
    onSuccess: async ({ bytes, signature, reportTransactionEffects }) => {
       // do something
    })
  }
)

Test plan

this code is true: https://github.com/MystenLabs/sui/blob/main/sdk/docs/examples/wallet-hooks.tsx#L241-L254
but the doc is error, it will confuse developers


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

@klren0312 klren0312 requested a review from a team as a code owner January 9, 2025 07:08
Copy link

vercel bot commented Jan 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 9, 2025 7:09am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Skipped (Inspect) Jan 9, 2025 7:09am
sui-kiosk ⬜️ Skipped (Inspect) Jan 9, 2025 7:09am

@vercel vercel bot temporarily deployed to Preview – multisig-toolkit January 9, 2025 07:08 Inactive
@vercel vercel bot temporarily deployed to Preview – sui-kiosk January 9, 2025 07:08 Inactive
@klren0312 klren0312 temporarily deployed to sui-typescript-aws-kms-test-env January 9, 2025 17:10 — with GitHub Actions Inactive
@hayes-mysten
Copy link
Contributor

I think there might be something else going on. Can you double check that you are using mutateAsync not mutate when you define signTransaction? The async version should resolve to a promise with the bytes and signature

@klren0312
Copy link
Contributor Author

I think there might be something else going on. Can you double check that you are using mutateAsync not mutate when you define signTransaction? The async version should resolve to a promise with the bytes and signature

thanks

@klren0312 klren0312 closed this Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants