@hyperlane-xyz/sdk
Version:
The official SDK for the Hyperlane Network
95 lines • 5.38 kB
TypeScript
import { SigningHyperlaneModuleClient } from '@hyperlane-xyz/cosmos-sdk';
import { Address, Domain, ProtocolType } from '@hyperlane-xyz/utils';
import { HyperlaneModule, HyperlaneModuleParams } from '../core/AbstractHyperlaneModule.js';
import { ChainMetadataManager } from '../metadata/ChainMetadataManager.js';
import { MultiProvider } from '../providers/MultiProvider.js';
import { AnnotatedCosmJsNativeTransaction } from '../providers/ProviderType.js';
import { ChainName, ChainNameOrId } from '../types.js';
import { CosmosNativeWarpRouteReader } from './CosmosNativeWarpRouteReader.js';
import { DerivedTokenRouterConfig, HypTokenRouterConfig } from './types.js';
type WarpRouteAddresses = {
deployedTokenRoute: Address;
};
export declare class CosmosNativeWarpModule extends HyperlaneModule<ProtocolType.CosmosNative, HypTokenRouterConfig, WarpRouteAddresses> {
protected readonly metadataManager: ChainMetadataManager;
protected readonly signer: SigningHyperlaneModuleClient;
protected logger: import("pino").default.Logger<never>;
reader: CosmosNativeWarpRouteReader;
readonly chainName: ChainName;
readonly chainId: string;
readonly domainId: Domain;
constructor(metadataManager: ChainMetadataManager, args: HyperlaneModuleParams<HypTokenRouterConfig, WarpRouteAddresses>, signer: SigningHyperlaneModuleClient);
/**
* Retrieves the token router configuration for the specified address.
*
* @param address - The address to derive the token router configuration from.
* @returns A promise that resolves to the token router configuration.
*/
read(): Promise<DerivedTokenRouterConfig>;
/**
* Updates the Warp Route contract with the provided configuration.
*
* @param expectedConfig - The configuration for the token router to be updated.
* @returns An array of Cosmos transactions that were executed to update the contract, or an error if the update failed.
*/
update(expectedConfig: HypTokenRouterConfig): Promise<AnnotatedCosmJsNativeTransaction[]>;
/**
* Create a transaction to update the remote routers for the Warp Route contract.
*
* @param actualConfig - The on-chain router configuration, including the remoteRouters array.
* @param expectedConfig - The expected token router configuration.
* @returns An array with Cosmos Native transactions that need to be executed to enroll the routers
*/
createEnrollRemoteRoutersUpdateTxs(actualConfig: DerivedTokenRouterConfig, expectedConfig: HypTokenRouterConfig): AnnotatedCosmJsNativeTransaction[];
createUnenrollRemoteRoutersUpdateTxs(actualConfig: DerivedTokenRouterConfig, expectedConfig: HypTokenRouterConfig): AnnotatedCosmJsNativeTransaction[];
/**
* Create a transaction to update the remote routers for the Warp Route contract.
*
* @param actualConfig - The on-chain router configuration, including the remoteRouters array.
* @param expectedConfig - The expected token router configuration.
* @returns A array with Cosmos transactions that need to be executed to update the destination gas
*/
createSetDestinationGasUpdateTxs(actualConfig: DerivedTokenRouterConfig, expectedConfig: HypTokenRouterConfig): Promise<AnnotatedCosmJsNativeTransaction[]>;
/**
* Create transactions to update an existing ISM config, or deploy a new ISM and return a tx to setInterchainSecurityModule
*
* @param actualConfig - The on-chain router configuration, including the ISM configuration, and address.
* @param expectedConfig - The expected token router configuration, including the ISM configuration.
* @returns Cosmos transaction that need to be executed to update the ISM configuration.
*/
createIsmUpdateTxs(actualConfig: DerivedTokenRouterConfig, expectedConfig: HypTokenRouterConfig): Promise<AnnotatedCosmJsNativeTransaction[]>;
/**
* Transfer ownership of an existing Warp route with a given config.
*
* @param actualConfig - The on-chain router configuration.
* @param expectedConfig - The expected token router configuration.
* @returns Cosmos transaction that need to be executed to update the owner.
*/
createOwnershipUpdateTxs(actualConfig: DerivedTokenRouterConfig, expectedConfig: HypTokenRouterConfig): AnnotatedCosmJsNativeTransaction[];
/**
* Updates or deploys the ISM using the provided configuration.
*
* @returns Object with deployedIsm address, and update Transactions
*/
deployOrUpdateIsm(actualConfig: DerivedTokenRouterConfig, expectedConfig: HypTokenRouterConfig): Promise<{
deployedIsm: Address;
updateTransactions: AnnotatedCosmJsNativeTransaction[];
}>;
/**
* Deploys the Warp Route.
*
* @param chain - The chain to deploy the module on.
* @param config - The configuration for the token router.
* @param multiProvider - The multi-provider instance to use.
* @param signer - The Cosmos signing client
* @returns A new instance of the CosmosNativeWarpModule.
*/
static create(params: {
chain: ChainNameOrId;
config: HypTokenRouterConfig;
multiProvider: MultiProvider;
signer: SigningHyperlaneModuleClient;
}): Promise<CosmosNativeWarpModule>;
}
export {};
//# sourceMappingURL=CosmosNativeWarpModule.d.ts.map