Package Information
- Package Name:
@iota/iota-sdk - Current Version: 1.11.0
- License: Apache-2.0
- Repository: github.com/iotaledger/iota
- Documentation: docs.iota.org/developer/ts-sdk/typescript
Module Exports
The SDK is organized into modular exports for different functionality:Client Module
IotaClient- Main client for interacting with the IOTA networkIotaHTTPTransport- HTTP transport layer
getFullnodeUrl(network)- Get default RPC URLs for networks
'localnet', 'devnet', 'testnet'
Transactions Module
Transaction- Transaction builder for creating and managing transactionsTransactionDataBuilder- Low-level transaction data builder
transferObjects(objects, recipient)- Transfer objectssplitCoins(coin, amounts)- Split coinsmergeCoins(destination, sources)- Merge coinsmoveCall(params)- Call Move functionspublish(params)- Publish Move packagesmakeMoveVec(params)- Create Move vectors
Keypair Modules
Ed25519
Ed25519Keypair- Ed25519 signature scheme keypairEd25519PublicKey- Ed25519 public key
Ed25519Keypair.generate()- Generate random keypairEd25519Keypair.fromSecretKey(key)- Create from secret keyEd25519Keypair.deriveKeypair(mnemonic, path)- Derive from mnemonic
m/44'/4218'/0'/0'/0'
Secp256k1
Secp256k1Keypair- Secp256k1 signature scheme keypairSecp256k1PublicKey- Secp256k1 public key
m/54'/4218'/0'/0/0
Secp256r1
Secp256r1Keypair- Secp256r1 signature scheme keypairSecp256r1PublicKey- Secp256r1 public key
m/74'/4218'/0'/0/0
Multisig Module
MultiSigPublicKey- Multi-signature public keyMultiSigSigner- Signer for multisig transactions
MAX_SIGNER_IN_MULTISIG- Maximum signers (10)MIN_SIGNER_IN_MULTISIG- Minimum signers (1)
Faucet Module
requestIotaFromFaucetV0(params)- Request tokens from faucetgetFaucetHost(network)- Get faucet URL for network
GraphQL Module
IotaGraphQLClient- GraphQL client for advanced queriesIotaGraphQLRequestError- GraphQL request error
BCS Module
Cryptography Module
generateMnemonic(wordCount?)- Generate BIP39 mnemonicisValidMnemonics(mnemonic)- Validate mnemonic phrasemnemonicToSeed(mnemonic)- Convert mnemonic to seed
Signer- Base signer interfacePublicKey- Base public key classKeypair- Base keypair class
Utils Module
isValidIotaAddress(address)- Validate IOTA addressisValidIotaObjectId(objectId)- Validate object IDnormalizeIotaAddress(address)- Normalize address to 0x-prefixed hexnormalizeIotaObjectId(objectId)- Normalize object IDformatBalance(balance, decimals)- Format balance for display
Verify Module
verifyTransactionSignature(bytes, signature)- Verify transaction signaturepublicKeyFromRawBytes(scheme, bytes)- Create public key from bytes
IotaClient API Methods
Query Methods
Objects
getObject(params)- Get single objectmultiGetObjects(params)- Get multiple objectsgetOwnedObjects(params)- Get objects owned by addressgetDynamicFields(params)- Get dynamic fieldsgetDynamicFieldObject(params)- Get dynamic field object
Coins
getCoins(params)- Get coins by typegetAllCoins(params)- Get all coinsgetBalance(params)- Get coin balancegetAllBalances(params)- Get all balancesgetCoinMetadata(params)- Get coin metadatagetTotalSupply(params)- Get total coin supply
Transactions
getTransaction(params)- Get transaction by digestmultiGetTransactions(params)- Get multiple transactionsqueryTransactions(params)- Query transactions with filters
Events
queryEvents(params)- Query eventssubscribeEvent(params)- Subscribe to events (WebSocket)subscribeTransaction(params)- Subscribe to transactions
Checkpoints
getCheckpoint(params)- Get checkpoint by IDgetCheckpoints(params)- Get checkpoints with paginationgetLatestCheckpointSequenceNumber()- Get latest checkpoint number
Network
getProtocolConfig(params?)- Get protocol configurationgetChainIdentifier()- Get chain identifiergetReferenceGasPrice()- Get reference gas price
Move
getMoveFunctionArgTypes(params)- Get function argument typesgetNormalizedMoveFunction(params)- Get normalized functiongetNormalizedMoveModule(params)- Get normalized modulegetNormalizedMoveModulesByPackage(params)- Get all modules in packagegetNormalizedMoveStruct(params)- Get normalized struct
Transaction Execution
signAndExecuteTransaction(params)- Sign and execute transactionexecuteTransaction(params)- Execute pre-signed transactiondryRunTransactionBlock(params)- Simulate transactiondevInspectTransactionBlock(params)- Inspect transaction effects
Custom RPC
call(method, params)- Make custom RPC call
Type Definitions
The SDK includes comprehensive TypeScript type definitions for all APIs.Common Types
TypeDoc Documentation
For detailed API documentation with all types and interfaces, visit:- Latest Release: TypeScript SDK TypeDoc
- Main Branch: Build locally with
pnpm docand opendoc/index.html
JSON-RPC API Reference
For the underlying JSON-RPC API reference:Examples
For complete code examples demonstrating these APIs:Examples
See complete code examples
Quick Start
Get started with basic usage
Version Compatibility
Release Cycle:- SDK releases bi-weekly in sync with Devnet validators
- Use
@iota/iota-sdk@experimentalfor latest changes from main branch - Use
@iota/iota-sdk@latestfor stable releases
Support and Resources
- GitHub: github.com/iotaledger/iota
- Issues: GitHub Issues
- Documentation: docs.iota.org
- NPM: @iota/iota-sdk
Next Steps
Installation
Install the SDK
Quick Start
Get started quickly
Examples
Complete examples