@m0-foundation/ntt-sdk-route 0.0.9 → 0.0.11
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/dist/index.d.mts +33 -4
- package/dist/index.d.ts +33 -4
- package/dist/index.js +668 -20
- package/dist/index.mjs +665 -22
- package/package.json +13 -7
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Network, routes, Chain, ChainContext, TokenId, Signer, ChainAddress, AccountAddress } from '@wormhole-foundation/sdk-connect';
|
|
2
2
|
import { Ntt } from '@wormhole-foundation/sdk-definitions-ntt';
|
|
3
3
|
import { EvmNtt } from '@wormhole-foundation/sdk-evm-ntt';
|
|
4
|
+
import { SolanaNtt } from '@wormhole-foundation/sdk-solana-ntt';
|
|
4
5
|
import { EvmChains, EvmUnsignedTransaction } from '@wormhole-foundation/sdk-evm';
|
|
6
|
+
import { SolanaChains, SolanaUnsignedTransaction } from '@wormhole-foundation/sdk-solana';
|
|
5
7
|
import { NttRoute } from '@wormhole-foundation/sdk-route-ntt';
|
|
6
8
|
import { TransactionRequest } from 'ethers';
|
|
9
|
+
import { PublicKey, TransactionInstruction, Connection, AddressLookupTableAccount } from '@solana/web3.js';
|
|
7
10
|
|
|
8
11
|
type Op = NttRoute.Options;
|
|
9
12
|
type Tp = routes.TransferParams<Op>;
|
|
@@ -18,14 +21,11 @@ type Contracts = Ntt.Contracts & {
|
|
|
18
21
|
declare class M0AutomaticRoute<N extends Network> extends routes.AutomaticRoute<N, Op, Vp, R> implements routes.StaticRouteMethods<typeof M0AutomaticRoute> {
|
|
19
22
|
static NATIVE_GAS_DROPOFF_SUPPORTED: boolean;
|
|
20
23
|
static EVM_WRAPPED_M_TOKEN: string;
|
|
21
|
-
static SOLANA_MAINNET_M_TOKEN: string;
|
|
22
|
-
static SOLANA_TESTNET_M_TOKEN: string;
|
|
23
24
|
static EVM_CONTRACTS: Contracts;
|
|
24
25
|
static meta: {
|
|
25
26
|
name: string;
|
|
26
27
|
provider: string;
|
|
27
28
|
};
|
|
28
|
-
static solanaContracts(network: Network): Contracts;
|
|
29
29
|
static supportedNetworks(): Network[];
|
|
30
30
|
static isPlatformSupported(platform: string): boolean;
|
|
31
31
|
static supportedChains(network: Network): Chain[];
|
|
@@ -44,7 +44,36 @@ declare class M0AutomaticRoute<N extends Network> extends routes.AutomaticRoute<
|
|
|
44
44
|
*/
|
|
45
45
|
transferMLike<N extends Network, C extends EvmChains>(ntt: EvmNtt<N, C>, sender: AccountAddress<C>, amount: bigint, destination: ChainAddress, sourceToken: string, destinationToken: string, options: Ntt.TransferOptions): AsyncGenerator<EvmUnsignedTransaction<N, C>>;
|
|
46
46
|
createUnsignedTx<N extends Network, C extends EvmChains>(ntt: EvmNtt<N, C>, txReq: TransactionRequest, description: string, parallelizable?: boolean): EvmUnsignedTransaction<N, C>;
|
|
47
|
+
transferSolanaExtension<N extends Network, C extends SolanaChains>(ntt: SolanaNtt<N, C>, sender: AccountAddress<C>, amount: bigint, recipient: ChainAddress, sourceToken: string, destinationToken: string, options: Ntt.TransferOptions): AsyncGenerator<SolanaUnsignedTransaction<N, C>>;
|
|
47
48
|
track(receipt: R, timeout?: number): AsyncGenerator<R, void, unknown>;
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
type SvmNetwork = Exclude<Network, "Devnet">;
|
|
52
|
+
type ExtensionDetails = {
|
|
53
|
+
program: PublicKey;
|
|
54
|
+
tokenProgram: PublicKey;
|
|
55
|
+
};
|
|
56
|
+
declare class SolanaRoutes<N extends Network, C extends SolanaChains> {
|
|
57
|
+
ntt: SolanaNtt<N, C>;
|
|
58
|
+
network: SvmNetwork;
|
|
59
|
+
programs: Record<string, PublicKey>;
|
|
60
|
+
extPrograms: Record<string, ExtensionDetails>;
|
|
61
|
+
constructor(ntt: SolanaNtt<N, C>);
|
|
62
|
+
private static getPrograms;
|
|
63
|
+
private static getExtPrograms;
|
|
64
|
+
static getSolanaContracts(chainContext: ChainContext<Network>): Ntt.Contracts & {
|
|
65
|
+
mLikeTokens: string[];
|
|
66
|
+
};
|
|
67
|
+
getTransferExtensionBurnIx(amount: bigint, recipient: ChainAddress, payer: PublicKey, outboxItem: PublicKey, extMint: PublicKey, destinationToken: Uint8Array, shouldQueue?: boolean): TransactionInstruction;
|
|
68
|
+
getReleaseInboundMintExtensionIx(nttMessage: Ntt.Message, emitterChain: Chain, payer: PublicKey, extMint: PublicKey, extAta: PublicKey): TransactionInstruction;
|
|
69
|
+
getAddressLookupTableAccounts(connection: Connection): Promise<AddressLookupTableAccount>;
|
|
70
|
+
static createReleaseInboundMintInstruction<N extends Network, C extends SolanaChains>(ntt: SolanaNtt<N, C>, args: {
|
|
71
|
+
payer: PublicKey;
|
|
72
|
+
chain: Chain;
|
|
73
|
+
nttMessage: Ntt.Message;
|
|
74
|
+
recipient: PublicKey;
|
|
75
|
+
revertWhenNotReady: boolean;
|
|
76
|
+
}): Promise<TransactionInstruction[]>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export { M0AutomaticRoute, SolanaRoutes };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Network, routes, Chain, ChainContext, TokenId, Signer, ChainAddress, AccountAddress } from '@wormhole-foundation/sdk-connect';
|
|
2
2
|
import { Ntt } from '@wormhole-foundation/sdk-definitions-ntt';
|
|
3
3
|
import { EvmNtt } from '@wormhole-foundation/sdk-evm-ntt';
|
|
4
|
+
import { SolanaNtt } from '@wormhole-foundation/sdk-solana-ntt';
|
|
4
5
|
import { EvmChains, EvmUnsignedTransaction } from '@wormhole-foundation/sdk-evm';
|
|
6
|
+
import { SolanaChains, SolanaUnsignedTransaction } from '@wormhole-foundation/sdk-solana';
|
|
5
7
|
import { NttRoute } from '@wormhole-foundation/sdk-route-ntt';
|
|
6
8
|
import { TransactionRequest } from 'ethers';
|
|
9
|
+
import { PublicKey, TransactionInstruction, Connection, AddressLookupTableAccount } from '@solana/web3.js';
|
|
7
10
|
|
|
8
11
|
type Op = NttRoute.Options;
|
|
9
12
|
type Tp = routes.TransferParams<Op>;
|
|
@@ -18,14 +21,11 @@ type Contracts = Ntt.Contracts & {
|
|
|
18
21
|
declare class M0AutomaticRoute<N extends Network> extends routes.AutomaticRoute<N, Op, Vp, R> implements routes.StaticRouteMethods<typeof M0AutomaticRoute> {
|
|
19
22
|
static NATIVE_GAS_DROPOFF_SUPPORTED: boolean;
|
|
20
23
|
static EVM_WRAPPED_M_TOKEN: string;
|
|
21
|
-
static SOLANA_MAINNET_M_TOKEN: string;
|
|
22
|
-
static SOLANA_TESTNET_M_TOKEN: string;
|
|
23
24
|
static EVM_CONTRACTS: Contracts;
|
|
24
25
|
static meta: {
|
|
25
26
|
name: string;
|
|
26
27
|
provider: string;
|
|
27
28
|
};
|
|
28
|
-
static solanaContracts(network: Network): Contracts;
|
|
29
29
|
static supportedNetworks(): Network[];
|
|
30
30
|
static isPlatformSupported(platform: string): boolean;
|
|
31
31
|
static supportedChains(network: Network): Chain[];
|
|
@@ -44,7 +44,36 @@ declare class M0AutomaticRoute<N extends Network> extends routes.AutomaticRoute<
|
|
|
44
44
|
*/
|
|
45
45
|
transferMLike<N extends Network, C extends EvmChains>(ntt: EvmNtt<N, C>, sender: AccountAddress<C>, amount: bigint, destination: ChainAddress, sourceToken: string, destinationToken: string, options: Ntt.TransferOptions): AsyncGenerator<EvmUnsignedTransaction<N, C>>;
|
|
46
46
|
createUnsignedTx<N extends Network, C extends EvmChains>(ntt: EvmNtt<N, C>, txReq: TransactionRequest, description: string, parallelizable?: boolean): EvmUnsignedTransaction<N, C>;
|
|
47
|
+
transferSolanaExtension<N extends Network, C extends SolanaChains>(ntt: SolanaNtt<N, C>, sender: AccountAddress<C>, amount: bigint, recipient: ChainAddress, sourceToken: string, destinationToken: string, options: Ntt.TransferOptions): AsyncGenerator<SolanaUnsignedTransaction<N, C>>;
|
|
47
48
|
track(receipt: R, timeout?: number): AsyncGenerator<R, void, unknown>;
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
type SvmNetwork = Exclude<Network, "Devnet">;
|
|
52
|
+
type ExtensionDetails = {
|
|
53
|
+
program: PublicKey;
|
|
54
|
+
tokenProgram: PublicKey;
|
|
55
|
+
};
|
|
56
|
+
declare class SolanaRoutes<N extends Network, C extends SolanaChains> {
|
|
57
|
+
ntt: SolanaNtt<N, C>;
|
|
58
|
+
network: SvmNetwork;
|
|
59
|
+
programs: Record<string, PublicKey>;
|
|
60
|
+
extPrograms: Record<string, ExtensionDetails>;
|
|
61
|
+
constructor(ntt: SolanaNtt<N, C>);
|
|
62
|
+
private static getPrograms;
|
|
63
|
+
private static getExtPrograms;
|
|
64
|
+
static getSolanaContracts(chainContext: ChainContext<Network>): Ntt.Contracts & {
|
|
65
|
+
mLikeTokens: string[];
|
|
66
|
+
};
|
|
67
|
+
getTransferExtensionBurnIx(amount: bigint, recipient: ChainAddress, payer: PublicKey, outboxItem: PublicKey, extMint: PublicKey, destinationToken: Uint8Array, shouldQueue?: boolean): TransactionInstruction;
|
|
68
|
+
getReleaseInboundMintExtensionIx(nttMessage: Ntt.Message, emitterChain: Chain, payer: PublicKey, extMint: PublicKey, extAta: PublicKey): TransactionInstruction;
|
|
69
|
+
getAddressLookupTableAccounts(connection: Connection): Promise<AddressLookupTableAccount>;
|
|
70
|
+
static createReleaseInboundMintInstruction<N extends Network, C extends SolanaChains>(ntt: SolanaNtt<N, C>, args: {
|
|
71
|
+
payer: PublicKey;
|
|
72
|
+
chain: Chain;
|
|
73
|
+
nttMessage: Ntt.Message;
|
|
74
|
+
recipient: PublicKey;
|
|
75
|
+
revertWhenNotReady: boolean;
|
|
76
|
+
}): Promise<TransactionInstruction[]>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export { M0AutomaticRoute, SolanaRoutes };
|