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}`);
Last updated on