Method Signature
align.blockchain.nfts.transferERC1155(
wallet: Wallet,
contractAddress: string,
to: string,
tokenId: string,
amount: string,
network: Network
): Promise<TransactionResponse>
Parameters
ERC-1155 contract address
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!
);
// Transfer 5 of token ID 42
const tx = await align.blockchain.nfts.transferERC1155(
wallet,
"0xERC1155ContractAddress...",
"0xRecipientAddress...",
"42", // Token ID
"5", // Amount to transfer
"polygon"
);
console.log(`TX Hash: ${tx.hash}`);
await tx.wait();
console.log("Tokens transferred!");
const tx = await align.blockchain.nfts.transferERC1155(
wallet,
contract,
recipient,
tokenId,
"10",
"polygon"
);
await tx.wait();
ERC-1155 is commonly used for gaming items, where you might have 100 copies of
a “sword” token.