@m0-foundation/ntt-sdk-route 0.0.9 → 0.0.10
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 +23 -4
- package/dist/index.d.ts +23 -4
- package/dist/index.js +603 -20
- package/dist/index.mjs +600 -22
- package/package.json +7 -2
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,26 @@ 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>, network: Network, 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 SolanaNetwork = Exclude<Network, "Devnet">;
|
|
52
|
+
type ExtensionDetails = {
|
|
53
|
+
program: PublicKey;
|
|
54
|
+
tokenProgram: PublicKey;
|
|
55
|
+
};
|
|
56
|
+
declare class SolanaRoutes {
|
|
57
|
+
network: SolanaNetwork;
|
|
58
|
+
programs: Record<string, PublicKey>;
|
|
59
|
+
extPrograms: Record<string, ExtensionDetails>;
|
|
60
|
+
constructor(network: Network);
|
|
61
|
+
getSolanaContracts(): Ntt.Contracts & {
|
|
62
|
+
mLikeTokens: string[];
|
|
63
|
+
};
|
|
64
|
+
getTransferExtensionBurnIx<N extends Network, C extends SolanaChains>(ntt: SolanaNtt<N, C>, amount: bigint, recipient: ChainAddress, payer: PublicKey, outboxItem: PublicKey, extMint: PublicKey, destinationToken: Uint8Array, shouldQueue?: boolean): TransactionInstruction;
|
|
65
|
+
getReleaseInboundMintExtensionIx<N extends Network, C extends SolanaChains>(ntt: SolanaNtt<N, C>, payer: string, inboxItem: PublicKey, mMint: PublicKey, extMint: PublicKey, extAta: PublicKey): TransactionInstruction;
|
|
66
|
+
getAddressLookupTableAccounts(connection: Connection): Promise<AddressLookupTableAccount>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
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,26 @@ 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>, network: Network, 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 SolanaNetwork = Exclude<Network, "Devnet">;
|
|
52
|
+
type ExtensionDetails = {
|
|
53
|
+
program: PublicKey;
|
|
54
|
+
tokenProgram: PublicKey;
|
|
55
|
+
};
|
|
56
|
+
declare class SolanaRoutes {
|
|
57
|
+
network: SolanaNetwork;
|
|
58
|
+
programs: Record<string, PublicKey>;
|
|
59
|
+
extPrograms: Record<string, ExtensionDetails>;
|
|
60
|
+
constructor(network: Network);
|
|
61
|
+
getSolanaContracts(): Ntt.Contracts & {
|
|
62
|
+
mLikeTokens: string[];
|
|
63
|
+
};
|
|
64
|
+
getTransferExtensionBurnIx<N extends Network, C extends SolanaChains>(ntt: SolanaNtt<N, C>, amount: bigint, recipient: ChainAddress, payer: PublicKey, outboxItem: PublicKey, extMint: PublicKey, destinationToken: Uint8Array, shouldQueue?: boolean): TransactionInstruction;
|
|
65
|
+
getReleaseInboundMintExtensionIx<N extends Network, C extends SolanaChains>(ntt: SolanaNtt<N, C>, payer: string, inboxItem: PublicKey, mMint: PublicKey, extMint: PublicKey, extAta: PublicKey): TransactionInstruction;
|
|
66
|
+
getAddressLookupTableAccounts(connection: Connection): Promise<AddressLookupTableAccount>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { M0AutomaticRoute, SolanaRoutes };
|