@wormhole-foundation/sdk-definitions-ntt 2.0.0 → 3.0.0-multi-token.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/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/layouts/index.d.ts +162 -1
- package/dist/cjs/layouts/index.d.ts.map +1 -1
- package/dist/cjs/layouts/index.js +9 -1
- package/dist/cjs/layouts/index.js.map +1 -1
- package/dist/cjs/layouts/multiToken.d.ts +212 -0
- package/dist/cjs/layouts/multiToken.d.ts.map +1 -0
- package/dist/cjs/layouts/multiToken.js +50 -0
- package/dist/cjs/layouts/multiToken.js.map +1 -0
- package/dist/cjs/multiTokenNtt.d.ts +69 -0
- package/dist/cjs/multiTokenNtt.d.ts.map +1 -0
- package/dist/cjs/multiTokenNtt.js +22 -0
- package/dist/cjs/multiTokenNtt.js.map +1 -0
- package/dist/cjs/multiTokenNttWithExecutor.d.ts +24 -0
- package/dist/cjs/multiTokenNttWithExecutor.d.ts.map +1 -0
- package/dist/cjs/multiTokenNttWithExecutor.js +3 -0
- package/dist/cjs/multiTokenNttWithExecutor.js.map +1 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +4 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/layouts/index.d.ts +162 -1
- package/dist/esm/layouts/index.d.ts.map +1 -1
- package/dist/esm/layouts/index.js +8 -0
- package/dist/esm/layouts/index.js.map +1 -1
- package/dist/esm/layouts/multiToken.d.ts +212 -0
- package/dist/esm/layouts/multiToken.d.ts.map +1 -0
- package/dist/esm/layouts/multiToken.js +46 -0
- package/dist/esm/layouts/multiToken.js.map +1 -0
- package/dist/esm/multiTokenNtt.d.ts +69 -0
- package/dist/esm/multiTokenNtt.d.ts.map +1 -0
- package/dist/esm/multiTokenNtt.js +19 -0
- package/dist/esm/multiTokenNtt.js.map +1 -0
- package/dist/esm/multiTokenNttWithExecutor.d.ts +24 -0
- package/dist/esm/multiTokenNttWithExecutor.d.ts.map +1 -0
- package/dist/esm/multiTokenNttWithExecutor.js +2 -0
- package/dist/esm/multiTokenNttWithExecutor.js.map +1 -0
- package/package.json +1 -1
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from "./ntt.js";
|
|
2
2
|
export * from "./nttWithExecutor.js";
|
|
3
|
+
export * from "./multiTokenNtt.js";
|
|
4
|
+
export * from "./multiTokenNttWithExecutor.js";
|
|
3
5
|
export * from "./layouts/index.js";
|
|
4
6
|
export type * from "./layouts/index.js";
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AASA,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gCAAgC,CAAC;AAE/C,cAAc,oBAAoB,CAAC;AACnC,mBAAmB,oBAAoB,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -17,7 +17,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
const sdk_definitions_1 = require("@wormhole-foundation/sdk-definitions");
|
|
18
18
|
const index_js_1 = require("./layouts/index.js");
|
|
19
19
|
(0, sdk_definitions_1.registerPayloadTypes)("Ntt", index_js_1.nttNamedPayloads);
|
|
20
|
+
(0, sdk_definitions_1.registerPayloadTypes)("MultiTokenNtt", index_js_1.multiTokenNttNamedPayloads);
|
|
20
21
|
__exportStar(require("./ntt.js"), exports);
|
|
21
22
|
__exportStar(require("./nttWithExecutor.js"), exports);
|
|
23
|
+
__exportStar(require("./multiTokenNtt.js"), exports);
|
|
24
|
+
__exportStar(require("./multiTokenNttWithExecutor.js"), exports);
|
|
22
25
|
__exportStar(require("./layouts/index.js"), exports);
|
|
23
26
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0EAA4E;AAC5E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0EAA4E;AAC5E,iDAG4B;AAE5B,IAAA,sCAAoB,EAAC,KAAK,EAAE,2BAAgB,CAAC,CAAC;AAC9C,IAAA,sCAAoB,EAAC,eAAe,EAAE,qCAA0B,CAAC,CAAC;AAElE,2CAAyB;AACzB,uDAAqC;AACrC,qDAAmC;AACnC,iEAA+C;AAE/C,qDAAmC"}
|
|
@@ -385,14 +385,174 @@ export declare const nttNamedPayloads: readonly [readonly ["WormholeTransfer", r
|
|
|
385
385
|
};
|
|
386
386
|
readonly name: "transceiver";
|
|
387
387
|
}]]];
|
|
388
|
+
export declare const multiTokenNttNamedPayloads: readonly [readonly ["WormholeTransfer", readonly [{
|
|
389
|
+
readonly name: "prefix";
|
|
390
|
+
readonly binary: "bytes";
|
|
391
|
+
readonly custom: Uint8Array;
|
|
392
|
+
readonly omit: true;
|
|
393
|
+
}, {
|
|
394
|
+
readonly binary: "bytes";
|
|
395
|
+
readonly size: 32;
|
|
396
|
+
readonly custom: {
|
|
397
|
+
to: (val: Uint8Array) => import("@wormhole-foundation/sdk-definitions").UniversalAddress;
|
|
398
|
+
from: (val: import("@wormhole-foundation/sdk-definitions").UniversalAddress) => Uint8Array;
|
|
399
|
+
};
|
|
400
|
+
readonly name: "sourceNttManager";
|
|
401
|
+
}, {
|
|
402
|
+
readonly binary: "bytes";
|
|
403
|
+
readonly size: 32;
|
|
404
|
+
readonly custom: {
|
|
405
|
+
to: (val: Uint8Array) => import("@wormhole-foundation/sdk-definitions").UniversalAddress;
|
|
406
|
+
from: (val: import("@wormhole-foundation/sdk-definitions").UniversalAddress) => Uint8Array;
|
|
407
|
+
};
|
|
408
|
+
readonly name: "recipientNttManager";
|
|
409
|
+
}, import("binary-layout").CustomizableBytesReturn<{
|
|
410
|
+
readonly name: "nttManagerPayload";
|
|
411
|
+
readonly lengthSize: 2;
|
|
412
|
+
}, readonly [{
|
|
413
|
+
readonly name: "id";
|
|
414
|
+
readonly binary: "bytes";
|
|
415
|
+
readonly size: 32;
|
|
416
|
+
}, {
|
|
417
|
+
readonly binary: "bytes";
|
|
418
|
+
readonly size: 32;
|
|
419
|
+
readonly custom: {
|
|
420
|
+
to: (val: Uint8Array) => import("@wormhole-foundation/sdk-definitions").UniversalAddress;
|
|
421
|
+
from: (val: import("@wormhole-foundation/sdk-definitions").UniversalAddress) => Uint8Array;
|
|
422
|
+
};
|
|
423
|
+
readonly name: "sender";
|
|
424
|
+
}, import("binary-layout").CustomizableBytesReturn<{
|
|
425
|
+
readonly name: "payload";
|
|
426
|
+
readonly lengthSize: 2;
|
|
427
|
+
}, readonly [{
|
|
428
|
+
readonly name: "prefix";
|
|
429
|
+
readonly binary: "bytes";
|
|
430
|
+
readonly custom: Uint8Array;
|
|
431
|
+
readonly omit: true;
|
|
432
|
+
}, {
|
|
433
|
+
readonly custom: {
|
|
434
|
+
to: (val: number) => "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Fogo" | "Sonic" | "Converge" | "Plume" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia";
|
|
435
|
+
from: (val: "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Fogo" | "Sonic" | "Converge" | "Plume" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia") => number;
|
|
436
|
+
};
|
|
437
|
+
readonly binary: "uint";
|
|
438
|
+
readonly size: 2;
|
|
439
|
+
readonly name: "toChain";
|
|
440
|
+
}, {
|
|
441
|
+
readonly binary: "bytes";
|
|
442
|
+
readonly size: 32;
|
|
443
|
+
readonly custom: {
|
|
444
|
+
to: (val: Uint8Array) => import("@wormhole-foundation/sdk-definitions").UniversalAddress;
|
|
445
|
+
from: (val: import("@wormhole-foundation/sdk-definitions").UniversalAddress) => Uint8Array;
|
|
446
|
+
};
|
|
447
|
+
readonly name: "callee";
|
|
448
|
+
}, {
|
|
449
|
+
readonly binary: "bytes";
|
|
450
|
+
readonly size: 32;
|
|
451
|
+
readonly custom: {
|
|
452
|
+
to: (val: Uint8Array) => import("@wormhole-foundation/sdk-definitions").UniversalAddress;
|
|
453
|
+
from: (val: import("@wormhole-foundation/sdk-definitions").UniversalAddress) => Uint8Array;
|
|
454
|
+
};
|
|
455
|
+
readonly name: "sender";
|
|
456
|
+
}, import("binary-layout").CustomizableBytesReturn<{
|
|
457
|
+
readonly name: "data";
|
|
458
|
+
readonly lengthSize: 2;
|
|
459
|
+
}, readonly [{
|
|
460
|
+
readonly name: "prefix";
|
|
461
|
+
readonly binary: "bytes";
|
|
462
|
+
readonly custom: Uint8Array;
|
|
463
|
+
readonly omit: true;
|
|
464
|
+
}, {
|
|
465
|
+
readonly binary: "bytes";
|
|
466
|
+
readonly layout: readonly [{
|
|
467
|
+
readonly name: "decimals";
|
|
468
|
+
readonly binary: "uint";
|
|
469
|
+
readonly size: 1;
|
|
470
|
+
}, {
|
|
471
|
+
readonly name: "amount";
|
|
472
|
+
readonly binary: "uint";
|
|
473
|
+
readonly size: 8;
|
|
474
|
+
}];
|
|
475
|
+
readonly name: "trimmedAmount";
|
|
476
|
+
}, {
|
|
477
|
+
readonly binary: "bytes";
|
|
478
|
+
readonly layout: readonly [{
|
|
479
|
+
readonly binary: "bytes";
|
|
480
|
+
readonly layout: readonly [{
|
|
481
|
+
readonly binary: "bytes";
|
|
482
|
+
readonly size: number;
|
|
483
|
+
readonly custom: {
|
|
484
|
+
to: (val: Uint8Array) => string;
|
|
485
|
+
from: (val: string) => Uint8Array;
|
|
486
|
+
};
|
|
487
|
+
readonly name: "name";
|
|
488
|
+
}, {
|
|
489
|
+
readonly binary: "bytes";
|
|
490
|
+
readonly size: number;
|
|
491
|
+
readonly custom: {
|
|
492
|
+
to: (val: Uint8Array) => string;
|
|
493
|
+
from: (val: string) => Uint8Array;
|
|
494
|
+
};
|
|
495
|
+
readonly name: "symbol";
|
|
496
|
+
}, {
|
|
497
|
+
readonly name: "decimals";
|
|
498
|
+
readonly binary: "uint";
|
|
499
|
+
readonly size: 1;
|
|
500
|
+
}];
|
|
501
|
+
readonly name: "meta";
|
|
502
|
+
}, {
|
|
503
|
+
readonly binary: "bytes";
|
|
504
|
+
readonly layout: readonly [{
|
|
505
|
+
readonly custom: {
|
|
506
|
+
to: (val: number) => "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Fogo" | "Sonic" | "Converge" | "Plume" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia";
|
|
507
|
+
from: (val: "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Fogo" | "Sonic" | "Converge" | "Plume" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia") => number;
|
|
508
|
+
};
|
|
509
|
+
readonly binary: "uint";
|
|
510
|
+
readonly size: 2;
|
|
511
|
+
readonly name: "chainId";
|
|
512
|
+
}, {
|
|
513
|
+
readonly binary: "bytes";
|
|
514
|
+
readonly size: 32;
|
|
515
|
+
readonly custom: {
|
|
516
|
+
to: (val: Uint8Array) => import("@wormhole-foundation/sdk-definitions").UniversalAddress;
|
|
517
|
+
from: (val: import("@wormhole-foundation/sdk-definitions").UniversalAddress) => Uint8Array;
|
|
518
|
+
};
|
|
519
|
+
readonly name: "tokenAddress";
|
|
520
|
+
}];
|
|
521
|
+
readonly name: "token";
|
|
522
|
+
}];
|
|
523
|
+
readonly name: "token";
|
|
524
|
+
}, {
|
|
525
|
+
readonly binary: "bytes";
|
|
526
|
+
readonly size: 32;
|
|
527
|
+
readonly custom: {
|
|
528
|
+
to: (val: Uint8Array) => import("@wormhole-foundation/sdk-definitions").UniversalAddress;
|
|
529
|
+
from: (val: import("@wormhole-foundation/sdk-definitions").UniversalAddress) => Uint8Array;
|
|
530
|
+
};
|
|
531
|
+
readonly name: "sender";
|
|
532
|
+
}, {
|
|
533
|
+
readonly binary: "bytes";
|
|
534
|
+
readonly size: 32;
|
|
535
|
+
readonly custom: {
|
|
536
|
+
to: (val: Uint8Array) => import("@wormhole-foundation/sdk-definitions").UniversalAddress;
|
|
537
|
+
from: (val: import("@wormhole-foundation/sdk-definitions").UniversalAddress) => Uint8Array;
|
|
538
|
+
};
|
|
539
|
+
readonly name: "to";
|
|
540
|
+
}, import("binary-layout").CustomizableBytesReturn<{
|
|
541
|
+
readonly name: "additionalPayload";
|
|
542
|
+
readonly lengthSize: 2;
|
|
543
|
+
}, import("binary-layout").CustomizableBytes>]>]>]>, import("binary-layout").CustomizableBytesReturn<{
|
|
544
|
+
readonly name: "transceiverPayload";
|
|
545
|
+
readonly lengthSize: 2;
|
|
546
|
+
}, Uint8Array>]]];
|
|
388
547
|
declare module "@wormhole-foundation/sdk-definitions" {
|
|
389
548
|
namespace WormholeRegistry {
|
|
390
|
-
interface PayloadLiteralToLayoutMapping extends RegisterPayloadTypes<"Ntt", typeof nttNamedPayloads> {
|
|
549
|
+
interface PayloadLiteralToLayoutMapping extends RegisterPayloadTypes<"Ntt", typeof nttNamedPayloads>, RegisterPayloadTypes<"MultiTokenNtt", typeof multiTokenNttNamedPayloads> {
|
|
391
550
|
}
|
|
392
551
|
}
|
|
393
552
|
}
|
|
394
553
|
export * from "./amount.js";
|
|
395
554
|
export * from "./manager.js";
|
|
555
|
+
export * from "./multiToken.js";
|
|
396
556
|
export * from "./prefix.js";
|
|
397
557
|
export * from "./transceiver.js";
|
|
398
558
|
export * from "./transceiverInstructions.js";
|
|
@@ -400,6 +560,7 @@ export * from "./transfer.js";
|
|
|
400
560
|
export * from "./wormhole.js";
|
|
401
561
|
export type * from "./amount.js";
|
|
402
562
|
export type * from "./manager.js";
|
|
563
|
+
export type * from "./multiToken.js";
|
|
403
564
|
export type * from "./prefix.js";
|
|
404
565
|
export type * from "./transceiver.js";
|
|
405
566
|
export type * from "./transceiverInstructions.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layouts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,EAErB,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layouts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,EAErB,MAAM,sCAAsC,CAAC;AAU9C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiBK,CAAC;AAEnC,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBASL,CAAC;AAGnC,OAAO,QAAQ,sCAAsC,CAAC;IACpD,UAAiB,gBAAgB,CAAC;QAChC,UAAU,6BACR,SAAQ,oBAAoB,CAAC,KAAK,EAAE,OAAO,gBAAgB,CAAC,EAC1D,oBAAoB,CAClB,eAAe,EACf,OAAO,0BAA0B,CAClC;SAAG;KACT;CACF;AAED,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAE9B,mBAAmB,aAAa,CAAC;AACjC,mBAAmB,cAAc,CAAC;AAClC,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,aAAa,CAAC;AACjC,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,eAAe,CAAC;AACnC,mBAAmB,eAAe,CAAC"}
|
|
@@ -14,11 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.nttNamedPayloads = void 0;
|
|
17
|
+
exports.multiTokenNttNamedPayloads = exports.nttNamedPayloads = void 0;
|
|
18
18
|
const sdk_definitions_1 = require("@wormhole-foundation/sdk-definitions");
|
|
19
19
|
const manager_js_1 = require("./manager.js");
|
|
20
20
|
const transceiver_js_1 = require("./transceiver.js");
|
|
21
21
|
const transfer_js_1 = require("./transfer.js");
|
|
22
|
+
const multiToken_js_1 = require("./multiToken.js");
|
|
22
23
|
const wormhole_js_1 = require("./wormhole.js");
|
|
23
24
|
exports.nttNamedPayloads = [
|
|
24
25
|
[
|
|
@@ -32,8 +33,15 @@ exports.nttNamedPayloads = [
|
|
|
32
33
|
["TransceiverInfo", transceiver_js_1.transceiverInfo],
|
|
33
34
|
["TransceiverRegistration", transceiver_js_1.transceiverRegistration],
|
|
34
35
|
];
|
|
36
|
+
exports.multiTokenNttNamedPayloads = [
|
|
37
|
+
[
|
|
38
|
+
"WormholeTransfer",
|
|
39
|
+
(0, wormhole_js_1.wormholeTransceiverMessageLayout)((0, manager_js_1.nttManagerMessageLayout)((0, multiToken_js_1.genericMessageLayout)(multiToken_js_1.multiTokenNativeTokenTransferLayout))),
|
|
40
|
+
],
|
|
41
|
+
];
|
|
35
42
|
__exportStar(require("./amount.js"), exports);
|
|
36
43
|
__exportStar(require("./manager.js"), exports);
|
|
44
|
+
__exportStar(require("./multiToken.js"), exports);
|
|
37
45
|
__exportStar(require("./prefix.js"), exports);
|
|
38
46
|
__exportStar(require("./transceiver.js"), exports);
|
|
39
47
|
__exportStar(require("./transceiverInstructions.js"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/layouts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0EAI8C;AAC9C,6CAAuD;AACvD,qDAA4E;AAC5E,+CAA0D;AAC1D,+CAAiE;AAEpD,QAAA,gBAAgB,GAAG;IAC9B;QACE,kBAAkB;QAClB,IAAA,8CAAgC,EAC9B,IAAA,oCAAuB,EAAC,uCAAyB,CAAC,CACnD;KACF;IACD;QACE,iCAAiC;QACjC,IAAA,2CAAyB,EACvB,IAAA,8CAAgC,EAC9B,IAAA,oCAAuB,EAAC,uCAAyB,CAAC,CACnD,CACF;KACF;IACD,CAAC,iBAAiB,EAAE,gCAAe,CAAC;IACpC,CAAC,yBAAyB,EAAE,wCAAuB,CAAC;CACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/layouts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0EAI8C;AAC9C,6CAAuD;AACvD,qDAA4E;AAC5E,+CAA0D;AAC1D,mDAGyB;AACzB,+CAAiE;AAEpD,QAAA,gBAAgB,GAAG;IAC9B;QACE,kBAAkB;QAClB,IAAA,8CAAgC,EAC9B,IAAA,oCAAuB,EAAC,uCAAyB,CAAC,CACnD;KACF;IACD;QACE,iCAAiC;QACjC,IAAA,2CAAyB,EACvB,IAAA,8CAAgC,EAC9B,IAAA,oCAAuB,EAAC,uCAAyB,CAAC,CACnD,CACF;KACF;IACD,CAAC,iBAAiB,EAAE,gCAAe,CAAC;IACpC,CAAC,yBAAyB,EAAE,wCAAuB,CAAC;CACpB,CAAC;AAEtB,QAAA,0BAA0B,GAAG;IACxC;QACE,kBAAkB;QAClB,IAAA,8CAAgC,EAC9B,IAAA,oCAAuB,EACrB,IAAA,oCAAoB,EAAC,mDAAmC,CAAC,CAC1D,CACF;KACF;CAC+B,CAAC;AAcnC,8CAA4B;AAC5B,+CAA6B;AAC7B,kDAAgC;AAChC,8CAA4B;AAC5B,mDAAiC;AACjC,+DAA6C;AAC7C,gDAA8B;AAC9B,gDAA8B"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { CustomizableBytes } from "@wormhole-foundation/sdk-base";
|
|
2
|
+
export declare const tokenMetaLayoutItem: {
|
|
3
|
+
readonly binary: "bytes";
|
|
4
|
+
readonly layout: readonly [{
|
|
5
|
+
readonly binary: "bytes";
|
|
6
|
+
readonly size: number;
|
|
7
|
+
readonly custom: {
|
|
8
|
+
to: (val: Uint8Array) => string;
|
|
9
|
+
from: (val: string) => Uint8Array;
|
|
10
|
+
};
|
|
11
|
+
readonly name: "name";
|
|
12
|
+
}, {
|
|
13
|
+
readonly binary: "bytes";
|
|
14
|
+
readonly size: number;
|
|
15
|
+
readonly custom: {
|
|
16
|
+
to: (val: Uint8Array) => string;
|
|
17
|
+
from: (val: string) => Uint8Array;
|
|
18
|
+
};
|
|
19
|
+
readonly name: "symbol";
|
|
20
|
+
}, {
|
|
21
|
+
readonly name: "decimals";
|
|
22
|
+
readonly binary: "uint";
|
|
23
|
+
readonly size: 1;
|
|
24
|
+
}];
|
|
25
|
+
};
|
|
26
|
+
export declare const tokenIdLayoutItem: {
|
|
27
|
+
readonly binary: "bytes";
|
|
28
|
+
readonly layout: readonly [{
|
|
29
|
+
readonly custom: {
|
|
30
|
+
to: (val: number) => "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Fogo" | "Sonic" | "Converge" | "Plume" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia";
|
|
31
|
+
from: (val: "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Fogo" | "Sonic" | "Converge" | "Plume" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia") => number;
|
|
32
|
+
};
|
|
33
|
+
readonly binary: "uint";
|
|
34
|
+
readonly size: 2;
|
|
35
|
+
readonly name: "chainId";
|
|
36
|
+
}, {
|
|
37
|
+
readonly binary: "bytes";
|
|
38
|
+
readonly size: 32;
|
|
39
|
+
readonly custom: {
|
|
40
|
+
to: (val: Uint8Array) => import("@wormhole-foundation/sdk-definitions").UniversalAddress;
|
|
41
|
+
from: (val: import("@wormhole-foundation/sdk-definitions").UniversalAddress) => Uint8Array;
|
|
42
|
+
};
|
|
43
|
+
readonly name: "tokenAddress";
|
|
44
|
+
}];
|
|
45
|
+
};
|
|
46
|
+
export declare const tokenInfoLayoutItem: {
|
|
47
|
+
readonly binary: "bytes";
|
|
48
|
+
readonly layout: readonly [{
|
|
49
|
+
readonly binary: "bytes";
|
|
50
|
+
readonly layout: readonly [{
|
|
51
|
+
readonly binary: "bytes";
|
|
52
|
+
readonly size: number;
|
|
53
|
+
readonly custom: {
|
|
54
|
+
to: (val: Uint8Array) => string;
|
|
55
|
+
from: (val: string) => Uint8Array;
|
|
56
|
+
};
|
|
57
|
+
readonly name: "name";
|
|
58
|
+
}, {
|
|
59
|
+
readonly binary: "bytes";
|
|
60
|
+
readonly size: number;
|
|
61
|
+
readonly custom: {
|
|
62
|
+
to: (val: Uint8Array) => string;
|
|
63
|
+
from: (val: string) => Uint8Array;
|
|
64
|
+
};
|
|
65
|
+
readonly name: "symbol";
|
|
66
|
+
}, {
|
|
67
|
+
readonly name: "decimals";
|
|
68
|
+
readonly binary: "uint";
|
|
69
|
+
readonly size: 1;
|
|
70
|
+
}];
|
|
71
|
+
readonly name: "meta";
|
|
72
|
+
}, {
|
|
73
|
+
readonly binary: "bytes";
|
|
74
|
+
readonly layout: readonly [{
|
|
75
|
+
readonly custom: {
|
|
76
|
+
to: (val: number) => "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Fogo" | "Sonic" | "Converge" | "Plume" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia";
|
|
77
|
+
from: (val: "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Fogo" | "Sonic" | "Converge" | "Plume" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia") => number;
|
|
78
|
+
};
|
|
79
|
+
readonly binary: "uint";
|
|
80
|
+
readonly size: 2;
|
|
81
|
+
readonly name: "chainId";
|
|
82
|
+
}, {
|
|
83
|
+
readonly binary: "bytes";
|
|
84
|
+
readonly size: 32;
|
|
85
|
+
readonly custom: {
|
|
86
|
+
to: (val: Uint8Array) => import("@wormhole-foundation/sdk-definitions").UniversalAddress;
|
|
87
|
+
from: (val: import("@wormhole-foundation/sdk-definitions").UniversalAddress) => Uint8Array;
|
|
88
|
+
};
|
|
89
|
+
readonly name: "tokenAddress";
|
|
90
|
+
}];
|
|
91
|
+
readonly name: "token";
|
|
92
|
+
}];
|
|
93
|
+
};
|
|
94
|
+
export declare const multiTokenNativeTokenTransferLayout: readonly [{
|
|
95
|
+
readonly name: "prefix";
|
|
96
|
+
readonly binary: "bytes";
|
|
97
|
+
readonly custom: Uint8Array;
|
|
98
|
+
readonly omit: true;
|
|
99
|
+
}, {
|
|
100
|
+
readonly binary: "bytes";
|
|
101
|
+
readonly layout: readonly [{
|
|
102
|
+
readonly name: "decimals";
|
|
103
|
+
readonly binary: "uint";
|
|
104
|
+
readonly size: 1;
|
|
105
|
+
}, {
|
|
106
|
+
readonly name: "amount";
|
|
107
|
+
readonly binary: "uint";
|
|
108
|
+
readonly size: 8;
|
|
109
|
+
}];
|
|
110
|
+
readonly name: "trimmedAmount";
|
|
111
|
+
}, {
|
|
112
|
+
readonly binary: "bytes";
|
|
113
|
+
readonly layout: readonly [{
|
|
114
|
+
readonly binary: "bytes";
|
|
115
|
+
readonly layout: readonly [{
|
|
116
|
+
readonly binary: "bytes";
|
|
117
|
+
readonly size: number;
|
|
118
|
+
readonly custom: {
|
|
119
|
+
to: (val: Uint8Array) => string;
|
|
120
|
+
from: (val: string) => Uint8Array;
|
|
121
|
+
};
|
|
122
|
+
readonly name: "name";
|
|
123
|
+
}, {
|
|
124
|
+
readonly binary: "bytes";
|
|
125
|
+
readonly size: number;
|
|
126
|
+
readonly custom: {
|
|
127
|
+
to: (val: Uint8Array) => string;
|
|
128
|
+
from: (val: string) => Uint8Array;
|
|
129
|
+
};
|
|
130
|
+
readonly name: "symbol";
|
|
131
|
+
}, {
|
|
132
|
+
readonly name: "decimals";
|
|
133
|
+
readonly binary: "uint";
|
|
134
|
+
readonly size: 1;
|
|
135
|
+
}];
|
|
136
|
+
readonly name: "meta";
|
|
137
|
+
}, {
|
|
138
|
+
readonly binary: "bytes";
|
|
139
|
+
readonly layout: readonly [{
|
|
140
|
+
readonly custom: {
|
|
141
|
+
to: (val: number) => "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Fogo" | "Sonic" | "Converge" | "Plume" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia";
|
|
142
|
+
from: (val: "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Fogo" | "Sonic" | "Converge" | "Plume" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia") => number;
|
|
143
|
+
};
|
|
144
|
+
readonly binary: "uint";
|
|
145
|
+
readonly size: 2;
|
|
146
|
+
readonly name: "chainId";
|
|
147
|
+
}, {
|
|
148
|
+
readonly binary: "bytes";
|
|
149
|
+
readonly size: 32;
|
|
150
|
+
readonly custom: {
|
|
151
|
+
to: (val: Uint8Array) => import("@wormhole-foundation/sdk-definitions").UniversalAddress;
|
|
152
|
+
from: (val: import("@wormhole-foundation/sdk-definitions").UniversalAddress) => Uint8Array;
|
|
153
|
+
};
|
|
154
|
+
readonly name: "tokenAddress";
|
|
155
|
+
}];
|
|
156
|
+
readonly name: "token";
|
|
157
|
+
}];
|
|
158
|
+
readonly name: "token";
|
|
159
|
+
}, {
|
|
160
|
+
readonly binary: "bytes";
|
|
161
|
+
readonly size: 32;
|
|
162
|
+
readonly custom: {
|
|
163
|
+
to: (val: Uint8Array) => import("@wormhole-foundation/sdk-definitions").UniversalAddress;
|
|
164
|
+
from: (val: import("@wormhole-foundation/sdk-definitions").UniversalAddress) => Uint8Array;
|
|
165
|
+
};
|
|
166
|
+
readonly name: "sender";
|
|
167
|
+
}, {
|
|
168
|
+
readonly binary: "bytes";
|
|
169
|
+
readonly size: 32;
|
|
170
|
+
readonly custom: {
|
|
171
|
+
to: (val: Uint8Array) => import("@wormhole-foundation/sdk-definitions").UniversalAddress;
|
|
172
|
+
from: (val: import("@wormhole-foundation/sdk-definitions").UniversalAddress) => Uint8Array;
|
|
173
|
+
};
|
|
174
|
+
readonly name: "to";
|
|
175
|
+
}, import("binary-layout").CustomizableBytesReturn<{
|
|
176
|
+
readonly name: "additionalPayload";
|
|
177
|
+
readonly lengthSize: 2;
|
|
178
|
+
}, CustomizableBytes>];
|
|
179
|
+
export declare const genericMessageLayout: <D extends CustomizableBytes>(data?: D) => readonly [{
|
|
180
|
+
readonly name: "prefix";
|
|
181
|
+
readonly binary: "bytes";
|
|
182
|
+
readonly custom: Uint8Array;
|
|
183
|
+
readonly omit: true;
|
|
184
|
+
}, {
|
|
185
|
+
readonly custom: {
|
|
186
|
+
to: (val: number) => "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Fogo" | "Sonic" | "Converge" | "Plume" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia";
|
|
187
|
+
from: (val: "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Blast" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Snaxchain" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Fogo" | "Sonic" | "Converge" | "Plume" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia") => number;
|
|
188
|
+
};
|
|
189
|
+
readonly binary: "uint";
|
|
190
|
+
readonly size: 2;
|
|
191
|
+
readonly name: "toChain";
|
|
192
|
+
}, {
|
|
193
|
+
readonly binary: "bytes";
|
|
194
|
+
readonly size: 32;
|
|
195
|
+
readonly custom: {
|
|
196
|
+
to: (val: Uint8Array) => import("@wormhole-foundation/sdk-definitions").UniversalAddress;
|
|
197
|
+
from: (val: import("@wormhole-foundation/sdk-definitions").UniversalAddress) => Uint8Array;
|
|
198
|
+
};
|
|
199
|
+
readonly name: "callee";
|
|
200
|
+
}, {
|
|
201
|
+
readonly binary: "bytes";
|
|
202
|
+
readonly size: 32;
|
|
203
|
+
readonly custom: {
|
|
204
|
+
to: (val: Uint8Array) => import("@wormhole-foundation/sdk-definitions").UniversalAddress;
|
|
205
|
+
from: (val: import("@wormhole-foundation/sdk-definitions").UniversalAddress) => Uint8Array;
|
|
206
|
+
};
|
|
207
|
+
readonly name: "sender";
|
|
208
|
+
}, import("binary-layout").CustomizableBytesReturn<{
|
|
209
|
+
readonly name: "data";
|
|
210
|
+
readonly lengthSize: 2;
|
|
211
|
+
}, D>];
|
|
212
|
+
//# sourceMappingURL=multiToken.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiToken.d.ts","sourceRoot":"","sources":["../../../src/layouts/multiToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAElB,MAAM,+BAA+B,CAAC;AAWvC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;CAGtB,CAAC;AAOX,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;CAGpB,CAAC;AAOX,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGtB,CAAC;AAEX,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAOrB,CAAC;AAG5B,eAAO,MAAM,oBAAoB,uCAAwC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAO7C,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.genericMessageLayout = exports.multiTokenNativeTokenTransferLayout = exports.tokenInfoLayoutItem = exports.tokenIdLayoutItem = exports.tokenMetaLayoutItem = void 0;
|
|
4
|
+
const sdk_base_1 = require("@wormhole-foundation/sdk-base");
|
|
5
|
+
const sdk_definitions_1 = require("@wormhole-foundation/sdk-definitions");
|
|
6
|
+
const amount_js_1 = require("./amount.js");
|
|
7
|
+
const prefix_js_1 = require("./prefix.js");
|
|
8
|
+
const tokenMetaLayout = [
|
|
9
|
+
{ name: "name", ...sdk_definitions_1.layoutItems.fixedLengthStringItem(32) },
|
|
10
|
+
{ name: "symbol", ...sdk_definitions_1.layoutItems.fixedLengthStringItem(32) },
|
|
11
|
+
{ name: "decimals", binary: "uint", size: 1 },
|
|
12
|
+
];
|
|
13
|
+
exports.tokenMetaLayoutItem = {
|
|
14
|
+
binary: "bytes",
|
|
15
|
+
layout: tokenMetaLayout,
|
|
16
|
+
};
|
|
17
|
+
const tokenIdLayout = [
|
|
18
|
+
{ name: "chainId", ...sdk_definitions_1.layoutItems.chainItem() },
|
|
19
|
+
{ name: "tokenAddress", ...sdk_definitions_1.layoutItems.universalAddressItem },
|
|
20
|
+
];
|
|
21
|
+
exports.tokenIdLayoutItem = {
|
|
22
|
+
binary: "bytes",
|
|
23
|
+
layout: tokenIdLayout,
|
|
24
|
+
};
|
|
25
|
+
const tokenInfoLayout = [
|
|
26
|
+
{ name: "meta", ...exports.tokenMetaLayoutItem },
|
|
27
|
+
{ name: "token", ...exports.tokenIdLayoutItem },
|
|
28
|
+
];
|
|
29
|
+
exports.tokenInfoLayoutItem = {
|
|
30
|
+
binary: "bytes",
|
|
31
|
+
layout: tokenInfoLayout,
|
|
32
|
+
};
|
|
33
|
+
exports.multiTokenNativeTokenTransferLayout = [
|
|
34
|
+
(0, prefix_js_1.prefixItem)([0x99, 0x4e, 0x54, 0x54]),
|
|
35
|
+
{ name: "trimmedAmount", ...amount_js_1.trimmedAmountItem },
|
|
36
|
+
{ name: "token", ...exports.tokenInfoLayoutItem },
|
|
37
|
+
{ name: "sender", ...sdk_definitions_1.layoutItems.universalAddressItem },
|
|
38
|
+
{ name: "to", ...sdk_definitions_1.layoutItems.universalAddressItem },
|
|
39
|
+
(0, sdk_base_1.customizableBytes)({ name: "additionalPayload", lengthSize: 2 }),
|
|
40
|
+
];
|
|
41
|
+
// GmpManager message layout
|
|
42
|
+
const genericMessageLayout = (data) => [
|
|
43
|
+
(0, prefix_js_1.prefixItem)([0x99, 0x47, 0x4d, 0x50]),
|
|
44
|
+
{ name: "toChain", ...sdk_definitions_1.layoutItems.chainItem() },
|
|
45
|
+
{ name: "callee", ...sdk_definitions_1.layoutItems.universalAddressItem },
|
|
46
|
+
{ name: "sender", ...sdk_definitions_1.layoutItems.universalAddressItem },
|
|
47
|
+
(0, sdk_base_1.customizableBytes)({ name: "data", lengthSize: 2 }, data),
|
|
48
|
+
];
|
|
49
|
+
exports.genericMessageLayout = genericMessageLayout;
|
|
50
|
+
//# sourceMappingURL=multiToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiToken.js","sourceRoot":"","sources":["../../../src/layouts/multiToken.ts"],"names":[],"mappings":";;;AAAA,4DAIuC;AACvC,0EAAmE;AACnE,2CAAgD;AAChD,2CAAyC;AAEzC,MAAM,e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AE;IACnD,IAAA,4BAAiB,EAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;CACtC,CAAC;AAE5B,4BAA4B;AACrB,MAAM,oBAAoB,GAAG,CAA8B,IAAQ,EAAE,EAAE,CAC5E;IACE,IAAA,sBAAU,EAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACpC,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,6BAAW,CAAC,SAAS,EAAE,EAAE;IAC/C,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,6BAAW,CAAC,oBAAoB,EAAE;IACvD,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,6BAAW,CAAC,oBAAoB,EAAE;IACvD,IAAA,4BAAiB,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC;CAC/B,CAAC;AAPjB,QAAA,oBAAoB,wBAOH"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type Chain, type Network } from "@wormhole-foundation/sdk-base";
|
|
2
|
+
import { AccountAddress, ChainAddress, EmptyPlatformMap, TokenAddress, TokenId, UniversalAddress, UnsignedTransaction, VAA } from "@wormhole-foundation/sdk-definitions";
|
|
3
|
+
import { NttManagerMessage, genericMessageLayout, multiTokenNativeTokenTransferLayout } from "./layouts/index.js";
|
|
4
|
+
import { Ntt } from "./ntt.js";
|
|
5
|
+
export declare namespace MultiTokenNtt {
|
|
6
|
+
const _protocol = "MultiTokenNtt";
|
|
7
|
+
export type ProtocolName = typeof _protocol;
|
|
8
|
+
export type Contracts = {
|
|
9
|
+
chain: Chain;
|
|
10
|
+
manager: string;
|
|
11
|
+
gmpManager: string;
|
|
12
|
+
transceiver: {
|
|
13
|
+
wormhole?: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export interface TokenMeta {
|
|
17
|
+
name: string;
|
|
18
|
+
symbol: string;
|
|
19
|
+
decimals: number;
|
|
20
|
+
}
|
|
21
|
+
export type Message = NttManagerMessage<ReturnType<typeof genericMessageLayout<typeof multiTokenNativeTokenTransferLayout>>>;
|
|
22
|
+
export type TransferOptions = {};
|
|
23
|
+
export type OriginalTokenId<C extends Chain = Chain> = {
|
|
24
|
+
chain: C;
|
|
25
|
+
address: UniversalAddress;
|
|
26
|
+
};
|
|
27
|
+
export type Attestation = VAA<"MultiTokenNtt:WormholeTransfer">;
|
|
28
|
+
/**
|
|
29
|
+
* messageDigest hashes a message for the Ntt manager, the digest is used
|
|
30
|
+
* to uniquely identify the message
|
|
31
|
+
* @param chain The chain that sent the message
|
|
32
|
+
* @param message The ntt message to hash
|
|
33
|
+
* @returns a 32 byte digest of the message
|
|
34
|
+
*/
|
|
35
|
+
export function messageDigest(chain: Chain, message: Message): Uint8Array;
|
|
36
|
+
export {};
|
|
37
|
+
}
|
|
38
|
+
export interface MultiTokenNtt<N extends Network, C extends Chain> {
|
|
39
|
+
isPaused(): Promise<boolean>;
|
|
40
|
+
quoteDeliveryPrice(destination: Chain, options: MultiTokenNtt.TransferOptions): Promise<bigint>;
|
|
41
|
+
transfer(sender: AccountAddress<C>, token: TokenAddress<C>, amount: bigint, destination: ChainAddress): AsyncGenerator<UnsignedTransaction<N, C>>;
|
|
42
|
+
redeem(attestations: MultiTokenNtt.Attestation[]): AsyncGenerator<UnsignedTransaction<N, C>>;
|
|
43
|
+
getTokenMeta(token: TokenId): Promise<MultiTokenNtt.TokenMeta>;
|
|
44
|
+
getCurrentOutboundCapacity(token: TokenId): Promise<bigint>;
|
|
45
|
+
getOutboundLimit(token: TokenId): Promise<bigint>;
|
|
46
|
+
getCurrentInboundCapacity(originalToken: MultiTokenNtt.OriginalTokenId, fromChain: Chain): Promise<bigint>;
|
|
47
|
+
getRateLimitDuration(): Promise<bigint>;
|
|
48
|
+
getInboundLimit(originalToken: MultiTokenNtt.OriginalTokenId, fromChain: Chain): Promise<bigint | null>;
|
|
49
|
+
getIsApproved(attestation: MultiTokenNtt.Attestation): Promise<boolean>;
|
|
50
|
+
getIsExecuted(attestation: MultiTokenNtt.Attestation): Promise<boolean>;
|
|
51
|
+
getIsTransferInboundQueued(attestation: MultiTokenNtt.Attestation): Promise<boolean>;
|
|
52
|
+
getInboundQueuedTransfer(fromChain: Chain, transceiverMessage: MultiTokenNtt.Message): Promise<Ntt.InboundQueuedTransfer<C> | null>;
|
|
53
|
+
completeInboundQueuedTransfer(fromChain: Chain, transceiverMessage: MultiTokenNtt.Message, payer?: AccountAddress<C>): AsyncGenerator<UnsignedTransaction<N, C>>;
|
|
54
|
+
getOriginalToken(localToken: TokenId): Promise<MultiTokenNtt.OriginalTokenId>;
|
|
55
|
+
getLocalToken(originalToken: MultiTokenNtt.OriginalTokenId): Promise<TokenId | null>;
|
|
56
|
+
calculateLocalTokenAddress(originalToken: MultiTokenNtt.OriginalTokenId, tokenMeta: MultiTokenNtt.TokenMeta): Promise<TokenAddress<C>>;
|
|
57
|
+
getWrappedNativeToken(): Promise<TokenId>;
|
|
58
|
+
}
|
|
59
|
+
declare module "@wormhole-foundation/sdk-definitions" {
|
|
60
|
+
namespace WormholeRegistry {
|
|
61
|
+
interface ProtocolToInterfaceMapping<N, C> {
|
|
62
|
+
MultiTokenNtt: MultiTokenNtt<N, C>;
|
|
63
|
+
}
|
|
64
|
+
interface ProtocolToPlatformMapping {
|
|
65
|
+
MultiTokenNtt: EmptyPlatformMap<MultiTokenNtt.ProtocolName>;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=multiTokenNtt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiTokenNtt.d.ts","sourceRoot":"","sources":["../../src/multiTokenNtt.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,KAAK,EACV,KAAK,OAAO,EACb,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACL,cAAc,EACd,YAAY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