For the complete documentation index, see llms.txt. This page is also available as Markdown.

Transfer

Stellar transfers are temporarily unavailable while the Stellar CCTP implementation is pending audit.

Tokens and parameters are compiled in the same way as for other chains:

const sdk = new AllbridgeCoreSdk(nodeRpcUrlsDefault);

const chainDetailsMap = await sdk.chainDetailsMap();
const sourceToken = chainDetailsMap[ChainSymbol.SRB].tokens.find((t) => t.symbol == "USDC");
const destinationToken = chainDetailsMap[ChainSymbol.ETH].tokens.find((t) => t.symbol == "USDC");
const amount = "2";
const sendParams: SendParams = {
  amount,
  fromAccountAddress: fromAddress,
  toAccountAddress: toAddress,
  sourceToken,
  destinationToken,
  messenger: Messenger.CCTP,
  extraGas: "1.15",
  extraGasFormat: AmountFormat.FLOAT,
  gasFeePaymentMethod: FeePaymentMethod.WITH_STABLECOIN,
};
const xdrTx: string = (await sdk.bridge.rawTxBuilder.send(sendParams)) as string;

Simulate the transaction before sending it. If some data is archived on Stellar, you have to restore it before sending the transaction. The simulation method can return a restore transaction, in this case, you have to send it first:

Then you have to send the main transaction. Please note that if you send a restore transaction before, the transaction sequence will be changed, and you have to recompile it:

Finally, if you make a transfer to Stellar, you have to ensure that you have trustlines for the destination token. Use the example below to check for the trustline/create it:

Full example

Last updated