PixelBridge Core
  • What is PixelBridge Core?
  • ⚪PRODUCT
    • How does PixelBridge Core work?
      • Fees
      • Messaging protocols
      • PixelBridge Core contracts
      • Token value
      • Liquidity provision
    • PixelBridge Core guide
    • How to provide liquidity?
    • How to bridge with PixelBridge Core via mobile TronLink
    • Security audit
  • ⚪PixelBridge CORE SDK
    • Get started
    • Guides
      • General
        • Token info
        • Send
        • Swap
        • Paying fees with stables
      • EVM
        • Transfer
        • Allowance and approve
      • Solana
        • Transfer
        • Swap
      • Stellar
        • Transfer
      • Utilities
        • Amount and fee calculations
        • Transfer time
        • Extra gas limits
  • ⚪SOCIAL LINKS
    • Twtter
    • Telegram
    • Medium
  • ⚪PixelBridge ECOSYSTEM
    • PixelBridge Classic
    • PixelBridge BaaS
Powered by GitBook
On this page
  1. ⚪PixelBridge CORE SDK
  2. Guides
  3. General

Paying fees with stables

By default you the transaction charges fee in network's gas tokens, but you may opt into paying fees with stables instead:

For this you have to use getGasFeeOptions metod

const gasFeeOptions = await sdk.getGasFeeOptions(sourceTokenInfo, destinationTokenInfo, Messenger..PixelBridge;
const gasFeeAmount = gasFeeOptions[FeePaymentMethod.WITH_STABLECOIN];

// initiate transfer
const rawTransactionTransfer = await sdk.bridge.rawTxBuilder.send(
  {
    amount: totalAmountFloat,
    fromAccountAddress: fromAddress,
    toAccountAddress: toAddress,
    sourceToken: sourceTokenInfo,
    destinationToken: destinationTokenInfo,
    messenger: Messenger.PixelBridge,
    gasFeePaymentMethod: FeePaymentMethod.WITH_STABLECOIN,
    fee: gasFeeAmount.int,
  }
);
PreviousSwapNextEVM

Last updated 12 months ago