Skip to main content

Abstract Class: BaseBridgeStrategy

GalaChain core SDK 1.0.0-rc.8


GalaChain core SDK 1.0.0-rc.8 / bridge / BaseBridgeStrategy

Abstract Class: BaseBridgeStrategy

Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1737

Base class providing common functionality for bridge strategies.

Concrete strategies extend this class and implement chain-specific logic.

Implements​

Properties​

network​

abstract readonly network: ExternalNetwork

Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1738

The external network this strategy handles.

Implementation of​

BridgeStrategy.network

Methods​

bridgeIn()​

abstract bridgeIn(params): Promise<BridgeTransaction>

Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1747

Bridge tokens IN from external chain to GalaChain.

Flow:

  1. Approve bridge contract (if needed)
  2. Deposit tokens to bridge contract
  3. Register the deposit with GalaConnect
  4. Receive native tokens on GalaChain

Parameters​

params​

BridgeInParams

Bridge in parameters

Returns​

Promise<BridgeTransaction>

Transaction details with tracking info

Implementation of​

BridgeStrategy.bridgeIn


bridgeOut()​

abstract bridgeOut(params): Promise<BridgeTransaction>

Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1746

Bridge tokens OUT from GalaChain to external chain.

Flow:

  1. Lock tokens on GalaChain (via GalaConnect)
  2. Wait for bridge confirmation
  3. Receive wrapped tokens on external chain

Parameters​

params​

BridgeOutParams

Bridge out parameters

Returns​

Promise<BridgeTransaction>

Transaction details with tracking info

Implementation of​

BridgeStrategy.bridgeOut


estimateFee()​

abstract estimateFee(tokenSymbol): Promise<BridgeFeeEstimate>

Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1745

Estimate bridge fees for a transfer (a per-transfer cost: it does not depend on the amount).

Parameters​

tokenSymbol​

string

Token symbol (e.g., 'GALA', 'GUSDC')

Returns​

Promise<BridgeFeeEstimate>

Fee estimate with breakdown

Implementation of​

BridgeStrategy.estimateFee


getStatus()​

abstract getStatus(transactionHash): Promise<BridgeStatus>

Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1748

Get the current status of a bridge transaction.

Parameters​

transactionHash​

string

The bridge transaction hash

Returns​

Promise<BridgeStatus>

Current status with details

Implementation of​

BridgeStrategy.getStatus


getSupportedTokens()​

abstract getSupportedTokens(): string[]

Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1749

Get the list of supported tokens for this chain.

Returns​

string[]

Array of token symbols supported by this bridge

Implementation of​

BridgeStrategy.getSupportedTokens


isTokenSupported()​

abstract isTokenSupported(tokenSymbol): boolean

Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1750

Check if a specific token is supported for bridging.

Parameters​

tokenSymbol​

string

Token symbol to check

Returns​

boolean

True if token can be bridged

Implementation of​

BridgeStrategy.isTokenSupported


isValidAddress()​

abstract isValidAddress(address): boolean

Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1751

Validate a recipient address for the external chain.

Parameters​

address​

string

Address to validate

Returns​

boolean

True if address is valid for this chain

Implementation of​

BridgeStrategy.isValidAddress


waitForCompletion()​

waitForCompletion(transactionHash, options?): Promise<BridgeStatus>

Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1758

Default implementation of waitForCompletion with polling.

Strategies can override this if they have chain-specific event subscription capabilities.

Parameters​

transactionHash​

string

options?​

WaitOptions

Returns​

Promise<BridgeStatus>

Implementation of​

BridgeStrategy.waitForCompletion