Class: BridgeableTokenService
GalaChain core SDK 1.0.0-rc.8 / bridge / BridgeableTokenService
Class: BridgeableTokenService
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:2014
Service for the tokens bridgeable to Ethereum and Solana.
Reads go through a DexApiReader (a GalaConnectClient, or launchpad-sdk's DEX API
HttpClient). Failures are GalaSDKErrors: BRIDGE_READ_RESPONSE_INVALID for an answer
without a token list, INVALID_TOKEN_REFERENCE for a token id that is not one, and the read's
own (GALACONNECT_HTTP_ERROR, TRANSPORT_ERROR, ...).
Constructors
Constructor
new BridgeableTokenService(
dexApi):BridgeableTokenService
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:2020
Parameters
dexApi
Reads the DEX API platform's token list
Returns
BridgeableTokenService
Methods
clearCache()
clearCache(
network?):void
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:2073
Forget the cached tokens of network, or of every network.
Parameters
network?
Returns
void
fetchAllBridgeableTokensByNetwork()
fetchAllBridgeableTokensByNetwork(
network):Promise<FetchBridgeableTokensResult>
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:2043
Fetch every token bridgeable to a network (every page), or the cached ones.
Parameters
network
ETHEREUM or SOLANA
Returns
Promise<FetchBridgeableTokensResult>
fetchAllTokensBridgeableToEthereum()
fetchAllTokensBridgeableToEthereum():
Promise<FetchBridgeableTokensResult>
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:2045
Every token bridgeable to Ethereum.
Returns
Promise<FetchBridgeableTokensResult>
fetchAllTokensBridgeableToSolana()
fetchAllTokensBridgeableToSolana():
Promise<FetchBridgeableTokensResult>
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:2047
Every token bridgeable to Solana.
Returns
Promise<FetchBridgeableTokensResult>
fetchBridgeableTokensByNetwork()
fetchBridgeableTokensByNetwork(
options):Promise<FetchBridgeableTokensResult>
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:2037
Fetch one page of the tokens bridgeable to a network. Not cached: the cache holds only the full list (a page standing in for it would hide every token on the other pages).
Parameters
options
Network, offset (default 0) and limit (default and at most 1000)
Returns
Promise<FetchBridgeableTokensResult>
getCacheStats()
getCacheStats():
BridgeableTokenCacheStats
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:2071
What the cache holds.
Returns
getContractAddress()
getContractAddress(
symbol,network):Promise<string|undefined>
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:2065
The contract address on network of the token with symbol, if any.
Parameters
symbol
string
network
Returns
Promise<string | undefined>
getSupportedTokenSymbols()
getSupportedTokenSymbols(
network):Promise<string[]>
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:2067
The symbols of the tokens bridgeable to network.
Parameters
network
Returns
Promise<string[]>
getTokenBySymbol()
getTokenBySymbol(
symbol,network):Promise<BridgeableToken|undefined>
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:2058
The token bridgeable to network with symbol (any case; the first listed), if any.
Parameters
symbol
string
network
Returns
Promise<BridgeableToken | undefined>
getTokenByTokenId()
getTokenByTokenId(
tokenId,network):Promise<BridgeableToken|undefined>
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:2063
The token bridgeable to network with the token id tokenId (a pipe class key, matched
exactly: class keys are case-sensitive), if any.
Parameters
tokenId
string
network
Returns
Promise<BridgeableToken | undefined>
isTokenBridgeableToEthereum()
isTokenBridgeableToEthereum(
tokenId):Promise<IsTokenBridgeableResult>
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:2054
Whether a token is bridgeable to Ethereum.
Parameters
tokenId
Returns
Promise<IsTokenBridgeableResult>
isTokenBridgeableToNetwork()
isTokenBridgeableToNetwork(
options):Promise<IsTokenBridgeableResult>
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:2052
Whether a token (by token id) is bridgeable to a network, with its symbol and contract address there. The symbol is the cached token's, never derived from the token id.
Parameters
options
Returns
Promise<IsTokenBridgeableResult>
isTokenBridgeableToSolana()
isTokenBridgeableToSolana(
tokenId):Promise<IsTokenBridgeableResult>
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:2056
Whether a token is bridgeable to Solana.
Parameters
tokenId
Returns
Promise<IsTokenBridgeableResult>
preload()
preload():
Promise<void>
Defined in: packages/gala-core-sdk/dist/bridge.d.ts:2069
Read both networks' token lists.
Returns
Promise<void>