@wormhole-foundation/sdk-sui-tokenbridge
Version:
SDK for Sui chains, used in conjunction with @wormhole-foundation/sdk
33 lines • 2.32 kB
TypeScript
import type { SuiClient } from "@mysten/sui/client";
import type { AccountAddress, Chain, ChainAddress, ChainsConfig, Contracts, NativeAddress, Network, Platform, TokenAddress, TokenBridge, TokenId } from "@wormhole-foundation/sdk-connect";
import { UniversalAddress } from "@wormhole-foundation/sdk-connect";
import type { SuiChains } from "@wormhole-foundation/sdk-sui";
import { SuiUnsignedTransaction } from "@wormhole-foundation/sdk-sui";
import "@wormhole-foundation/sdk-sui-core";
export declare class SuiTokenBridge<N extends Network, C extends SuiChains> implements TokenBridge<N, C> {
readonly network: N;
readonly chain: C;
readonly provider: SuiClient;
readonly contracts: Contracts;
readonly coreBridgeObjectId: string;
readonly tokenBridgeObjectId: string;
readonly chainId: bigint;
constructor(network: N, chain: C, provider: SuiClient, contracts: Contracts);
static fromRpc<N extends Network>(provider: SuiClient, config: ChainsConfig<N, Platform>): Promise<SuiTokenBridge<N, SuiChains>>;
isWrappedAsset(token: TokenAddress<C>): Promise<boolean>;
getOriginalAsset(token: TokenAddress<C>): Promise<TokenId>;
getTokenUniversalAddress(token: NativeAddress<C>): Promise<UniversalAddress>;
getTokenNativeAddress(originChain: Chain, token: UniversalAddress): Promise<NativeAddress<C>>;
hasWrappedAsset(token: TokenId): Promise<boolean>;
getWrappedAsset(token: TokenId<Chain>): Promise<NativeAddress<C>>;
isTransferCompleted(vaa: TokenBridge.VAA<"Transfer" | "TransferWithPayload">): Promise<boolean>;
createAttestation(token: TokenAddress<C>): AsyncGenerator<SuiUnsignedTransaction<N, C>>;
submitAttestation(vaa: TokenBridge.VAA<"AttestMeta">, sender: AccountAddress<C>): AsyncGenerator<SuiUnsignedTransaction<N, C>>;
transfer(sender: AccountAddress<C>, recipient: ChainAddress, token: TokenAddress<C>, amount: bigint, payload?: Uint8Array): AsyncGenerator<SuiUnsignedTransaction<N, C>>;
redeem(sender: AccountAddress<C>, vaa: TokenBridge.VAA<"Transfer" | "TransferWithPayload">, unwrapNative?: boolean): AsyncGenerator<SuiUnsignedTransaction<N, C>>;
getWrappedNative(): Promise<NativeAddress<C>>;
private getPackageIds;
private getCoinBuildOutput;
private createUnsignedTx;
}
//# sourceMappingURL=tokenBridge.d.ts.map