# Class MockPlatform<N, P>

#### Type Parameters

- #### N extends Network

- #### P extends Platform

#### Hierarchy

- PlatformContext<N, P>
  - MockPlatform

- Defined in core/definitions/dist/esm/testing/mocks/platform.d.ts:4

#####
Index

### Constructors

constructor

### Properties

config
network

### Methods

getChain
getDecimals
getNativeBalance
getProtocol
getRpc
getTokenDecimals
getWrappedAsset
parseWormholeMessages
utils
getProtocol

## Constructors

### constructor

- new MockPlatform<N, P>(network, config): testing.mocks.MockPlatform<N, P>

- #### Type Parameters

  - #### N extends "Mainnet" | "Testnet" | "Devnet"

  - #### P extends "Solana" | "Algorand" | "Near" | "Sui" | "Aptos" | "Btc" | "Evm" | "Cosmwasm"

  #### Parameters

  - ##### network: N

  - ##### config: ChainsConfig<N, P>

  #### Returns testing.mocks.MockPlatform<N, P>

  Overrides PlatformContext.constructor

  - Defined in core/definitions/dist/esm/testing/mocks/platform.d.ts:5

## Properties

### `Readonly` config

config: ChainsConfig<N, P>

Inherited from PlatformContext.config

- Defined in core/definitions/dist/esm/platform.d.ts:24

### `Readonly` network

network: N

Inherited from PlatformContext.network

- Defined in core/definitions/dist/esm/platform.d.ts:23

## Methods

### getChain

- getChain<C>(chain): ChainContext<N, P, C>

- #### Type Parameters

  - #### C extends "Solana" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Algorand" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Btc" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky"

  #### Parameters

  - ##### chain: C

  #### Returns ChainContext<N, P, C>

  Overrides PlatformContext.getChain

  - Defined in core/definitions/dist/esm/testing/mocks/platform.d.ts:7

### getDecimals

- getDecimals<C>(chain, rpc, token): Promise<number>

- #### Type Parameters

  - #### C extends "Solana" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Algorand" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Btc" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky"

  #### Parameters

  - ##### chain: C

  - ##### rpc: any

  - ##### token: TokenAddress<C>

  #### Returns Promise<number>

  - Defined in core/definitions/dist/esm/testing/mocks/platform.d.ts:12

### getNativeBalance

- getNativeBalance(rpc, walletAddr): Promise<bigint>

- #### Parameters

  - ##### rpc: any

  - ##### walletAddr: string

  #### Returns Promise<bigint>

  - Defined in core/definitions/dist/esm/testing/mocks/platform.d.ts:11

### getProtocol

- getProtocol<PN, T>(protocol, rpc): Promise<T>

- #### Type Parameters

  - #### PN extends "WormholeCore" | "TokenBridge" | "AutomaticTokenBridge" | "CircleBridge" | "AutomaticCircleBridge" | "Relayer" | "IbcBridge" | "NftBridge"

  - #### T

  #### Parameters

  - ##### protocol: PN

  - ##### rpc: any

  #### Returns Promise<T>

  Inherited from PlatformContext.getProtocol

  - Defined in core/definitions/dist/esm/platform.d.ts:29

### getRpc

- getRpc<C>(chain): any

- #### Type Parameters

  - #### C extends "Solana" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Algorand" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Btc" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky"

  #### Parameters

  - ##### chain: C

  #### Returns any

  Overrides PlatformContext.getRpc

  - Defined in core/definitions/dist/esm/testing/mocks/platform.d.ts:8

### getTokenDecimals

- getTokenDecimals(rpc, token): Promise<bigint>

- #### Parameters

  - ##### rpc: any

  - ##### token: TokenId<PlatformToChains<P>>

  #### Returns Promise<bigint>

  - Defined in core/definitions/dist/esm/testing/mocks/platform.d.ts:10

### getWrappedAsset

- getWrappedAsset<C>(chain, rpc, token): Promise<TokenId<C>>

- #### Type Parameters

  - #### C extends "Solana" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Algorand" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Btc" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky"

  #### Parameters

  - ##### chain: C

  - ##### rpc: any

  - ##### token: TokenId<C>

  #### Returns Promise<TokenId<C>>

  - Defined in core/definitions/dist/esm/testing/mocks/platform.d.ts:9

### parseWormholeMessages

- parseWormholeMessages<C>(chain, rpc, txid): Promise<WormholeMessageId[]>

- #### Type Parameters

  - #### C extends "Solana" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Algorand" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Btc" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky"

  #### Parameters

  - ##### chain: C

  - ##### rpc: any

  - ##### txid: string

  #### Returns Promise<WormholeMessageId[]>

  Inherited from PlatformContext.parseWormholeMessages

  - Defined in core/definitions/dist/esm/platform.d.ts:30

### utils

- utils(): PlatformUtils<N, P>

- #### Returns PlatformUtils<N, P>

  Inherited from PlatformContext.utils

  - Defined in core/definitions/dist/esm/platform.d.ts:26

### `Static` getProtocol

- getProtocol<PN, T>(protocol): T

- #### Type Parameters

  - #### PN extends "WormholeCore" | "TokenBridge" | "AutomaticTokenBridge" | "CircleBridge" | "AutomaticCircleBridge" | "Relayer" | "IbcBridge" | "NftBridge"

  - #### T extends unknown

  #### Parameters

  - ##### protocol: PN

  #### Returns T

  - Defined in core/definitions/dist/esm/testing/mocks/platform.d.ts:6

Generated using TypeDoc