Post
Share your knowledge.
How do I sign txs without using a wallet?
Is there a secure way to sign and send transactions programmatically using a private key — without needing a browser wallet?
- Sui
- Architecture
- SDKs and Developer Tools
- Move
Answers
2The above question is correct but it used the old library which not support any more. Current Mysten Lab have change to package @mysten/sui
First you need to get the key pair from mnemonic or private key
const exampleMnemonic = 'result crisp session latin ...';
const keyPair = Ed25519Keypair.deriveKeypair(exampleMnemonic);
https://sdk.mystenlabs.com/typescript/cryptography/keypairs#deriving-a-key-pair-from-a-mnemonic
Then use that keypair to create signature for transaction https://sdk.mystenlabs.com/typescript/transaction-building/basics#transactions
const result = await client.signAndExecuteTransaction({ signer: keypair, transaction: tx });
await client.waitForTransaction({ digest: result.digest });
You can read more at https://sdk.mystenlabs.com/typescript/transaction-building/basics#transactions
Do you know the answer?
Please log in and share it.
Sui is a Layer 1 protocol blockchain designed as the first internet-scale programmable blockchain platform.
- How to Maximize Profit Holding SUI: Sui Staking vs Liquid Staking616
- Why does BCS require exact field order for deserialization when Move structs have named fields?65
- Multiple Source Verification Errors" in Sui Move Module Publications - Automated Error Resolution55
- Sui Move Error - Unable to process transaction No valid gas coins found for the transaction419
- Sui Transaction Failing: Objects Reserved for Another Transaction410