@hyperlane-xyz/sdk
Version:
The official SDK for the Hyperlane Network
51 lines • 2.84 kB
TypeScript
import { HyperlaneModuleClient, SigningHyperlaneModuleClient } from '@hyperlane-xyz/cosmos-sdk';
import { Address } from '@hyperlane-xyz/utils';
import { CosmosNativeHookReader } from '../hook/CosmosNativeHookReader.js';
import { CosmosNativeIsmReader } from '../ism/CosmosNativeIsmReader.js';
import { ChainMetadataManager } from '../metadata/ChainMetadataManager.js';
import { DestinationGas, MailboxClientConfig, RemoteRouters } from '../router/types.js';
import { ChainNameOrId } from '../types.js';
import { TokenType } from './config.js';
import { DerivedTokenRouterConfig, HypTokenConfig } from './types.js';
export declare class CosmosNativeWarpRouteReader {
protected readonly metadataManager: ChainMetadataManager;
protected readonly chain: ChainNameOrId;
protected readonly cosmosProviderOrSigner: SigningHyperlaneModuleClient | HyperlaneModuleClient;
protected readonly logger: import("pino").default.Logger<never>;
hookReader: CosmosNativeHookReader;
ismReader: CosmosNativeIsmReader;
constructor(metadataManager: ChainMetadataManager, chain: ChainNameOrId, cosmosProviderOrSigner: SigningHyperlaneModuleClient | HyperlaneModuleClient);
/**
* Derives the configuration for a Hyperlane ERC20 router contract at the given address.
*
* @param warpRouteAddress - The address of the Hyperlane ERC20 router contract.
* @returns The configuration for the Hyperlane ERC20 router.
*
*/
deriveWarpRouteConfig(warpRouteAddress: Address): Promise<DerivedTokenRouterConfig>;
/**
* Derives the token type for a given Warp Route address using specific methods
*
* @param warpRouteAddress - The Warp Route address to derive the token type for.
* @returns The derived token type, which can be one of: collateralVault, collateral, native, or synthetic.
*/
deriveTokenType(warpRouteAddress: Address): Promise<TokenType>;
/**
* Fetches the base metadata for a Warp Route contract.
*
* @param routerAddress - The address of the Warp Route contract.
* @returns The base metadata for the Warp Route contract, including the mailbox, owner, hook, and ism.
*/
fetchMailboxClientConfig(routerAddress: Address): Promise<MailboxClientConfig>;
/**
* Fetches the metadata for a token address.
*
* @param warpRouteAddress - The address of the token.
* @returns A partial ERC20 metadata object containing the token name, symbol, total supply, and decimals.
* Throws if unsupported token type
*/
fetchTokenConfig(type: TokenType, warpRouteAddress: Address): Promise<HypTokenConfig>;
fetchRemoteRouters(warpRouteAddress: Address): Promise<RemoteRouters>;
fetchDestinationGas(warpRouteAddress: Address): Promise<DestinationGas>;
}
//# sourceMappingURL=CosmosNativeWarpRouteReader.d.ts.map