Method Signature
align.blockchain.wallets.sendToken(
wallet: Wallet,
token: string,
to: string,
amount: string,
network: Network
): Promise<Transaction>
Parameters
The sender’s wallet object (with private key)
Token contract address or identifier (usdc, usdt)
Amount to send (e.g., "100.00" for 100 USDC)
Network: ethereum, polygon, base, arbitrum
Returns
Examples
import Align from "@tolbel/align";
const align = new Align({
apiKey: process.env.ALIGN_API_KEY!,
environment: "sandbox",
});
const wallet = await align.blockchain.wallets.createFromPrivateKey(
process.env.PRIVATE_KEY!
);
// Send 50 USDC on Polygon
const tx = await align.blockchain.wallets.sendToken(
wallet,
"usdc",
"0xRecipientAddress...",
"50.00",
"polygon"
);
console.log(`TX Hash: ${tx.hash}`);
// Wait for confirmation
const receipt = await align.blockchain.transactions.waitForConfirmation(
tx.hash,
"polygon"
);
console.log(`Sent 50 USDC in block ${receipt.blockNumber}`);
const tx = await align.blockchain.wallets.sendToken(
wallet,
"usdc",
"0xRecipient...",
"50.00",
"polygon"
);
console.log("TX Hash:", tx.hash);
Using Contract Address
// Custom token by contract address
const DAI_POLYGON = "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063";
const tx = await align.blockchain.wallets.sendToken(
wallet,
DAI_POLYGON,
recipient,
"100.00",
"polygon"
);
Token transfers require native tokens for gas fees. Ensure the wallet has both
the tokens to send AND native tokens for gas.