Method Signature
align.blockchain.transactions.sendNativeToken(
wallet: Wallet,
to: string,
amount: string,
network: Network
): Promise<Transaction>
Parameters
The sender’s wallet (must have private key)
Amount to send in human-readable format (e.g., "0.1")
Network: ethereum, polygon, base, arbitrum, optimism
Returns
Returns a Transaction object with:
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 0.1 POL on Polygon
const tx = await align.blockchain.transactions.sendNativeToken(
wallet,
"0xRecipientAddress...",
"0.1",
"polygon"
);
console.log(`TX Hash: ${tx.hash}`);
// Wait for confirmation
const receipt = await align.blockchain.transactions.waitForConfirmation(
tx.hash,
"polygon"
);
console.log(`Confirmed in block ${receipt.blockNumber}`);
const tx = await align.blockchain.transactions.sendNativeToken(
wallet,
recipient,
"0.5",
"ethereum"
);
console.log("TX Hash:", tx.hash);
Ensure the wallet has sufficient balance to cover both the amount and gas
fees.