@wormhole-foundation/sdk-evm
Version:
SDK for EVM chains, used in conjunction with @wormhole-foundation/sdk
29 lines • 2 kB
TypeScript
import type { Balances, Chain, ChainsConfig, Network, SignedTx, StaticPlatformMethods, TokenId, TxHash } from '@wormhole-foundation/sdk-connect';
import { PlatformContext } from '@wormhole-foundation/sdk-connect';
import type { Provider } from 'ethers';
import * as ethers_contracts from './ethers-contracts/index.js';
import { EvmChain } from './chain.js';
import type { AnyEvmAddress, EvmChains, EvmPlatformType } from './types.js';
/**
* @category EVM
*/
export declare class EvmPlatform<N extends Network> extends PlatformContext<N, EvmPlatformType> implements StaticPlatformMethods<EvmPlatformType, typeof EvmPlatform> {
static _platform: "Evm";
private _providers;
constructor(network: N, _config?: ChainsConfig<N, EvmPlatformType>);
getRpc<C extends EvmChains>(chain: C): Provider;
getChain<C extends EvmChains>(chain: C, rpc?: Provider): EvmChain<N, C>;
static nativeTokenId<N extends Network, C extends EvmChains>(network: N, chain: C): TokenId<C>;
static isNativeTokenId<N extends Network, C extends EvmChains>(network: N, chain: C, tokenId: TokenId<C>): boolean;
static isSupportedChain(chain: Chain): boolean;
static getDecimals(chain: Chain, rpc: Provider, token: AnyEvmAddress): Promise<number>;
static getBalance(chain: Chain, rpc: Provider, walletAddr: string, token: AnyEvmAddress): Promise<bigint | null>;
static getBalances(chain: Chain, rpc: Provider, walletAddr: string, tokens: AnyEvmAddress[]): Promise<Balances>;
static sendWait(chain: Chain, rpc: Provider, stxns: SignedTx[]): Promise<TxHash[]>;
static getLatestBlock(rpc: Provider): Promise<number>;
static getLatestFinalizedBlock(rpc: Provider): Promise<number>;
static chainFromChainId(eip155ChainId: string): [Network, EvmChains];
static chainFromRpc(rpc: Provider): Promise<[Network, EvmChains]>;
static getTokenImplementation(connection: Provider, address: string): ethers_contracts.TokenImplementation;
}
//# sourceMappingURL=platform.d.ts.map