Class: GalaConnectClient
GalaChain core SDK 1.0.0-rc.8 / bridge / GalaConnectClient
Class: GalaConnectClient
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1497
GalaConnect API client
Handles all HTTP communication with the GalaConnect bridge API.
Constructors
Constructor
new GalaConnectClient(
config):GalaConnectClient
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1518
Creates a new GalaConnect client.
Parameters
config
Client configuration (httpRequestor defaults to the global fetch).
walletAddress is sent (the X-Wallet-Address header, the gateway balance read's owner)
in the gateway's spelling: an Ethereum account in any form as eth|<checksummed>, a client|
alias as written; '' is a client with no wallet (the public token lists).
Returns
GalaConnectClient
Throws
GalaSDKError INVALID_TIMEOUT for a requestTimeoutMs that is not a positive number
of milliseconds or Infinity; INVALID_BRIDGE_OPTION (baseUrl, galachainBaseUrl) for a
URL that is not http(s); (requestsPerSecond) for a rate that is not above zero;
INVALID_WALLET_ADDRESS (walletAddress) for a wallet address that is no user reference
Methods
bridgeTokenOut()
bridgeTokenOut(
payload):Promise<BridgeTokenOutResponse>
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1582
Execute bridge token out (generate wormhole message).
This is the second step in the bridge out process. Called after RequestBridgeOut succeeds.
Parameters
payload
Record<string, unknown>
Bridge token out parameters
Returns
Promise<BridgeTokenOutResponse>
Response with wormhole message data
fetchBalances()
fetchBalances(
channel?):Promise<FetchBalancesResponse>
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1606
Fetch token balances for the wallet.
Parameters
channel?
string
Token channel (default: 'asset')
Returns
Promise<FetchBalancesResponse>
Balance response with token holdings
fetchBridgeFee()
fetchBridgeFee(
payload):Promise<BridgeFeeResponse>
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1558
Fetch bridge fee estimate for a token transfer.
Parameters
payload
Fee request parameters
bridgeToken
chainId
string
Returns
Promise<BridgeFeeResponse>
Fee estimate with breakdown
getBaseUrl()
getBaseUrl():
string
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1524
Get the base URL for constructing status URLs.
Returns
string
The GalaConnect API base URL
getBridgeConfigurations()
getBridgeConfigurations(
searchPrefix):Promise<BridgeConfigurationToken[]>
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1537
Get bridge configurations for tokens matching a prefix.
Returns detailed token information including:
- Token class key (collection, category, type, additionalKey)
- Supported bridge routes
- External network contract addresses
Parameters
searchPrefix
string
Token symbol prefix to search (e.g., 'GALA', 'GUS')
Returns
Promise<BridgeConfigurationToken[]>
Array of matching token configurations
Throws
GalaSDKError BRIDGE_READ_RESPONSE_INVALID unless the answer has data.tokens (an array)
getBridgeStatus()
getBridgeStatus(
hash):Promise<BridgeStatusResponse>
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1589
Get the status of a bridge transaction.
Parameters
hash
string
Transaction hash to check
Returns
Promise<BridgeStatusResponse>
Current status with details
registerBridgeTransaction()
registerBridgeTransaction(
payload):Promise<BridgeTransactionRegistrationResponse>
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1599
Register a bridge transaction (for External → GalaChain transfers).
Called after depositing tokens to the bridge contract on the external chain. Notifies GalaConnect to process the inbound transfer.
Parameters
payload
Record<string, unknown>
Transaction registration data
Returns
Promise<BridgeTransactionRegistrationResponse>
Registration response
request()
request<
T>(config):Promise<T>
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1547
A GET of the DEX API platform (baseUrl): url with params as its query, the JSON answer
(a DexApiReader, which the token services read the token lists through). A read: a failure
is GALACONNECT_HTTP_ERROR, TRANSPORT_ERROR, REQUEST_TIMEOUT or, for an answer that is
not JSON, BRIDGE_READ_RESPONSE_INVALID, each with write: false.
Type Parameters
T
T
Parameters
config
The path and its query
method
"GET"
params
Record<string, string | number | boolean>
url
string
Returns
Promise<T>
The parsed JSON answer (undefined for an empty one)
requestBridgeOut()
requestBridgeOut(
payload):Promise<RequestBridgeOutResponse>
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:1572
Request token bridge out (initiate GalaChain → External transfer).
This is the first step in the bridge out process:
- RequestBridgeOut - Lock tokens on GalaChain
- BridgeTokenOut - Generate wormhole message
Parameters
payload
Record<string, unknown>
Bridge out request parameters
Returns
Promise<RequestBridgeOutResponse>
Response with transaction data