Prerequisites
- Node.js >= 24 installed
- Basic understanding of TypeScript/JavaScript
- A code editor (VS Code recommended)
Installation
First, install the SDK:Basic Setup
Create a new TypeScript file and import the required modules:Complete Working Example
Here’s a complete example that connects to the network, requests tokens from the faucet, and transfers IOTA:Step-by-Step Breakdown
1. Connect to the Network
getFullnodeUrl() helper provides default URLs for:
'localnet'-http://127.0.0.1:9000'devnet'-https://api.devnet.iota.cafe
2. Generate a Keypair
3. Request Tokens
4. Build a Transaction
- Splits 1000 NANOS from the gas coin
- Transfers it to the specified address
5. Execute the Transaction
Network Options
Connect to different networks:- Devnet
- Testnet
- Localnet
- Custom
Common Operations
Get Coins
Get Objects
Get Transaction Details
Next Steps
Client Setup
Learn more about configuring the IotaClient
Transactions
Deep dive into transaction building
Reading Data
Query blockchain data
Examples
Explore more code examples