@m0-foundation/ntt-sdk-route 0.0.12 → 0.0.13
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 +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -6,7 +6,7 @@ import { EvmChains, EvmUnsignedTransaction } from '@wormhole-foundation/sdk-evm'
|
|
|
6
6
|
import { SolanaChains, SolanaUnsignedTransaction } from '@wormhole-foundation/sdk-solana';
|
|
7
7
|
import { NttRoute } from '@wormhole-foundation/sdk-route-ntt';
|
|
8
8
|
import { TransactionRequest } from 'ethers';
|
|
9
|
-
import { PublicKey, TransactionInstruction, Connection, AddressLookupTableAccount } from '@solana/web3.js';
|
|
9
|
+
import { Keypair, PublicKey, TransactionInstruction, Connection, AddressLookupTableAccount } from '@solana/web3.js';
|
|
10
10
|
|
|
11
11
|
type Op = NttRoute.Options;
|
|
12
12
|
type Tp = routes.TransferParams<Op>;
|
|
@@ -44,7 +44,7 @@ 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
|
+
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, outboxItem?: Keypair): AsyncGenerator<SolanaUnsignedTransaction<N, C>>;
|
|
48
48
|
track(receipt: R, timeout?: number): AsyncGenerator<R, void, unknown>;
|
|
49
49
|
}
|
|
50
50
|
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { EvmChains, EvmUnsignedTransaction } from '@wormhole-foundation/sdk-evm'
|
|
|
6
6
|
import { SolanaChains, SolanaUnsignedTransaction } from '@wormhole-foundation/sdk-solana';
|
|
7
7
|
import { NttRoute } from '@wormhole-foundation/sdk-route-ntt';
|
|
8
8
|
import { TransactionRequest } from 'ethers';
|
|
9
|
-
import { PublicKey, TransactionInstruction, Connection, AddressLookupTableAccount } from '@solana/web3.js';
|
|
9
|
+
import { Keypair, PublicKey, TransactionInstruction, Connection, AddressLookupTableAccount } from '@solana/web3.js';
|
|
10
10
|
|
|
11
11
|
type Op = NttRoute.Options;
|
|
12
12
|
type Tp = routes.TransferParams<Op>;
|
|
@@ -44,7 +44,7 @@ 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
|
+
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, outboxItem?: Keypair): AsyncGenerator<SolanaUnsignedTransaction<N, C>>;
|
|
48
48
|
track(receipt: R, timeout?: number): AsyncGenerator<R, void, unknown>;
|
|
49
49
|
}
|
|
50
50
|
|
package/dist/index.js
CHANGED
|
@@ -824,14 +824,14 @@ var _M0AutomaticRoute = class _M0AutomaticRoute extends sdkConnect.routes.Automa
|
|
|
824
824
|
parallelizable
|
|
825
825
|
);
|
|
826
826
|
}
|
|
827
|
-
async *transferSolanaExtension(ntt, sender, amount2, recipient, sourceToken, destinationToken, options) {
|
|
827
|
+
async *transferSolanaExtension(ntt, sender, amount2, recipient, sourceToken, destinationToken, options, outboxItem) {
|
|
828
828
|
const router = new SolanaRoutes(ntt);
|
|
829
829
|
if ((await ntt.getConfig()).mint.toBase58() === sourceToken) {
|
|
830
830
|
return ntt.transfer(sender, amount2, recipient, options);
|
|
831
831
|
}
|
|
832
832
|
const config = await ntt.getConfig();
|
|
833
833
|
if (config.paused) throw new Error("Contract is paused");
|
|
834
|
-
|
|
834
|
+
outboxItem = outboxItem ?? web3_js.Keypair.generate();
|
|
835
835
|
const payerAddress = new sdkSolana.SolanaAddress(sender).unwrap();
|
|
836
836
|
const ixs = [
|
|
837
837
|
router.getTransferExtensionBurnIx(
|
package/dist/index.mjs
CHANGED
|
@@ -818,14 +818,14 @@ var _M0AutomaticRoute = class _M0AutomaticRoute extends routes.AutomaticRoute {
|
|
|
818
818
|
parallelizable
|
|
819
819
|
);
|
|
820
820
|
}
|
|
821
|
-
async *transferSolanaExtension(ntt, sender, amount2, recipient, sourceToken, destinationToken, options) {
|
|
821
|
+
async *transferSolanaExtension(ntt, sender, amount2, recipient, sourceToken, destinationToken, options, outboxItem) {
|
|
822
822
|
const router = new SolanaRoutes(ntt);
|
|
823
823
|
if ((await ntt.getConfig()).mint.toBase58() === sourceToken) {
|
|
824
824
|
return ntt.transfer(sender, amount2, recipient, options);
|
|
825
825
|
}
|
|
826
826
|
const config = await ntt.getConfig();
|
|
827
827
|
if (config.paused) throw new Error("Contract is paused");
|
|
828
|
-
|
|
828
|
+
outboxItem = outboxItem ?? Keypair.generate();
|
|
829
829
|
const payerAddress = new SolanaAddress(sender).unwrap();
|
|
830
830
|
const ixs = [
|
|
831
831
|
router.getTransferExtensionBurnIx(
|