BridgeClient provides methods to construct unsigned bridge transactions

Constructors

Methods

  • Create Kaspa deposit payload (not full transaction)

    Since Kaspa has no smart contracts, this creates a Hyperlane message payload that must be included in a Kaspa transaction to the escrow address.

    Parameters

    • params: { amount: bigint; hubRecipient: string }

      Deposit parameters

    Returns Uint8Array

    Serialized Hyperlane message bytes to include in Kaspa tx

  • Create forwarding memo for RollApp -> EVM via EIBC

    Creates the JSON memo to include in an IBC MsgTransfer from RollApp that will be forwarded via Hyperlane after arriving on Hub.

    Parameters

    • params: {
          amount: string;
          destinationDomain: number;
          eibcFee: string;
          maxFee: { amount: string; denom: string };
          recipient: string;
          tokenId: string;
      }

      Forwarding parameters

    Returns string

    JSON memo string to include in IBC MsgTransfer

  • Estimate all fees for a bridge transfer

    Calculates approximate fees for different transfer scenarios:

    • Bridging fee (protocol fee, fetched dynamically or default 0.1%)
    • EIBC fee for RollApp withdrawals (if applicable)
    • IGP fee for Hyperlane gas costs (fetched dynamically)
    • Transaction fee on source chain (estimated)

    Parameters

    • params: EstimateFeesParams

      Fee estimation parameters

    Returns Promise<FeeBreakdown>

    Breakdown of all fees and recipient amount

  • Get the resolved configuration

    Returns ResolvedConfig

  • Create unsigned transaction for EVM -> Hub transfer

    Parameters

    • params: EvmToHubParams

    Returns Promise<PopulatedTransaction>

  • Create unsigned transaction for Hub -> EVM transfer

    Uses MsgRemoteTransfer for the native Hyperlane warp module.

    Parameters

    • params: HubToEvmParams

    Returns Promise<MsgRemoteTransfer>

  • Create unsigned transaction for Hub -> Kaspa transfer

    Uses MsgRemoteTransfer for the Hyperlane warp module (native SDK message). Requires IGP fee payment via the KAS IGP hook.

    Parameters

    • params: { amount: bigint; igpFee: bigint; kaspaRecipient: string; sender: string }
      • amount: bigint
      • igpFee: bigint

        IGP fee in KAS denom (get from FeeProvider.quoteIgpPayment)

      • kaspaRecipient: string
      • sender: string

    Returns Promise<MsgRemoteTransfer>

  • Create unsigned transaction for Hub -> Solana transfer

    Uses MsgRemoteTransfer for the native Hyperlane warp module. Requires IGP fee payment via the token-specific IGP hook.

    Parameters

    • params: HubToSolanaParams

    Returns Promise<MsgRemoteTransfer>

  • Create unsigned transaction for Solana -> Hub transfer

    Parameters

    • params: SolanaToHubParams

    Returns Promise<unknown>

  • Create an unsigned transfer transaction using chain and token symbols

    This high-level method automatically:

    • Looks up token addresses from the registry
    • Converts addresses to the appropriate format
    • Routes through Hub if needed for cross-chain transfers
    • Constructs the appropriate transaction type

    Parameters

    Returns Promise<TransferResult>

    // EVM to Hub
    const result = await client.transfer({
    from: 'ethereum',
    to: 'dymension',
    token: 'KAS',
    amount: 100000000n,
    recipient: 'dym1abc...',
    sender: '0x123...',
    });

    // Hub to Kaspa
    const result = await client.transfer({
    from: 'dymension',
    to: 'kaspa',
    token: 'KAS',
    amount: 100000000n,
    recipient: 'kaspa:qz...',
    sender: 'dym1abc...',
    });