@wormhole-foundation/wormhole-connect 3.0.0-beta.0-development → 3.0.0-beta.1-development

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 (135) hide show
  1. package/dist/main.js +49 -49
  2. package/dist/src/components/SampleApp/index.d.ts.map +1 -1
  3. package/dist/src/config/index.d.ts.map +1 -1
  4. package/dist/src/config/types.d.ts +2 -0
  5. package/dist/src/config/types.d.ts.map +1 -1
  6. package/dist/src/exports/executor.d.ts +2 -0
  7. package/dist/src/exports/executor.d.ts.map +1 -0
  8. package/dist/src/hooks/useFetchSupportedRoutes.d.ts.map +1 -1
  9. package/dist/src/utils/index.d.ts +1 -0
  10. package/dist/src/utils/index.d.ts.map +1 -1
  11. package/dist/src/utils/sdkv2.d.ts +0 -1
  12. package/dist/src/utils/sdkv2.d.ts.map +1 -1
  13. package/dist/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
  14. package/dist/src/views/v2/Redeem/TransactionDetails/index.d.ts.map +1 -1
  15. package/dist/src/views/v2/Redeem/index.d.ts.map +1 -1
  16. package/lib/account-CKUCmcgT.mjs +30 -0
  17. package/lib/account-QG_Hi4er.js +1 -0
  18. package/lib/address-B-_yHNB2.js +1 -0
  19. package/lib/{address-D74XlMdi.mjs → address-B9anhmbU.mjs} +5 -5
  20. package/lib/address-Cj96wodd.mjs +64 -0
  21. package/lib/{address-DXFbgyJW.mjs → address-Drr_9OcK.mjs} +93 -93
  22. package/lib/aptos-BZ2mcuTd.js +2 -0
  23. package/lib/aptos-DPIwkCrX.mjs +68 -0
  24. package/lib/{aptos-WhWqMfkU.js → aptos-Da6iqpC-.js} +1 -1
  25. package/lib/{aptos-BckWT_Pe.mjs → aptos-Dz4Js3_d.mjs} +3 -3
  26. package/lib/{base64-DPCMLrON.mjs → base64-BcnUThiU.mjs} +1 -1
  27. package/lib/{blake2b-BmQx89Cf.mjs → blake2b-CnkNeJT4.mjs} +1 -1
  28. package/lib/{browser-ponyfill-Zjbs5ehD.mjs → browser-ponyfill-oWZrCgRw.mjs} +1 -1
  29. package/lib/{ccip-DiNEz9KN.js → ccip-Bb-IPrNA.js} +1 -1
  30. package/lib/{ccip-B45dpIhp.mjs → ccip-Ceg_B70t.mjs} +1 -1
  31. package/lib/{chain-DaAd2Ztf.mjs → chain-CNVMEdrk.mjs} +1 -1
  32. package/lib/{chunk-IMTC3J2M-Bn3rs7tb.mjs → chunk-IMTC3J2M-B7fKwIuX.mjs} +3 -3
  33. package/lib/{constants-CbKC2uxb.mjs → constants-Ba9GwEM1.mjs} +1 -1
  34. package/lib/constants-BqqwmYZc.js +1 -0
  35. package/lib/{contract-BI_HDILr.mjs → contract-DANWVftx.mjs} +1 -1
  36. package/lib/{create-CzWSWmF_.mjs → create-B9LwWha4.mjs} +1 -1
  37. package/lib/{evm-DFyxDQ-x.js → evm-1T5rGzcO.js} +3 -3
  38. package/lib/{evm-DgG5biHb.mjs → evm-B552wdhN.mjs} +9 -9
  39. package/lib/{evm-Es3E89UO.mjs → evm-DarNu22s.mjs} +9 -9
  40. package/lib/executor.d.ts +2 -0
  41. package/lib/executor.js +1 -0
  42. package/lib/executor.mjs +828 -0
  43. package/lib/hosted.js +1 -1
  44. package/lib/hosted.mjs +1 -1
  45. package/lib/index-2f5GRlqp.mjs +46 -0
  46. package/lib/{index-Blt9MjZK.mjs → index-B1XGfrNH.mjs} +1 -1
  47. package/lib/{index-DUiyW0v6.js → index-B40ktVOy.js} +1 -1
  48. package/lib/{index-jfL73ugq.mjs → index-B4NYDFvU.mjs} +5 -5
  49. package/lib/{index--QOOnO1S.mjs → index-BAuH_G93.mjs} +5 -5
  50. package/lib/{index-C9ZemP81.mjs → index-BHMN5Px3.mjs} +2 -2
  51. package/lib/{index-CGbZMLbJ.mjs → index-BO0DC-jc.mjs} +3 -3
  52. package/lib/{index-BziywkBj.mjs → index-BQ0RlDhv.mjs} +246 -272
  53. package/lib/{index-Cuu-xM0U.mjs → index-BR4w3fuE.mjs} +5 -5
  54. package/lib/{index-DnOkd5VL.js → index-BTNmmLkb.js} +1 -1
  55. package/lib/{index-BQwsEzas.mjs → index-BlJpOhTM.mjs} +5 -5
  56. package/lib/{index-CjL3WbDp.js → index-Blzzdktm.js} +1 -1
  57. package/lib/{index-Bc7EWiox.js → index-Bn1o04G7.js} +80 -80
  58. package/lib/index-C2Pe6i5V.js +1 -0
  59. package/lib/{index-5xE5bjpW.mjs → index-C9XIIFQK.mjs} +1 -1
  60. package/lib/{index-XFRw6zfV.mjs → index-CCRPy0B_.mjs} +2 -2
  61. package/lib/index-CE0rxdUf.js +1 -0
  62. package/lib/{index-Bu6LLuxH.mjs → index-CEXcD8Mw.mjs} +4 -4
  63. package/lib/{index-BLYjmYmu.mjs → index-CKg04pdA.mjs} +5 -5
  64. package/lib/{index-CxW1HjrT.mjs → index-CM_IP492.mjs} +14 -14
  65. package/lib/{index-pjyIirVB.mjs → index-CT2-qOL1.mjs} +2 -2
  66. package/lib/{index-DFHQnDR7.mjs → index-CYdhveYx.mjs} +6 -6
  67. package/lib/{index-COkWxUoe.mjs → index-Cda4HnP1.mjs} +5 -5
  68. package/lib/{index-BYzONVwG.mjs → index-CfC3_uPF.mjs} +7 -7
  69. package/lib/index-DC1ot7tO.js +1 -0
  70. package/lib/{index-v0MO46Zl.mjs → index-DHAgduQ-.mjs} +4 -4
  71. package/lib/{index-DQjqwKVk.mjs → index-DSSOE7Me.mjs} +2 -2
  72. package/lib/{index-BbCcdl9J.mjs → index-DoFo485M.mjs} +73 -72
  73. package/lib/{index-BNjB0Q50.mjs → index-DvxmZnxH.mjs} +5 -5
  74. package/lib/{index-ju2wtFjy.mjs → index-Dw7INWis.mjs} +7 -7
  75. package/lib/{index-t94-e3qG.js → index-VhcNuaP6.js} +1 -1
  76. package/lib/index-dpkTW-H8.js +1 -0
  77. package/lib/index-f_27F6WX.js +1 -0
  78. package/lib/{index-BkHLwIMc.mjs → index-l0sxQXRT.mjs} +1 -1
  79. package/lib/{index-CdOqWihR.mjs → index-mXHkgOxH.mjs} +4 -4
  80. package/lib/{index-C2jOUiub.mjs → index-pN0Dgjjf.mjs} +5 -5
  81. package/lib/{index-B7U-me-L.mjs → index-pNqQSm4p.mjs} +6628 -6659
  82. package/lib/{index.es-BYLVcsBS.js → index.es-_N4sKEIC.js} +1 -1
  83. package/lib/{index.es-BrgiiIYV.mjs → index.es-rEir51oG.mjs} +7 -7
  84. package/lib/index.js +1 -1
  85. package/lib/index.mjs +5 -5
  86. package/lib/mayan.mjs +10 -10
  87. package/lib/{mint-BjwZUbPm.mjs → mint-DVxIczlI.mjs} +2 -2
  88. package/lib/ntt.js +1 -1
  89. package/lib/ntt.mjs +10 -10
  90. package/lib/{platform-pi9E7cPR.mjs → platform-CbDx4hex.mjs} +4 -4
  91. package/lib/platform-CyTWPtDR.js +1 -0
  92. package/lib/{platform-C-edrCmf.mjs → platform-D-nUFU0e.mjs} +6 -6
  93. package/lib/platform-PaIJsXKV.mjs +118 -0
  94. package/lib/{provider-jsonrpc-BjcoR80W.mjs → provider-jsonrpc-C_IZFSfB.mjs} +2 -2
  95. package/lib/{sha3-B1KxiAa7.mjs → sha3-DQQvDwj1.mjs} +1 -1
  96. package/lib/{signer-CgLO7fBA.mjs → signer-CsMX8mEc.mjs} +6 -6
  97. package/lib/{solana-DA48rYUK.js → solana-BRQmi9BN.js} +1 -1
  98. package/lib/solana-C_0khyJw.mjs +18 -0
  99. package/lib/{solana-Pjpx_PkM.js → solana-CrjSp_Zk.js} +1 -1
  100. package/lib/{solana-CvaeYBIB.mjs → solana-SQhnN3yB.mjs} +6 -6
  101. package/lib/{solanaEmbed.esm-jxAhxZ9V.js → solanaEmbed.esm-B7IRXgnI.js} +1 -1
  102. package/lib/{solanaEmbed.esm-Gti-Nr19.mjs → solanaEmbed.esm-Din0Z51P.mjs} +3 -3
  103. package/lib/src/components/SampleApp/index.d.ts.map +1 -1
  104. package/lib/src/config/index.d.ts.map +1 -1
  105. package/lib/src/config/types.d.ts +2 -0
  106. package/lib/src/config/types.d.ts.map +1 -1
  107. package/lib/src/exports/executor.d.ts +2 -0
  108. package/lib/src/exports/executor.d.ts.map +1 -0
  109. package/lib/src/hooks/useFetchSupportedRoutes.d.ts.map +1 -1
  110. package/lib/src/utils/index.d.ts +1 -0
  111. package/lib/src/utils/index.d.ts.map +1 -1
  112. package/lib/src/utils/sdkv2.d.ts +0 -1
  113. package/lib/src/utils/sdkv2.d.ts.map +1 -1
  114. package/lib/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
  115. package/lib/src/views/v2/Redeem/TransactionDetails/index.d.ts.map +1 -1
  116. package/lib/src/views/v2/Redeem/index.d.ts.map +1 -1
  117. package/lib/{sui-CuwmPzXZ.mjs → sui-BSLo7-bI.mjs} +14 -14
  118. package/lib/{sui-Bi1J0W_P.mjs → sui-BePFnRSc.mjs} +3 -3
  119. package/lib/{sui-uSCH-o_h.js → sui-C7KPm3kD.js} +1 -1
  120. package/lib/{tokens-DcqY0jHv.js → tokens-CChVRIuE.js} +1 -1
  121. package/lib/{tokens-DOx4hiaR.mjs → tokens-CyKAZUN-.mjs} +4 -4
  122. package/lib/{units-YO78Cq5F.mjs → units-DP5zqyxn.mjs} +9 -9
  123. package/lib/{unsignedTransaction-Cj476rGh.mjs → unsignedTransaction-fSrwDjHx.mjs} +9 -9
  124. package/lib/{web3--AtxvLIy.mjs → web3-DCo8oN-v.mjs} +4 -4
  125. package/package.json +16 -1
  126. package/lib/aptos-VwYOwtQy.mjs +0 -179
  127. package/lib/aptos-hc5GrCHO.js +0 -2
  128. package/lib/constants-Cib4VRZO.js +0 -1
  129. package/lib/index-BlzRxQ82.js +0 -1
  130. package/lib/index-CJXmILJz.js +0 -1
  131. package/lib/index-C_dsyQjC.mjs +0 -46
  132. package/lib/index-CpuzvBlL.js +0 -1
  133. package/lib/index-Cxg2C7RE.js +0 -1
  134. package/lib/index-DDAGOrv0.js +0 -1
  135. package/lib/solana-qHqB-cdc.mjs +0 -18
@@ -1,56 +1,34 @@
1
- var Ue = Object.defineProperty;
2
- var Te = (r, e, t) => e in r ? Ue(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var u = (r, e, t) => Te(r, typeof e != "symbol" ? e + "" : e, t);
4
- import { ae as m, d as g, a_ as Ce, aJ as ne, as as ke, cB as _e, an as M, bU as Pe, aP as L, aq as U, ap as V, b1 as q, aX as oe, cC as ve, cD as ze, ao as re, b2 as j, aA as Ke, b3 as qe } from "./address-DXFbgyJW.mjs";
5
- import { d as l, P as Fe, c as Ve } from "./index-BkHLwIMc.mjs";
6
- import { a as De, S as Oe } from "./unsignedTransaction-Cj476rGh.mjs";
7
- import { c as Ge } from "./create-CzWSWmF_.mjs";
8
- import { r as Ne } from "./chain-DaAd2Ztf.mjs";
9
- const se = (r) => typeof r == "string" ? g.Buffer.from(r) : r;
10
- function b(r, e) {
11
- return m.findProgramAddressSync(Array.isArray(r) ? r.map(se) : [se(r)], new m(e))[0];
12
- }
13
- function Mt(r, e) {
14
- return {
15
- pubkey: new m(r),
16
- isWritable: !0,
17
- isSigner: e
18
- };
19
- }
20
- function bt(r, e) {
21
- return {
22
- pubkey: new m(r),
23
- isWritable: !1,
24
- isSigner: e
25
- };
26
- }
27
- function z(r) {
28
- if (r === null)
29
- throw Error("account info is null");
30
- return r.data;
31
- }
32
- const ue = new m("BPFLoaderUpgradeab1e11111111111111111111111");
33
- function Re(r) {
34
- return b([new m(r).toBuffer()], ue);
35
- }
36
- class $e extends Error {
1
+ var Le = Object.defineProperty;
2
+ var Ue = (r, e, t) => e in r ? Le(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var u = (r, e, t) => Ue(r, typeof e != "symbol" ? e + "" : e, t);
4
+ import { ae as p, a_ as Te, aJ as ne, d, as as Ce, cB as _e, an as M, bV as ke, aP as L, aq as U, ap as V, b1 as q, aX as ie, cC as Pe, cD as ve, ao as re, b2 as j, aA as ze, b3 as Ke } from "./address-Drr_9OcK.mjs";
5
+ import { d as m, P as qe, c as Fe } from "./index-l0sxQXRT.mjs";
6
+ import { d as b, g as z } from "./account-CKUCmcgT.mjs";
7
+ import { a as Ve, S as De } from "./unsignedTransaction-fSrwDjHx.mjs";
8
+ import { c as Ge } from "./create-B9LwWha4.mjs";
9
+ import { r as Oe } from "./chain-CNVMEdrk.mjs";
10
+ const oe = new p("BPFLoaderUpgradeab1e11111111111111111111111");
11
+ function Ne(r) {
12
+ return b([new p(r).toBuffer()], oe);
13
+ }
14
+ class Re extends Error {
37
15
  constructor(e) {
38
16
  super(e), this.name = "IdlError";
39
17
  }
40
18
  }
41
- function ce(r, e) {
19
+ function ue(r, e) {
42
20
  switch (e.type.kind) {
43
21
  case "struct":
44
- return e.type.fields.map((t) => I(r, t.type)).reduce((t, n) => t + n, 0);
22
+ return e.type.fields.map((t) => A(r, t.type)).reduce((t, n) => t + n, 0);
45
23
  case "enum": {
46
- const t = e.type.variants.map((n) => n.fields ? n.fields.map((s) => typeof s == "object" && "name" in s ? I(r, s.type) : I(r, s)).reduce((s, a) => s + a, 0) : 0);
24
+ const t = e.type.variants.map((n) => n.fields ? n.fields.map((s) => typeof s == "object" && "name" in s ? A(r, s.type) : A(r, s)).reduce((s, a) => s + a, 0) : 0);
47
25
  return Math.max(...t) + 1;
48
26
  }
49
27
  case "alias":
50
- return I(r, e.type.value);
28
+ return A(r, e.type.value);
51
29
  }
52
30
  }
53
- function I(r, e) {
31
+ function A(r, e) {
54
32
  var t;
55
33
  switch (e) {
56
34
  case "bool":
@@ -93,32 +71,32 @@ function I(r, e) {
93
71
  if ("vec" in e)
94
72
  return 1;
95
73
  if ("option" in e)
96
- return 1 + I(r, e.option);
74
+ return 1 + A(r, e.option);
97
75
  if ("coption" in e)
98
- return 4 + I(r, e.coption);
76
+ return 4 + A(r, e.coption);
99
77
  if ("defined" in e) {
100
78
  const n = ((t = r.types) == null ? void 0 : t.filter((a) => a.name === e.defined)) ?? [];
101
79
  if (n.length !== 1)
102
- throw new $e(`Type not found: ${JSON.stringify(e)}`);
80
+ throw new Re(`Type not found: ${JSON.stringify(e)}`);
103
81
  let s = n[0];
104
- return ce(r, s);
82
+ return ue(r, s);
105
83
  }
106
84
  if ("array" in e) {
107
85
  let n = e.array[0], s = e.array[1];
108
- return I(r, n) * s;
86
+ return A(r, n) * s;
109
87
  }
110
88
  throw new Error(`Invalid type ${JSON.stringify(e)}`);
111
89
  }
112
90
  }
113
- function _(r) {
91
+ function k(r) {
114
92
  return r.replace(/(?:^\w|[A-Z]|\b\w)/g, function(e, t) {
115
93
  return t === 0 ? e.toLowerCase() : e.toUpperCase();
116
94
  }).replace(/[\s\-_]+/g, "");
117
95
  }
118
- function Ye(r) {
96
+ function $e(r) {
119
97
  return r.charAt(0).toUpperCase() + r.slice(1);
120
98
  }
121
- const ge = [
99
+ const ce = [
122
100
  { name: "discriminator", binary: "bytes", size: 4 },
123
101
  { name: "consistencyLevel", binary: "uint", size: 1, endianness: "little" },
124
102
  { name: "emitterAuthority", ...ne },
@@ -132,31 +110,31 @@ const ge = [
132
110
  { name: "payloadLength", binary: "uint", size: 4, endianness: "little" },
133
111
  { name: "payload", binary: "bytes" }
134
112
  ];
135
- function de(r) {
136
- return Ce(ge, r);
113
+ function ge(r) {
114
+ return Te(ce, r);
137
115
  }
138
116
  function T(r, e, t, n) {
139
- const s = typeof e == "string" ? g.Buffer.from(e, "hex") : g.Buffer.from(e);
117
+ const s = typeof e == "string" ? d.Buffer.from(e, "hex") : d.Buffer.from(e);
140
118
  if (s.length != 32)
141
119
  throw Error("address.length != 32");
142
- const a = g.Buffer.alloc(8);
120
+ const a = d.Buffer.alloc(8);
143
121
  return a.writeBigUInt64BE(typeof n == "number" ? BigInt(n) : n), b([
144
122
  s,
145
123
  (() => {
146
- const i = g.Buffer.alloc(2);
124
+ const i = d.Buffer.alloc(2);
147
125
  return i.writeUInt16BE(t), i;
148
126
  })(),
149
127
  a
150
128
  ], r);
151
129
  }
152
- async function je(r, e, t, n, s, a) {
130
+ async function Ye(r, e, t, n, s, a) {
153
131
  return r.getAccountInfo(T(e, t, n, s), a).then((i) => !!z(i)[0]);
154
132
  }
155
133
  function S(r) {
156
- return b([g.Buffer.from("Bridge")], r);
134
+ return b([d.Buffer.from("Bridge")], r);
157
135
  }
158
- async function fe(r, e, t) {
159
- return r.getAccountInfo(S(e), t).then((n) => O.deserialize(z(n)));
136
+ async function de(r, e, t) {
137
+ return r.getAccountInfo(S(e), t).then((n) => G.deserialize(z(n)));
160
138
  }
161
139
  class D {
162
140
  constructor(e, t) {
@@ -171,7 +149,7 @@ class D {
171
149
  return new D(t, n);
172
150
  }
173
151
  }
174
- class O {
152
+ class G {
175
153
  constructor(e, t, n) {
176
154
  u(this, "guardianSetIndex");
177
155
  u(this, "lastLamports");
@@ -182,14 +160,14 @@ class O {
182
160
  if (e.length != 24)
183
161
  throw new Error("data.length != 24");
184
162
  const t = e.readUInt32LE(0), n = e.readBigUInt64LE(4), s = D.deserialize(e.subarray(12));
185
- return new O(t, n, s);
163
+ return new G(t, n, s);
186
164
  }
187
165
  }
188
- function G(r, e) {
189
- return b([g.Buffer.from("Sequence"), new m(r).toBytes()], e);
166
+ function O(r, e) {
167
+ return b([d.Buffer.from("Sequence"), new p(r).toBytes()], e);
190
168
  }
191
- async function me(r, e, t, n) {
192
- return r.getAccountInfo(G(e, t), n).then((s) => N.deserialize(z(s)));
169
+ async function fe(r, e, t, n) {
170
+ return r.getAccountInfo(O(e, t), n).then((s) => N.deserialize(z(s)));
193
171
  }
194
172
  class N {
195
173
  constructor(e, t, n) {
@@ -209,25 +187,25 @@ class N {
209
187
  return this.sequence;
210
188
  }
211
189
  }
212
- function W(r) {
213
- return b([g.Buffer.from("emitter")], r);
190
+ function H(r) {
191
+ return b([d.Buffer.from("emitter")], r);
214
192
  }
215
- function H(r, e) {
216
- const t = W(r);
193
+ function J(r, e) {
194
+ const t = H(r);
217
195
  return {
218
196
  emitter: t,
219
- sequence: G(t, e)
197
+ sequence: O(t, e)
220
198
  };
221
199
  }
222
- async function We(r, e, t, n) {
223
- return me(r, W(e), t, n);
200
+ async function je(r, e, t, n) {
201
+ return fe(r, H(e), t, n);
224
202
  }
225
203
  function C(r) {
226
- return b([g.Buffer.from("fee_collector")], r);
204
+ return b([d.Buffer.from("fee_collector")], r);
227
205
  }
228
- const ae = 65, P = 20;
206
+ const se = 65, P = 20;
229
207
  function He(r, e, t) {
230
- return new ke({
208
+ return new Ce({
231
209
  keys: [],
232
210
  programId: _e.programId,
233
211
  data: Je.serialize(r, e, t)
@@ -279,31 +257,31 @@ class Je {
279
257
  throw Error("signatures.length != keys.length");
280
258
  if (n.length != 32)
281
259
  throw Error("message.length != 32");
282
- const s = e.length, a = 11, i = 1 + s * a, o = ae + P, c = i + s * o, f = 32, d = g.Buffer.alloc(c + f);
283
- d.writeUInt8(s, 0), d.write(n.toString("hex"), c, "hex");
284
- for (let p = 0; p < s; ++p) {
285
- const y = e.at(p);
286
- if ((y == null ? void 0 : y.length) != ae)
287
- throw Error(`signatures[${p}].length != 65`);
288
- const h = t.at(p);
260
+ const s = e.length, a = 11, i = 1 + s * a, o = se + P, c = i + s * o, f = 32, g = d.Buffer.alloc(c + f);
261
+ g.writeUInt8(s, 0), g.write(n.toString("hex"), c, "hex");
262
+ for (let l = 0; l < s; ++l) {
263
+ const y = e.at(l);
264
+ if ((y == null ? void 0 : y.length) != se)
265
+ throw Error(`signatures[${l}].length != 65`);
266
+ const h = t.at(l);
289
267
  if ((h == null ? void 0 : h.length) != P)
290
- throw Error(`keys[${p}].length != 20`);
291
- const A = i + o * p, k = A + 65;
292
- d.writeUInt16LE(A, 1 + p * a), d.writeUInt8(0, 3 + p * a), d.writeUInt16LE(k, 4 + p * a), d.writeUInt8(0, 6 + p * a), d.writeUInt16LE(c, 7 + p * a), d.writeUInt16LE(f, 9 + p * a), d.writeUInt8(0, 10 + p * a), d.write(y.toString("hex"), A, "hex"), d.write(h.toString("hex"), k, "hex");
268
+ throw Error(`keys[${l}].length != 20`);
269
+ const I = i + o * l, _ = I + 65;
270
+ g.writeUInt16LE(I, 1 + l * a), g.writeUInt8(0, 3 + l * a), g.writeUInt16LE(_, 4 + l * a), g.writeUInt8(0, 6 + l * a), g.writeUInt16LE(c, 7 + l * a), g.writeUInt16LE(f, 9 + l * a), g.writeUInt8(0, 10 + l * a), g.write(y.toString("hex"), I, "hex"), g.write(h.toString("hex"), _, "hex");
293
271
  }
294
- return d;
272
+ return g;
295
273
  }
296
274
  }
297
275
  function x(r, e) {
298
276
  return b([
299
- g.Buffer.from("GuardianSet"),
277
+ d.Buffer.from("GuardianSet"),
300
278
  (() => {
301
- const t = g.Buffer.alloc(4);
279
+ const t = d.Buffer.alloc(4);
302
280
  return t.writeUInt32BE(e), t;
303
281
  })()
304
282
  ], r);
305
283
  }
306
- async function J(r, e, t, n) {
284
+ async function W(r, e, t, n) {
307
285
  return r.getAccountInfo(x(e, t), n).then((s) => R.deserialize(z(s)));
308
286
  }
309
287
  class R {
@@ -324,10 +302,10 @@ class R {
324
302
  }
325
303
  }
326
304
  function E(r, e) {
327
- return b([g.Buffer.from("PostedVAA"), e], r);
305
+ return b([d.Buffer.from("PostedVAA"), e], r);
328
306
  }
329
- async function Xe(r, e, t) {
330
- return r.getAccountInfo(new m(e), t).then((n) => $.deserialize(z(n)));
307
+ async function We(r, e, t) {
308
+ return r.getAccountInfo(new p(e), t).then((n) => $.deserialize(z(n)));
331
309
  }
332
310
  class $ {
333
311
  constructor(e, t, n) {
@@ -341,17 +319,17 @@ class $ {
341
319
  return new $(n, a, i);
342
320
  }
343
321
  }
344
- function le(r) {
345
- return b([g.Buffer.from("upgrade")], r);
322
+ function me(r) {
323
+ return b([d.Buffer.from("upgrade")], r);
346
324
  }
347
- function pe(r, e, t) {
325
+ function le(r, e, t) {
348
326
  return M.transfer({
349
- fromPubkey: new m(e),
327
+ fromPubkey: new p(e),
350
328
  toPubkey: C(r),
351
329
  lamports: t
352
330
  });
353
331
  }
354
- class Qe {
332
+ class Xe {
355
333
  constructor(e) {
356
334
  u(this, "idl");
357
335
  this.idl = e;
@@ -383,10 +361,10 @@ class Qe {
383
361
  }
384
362
  }
385
363
  size(e) {
386
- return ce(this.idl, e) ?? 0;
364
+ return ue(this.idl, e) ?? 0;
387
365
  }
388
366
  }
389
- class Ze {
367
+ class Qe {
390
368
  constructor(e) {
391
369
  }
392
370
  decode(e) {
@@ -395,52 +373,52 @@ class Ze {
395
373
  }
396
374
  class B {
397
375
  static fieldLayout(e, t) {
398
- const n = e.name !== void 0 ? _(e.name) : void 0;
376
+ const n = e.name !== void 0 ? k(e.name) : void 0;
399
377
  switch (e.type) {
400
378
  case "bool":
401
- return l.bool(n);
379
+ return m.bool(n);
402
380
  case "u8":
403
- return l.u8(n);
381
+ return m.u8(n);
404
382
  case "i8":
405
- return l.i8(n);
383
+ return m.i8(n);
406
384
  case "u16":
407
- return l.u16(n);
385
+ return m.u16(n);
408
386
  case "i16":
409
- return l.i16(n);
387
+ return m.i16(n);
410
388
  case "u32":
411
- return l.u32(n);
389
+ return m.u32(n);
412
390
  case "i32":
413
- return l.i32(n);
391
+ return m.i32(n);
414
392
  case "f32":
415
- return l.f32(n);
393
+ return m.f32(n);
416
394
  case "u64":
417
- return l.u64(n);
395
+ return m.u64(n);
418
396
  case "i64":
419
- return l.i64(n);
397
+ return m.i64(n);
420
398
  case "f64":
421
- return l.f64(n);
399
+ return m.f64(n);
422
400
  case "u128":
423
- return l.u128(n);
401
+ return m.u128(n);
424
402
  case "i128":
425
- return l.i128(n);
403
+ return m.i128(n);
426
404
  case "u256":
427
- return l.u256(n);
405
+ return m.u256(n);
428
406
  case "i256":
429
- return l.i256(n);
407
+ return m.i256(n);
430
408
  case "bytes":
431
- return l.vecU8(n);
409
+ return m.vecU8(n);
432
410
  case "string":
433
- return l.str(n);
411
+ return m.str(n);
434
412
  case "publicKey":
435
- return l.publicKey(n);
413
+ return m.publicKey(n);
436
414
  default: {
437
415
  if ("vec" in e.type)
438
- return l.vec(B.fieldLayout({
416
+ return m.vec(B.fieldLayout({
439
417
  name: void 0,
440
418
  type: e.type.vec
441
419
  }, t), n);
442
420
  if ("option" in e.type)
443
- return l.option(B.fieldLayout({
421
+ return m.option(B.fieldLayout({
444
422
  name: void 0,
445
423
  type: e.type.option
446
424
  }, t), n);
@@ -449,7 +427,7 @@ class B {
449
427
  name: void 0,
450
428
  type: s
451
429
  }, t);
452
- return l.array(i, a, n);
430
+ return m.array(i, a, n);
453
431
  } else
454
432
  throw new Error(`Not yet implemented: ${e}`);
455
433
  }
@@ -464,29 +442,29 @@ class X {
464
442
  static parseIxLayout(e) {
465
443
  const n = (e.instructions ? e.instructions : []).map((s) => {
466
444
  let a = s.args.map((o) => B.fieldLayout(o, Array.from([...e.accounts ?? [], ...e.types ?? []])));
467
- const i = _(s.name);
468
- return [i, l.struct(a, i)];
445
+ const i = k(s.name);
446
+ return [i, m.struct(a, i)];
469
447
  }).concat(e.instructions.map((s) => {
470
448
  let a = s.args.map((o) => B.fieldLayout(o, Array.from([...e.accounts ?? [], ...e.types ?? []])));
471
- const i = _(s.name);
472
- return [i, l.struct(a, i)];
449
+ const i = k(s.name);
450
+ return [i, m.struct(a, i)];
473
451
  }));
474
452
  return new Map(n);
475
453
  }
476
454
  encode(e, t) {
477
- const n = g.Buffer.alloc(1e3), s = _(e), a = this.ixLayout.get(s);
455
+ const n = d.Buffer.alloc(1e3), s = k(e), a = this.ixLayout.get(s);
478
456
  if (!a)
479
457
  throw new Error(`Unknown method: ${s}`);
480
458
  const i = a.encode(t, n), o = n.slice(0, i);
481
- return et(F[Ye(s)], o);
459
+ return Ze(F[$e(s)], o);
482
460
  }
483
461
  encodeState(e, t) {
484
462
  throw new Error("Wormhole program does not have state");
485
463
  }
486
464
  decode(e, t = "hex") {
487
465
  var o;
488
- typeof e == "string" && (e = t === "hex" ? g.Buffer.from(e, "hex") : Pe.decode(e));
489
- let n = g.Buffer.from(e.slice(0, 1)).readInt8(), s = g.Buffer.from(e.slice(1)), a = _(F[n] ?? "");
466
+ typeof e == "string" && (e = t === "hex" ? d.Buffer.from(e, "hex") : ke.decode(e));
467
+ let n = d.Buffer.from(e.slice(0, 1)).readInt8(), s = d.Buffer.from(e.slice(1)), a = k(F[n] ?? "");
490
468
  return this.ixLayout.get(a) ? { data: (o = this.ixLayout.get(a)) == null ? void 0 : o.decode(s), name: a } : null;
491
469
  }
492
470
  }
@@ -494,11 +472,11 @@ var F;
494
472
  (function(r) {
495
473
  r[r.Initialize = 0] = "Initialize", r[r.PostMessage = 1] = "PostMessage", r[r.PostVaa = 2] = "PostVaa", r[r.SetFees = 3] = "SetFees", r[r.TransferFees = 4] = "TransferFees", r[r.UpgradeContract = 5] = "UpgradeContract", r[r.UpgradeGuardianSet = 6] = "UpgradeGuardianSet", r[r.VerifySignatures = 7] = "VerifySignatures", r[r.PostMessageUnreliable = 8] = "PostMessageUnreliable";
496
474
  })(F || (F = {}));
497
- function et(r, e) {
498
- const t = g.Buffer.alloc(1 + (e === void 0 ? 0 : e.length));
475
+ function Ze(r, e) {
476
+ const t = d.Buffer.alloc(1 + (e === void 0 ? 0 : e.length));
499
477
  return t.writeUInt8(r, 0), e !== void 0 && t.write(e.toString("hex"), 1, "hex"), t;
500
478
  }
501
- class tt {
479
+ class et {
502
480
  constructor(e) {
503
481
  }
504
482
  encode(e, t) {
@@ -508,7 +486,7 @@ class tt {
508
486
  throw new Error("Wormhole program does not have state");
509
487
  }
510
488
  }
511
- class nt {
489
+ class tt {
512
490
  constructor(e) {
513
491
  }
514
492
  encode(e, t) {
@@ -518,14 +496,14 @@ class nt {
518
496
  throw new Error("Wormhole program does not have user-defined types");
519
497
  }
520
498
  }
521
- class rt {
499
+ class nt {
522
500
  constructor(e) {
523
501
  u(this, "instruction");
524
502
  u(this, "accounts");
525
503
  u(this, "state");
526
504
  u(this, "events");
527
505
  u(this, "types");
528
- this.instruction = new X(e), this.accounts = new Qe(e), this.state = new tt(e), this.events = new Ze(e), this.types = new nt(e);
506
+ this.instruction = new X(e), this.accounts = new Xe(e), this.state = new et(e), this.events = new Qe(e), this.types = new tt(e);
529
507
  }
530
508
  }
531
509
  const Q = {
@@ -1139,130 +1117,130 @@ const Q = {
1139
1117
  }
1140
1118
  ]
1141
1119
  };
1142
- function ye(r, e) {
1143
- return new Fe(Q, new m(r), e === void 0 ? { connection: null } : e, he());
1120
+ function pe(r, e) {
1121
+ return new qe(Q, new p(r), e === void 0 ? { connection: null } : e, ye());
1144
1122
  }
1145
1123
  function w(r, e) {
1146
- return ye(r, Ve(e));
1124
+ return pe(r, Fe(e));
1147
1125
  }
1148
- function he() {
1149
- return new rt(Q);
1126
+ function ye() {
1127
+ return new nt(Q);
1150
1128
  }
1151
- function st(r, e, t, n) {
1129
+ function rt(r, e, t, n) {
1152
1130
  const s = w(e, r).methods.setFees();
1153
1131
  return s._ixFn(...s._args, {
1154
- accounts: Se(e, t, n),
1132
+ accounts: he(e, t, n),
1155
1133
  signers: void 0,
1156
1134
  remainingAccounts: void 0,
1157
1135
  preInstructions: void 0,
1158
1136
  postInstructions: void 0
1159
1137
  });
1160
1138
  }
1161
- function Se(r, e, t) {
1139
+ function he(r, e, t) {
1162
1140
  return {
1163
- payer: new m(e),
1141
+ payer: new p(e),
1164
1142
  bridge: S(r),
1165
- vaa: E(r, g.Buffer.from(t.hash)),
1143
+ vaa: E(r, d.Buffer.from(t.hash)),
1166
1144
  claim: T(r, t.emitterAddress.toString(), L(t.emitterChain), t.sequence),
1167
1145
  systemProgram: M.programId
1168
1146
  };
1169
1147
  }
1170
- function at(r, e, t, n, s) {
1148
+ function st(r, e, t, n, s) {
1171
1149
  const a = w(e, r).methods.transferFees();
1172
1150
  return a._ixFn(...a._args, {
1173
- accounts: we(e, t, n, s),
1151
+ accounts: Se(e, t, n, s),
1174
1152
  signers: void 0,
1175
1153
  remainingAccounts: void 0,
1176
1154
  preInstructions: void 0,
1177
1155
  postInstructions: void 0
1178
1156
  });
1179
1157
  }
1180
- function we(r, e, t, n) {
1158
+ function Se(r, e, t, n) {
1181
1159
  return {
1182
- payer: new m(e),
1160
+ payer: new p(e),
1183
1161
  bridge: S(r),
1184
- vaa: E(r, g.Buffer.from(n.hash)),
1162
+ vaa: E(r, d.Buffer.from(n.hash)),
1185
1163
  claim: T(r, n.emitterAddress.toString(), L(n.emitterChain), n.sequence),
1186
1164
  feeCollector: C(r),
1187
- recipient: new m(t),
1165
+ recipient: new p(t),
1188
1166
  rent: U,
1189
1167
  systemProgram: M.programId
1190
1168
  };
1191
1169
  }
1192
- function it(r, e, t, n) {
1170
+ function at(r, e, t, n) {
1193
1171
  const s = w(e, r).methods.upgradeGuardianSet();
1194
1172
  return s._ixFn(...s._args, {
1195
- accounts: Me(e, t, n),
1173
+ accounts: we(e, t, n),
1196
1174
  signers: void 0,
1197
1175
  remainingAccounts: void 0,
1198
1176
  preInstructions: void 0,
1199
1177
  postInstructions: void 0
1200
1178
  });
1201
1179
  }
1202
- function Me(r, e, t) {
1180
+ function we(r, e, t) {
1203
1181
  return {
1204
- payer: new m(e),
1182
+ payer: new p(e),
1205
1183
  bridge: S(r),
1206
- vaa: E(r, g.Buffer.from(t.hash)),
1184
+ vaa: E(r, d.Buffer.from(t.hash)),
1207
1185
  claim: T(r, t.emitterAddress.toString(), L(t.emitterChain), t.sequence),
1208
1186
  guardianSetOld: x(r, t.guardianSet),
1209
1187
  guardianSetNew: x(r, t.guardianSet + 1),
1210
1188
  systemProgram: M.programId
1211
1189
  };
1212
1190
  }
1213
- function ot(r, e, t, n) {
1191
+ function it(r, e, t, n) {
1214
1192
  const s = w(e, r).methods.upgradeContract();
1215
1193
  return s._ixFn(...s._args, {
1216
- accounts: be(e, t, n),
1194
+ accounts: Me(e, t, n),
1217
1195
  signers: void 0,
1218
1196
  remainingAccounts: void 0,
1219
1197
  preInstructions: void 0,
1220
1198
  postInstructions: void 0
1221
1199
  });
1222
1200
  }
1223
- function be(r, e, t, n) {
1201
+ function Me(r, e, t, n) {
1224
1202
  const { newContract: s } = t.payload.actionArgs;
1225
1203
  return {
1226
- payer: new m(e),
1204
+ payer: new p(e),
1227
1205
  bridge: S(r),
1228
- vaa: E(r, g.Buffer.from(t.hash)),
1206
+ vaa: E(r, d.Buffer.from(t.hash)),
1229
1207
  claim: T(r, t.emitterAddress.toString(), L(t.emitterChain), t.sequence),
1230
- upgradeAuthority: le(r),
1231
- spill: new m(n === void 0 ? e : n),
1208
+ upgradeAuthority: me(r),
1209
+ spill: new p(n === void 0 ? e : n),
1232
1210
  implementation: new q(s).unwrap(),
1233
- programData: Re(r),
1234
- wormholeProgram: new m(r),
1211
+ programData: Ne(r),
1212
+ wormholeProgram: new p(r),
1235
1213
  rent: U,
1236
1214
  clock: V,
1237
- bpfLoaderUpgradeable: ue,
1215
+ bpfLoaderUpgradeable: oe,
1238
1216
  systemProgram: M.programId
1239
1217
  };
1240
1218
  }
1241
- function ut(r, e, t, n, s, a) {
1242
- const i = w(e, r).methods.initialize(n, new oe(s.toString()), [
1219
+ function ot(r, e, t, n, s, a) {
1220
+ const i = w(e, r).methods.initialize(n, new ie(s.toString()), [
1243
1221
  ...a.map((o) => [...new Uint8Array(o)])
1244
1222
  ]);
1245
1223
  return i._ixFn(...i._args, {
1246
- accounts: Ae(e, t),
1224
+ accounts: be(e, t),
1247
1225
  signers: void 0,
1248
1226
  remainingAccounts: void 0,
1249
1227
  preInstructions: void 0,
1250
1228
  postInstructions: void 0
1251
1229
  });
1252
1230
  }
1253
- function Ae(r, e) {
1231
+ function be(r, e) {
1254
1232
  return {
1255
1233
  bridge: S(r),
1256
1234
  guardianSet: x(r, 0),
1257
1235
  feeCollector: C(r),
1258
- payer: new m(e),
1236
+ payer: new p(e),
1259
1237
  clock: V,
1260
1238
  rent: U,
1261
1239
  systemProgram: M.programId
1262
1240
  };
1263
1241
  }
1264
1242
  function Ie(r, e, t, n, s, a, i) {
1265
- const o = w(e, r).methods.postMessage(a, g.Buffer.from(s), i);
1243
+ const o = w(e, r).methods.postMessage(a, d.Buffer.from(s), i);
1266
1244
  return o._ixFn(...o._args, {
1267
1245
  accounts: Z(e, t, n),
1268
1246
  signers: void 0,
@@ -1273,19 +1251,19 @@ function Ie(r, e, t, n, s, a, i) {
1273
1251
  }
1274
1252
  function Z(r, e, t, n) {
1275
1253
  let s;
1276
- return n ? { emitter: n, sequence: s } = H(n, r) : (n = e, s = G(n, r)), {
1254
+ return n ? { emitter: n, sequence: s } = J(n, r) : (n = e, s = O(n, r)), {
1277
1255
  bridge: S(r),
1278
- message: new m(t),
1279
- emitter: new m(n),
1256
+ message: new p(t),
1257
+ emitter: new p(n),
1280
1258
  sequence: s,
1281
- payer: new m(e),
1259
+ payer: new p(e),
1282
1260
  feeCollector: C(r),
1283
1261
  clock: V,
1284
1262
  rent: U,
1285
1263
  systemProgram: M.programId
1286
1264
  };
1287
1265
  }
1288
- function xe(r, e, t, n, s) {
1266
+ function Ae(r, e, t, n, s) {
1289
1267
  const a = w(e, r).methods.postVaa(
1290
1268
  1,
1291
1269
  // TODO: hardcoded VAA version
@@ -1294,66 +1272,66 @@ function xe(r, e, t, n, s) {
1294
1272
  n.nonce,
1295
1273
  L(n.emitterChain),
1296
1274
  [...n.emitterAddress.toUint8Array()],
1297
- new oe(n.sequence.toString()),
1275
+ new ie(n.sequence.toString()),
1298
1276
  n.consistencyLevel,
1299
1277
  // Note: This _must_ be a Buffer, a Uint8Array does not work
1300
- g.Buffer.from(ve(n.payloadLiteral, n.payload))
1278
+ d.Buffer.from(Pe(n.payloadLiteral, n.payload))
1301
1279
  );
1302
1280
  return a._ixFn(...a._args, {
1303
- accounts: Ee(e, t, s, n),
1281
+ accounts: xe(e, t, s, n),
1304
1282
  signers: void 0,
1305
1283
  remainingAccounts: void 0,
1306
1284
  preInstructions: void 0,
1307
1285
  postInstructions: void 0
1308
1286
  });
1309
1287
  }
1310
- function Ee(r, e, t, n) {
1288
+ function xe(r, e, t, n) {
1311
1289
  return {
1312
1290
  guardianSet: x(r, n.guardianSet),
1313
1291
  bridge: S(r),
1314
- signatureSet: new m(t),
1315
- vaa: E(r, g.Buffer.from(n.hash)),
1316
- payer: new m(e),
1292
+ signatureSet: new p(t),
1293
+ vaa: E(r, d.Buffer.from(n.hash)),
1294
+ payer: new p(e),
1317
1295
  clock: V,
1318
1296
  rent: U,
1319
1297
  systemProgram: M.programId
1320
1298
  };
1321
1299
  }
1322
- const ct = 19;
1323
- async function Be(r, e, t, n, s, a) {
1324
- const i = n.guardianSet, o = await J(r, e, i, a), c = n.signatures, f = o.keys, d = 7, p = [];
1325
- for (let y = 0; y < Math.ceil(c.length / d); ++y) {
1326
- const h = y * d, A = Math.min(c.length, (y + 1) * d), k = new Array(ct).fill(-1), ee = [], te = [];
1327
- for (let K = 0; K < A - h; ++K) {
1300
+ const ut = 19;
1301
+ async function Ee(r, e, t, n, s, a) {
1302
+ const i = n.guardianSet, o = await W(r, e, i, a), c = n.signatures, f = o.keys, g = 7, l = [];
1303
+ for (let y = 0; y < Math.ceil(c.length / g); ++y) {
1304
+ const h = y * g, I = Math.min(c.length, (y + 1) * g), _ = new Array(ut).fill(-1), ee = [], te = [];
1305
+ for (let K = 0; K < I - h; ++K) {
1328
1306
  const Y = c.at(K + h);
1329
- ee.push(g.Buffer.from(Y.signature.encode())), te.push(f.at(Y.guardianIndex)), k[Y.guardianIndex] = K;
1307
+ ee.push(d.Buffer.from(Y.signature.encode())), te.push(f.at(Y.guardianIndex)), _[Y.guardianIndex] = K;
1330
1308
  }
1331
- p.push(He(ee, te, g.Buffer.from(n.hash))), p.push(gt(r, e, t, n, s, k));
1309
+ l.push(He(ee, te, d.Buffer.from(n.hash))), l.push(ct(r, e, t, n, s, _));
1332
1310
  }
1333
- return p;
1311
+ return l;
1334
1312
  }
1335
- function gt(r, e, t, n, s, a) {
1313
+ function ct(r, e, t, n, s, a) {
1336
1314
  const i = w(e, r).methods.verifySignatures(a);
1337
1315
  return i._ixFn(...i._args, {
1338
- accounts: Le(e, t, s, n),
1316
+ accounts: Be(e, t, s, n),
1339
1317
  signers: void 0,
1340
1318
  remainingAccounts: void 0,
1341
1319
  preInstructions: void 0,
1342
1320
  postInstructions: void 0
1343
1321
  });
1344
1322
  }
1345
- function Le(r, e, t, n) {
1323
+ function Be(r, e, t, n) {
1346
1324
  return {
1347
- payer: new m(e),
1325
+ payer: new p(e),
1348
1326
  guardianSet: x(r, n.guardianSet),
1349
- signatureSet: new m(t),
1350
- instructions: ze,
1327
+ signatureSet: new p(t),
1328
+ instructions: ve,
1351
1329
  rent: U,
1352
1330
  systemProgram: M.programId
1353
1331
  };
1354
1332
  }
1355
- function dt(r, e) {
1356
- const { emitter: t, sequence: n } = H(r, e);
1333
+ function gt(r, e) {
1334
+ const { emitter: t, sequence: n } = J(r, e);
1357
1335
  return {
1358
1336
  wormholeBridge: S(e),
1359
1337
  wormholeEmitter: t,
@@ -1361,7 +1339,7 @@ function dt(r, e) {
1361
1339
  wormholeFeeCollector: C(e)
1362
1340
  };
1363
1341
  }
1364
- function ft(r, e, t, n) {
1342
+ function dt(r, e, t, n) {
1365
1343
  const s = Z(e, t, n, r);
1366
1344
  return {
1367
1345
  payer: s.payer,
@@ -1375,51 +1353,51 @@ function ft(r, e, t, n) {
1375
1353
  systemProgram: s.systemProgram
1376
1354
  };
1377
1355
  }
1378
- const mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1356
+ const ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1379
1357
  __proto__: null,
1380
1358
  BridgeConfig: D,
1381
- BridgeData: O,
1359
+ BridgeData: G,
1382
1360
  GuardianSetData: R,
1383
1361
  SequenceTracker: N,
1384
1362
  SignatureSetData: $,
1385
- coder: he,
1386
- createBridgeFeeTransferInstruction: pe,
1387
- createInitializeInstruction: ut,
1363
+ coder: ye,
1364
+ createBridgeFeeTransferInstruction: le,
1365
+ createInitializeInstruction: ot,
1388
1366
  createPostMessageInstruction: Ie,
1389
- createPostVaaInstruction: xe,
1367
+ createPostVaaInstruction: Ae,
1390
1368
  createReadOnlyWormholeProgramInterface: w,
1391
- createSetFeesInstruction: st,
1392
- createTransferFeesInstruction: at,
1393
- createUpgradeContractInstruction: ot,
1394
- createUpgradeGuardianSetInstruction: it,
1395
- createVerifySignaturesInstructions: Be,
1396
- createWormholeProgramInterface: ye,
1369
+ createSetFeesInstruction: rt,
1370
+ createTransferFeesInstruction: st,
1371
+ createUpgradeContractInstruction: it,
1372
+ createUpgradeGuardianSetInstruction: at,
1373
+ createVerifySignaturesInstructions: Ee,
1374
+ createWormholeProgramInterface: pe,
1397
1375
  deriveClaimKey: T,
1398
- deriveEmitterSequenceKey: G,
1376
+ deriveEmitterSequenceKey: O,
1399
1377
  deriveFeeCollectorKey: C,
1400
1378
  deriveGuardianSetKey: x,
1401
1379
  derivePostedVaaKey: E,
1402
- deriveUpgradeAuthorityKey: le,
1380
+ deriveUpgradeAuthorityKey: me,
1403
1381
  deriveWormholeBridgeDataKey: S,
1404
- deriveWormholeEmitterKey: W,
1405
- getClaim: je,
1406
- getEmitterKeys: H,
1407
- getGuardianSet: J,
1408
- getInitializeAccounts: Ae,
1382
+ deriveWormholeEmitterKey: H,
1383
+ getClaim: Ye,
1384
+ getEmitterKeys: J,
1385
+ getGuardianSet: W,
1386
+ getInitializeAccounts: be,
1409
1387
  getPostMessageAccounts: Z,
1410
- getPostMessageCpiAccounts: ft,
1411
- getPostVaaAccounts: Ee,
1412
- getProgramSequenceTracker: We,
1413
- getSequenceTracker: me,
1414
- getSetFeesAccounts: Se,
1415
- getSignatureSetData: Xe,
1416
- getTransferFeesAccounts: we,
1417
- getUpgradeContractAccounts: be,
1418
- getUpgradeGuardianSetAccounts: Me,
1419
- getVerifySignatureAccounts: Le,
1420
- getWormholeBridgeData: fe,
1421
- getWormholeDerivedAccounts: dt
1422
- }, Symbol.toStringTag, { value: "Module" })), ie = "Program log: Sequence: ";
1388
+ getPostMessageCpiAccounts: dt,
1389
+ getPostVaaAccounts: xe,
1390
+ getProgramSequenceTracker: je,
1391
+ getSequenceTracker: fe,
1392
+ getSetFeesAccounts: he,
1393
+ getSignatureSetData: We,
1394
+ getTransferFeesAccounts: Se,
1395
+ getUpgradeContractAccounts: Me,
1396
+ getUpgradeGuardianSetAccounts: we,
1397
+ getVerifySignatureAccounts: Be,
1398
+ getWormholeBridgeData: de,
1399
+ getWormholeDerivedAccounts: gt
1400
+ }, Symbol.toStringTag, { value: "Module" })), ae = "Program log: Sequence: ";
1423
1401
  class v {
1424
1402
  constructor(e, t, n, s) {
1425
1403
  u(this, "network");
@@ -1437,7 +1415,7 @@ class v {
1437
1415
  this.address = a, this.coreBridge = w(a, n);
1438
1416
  }
1439
1417
  async getGuardianSet(e) {
1440
- const t = await J(this.connection, this.coreBridge.programId, e);
1418
+ const t = await W(this.connection, this.coreBridge.programId, e);
1441
1419
  return {
1442
1420
  index: t.index,
1443
1421
  keys: t.keys.map((n) => n.toString("hex")),
@@ -1445,13 +1423,13 @@ class v {
1445
1423
  };
1446
1424
  }
1447
1425
  static async fromRpc(e, t) {
1448
- const [n, s] = await De.chainFromRpc(e), a = t[s];
1426
+ const [n, s] = await Ve.chainFromRpc(e), a = t[s];
1449
1427
  if (a.network !== n)
1450
1428
  throw new Error(`Network mismatch for chain ${s}: ${a.network} != ${n}`);
1451
1429
  return new v(n, s, e, t[s].contracts);
1452
1430
  }
1453
1431
  async ensureBridgeConfig() {
1454
- this.bridgeData || (this.bridgeData = await fe(this.connection, this.coreBridge.programId));
1432
+ this.bridgeData || (this.bridgeData = await de(this.connection, this.coreBridge.programId));
1455
1433
  }
1456
1434
  async getMessageFee() {
1457
1435
  return await this.ensureBridgeConfig(), this.bridgeData.config.fee;
@@ -1460,39 +1438,39 @@ class v {
1460
1438
  return await this.ensureBridgeConfig(), this.bridgeData.guardianSetIndex;
1461
1439
  }
1462
1440
  async *publishMessage(e, t, n, s) {
1463
- const a = re.generate(), i = new q(e).unwrap(), o = Ie(this.connection, this.coreBridge.programId, i, a.publicKey, t, n, s), c = await this.getMessageFee(), f = pe(this.coreBridge.programId, i, c), d = new j();
1464
- d.feePayer = i, d.add(f, o), yield this.createUnsignedTx({ transaction: d, signers: [a] }, "Core.PublishMessage");
1441
+ const a = re.generate(), i = new q(e).unwrap(), o = Ie(this.connection, this.coreBridge.programId, i, a.publicKey, t, n, s), c = await this.getMessageFee(), f = le(this.coreBridge.programId, i, c), g = new j();
1442
+ g.feePayer = i, g.add(f, o), yield this.createUnsignedTx({ transaction: g, signers: [a] }, "Core.PublishMessage");
1465
1443
  }
1466
1444
  async *verifyMessage(e, t) {
1467
1445
  yield* this.postVaa(e, t);
1468
1446
  }
1469
1447
  async *postVaa(e, t) {
1470
- const n = E(this.coreBridge.programId, g.Buffer.from(t.hash));
1448
+ const n = E(this.coreBridge.programId, d.Buffer.from(t.hash));
1471
1449
  if (await this.connection.getAccountInfo(n))
1472
1450
  return;
1473
- const a = new q(e).unwrap(), i = re.generate(), o = await Be(this.connection, this.coreBridge.programId, a, t, i.publicKey);
1451
+ const a = new q(e).unwrap(), i = re.generate(), o = await Ee(this.connection, this.coreBridge.programId, a, t, i.publicKey);
1474
1452
  for (let f = 0; f < o.length; f += 2) {
1475
- const d = new j().add(...o.slice(f, f + 2));
1476
- d.feePayer = a, yield this.createUnsignedTx({ transaction: d, signers: [i] }, "Core.VerifySignature", !0);
1453
+ const g = new j().add(...o.slice(f, f + 2));
1454
+ g.feePayer = a, yield this.createUnsignedTx({ transaction: g, signers: [i] }, "Core.VerifySignature", !0);
1477
1455
  }
1478
- const c = new j().add(xe(this.connection, this.coreBridge.programId, a, t, i.publicKey));
1456
+ const c = new j().add(Ae(this.connection, this.coreBridge.programId, a, t, i.publicKey));
1479
1457
  c.feePayer = a, yield this.createUnsignedTx({ transaction: c }, "Core.PostVAA");
1480
1458
  }
1481
1459
  static parseSequenceFromLog(e, t) {
1482
- var c, f, d, p;
1460
+ var c, f, g, l;
1483
1461
  const { meta: n, transaction: { message: s } } = t;
1484
1462
  if (!((c = n == null ? void 0 : n.innerInstructions) != null && c.length))
1485
1463
  return [];
1486
1464
  const a = s.staticAccountKeys;
1487
1465
  if (a.filter((y) => y.toString() === e).length === 0)
1488
1466
  return [];
1489
- const i = (p = (d = (f = n == null ? void 0 : n.logMessages) == null ? void 0 : f.filter((y) => y.startsWith(ie))) == null ? void 0 : d[0]) == null ? void 0 : p.replace(ie, "");
1467
+ const i = (l = (g = (f = n == null ? void 0 : n.logMessages) == null ? void 0 : f.filter((y) => y.startsWith(ae))) == null ? void 0 : g[0]) == null ? void 0 : l.replace(ae, "");
1490
1468
  if (!i)
1491
1469
  return [];
1492
1470
  const o = [];
1493
1471
  for (const y of n == null ? void 0 : n.innerInstructions) {
1494
1472
  const h = y.instructions;
1495
- o.push(...h.filter((A) => A.programIdIndex in a && a[A.programIdIndex].toString() === e));
1473
+ o.push(...h.filter((I) => I.programIdIndex in a && a[I.programIdIndex].toString() === e));
1496
1474
  }
1497
1475
  return o.length < 1 ? [] : a.length < 3 ? [] : o.map((y) => [new q(a[y.accounts[2]]).toUniversalAddress(), BigInt(i)]).filter((y) => y !== null);
1498
1476
  }
@@ -1522,7 +1500,7 @@ class v {
1522
1500
  var c;
1523
1501
  const { meta: n, transaction: { message: s } } = t, a = this.coreBridge.programId, i = (c = n.innerInstructions) == null ? void 0 : c.flatMap((f) => f.instructions.filter(
1524
1502
  // find the instructions where the programId equals the Wormhole ProgramId
1525
- (d) => a.toString() === e.get(d.programIdIndex).toString()
1503
+ (g) => a.toString() === e.get(g.programIdIndex).toString()
1526
1504
  )).map((f) => ({
1527
1505
  programIdIndex: f.programIdIndex,
1528
1506
  accountKeyIndexes: f.accounts
@@ -1533,10 +1511,10 @@ class v {
1533
1511
  const t = await this.connection.getAccountInfo(e);
1534
1512
  if (!(t != null && t.data))
1535
1513
  throw new Error("No data found in message account");
1536
- const { timestamp: n, emitterAddress: s, emitterChain: a, consistencyLevel: i, sequence: o, nonce: c, payload: f } = de(new Uint8Array(t == null ? void 0 : t.data));
1514
+ const { timestamp: n, emitterAddress: s, emitterChain: a, consistencyLevel: i, sequence: o, nonce: c, payload: f } = ge(new Uint8Array(t == null ? void 0 : t.data));
1537
1515
  return Ge("Uint8Array", {
1538
1516
  guardianSet: await this.getGuardianSetIndex(),
1539
- emitterChain: Ke(a),
1517
+ emitterChain: ze(a),
1540
1518
  timestamp: n,
1541
1519
  emitterAddress: s,
1542
1520
  consistencyLevel: i,
@@ -1595,39 +1573,35 @@ class v {
1595
1573
  return await Promise.all(a);
1596
1574
  }
1597
1575
  createUnsignedTx(e, t, n = !1) {
1598
- return new Oe(e, this.network, this.chain, t, n);
1576
+ return new De(e, this.network, this.chain, t, n);
1599
1577
  }
1600
1578
  }
1601
- Ne(qe, "WormholeCore", v);
1602
- const At = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1579
+ Oe(Ke, "WormholeCore", v);
1580
+ const Mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1603
1581
  __proto__: null,
1604
1582
  IDL: Q,
1605
1583
  SolanaWormholeCore: v,
1606
- deserializePostMessage: de,
1607
- postMessageLayout: ge,
1608
- utils: mt
1584
+ deserializePostMessage: ge,
1585
+ postMessageLayout: ce,
1586
+ utils: ft
1609
1587
  }, Symbol.toStringTag, { value: "Module" }));
1610
1588
  export {
1611
- ue as B,
1589
+ oe as B,
1612
1590
  v as S,
1613
1591
  C as a,
1614
- We as b,
1592
+ je as b,
1615
1593
  S as c,
1616
1594
  E as d,
1617
- W as e,
1618
- G as f,
1619
- dt as g,
1595
+ H as e,
1596
+ O as f,
1597
+ gt as g,
1620
1598
  T as h,
1621
- b as i,
1622
- z as j,
1623
- ce as k,
1624
- bt as l,
1625
- Z as m,
1626
- Mt as n,
1627
- Re as o,
1628
- le as p,
1629
- ft as q,
1630
- je as r,
1631
- pe as s,
1632
- At as t
1599
+ ue as i,
1600
+ Z as j,
1601
+ Ne as k,
1602
+ me as l,
1603
+ dt as m,
1604
+ Ye as n,
1605
+ le as o,
1606
+ Mt as p
1633
1607
  };