@wormhole-labs/cctp-executor-route 0.3.0 → 0.5.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/aptos/executor.d.ts +1 -1
- package/dist/cjs/aptos/executor.d.ts.map +1 -1
- package/dist/cjs/aptos/executor.js +1 -1
- package/dist/cjs/aptos/executor.js.map +1 -1
- package/dist/cjs/consts.d.ts +22 -1
- package/dist/cjs/consts.d.ts.map +1 -1
- package/dist/cjs/consts.js +224 -6
- package/dist/cjs/consts.js.map +1 -1
- package/dist/cjs/evm/executor.d.ts +1 -1
- package/dist/cjs/evm/executor.d.ts.map +1 -1
- package/dist/cjs/evm/executor.js +1 -1
- package/dist/cjs/evm/executor.js.map +1 -1
- package/dist/cjs/evm/executorV2.d.ts +25 -0
- package/dist/cjs/evm/executorV2.d.ts.map +1 -0
- package/dist/cjs/evm/executorV2.js +100 -0
- package/dist/cjs/evm/executorV2.js.map +1 -0
- package/dist/cjs/evm/index.d.ts +1 -0
- package/dist/cjs/evm/index.d.ts.map +1 -1
- package/dist/cjs/evm/index.js +3 -0
- package/dist/cjs/evm/index.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -91
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +15 -334
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/layouts/circle.d.ts +161 -0
- package/dist/cjs/layouts/circle.d.ts.map +1 -0
- package/dist/cjs/layouts/circle.js +48 -0
- package/dist/cjs/layouts/circle.js.map +1 -0
- package/dist/cjs/layouts/index.d.ts +1 -1
- package/dist/cjs/layouts/index.d.ts.map +1 -1
- package/dist/cjs/layouts/index.js +1 -1
- package/dist/cjs/layouts/index.js.map +1 -1
- package/dist/cjs/routes/cctpV1.d.ts +92 -0
- package/dist/cjs/routes/cctpV1.d.ts.map +1 -0
- package/dist/cjs/routes/cctpV1.js +190 -0
- package/dist/cjs/routes/cctpV1.js.map +1 -0
- package/dist/cjs/routes/cctpV2Base.d.ts +57 -0
- package/dist/cjs/routes/cctpV2Base.d.ts.map +1 -0
- package/dist/cjs/routes/cctpV2Base.js +179 -0
- package/dist/cjs/routes/cctpV2Base.js.map +1 -0
- package/dist/cjs/routes/cctpV2Fast.d.ts +42 -0
- package/dist/cjs/routes/cctpV2Fast.d.ts.map +1 -0
- package/dist/cjs/routes/cctpV2Fast.js +138 -0
- package/dist/cjs/routes/cctpV2Fast.js.map +1 -0
- package/dist/cjs/routes/cctpV2Standard.d.ts +42 -0
- package/dist/cjs/routes/cctpV2Standard.d.ts.map +1 -0
- package/dist/cjs/routes/cctpV2Standard.js +126 -0
- package/dist/cjs/routes/cctpV2Standard.js.map +1 -0
- package/dist/cjs/routes/helpers.d.ts +12 -0
- package/dist/cjs/routes/helpers.d.ts.map +1 -0
- package/dist/cjs/routes/helpers.js +181 -0
- package/dist/cjs/routes/helpers.js.map +1 -0
- package/dist/cjs/routes/index.d.ts +5 -0
- package/dist/cjs/routes/index.d.ts.map +1 -0
- package/dist/cjs/routes/index.js +21 -0
- package/dist/cjs/routes/index.js.map +1 -0
- package/dist/cjs/sui/executor.d.ts +1 -1
- package/dist/cjs/sui/executor.d.ts.map +1 -1
- package/dist/cjs/svm/executor.d.ts +1 -1
- package/dist/cjs/svm/executor.d.ts.map +1 -1
- package/dist/cjs/svm/executor.js +1 -1
- package/dist/cjs/svm/executor.js.map +1 -1
- package/dist/cjs/types.d.ts +8 -1
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/cjs/utils.d.ts +20 -1
- package/dist/cjs/utils.d.ts.map +1 -1
- package/dist/cjs/utils.js +86 -2
- package/dist/cjs/utils.js.map +1 -1
- package/dist/esm/aptos/executor.d.ts +1 -1
- package/dist/esm/aptos/executor.d.ts.map +1 -1
- package/dist/esm/aptos/executor.js +2 -2
- package/dist/esm/aptos/executor.js.map +1 -1
- package/dist/esm/consts.d.ts +22 -1
- package/dist/esm/consts.d.ts.map +1 -1
- package/dist/esm/consts.js +217 -5
- package/dist/esm/consts.js.map +1 -1
- package/dist/esm/evm/executor.d.ts +1 -1
- package/dist/esm/evm/executor.d.ts.map +1 -1
- package/dist/esm/evm/executor.js +2 -2
- package/dist/esm/evm/executor.js.map +1 -1
- package/dist/esm/evm/executorV2.d.ts +25 -0
- package/dist/esm/evm/executorV2.d.ts.map +1 -0
- package/dist/esm/evm/executorV2.js +96 -0
- package/dist/esm/evm/executorV2.js.map +1 -0
- package/dist/esm/evm/index.d.ts +1 -0
- package/dist/esm/evm/index.d.ts.map +1 -1
- package/dist/esm/evm/index.js +3 -0
- package/dist/esm/evm/index.js.map +1 -1
- package/dist/esm/index.d.ts +1 -91
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -331
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/layouts/circle.d.ts +161 -0
- package/dist/esm/layouts/circle.d.ts.map +1 -0
- package/dist/esm/layouts/circle.js +43 -0
- package/dist/esm/layouts/circle.js.map +1 -0
- package/dist/esm/layouts/index.d.ts +1 -1
- package/dist/esm/layouts/index.d.ts.map +1 -1
- package/dist/esm/layouts/index.js +1 -1
- package/dist/esm/layouts/index.js.map +1 -1
- package/dist/esm/routes/cctpV1.d.ts +92 -0
- package/dist/esm/routes/cctpV1.d.ts.map +1 -0
- package/dist/esm/routes/cctpV1.js +185 -0
- package/dist/esm/routes/cctpV1.js.map +1 -0
- package/dist/esm/routes/cctpV2Base.d.ts +57 -0
- package/dist/esm/routes/cctpV2Base.d.ts.map +1 -0
- package/dist/esm/routes/cctpV2Base.js +175 -0
- package/dist/esm/routes/cctpV2Base.js.map +1 -0
- package/dist/esm/routes/cctpV2Fast.d.ts +42 -0
- package/dist/esm/routes/cctpV2Fast.d.ts.map +1 -0
- package/dist/esm/routes/cctpV2Fast.js +133 -0
- package/dist/esm/routes/cctpV2Fast.js.map +1 -0
- package/dist/esm/routes/cctpV2Standard.d.ts +42 -0
- package/dist/esm/routes/cctpV2Standard.d.ts.map +1 -0
- package/dist/esm/routes/cctpV2Standard.js +121 -0
- package/dist/esm/routes/cctpV2Standard.js.map +1 -0
- package/dist/esm/routes/helpers.d.ts +12 -0
- package/dist/esm/routes/helpers.d.ts.map +1 -0
- package/dist/esm/routes/helpers.js +177 -0
- package/dist/esm/routes/helpers.js.map +1 -0
- package/dist/esm/routes/index.d.ts +5 -0
- package/dist/esm/routes/index.d.ts.map +1 -0
- package/dist/esm/routes/index.js +5 -0
- package/dist/esm/routes/index.js.map +1 -0
- package/dist/esm/sui/executor.d.ts +1 -1
- package/dist/esm/sui/executor.d.ts.map +1 -1
- package/dist/esm/svm/executor.d.ts +1 -1
- package/dist/esm/svm/executor.d.ts.map +1 -1
- package/dist/esm/svm/executor.js +2 -2
- package/dist/esm/svm/executor.js.map +1 -1
- package/dist/esm/types.d.ts +8 -1
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/esm/utils.d.ts +20 -1
- package/dist/esm/utils.d.ts.map +1 -1
- package/dist/esm/utils.js +83 -3
- package/dist/esm/utils.js.map +1 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/dist/cjs/layouts/requestForExecution.d.ts +0 -18
- package/dist/cjs/layouts/requestForExecution.d.ts.map +0 -1
- package/dist/cjs/layouts/requestForExecution.js +0 -15
- package/dist/cjs/layouts/requestForExecution.js.map +0 -1
- package/dist/esm/layouts/requestForExecution.d.ts +0 -18
- package/dist/esm/layouts/requestForExecution.d.ts.map +0 -1
- package/dist/esm/layouts/requestForExecution.js +0 -12
- package/dist/esm/layouts/requestForExecution.js.map +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { amount, Chain, ChainAddress, EmptyPlatformMap, Network, routes, Signer, TransactionId } from "@wormhole-foundation/sdk-connect";
|
|
2
|
+
import { CircleV2Message } from "../layouts";
|
|
3
|
+
import { QuoteDetails } from "./cctpV1";
|
|
4
|
+
import { CCTPv2Executor } from "../types";
|
|
5
|
+
export declare namespace CCTPv2ExecutorRoute {
|
|
6
|
+
type Options = {
|
|
7
|
+
nativeGas?: number;
|
|
8
|
+
};
|
|
9
|
+
type NormalizedParams = {
|
|
10
|
+
amount: amount.Amount;
|
|
11
|
+
};
|
|
12
|
+
interface ValidatedParams extends routes.ValidatedTransferParams<Options> {
|
|
13
|
+
normalizedParams: NormalizedParams;
|
|
14
|
+
}
|
|
15
|
+
type Config = {
|
|
16
|
+
referrerFeeDbps: bigint;
|
|
17
|
+
};
|
|
18
|
+
type Attestation = {
|
|
19
|
+
id: string;
|
|
20
|
+
attestation: {
|
|
21
|
+
message: CircleV2Message;
|
|
22
|
+
attestation: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export type Op = CCTPv2ExecutorRoute.Options;
|
|
27
|
+
export type Vp = CCTPv2ExecutorRoute.ValidatedParams;
|
|
28
|
+
export type Tp = routes.TransferParams<Op>;
|
|
29
|
+
export type Vr = routes.ValidationResult<Op>;
|
|
30
|
+
export type CCTPv2QuoteDetails = QuoteDetails & {
|
|
31
|
+
fastTransferMaxFee: bigint;
|
|
32
|
+
minFinalityThreshold: number;
|
|
33
|
+
};
|
|
34
|
+
export type Q = routes.Quote<Op, Vp, CCTPv2QuoteDetails>;
|
|
35
|
+
export type Qr = routes.QuoteResult<Op, Vp>;
|
|
36
|
+
export type R = routes.Receipt<CCTPv2ExecutorRoute.Attestation>;
|
|
37
|
+
export declare abstract class CCTPv2BaseRoute<N extends Network> extends routes.AutomaticRoute<N, Op, Vp, R> {
|
|
38
|
+
static NATIVE_GAS_DROPOFF_SUPPORTED: boolean;
|
|
39
|
+
static supportedNetworks(): Network[];
|
|
40
|
+
static supportedChains(network: Network): Chain[];
|
|
41
|
+
getDefaultOptions(): Op;
|
|
42
|
+
initiate(request: routes.RouteTransferRequest<N>, signer: Signer, quote: Q, to: ChainAddress): Promise<R>;
|
|
43
|
+
track(receipt: R, timeout?: number): AsyncGenerator<import("@wormhole-foundation/sdk-connect").SourceInitiatedTransferReceipt<"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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia", "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia"> | import("@wormhole-foundation/sdk-connect").FailedTransferReceipt<CCTPv2ExecutorRoute.Attestation, "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia", "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia"> | import("@wormhole-foundation/sdk-connect").SourceFinalizedTransferReceipt<CCTPv2ExecutorRoute.Attestation, "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia", "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia"> | import("@wormhole-foundation/sdk-connect").AttestedTransferReceipt<CCTPv2ExecutorRoute.Attestation, "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia", "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia"> | import("@wormhole-foundation/sdk-connect").CompletedTransferReceipt<CCTPv2ExecutorRoute.Attestation, "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia", "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia">, R, unknown>;
|
|
44
|
+
complete(signer: Signer, receipt: R): Promise<R>;
|
|
45
|
+
resume(tx: TransactionId): Promise<R>;
|
|
46
|
+
}
|
|
47
|
+
declare module "@wormhole-foundation/sdk-definitions" {
|
|
48
|
+
namespace WormholeRegistry {
|
|
49
|
+
interface ProtocolToInterfaceMapping<N, C> {
|
|
50
|
+
CCTPv2Executor: CCTPv2Executor<N, C>;
|
|
51
|
+
}
|
|
52
|
+
interface ProtocolToPlatformMapping {
|
|
53
|
+
CCTPv2Executor: EmptyPlatformMap<"CCTPv2Executor">;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//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AC,CAAC,CAAC;SACtC;QACD,UAAU,yBAAyB;YACjC,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;SACpD;KACF;CACF"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { isAttested, isCompleted, isFailed, isSourceFinalized, isSourceInitiated, routes, signSendWait, TransferState, Wormhole, } from "@wormhole-foundation/sdk-connect";
|
|
2
|
+
import { fetchStatus, getCircleV2Attestation, reattestCircleV2Message, RelayStatus, } from "../utils";
|
|
3
|
+
import { circleV2Domains, getCircleV2Chain } from "../consts";
|
|
4
|
+
import { initiateTransfer } from "./helpers";
|
|
5
|
+
export class CCTPv2BaseRoute extends routes.AutomaticRoute {
|
|
6
|
+
static NATIVE_GAS_DROPOFF_SUPPORTED = true;
|
|
7
|
+
static supportedNetworks() {
|
|
8
|
+
return ["Mainnet", "Testnet"];
|
|
9
|
+
}
|
|
10
|
+
static supportedChains(network) {
|
|
11
|
+
return Object.keys(circleV2Domains[network] ?? {});
|
|
12
|
+
}
|
|
13
|
+
getDefaultOptions() {
|
|
14
|
+
return {
|
|
15
|
+
nativeGas: 0,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
async initiate(request, signer, quote, to) {
|
|
19
|
+
if (!quote.details) {
|
|
20
|
+
throw new Error("Missing quote details");
|
|
21
|
+
}
|
|
22
|
+
return await initiateTransfer(request, signer, to, {
|
|
23
|
+
protocol: "CCTPv2Executor",
|
|
24
|
+
details: quote.details,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
async *track(receipt, timeout) {
|
|
28
|
+
if (isCompleted(receipt))
|
|
29
|
+
return receipt;
|
|
30
|
+
let leftover = timeout ? timeout : 60 * 60 * 1000;
|
|
31
|
+
while (leftover > 0) {
|
|
32
|
+
const start = Date.now();
|
|
33
|
+
if (isSourceInitiated(receipt) ||
|
|
34
|
+
isSourceFinalized(receipt) ||
|
|
35
|
+
isAttested(receipt) ||
|
|
36
|
+
isFailed(receipt)) {
|
|
37
|
+
try {
|
|
38
|
+
const txId = receipt.originTxs.at(-1).txid;
|
|
39
|
+
// First we fetch the circle attestation
|
|
40
|
+
if (isSourceInitiated(receipt) || isSourceFinalized(receipt)) {
|
|
41
|
+
const attestation = await getCircleV2Attestation({ chain: receipt.from, txid: txId }, this.wh.network);
|
|
42
|
+
if (attestation) {
|
|
43
|
+
receipt = {
|
|
44
|
+
...receipt,
|
|
45
|
+
state: TransferState.Attested,
|
|
46
|
+
attestation: {
|
|
47
|
+
id: txId,
|
|
48
|
+
attestation,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
yield receipt;
|
|
53
|
+
}
|
|
54
|
+
// Next we check the relay status
|
|
55
|
+
// This will either mark it as completed or failed
|
|
56
|
+
if (isAttested(receipt)) {
|
|
57
|
+
const [txStatus] = await fetchStatus(this.wh.network, txId, receipt.from);
|
|
58
|
+
if (!txStatus) {
|
|
59
|
+
throw new Error("No transaction status found");
|
|
60
|
+
}
|
|
61
|
+
const relayStatus = txStatus?.status;
|
|
62
|
+
if (relayStatus === RelayStatus.Submitted) {
|
|
63
|
+
receipt = {
|
|
64
|
+
...receipt,
|
|
65
|
+
state: TransferState.DestinationFinalized,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
else if (relayStatus === RelayStatus.Failed || // this could happen if simulation fails
|
|
69
|
+
relayStatus === RelayStatus.Underpaid || // only happens if you don't pay at least the costEstimate
|
|
70
|
+
relayStatus === RelayStatus.Unsupported || // capabilities check didn't pass
|
|
71
|
+
relayStatus === RelayStatus.Aborted // An unrecoverable error indicating the attempt should stop (bad data, pre-flight checks failed, or chain-specific conditions)
|
|
72
|
+
) {
|
|
73
|
+
receipt = {
|
|
74
|
+
...receipt,
|
|
75
|
+
state: TransferState.Failed,
|
|
76
|
+
error: new routes.RelayFailedError(`Relay failed with status: ${relayStatus}`),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
// If the relay failed, then we check if it was completed
|
|
81
|
+
// through another method (e.g. manual delivery)
|
|
82
|
+
if (isFailed(receipt)) {
|
|
83
|
+
if (!receipt.attestation) {
|
|
84
|
+
// This should never happen since we set the attestation
|
|
85
|
+
// on the receipt before checking the relay status
|
|
86
|
+
throw new Error("Receipt is missing attestation");
|
|
87
|
+
}
|
|
88
|
+
const attestation = receipt.attestation;
|
|
89
|
+
const executor = await this.wh
|
|
90
|
+
.getChain(receipt.to)
|
|
91
|
+
.getProtocol("CCTPv2Executor");
|
|
92
|
+
const isTransferCompleted = await executor.isTransferCompleted(attestation.attestation.message);
|
|
93
|
+
if (isTransferCompleted) {
|
|
94
|
+
receipt = {
|
|
95
|
+
...receipt,
|
|
96
|
+
state: TransferState.DestinationFinalized,
|
|
97
|
+
attestation,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// Important to yield before checking for completion
|
|
102
|
+
// so the caller can update the receipt state
|
|
103
|
+
yield receipt;
|
|
104
|
+
if (isCompleted(receipt)) {
|
|
105
|
+
return receipt;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
console.error(`Error fetching transaction status: ${error.message || error}`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// Sleep so we don't spam the endpoint
|
|
113
|
+
await new Promise((resolve) => setTimeout(resolve, 3000));
|
|
114
|
+
leftover -= Date.now() - start;
|
|
115
|
+
}
|
|
116
|
+
return receipt;
|
|
117
|
+
}
|
|
118
|
+
async complete(signer, receipt) {
|
|
119
|
+
if (!isAttested(receipt) && !isFailed(receipt)) {
|
|
120
|
+
throw new Error("Transfer is not attested");
|
|
121
|
+
}
|
|
122
|
+
if (!receipt.attestation) {
|
|
123
|
+
throw new Error("No attestation found");
|
|
124
|
+
}
|
|
125
|
+
const toChain = this.wh.getChain(receipt.to);
|
|
126
|
+
const executor = await toChain.getProtocol("CCTPv2Executor");
|
|
127
|
+
// check if the attestation is expired and, if so, re-attest and fetch
|
|
128
|
+
let { attestation, message } = receipt.attestation.attestation;
|
|
129
|
+
const { expirationBlock } = message.messageBody;
|
|
130
|
+
const currentBlock = await executor.getCurrentBlock();
|
|
131
|
+
if (expirationBlock !== 0n && expirationBlock < currentBlock) {
|
|
132
|
+
const newAttestation = await reattestCircleV2Message(toChain.network, receipt.attestation);
|
|
133
|
+
if (!newAttestation) {
|
|
134
|
+
throw new Error("Failed to reattest message");
|
|
135
|
+
}
|
|
136
|
+
attestation = newAttestation.attestation;
|
|
137
|
+
message = newAttestation.message;
|
|
138
|
+
}
|
|
139
|
+
const sender = Wormhole.parseAddress(signer.chain(), signer.address());
|
|
140
|
+
const xfer = executor.redeem(sender, message, attestation);
|
|
141
|
+
const dstTxIds = await signSendWait(this.wh.getChain(receipt.to), xfer, signer);
|
|
142
|
+
return {
|
|
143
|
+
...receipt,
|
|
144
|
+
state: TransferState.DestinationInitiated,
|
|
145
|
+
attestation: receipt.attestation,
|
|
146
|
+
destinationTxs: dstTxIds,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
async resume(tx) {
|
|
150
|
+
const attestation = await getCircleV2Attestation(tx, this.wh.network);
|
|
151
|
+
if (!attestation)
|
|
152
|
+
throw new Error("No attestation found");
|
|
153
|
+
const { message } = attestation;
|
|
154
|
+
const to = getCircleV2Chain(this.wh.network, message.destinationDomain);
|
|
155
|
+
const executor = await this.wh.getChain(to).getProtocol("CCTPv2Executor");
|
|
156
|
+
const isCompleted = await executor.isTransferCompleted(message);
|
|
157
|
+
if (isCompleted) {
|
|
158
|
+
return {
|
|
159
|
+
from: tx.chain,
|
|
160
|
+
to,
|
|
161
|
+
state: TransferState.DestinationFinalized,
|
|
162
|
+
originTxs: [tx],
|
|
163
|
+
attestation: { id: tx.txid, attestation },
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
from: tx.chain,
|
|
168
|
+
to,
|
|
169
|
+
state: TransferState.Attested,
|
|
170
|
+
originTxs: [tx],
|
|
171
|
+
attestation: { id: tx.txid, attestation },
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=cctpV2Base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cctpV2Base.js","sourceRoot":"","sources":["../../../src/routes/cctpV2Base.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,UAAU,EACV,WAAW,EACX,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,EAEjB,MAAM,EAEN,YAAY,EAEZ,aAAa,EACb,QAAQ,GACT,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,uBAAuB,EACvB,WAAW,GACZ,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AA6C7C,MAAM,OAAgB,eAEpB,SAAQ,MAAM,CAAC,cAA4B;IAC3C,MAAM,CAAC,4BAA4B,GAAG,IAAI,CAAC;IAE3C,MAAM,CAAC,iBAAiB;QACtB,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,eAAe,CAAC,OAAgB;QACrC,OAAO,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,CAAY,CAAC;IAChE,CAAC;IAED,iBAAiB;QACf,OAAO;YACL,SAAS,EAAE,CAAC;SACb,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ,CACZ,OAAuC,EACvC,MAAc,EACd,KAAQ,EACR,EAAgB;QAEhB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAC3C,CAAC;QAED,OAAO,MAAM,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE;YAC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B,MAAM,WAAW,GAAG,MAAM,sBAAsB,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;QACtE,IAAI,CAAC,WAAW;YAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAE1D,MAAM,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC;QAChC,MAAM,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;QACxE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QAC1E,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAEhE,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO;gBACL,IAAI,EAAE,EAAE,CAAC,KAAK;gBACd,EAAE;gBACF,KAAK,EAAE,aAAa,CAAC,oBAAoB;gBACzC,SAAS,EAAE,CAAC,EAAE,CAAC;gBACf,WAAW,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE;aAC1C,CAAC;QACJ,CAAC;QAED,OAAO;YACL,IAAI,EAAE,EAAE,CAAC,KAAK;YACd,EAAE;YACF,KAAK,EAAE,aAAa,CAAC,QAAQ;YAC7B,SAAS,EAAE,CAAC,EAAE,CAAC;YACf,WAAW,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE;SAC1C,CAAC;IACJ,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Network } from "@wormhole-foundation/sdk-base";
|
|
2
|
+
import { ChainContext, TokenId } from "@wormhole-foundation/sdk-definitions";
|
|
3
|
+
import { routes, Wormhole } from "@wormhole-foundation/sdk-connect";
|
|
4
|
+
import { CCTPv2BaseRoute, CCTPv2ExecutorRoute, Qr, Tp, Vp, Vr } from "./cctpV2Base";
|
|
5
|
+
export declare function cctpV2FastExecutorRoute(config?: CCTPv2ExecutorRoute.Config): {
|
|
6
|
+
new <N extends Network>(wh: Wormhole<N>): {
|
|
7
|
+
readonly staticConfig: any;
|
|
8
|
+
validate(request: routes.RouteTransferRequest<N>, params: Tp): Promise<Vr>;
|
|
9
|
+
quote(request: routes.RouteTransferRequest<N>, params: Vp): Promise<Qr>;
|
|
10
|
+
getDefaultOptions(): import("./cctpV2Base").Op;
|
|
11
|
+
initiate(request: routes.RouteTransferRequest<N>, signer: import("@wormhole-foundation/sdk-definitions").Signer, quote: import("./cctpV2Base").Q, to: import("@wormhole-foundation/sdk-definitions").ChainAddress): Promise<import("./cctpV2Base").R>;
|
|
12
|
+
track(receipt: import("./cctpV2Base").R, timeout?: number): AsyncGenerator<import("@wormhole-foundation/sdk-connect").SourceInitiatedTransferReceipt<"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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia", "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia"> | import("@wormhole-foundation/sdk-connect").FailedTransferReceipt<CCTPv2ExecutorRoute.Attestation, "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia", "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia"> | import("@wormhole-foundation/sdk-connect").SourceFinalizedTransferReceipt<CCTPv2ExecutorRoute.Attestation, "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia", "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia"> | import("@wormhole-foundation/sdk-connect").AttestedTransferReceipt<CCTPv2ExecutorRoute.Attestation, "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia", "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia"> | import("@wormhole-foundation/sdk-connect").CompletedTransferReceipt<CCTPv2ExecutorRoute.Attestation, "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia", "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia">, import("./cctpV2Base").R, unknown>;
|
|
13
|
+
complete(signer: import("@wormhole-foundation/sdk-definitions").Signer, receipt: import("./cctpV2Base").R): Promise<import("./cctpV2Base").R>;
|
|
14
|
+
resume(tx: import("@wormhole-foundation/sdk-definitions").TransactionId): Promise<import("./cctpV2Base").R>;
|
|
15
|
+
wh: Wormhole<N>;
|
|
16
|
+
transferUrl(txid: string): string;
|
|
17
|
+
};
|
|
18
|
+
config: CCTPv2ExecutorRoute.Config;
|
|
19
|
+
meta: {
|
|
20
|
+
name: string;
|
|
21
|
+
provider: string;
|
|
22
|
+
};
|
|
23
|
+
isPathSupported<N extends Network>(fromChain: ChainContext<N>, toChain: ChainContext<N>): boolean;
|
|
24
|
+
supportedDestinationTokens<N extends Network>(sourceToken: TokenId, fromChain: ChainContext<N>, toChain: ChainContext<N>): Promise<TokenId[]>;
|
|
25
|
+
NATIVE_GAS_DROPOFF_SUPPORTED: boolean;
|
|
26
|
+
supportedNetworks(): Network[];
|
|
27
|
+
supportedChains(network: Network): import("@wormhole-foundation/sdk-base").Chain[];
|
|
28
|
+
IS_AUTOMATIC: boolean;
|
|
29
|
+
};
|
|
30
|
+
export declare class CCTPv2FastExecutorRoute<N extends Network> extends CCTPv2BaseRoute<N> implements routes.StaticRouteMethods<typeof CCTPv2FastExecutorRoute> {
|
|
31
|
+
readonly staticConfig: any;
|
|
32
|
+
static config: CCTPv2ExecutorRoute.Config;
|
|
33
|
+
static meta: {
|
|
34
|
+
name: string;
|
|
35
|
+
provider: string;
|
|
36
|
+
};
|
|
37
|
+
static isPathSupported<N extends Network>(fromChain: ChainContext<N>, toChain: ChainContext<N>): boolean;
|
|
38
|
+
static supportedDestinationTokens<N extends Network>(sourceToken: TokenId, fromChain: ChainContext<N>, toChain: ChainContext<N>): Promise<TokenId[]>;
|
|
39
|
+
validate(request: routes.RouteTransferRequest<N>, params: Tp): Promise<Vr>;
|
|
40
|
+
quote(request: routes.RouteTransferRequest<N>, params: Vp): Promise<Qr>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=cctpV2Fast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cctpV2Fast.d.ts","sourceRoot":"","sources":["../../../src/routes/cctpV2Fast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EACL,YAAY,EAGZ,OAAO,EACR,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AASpE,OAAO,EACL,eAAe,EACf,mBAAmB,EAEnB,EAAE,EACF,EAAE,EACF,EAAE,EACF,EAAE,EACH,MAAM,cAAc,CAAC;AAItB,wBAAgB,uBAAuB,CACrC,MAAM,GAAE,mBAAmB,CAAC,MAAgC;SAM1D,CAAC,SAAS,OAAO;;kEAiET,EAAE,GACT,OAAO,CAAC,EAAE,CAAC;+DAwCJ,EAAE,GACT,OAAO,CAAC,EAAE,CAAC;;;;;;;;;;;;;;oBApFS,CAAC,SAAS,OAAO,aAC3B,YAAY,CAAC,CAAC,CAAC,WACjB,YAAY,CAAC,CAAC,CAAC,GACvB,OAAO;+BAO8B,CAAC,SAAS,OAAO,eAC1C,OAAO,aACT,YAAY,CAAC,CAAC,CAAC,WACjB,YAAY,CAAC,CAAC,CAAC,GACvB,OAAO,CAAC,OAAO,EAAE,CAAC;;;;;EA/BtB;AAED,qBAAa,uBAAuB,CAAC,CAAC,SAAS,OAAO,CACpD,SAAQ,eAAe,CAAC,CAAC,CACzB,YAAW,MAAM,CAAC,kBAAkB,CAAC,OAAO,uBAAuB,CAAC;IAKpE,QAAQ,CAAC,YAAY,MAA2B;IAChD,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,MAAM,CAA2B;IAEpE,MAAM,CAAC,IAAI;;;MAGT;IAEF,MAAM,CAAC,eAAe,CAAC,CAAC,SAAS,OAAO,EACtC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,EAC1B,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,GACvB,OAAO;WAOG,0BAA0B,CAAC,CAAC,SAAS,OAAO,EACvD,WAAW,EAAE,OAAO,EACpB,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,EAC1B,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,GACvB,OAAO,CAAC,OAAO,EAAE,CAAC;IA0Bf,QAAQ,CACZ,OAAO,EAAE,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC,EACvC,MAAM,EAAE,EAAE,GACT,OAAO,CAAC,EAAE,CAAC;IAsCR,KAAK,CACT,OAAO,EAAE,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC,EACvC,MAAM,EAAE,EAAE,GACT,OAAO,CAAC,EAAE,CAAC;CAoFf"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { amount } from "@wormhole-foundation/sdk-base";
|
|
2
|
+
import { isSameToken, nativeTokenId, } from "@wormhole-foundation/sdk-definitions";
|
|
3
|
+
import { Wormhole } from "@wormhole-foundation/sdk-connect";
|
|
4
|
+
import { getCircleV2FastBurnAllowance, getCircleV2FastBurnFee } from "../utils";
|
|
5
|
+
import { CircleV2FinalityThreshold, fastTransferETAs, isCircleV2Chain, isCircleV2FastChain, usdcContracts, } from "../consts";
|
|
6
|
+
import { CCTPv2BaseRoute, } from "./cctpV2Base";
|
|
7
|
+
import { fetchExecutorQuote } from "./helpers";
|
|
8
|
+
// Use this function to create a new CCTPv2FastExecutorRoute with custom config
|
|
9
|
+
export function cctpV2FastExecutorRoute(config = { referrerFeeDbps: 0n }) {
|
|
10
|
+
if (config.referrerFeeDbps < 0 || config.referrerFeeDbps > 65535n) {
|
|
11
|
+
throw new Error("Referrer fee must be between 0 and 65535");
|
|
12
|
+
}
|
|
13
|
+
class CCTPv2FastExecutorRouteImpl extends CCTPv2FastExecutorRoute {
|
|
14
|
+
static config = config;
|
|
15
|
+
}
|
|
16
|
+
return CCTPv2FastExecutorRouteImpl;
|
|
17
|
+
}
|
|
18
|
+
export class CCTPv2FastExecutorRoute extends CCTPv2BaseRoute {
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
// Since we set the config on the static class, access it with this param
|
|
21
|
+
// the CCTPv2FastExecutorRoute.config will always be empty
|
|
22
|
+
staticConfig = this.constructor.config;
|
|
23
|
+
static config = { referrerFeeDbps: 0n };
|
|
24
|
+
static meta = {
|
|
25
|
+
name: "CCTPv2FastExecutorRoute",
|
|
26
|
+
provider: "Circle",
|
|
27
|
+
};
|
|
28
|
+
static isPathSupported(fromChain, toChain) {
|
|
29
|
+
return (isCircleV2FastChain(fromChain.network, fromChain.chain) &&
|
|
30
|
+
isCircleV2Chain(toChain.network, toChain.chain));
|
|
31
|
+
}
|
|
32
|
+
static async supportedDestinationTokens(sourceToken, fromChain, toChain) {
|
|
33
|
+
if (!this.isPathSupported(fromChain, toChain)) {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
// Ensure the source token is USDC
|
|
37
|
+
const sourceChainUsdcContract = usdcContracts[fromChain.network]?.[fromChain.chain];
|
|
38
|
+
if (!(sourceChainUsdcContract &&
|
|
39
|
+
isSameToken(sourceToken, Wormhole.tokenId(fromChain.chain, sourceChainUsdcContract)))) {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
const { network, chain } = toChain;
|
|
43
|
+
const destChainUsdcContract = usdcContracts[network]?.[chain];
|
|
44
|
+
if (!destChainUsdcContract)
|
|
45
|
+
return [];
|
|
46
|
+
return [Wormhole.chainAddress(chain, destChainUsdcContract)];
|
|
47
|
+
}
|
|
48
|
+
async validate(request, params) {
|
|
49
|
+
if (!CCTPv2FastExecutorRoute.isPathSupported(request.fromChain, request.toChain)) {
|
|
50
|
+
return {
|
|
51
|
+
valid: false,
|
|
52
|
+
error: new Error("Can only transfer from a Circle V2 fast chain to a Circle V2 chain"),
|
|
53
|
+
params,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
if (params.options?.nativeGas &&
|
|
57
|
+
(params.options.nativeGas < 0 || params.options.nativeGas > 1)) {
|
|
58
|
+
return {
|
|
59
|
+
valid: false,
|
|
60
|
+
error: new Error("Invalid native gas percentage"),
|
|
61
|
+
params,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
const validatedParams = {
|
|
65
|
+
normalizedParams: {
|
|
66
|
+
amount: request.parseAmount(params.amount),
|
|
67
|
+
},
|
|
68
|
+
options: params.options ?? this.getDefaultOptions(),
|
|
69
|
+
...params,
|
|
70
|
+
};
|
|
71
|
+
return { valid: true, params: validatedParams };
|
|
72
|
+
}
|
|
73
|
+
async quote(request, params) {
|
|
74
|
+
const { fromChain, toChain } = request;
|
|
75
|
+
try {
|
|
76
|
+
const quoteDetails = await fetchExecutorQuote(request, params, this.staticConfig.referrerFeeDbps, "ERC2");
|
|
77
|
+
const { remainingAmount, estimatedCost, gasDropOff, expiryTime } = quoteDetails;
|
|
78
|
+
const allowance = await getCircleV2FastBurnAllowance(fromChain.network);
|
|
79
|
+
if (allowance <= remainingAmount) {
|
|
80
|
+
return {
|
|
81
|
+
success: false,
|
|
82
|
+
error: new Error("Insufficient allowance for fast transfer"),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
const fastBurnFeeBps = await getCircleV2FastBurnFee(fromChain.network, fromChain.chain, toChain.chain);
|
|
86
|
+
// round up or the fee may be too low and the transfer will be slow
|
|
87
|
+
const fastTransferMaxFee = (remainingAmount * fastBurnFeeBps + 10000n - 1n) / 10000n;
|
|
88
|
+
const receivedAmount = remainingAmount - fastTransferMaxFee;
|
|
89
|
+
if (receivedAmount <= 0n) {
|
|
90
|
+
return {
|
|
91
|
+
success: false,
|
|
92
|
+
error: new Error("Amount after fast transfer fee <= 0"),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
const eta = fastTransferETAs[fromChain.network]?.[fromChain.chain];
|
|
96
|
+
const [srcNativeDecimals, dstNativeDecimals] = await Promise.all([
|
|
97
|
+
fromChain.getDecimals("native"),
|
|
98
|
+
toChain.getDecimals("native"),
|
|
99
|
+
]);
|
|
100
|
+
return {
|
|
101
|
+
success: true,
|
|
102
|
+
params,
|
|
103
|
+
sourceToken: {
|
|
104
|
+
token: request.source.id,
|
|
105
|
+
amount: params.normalizedParams.amount,
|
|
106
|
+
},
|
|
107
|
+
destinationToken: {
|
|
108
|
+
token: request.destination.id,
|
|
109
|
+
amount: amount.fromBaseUnits(receivedAmount, request.destination.decimals),
|
|
110
|
+
},
|
|
111
|
+
relayFee: {
|
|
112
|
+
token: nativeTokenId(fromChain.chain),
|
|
113
|
+
amount: amount.fromBaseUnits(estimatedCost, srcNativeDecimals),
|
|
114
|
+
},
|
|
115
|
+
destinationNativeGas: amount.fromBaseUnits(gasDropOff, dstNativeDecimals),
|
|
116
|
+
eta,
|
|
117
|
+
expires: expiryTime,
|
|
118
|
+
details: {
|
|
119
|
+
...quoteDetails,
|
|
120
|
+
minFinalityThreshold: CircleV2FinalityThreshold.CONFIRMED,
|
|
121
|
+
fastTransferMaxFee,
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
catch (e) {
|
|
126
|
+
return {
|
|
127
|
+
success: false,
|
|
128
|
+
error: new Error(e instanceof Error ? e.message : `${e}`),
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=cctpV2Fast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cctpV2Fast.js","sourceRoot":"","sources":["../../../src/routes/cctpV2Fast.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAEL,WAAW,EACX,aAAa,GAEd,MAAM,sCAAsC,CA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d,KAAK,EAAE,IAAI,KAAK,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;aAC1D,CAAC;QACJ,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Network } from "@wormhole-foundation/sdk-base";
|
|
2
|
+
import { ChainContext, TokenId } from "@wormhole-foundation/sdk-definitions";
|
|
3
|
+
import { routes, Wormhole } from "@wormhole-foundation/sdk-connect";
|
|
4
|
+
import { CCTPv2BaseRoute, CCTPv2ExecutorRoute, Qr, Tp, Vp, Vr } from "./cctpV2Base";
|
|
5
|
+
export declare function cctpV2StandardExecutorRoute(config?: CCTPv2ExecutorRoute.Config): {
|
|
6
|
+
new <N extends Network>(wh: Wormhole<N>): {
|
|
7
|
+
readonly staticConfig: any;
|
|
8
|
+
validate(request: routes.RouteTransferRequest<N>, params: Tp): Promise<Vr>;
|
|
9
|
+
quote(request: routes.RouteTransferRequest<N>, params: Vp): Promise<Qr>;
|
|
10
|
+
getDefaultOptions(): import("./cctpV2Base").Op;
|
|
11
|
+
initiate(request: routes.RouteTransferRequest<N>, signer: import("@wormhole-foundation/sdk-definitions").Signer, quote: import("./cctpV2Base").Q, to: import("@wormhole-foundation/sdk-definitions").ChainAddress): Promise<import("./cctpV2Base").R>;
|
|
12
|
+
track(receipt: import("./cctpV2Base").R, timeout?: number): AsyncGenerator<import("@wormhole-foundation/sdk-connect").SourceInitiatedTransferReceipt<"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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia", "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia"> | import("@wormhole-foundation/sdk-connect").FailedTransferReceipt<CCTPv2ExecutorRoute.Attestation, "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia", "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia"> | import("@wormhole-foundation/sdk-connect").SourceFinalizedTransferReceipt<CCTPv2ExecutorRoute.Attestation, "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia", "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia"> | import("@wormhole-foundation/sdk-connect").AttestedTransferReceipt<CCTPv2ExecutorRoute.Attestation, "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia", "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia"> | import("@wormhole-foundation/sdk-connect").CompletedTransferReceipt<CCTPv2ExecutorRoute.Attestation, "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia", "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" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia">, import("./cctpV2Base").R, unknown>;
|
|
13
|
+
complete(signer: import("@wormhole-foundation/sdk-definitions").Signer, receipt: import("./cctpV2Base").R): Promise<import("./cctpV2Base").R>;
|
|
14
|
+
resume(tx: import("@wormhole-foundation/sdk-definitions").TransactionId): Promise<import("./cctpV2Base").R>;
|
|
15
|
+
wh: Wormhole<N>;
|
|
16
|
+
transferUrl(txid: string): string;
|
|
17
|
+
};
|
|
18
|
+
config: CCTPv2ExecutorRoute.Config;
|
|
19
|
+
meta: {
|
|
20
|
+
name: string;
|
|
21
|
+
provider: string;
|
|
22
|
+
};
|
|
23
|
+
isPathSupported<N extends Network>(fromChain: ChainContext<N>, toChain: ChainContext<N>): boolean;
|
|
24
|
+
supportedDestinationTokens<N extends Network>(sourceToken: TokenId, fromChain: ChainContext<N>, toChain: ChainContext<N>): Promise<TokenId[]>;
|
|
25
|
+
NATIVE_GAS_DROPOFF_SUPPORTED: boolean;
|
|
26
|
+
supportedNetworks(): Network[];
|
|
27
|
+
supportedChains(network: Network): import("@wormhole-foundation/sdk-base").Chain[];
|
|
28
|
+
IS_AUTOMATIC: boolean;
|
|
29
|
+
};
|
|
30
|
+
export declare class CCTPv2StandardExecutorRoute<N extends Network> extends CCTPv2BaseRoute<N> implements routes.StaticRouteMethods<typeof CCTPv2StandardExecutorRoute> {
|
|
31
|
+
readonly staticConfig: any;
|
|
32
|
+
static config: CCTPv2ExecutorRoute.Config;
|
|
33
|
+
static meta: {
|
|
34
|
+
name: string;
|
|
35
|
+
provider: string;
|
|
36
|
+
};
|
|
37
|
+
static isPathSupported<N extends Network>(fromChain: ChainContext<N>, toChain: ChainContext<N>): boolean;
|
|
38
|
+
static supportedDestinationTokens<N extends Network>(sourceToken: TokenId, fromChain: ChainContext<N>, toChain: ChainContext<N>): Promise<TokenId[]>;
|
|
39
|
+
validate(request: routes.RouteTransferRequest<N>, params: Tp): Promise<Vr>;
|
|
40
|
+
quote(request: routes.RouteTransferRequest<N>, params: Vp): Promise<Qr>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=cctpV2Standard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cctpV2Standard.d.ts","sourceRoot":"","sources":["../../../src/routes/cctpV2Standard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EACL,YAAY,EAGZ,OAAO,EACR,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAMpE,OAAO,EACL,eAAe,EACf,mBAAmB,EAEnB,EAAE,EACF,EAAE,EACF,EAAE,EACF,EAAE,EACH,MAAM,cAAc,CAAC;AAItB,wBAAgB,2BAA2B,CACzC,MAAM,GAAE,mBAAmB,CAAC,MAAgC;SAM1D,CAAC,SAAS,OAAO;;kEAoET,EAAE,GACT,OAAO,CAAC,EAAE,CAAC;+DAsCJ,EAAE,GACT,OAAO,CAAC,EAAE,CAAC;;;;;;;;;;;;;;oBArFS,CAAC,SAAS,OAAO,aAC3B,YAAY,CAAC,CAAC,CAAC,WACjB,YAAY,CAAC,CAAC,CAAC,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