Algorand
Initiating transfers to Algorand is the same as for the other chains, you have to use chain symbol ChainSymbol.ALG as a destination chain. Make sure that the recipient wallet address opted in to receive the token (read more here).
To send transfers from Algorand you have to initialize Allbridge Core SDK with Algorand node URL.
const sdk = new AllbridgeCoreSdk({ ...nodeRpcUrlsDefault, ALG: getEnvVar("ALG_PROVIDER_URL") });After the SDK is initialized you can create a token send transaction.
const rawTransactionTransfer = (await sdk.bridge.rawTxBuilder.send({
amount: amount,
fromAccountAddress: fromAddress,
toAccountAddress: toAddress,
sourceToken: sourceToken,
destinationToken: destinationToken,
messenger: Messenger.ALLBRIDGE,
// gasFeePaymentMethod: FeePaymentMethod.WITH_STABLECOIN
})) as RawAlgTransaction;
const txId = await sendAlgRawTransaction(rawTransactionTransfer);You can construct transaction to pay the relayer fee either from the body of the transfer itself or with ALGO token (by specifying gasFeePaymentMethod parameter.
In the example above the signing and sending of transaction is within the sendAlgRawTransaction function. You can check out the full code in our examples:
Sending transfers from Algorand: https://github.com/allbridge-io/allbridge-core-js-sdk/blob/main/examples/src/examples/bridge/alg/alg-build-send-tx.ts
Last updated