Allbridge Core
LAUNCH APP
  • What is Allbridge Core?
  • ⚪Product
    • How does Allbridge Core work?
      • Fees
      • Messaging protocols
      • Allbridge Core contracts
      • Token value
      • Liquidity provision
    • FAQ
      • How to bridge with Allbridge Core via mobile TronLink
      • Allbridge Core guide
      • How to provide liquidity?
      • What is an Approve Transaction?
    • Security audits
    • Ecosystem reports
    • Leaderboard
  • ⚪Allbridge Core SDK
    • Get started
    • Guides
      • General
        • Token info
        • Send
        • Swap
        • Paying fees with stables
      • EVM
        • Transfer
        • Allowance and approve
      • Solana
        • Transfer
        • Swap
      • Tron
      • Stellar
        • Transfer
      • Utilities
        • Amount and fee calculations
        • Transfer time
        • Extra gas limits
    • Technical reference
    • Referral program
    • Allbridge Core REST API
  • ⚪official support
    • Telegram
    • Discord
  • ⚪Social links
    • Twitter
    • Discord
    • Telegram announcements
    • Telegram group
    • Medium
    • Reddit
  • ⚪Allbridge ecosystem
    • Allbridge Classic
    • Allbridge BaaS
Powered by GitBook
On this page

Was this helpful?

  1. Allbridge Core SDK
  2. Guides
  3. Solana

Transfer

Initiate raw transaction for the token transfer with this SDK instance:

// initiate transfer using Messenger.WORMHOLE
const transaction = (await sdk.bridge.rawTxBuilder.send({
  amount: "0.2",
  fromAccountAddress: fromAddress,
  toAccountAddress: toAddressPol,
  sourceToken: sourceTokenInfo,
  destinationToken: destinationTokenInfoPol,
  messenger: Messenger.WORMHOLE,
  txFeeParams: {
    solana: SolanaAutoTxFee,
  },
})) as RawBridgeSolanaTransaction;

const keypair = solanaWeb3.Keypair.fromSecretKey(bs58.decode(privateKey));
transaction.sign([keypair]);

const connection = new solanaWeb3.Connection(nodeUrlsDefault.solanaRpcUrl, "confirmed");
const txId = await connection.sendTransaction(transaction);
console.log(`https://explorer.solana.com/tx/${txId}`);
PreviousSolanaNextSwap

Last updated 11 months ago

Was this helpful?

⚪
Allbrdige and Wormhole messaging full example