Skip to main content

Class: EthereumBridgeStrategy

GalaChain core SDK 1.0.0-rc.8


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

Class: EthereumBridgeStrategy

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

Bridge strategy for GalaChain ↔ Ethereum transfers.

Supports 6 tokens: GALA, GWETH, GUSDC, GUSDT, GWTRX, GWBTC

Extends​

Constructors​

Constructor​

new EthereumBridgeStrategy(config): EthereumBridgeStrategy

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

Creates a new Ethereum bridge strategy.

Parameters​

config​

EthereumBridgeConfig

Strategy configuration

Returns​

EthereumBridgeStrategy

Throws​

GalaSDKError INVALID_PRIVATE_KEY if ethereumPrivateKey is not 0x and 64 hex digits; INVALID_BRIDGE_OPTION (the option) for a bridge contract or wallet address that is not an Ethereum address (the contract is required), or an RPC URL that is not http(s)

Overrides​

ConfiguredBridgeStrategy<EthereumTokenConfig>.constructor

Properties​

network​

readonly network: ExternalNetwork

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

Overrides​

ConfiguredBridgeStrategy.network


ETHEREUM_FINALITY_THRESHOLD​

readonly static ETHEREUM_FINALITY_THRESHOLD: 12 = 12

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

Ethereum finality threshold (number of confirmations). 12+ confirmations is the practical finality threshold for Ethereum mainnet.

Methods​

bridgeIn()​

bridgeIn(params): Promise<BridgeTransaction>

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

Bridge tokens from Ethereum to GalaChain.

Parameters​

params​

BridgeInParams

Bridge in parameters

Returns​

Promise<BridgeTransaction>

Transaction details

Throws​

GalaSDKError before the deposit is sent: the input's refusal, BRIDGE_CHAIN_READ_FAILED, INSUFFICIENT_BRIDGE_BALANCE; once it is being sent: BRIDGE_DEPOSIT_OUTCOME_UNKNOWN

Overrides​

ConfiguredBridgeStrategy.bridgeIn


bridgeOut()​

bridgeOut(params): Promise<BridgeTransaction>

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

Bridge tokens from GalaChain to Ethereum.

Parameters​

params​

BridgeOutParams

Bridge out parameters

Returns​

Promise<BridgeTransaction>

Transaction details

Overrides​

ConfiguredBridgeStrategy.bridgeOut


estimateFee()​

estimateFee(tokenSymbol): Promise<BridgeFeeEstimate>

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

Estimate bridge fees for a transfer to Ethereum.

Parameters​

tokenSymbol​

string

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

Returns​

Promise<BridgeFeeEstimate>

Fee estimate with breakdown (it does not depend on the amount)

Overrides​

ConfiguredBridgeStrategy.estimateFee


getEthereumNativeBalance()​

getEthereumNativeBalance(address?): Promise<string>

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

Get native ETH balance for an Ethereum address.

Parameters​

address?​

string

Optional Ethereum address (defaults to configured wallet)

Returns​

Promise<string>

ETH balance as decimal string (18 decimals)

Throws​

GalaSDKError INVALID_WALLET_ADDRESS if address invalid


getEthereumTokenBalance()​

getEthereumTokenBalance(tokenSymbol, address?): Promise<string>

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

Get ERC-20 token balance for an Ethereum address.

Parameters​

tokenSymbol​

string

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

address?​

string

Optional Ethereum address (defaults to configured wallet)

Returns​

Promise<string>

Token balance as decimal string (e.g., "123.45678901")

Throws​

GalaSDKError UNSUPPORTED_BRIDGE_TOKEN, INVALID_WALLET_ADDRESS, BRIDGE_CHAIN_READ_FAILED


getEthereumTransactionStatus()​

getEthereumTransactionStatus(transactionHash): Promise<EthereumTransactionStatus>

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

Get the status of an Ethereum transaction by hash.

Queries Ethereum RPC directly using getTransactionReceipt() and getTransaction(). An RPC failure is answered as not_found with the failure in error.

Parameters​

transactionHash​

string

Ethereum transaction hash (0x-prefixed, 64 hex characters)

Returns​

Promise<EthereumTransactionStatus>

Transaction status with confirmation details

Throws​

GalaSDKError INVALID_TRANSACTION_HASH if hash format is invalid


getStatus()​

getStatus(transactionHash): Promise<BridgeStatus>

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

Get the current status of a bridge transaction.

Parameters​

transactionHash​

string

Transaction hash to check.

Returns​

Promise<BridgeStatus>

Current bridge status.

Inherited from​

ConfiguredBridgeStrategy.getStatus


getSupportedTokens()​

getSupportedTokens(): string[]

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

Get the configured symbols supported by this strategy.

Returns​

string[]

Supported token symbols.

Inherited from​

ConfiguredBridgeStrategy.getSupportedTokens


getWalletAddress()​

getWalletAddress(): string

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

Get the configured Ethereum wallet address.

Returns​

string

Ethereum wallet address (0x format)


isTokenSupported()​

isTokenSupported(tokenSymbol): boolean

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

Check whether a token symbol is configured for this strategy.

Parameters​

tokenSymbol​

string

Token symbol to check.

Returns​

boolean

True when the token is configured.

Inherited from​

ConfiguredBridgeStrategy.isTokenSupported


isValidAddress()​

isValidAddress(address): boolean

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

Validate an Ethereum address.

Parameters​

address​

string

Address to validate

Returns​

boolean

True if 0x and 40 hex digits

Overrides​

ConfiguredBridgeStrategy.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>

Inherited from​

ConfiguredBridgeStrategy.waitForCompletion