TypeScript SDK
The TypeScript SDK allows you to connect, explore, and interact on the Aptos blockchain. You can use it to request data, send transactions, set up test environments, and more!
npm i @aptos-labs/ts-sdk
Examples
Quickstart →
See the quickstart to get a working demo in < 5 minutes20+ Examples →
Explore all of the TypeScript examples provided in the SDK repositoryTransfer APT in 10 lines or less
// Transfer between users
const txn = await aptos.transaction.build.simple({
sender: alice.accountAddress,
data: {
function: "0x1::coin::transfer",
typeArguments: [APTOS_COIN],
functionArguments: [bob.accountAddress, TRANSFER_AMOUNT],
},
});
console.log("\n=== Transfer transaction ===\n");
const committedTxn = await aptos.signAndSubmitTransaction({ signer: alice, transaction: txn });
await aptos.waitForTransaction({ transactionHash: committedTxn.hash });
console.log(`Committed transaction: ${committedTxn.hash}`);