Initialize Token Account
Creating a token account from Solana Proxy Account for each x-chain users.
const owner = "0x91845D534744Ef350695CF98393d23acC9639024";
const tokenAddress = "<evm token address>"
const sourceChain = CHAIN_ID_BSC;
const targetChain = CHAIN_ID_SOLANA;
const tokenAddrInSolana = await getTargetAsset(
signer,
tokenAddress,
sourceChain,
targetChain
)
const proxyAccount = ZebecSolBridgeClient.getProxyUserKey(
tryNativeToUint8Array(owner, sourceChain),
sourceChain,
SOL_ZEBEC_BRIDGE_ADDRESS
);
const ethClient = new ZebecEthBridgeClient(BSC_ZEBEC_BRIDGE_ADDRESS, signer, sourceChain);
const receipt = await ethClient.createTokenAccount(owner, tokenAddrInSolana);Last updated