@gardenfi/swap 0.0.2-beta.2 → 0.0.2-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +4 -4
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +3 -3
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +3 -3
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +1 -1
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +1 -1
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +12 -12
- package/dist/index120.cjs +1 -1
- package/dist/index120.js +2 -2
- package/dist/index121.cjs +1 -1
- package/dist/index121.js +7 -7
- package/dist/index132.cjs +1 -1
- package/dist/index132.js +1 -1
- package/dist/index133.cjs +1 -1
- package/dist/index133.js +1 -1
- package/dist/index134.cjs +1 -1
- package/dist/index134.js +1 -1
- package/dist/index135.cjs +1 -1
- package/dist/index135.js +1 -1
- package/dist/index138.cjs +1 -1
- package/dist/index138.js +2 -2
- package/dist/index161.cjs +1 -1
- package/dist/index161.js +2 -2
- package/dist/index167.cjs +1 -1
- package/dist/index167.js +1 -1
- package/dist/index168.cjs +1 -1
- package/dist/index168.js +2 -2
- package/dist/index169.cjs +1 -1
- package/dist/index169.js +2 -2
- package/dist/index170.cjs +1 -1
- package/dist/index170.js +2 -2
- package/dist/index171.cjs +1 -1
- package/dist/index171.js +2 -2
- package/dist/index172.cjs +1 -1
- package/dist/index172.js +2 -2
- package/dist/index272.cjs +1 -1
- package/dist/index272.js +9 -174
- package/dist/index273.cjs +1 -2
- package/dist/index273.js +30 -91
- package/dist/index274.cjs +1 -1
- package/dist/index274.js +2 -41
- package/dist/index275.cjs +1 -1
- package/dist/index275.js +47 -4
- package/dist/index276.cjs +1 -1
- package/dist/index276.js +11 -9
- package/dist/index277.cjs +1 -1
- package/dist/index277.js +174 -30
- package/dist/index278.cjs +2 -1
- package/dist/index278.js +92 -2
- package/dist/index279.cjs +1 -1
- package/dist/index279.js +38 -45
- package/dist/index280.cjs +1 -1
- package/dist/index280.js +4 -11
- package/dist/index281.cjs +1 -1
- package/dist/index281.js +3 -3
- package/dist/index283.cjs +1 -2
- package/dist/index283.js +42 -41
- package/dist/index284.cjs +1 -1
- package/dist/index284.js +321 -2
- package/dist/index285.cjs +1 -1
- package/dist/index285.js +605 -5
- package/dist/index286.cjs +1 -1
- package/dist/index286.js +109 -10
- package/dist/index287.cjs +1 -1
- package/dist/index287.js +167 -19
- package/dist/index288.cjs +1 -1
- package/dist/index288.js +301 -8
- package/dist/index289.cjs +1 -1
- package/dist/index289.js +93 -72
- package/dist/index290.cjs +1 -1
- package/dist/index290.js +54 -63
- package/dist/index291.cjs +1 -1
- package/dist/index291.js +51 -186
- package/dist/index292.cjs +1 -1
- package/dist/index292.js +42 -20
- package/dist/index293.cjs +1 -1
- package/dist/index293.js +14 -41
- package/dist/index294.cjs +1 -1
- package/dist/index294.js +315 -23
- package/dist/index295.cjs +1 -1
- package/dist/index295.js +57 -88
- package/dist/index296.cjs +1 -1
- package/dist/index296.js +19 -40
- package/dist/index297.cjs +1 -1
- package/dist/index297.js +28 -15
- package/dist/index298.cjs +1 -1
- package/dist/index298.js +3 -13
- package/dist/index299.cjs +7 -1
- package/dist/index299.js +237 -7
- package/dist/index300.cjs +1 -1
- package/dist/index300.js +48 -38
- package/dist/index301.cjs +1 -1
- package/dist/index301.js +211 -14
- package/dist/index302.cjs +1 -1
- package/dist/index302.js +77 -38
- package/dist/index303.cjs +1 -1
- package/dist/index303.js +25 -316
- package/dist/index304.cjs +1 -1
- package/dist/index304.js +73 -602
- package/dist/index305.cjs +2 -1
- package/dist/index305.js +41 -109
- package/dist/index306.cjs +1 -1
- package/dist/index306.js +2 -168
- package/dist/index307.cjs +1 -1
- package/dist/index307.js +5 -301
- package/dist/index308.cjs +1 -1
- package/dist/index308.js +10 -93
- package/dist/index309.cjs +1 -1
- package/dist/index309.js +18 -55
- package/dist/index310.cjs +1 -1
- package/dist/index310.js +8 -53
- package/dist/index311.cjs +1 -1
- package/dist/index311.js +72 -44
- package/dist/index312.cjs +1 -1
- package/dist/index312.js +64 -14
- package/dist/index313.cjs +1 -1
- package/dist/index313.js +184 -313
- package/dist/index314.cjs +1 -1
- package/dist/index314.js +19 -56
- package/dist/index315.cjs +1 -1
- package/dist/index315.js +42 -19
- package/dist/index316.cjs +1 -1
- package/dist/index316.js +23 -27
- package/dist/index317.cjs +1 -1
- package/dist/index317.js +90 -3
- package/dist/index318.cjs +1 -7
- package/dist/index318.js +33 -230
- package/dist/index319.cjs +1 -1
- package/dist/index319.js +17 -48
- package/dist/index320.cjs +1 -1
- package/dist/index320.js +11 -210
- package/dist/index321.cjs +1 -1
- package/dist/index321.js +7 -81
- package/dist/index322.cjs +1 -1
- package/dist/index322.js +36 -28
- package/dist/index323.cjs +1 -1
- package/dist/index323.js +15 -76
- package/dist/index326.cjs +1 -1
- package/dist/index326.js +1 -1
- package/dist/index327.cjs +1 -1
- package/dist/index327.js +1 -1
- package/dist/index333.cjs +1 -1
- package/dist/index333.js +2 -2
- package/dist/index334.cjs +1 -1
- package/dist/index334.js +2 -2
- package/dist/index340.cjs +1 -1
- package/dist/index340.js +1 -1
- package/dist/index341.cjs +1 -1
- package/dist/index341.js +1 -1
- package/dist/index343.cjs +1 -1
- package/dist/index343.js +1 -1
- package/dist/index346.cjs +1 -1
- package/dist/index346.js +1 -1
- package/dist/index347.cjs +1 -1
- package/dist/index347.js +1 -1
- package/dist/index348.cjs +1 -1
- package/dist/index348.js +3 -3
- package/dist/index349.cjs +1 -2
- package/dist/index349.js +4 -193
- package/dist/index350.cjs +2 -1
- package/dist/index350.js +168 -52
- package/dist/index351.cjs +1 -1
- package/dist/index351.js +65 -331
- package/dist/index352.cjs +1 -1
- package/dist/index352.js +332 -149
- package/dist/index353.cjs +1 -1
- package/dist/index353.js +161 -5
- package/dist/index354.cjs +1 -1
- package/dist/index354.js +5 -5
- package/dist/index357.cjs +1 -1
- package/dist/index357.js +8 -205
- package/dist/index359.cjs +1 -1
- package/dist/index359.js +205 -8
- package/dist/index360.cjs +1 -1
- package/dist/index360.js +94 -68
- package/dist/index361.cjs +1 -1
- package/dist/index361.js +28 -94
- package/dist/index362.cjs +1 -1
- package/dist/index362.js +147 -27
- package/dist/index363.cjs +1 -1
- package/dist/index363.js +324 -118
- package/dist/index364.cjs +1 -1
- package/dist/index364.js +72 -353
- package/dist/index365.cjs +1 -1
- package/dist/index365.js +29 -71
- package/dist/index366.cjs +1 -1
- package/dist/index366.js +5 -31
- package/dist/index367.cjs +1 -1
- package/dist/index367.js +275 -5
- package/dist/index368.cjs +1 -1
- package/dist/index368.js +171 -4
- package/dist/index369.cjs +1 -1
- package/dist/index369.js +10 -141
- package/dist/index370.cjs +1 -1
- package/dist/index370.js +105 -273
- package/dist/index371.cjs +1 -1
- package/dist/index371.js +10 -171
- package/dist/index372.cjs +1 -1
- package/dist/index372.js +69 -10
- package/dist/index373.cjs +1 -1
- package/dist/index373.js +3 -107
- package/dist/index374.cjs +1 -1
- package/dist/index374.js +140 -9
- package/dist/index375.cjs +1 -1
- package/dist/index375.js +4 -4
- package/dist/index376.cjs +1 -1
- package/dist/index376.js +2 -79
- package/dist/index377.cjs +1 -1
- package/dist/index377.js +79 -2
- package/dist/index379.cjs +1 -1
- package/dist/index379.js +1 -1
- package/dist/index380.cjs +1 -1
- package/dist/index380.js +1 -1
- package/dist/index381.cjs +1 -1
- package/dist/index381.js +2 -22
- package/dist/index382.cjs +1 -1
- package/dist/index382.js +22 -2
- package/dist/index385.cjs +1 -1
- package/dist/index385.js +2 -2
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +13 -13
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +1 -1
- package/dist/src/lib/store/swapStore.d.ts +1 -1
- package/package.json +5 -5
package/dist/index346.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("./index340.cjs"),a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("./index340.cjs"),a=require("./index359.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const d=BigInt(0),f=BigInt(1),h=BigInt(2),K=BigInt(3),I=BigInt(4),L=BigInt(5),T=BigInt(8);function g(t,n){const o=t%n;return o>=d?o:n+o}function Q(t,n,o){let r=t;for(;n-- >d;)r*=r,r%=o;return r}function B(t,n){if(t===d)throw new Error("invert: expected non-zero number");if(n<=d)throw new Error("invert: expected positive modulus, got "+n);let o=g(t,n),r=n,s=d,l=f;for(;o!==d;){const c=r/o,e=r%o,i=s-l*c;r=o,o=e,s=l,l=i}if(r!==f)throw new Error("invert: does not exist");return g(s,n)}function x(t,n){const o=(t.ORDER+f)/I,r=t.pow(n,o);if(!t.eql(t.sqr(r),n))throw new Error("Cannot find square root");return r}function V(t,n){const o=(t.ORDER-L)/T,r=t.mul(n,h),s=t.pow(r,o),l=t.mul(n,s),u=t.mul(t.mul(l,h),s),c=t.mul(l,t.sub(u,t.ONE));if(!t.eql(t.sqr(c),n))throw new Error("Cannot find square root");return c}function _(t){if(t<BigInt(3))throw new Error("sqrt is not defined for small field");let n=t-f,o=0;for(;n%h===d;)n/=h,o++;let r=h;const s=Z(t);for(;y(s,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(o===1)return x;let l=s.pow(r,n);const u=(n+f)/h;return function(e,i){if(e.is0(i))return i;if(y(e,i)!==1)throw new Error("Cannot find square root");let w=o,v=e.mul(e.ONE,l),b=e.pow(i,n),E=e.pow(i,u);for(;!e.eql(b,e.ONE);){if(e.is0(b))return e.ZERO;let q=1,m=e.sqr(b);for(;!e.eql(m,e.ONE);)if(q++,m=e.sqr(m),q===w)throw new Error("Cannot find square root");const z=f<<BigInt(w-q-1),S=e.pow(v,z);w=q,v=e.sqr(S),b=e.mul(b,v),E=e.mul(E,S)}return E}}function M(t){return t%I===K?x:t%T===L?V:_(t)}const Y=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function k(t){const n={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},o=Y.reduce((r,s)=>(r[s]="function",r),n);return a.validateObject(t,o)}function O(t,n,o){if(o<d)throw new Error("invalid exponent, negatives unsupported");if(o===d)return t.ONE;if(o===f)return n;let r=t.ONE,s=n;for(;o>d;)o&f&&(r=t.mul(r,s)),s=t.sqr(s),o>>=f;return r}function A(t,n,o=!1){const r=new Array(n.length).fill(o?t.ZERO:void 0),s=n.reduce((u,c,e)=>t.is0(c)?u:(r[e]=u,t.mul(u,c)),t.ONE),l=t.inv(s);return n.reduceRight((u,c,e)=>t.is0(c)?u:(r[e]=t.mul(u,r[e]),t.mul(u,c)),l),r}function y(t,n){const o=(t.ORDER-f)/h,r=t.pow(n,o),s=t.eql(r,t.ONE),l=t.eql(r,t.ZERO),u=t.eql(r,t.neg(t.ONE));if(!s&&!l&&!u)throw new Error("invalid Legendre symbol result");return s?1:l?0:-1}function C(t,n){n!==void 0&&H.anumber(n);const o=n!==void 0?n:t.toString(2).length,r=Math.ceil(o/8);return{nBitLength:o,nByteLength:r}}function Z(t,n,o=!1,r={}){if(t<=d)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:s,nByteLength:l}=C(t,n);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u;const c=Object.freeze({ORDER:t,isLE:o,BITS:s,BYTES:l,MASK:a.bitMask(s),ZERO:d,ONE:f,create:e=>g(e,t),isValid:e=>{if(typeof e!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof e);return d<=e&&e<t},is0:e=>e===d,isOdd:e=>(e&f)===f,neg:e=>g(-e,t),eql:(e,i)=>e===i,sqr:e=>g(e*e,t),add:(e,i)=>g(e+i,t),sub:(e,i)=>g(e-i,t),mul:(e,i)=>g(e*i,t),pow:(e,i)=>O(c,e,i),div:(e,i)=>g(e*B(i,t),t),sqrN:e=>e*e,addN:(e,i)=>e+i,subN:(e,i)=>e-i,mulN:(e,i)=>e*i,inv:e=>B(e,t),sqrt:r.sqrt||(e=>(u||(u=M(t)),u(c,e))),toBytes:e=>o?a.numberToBytesLE(e,l):a.numberToBytesBE(e,l),fromBytes:e=>{if(e.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+e.length);return o?a.bytesToNumberLE(e):a.bytesToNumberBE(e)},invertBatch:e=>A(c,e),cmov:(e,i,w)=>w?i:e});return Object.freeze(c)}function N(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const n=t.toString(2).length;return Math.ceil(n/8)}function j(t){const n=N(t);return n+Math.ceil(n/2)}function P(t,n,o=!1){const r=t.length,s=N(n),l=j(n);if(r<16||r<l||r>1024)throw new Error("expected "+l+"-1024 bytes of input, got "+r);const u=o?a.bytesToNumberLE(t):a.bytesToNumberBE(t),c=g(u,n-f)+f;return o?a.numberToBytesLE(c,s):a.numberToBytesBE(c,s)}exports.Field=Z;exports.FpInvertBatch=A;exports.FpLegendre=y;exports.FpPow=O;exports.FpSqrt=M;exports.getFieldBytesLength=N;exports.getMinHashLength=j;exports.invert=B;exports.mapHashToField=P;exports.mod=g;exports.nLength=C;exports.pow2=Q;exports.tonelliShanks=_;exports.validateField=k;
|
package/dist/index346.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { anumber as C } from "./index340.js";
|
|
2
|
-
import { numberToBytesLE as I, numberToBytesBE as y, bitMask as Z, bytesToNumberLE as S, bytesToNumberBE as x, validateObject as z } from "./
|
|
2
|
+
import { numberToBytesLE as I, numberToBytesBE as y, bitMask as Z, bytesToNumberLE as S, bytesToNumberBE as x, validateObject as z } from "./index359.js";
|
|
3
3
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
4
4
|
const d = BigInt(0), f = BigInt(1), g = /* @__PURE__ */ BigInt(2), j = /* @__PURE__ */ BigInt(3), L = /* @__PURE__ */ BigInt(4), _ = /* @__PURE__ */ BigInt(5), T = /* @__PURE__ */ BigInt(8);
|
|
5
5
|
function w(t, n) {
|
package/dist/index347.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index247.cjs"),o=require("./index348.cjs"),n=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index247.cjs"),o=require("./index348.cjs"),n=require("./index277.cjs");function i(e,r={}){const{as:s=typeof e=="string"?"Hex":"Bytes"}=r,t=c.keccak_256(o.from(e));return s==="Bytes"?t:n.fromBytes(t)}exports.keccak256=i;
|
package/dist/index347.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { keccak_256 as f } from "./index247.js";
|
|
2
2
|
import { from as m } from "./index348.js";
|
|
3
|
-
import { fromBytes as s } from "./
|
|
3
|
+
import { fromBytes as s } from "./index277.js";
|
|
4
4
|
function p(t, o = {}) {
|
|
5
5
|
const { as: e = typeof t == "string" ? "Hex" : "Bytes" } = o, r = f(m(t));
|
|
6
6
|
return e === "Bytes" ? r : s(r);
|
package/dist/index348.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index278.cjs"),s=require("./index277.cjs"),o=require("./index358.cjs"),S=require("./index279.cjs"),x=new TextDecoder,E=new TextEncoder;function p(e){return e instanceof Uint8Array?e:typeof e=="string"?b(e):g(e)}function g(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function b(e,t={}){const{size:n}=t;let r=e;n&&(S.assertSize(e,n),r=s.padRight(e,n));let i=r.slice(2);i.length%2&&(i=`0${i}`);const u=i.length/2,d=new Uint8Array(u);for(let f=0,c=0;f<u;f++){const l=o.charCodeToBase16(i.charCodeAt(c++)),y=o.charCodeToBase16(i.charCodeAt(c++));if(l===void 0||y===void 0)throw new a.BaseError(`Invalid byte sequence ("${i[c-2]}${i[c-1]}" in "${i}").`);d[f]=l<<4|y}return d}function w(e,t={}){const{size:n}=t,r=E.encode(e);return typeof n=="number"?(o.assertSize(r,n),h(r,n)):r}function h(e,t){return o.pad(e,{dir:"right",size:t})}function $(e){return e.length}function v(e,t,n,r={}){const{strict:i}=r;return e.slice(t,n)}function A(e,t={}){const{size:n}=t;typeof n<"u"&&o.assertSize(e,n);const r=s.fromBytes(e,t);return s.toBigInt(r,t)}function I(e,t={}){const{size:n}=t;let r=e;if(typeof n<"u"&&(o.assertSize(r,n),r=m(r)),r.length>1||r[0]>1)throw new B(r);return!!r[0]}function O(e,t={}){const{size:n}=t;typeof n<"u"&&o.assertSize(e,n);const r=s.fromBytes(e,t);return s.toNumber(r,t)}function P(e,t={}){const{size:n}=t;let r=e;return typeof n<"u"&&(o.assertSize(r,n),r=z(r)),x.decode(r)}function m(e){return o.trim(e,{dir:"left"})}function z(e){return o.trim(e,{dir:"right"})}class B extends a.BaseError{constructor(t){super(`Bytes value \`${t}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}class C extends a.BaseError{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}class R extends a.BaseError{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}exports.InvalidBytesBooleanError=B;exports.SizeExceedsPaddingSizeError=R;exports.SizeOverflowError=C;exports.from=p;exports.fromArray=g;exports.fromHex=b;exports.fromString=w;exports.padRight=h;exports.size=$;exports.slice=v;exports.toBigInt=A;exports.toBoolean=I;exports.toNumber=O;exports.toString=P;exports.trimLeft=m;exports.trimRight=z;
|
package/dist/index348.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BaseError as c } from "./
|
|
2
|
-
import { padRight as g, fromBytes as m, toNumber as h, toBigInt as z } from "./
|
|
1
|
+
import { BaseError as c } from "./index278.js";
|
|
2
|
+
import { padRight as g, fromBytes as m, toNumber as h, toBigInt as z } from "./index277.js";
|
|
3
3
|
import { charCodeToBase16 as b, assertSize as o, trim as y, pad as p } from "./index358.js";
|
|
4
|
-
import { assertSize as x } from "./
|
|
4
|
+
import { assertSize as x } from "./index279.js";
|
|
5
5
|
const B = /* @__PURE__ */ new TextDecoder(), $ = /* @__PURE__ */ new TextEncoder();
|
|
6
6
|
function U(e) {
|
|
7
7
|
return e instanceof Uint8Array ? e : typeof e == "string" ? S(e) : w(e);
|
package/dist/index349.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class T extends d.BaseError{constructor(r){super(`Value \`${r}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class x extends d.BaseError{constructor(r){super(`Type \`${r}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}exports.ArrayLengthMismatchError=I;exports.BytesSizeMismatchError=w;exports.DataSizeTooSmallError=A;exports.InvalidArrayError=T;exports.InvalidTypeError=x;exports.LengthMismatchError=p;exports.ZeroDataError=P;exports.decode=M;exports.encode=L;exports.encodePacked=b;exports.from=v;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index381.cjs");function r(){return e.version}exports.getVersion=r;
|
package/dist/index349.js
CHANGED
|
@@ -1,196 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { fromBytes as x, size as E, padLeft as b, fromString as $, fromBoolean as z, fromNumber as I, padRight as L, concat as p } from "./index272.js";
|
|
5
|
-
import { prepareParameters as M, encode as v, decodeParameter as S } from "./index351.js";
|
|
6
|
-
import { create as j } from "./index352.js";
|
|
7
|
-
import { integerRegex as B, bytesRegex as T, arrayRegex as O } from "./index282.js";
|
|
8
|
-
import { parseAbiParameters as g } from "./index294.js";
|
|
9
|
-
import { formatAbiParameters as D } from "./index286.js";
|
|
10
|
-
function Q(e, r, n = {}) {
|
|
11
|
-
const { as: t = "Array", checksumAddress: a = !1 } = n, o = typeof r == "string" ? w(r) : r, l = j(o);
|
|
12
|
-
if (h(o) === 0 && e.length > 0)
|
|
13
|
-
throw new R();
|
|
14
|
-
if (h(o) && h(o) < 32)
|
|
15
|
-
throw new N({
|
|
16
|
-
data: typeof r == "string" ? r : x(r),
|
|
17
|
-
parameters: e,
|
|
18
|
-
size: h(o)
|
|
19
|
-
});
|
|
20
|
-
let f = 0;
|
|
21
|
-
const i = t === "Array" ? [] : {};
|
|
22
|
-
for (let s = 0; s < e.length; ++s) {
|
|
23
|
-
const c = e[s];
|
|
24
|
-
l.setPosition(f);
|
|
25
|
-
const [u, A] = S(l, c, {
|
|
26
|
-
checksumAddress: a,
|
|
27
|
-
staticPosition: 0
|
|
28
|
-
});
|
|
29
|
-
f += A, t === "Array" ? i.push(u) : i[c.name ?? s] = u;
|
|
30
|
-
}
|
|
31
|
-
return i;
|
|
32
|
-
}
|
|
33
|
-
function U(e, r, n) {
|
|
34
|
-
const { checksumAddress: t = !1 } = {};
|
|
35
|
-
if (e.length !== r.length)
|
|
36
|
-
throw new y({
|
|
37
|
-
expectedLength: e.length,
|
|
38
|
-
givenLength: r.length
|
|
39
|
-
});
|
|
40
|
-
const a = M({
|
|
41
|
-
checksumAddress: t,
|
|
42
|
-
parameters: e,
|
|
43
|
-
values: r
|
|
44
|
-
}), o = v(a);
|
|
45
|
-
return o.length === 0 ? "0x" : o;
|
|
46
|
-
}
|
|
47
|
-
function d(e, r) {
|
|
48
|
-
if (e.length !== r.length)
|
|
49
|
-
throw new y({
|
|
50
|
-
expectedLength: e.length,
|
|
51
|
-
givenLength: r.length
|
|
52
|
-
});
|
|
53
|
-
const n = [];
|
|
54
|
-
for (let t = 0; t < e.length; t++) {
|
|
55
|
-
const a = e[t], o = r[t];
|
|
56
|
-
n.push(d.encode(a, o));
|
|
57
|
-
}
|
|
58
|
-
return p(...n);
|
|
59
|
-
}
|
|
60
|
-
(function(e) {
|
|
61
|
-
function r(n, t, a = !1) {
|
|
62
|
-
if (n === "address") {
|
|
63
|
-
const i = t;
|
|
64
|
-
return P(i), b(i.toLowerCase(), a ? 32 : 0);
|
|
65
|
-
}
|
|
66
|
-
if (n === "string")
|
|
67
|
-
return $(t);
|
|
68
|
-
if (n === "bytes")
|
|
69
|
-
return t;
|
|
70
|
-
if (n === "bool")
|
|
71
|
-
return b(z(t), a ? 32 : 1);
|
|
72
|
-
const o = n.match(B);
|
|
73
|
-
if (o) {
|
|
74
|
-
const [i, s, c = "256"] = o, u = Number.parseInt(c, 10) / 8;
|
|
75
|
-
return I(t, {
|
|
76
|
-
size: a ? 32 : u,
|
|
77
|
-
signed: s === "int"
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
const l = n.match(T);
|
|
81
|
-
if (l) {
|
|
82
|
-
const [i, s] = l;
|
|
83
|
-
if (Number.parseInt(s, 10) !== (t.length - 2) / 2)
|
|
84
|
-
throw new _({
|
|
85
|
-
expectedSize: Number.parseInt(s, 10),
|
|
86
|
-
value: t
|
|
87
|
-
});
|
|
88
|
-
return L(t, a ? 32 : 0);
|
|
89
|
-
}
|
|
90
|
-
const f = n.match(O);
|
|
91
|
-
if (f && Array.isArray(t)) {
|
|
92
|
-
const [i, s] = f, c = [];
|
|
93
|
-
for (let u = 0; u < t.length; u++)
|
|
94
|
-
c.push(r(s, t[u], !0));
|
|
95
|
-
return c.length === 0 ? "0x" : p(...c);
|
|
96
|
-
}
|
|
97
|
-
throw new k(n);
|
|
98
|
-
}
|
|
99
|
-
e.encode = r;
|
|
100
|
-
})(d || (d = {}));
|
|
101
|
-
function W(e) {
|
|
102
|
-
return Array.isArray(e) && typeof e[0] == "string" ? g(e) : typeof e == "string" ? g(e) : e;
|
|
103
|
-
}
|
|
104
|
-
class N extends m {
|
|
105
|
-
constructor({ data: r, parameters: n, size: t }) {
|
|
106
|
-
super(`Data size of ${t} bytes is too small for given parameters.`, {
|
|
107
|
-
metaMessages: [
|
|
108
|
-
`Params: (${D(n)})`,
|
|
109
|
-
`Data: ${r} (${t} bytes)`
|
|
110
|
-
]
|
|
111
|
-
}), Object.defineProperty(this, "name", {
|
|
112
|
-
enumerable: !0,
|
|
113
|
-
configurable: !0,
|
|
114
|
-
writable: !0,
|
|
115
|
-
value: "AbiParameters.DataSizeTooSmallError"
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
class R extends m {
|
|
120
|
-
constructor() {
|
|
121
|
-
super('Cannot decode zero data ("0x") with ABI parameters.'), Object.defineProperty(this, "name", {
|
|
122
|
-
enumerable: !0,
|
|
123
|
-
configurable: !0,
|
|
124
|
-
writable: !0,
|
|
125
|
-
value: "AbiParameters.ZeroDataError"
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
class X extends m {
|
|
130
|
-
constructor({ expectedLength: r, givenLength: n, type: t }) {
|
|
131
|
-
super(`Array length mismatch for type \`${t}\`. Expected: \`${r}\`. Given: \`${n}\`.`), Object.defineProperty(this, "name", {
|
|
132
|
-
enumerable: !0,
|
|
133
|
-
configurable: !0,
|
|
134
|
-
writable: !0,
|
|
135
|
-
value: "AbiParameters.ArrayLengthMismatchError"
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
class _ extends m {
|
|
140
|
-
constructor({ expectedSize: r, value: n }) {
|
|
141
|
-
super(`Size of bytes "${n}" (bytes${E(n)}) does not match expected size (bytes${r}).`), Object.defineProperty(this, "name", {
|
|
142
|
-
enumerable: !0,
|
|
143
|
-
configurable: !0,
|
|
144
|
-
writable: !0,
|
|
145
|
-
value: "AbiParameters.BytesSizeMismatchError"
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
class y extends m {
|
|
150
|
-
constructor({ expectedLength: r, givenLength: n }) {
|
|
151
|
-
super([
|
|
152
|
-
"ABI encoding parameters/values length mismatch.",
|
|
153
|
-
`Expected length (parameters): ${r}`,
|
|
154
|
-
`Given length (values): ${n}`
|
|
155
|
-
].join(`
|
|
156
|
-
`)), Object.defineProperty(this, "name", {
|
|
157
|
-
enumerable: !0,
|
|
158
|
-
configurable: !0,
|
|
159
|
-
writable: !0,
|
|
160
|
-
value: "AbiParameters.LengthMismatchError"
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
class Y extends m {
|
|
165
|
-
constructor(r) {
|
|
166
|
-
super(`Value \`${r}\` is not a valid array.`), Object.defineProperty(this, "name", {
|
|
167
|
-
enumerable: !0,
|
|
168
|
-
configurable: !0,
|
|
169
|
-
writable: !0,
|
|
170
|
-
value: "AbiParameters.InvalidArrayError"
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
class k extends m {
|
|
175
|
-
constructor(r) {
|
|
176
|
-
super(`Type \`${r}\` is not a valid ABI Type.`), Object.defineProperty(this, "name", {
|
|
177
|
-
enumerable: !0,
|
|
178
|
-
configurable: !0,
|
|
179
|
-
writable: !0,
|
|
180
|
-
value: "AbiParameters.InvalidTypeError"
|
|
181
|
-
});
|
|
182
|
-
}
|
|
1
|
+
import { version as r } from "./index381.js";
|
|
2
|
+
function e() {
|
|
3
|
+
return r;
|
|
183
4
|
}
|
|
184
5
|
export {
|
|
185
|
-
|
|
186
|
-
_ as BytesSizeMismatchError,
|
|
187
|
-
N as DataSizeTooSmallError,
|
|
188
|
-
Y as InvalidArrayError,
|
|
189
|
-
k as InvalidTypeError,
|
|
190
|
-
y as LengthMismatchError,
|
|
191
|
-
R as ZeroDataError,
|
|
192
|
-
Q as decode,
|
|
193
|
-
U as encode,
|
|
194
|
-
d as encodePacked,
|
|
195
|
-
W as from
|
|
6
|
+
e as getVersion
|
|
196
7
|
};
|
package/dist/index350.cjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index348.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./index351.cjs"),f=require("./index348.cjs"),d=require("./index278.cjs"),i=require("./index277.cjs"),y=require("./index352.cjs"),S=require("./index353.cjs"),g=require("./index282.cjs"),E=require("./index316.cjs"),$=require("./index308.cjs");function M(e,r,n={}){const{as:t="Array",checksumAddress:a=!1}=n,s=typeof r=="string"?f.fromHex(r):r,m=S.create(s);if(f.size(s)===0&&e.length>0)throw new P;if(f.size(s)&&f.size(s)<32)throw new A({data:typeof r=="string"?r:i.fromBytes(r),parameters:e,size:f.size(s)});let h=0;const c=t==="Array"?[]:{};for(let o=0;o<e.length;++o){const u=e[o];m.setPosition(h);const[l,z]=y.decodeParameter(m,u,{checksumAddress:a,staticPosition:0});h+=z,t==="Array"?c.push(l):c[u.name??o]=l}return c}function L(e,r,n){const{checksumAddress:t=!1}={};if(e.length!==r.length)throw new p({expectedLength:e.length,givenLength:r.length});const a=y.prepareParameters({checksumAddress:t,parameters:e,values:r}),s=y.encode(a);return s.length===0?"0x":s}function b(e,r){if(e.length!==r.length)throw new p({expectedLength:e.length,givenLength:r.length});const n=[];for(let t=0;t<e.length;t++){const a=e[t],s=r[t];n.push(b.encode(a,s))}return i.concat(...n)}(function(e){function r(n,t,a=!1){if(n==="address"){const c=t;return B.assert(c),i.padLeft(c.toLowerCase(),a?32:0)}if(n==="string")return i.fromString(t);if(n==="bytes")return t;if(n==="bool")return i.padLeft(i.fromBoolean(t),a?32:1);const s=n.match(g.integerRegex);if(s){const[c,o,u="256"]=s,l=Number.parseInt(u,10)/8;return i.fromNumber(t,{size:a?32:l,signed:o==="int"})}const m=n.match(g.bytesRegex);if(m){const[c,o]=m;if(Number.parseInt(o,10)!==(t.length-2)/2)throw new w({expectedSize:Number.parseInt(o,10),value:t});return i.padRight(t,a?32:0)}const h=n.match(g.arrayRegex);if(h&&Array.isArray(t)){const[c,o]=h,u=[];for(let l=0;l<t.length;l++)u.push(r(o,t[l],!0));return u.length===0?"0x":i.concat(...u)}throw new x(n)}e.encode=r})(b||(b={}));function v(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?E.parseAbiParameters(e):e}class A extends d.BaseError{constructor({data:r,parameters:n,size:t}){super(`Data size of ${t} bytes is too small for given parameters.`,{metaMessages:[`Params: (${$.formatAbiParameters(n)})`,`Data: ${r} (${t} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class P extends d.BaseError{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class I extends d.BaseError{constructor({expectedLength:r,givenLength:n,type:t}){super(`Array length mismatch for type \`${t}\`. Expected: \`${r}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class w extends d.BaseError{constructor({expectedSize:r,value:n}){super(`Size of bytes "${n}" (bytes${i.size(n)}) does not match expected size (bytes${r}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class p extends d.BaseError{constructor({expectedLength:r,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${r}`,`Given length (values): ${n}`].join(`
|
|
2
|
+
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class T extends d.BaseError{constructor(r){super(`Value \`${r}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class x extends d.BaseError{constructor(r){super(`Type \`${r}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}exports.ArrayLengthMismatchError=I;exports.BytesSizeMismatchError=w;exports.DataSizeTooSmallError=A;exports.InvalidArrayError=T;exports.InvalidTypeError=x;exports.LengthMismatchError=p;exports.ZeroDataError=P;exports.decode=M;exports.encode=L;exports.encodePacked=b;exports.from=v;
|
package/dist/index350.js
CHANGED
|
@@ -1,80 +1,196 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { BaseError as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { assert as P } from "./index351.js";
|
|
2
|
+
import { fromHex as w, size as h } from "./index348.js";
|
|
3
|
+
import { BaseError as m } from "./index278.js";
|
|
4
|
+
import { fromBytes as x, size as E, padLeft as b, fromString as $, fromBoolean as z, fromNumber as I, padRight as L, concat as p } from "./index277.js";
|
|
5
|
+
import { prepareParameters as M, encode as v, decodeParameter as S } from "./index352.js";
|
|
6
|
+
import { create as j } from "./index353.js";
|
|
7
|
+
import { integerRegex as B, bytesRegex as T, arrayRegex as O } from "./index282.js";
|
|
8
|
+
import { parseAbiParameters as g } from "./index316.js";
|
|
9
|
+
import { formatAbiParameters as D } from "./index308.js";
|
|
10
|
+
function Q(e, r, n = {}) {
|
|
11
|
+
const { as: t = "Array", checksumAddress: a = !1 } = n, o = typeof r == "string" ? w(r) : r, l = j(o);
|
|
12
|
+
if (h(o) === 0 && e.length > 0)
|
|
13
|
+
throw new R();
|
|
14
|
+
if (h(o) && h(o) < 32)
|
|
15
|
+
throw new N({
|
|
16
|
+
data: typeof r == "string" ? r : x(r),
|
|
17
|
+
parameters: e,
|
|
18
|
+
size: h(o)
|
|
12
19
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
let f = 0;
|
|
21
|
+
const i = t === "Array" ? [] : {};
|
|
22
|
+
for (let s = 0; s < e.length; ++s) {
|
|
23
|
+
const c = e[s];
|
|
24
|
+
l.setPosition(f);
|
|
25
|
+
const [u, A] = S(l, c, {
|
|
26
|
+
checksumAddress: a,
|
|
27
|
+
staticPosition: 0
|
|
28
|
+
});
|
|
29
|
+
f += A, t === "Array" ? i.push(u) : i[c.name ?? s] = u;
|
|
21
30
|
}
|
|
31
|
+
return i;
|
|
32
|
+
}
|
|
33
|
+
function U(e, r, n) {
|
|
34
|
+
const { checksumAddress: t = !1 } = {};
|
|
35
|
+
if (e.length !== r.length)
|
|
36
|
+
throw new y({
|
|
37
|
+
expectedLength: e.length,
|
|
38
|
+
givenLength: r.length
|
|
39
|
+
});
|
|
40
|
+
const a = M({
|
|
41
|
+
checksumAddress: t,
|
|
42
|
+
parameters: e,
|
|
43
|
+
values: r
|
|
44
|
+
}), o = v(a);
|
|
45
|
+
return o.length === 0 ? "0x" : o;
|
|
22
46
|
}
|
|
23
|
-
function
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
47
|
+
function d(e, r) {
|
|
48
|
+
if (e.length !== r.length)
|
|
49
|
+
throw new y({
|
|
50
|
+
expectedLength: e.length,
|
|
51
|
+
givenLength: r.length
|
|
52
|
+
});
|
|
53
|
+
const n = [];
|
|
54
|
+
for (let t = 0; t < e.length; t++) {
|
|
55
|
+
const a = e[t], o = r[t];
|
|
56
|
+
n.push(d.encode(a, o));
|
|
57
|
+
}
|
|
58
|
+
return p(...n);
|
|
32
59
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
60
|
+
(function(e) {
|
|
61
|
+
function r(n, t, a = !1) {
|
|
62
|
+
if (n === "address") {
|
|
63
|
+
const i = t;
|
|
64
|
+
return P(i), b(i.toLowerCase(), a ? 32 : 0);
|
|
65
|
+
}
|
|
66
|
+
if (n === "string")
|
|
67
|
+
return $(t);
|
|
68
|
+
if (n === "bytes")
|
|
69
|
+
return t;
|
|
70
|
+
if (n === "bool")
|
|
71
|
+
return b(z(t), a ? 32 : 1);
|
|
72
|
+
const o = n.match(B);
|
|
73
|
+
if (o) {
|
|
74
|
+
const [i, s, c = "256"] = o, u = Number.parseInt(c, 10) / 8;
|
|
75
|
+
return I(t, {
|
|
76
|
+
size: a ? 32 : u,
|
|
77
|
+
signed: s === "int"
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const l = n.match(T);
|
|
81
|
+
if (l) {
|
|
82
|
+
const [i, s] = l;
|
|
83
|
+
if (Number.parseInt(s, 10) !== (t.length - 2) / 2)
|
|
84
|
+
throw new _({
|
|
85
|
+
expectedSize: Number.parseInt(s, 10),
|
|
86
|
+
value: t
|
|
87
|
+
});
|
|
88
|
+
return L(t, a ? 32 : 0);
|
|
89
|
+
}
|
|
90
|
+
const f = n.match(O);
|
|
91
|
+
if (f && Array.isArray(t)) {
|
|
92
|
+
const [i, s] = f, c = [];
|
|
93
|
+
for (let u = 0; u < t.length; u++)
|
|
94
|
+
c.push(r(s, t[u], !0));
|
|
95
|
+
return c.length === 0 ? "0x" : p(...c);
|
|
96
|
+
}
|
|
97
|
+
throw new k(n);
|
|
39
98
|
}
|
|
99
|
+
e.encode = r;
|
|
100
|
+
})(d || (d = {}));
|
|
101
|
+
function W(e) {
|
|
102
|
+
return Array.isArray(e) && typeof e[0] == "string" ? g(e) : typeof e == "string" ? g(e) : e;
|
|
40
103
|
}
|
|
41
|
-
class
|
|
42
|
-
constructor({
|
|
43
|
-
super(`
|
|
44
|
-
|
|
104
|
+
class N extends m {
|
|
105
|
+
constructor({ data: r, parameters: n, size: t }) {
|
|
106
|
+
super(`Data size of ${t} bytes is too small for given parameters.`, {
|
|
107
|
+
metaMessages: [
|
|
108
|
+
`Params: (${D(n)})`,
|
|
109
|
+
`Data: ${r} (${t} bytes)`
|
|
110
|
+
]
|
|
45
111
|
}), Object.defineProperty(this, "name", {
|
|
46
112
|
enumerable: !0,
|
|
47
113
|
configurable: !0,
|
|
48
114
|
writable: !0,
|
|
49
|
-
value: "
|
|
115
|
+
value: "AbiParameters.DataSizeTooSmallError"
|
|
50
116
|
});
|
|
51
117
|
}
|
|
52
118
|
}
|
|
53
|
-
class
|
|
119
|
+
class R extends m {
|
|
54
120
|
constructor() {
|
|
55
|
-
super(
|
|
121
|
+
super('Cannot decode zero data ("0x") with ABI parameters.'), Object.defineProperty(this, "name", {
|
|
56
122
|
enumerable: !0,
|
|
57
123
|
configurable: !0,
|
|
58
124
|
writable: !0,
|
|
59
|
-
value: "
|
|
125
|
+
value: "AbiParameters.ZeroDataError"
|
|
60
126
|
});
|
|
61
127
|
}
|
|
62
128
|
}
|
|
63
|
-
class
|
|
64
|
-
constructor() {
|
|
65
|
-
super(
|
|
129
|
+
class X extends m {
|
|
130
|
+
constructor({ expectedLength: r, givenLength: n, type: t }) {
|
|
131
|
+
super(`Array length mismatch for type \`${t}\`. Expected: \`${r}\`. Given: \`${n}\`.`), Object.defineProperty(this, "name", {
|
|
132
|
+
enumerable: !0,
|
|
133
|
+
configurable: !0,
|
|
134
|
+
writable: !0,
|
|
135
|
+
value: "AbiParameters.ArrayLengthMismatchError"
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
class _ extends m {
|
|
140
|
+
constructor({ expectedSize: r, value: n }) {
|
|
141
|
+
super(`Size of bytes "${n}" (bytes${E(n)}) does not match expected size (bytes${r}).`), Object.defineProperty(this, "name", {
|
|
142
|
+
enumerable: !0,
|
|
143
|
+
configurable: !0,
|
|
144
|
+
writable: !0,
|
|
145
|
+
value: "AbiParameters.BytesSizeMismatchError"
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
class y extends m {
|
|
150
|
+
constructor({ expectedLength: r, givenLength: n }) {
|
|
151
|
+
super([
|
|
152
|
+
"ABI encoding parameters/values length mismatch.",
|
|
153
|
+
`Expected length (parameters): ${r}`,
|
|
154
|
+
`Given length (values): ${n}`
|
|
155
|
+
].join(`
|
|
156
|
+
`)), Object.defineProperty(this, "name", {
|
|
157
|
+
enumerable: !0,
|
|
158
|
+
configurable: !0,
|
|
159
|
+
writable: !0,
|
|
160
|
+
value: "AbiParameters.LengthMismatchError"
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
class Y extends m {
|
|
165
|
+
constructor(r) {
|
|
166
|
+
super(`Value \`${r}\` is not a valid array.`), Object.defineProperty(this, "name", {
|
|
167
|
+
enumerable: !0,
|
|
168
|
+
configurable: !0,
|
|
169
|
+
writable: !0,
|
|
170
|
+
value: "AbiParameters.InvalidArrayError"
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
class k extends m {
|
|
175
|
+
constructor(r) {
|
|
176
|
+
super(`Type \`${r}\` is not a valid ABI Type.`), Object.defineProperty(this, "name", {
|
|
66
177
|
enumerable: !0,
|
|
67
178
|
configurable: !0,
|
|
68
179
|
writable: !0,
|
|
69
|
-
value: "
|
|
180
|
+
value: "AbiParameters.InvalidTypeError"
|
|
70
181
|
});
|
|
71
182
|
}
|
|
72
183
|
}
|
|
73
184
|
export {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
185
|
+
X as ArrayLengthMismatchError,
|
|
186
|
+
_ as BytesSizeMismatchError,
|
|
187
|
+
N as DataSizeTooSmallError,
|
|
188
|
+
Y as InvalidArrayError,
|
|
189
|
+
k as InvalidTypeError,
|
|
190
|
+
y as LengthMismatchError,
|
|
191
|
+
R as ZeroDataError,
|
|
192
|
+
Q as decode,
|
|
193
|
+
U as encode,
|
|
194
|
+
d as encodePacked,
|
|
195
|
+
W as from
|
|
80
196
|
};
|
package/dist/index351.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index348.cjs"),c=require("./index354.cjs"),o=require("./index278.cjs"),m=require("./index347.cjs"),b=/^0x[a-fA-F0-9]{40}$/;function i(e,t={}){const{strict:s=!0}=t;if(!b.test(e))throw new a({address:e,cause:new l});if(s){if(e.toLowerCase()===e)return;if(d(e)!==e)throw new a({address:e,cause:new h})}}function d(e){if(c.checksum.has(e))return c.checksum.get(e);i(e,{strict:!1});const t=e.substring(2).toLowerCase(),s=m.keccak256(f.fromString(t),{as:"Bytes"}),n=t.split("");for(let r=0;r<40;r+=2)s[r>>1]>>4>=8&&n[r]&&(n[r]=n[r].toUpperCase()),(s[r>>1]&15)>=8&&n[r+1]&&(n[r+1]=n[r+1].toUpperCase());const u=`0x${n.join("")}`;return c.checksum.set(e,u),u}function p(e,t={}){const{strict:s=!0}=t??{};try{return i(e,{strict:s}),!0}catch{return!1}}class a extends o.BaseError{constructor({address:t,cause:s}){super(`Address "${t}" is invalid.`,{cause:s}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class l extends o.BaseError{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class h extends o.BaseError{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}exports.InvalidAddressError=a;exports.InvalidChecksumError=h;exports.InvalidInputError=l;exports.assert=i;exports.checksum=d;exports.validate=p;
|