Skip to content
๐ŸŽ‰ Welcome! Translations are currently experimental. | ็ฟป่จณใฏ็พๅœจๅฎŸ้จ“็š„ใงใ™ใ€‚ | ็ฟป่ฏ‘็›ฎๅ‰ๅค„ไบŽๅฎž้ชŒ้˜ถๆฎตใ€‚
Click here to submit feedback! | ใ“ใ“ใ‚’ใ‚ฏใƒชใƒƒใ‚ฏใ—ใฆใƒ•ใ‚ฃใƒผใƒ‰ใƒใƒƒใ‚ฏใ‚’้€ไฟกใ—ใฆใใ ใ•ใ„๏ผ | ็‚นๅ‡ป่ฟ™้‡Œๆไบคๅ้ฆˆ๏ผ
BuildSDKsTypeScript SDK

TypeScript SDK

Github Repo Stars

NPM Version

Static Badge

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

Transfer 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}`);