Transactions
Sign & send a transaction
Example 1: Sign transaction with a Keying account
Keying accountimport { cryptoWaitReady } from '@polkadot/util-crypto';
import { Keyring } from '@polkadot/keyring';
// ...
await cryptoWaitReady();
const keyring = new Keyring({ type: 'sr25519' });
const alice = keyring.addFromUri('//Alice');
const { status } = await client.tx.balances
.transferKeepAlive(<destAddress>, 2_000_000_000_000n)
.signAndSend(alice, ({ status }) => {
console.log('Transaction status', status.type);
})
.untilFinalized();
console.log(`Transaction finalized at block hash ${status.value.blockHash}`);Example 2: Sign transaction using Signer from Polkadot{.js} wallet extension
Signer from Polkadot{.js} wallet extensionSubmittableExtrinsic
sign
signsend
sendsignAndSend
signAndSendpaymentInfo
paymentInfoTx Resolver Methods
SubmittableResult
TxStatus
SignerOptions
Last updated