@wormhole-foundation/sdk-definitions 0.1.3-beta.4 → 0.1.3-beta.6

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.
Files changed (104) hide show
  1. package/README.md +51 -2
  2. package/dist/cjs/chain.d.ts +19 -18
  3. package/dist/cjs/chain.d.ts.map +1 -1
  4. package/dist/cjs/chain.js +46 -24
  5. package/dist/cjs/chain.js.map +1 -1
  6. package/dist/cjs/index.d.ts +1 -0
  7. package/dist/cjs/index.d.ts.map +1 -1
  8. package/dist/cjs/index.js +1 -0
  9. package/dist/cjs/index.js.map +1 -1
  10. package/dist/cjs/layout-items/chain.d.ts +8 -4
  11. package/dist/cjs/layout-items/chain.d.ts.map +1 -1
  12. package/dist/cjs/layout-items/chain.js +4 -4
  13. package/dist/cjs/layout-items/chain.js.map +1 -1
  14. package/dist/cjs/payloads/bam.d.ts +187 -0
  15. package/dist/cjs/payloads/bam.d.ts.map +1 -0
  16. package/dist/cjs/payloads/bam.js +37 -0
  17. package/dist/cjs/payloads/bam.js.map +1 -0
  18. package/dist/cjs/payloads/governance.d.ts +252 -252
  19. package/dist/cjs/payloads/relayer.d.ts +10 -10
  20. package/dist/cjs/payloads/tokenBridge.d.ts +14 -14
  21. package/dist/cjs/platform.d.ts +14 -19
  22. package/dist/cjs/platform.d.ts.map +1 -1
  23. package/dist/cjs/protocols/cctp.d.ts +9 -0
  24. package/dist/cjs/protocols/cctp.d.ts.map +1 -1
  25. package/dist/cjs/protocols/cctp.js +10 -0
  26. package/dist/cjs/protocols/cctp.js.map +1 -1
  27. package/dist/cjs/protocols/core.d.ts +5 -0
  28. package/dist/cjs/protocols/core.d.ts.map +1 -1
  29. package/dist/cjs/protocols/core.js +5 -0
  30. package/dist/cjs/protocols/core.js.map +1 -1
  31. package/dist/cjs/protocols/tokenBridge.d.ts +9 -0
  32. package/dist/cjs/protocols/tokenBridge.d.ts.map +1 -1
  33. package/dist/cjs/protocols/tokenBridge.js +10 -1
  34. package/dist/cjs/protocols/tokenBridge.js.map +1 -1
  35. package/dist/cjs/rpc.d.ts +1 -9
  36. package/dist/cjs/rpc.d.ts.map +1 -1
  37. package/dist/cjs/testing/mocks/chain.d.ts +6 -5
  38. package/dist/cjs/testing/mocks/chain.d.ts.map +1 -1
  39. package/dist/cjs/testing/mocks/chain.js +9 -6
  40. package/dist/cjs/testing/mocks/chain.js.map +1 -1
  41. package/dist/cjs/testing/mocks/platform.d.ts +11 -4
  42. package/dist/cjs/testing/mocks/platform.d.ts.map +1 -1
  43. package/dist/cjs/testing/mocks/platform.js +27 -6
  44. package/dist/cjs/testing/mocks/platform.js.map +1 -1
  45. package/dist/cjs/types.d.ts +1 -1
  46. package/dist/cjs/vaa.d.ts +4 -4
  47. package/dist/esm/chain.d.ts +19 -18
  48. package/dist/esm/chain.d.ts.map +1 -1
  49. package/dist/esm/chain.js +46 -24
  50. package/dist/esm/chain.js.map +1 -1
  51. package/dist/esm/index.d.ts +1 -0
  52. package/dist/esm/index.d.ts.map +1 -1
  53. package/dist/esm/index.js +1 -0
  54. package/dist/esm/index.js.map +1 -1
  55. package/dist/esm/layout-items/chain.d.ts +8 -4
  56. package/dist/esm/layout-items/chain.d.ts.map +1 -1
  57. package/dist/esm/layout-items/chain.js +1 -1
  58. package/dist/esm/layout-items/chain.js.map +1 -1
  59. package/dist/esm/payloads/bam.d.ts +187 -0
  60. package/dist/esm/payloads/bam.d.ts.map +1 -0
  61. package/dist/esm/payloads/bam.js +34 -0
  62. package/dist/esm/payloads/bam.js.map +1 -0
  63. package/dist/esm/payloads/governance.d.ts +252 -252
  64. package/dist/esm/payloads/relayer.d.ts +10 -10
  65. package/dist/esm/payloads/tokenBridge.d.ts +14 -14
  66. package/dist/esm/platform.d.ts +14 -19
  67. package/dist/esm/platform.d.ts.map +1 -1
  68. package/dist/esm/protocols/cctp.d.ts +9 -0
  69. package/dist/esm/protocols/cctp.d.ts.map +1 -1
  70. package/dist/esm/protocols/cctp.js +7 -0
  71. package/dist/esm/protocols/cctp.js.map +1 -1
  72. package/dist/esm/protocols/core.d.ts +5 -0
  73. package/dist/esm/protocols/core.d.ts.map +1 -1
  74. package/dist/esm/protocols/core.js +3 -1
  75. package/dist/esm/protocols/core.js.map +1 -1
  76. package/dist/esm/protocols/tokenBridge.d.ts +9 -0
  77. package/dist/esm/protocols/tokenBridge.d.ts.map +1 -1
  78. package/dist/esm/protocols/tokenBridge.js +7 -0
  79. package/dist/esm/protocols/tokenBridge.js.map +1 -1
  80. package/dist/esm/rpc.d.ts +1 -9
  81. package/dist/esm/rpc.d.ts.map +1 -1
  82. package/dist/esm/testing/mocks/chain.d.ts +6 -5
  83. package/dist/esm/testing/mocks/chain.d.ts.map +1 -1
  84. package/dist/esm/testing/mocks/chain.js +9 -6
  85. package/dist/esm/testing/mocks/chain.js.map +1 -1
  86. package/dist/esm/testing/mocks/platform.d.ts +11 -4
  87. package/dist/esm/testing/mocks/platform.d.ts.map +1 -1
  88. package/dist/esm/testing/mocks/platform.js +27 -6
  89. package/dist/esm/testing/mocks/platform.js.map +1 -1
  90. package/dist/esm/types.d.ts +1 -1
  91. package/dist/esm/vaa.d.ts +4 -4
  92. package/package.json +1 -1
  93. package/src/chain.ts +76 -59
  94. package/src/index.ts +1 -0
  95. package/src/layout-items/chain.ts +1 -1
  96. package/src/payloads/bam.ts +66 -0
  97. package/src/platform.ts +29 -28
  98. package/src/protocols/cctp.ts +27 -0
  99. package/src/protocols/core.ts +13 -0
  100. package/src/protocols/tokenBridge.ts +43 -0
  101. package/src/rpc.ts +1 -15
  102. package/src/testing/mocks/chain.ts +17 -8
  103. package/src/testing/mocks/platform.ts +40 -13
  104. package/src/types.ts +1 -1
package/README.md CHANGED
@@ -1,3 +1,52 @@
1
- should subsume/replace files from old sdk:
1
+ # Definitions SDK
2
+
3
+ Replaces these files from old sdk:
2
4
  * vaa/parser
3
- * mock
5
+ * mock
6
+
7
+ ## VAA
8
+
9
+ ### Deserialization
10
+
11
+ ```ts
12
+ // decode VAA
13
+ const vaaBytes = Buffer.from(testCase.vaa, "base64");
14
+ // deserializes the base VAA details (emitterChain, emitterAddress, sequence, signatures, payload, hash, etc)
15
+ const parsed = deserialize("Uint8Array", new Uint8Array(vaaBytes));
16
+ // deserialize the payload, first argument denotes the type of payload
17
+ const deserialized = deserializePayload("BAMessage", parsed.payload);
18
+ ```
19
+
20
+ #### Available payload types
21
+
22
+ Token Bridge:
23
+ - "AttestMeta"
24
+ - "Transfer"
25
+ - "TransferWithPayload
26
+
27
+ Generic Relayer:
28
+ - "DeliveryInstruction"
29
+ - "RedeliveryInstruction"
30
+ - "DeliveryOverride"
31
+
32
+ Governance
33
+ - "CoreBridgeUpgradeContract"
34
+ - "CoreBridgeGuardianSetUpgrade"
35
+ - "CoreBridgeSetMessageFee"
36
+ - "CoreBridgeTransferFees"
37
+ - "CoreBridgeRecoverChainId"
38
+ - "TokenBridgeRegisterChain"
39
+ - "TokenBridgeUpgradeContract"
40
+ - "TokenBridgeRecoverChainId"
41
+ - "NftBridgeRegisterChain"
42
+ - "NftBridgeUpgradeContract"
43
+ - "NftBridgeRecoverChainId"
44
+ - "RelayerRegisterChain"
45
+ - "RelayerUpgradeContract"
46
+ - "RelayerUpdateDefaultProvider"
47
+
48
+ Circle
49
+ - "CircleTransferRelay"
50
+
51
+ BAM
52
+ - "BAMessage"
@@ -3,29 +3,30 @@ import { Platform } from "./platform";
3
3
  import { RpcConnection } from "./rpc";
4
4
  import { AutomaticTokenBridge, TokenBridge } from "./protocols/tokenBridge";
5
5
  import { AutomaticCircleBridge, CircleBridge } from "./protocols/cctp";
6
- type _omitChain<Fn> = Fn extends (chain: ChainName, ...args: infer A) => infer R ? (...args: A) => R : Fn;
7
- type _omitRpc<P extends PlatformName, Fn> = Fn extends (rpc: RpcConnection<P>, ...args: infer A) => infer R ? (...args: A) => R : Fn;
8
- type OmitChainRpc<P extends PlatformName, F extends keyof Platform<P>> = _omitRpc<P, _omitChain<Platform<P>[F]>>;
9
- type OmitRpc<P extends PlatformName, F extends keyof Platform<P>> = _omitRpc<P, Platform<P>[F]>;
10
- type OmitChain<P extends PlatformName, F extends keyof Platform<P>> = _omitChain<Platform<P>[F]>;
6
+ import { SignedTx, TokenId } from "./types";
7
+ import { WormholeMessageId } from "./attestation";
11
8
  export declare abstract class ChainContext<P extends PlatformName> {
12
- readonly platform: Platform<P>;
13
9
  readonly chain: ChainName;
10
+ protected rpc?: RpcConnection<P>;
14
11
  protected tokenBridge?: TokenBridge<P>;
15
12
  protected autoTokenBridge?: AutomaticTokenBridge<P>;
16
13
  protected circleBridge?: CircleBridge<P>;
17
14
  protected autoCircleBridge?: AutomaticCircleBridge<P>;
18
- constructor(platform: Platform<P>, chain: ChainName);
19
- abstract getRpc(): RpcConnection<P>;
20
- getDecimals: OmitChainRpc<P, "getDecimals">;
21
- getBalance: OmitChainRpc<P, "getBalance">;
22
- parseTransaction: OmitChainRpc<P, "parseTransaction">;
23
- sendWait: OmitChainRpc<P, "sendWait">;
24
- parseAddress: OmitChain<P, "parseAddress">;
25
- getTokenBridge: OmitRpc<P, "getTokenBridge">;
26
- getAutomaticTokenBridge: OmitRpc<P, "getAutomaticTokenBridge">;
27
- getCircleBridge: OmitRpc<P, "getCircleBridge">;
28
- getAutomaticCircleBridge: OmitRpc<P, "getAutomaticCircleBridge">;
15
+ abstract platform: Platform<P>;
16
+ constructor(chain: ChainName);
17
+ getRpc(): RpcConnection<P>;
18
+ getDecimals(token: TokenId | "native"): Promise<bigint>;
19
+ getBalance(walletAddr: string, token: TokenId | "native"): Promise<bigint | null>;
20
+ getCurrentBlock(): Promise<number>;
21
+ parseTransaction(txid: string): Promise<WormholeMessageId[]>;
22
+ sendWait(stxns: SignedTx): Promise<string[]>;
23
+ supportsTokenBridge: () => boolean;
24
+ getTokenBridge(): Promise<TokenBridge<P>>;
25
+ supportsAutomaticTokenBridge: () => boolean;
26
+ getAutomaticTokenBridge(): Promise<AutomaticTokenBridge<P>>;
27
+ supportsCircleBridge: () => boolean;
28
+ getCircleBridge(): Promise<CircleBridge<P>>;
29
+ supportsAutomaticCircleBridge: () => boolean;
30
+ getAutomaticCircleBridge(): Promise<AutomaticCircleBridge<P>>;
29
31
  }
30
- export {};
31
32
  //# sourceMappingURL=chain.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../src/chain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAMvE,KAAK,UAAU,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,GAC5E,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GACjB,EAAE,CAAC;AACP,KAAK,QAAQ,CAAC,CAAC,SAAS,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,CACrD,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,EACrB,GAAG,IAAI,EAAE,MAAM,CAAC,KACb,MAAM,CAAC,GACR,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GACjB,EAAE,CAAC;AAEP,KAAK,YAAY,CACf,CAAC,SAAS,YAAY,EACtB,CAAC,SAAS,MAAM,QAAQ,CAAC,CAAC,CAAC,IACzB,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE5C,KAAK,OAAO,CAAC,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,MAAM,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AG,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAKvD,UAAU,CACd,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,OAAO,GAAG,QAAQ,GACxB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IASnB,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC;IAKlC,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAK5D,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IASlD,mBAAmB,gBAA+C;IAC5D,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAW/C,4BAA4B,gBACqB;IAC3C,uBAAuB,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAWjE,oBAAoB,gBAAgD;IAC9D,eAAe,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAWjD,6BAA6B,gBACqB;IAE5C,wBAAwB,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;CASpE"}
package/dist/cjs/chain.js CHANGED
@@ -1,62 +1,84 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ChainContext = void 0;
4
+ const cctp_1 = require("./protocols/cctp");
5
+ const tokenBridge_1 = require("./protocols/tokenBridge");
4
6
  class ChainContext {
5
- platform;
6
7
  chain;
7
8
  // Cached Protocol clients
9
+ rpc;
8
10
  tokenBridge;
9
11
  autoTokenBridge;
10
12
  circleBridge;
11
13
  autoCircleBridge;
12
- constructor(platform, chain) {
13
- this.platform = platform;
14
+ constructor(chain) {
14
15
  this.chain = chain;
15
16
  }
16
- // Utils for platform specific queries
17
- getDecimals = (token) => {
17
+ getRpc() {
18
+ this.rpc = this.rpc ? this.rpc : this.platform.getRpc(this.chain);
19
+ return this.rpc;
20
+ }
21
+ // Get the number of decimals for a token
22
+ async getDecimals(token) {
18
23
  return this.platform.getDecimals(this.chain, this.getRpc(), token);
19
- };
20
- getBalance = (walletAddr, token) => {
24
+ }
25
+ // Get the balance of a token for a given address
26
+ async getBalance(walletAddr, token) {
21
27
  return this.platform.getBalance(this.chain, this.getRpc(), walletAddr, token);
22
- };
28
+ }
29
+ async getCurrentBlock() {
30
+ return this.platform.getCurrentBlock(this.getRpc());
31
+ }
23
32
  // Get details about the transaction
24
- parseTransaction = (txid) => {
33
+ async parseTransaction(txid) {
25
34
  return this.platform.parseTransaction(this.chain, this.getRpc(), txid);
26
- };
35
+ }
27
36
  // Send a transaction and wait for it to be confirmed
28
- sendWait = (stxns) => {
37
+ async sendWait(stxns) {
29
38
  return this.platform.sendWait(this.chain, this.getRpc(), stxns);
30
- };
31
- // Take a native address and convert it to a UniversalAddress
32
- parseAddress = (address) => {
33
- return this.platform.parseAddress(this.chain, address);
34
- };
39
+ }
40
+ //
35
41
  // protocols
36
- getTokenBridge = async () => {
42
+ //
43
+ //
44
+ supportsTokenBridge = () => (0, tokenBridge_1.supportsTokenBridge)(this.platform);
45
+ async getTokenBridge() {
46
+ if (!(0, tokenBridge_1.supportsTokenBridge)(this.platform))
47
+ throw new Error("Platform does not support TokenBridge");
37
48
  this.tokenBridge = this.tokenBridge
38
49
  ? this.tokenBridge
39
50
  : await this.platform.getTokenBridge(this.getRpc());
40
51
  return this.tokenBridge;
41
- };
42
- getAutomaticTokenBridge = async () => {
52
+ }
53
+ supportsAutomaticTokenBridge = () => (0, tokenBridge_1.supportsAutomaticTokenBridge)(this.platform);
54
+ async getAutomaticTokenBridge() {
55
+ if (!(0, tokenBridge_1.supportsAutomaticTokenBridge)(this.platform))
56
+ throw new Error("Platform does not support AutomaticTokenBridge");
43
57
  this.autoTokenBridge = this.autoTokenBridge
44
58
  ? this.autoTokenBridge
45
59
  : await this.platform.getAutomaticTokenBridge(this.getRpc());
46
60
  return this.autoTokenBridge;
47
- };
48
- getCircleBridge = async () => {
61
+ }
62
+ //
63
+ supportsCircleBridge = () => (0, cctp_1.supportsCircleBridge)(this.platform);
64
+ async getCircleBridge() {
65
+ if (!(0, cctp_1.supportsCircleBridge)(this.platform))
66
+ throw new Error("Platform does not support CircleBridge");
49
67
  this.circleBridge = this.circleBridge
50
68
  ? this.circleBridge
51
69
  : await this.platform.getCircleBridge(this.getRpc());
52
70
  return this.circleBridge;
53
- };
54
- getAutomaticCircleBridge = async () => {
71
+ }
72
+ //
73
+ supportsAutomaticCircleBridge = () => (0, cctp_1.supportsAutomaticCircleBridge)(this.platform);
74
+ async getAutomaticCircleBridge() {
75
+ if (!(0, cctp_1.supportsAutomaticCircleBridge)(this.platform))
76
+ throw new Error("Platform does not support AutomaticCircleBridge");
55
77
  this.autoCircleBridge = this.autoCircleBridge
56
78
  ? this.autoCircleBridge
57
79
  : await this.platform.getAutomaticCircleBridge(this.getRpc());
58
80
  return this.autoCircleBridge;
59
- };
81
+ }
60
82
  }
61
83
  exports.ChainContext = ChainContext;
62
84
  //# sourceMappingURL=chain.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chain.js","sourceRoot":"","sources":["../../src/chain.ts"],"names":[],"mappings":";;;AAmCA,MAAsB,YAAY;IAOX;IAAgC;IANrD,0BAA0B;IAChB,WAAW,CAAkB;IAC7B,eAAe,CAA2B;IAC1C,YAAY,CAAmB;IAC/B,gBAAgB,CAA4B;IAEtD,YAAqB,QAAqB,EAAW,KAAgB;QAAhD,aAAQ,GAAR,QAAQ,CAAa;QAAW,UAAK,GAAL,KAAK,CAAW;IAAG,CAAC;IAIzE,sCAAsC;IACtC,WAAW,GAAmC,CAAC,KAAK,EAAE,EAAE;QACtD,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,KAAK,CAAC,CAAC;IACrE,CAAC,CAAC;IAEF,UAAU,GAAkC,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE;QAChE,OAAO,IAA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KAAK,CAAC,iDAAiD,CAAC,CAAC;QAErE,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB;YAC3C,CAAC,CAAC,IAAI,CAAC,gBAAgB;YACvB,CAAC,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,wBAAwB,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QAChE,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;CACF;AAvGD,oCAuGC"}
@@ -2,6 +2,7 @@ import "./payloads/connect";
2
2
  import "./payloads/relayer";
3
3
  import "./payloads/governance";
4
4
  import "./payloads/tokenBridge";
5
+ import "./payloads/bam";
5
6
  export * from "./address";
6
7
  export * from "./universalAddress";
7
8
  export * from "./unsignedTransaction";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,wBAAwB,CAAC;AAEhC,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AAExB,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AAEjC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,wBAAwB,CAAC;AAChC,OAAO,gBAAgB,CAAC;AAExB,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AAExB,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AAEjC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC"}
package/dist/cjs/index.js CHANGED
@@ -32,6 +32,7 @@ require("./payloads/connect");
32
32
  require("./payloads/relayer");
33
33
  require("./payloads/governance");
34
34
  require("./payloads/tokenBridge");
35
+ require("./payloads/bam");
35
36
  __exportStar(require("./address"), exports);
36
37
  __exportStar(require("./universalAddress"), exports);
37
38
  __exportStar(require("./unsignedTransaction"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCAAoC;AACpC,8BAA4B;AAC5B,8BAA4B;AAC5B,iCAA+B;AAC/B,kCAAgC;AAEhC,4CAA0B;AAC1B,qDAAmC;AACnC,wDAAsC;AACtC,wCAAsB;AACtB,0CAAwB;AACxB,4CAA0B;AAC1B,6CAA2B;AAC3B,0CAAwB;AACxB,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,gDAA8B;AAC9B,0CAAwB;AAExB,mDAAiC;AACjC,0DAAwC;AACxC,mDAAiC;AAEjC,qDAAqC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCAAoC;AACpC,8BAA4B;AAC5B,8BAA4B;AAC5B,iCAA+B;AAC/B,kCAAgC;AAChC,0BAAwB;AAExB,4CAA0B;AAC1B,qDAAmC;AACnC,wDAAsC;AACtC,wCAAsB;AACtB,0CAAwB;AACxB,4CAA0B;AAC1B,6CAA2B;AAC3B,0CAAwB;AACxB,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,gDAA8B;AAC9B,0CAAwB;AAExB,mDAAiC;AACjC,0DAAwC;AACxC,mDAAiC;AAEjC,qDAAqC"}
@@ -1,5 +1,9 @@
1
+ export declare const chainItemBase: {
2
+ readonly binary: "uint";
3
+ readonly size: 2;
4
+ };
1
5
  type AllowNull<T, B extends boolean> = B extends true ? T | null : T;
2
- export declare const chainItem: <C extends readonly ("Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Osmosis" | "Wormchain" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Sepolia")[] = readonly ["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", "Wormchain", "Sepolia"], N extends boolean = false>(opts?: {
6
+ export declare const chainItem: <C extends readonly ("Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia")[] = readonly ["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", "Rootstock", "Wormchain", "Cosmoshub", "Evmos", "Kujira", "Sepolia"], N extends boolean = false>(opts?: {
3
7
  allowedChains?: C | undefined;
4
8
  allowNull?: N | undefined;
5
9
  } | undefined) => {
@@ -10,14 +14,14 @@ export declare const chainItem: <C extends readonly ("Solana" | "Btc" | "Algoran
10
14
  readonly binary: "uint";
11
15
  readonly size: 2;
12
16
  };
13
- export declare const fixedChainItem: <C extends "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Osmosis" | "Wormchain" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Sepolia">(chain: C) => {
17
+ export declare const fixedChainItem: <C extends "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia">(chain: C) => {
14
18
  readonly custom: {
15
19
  to: C;
16
- from: (C extends bigint | boolean | PropertyKey ? import("@wormhole-foundation/sdk-base").AssertType<C extends bigint ? `bigint(${C})` : C extends boolean ? `boolean(${C})` : C, PropertyKey> : never) extends "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Osmosis" | "Wormchain" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Sepolia" ? import("@wormhole-foundation/sdk-base").ObjectFromMappingEntries<readonly [readonly ["Solana", 1], readonly ["Ethereum", 2], readonly ["Terra", 3], readonly ["Bsc", 4], readonly ["Polygon", 5], readonly ["Avalanche", 6], readonly ["Oasis", 7], readonly ["Algorand", 8], readonly ["Aurora", 9], readonly ["Fantom", 10], readonly ["Karura", 11], readonly ["Acala", 12], readonly ["Klaytn", 13], readonly ["Celo", 14], readonly ["Near", 15], readonly ["Moonbeam", 16], readonly ["Neon", 17], readonly ["Terra2", 18], readonly ["Injective", 19], readonly ["Osmosis", 20], readonly ["Sui", 21], readonly ["Aptos", 22], readonly ["Arbitrum", 23], readonly ["Optimism", 24], readonly ["Gnosis", 25], readonly ["Pythnet", 26], readonly ["Xpla", 28], readonly ["Btc", 29], readonly ["Base", 30], readonly ["Sei", 32], readonly ["Wormchain", 3104], readonly ["Sepolia", 10002]]>[("Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Osmosis" | "Wormchain" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Sepolia") & (C extends bigint | boolean | PropertyKey ? import("@wormhole-foundation/sdk-base").AssertType<C extends bigint ? `bigint(${C})` : C extends boolean ? `boolean(${C})` : C, PropertyKey> : never)] extends {
20
+ from: (C extends bigint | boolean | PropertyKey ? import("@wormhole-foundation/sdk-base").AssertType<C extends bigint ? `bigint(${C})` : C extends boolean ? `boolean(${C})` : C, PropertyKey> : never) extends "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia" ? import("@wormhole-foundation/sdk-base").ObjectFromMappingEntries<readonly [readonly ["Solana", 1], readonly ["Ethereum", 2], readonly ["Terra", 3], readonly ["Bsc", 4], readonly ["Polygon", 5], readonly ["Avalanche", 6], readonly ["Oasis", 7], readonly ["Algorand", 8], readonly ["Aurora", 9], readonly ["Fantom", 10], readonly ["Karura", 11], readonly ["Acala", 12], readonly ["Klaytn", 13], readonly ["Celo", 14], readonly ["Near", 15], readonly ["Moonbeam", 16], readonly ["Neon", 17], readonly ["Terra2", 18], readonly ["Injective", 19], readonly ["Osmosis", 20], readonly ["Sui", 21], readonly ["Aptos", 22], readonly ["Arbitrum", 23], readonly ["Optimism", 24], readonly ["Gnosis", 25], readonly ["Pythnet", 26], readonly ["Xpla", 28], readonly ["Btc", 29], readonly ["Base", 30], readonly ["Sei", 32], readonly ["Rootstock", 33], readonly ["Wormchain", 3104], readonly ["Cosmoshub", 4000], readonly ["Evmos", 4001], readonly ["Kujira", 4002], readonly ["Sepolia", 10002]]>[("Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia") & (C extends bigint | boolean | PropertyKey ? import("@wormhole-foundation/sdk-base").AssertType<C extends bigint ? `bigint(${C})` : C extends boolean ? `boolean(${C})` : C, PropertyKey> : never)] extends {
17
21
  [key: string]: unknown;
18
22
  [key: number]: unknown;
19
23
  [key: symbol]: unknown;
20
- } ? import("@wormhole-foundation/sdk-base").ObjectFromMappingEntries<readonly [readonly ["Solana", 1], readonly ["Ethereum", 2], readonly ["Terra", 3], readonly ["Bsc", 4], readonly ["Polygon", 5], readonly ["Avalanche", 6], readonly ["Oasis", 7], readonly ["Algorand", 8], readonly ["Aurora", 9], readonly ["Fantom", 10], readonly ["Karura", 11], readonly ["Acala", 12], readonly ["Klaytn", 13], readonly ["Celo", 14], readonly ["Near", 15], readonly ["Moonbeam", 16], readonly ["Neon", 17], readonly ["Terra2", 18], readonly ["Injective", 19], readonly ["Osmosis", 20], readonly ["Sui", 21], readonly ["Aptos", 22], readonly ["Arbitrum", 23], readonly ["Optimism", 24], readonly ["Gnosis", 25], readonly ["Pythnet", 26], readonly ["Xpla", 28], readonly ["Btc", 29], readonly ["Base", 30], readonly ["Sei", 32], readonly ["Wormchain", 3104], readonly ["Sepolia", 10002]]>[("Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Osmosis" | "Wormchain" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Sepolia") & (C extends bigint | boolean | PropertyKey ? import("@wormhole-foundation/sdk-base").AssertType<C extends bigint ? `bigint(${C})` : C extends boolean ? `boolean(${C})` : C, PropertyKey> : never)] : import("@wormhole-foundation/sdk-base").ObjectFromMappingEntries<readonly [readonly ["Solana", 1], readonly ["Ethereum", 2], readonly ["Terra", 3], readonly ["Bsc", 4], readonly ["Polygon", 5], readonly ["Avalanche", 6], readonly ["Oasis", 7], readonly ["Algorand", 8], readonly ["Aurora", 9], readonly ["Fantom", 10], readonly ["Karura", 11], readonly ["Acala", 12], readonly ["Klaytn", 13], readonly ["Celo", 14], readonly ["Near", 15], readonly ["Moonbeam", 16], readonly ["Neon", 17], readonly ["Terra2", 18], readonly ["Injective", 19], readonly ["Osmosis", 20], readonly ["Sui", 21], readonly ["Aptos", 22], readonly ["Arbitrum", 23], readonly ["Optimism", 24], readonly ["Gnosis", 25], readonly ["Pythnet", 26], readonly ["Xpla", 28], readonly ["Btc", 29], readonly ["Base", 30], readonly ["Sei", 32], readonly ["Wormchain", 3104], readonly ["Sepolia", 10002]]>[("Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Osmosis" | "Wormchain" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Sepolia") & (C extends bigint | boolean | PropertyKey ? import("@wormhole-foundation/sdk-base").AssertType<C extends bigint ? `bigint(${C})` : C extends boolean ? `boolean(${C})` : C, PropertyKey> : never)] : never;
24
+ } ? import("@wormhole-foundation/sdk-base").ObjectFromMappingEntries<readonly [readonly ["Solana", 1], readonly ["Ethereum", 2], readonly ["Terra", 3], readonly ["Bsc", 4], readonly ["Polygon", 5], readonly ["Avalanche", 6], readonly ["Oasis", 7], readonly ["Algorand", 8], readonly ["Aurora", 9], readonly ["Fantom", 10], readonly ["Karura", 11], readonly ["Acala", 12], readonly ["Klaytn", 13], readonly ["Celo", 14], readonly ["Near", 15], readonly ["Moonbeam", 16], readonly ["Neon", 17], readonly ["Terra2", 18], readonly ["Injective", 19], readonly ["Osmosis", 20], readonly ["Sui", 21], readonly ["Aptos", 22], readonly ["Arbitrum", 23], readonly ["Optimism", 24], readonly ["Gnosis", 25], readonly ["Pythnet", 26], readonly ["Xpla", 28], readonly ["Btc", 29], readonly ["Base", 30], readonly ["Sei", 32], readonly ["Rootstock", 33], readonly ["Wormchain", 3104], readonly ["Cosmoshub", 4000], readonly ["Evmos", 4001], readonly ["Kujira", 4002], readonly ["Sepolia", 10002]]>[("Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia") & (C extends bigint | boolean | PropertyKey ? import("@wormhole-foundation/sdk-base").AssertType<C extends bigint ? `bigint(${C})` : C extends boolean ? `boolean(${C})` : C, PropertyKey> : never)] : import("@wormhole-foundation/sdk-base").ObjectFromMappingEntries<readonly [readonly ["Solana", 1], readonly ["Ethereum", 2], readonly ["Terra", 3], readonly ["Bsc", 4], readonly ["Polygon", 5], readonly ["Avalanche", 6], readonly ["Oasis", 7], readonly ["Algorand", 8], readonly ["Aurora", 9], readonly ["Fantom", 10], readonly ["Karura", 11], readonly ["Acala", 12], readonly ["Klaytn", 13], readonly ["Celo", 14], readonly ["Near", 15], readonly ["Moonbeam", 16], readonly ["Neon", 17], readonly ["Terra2", 18], readonly ["Injective", 19], readonly ["Osmosis", 20], readonly ["Sui", 21], readonly ["Aptos", 22], readonly ["Arbitrum", 23], readonly ["Optimism", 24], readonly ["Gnosis", 25], readonly ["Pythnet", 26], readonly ["Xpla", 28], readonly ["Btc", 29], readonly ["Base", 30], readonly ["Sei", 32], readonly ["Rootstock", 33], readonly ["Wormchain", 3104], readonly ["Cosmoshub", 4000], readonly ["Evmos", 4001], readonly ["Kujira", 4002], readonly ["Sepolia", 10002]]>[("Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia") & (C extends bigint | boolean | PropertyKey ? import("@wormhole-foundation/sdk-base").AssertType<C extends bigint ? `bigint(${C})` : C extends boolean ? `boolean(${C})` : C, PropertyKey> : never)] : never;
21
25
  };
22
26
  readonly binary: "uint";
23
27
  readonly size: 2;
@@ -1 +1 @@
1
- {"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../../src/layout-items/chain.ts"],"names":[],"mappings":"AAaA,KAAK,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,IAAI,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;AAErE,eAAO,MAAM,SAAS;;;;;kBAUN,MAAM;gDAmBsB,MAAM;;;;CAGE,CAAC;AAErD,eAAO,MAAM,cAAc;;;;;;;;;;;CAOyB,CAAC"}
1
+ {"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../../src/layout-items/chain.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,aAAa;;;CAAuC,CAAC;AAElE,KAAK,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,IAAI,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;AAErE,eAAO,MAAM,SAAS;;;;;kBAUN,MAAM;gDAmBsB,MAAM;;;;CAGE,CAAC;AAErD,eAAO,MAAM,cAAc;;;;;;;;;;;CAOyB,CAAC"}
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fixedChainItem = exports.chainItem = void 0;
3
+ exports.fixedChainItem = exports.chainItem = exports.chainItemBase = void 0;
4
4
  const sdk_base_1 = require("@wormhole-foundation/sdk-base");
5
- const chainItemBase = { binary: "uint", size: 2 };
5
+ exports.chainItemBase = { binary: "uint", size: 2 };
6
6
  const chainItem = (opts) => ({
7
- ...chainItemBase,
7
+ ...exports.chainItemBase,
8
8
  custom: {
9
9
  to: (val) => {
10
10
  if (val === 0) {
@@ -23,7 +23,7 @@ const chainItem = (opts) => ({
23
23
  });
24
24
  exports.chainItem = chainItem;
25
25
  const fixedChainItem = (chain) => ({
26
- ...chainItemBase,
26
+ ...exports.chainItemBase,
27
27
  custom: {
28
28
  to: chain,
29
29
  from: (0, sdk_base_1.chainToChainId)(chain),
@@ -1 +1 @@
1
- {"version":3,"file":"chain.js","sourceRoot":"","sources":["../../../src/layout-items/chain.ts"],"names":[],"mappings":";;;AAAA,4DASuC;AAEvC,MAAM,aAAa,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAW,CAAC;AAIpD,MAAM,SAAS,GAAG,CAGvB,IAGD,EAAE,EAAE,CACH,CAAC;IACC,GAAG,aAAa;IAChB,MAAM,EAAE;QACN,EAAE,EAAE,CAAC,GAAW,EAA2B,EAAE;YAC3C,IAAI,GAAG,KAAK,CAAC,EAAE;gBACb,IAAI,CAAC,IAAI,EAAE,SAAS;oBAClB,MAAM,IAAI,KAAK,CACb,mDAAmD,CACpD,CAAC;gBAEJ,OAAO,IAA+B,CAAC;aACxC;Y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c,EAAC,IAAA,oBAAS,EAAC,GAAG,CAAC,CAAC,CAAC;YAC7C,MAAM,aAAa,GAAG,IAAI,EAAE,aAAa,IAAI,iBAAM,CAAC;YACpD,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAChC,MAAM,IAAI,KAAK,CACb,SAAS,KAAK,0BAA0B,aAAa,EAAE,CACxD,CAAC;YAEJ,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,EAAE,CAAC,GAA4B,EAAU,EAAE,CAC7C,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,yBAAc,EAAC,GAAG,CAAC;KACoB;CACd,CAAC,CAAC;AAhCxC,QAAA,SAAS,aAgC+B;AAE9C,MAAM,cAAc,GAAG,CAAsB,KAAQ,EAAE,EAAE,CAC9D,CAAC;IACC,GAAG,qBAAa;IAChB,MAAM,EAAE;QACN,EAAE,EAAE,KAAK;QACT,IAAI,EAAE,IAAA,yBAAc,EAAC,KAAK,CAAC;KACS;CACS,CAAC,CAAC;AAPxC,QAAA,cAAc,kBAO0B"}
@@ -0,0 +1,187 @@
1
+ import { ShallowMapping } from "@wormhole-foundation/sdk-base";
2
+ export declare const bamPayloads: readonly [readonly ["BamMessage", readonly [{
3
+ readonly name: "magicByte";
4
+ readonly binary: "uint";
5
+ readonly size: 1;
6
+ readonly custom: 187;
7
+ readonly omit: true;
8
+ }, {
9
+ readonly name: "version";
10
+ readonly binary: "uint";
11
+ readonly size: 1;
12
+ readonly custom: 0;
13
+ readonly omit: true;
14
+ }, {
15
+ readonly name: "type";
16
+ readonly binary: "uint";
17
+ readonly size: 1;
18
+ readonly custom: 0;
19
+ readonly omit: true;
20
+ }, {
21
+ readonly name: "index";
22
+ readonly binary: "uint";
23
+ readonly size: 8;
24
+ }, {
25
+ readonly custom: {
26
+ to: (val: number) => "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia";
27
+ from: (val: "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia") => number;
28
+ };
29
+ readonly binary: "uint";
30
+ readonly size: 2;
31
+ readonly name: "targetChain";
32
+ }, {
33
+ readonly binary: "bytes";
34
+ readonly lengthSize: 2;
35
+ readonly name: "targetAddress";
36
+ }, {
37
+ readonly binary: "bytes";
38
+ readonly lengthSize: 2;
39
+ readonly name: "senderAddress";
40
+ }, {
41
+ readonly custom: any;
42
+ readonly name: "contents";
43
+ readonly binary: "bytes";
44
+ readonly lengthSize: 2;
45
+ } | {
46
+ readonly custom?: undefined;
47
+ readonly name: "contents";
48
+ readonly binary: "bytes";
49
+ readonly lengthSize: 2;
50
+ }]], readonly ["BamTokenMessage", readonly [{
51
+ readonly name: "magicByte";
52
+ readonly binary: "uint";
53
+ readonly size: 1;
54
+ readonly custom: 187;
55
+ readonly omit: true;
56
+ }, {
57
+ readonly name: "version";
58
+ readonly binary: "uint";
59
+ readonly size: 1;
60
+ readonly custom: 0;
61
+ readonly omit: true;
62
+ }, {
63
+ readonly name: "type";
64
+ readonly binary: "uint";
65
+ readonly size: 1;
66
+ readonly custom: 1;
67
+ readonly omit: true;
68
+ }, {
69
+ readonly name: "index";
70
+ readonly binary: "uint";
71
+ readonly size: 8;
72
+ }, {
73
+ readonly custom: {
74
+ to: (val: number) => "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia";
75
+ from: (val: "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia") => number;
76
+ };
77
+ readonly binary: "uint";
78
+ readonly size: 2;
79
+ readonly name: "targetChain";
80
+ }, {
81
+ readonly binary: "bytes";
82
+ readonly lengthSize: 2;
83
+ readonly name: "targetAddress";
84
+ }, {
85
+ readonly binary: "bytes";
86
+ readonly lengthSize: 2;
87
+ readonly name: "senderAddress";
88
+ }, {
89
+ readonly custom: any;
90
+ readonly name: "contents";
91
+ readonly binary: "bytes";
92
+ readonly lengthSize: 2;
93
+ } | {
94
+ readonly custom?: undefined;
95
+ readonly name: "contents";
96
+ readonly binary: "bytes";
97
+ readonly lengthSize: 2;
98
+ }, {
99
+ readonly custom: any;
100
+ readonly name: "bridge";
101
+ readonly binary: "uint";
102
+ readonly size: 1;
103
+ } | {
104
+ readonly custom?: undefined;
105
+ readonly name: "bridge";
106
+ readonly binary: "uint";
107
+ readonly size: 1;
108
+ }, {
109
+ readonly custom: any;
110
+ readonly name: "assetIdentifier";
111
+ readonly binary: "uint";
112
+ readonly size: 2;
113
+ } | {
114
+ readonly custom?: undefined;
115
+ readonly name: "assetIdentifier";
116
+ readonly binary: "uint";
117
+ readonly size: 2;
118
+ }, {
119
+ readonly binary: "uint";
120
+ readonly size: 32;
121
+ readonly name: "amount";
122
+ }]], readonly ["BamExtendedMessage", readonly [{
123
+ readonly name: "magicByte";
124
+ readonly binary: "uint";
125
+ readonly size: 1;
126
+ readonly custom: 187;
127
+ readonly omit: true;
128
+ }, {
129
+ readonly name: "version";
130
+ readonly binary: "uint";
131
+ readonly size: 1;
132
+ readonly custom: 0;
133
+ readonly omit: true;
134
+ }, {
135
+ readonly name: "type";
136
+ readonly binary: "uint";
137
+ readonly size: 1;
138
+ readonly custom: 2;
139
+ readonly omit: true;
140
+ }, {
141
+ readonly name: "index";
142
+ readonly binary: "uint";
143
+ readonly size: 8;
144
+ }, {
145
+ readonly custom: {
146
+ to: (val: number) => "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia";
147
+ from: (val: "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia") => number;
148
+ };
149
+ readonly binary: "uint";
150
+ readonly size: 2;
151
+ readonly name: "targetChain";
152
+ }, {
153
+ readonly binary: "bytes";
154
+ readonly lengthSize: 2;
155
+ readonly name: "targetAddress";
156
+ }, {
157
+ readonly binary: "bytes";
158
+ readonly lengthSize: 2;
159
+ readonly name: "senderAddress";
160
+ }, {
161
+ readonly custom: any;
162
+ readonly name: "contents";
163
+ readonly binary: "bytes";
164
+ readonly lengthSize: 2;
165
+ } | {
166
+ readonly custom?: undefined;
167
+ readonly name: "contents";
168
+ readonly binary: "bytes";
169
+ readonly lengthSize: 2;
170
+ }, {
171
+ readonly custom: any;
172
+ readonly name: "relaySignal";
173
+ readonly binary: "bytes";
174
+ readonly lengthSize: 2;
175
+ } | {
176
+ readonly custom?: undefined;
177
+ readonly name: "relaySignal";
178
+ readonly binary: "bytes";
179
+ readonly lengthSize: 2;
180
+ }]]];
181
+ declare global {
182
+ namespace Wormhole {
183
+ interface PayloadLiteralToDescriptionMapping extends ShallowMapping<typeof bamPayloads> {
184
+ }
185
+ }
186
+ }
187
+ //# sourceMappingURL=bam.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bam.d.ts","sourceRoot":"","sources":["../../../src/payloads/bam.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyD,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAgDtH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAImC,CAAC;AAI5D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,QAAQ,CAAC;QACjB,UAAU,kCACR,SAAQ,cAAc,CAAC,OAAO,WAAW,CAAC;SAAG;KAChD;CACF"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bamPayloads = void 0;
4
+ const layout_items_1 = require("../layout-items");
5
+ const vaa_1 = require("../vaa");
6
+ const bamAddressItem = {
7
+ binary: "bytes",
8
+ lengthSize: 2
9
+ };
10
+ const customOrEmpty = (custom) => custom ? { custom } : {};
11
+ const messageLayout = (type, customContents) => [
12
+ { name: "magicByte", binary: "uint", size: 1, custom: 0xbb, omit: true },
13
+ { name: "version", binary: "uint", size: 1, custom: 0, omit: true },
14
+ { name: "type", binary: "uint", size: 1, custom: type, omit: true },
15
+ { name: "index", binary: "uint", size: 8 },
16
+ { name: "targetChain", ...(0, layout_items_1.chainItem)() },
17
+ { name: "targetAddress", ...bamAddressItem },
18
+ { name: "senderAddress", ...bamAddressItem },
19
+ { name: "contents", binary: "bytes", lengthSize: 2, ...customOrEmpty(customContents) },
20
+ ];
21
+ const tokenMessageLayout = (custom) => [
22
+ ...messageLayout(1, custom?.contents),
23
+ { name: "bridge", binary: "uint", size: 1, ...customOrEmpty(custom?.bridge) },
24
+ { name: "assetIdentifier", binary: "uint", size: 2, ...customOrEmpty(custom?.assetIdentifier) },
25
+ { name: "amount", ...layout_items_1.amountItem },
26
+ ];
27
+ const extendedMessageLayout = (custom) => [
28
+ ...messageLayout(2, custom?.contents),
29
+ { name: "relaySignal", binary: "bytes", lengthSize: 2, ...customOrEmpty(custom?.relaySignal) },
30
+ ];
31
+ exports.bamPayloads = [
32
+ ["BamMessage", messageLayout(0)],
33
+ ["BamTokenMessage", tokenMessageLayout()],
34
+ ["BamExtendedMessage", extendedMessageLayout()],
35
+ ];
36
+ exports.bamPayloads.forEach(([payloadLiteral, layout]) => (0, vaa_1.registerPayloadType)(payloadLiteral, layout));
37
+ //# sourceMappingURL=bam.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bam.js","sourceRoot":"","sources":["../../../src/payloads/bam.ts"],"names":[],"mappings":";;;AACA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