@wormhole-foundation/wormhole-connect 0.3.3-beta.1-development → 0.3.3-beta.3-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 (48) hide show
  1. package/dist/main.js +86 -86
  2. package/dist/src/config/mainnet/gasEstimates.d.ts.map +1 -1
  3. package/dist/src/config/mainnet/nttGroups.d.ts.map +1 -1
  4. package/dist/src/config/mainnet/tokens.d.ts.map +1 -1
  5. package/dist/src/routes/utils.d.ts.map +1 -1
  6. package/dist/src/views/Bridge/Bridge.d.ts.map +1 -1
  7. package/lib/{aptos-zqw8CE0g.js → aptos-Gl7Lvx33.js} +1 -1
  8. package/lib/{aptos-cjiLVgwc.mjs → aptos-wWY9cYKb.mjs} +1 -1
  9. package/lib/{ccip-3qscPCG4.mjs → ccip-U0O--jNe.mjs} +3 -3
  10. package/lib/{ccip-zP2Pn-k1.js → ccip-ZIQJfzGP.js} +1 -1
  11. package/lib/{cosmos-3CuMYWTB.js → cosmos-FDC9IzRr.js} +1 -1
  12. package/lib/{cosmos-LZbcmh28.mjs → cosmos-c0ODp2pR.mjs} +3 -3
  13. package/lib/{evm-Kp2uR9Fe.js → evm-HSpaYhQP.js} +3 -3
  14. package/lib/{evm-2aMPlWl0.mjs → evm-wgq2htQK.mjs} +4 -4
  15. package/lib/{index-soixhS2C.js → index-4Y1uNAAU.js} +3 -3
  16. package/lib/{index-zgwtG0wU.js → index-Mg5q9ZMw.js} +1 -1
  17. package/lib/{index-p4cvTk2e.js → index-Mk7LYYdN.js} +1 -1
  18. package/lib/{index-pbA6ePf7.mjs → index-MoMbeAKz.mjs} +1 -1
  19. package/lib/{index-9CzlFlmy.js → index-MvsxOCsW.js} +1 -1
  20. package/lib/{index-Hgi51M-G.mjs → index-TdxYLzGx.mjs} +3 -3
  21. package/lib/{index-dEADQOcf.js → index-iJmUtx_H.js} +1 -1
  22. package/lib/{index-HBwOgLYJ.mjs → index-oliZI3Bw.mjs} +82 -23
  23. package/lib/{index-WEpJeYUB.mjs → index-vsAk8D8-.mjs} +2 -2
  24. package/lib/{index-AzuDRjt4.mjs → index-zXvuSp6M.mjs} +1 -1
  25. package/lib/{index.es-P2W5Cy73.mjs → index.es-9kvKUYIv.mjs} +2 -2
  26. package/lib/{index.es-siSLzXPl.mjs → index.es-CueUNOIp.mjs} +1 -1
  27. package/lib/{index.es-jza9AjyO.js → index.es-MjAXWJbv.js} +2 -2
  28. package/lib/{index.es-j9OF4RCQ.js → index.es-NIfnGwYn.js} +1 -1
  29. package/lib/{index.es-FpKwGSlX.js → index.es-dKB91XRm.js} +1 -1
  30. package/lib/{index.es-NVLYuEEG.mjs → index.es-l5YUjdFo.mjs} +4 -4
  31. package/lib/index.js +1 -1
  32. package/lib/index.mjs +1 -1
  33. package/lib/{libsodium-wrappers-QUuw9ka0.js → libsodium-wrappers-9aCJqlW5.js} +1 -1
  34. package/lib/{libsodium-wrappers-RbcWfPuP.mjs → libsodium-wrappers-t-G4VebW.mjs} +1 -1
  35. package/lib/{sei-y7SngMRu.js → sei-LCVHAbJP.js} +1 -1
  36. package/lib/{sei-jqCqxgBA.mjs → sei-kAT23rRb.mjs} +2 -2
  37. package/lib/{solana-N7jROrW3.mjs → solana-9cEEFpYk.mjs} +3 -3
  38. package/lib/{solana-x57BQ6qu.js → solana-iA5G1mT6.js} +1 -1
  39. package/lib/{solanaEmbed.esm-ck9jvWiL.mjs → solanaEmbed.esm-83vVt6e1.mjs} +2 -2
  40. package/lib/{solanaEmbed.esm-hNvP2iQv.js → solanaEmbed.esm-IF6HXU18.js} +1 -1
  41. package/lib/src/config/mainnet/gasEstimates.d.ts.map +1 -1
  42. package/lib/src/config/mainnet/nttGroups.d.ts.map +1 -1
  43. package/lib/src/config/mainnet/tokens.d.ts.map +1 -1
  44. package/lib/src/routes/utils.d.ts.map +1 -1
  45. package/lib/src/views/Bridge/Bridge.d.ts.map +1 -1
  46. package/lib/{sui-F-C4vaHz.js → sui-2auVkRE6.js} +1 -1
  47. package/lib/{sui-DtGG5GWD.mjs → sui-MKTbT49-.mjs} +1 -1
  48. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"gasEstimates.d.ts","sourceRoot":"","sources":["../../../../src/config/mainnet/gasEstimates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAS,MAAM,UAAU,CAAC;AAE/C,eAAO,MAAM,qBAAqB,EAAE,YAgTnC,CAAC"}
1
+ {"version":3,"file":"gasEstimates.d.ts","sourceRoot":"","sources":["../../../../src/config/mainnet/gasEstimates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAS,MAAM,UAAU,CAAC;AAE/C,eAAO,MAAM,qBAAqB,EAAE,YA8TnC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"nttGroups.d.ts","sourceRoot":"","sources":["../../../../src/config/mainnet/nttGroups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,kBAAkB,EAAE,SAAc,CAAC"}
1
+ {"version":3,"file":"nttGroups.d.ts","sourceRoot":"","sources":["../../../../src/config/mainnet/nttGroups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,kBAAkB,EAAE,SA2BhC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../../src/config/mainnet/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,YAAY,EAAE,MAAM,UAAU,CAAC;AAE9C,eAAO,MAAM,cAAc,EAAE,YA8oF5B,CAAC"}
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../../src/config/mainnet/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,YAAY,EAAE,MAAM,UAAU,CAAC;AAE9C,eAAO,MAAM,cAAc,EAAE,YA6pF5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/routes/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EAEP,aAAa,IAAI,gBAAgB,EACjC,oBAAoB,IAAI,uBAAuB,EAChD,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,SAAS,EAAS,MAAM,QAAQ,CAAC;AAG1C,OAAO,EACL,aAAa,EACb,oBAAoB,EAGrB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIlD,eAAO,MAAM,kBAAkB,WACrB,gBAAgB,GAAG,uBAAuB,KACjD,QAAQ,aAAa,GAAG,oBAAoB,CA0C9C,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,SAAS,GAAG,OAAO,UAAU,SAAS,WAKzE,CAAC;AAEF,eAAO,MAAM,mBAAmB,4BACL,WAAW,aACzB,SAAS,GAAG,OAAO,KAC7B,OAyBF,CAAC;AAEF,eAAO,MAAM,UAAU,WAAY,KAAK,YAEvC,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/routes/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EAEP,aAAa,IAAI,gBAAgB,EACjC,oBAAoB,IAAI,uBAAuB,EAChD,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,SAAS,EAAS,MAAM,QAAQ,CAAC;AAG1C,OAAO,EACL,aAAa,EACb,oBAAoB,EAGrB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIlD,eAAO,MAAM,kBAAkB,WACrB,gBAAgB,GAAG,uBAAuB,KACjD,QAAQ,aAAa,GAAG,oBAAoB,CA0C9C,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,SAAS,GAAG,OAAO,UAAU,SAAS,WAKzE,CAAC;AAEF,eAAO,MAAM,mBAAmB,4BACL,WAAW,aACzB,SAAS,GAAG,OAAO,KAC7B,OAiCF,CAAC;AAEF,eAAO,MAAM,UAAU,WAAY,KAAK,YAEvC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Bridge.d.ts","sourceRoot":"","sources":["../../../../src/views/Bridge/Bridge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAwFzC,iBAAS,MAAM,sBAkPd;AAcD,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Bridge.d.ts","sourceRoot":"","sources":["../../../../src/views/Bridge/Bridge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAwFzC,iBAAS,MAAM,sBAwPd;AAcD,eAAe,MAAM,CAAC"}
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-soixhS2C.js"),ye=require("./wallets-dYYjlQ6_.js");require("react");require("react-dom");function pt(i){if(i.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<i.length;n++){var s=i.charAt(n),a=s.charCodeAt(0);if(t[a]!==255)throw new TypeError(s+" is ambiguous");t[a]=n}var g=i.length,u=i.charAt(0),o=Math.log(g)/Math.log(256),c=Math.log(256)/Math.log(g);function A(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var d=0,N=0,y=0,p=l.length;y!==p&&l[y]===0;)y++,d++;for(var D=(p-y)*c+1>>>0,T=new Uint8Array(D);y!==p;){for(var z=l[y],B=0,h=D-1;(z!==0||B<N)&&h!==-1;h--,B++)z+=256*T[h]>>>0,T[h]=z%g>>>0,z=z/g>>>0;if(z!==0)throw new Error("Non-zero carry");N=B,y++}for(var O=D-N;O!==D&&T[O]===0;)O++;for(var $=u.repeat(d);O<D;++O)$+=i.charAt(T[O]);return $}function j(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;for(var d=0,N=0,y=0;l[d]===u;)N++,d++;for(var p=(l.length-d)*o+1>>>0,D=new Uint8Array(p);l[d];){var T=t[l.charCodeAt(d)];if(T===255)return;for(var z=0,B=p-1;(T!==0||z<y)&&B!==-1;B--,z++)T+=g*D[B]>>>0,D[B]=T%256>>>0,T=T/256>>>0;if(T!==0)throw new Error("Non-zero carry");y=z,d++}for(var h=p-y;h!==p&&D[h]===0;)h++;for(var O=new Uint8Array(N+(p-h)),$=N;h!==p;)O[$++]=D[h++];return O}function I(l){var d=j(l);if(d)return d;throw new Error("Non-base"+g+" character")}return{encode:A,decodeUnsafe:j,decode:I}}var Tt=pt;const Dt=Tt,bt="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var St=Dt(bt);const Re=e.getDefaultExportFromCjs(St);function Lt(i){return i>64&&i<91?i-65:i>96&&i<123?i-71:i>47&&i<58?i+4:i===43?62:i===47?63:0}function re(i,t){for(var r=i.replace(/[^A-Za-z0-9+/]/g,""),n=r.length,s=t?Math.ceil((n*3+1>>2)/t)*t:n*3+1>>2,a=new Uint8Array(s),g,u,o=0,c=0,A=0;A<n;A++)if(u=A&3,o|=Lt(r.charCodeAt(A))<<6*(3-u),u===3||n-A===1){for(g=0;g<3&&c<s;g++,c++)a[c]=o>>>(16>>>g&24)&255;o=0}return a}function ee(i){return i<26?i+65:i<52?i+71:i<62?i-4:i===62?43:i===63?47:65}function q(i){for(var t=2,r="",n=i.length,s=0,a=0;a<n;a++)t=a%3,s|=i[a]<<(16>>>t&24),(t===2||i.length-a===1)&&(r+=String.fromCodePoint(ee(s>>>18&63),ee(s>>>12&63),ee(s>>>6&63),ee(s&63)),s=0);return r.slice(0,r.length-2+t)+(t===2?"":t===1?"=":"==")}function de(i){var s;const t=i.startsWith("0x")?i.slice(2):i,n=((s=(t.length%2===0?t:`0${t}}`).match(/.{2}/g))==null?void 0:s.map(a=>parseInt(a,16)))??[];return Uint8Array.from(n)}function Ne(i){return i.reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"")}var mt=32;function ne(i,t){let r=new Uint8Array(t),n=0;for(;i>0;)r[n]=Number(i%BigInt(256)),i=i/BigInt(256),n+=1;return r}var We=i=>Re.encode(i),Ve=i=>Re.decode(i),ht=class{constructor(i){this.bytePosition=0,this.dataView=new DataView(i.buffer)}shift(i){return this.bytePosition+=i,this}read8(){let i=this.dataView.getUint8(this.bytePosition);return this.shift(1),i}read16(){let i=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),i}read32(){let i=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),i}read64(){let i=this.read32(),r=this.read32().toString(16)+i.toString(16).padStart(8,"0");return BigInt("0x"+r).toString(10)}read128(){let i=BigInt(this.read64()),r=BigInt(this.read64()).toString(16)+i.toString(16).padStart(16,"0");return BigInt("0x"+r).toString(10)}read256(){let i=BigInt(this.read128()),r=BigInt(this.read128()).toString(16)+i.toString(16).padStart(32,"0");return BigInt("0x"+r).toString(10)}readBytes(i){let t=this.bytePosition+this.dataView.byteOffset,r=new Uint8Array(this.dataView.buffer,t,i);return this.shift(i),r}readULEB(){let i=this.bytePosition+this.dataView.byteOffset,t=new Uint8Array(this.dataView.buffer,i),{value:r,length:n}=Ct(t);return this.shift(n),r}readVec(i){let t=this.readULEB(),r=[];for(let n=0;n<t;n++)r.push(i(this,n,t));return r}},wt=class{constructor({size:i=1024,maxSize:t,allocateSize:r=1024}={}){this.bytePosition=0,this.size=i,this.maxSize=t||i,this.allocateSize=r,this.dataView=new DataView(new ArrayBuffer(i))}ensureSizeOrGrow(i){const t=this.bytePosition+i;if(t>this.size){const r=Math.min(this.maxSize,this.size+this.allocateSize);if(t>r)throw new Error(`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${t}`);this.size=r;const n=new ArrayBuffer(this.size);new Uint8Array(n).set(new Uint8Array(this.dataView.buffer)),this.dataView=new DataView(n)}}shift(i){return this.bytePosition+=i,this}write8(i){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(i)),this.shift(1)}write16(i){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(i),!0),this.shift(2)}write32(i){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(i),!0),this.shift(4)}write64(i){return ne(BigInt(i),8).forEach(t=>this.write8(t)),this}write128(i){return ne(BigInt(i),16).forEach(t=>this.write8(t)),this}write256(i){return ne(BigInt(i),32).forEach(t=>this.write8(t)),this}writeULEB(i){return Et(i).forEach(t=>this.write8(t)),this}writeVec(i,t){return this.writeULEB(i.length),Array.from(i).forEach((r,n)=>t(this,r,n,i.length)),this}*[Symbol.iterator](){for(let i=0;i<this.bytePosition;i++)yield this.dataView.getUint8(i);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(i){return zt(this.toBytes(),i)}};function Et(i){let t=[],r=0;if(i===0)return[0];for(;i>0;)t[r]=i&127,(i>>=7)&&(t[r]|=128),r+=1;return t}function Ct(i){let t=0,r=0,n=0;for(;;){let s=i[n];if(n+=1,t|=(s&127)<<r,!(s&128))break;r+=7}return{value:t,length:n}}var L=class X{constructor(t){if(this.types=new Map,this.counter=0,t instanceof X){this.schema=t.schema,this.types=new Map(t.types);return}if(this.schema=t,this.registerAddressType(X.ADDRESS,t.addressLength,t.addressEncoding),this.registerVectorType(t.vectorType),t.types&&t.types.structs)for(let r of Object.keys(t.types.structs))this.registerStructType(r,t.types.structs[r]);if(t.types&&t.types.enums)for(let r of Object.keys(t.types.enums))this.registerEnumType(r,t.types.enums[r]);if(t.types&&t.types.aliases)for(let r of Object.keys(t.types.aliases))this.registerAlias(r,t.types.aliases[r]);t.withPrimitives!==!1&&xt(this)}tempKey(){return`bcs-struct-${++this.counter}`}ser(t,r,n){if(typeof t=="string"||Array.isArray(t)){const{name:s,params:a}=this.parseTypeName(t);return this.getTypeInterface(s).encode(this,r,n,a)}if(typeof t=="object"){const s=this.tempKey();return new X(this).registerStructType(s,t).ser(s,r,n)}throw new Error(`Incorrect type passed into the '.ser()' function.
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-4Y1uNAAU.js"),ye=require("./wallets-dYYjlQ6_.js");require("react");require("react-dom");function pt(i){if(i.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<i.length;n++){var s=i.charAt(n),a=s.charCodeAt(0);if(t[a]!==255)throw new TypeError(s+" is ambiguous");t[a]=n}var g=i.length,u=i.charAt(0),o=Math.log(g)/Math.log(256),c=Math.log(256)/Math.log(g);function A(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var d=0,N=0,y=0,p=l.length;y!==p&&l[y]===0;)y++,d++;for(var D=(p-y)*c+1>>>0,T=new Uint8Array(D);y!==p;){for(var z=l[y],B=0,h=D-1;(z!==0||B<N)&&h!==-1;h--,B++)z+=256*T[h]>>>0,T[h]=z%g>>>0,z=z/g>>>0;if(z!==0)throw new Error("Non-zero carry");N=B,y++}for(var O=D-N;O!==D&&T[O]===0;)O++;for(var $=u.repeat(d);O<D;++O)$+=i.charAt(T[O]);return $}function j(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;for(var d=0,N=0,y=0;l[d]===u;)N++,d++;for(var p=(l.length-d)*o+1>>>0,D=new Uint8Array(p);l[d];){var T=t[l.charCodeAt(d)];if(T===255)return;for(var z=0,B=p-1;(T!==0||z<y)&&B!==-1;B--,z++)T+=g*D[B]>>>0,D[B]=T%256>>>0,T=T/256>>>0;if(T!==0)throw new Error("Non-zero carry");y=z,d++}for(var h=p-y;h!==p&&D[h]===0;)h++;for(var O=new Uint8Array(N+(p-h)),$=N;h!==p;)O[$++]=D[h++];return O}function I(l){var d=j(l);if(d)return d;throw new Error("Non-base"+g+" character")}return{encode:A,decodeUnsafe:j,decode:I}}var Tt=pt;const Dt=Tt,bt="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var St=Dt(bt);const Re=e.getDefaultExportFromCjs(St);function Lt(i){return i>64&&i<91?i-65:i>96&&i<123?i-71:i>47&&i<58?i+4:i===43?62:i===47?63:0}function re(i,t){for(var r=i.replace(/[^A-Za-z0-9+/]/g,""),n=r.length,s=t?Math.ceil((n*3+1>>2)/t)*t:n*3+1>>2,a=new Uint8Array(s),g,u,o=0,c=0,A=0;A<n;A++)if(u=A&3,o|=Lt(r.charCodeAt(A))<<6*(3-u),u===3||n-A===1){for(g=0;g<3&&c<s;g++,c++)a[c]=o>>>(16>>>g&24)&255;o=0}return a}function ee(i){return i<26?i+65:i<52?i+71:i<62?i-4:i===62?43:i===63?47:65}function q(i){for(var t=2,r="",n=i.length,s=0,a=0;a<n;a++)t=a%3,s|=i[a]<<(16>>>t&24),(t===2||i.length-a===1)&&(r+=String.fromCodePoint(ee(s>>>18&63),ee(s>>>12&63),ee(s>>>6&63),ee(s&63)),s=0);return r.slice(0,r.length-2+t)+(t===2?"":t===1?"=":"==")}function de(i){var s;const t=i.startsWith("0x")?i.slice(2):i,n=((s=(t.length%2===0?t:`0${t}}`).match(/.{2}/g))==null?void 0:s.map(a=>parseInt(a,16)))??[];return Uint8Array.from(n)}function Ne(i){return i.reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"")}var mt=32;function ne(i,t){let r=new Uint8Array(t),n=0;for(;i>0;)r[n]=Number(i%BigInt(256)),i=i/BigInt(256),n+=1;return r}var We=i=>Re.encode(i),Ve=i=>Re.decode(i),ht=class{constructor(i){this.bytePosition=0,this.dataView=new DataView(i.buffer)}shift(i){return this.bytePosition+=i,this}read8(){let i=this.dataView.getUint8(this.bytePosition);return this.shift(1),i}read16(){let i=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),i}read32(){let i=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),i}read64(){let i=this.read32(),r=this.read32().toString(16)+i.toString(16).padStart(8,"0");return BigInt("0x"+r).toString(10)}read128(){let i=BigInt(this.read64()),r=BigInt(this.read64()).toString(16)+i.toString(16).padStart(16,"0");return BigInt("0x"+r).toString(10)}read256(){let i=BigInt(this.read128()),r=BigInt(this.read128()).toString(16)+i.toString(16).padStart(32,"0");return BigInt("0x"+r).toString(10)}readBytes(i){let t=this.bytePosition+this.dataView.byteOffset,r=new Uint8Array(this.dataView.buffer,t,i);return this.shift(i),r}readULEB(){let i=this.bytePosition+this.dataView.byteOffset,t=new Uint8Array(this.dataView.buffer,i),{value:r,length:n}=Ct(t);return this.shift(n),r}readVec(i){let t=this.readULEB(),r=[];for(let n=0;n<t;n++)r.push(i(this,n,t));return r}},wt=class{constructor({size:i=1024,maxSize:t,allocateSize:r=1024}={}){this.bytePosition=0,this.size=i,this.maxSize=t||i,this.allocateSize=r,this.dataView=new DataView(new ArrayBuffer(i))}ensureSizeOrGrow(i){const t=this.bytePosition+i;if(t>this.size){const r=Math.min(this.maxSize,this.size+this.allocateSize);if(t>r)throw new Error(`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${t}`);this.size=r;const n=new ArrayBuffer(this.size);new Uint8Array(n).set(new Uint8Array(this.dataView.buffer)),this.dataView=new DataView(n)}}shift(i){return this.bytePosition+=i,this}write8(i){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(i)),this.shift(1)}write16(i){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(i),!0),this.shift(2)}write32(i){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(i),!0),this.shift(4)}write64(i){return ne(BigInt(i),8).forEach(t=>this.write8(t)),this}write128(i){return ne(BigInt(i),16).forEach(t=>this.write8(t)),this}write256(i){return ne(BigInt(i),32).forEach(t=>this.write8(t)),this}writeULEB(i){return Et(i).forEach(t=>this.write8(t)),this}writeVec(i,t){return this.writeULEB(i.length),Array.from(i).forEach((r,n)=>t(this,r,n,i.length)),this}*[Symbol.iterator](){for(let i=0;i<this.bytePosition;i++)yield this.dataView.getUint8(i);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(i){return zt(this.toBytes(),i)}};function Et(i){let t=[],r=0;if(i===0)return[0];for(;i>0;)t[r]=i&127,(i>>=7)&&(t[r]|=128),r+=1;return t}function Ct(i){let t=0,r=0,n=0;for(;;){let s=i[n];if(n+=1,t|=(s&127)<<r,!(s&128))break;r+=7}return{value:t,length:n}}var L=class X{constructor(t){if(this.types=new Map,this.counter=0,t instanceof X){this.schema=t.schema,this.types=new Map(t.types);return}if(this.schema=t,this.registerAddressType(X.ADDRESS,t.addressLength,t.addressEncoding),this.registerVectorType(t.vectorType),t.types&&t.types.structs)for(let r of Object.keys(t.types.structs))this.registerStructType(r,t.types.structs[r]);if(t.types&&t.types.enums)for(let r of Object.keys(t.types.enums))this.registerEnumType(r,t.types.enums[r]);if(t.types&&t.types.aliases)for(let r of Object.keys(t.types.aliases))this.registerAlias(r,t.types.aliases[r]);t.withPrimitives!==!1&&xt(this)}tempKey(){return`bcs-struct-${++this.counter}`}ser(t,r,n){if(typeof t=="string"||Array.isArray(t)){const{name:s,params:a}=this.parseTypeName(t);return this.getTypeInterface(s).encode(this,r,n,a)}if(typeof t=="object"){const s=this.tempKey();return new X(this).registerStructType(s,t).ser(s,r,n)}throw new Error(`Incorrect type passed into the '.ser()' function.
2
2
  ${JSON.stringify(t)}`)}de(t,r,n){if(typeof r=="string")if(n)r=ft(r,n);else throw new Error("To pass a string to `bcs.de`, specify encoding");if(typeof t=="string"||Array.isArray(t)){const{name:s,params:a}=this.parseTypeName(t);return this.getTypeInterface(s).decode(this,r,a)}if(typeof t=="object"){const s=new X(this),a=this.tempKey();return s.registerStructType(a,t).de(a,r,n)}throw new Error(`Incorrect type passed into the '.de()' function.
3
3
  ${JSON.stringify(t)}`)}hasType(t){return this.types.has(t)}registerAlias(t,r){return this.types.set(t,r),this}registerType(t,r,n,s=()=>!0){const{name:a,params:g}=this.parseTypeName(t);return this.types.set(a,{encode(u,o,c,A){const j=g.reduce((I,l,d)=>Object.assign(I,{[l]:A[d]}),{});return this._encodeRaw.call(u,new wt(c),o,A,j)},decode(u,o,c){const A=g.reduce((j,I,l)=>Object.assign(j,{[I]:c[l]}),{});return this._decodeRaw.call(u,new ht(o),c,A)},_encodeRaw(u,o,c,A){if(s(o))return r.call(this,u,o,c,A);throw new Error(`Validation failed for type ${a}, data: ${o}`)},_decodeRaw(u,o,c){return n.call(this,u,o,c)}}),this}registerAddressType(t,r,n="hex"){switch(n){case"base64":return this.registerType(t,function(a,g){return re(g).reduce((u,o)=>u.write8(o),a)},function(a){return q(a.readBytes(r))});case"hex":return this.registerType(t,function(a,g){return de(g).reduce((u,o)=>u.write8(o),a)},function(a){return Ne(a.readBytes(r))});default:throw new Error("Unsupported encoding! Use either hex or base64")}}registerVectorType(t){let{name:r,params:n}=this.parseTypeName(t);if(n.length>1)throw new Error("Vector can have only one type parameter; got "+r);return this.registerType(t,function(a,g,u,o){return a.writeVec(g,(c,A)=>{let j=u[0];if(!j)throw new Error(`Incorrect number of type parameters passed a to vector '${t}'`);let{name:I,params:l}=this.parseTypeName(j);if(this.hasType(I))return this.getTypeInterface(I)._encodeRaw.call(this,c,A,l,o);if(!(I in o))throw new Error(`Unable to find a matching type definition for ${I} in vector; make sure you passed a generic`);let{name:d,params:N}=this.parseTypeName(o[I]);return this.getTypeInterface(d)._encodeRaw.call(this,c,A,N,o)})},function(a,g,u){return a.readVec(o=>{let c=g[0];if(!c)throw new Error(`Incorrect number of type parameters passed to a vector '${t}'`);let{name:A,params:j}=this.parseTypeName(c);if(this.hasType(A))return this.getTypeInterface(A)._decodeRaw.call(this,o,j,u);if(!(A in u))throw new Error(`Unable to find a matching type definition for ${A} in vector; make sure you passed a generic`);let{name:I,params:l}=this.parseTypeName(u[A]);return this.getTypeInterface(I)._decodeRaw.call(this,o,l,u)})})}registerStructType(t,r){for(let u in r){let o=this.tempKey(),c=r[u];!Array.isArray(c)&&typeof c!="string"&&(r[u]=o,this.registerStructType(o,c))}let n=Object.freeze(r),s=Object.keys(n),{name:a,params:g}=this.parseTypeName(t);return this.registerType(t,function(o,c,A,j){if(!c||c.constructor!==Object)throw new Error(`Expected ${a} to be an Object, got: ${c}`);if(A.length!==g.length)throw new Error(`Incorrect number of generic parameters passed; expected: ${g.length}, got: ${A.length}`);for(let I of s){if(!(I in c))throw new Error(`Struct ${a} requires field ${I}:${n[I]}`);const{name:l,params:d}=this.parseTypeName(n[I]);if(!g.includes(l))this.getTypeInterface(l)._encodeRaw.call(this,o,c[I],d,j);else{const N=g.indexOf(l);let{name:y,params:p}=this.parseTypeName(A[N]);if(this.hasType(y)){this.getTypeInterface(y)._encodeRaw.call(this,o,c[I],p,j);continue}if(!(y in j))throw new Error(`Unable to find a matching type definition for ${y} in ${a}; make sure you passed a generic`);let{name:D,params:T}=this.parseTypeName(j[y]);this.getTypeInterface(D)._encodeRaw.call(this,o,c[I],T,j)}}return o},function(o,c,A){if(c.length!==g.length)throw new Error(`Incorrect number of generic parameters passed; expected: ${g.length}, got: ${c.length}`);let j={};for(let I of s){const{name:l,params:d}=this.parseTypeName(n[I]);if(!g.includes(l))j[I]=this.getTypeInterface(l)._decodeRaw.call(this,o,d,A);else{const N=g.indexOf(l);let{name:y,params:p}=this.parseTypeName(c[N]);if(this.hasType(y)){j[I]=this.getTypeInterface(y)._decodeRaw.call(this,o,p,A);continue}if(!(y in A))throw new Error(`Unable to find a matching type definition for ${y} in ${a}; make sure you passed a generic`);let{name:D,params:T}=this.parseTypeName(A[y]);j[I]=this.getTypeInterface(D)._decodeRaw.call(this,o,T,A)}}return j})}registerEnumType(t,r){for(let u in r){let o=this.tempKey(),c=r[u];c!==null&&!Array.isArray(c)&&typeof c!="string"&&(r[u]=o,this.registerStructType(o,c))}let n=Object.freeze(r),s=Object.keys(n),{name:a,params:g}=this.parseTypeName(t);return this.registerType(t,function(o,c,A,j){if(!c)throw new Error(`Unable to write enum "${a}", missing data.
4
4
  Received: "${c}"`);if(typeof c!="object")throw new Error(`Incorrect data passed into enum "${a}", expected object with properties: "${s.join(" | ")}".
@@ -1,4 +1,4 @@
1
- import { g as Ut, ag as t, ah as S, ai as n, aj as j, ak as A, al as ue, am as v, an as p, ao as d, ap as a, aq as J, ar as Me, as as at, at as c, au as x, av as le, aw as H, W as Gt, c as Fe, ax as Qt, ay as Je, N as Yt, B as Ne } from "./index-HBwOgLYJ.mjs";
1
+ import { g as Ut, ag as t, ah as S, ai as n, aj as j, ak as A, al as ue, am as v, an as p, ao as d, ap as a, aq as J, ar as Me, as as at, at as c, au as x, av as le, aw as H, W as Gt, c as Fe, ax as Qt, ay as Je, N as Yt, B as Ne } from "./index-oliZI3Bw.mjs";
2
2
  import { g as ot, R as Zt } from "./wallets-XPPz8jCP.mjs";
3
3
  import "react";
4
4
  import "react-dom";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wormhole-foundation/wormhole-connect",
3
- "version": "0.3.3-beta.1-development",
3
+ "version": "0.3.3-beta.3-development",
4
4
  "repository": "github:wormhole-foundation/wormhole-connect",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.mjs",