@somnia-chain/markets-sdk


@somnia-chain/markets-sdk / index / ExchangeBridge

Interface: ExchangeBridge

Defined in: packages/sdk/src/unified/bridge.ts:89

The bridge, reached as exchange.bridge: plan and execute transfers between the exchange's own chains through the account's executors.

Methods

plan()

plan(params): BridgeTransfer

Defined in: packages/sdk/src/unified/bridge.ts:95

Plan a transfer between two configured chains — pure, nothing sent. Throws NotConfiguredError when either chain is not one of the exchange's, InvalidInputError when the token has no route between them.

Parameters

params

ExchangeBridgeParams

Returns

BridgeTransfer


transfer()

transfer(params, options?): Promise<ExchangeBridgeResult>

Defined in: packages/sdk/src/unified/bridge.ts:108

Plan and execute: the origin legs go through the origin chain's executor (a safe packs approval and bridge into one transaction), then delivery is awaited on the destination engine's socket.

Gotchas

  • Throws NotConfiguredError - a chain outside the exchange, or no executor for the origin chain.
  • Throws ContractRevertError - an origin leg reverted.
  • Resolves with delivered: false when the destination event was not seen within the timeout — the transfer may still land; it is not undone.

Parameters

params

ExchangeBridgeParams

options?

ExchangeBridgeTransferOptions

Returns

Promise<ExchangeBridgeResult>