# Class CosmwasmTokenBridge<N, C>

#### Type Parameters

- #### N extends Network

- #### C extends CosmwasmChains

#### Hierarchy

- CosmwasmTokenBridge

#### Implements

- TokenBridge<N, CosmwasmPlatformType, C>

- Defined in tokenBridge.ts:35

#####
Index

### Constructors

constructor

### Properties

chain
contracts
network
rpc
tokenBridge
translator?

### Methods

createAttestation
createUnsignedTx
getOriginalAsset
getWrappedAsset
getWrappedNative
hasWrappedAsset
isTransferCompleted
isWrappedAsset
parseTransactionDetails
redeem
submitAttestation
transfer
fromRpc

## Constructors

### `Private` constructor

- new CosmwasmTokenBridge<N, C>(network, chain, rpc, contracts): CosmwasmTokenBridge<N, C>

- #### Type Parameters

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

  - #### C extends "Terra" | "Terra2" | "Injective" | "Osmosis" | "Xpla" | "Sei" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira"

  #### Parameters

  - ##### network: N

  - ##### chain: C

  - ##### rpc: CosmWasmClient

  - ##### contracts: Contracts

  #### Returns CosmwasmTokenBridge<N, C>

  - Defined in tokenBridge.ts:40

## Properties

### `Readonly` chain

chain: C

- Defined in tokenBridge.ts:42

### `Readonly` contracts

contracts: Contracts

- Defined in tokenBridge.ts:44

### `Readonly` network

network: N

- Defined in tokenBridge.ts:41

### `Readonly` rpc

rpc: CosmWasmClient

- Defined in tokenBridge.ts:43

### `Private` tokenBridge

tokenBridge: string

- Defined in tokenBridge.ts:38

### `Private` `Optional` translator

translator?: string

- Defined in tokenBridge.ts:39

## Methods

### createAttestation

- createAttestation(token, payer?): AsyncGenerator<CosmwasmUnsignedTransaction<N, C>, any, unknown>

- #### Parameters

  - ##### token: AnyCosmwasmAddress

  - ##### `Optional` payer: AnyCosmwasmAddress

  #### Returns AsyncGenerator<CosmwasmUnsignedTransaction<N, C>, any, unknown>

  Implementation of TokenBridge.createAttestation

  - Defined in tokenBridge.ts:124

### `Private` createUnsignedTx

- createUnsignedTx(txReq, description, parallelizable?): CosmwasmUnsignedTransaction<N, C>

- #### Parameters

  - ##### txReq: CosmwasmTransaction

  - ##### description: string

  - ##### parallelizable: boolean = false

  #### Returns CosmwasmUnsignedTransaction<N, C>

  - Defined in tokenBridge.ts:321

### getOriginalAsset

- getOriginalAsset(token): Promise<TokenId>

- #### Parameters

  - ##### token: AnyCosmwasmAddress

  #### Returns Promise<TokenId>

  Implementation of TokenBridge.getOriginalAsset

  - Defined in tokenBridge.ts:100

### getWrappedAsset

- getWrappedAsset(token): Promise<NativeAddress<C>>

- #### Parameters

  - ##### token: TokenId<"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">

  #### Returns Promise<NativeAddress<C>>

  Implementation of TokenBridge.getWrappedAsset

  - Defined in tokenBridge.ts:82

### getWrappedNative

- getWrappedNative(): Promise<NativeAddress<C>>

- #### Returns Promise<NativeAddress<C>>

  Implementation of TokenBridge.getWrappedNative

  - Defined in tokenBridge.ts:317

### hasWrappedAsset

- hasWrappedAsset(token): Promise<boolean>

- #### Parameters

  - ##### token: TokenId

  #### Returns Promise<boolean>

  Implementation of TokenBridge.hasWrappedAsset

  - Defined in tokenBridge.ts:74

### isTransferCompleted

- isTransferCompleted(vaa): Promise<boolean>

- #### Parameters

  - ##### vaa: VAA<"TokenBridge:Transfer"> | VAA<"TokenBridge:TransferWithPayload">

  #### Returns Promise<boolean>

  Implementation of TokenBridge.isTransferCompleted

  - Defined in tokenBridge.ts:116

### isWrappedAsset

- isWrappedAsset(token): Promise<boolean>

- #### Parameters

  - ##### token: AnyCosmwasmAddress

  #### Returns Promise<boolean>

  Implementation of TokenBridge.isWrappedAsset

  - Defined in tokenBridge.ts:66

### parseTransactionDetails

- parseTransactionDetails(txid): Promise<void>

- #### Parameters

  - ##### txid: string

  #### Returns Promise<void>

  - Defined in tokenBridge.ts:313

### redeem

- redeem(sender, vaa, unwrapNative?): AsyncGenerator<CosmwasmUnsignedTransaction<N, C>, any, unknown>

- #### Parameters

  - ##### sender: AnyCosmwasmAddress

  - ##### vaa: VAA<"TokenBridge:Transfer"> | VAA<"TokenBridge:TransferWithPayload">

  - ##### unwrapNative: boolean = true

  #### Returns AsyncGenerator<CosmwasmUnsignedTransaction<N, C>, any, unknown>

  Implementation of TokenBridge.redeem

  - Defined in tokenBridge.ts:278

### submitAttestation

- submitAttestation(vaa, payer?): AsyncGenerator<CosmwasmUnsignedTransaction<N, C>, any, unknown>

- #### Parameters

  - ##### vaa: VAA<"TokenBridge:AttestMeta">

  - ##### `Optional` payer: AnyCosmwasmAddress

  #### Returns AsyncGenerator<CosmwasmUnsignedTransaction<N, C>, any, unknown>

  Implementation of TokenBridge.submitAttestation

  - Defined in tokenBridge.ts:160

### transfer

- transfer(sender, recipient, token, amount, payload?): AsyncGenerator<CosmwasmUnsignedTransaction<N, C>, any, unknown>

- #### Parameters

  - ##### sender: AnyCosmwasmAddress

  - ##### recipient: ChainAddress

  - ##### token: AnyCosmwasmAddress

  - ##### amount: bigint

  - ##### `Optional` payload: Uint8Array

  #### Returns AsyncGenerator<CosmwasmUnsignedTransaction<N, C>, any, unknown>

  Implementation of TokenBridge.transfer

  - Defined in tokenBridge.ts:182

### `Static` fromRpc

- fromRpc<N>(rpc, config): Promise<CosmwasmTokenBridge<N, "Terra" | "Terra2" | "Injective" | "Osmosis" | "Xpla" | "Sei" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira">>

- #### Type Parameters

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

  #### Parameters

  - ##### rpc: CosmWasmClient

  - ##### config: ChainsConfig<N, "Cosmwasm">

  #### Returns Promise<CosmwasmTokenBridge<N, "Terra" | "Terra2" | "Injective" | "Osmosis" | "Xpla" | "Sei" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira">>

  - Defined in tokenBridge.ts:55

Generated using TypeDoc