@gardenfi/swap 0.0.2-beta.1 → 0.0.2-beta.2

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 (179) hide show
  1. package/dist/index104.cjs +1 -1
  2. package/dist/index104.js +4 -4
  3. package/dist/index106.cjs +1 -1
  4. package/dist/index106.js +3 -3
  5. package/dist/index107.cjs +1 -1
  6. package/dist/index107.js +3 -3
  7. package/dist/index116.cjs +1 -1
  8. package/dist/index116.js +1 -1
  9. package/dist/index117.cjs +1 -1
  10. package/dist/index117.js +1 -1
  11. package/dist/index120.cjs +1 -1
  12. package/dist/index120.js +2 -2
  13. package/dist/index121.cjs +1 -1
  14. package/dist/index121.js +7 -7
  15. package/dist/index132.cjs +1 -1
  16. package/dist/index132.js +1 -1
  17. package/dist/index133.cjs +1 -1
  18. package/dist/index133.js +1 -1
  19. package/dist/index134.cjs +1 -1
  20. package/dist/index134.js +1 -1
  21. package/dist/index135.cjs +1 -1
  22. package/dist/index135.js +1 -1
  23. package/dist/index138.cjs +1 -1
  24. package/dist/index138.js +2 -2
  25. package/dist/index161.cjs +1 -1
  26. package/dist/index161.js +2 -2
  27. package/dist/index167.cjs +1 -1
  28. package/dist/index167.js +2 -2
  29. package/dist/index168.cjs +1 -1
  30. package/dist/index168.js +2 -2
  31. package/dist/index169.cjs +1 -1
  32. package/dist/index169.js +2 -2
  33. package/dist/index170.cjs +1 -1
  34. package/dist/index170.js +2 -2
  35. package/dist/index171.cjs +1 -1
  36. package/dist/index171.js +2 -2
  37. package/dist/index172.cjs +1 -1
  38. package/dist/index172.js +2 -2
  39. package/dist/index181.cjs +1 -1
  40. package/dist/index181.js +1 -1
  41. package/dist/index272.cjs +1 -1
  42. package/dist/index272.js +174 -9
  43. package/dist/index273.cjs +2 -1
  44. package/dist/index273.js +91 -30
  45. package/dist/index274.cjs +1 -1
  46. package/dist/index274.js +41 -2
  47. package/dist/index275.cjs +1 -1
  48. package/dist/index275.js +4 -47
  49. package/dist/index276.cjs +1 -1
  50. package/dist/index276.js +9 -11
  51. package/dist/index277.cjs +1 -1
  52. package/dist/index277.js +30 -174
  53. package/dist/index278.cjs +1 -2
  54. package/dist/index278.js +2 -92
  55. package/dist/index279.cjs +1 -1
  56. package/dist/index279.js +45 -38
  57. package/dist/index280.cjs +1 -1
  58. package/dist/index280.js +11 -4
  59. package/dist/index281.cjs +1 -1
  60. package/dist/index281.js +3 -3
  61. package/dist/index299.cjs +1 -1
  62. package/dist/index299.js +7 -37
  63. package/dist/index300.cjs +1 -1
  64. package/dist/index300.js +36 -14
  65. package/dist/index301.cjs +1 -1
  66. package/dist/index301.js +15 -8
  67. package/dist/index302.cjs +1 -1
  68. package/dist/index302.js +43 -8
  69. package/dist/index303.cjs +1 -1
  70. package/dist/index303.js +317 -39
  71. package/dist/index304.cjs +1 -1
  72. package/dist/index304.js +586 -301
  73. package/dist/index305.cjs +1 -1
  74. package/dist/index305.js +107 -603
  75. package/dist/index306.cjs +1 -1
  76. package/dist/index306.js +168 -110
  77. package/dist/index307.cjs +1 -1
  78. package/dist/index307.js +299 -165
  79. package/dist/index308.cjs +1 -1
  80. package/dist/index308.js +92 -300
  81. package/dist/index309.cjs +1 -1
  82. package/dist/index309.js +56 -93
  83. package/dist/index310.cjs +1 -1
  84. package/dist/index310.js +52 -55
  85. package/dist/index311.cjs +1 -1
  86. package/dist/index311.js +42 -51
  87. package/dist/index312.cjs +1 -1
  88. package/dist/index312.js +14 -43
  89. package/dist/index313.cjs +1 -1
  90. package/dist/index313.js +317 -15
  91. package/dist/index314.cjs +1 -1
  92. package/dist/index314.js +53 -311
  93. package/dist/index315.cjs +1 -1
  94. package/dist/index315.js +19 -59
  95. package/dist/index316.cjs +1 -1
  96. package/dist/index316.js +29 -19
  97. package/dist/index317.cjs +1 -1
  98. package/dist/index317.js +3 -29
  99. package/dist/index318.cjs +7 -1
  100. package/dist/index318.js +237 -3
  101. package/dist/index319.cjs +1 -7
  102. package/dist/index319.js +48 -238
  103. package/dist/index320.cjs +1 -1
  104. package/dist/index320.js +213 -48
  105. package/dist/index321.cjs +1 -1
  106. package/dist/index321.js +75 -206
  107. package/dist/index322.cjs +1 -1
  108. package/dist/index322.js +26 -78
  109. package/dist/index323.cjs +1 -1
  110. package/dist/index323.js +73 -26
  111. package/dist/index324.cjs +1 -1
  112. package/dist/index324.js +7 -75
  113. package/dist/index326.cjs +1 -1
  114. package/dist/index326.js +1 -1
  115. package/dist/index327.cjs +1 -1
  116. package/dist/index327.js +1 -1
  117. package/dist/index333.cjs +1 -1
  118. package/dist/index333.js +2 -2
  119. package/dist/index334.cjs +1 -1
  120. package/dist/index334.js +2 -2
  121. package/dist/index346.cjs +1 -1
  122. package/dist/index346.js +1 -1
  123. package/dist/index347.cjs +1 -1
  124. package/dist/index347.js +1 -1
  125. package/dist/index348.cjs +1 -1
  126. package/dist/index348.js +3 -3
  127. package/dist/index349.cjs +2 -1
  128. package/dist/index349.js +193 -4
  129. package/dist/index350.cjs +1 -2
  130. package/dist/index350.js +52 -168
  131. package/dist/index351.cjs +1 -1
  132. package/dist/index351.js +331 -65
  133. package/dist/index352.cjs +1 -1
  134. package/dist/index352.js +149 -332
  135. package/dist/index353.cjs +1 -1
  136. package/dist/index353.js +5 -161
  137. package/dist/index354.cjs +1 -1
  138. package/dist/index354.js +5 -5
  139. package/dist/index357.cjs +1 -1
  140. package/dist/index357.js +205 -8
  141. package/dist/index359.cjs +1 -1
  142. package/dist/index359.js +8 -205
  143. package/dist/index363.cjs +1 -1
  144. package/dist/index363.js +1 -1
  145. package/dist/index364.cjs +1 -1
  146. package/dist/index364.js +1 -1
  147. package/dist/index365.cjs +1 -1
  148. package/dist/index365.js +73 -3
  149. package/dist/index366.cjs +1 -1
  150. package/dist/index366.js +29 -138
  151. package/dist/index367.cjs +1 -1
  152. package/dist/index367.js +5 -73
  153. package/dist/index368.cjs +1 -1
  154. package/dist/index368.js +2 -30
  155. package/dist/index369.cjs +1 -1
  156. package/dist/index369.js +140 -5
  157. package/dist/index370.cjs +1 -1
  158. package/dist/index370.js +1 -1
  159. package/dist/index373.cjs +1 -1
  160. package/dist/index373.js +1 -1
  161. package/dist/index374.cjs +1 -1
  162. package/dist/index374.js +1 -1
  163. package/dist/index375.cjs +1 -1
  164. package/dist/index375.js +2 -2
  165. package/dist/index379.cjs +1 -1
  166. package/dist/index379.js +1 -1
  167. package/dist/index380.cjs +1 -1
  168. package/dist/index380.js +1 -1
  169. package/dist/index381.cjs +1 -1
  170. package/dist/index381.js +22 -2
  171. package/dist/index382.cjs +1 -1
  172. package/dist/index382.js +2 -22
  173. package/dist/index385.cjs +1 -1
  174. package/dist/index385.js +2 -2
  175. package/dist/index77.cjs +1 -1
  176. package/dist/index77.js +13 -13
  177. package/dist/index99.cjs +1 -1
  178. package/dist/index99.js +1 -1
  179. package/package.json +5 -5
package/dist/index272.js CHANGED
@@ -1,12 +1,177 @@
1
- import { recoverAddress as i } from "./index102.js";
2
- import { hashAuthorization as e } from "./index356.js";
3
- async function a(o) {
4
- const { authorization: r, signature: t } = o;
5
- return i({
6
- hash: e(r),
7
- signature: t ?? r
8
- });
1
+ import { BaseError as o } from "./index273.js";
2
+ import { assertStartOffset as x, assertEndOffset as $, pad as b, assertSize as f } from "./index274.js";
3
+ import { stringify as p } from "./index275.js";
4
+ const y = /* @__PURE__ */ new TextEncoder(), h = /* @__PURE__ */ Array.from({ length: 256 }, (e, r) => r.toString(16).padStart(2, "0"));
5
+ function z(e, r = {}) {
6
+ const { strict: t = !1 } = r;
7
+ if (!e)
8
+ throw new d(e);
9
+ if (typeof e != "string")
10
+ throw new d(e);
11
+ if (t && !/^0x[0-9a-fA-F]*$/.test(e))
12
+ throw new g(e);
13
+ if (!e.startsWith("0x"))
14
+ throw new g(e);
15
+ }
16
+ function A(...e) {
17
+ return `0x${e.reduce((r, t) => r + t.replace("0x", ""), "")}`;
18
+ }
19
+ function N(e) {
20
+ return e instanceof Uint8Array ? c(e) : Array.isArray(e) ? c(new Uint8Array(e)) : e;
21
+ }
22
+ function P(e, r = {}) {
23
+ const t = `0x${Number(e)}`;
24
+ return typeof r.size == "number" ? (f(t, r.size), m(t, r.size)) : t;
25
+ }
26
+ function c(e, r = {}) {
27
+ let t = "";
28
+ for (let s = 0; s < e.length; s++)
29
+ t += h[e[s]];
30
+ const n = `0x${t}`;
31
+ return typeof r.size == "number" ? (f(n, r.size), w(n, r.size)) : n;
32
+ }
33
+ function V(e, r = {}) {
34
+ const { signed: t, size: n } = r, s = BigInt(e);
35
+ let i;
36
+ n ? t ? i = (1n << BigInt(n) * 8n - 1n) - 1n : i = 2n ** (BigInt(n) * 8n) - 1n : typeof e == "number" && (i = BigInt(Number.MAX_SAFE_INTEGER));
37
+ const u = typeof i == "bigint" && t ? -i - 1n : 0;
38
+ if (i && s > i || s < u) {
39
+ const a = typeof e == "bigint" ? "n" : "";
40
+ throw new O({
41
+ max: i ? `${i}${a}` : void 0,
42
+ min: `${u}${a}`,
43
+ signed: t,
44
+ size: n,
45
+ value: `${e}${a}`
46
+ });
47
+ }
48
+ const l = `0x${(t && s < 0 ? BigInt.asUintN(n * 8, BigInt(s)) : s).toString(16)}`;
49
+ return n ? m(l, n) : l;
50
+ }
51
+ function j(e, r = {}) {
52
+ return c(y.encode(e), r);
53
+ }
54
+ function m(e, r) {
55
+ return b(e, { dir: "left", size: r });
56
+ }
57
+ function w(e, r) {
58
+ return b(e, { dir: "right", size: r });
59
+ }
60
+ function _(e, r, t, n = {}) {
61
+ const { strict: s } = n;
62
+ x(e, r);
63
+ const i = `0x${e.replace("0x", "").slice((r ?? 0) * 2, (t ?? e.length) * 2)}`;
64
+ return s && $(i, r, t), i;
65
+ }
66
+ function v(e) {
67
+ return Math.ceil((e.length - 2) / 2);
68
+ }
69
+ function E(e, r = {}) {
70
+ const { signed: t } = r;
71
+ r.size && f(e, r.size);
72
+ const n = BigInt(e);
73
+ if (!t)
74
+ return n;
75
+ const s = (e.length - 2) / 2, i = (1n << BigInt(s) * 8n) - 1n, u = i >> 1n;
76
+ return n <= u ? n : n - i - 1n;
77
+ }
78
+ function M(e, r = {}) {
79
+ const { signed: t, size: n } = r;
80
+ return Number(!t && !n ? e : E(e, r));
81
+ }
82
+ function R(e, r = {}) {
83
+ const { strict: t = !1 } = r;
84
+ try {
85
+ return z(e, { strict: t }), !0;
86
+ } catch {
87
+ return !1;
88
+ }
89
+ }
90
+ class O extends o {
91
+ constructor({ max: r, min: t, signed: n, size: s, value: i }) {
92
+ super(`Number \`${i}\` is not in safe${s ? ` ${s * 8}-bit` : ""}${n ? " signed" : " unsigned"} integer range ${r ? `(\`${t}\` to \`${r}\`)` : `(above \`${t}\`)`}`), Object.defineProperty(this, "name", {
93
+ enumerable: !0,
94
+ configurable: !0,
95
+ writable: !0,
96
+ value: "Hex.IntegerOutOfRangeError"
97
+ });
98
+ }
99
+ }
100
+ class d extends o {
101
+ constructor(r) {
102
+ super(`Value \`${typeof r == "object" ? p(r) : r}\` of type \`${typeof r}\` is an invalid hex type.`, {
103
+ metaMessages: ['Hex types must be represented as `"0x${string}"`.']
104
+ }), Object.defineProperty(this, "name", {
105
+ enumerable: !0,
106
+ configurable: !0,
107
+ writable: !0,
108
+ value: "Hex.InvalidHexTypeError"
109
+ });
110
+ }
111
+ }
112
+ class g extends o {
113
+ constructor(r) {
114
+ super(`Value \`${r}\` is an invalid hex value.`, {
115
+ metaMessages: [
116
+ 'Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).'
117
+ ]
118
+ }), Object.defineProperty(this, "name", {
119
+ enumerable: !0,
120
+ configurable: !0,
121
+ writable: !0,
122
+ value: "Hex.InvalidHexValueError"
123
+ });
124
+ }
125
+ }
126
+ class T extends o {
127
+ constructor({ givenSize: r, maxSize: t }) {
128
+ super(`Size cannot exceed \`${t}\` bytes. Given size: \`${r}\` bytes.`), Object.defineProperty(this, "name", {
129
+ enumerable: !0,
130
+ configurable: !0,
131
+ writable: !0,
132
+ value: "Hex.SizeOverflowError"
133
+ });
134
+ }
135
+ }
136
+ class U extends o {
137
+ constructor({ offset: r, position: t, size: n }) {
138
+ super(`Slice ${t === "start" ? "starting" : "ending"} at offset \`${r}\` is out-of-bounds (size: \`${n}\`).`), Object.defineProperty(this, "name", {
139
+ enumerable: !0,
140
+ configurable: !0,
141
+ writable: !0,
142
+ value: "Hex.SliceOffsetOutOfBoundsError"
143
+ });
144
+ }
145
+ }
146
+ class F extends o {
147
+ constructor({ size: r, targetSize: t, type: n }) {
148
+ super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${r}\`) exceeds padding size (\`${t}\`).`), Object.defineProperty(this, "name", {
149
+ enumerable: !0,
150
+ configurable: !0,
151
+ writable: !0,
152
+ value: "Hex.SizeExceedsPaddingSizeError"
153
+ });
154
+ }
9
155
  }
10
156
  export {
11
- a as recoverAuthorizationAddress
157
+ O as IntegerOutOfRangeError,
158
+ d as InvalidHexTypeError,
159
+ g as InvalidHexValueError,
160
+ F as SizeExceedsPaddingSizeError,
161
+ T as SizeOverflowError,
162
+ U as SliceOffsetOutOfBoundsError,
163
+ z as assert,
164
+ A as concat,
165
+ N as from,
166
+ P as fromBoolean,
167
+ c as fromBytes,
168
+ V as fromNumber,
169
+ j as fromString,
170
+ m as padLeft,
171
+ w as padRight,
172
+ v as size,
173
+ _ as slice,
174
+ E as toBigInt,
175
+ M as toNumber,
176
+ R as validate
12
177
  };
package/dist/index273.cjs CHANGED
@@ -1 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index277.cjs"),a=require("./index357.cjs");function i(t){return{...typeof t.baseFeePerGas=="bigint"&&{baseFeePerGas:e.fromNumber(t.baseFeePerGas)},...typeof t.blobBaseFee=="bigint"&&{blobBaseFee:e.fromNumber(t.blobBaseFee)},...typeof t.feeRecipient=="string"&&{feeRecipient:t.feeRecipient},...typeof t.gasLimit=="bigint"&&{gasLimit:e.fromNumber(t.gasLimit)},...typeof t.number=="bigint"&&{number:e.fromNumber(t.number)},...typeof t.prevRandao=="bigint"&&{prevRandao:e.fromNumber(t.prevRandao)},...typeof t.time=="bigint"&&{time:e.fromNumber(t.time)},...t.withdrawals&&{withdrawals:t.withdrawals.map(a.toRpc)}}}exports.toRpc=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index354.cjs");class r extends Error{static setStaticOptions(t){r.prototype.docsOrigin=t.docsOrigin,r.prototype.showVersion=t.showVersion,r.prototype.version=t.version}constructor(t,e={}){const i=(()=>{var a;if(e.cause instanceof r){if(e.cause.details)return e.cause.details;if(e.cause.shortMessage)return e.cause.shortMessage}return e.cause&&"details"in e.cause&&typeof e.cause.details=="string"?e.cause.details:(a=e.cause)!=null&&a.message?e.cause.message:e.details})(),u=e.cause instanceof r&&e.cause.docsPath||e.docsPath,n=e.docsOrigin??r.prototype.docsOrigin,l=`${n}${u??""}`,c=!!(e.version??r.prototype.showVersion),o=e.version??r.prototype.version,b=[t||"An error occurred.",...e.metaMessages?["",...e.metaMessages]:[],...i||u||c?["",i?`Details: ${i}`:void 0,u?`See: ${l}`:void 0,c?`Version: ${o}`:void 0]:[]].filter(a=>typeof a=="string").join(`
2
+ `);super(b,e.cause?{cause:e.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=e.cause,this.details=i,this.docs=l,this.docsOrigin=n,this.docsPath=u,this.shortMessage=t,this.showVersion=c,this.version=o}walk(t){return d(this,t)}}Object.defineProperty(r,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${f.getVersion()}`}});r.setStaticOptions(r.defaultStaticOptions);function d(s,t){return t!=null&&t(s)?s:s&&typeof s=="object"&&"cause"in s&&s.cause?d(s.cause,t):t?null:s}exports.BaseError=r;
package/dist/index273.js CHANGED
@@ -1,33 +1,94 @@
1
- import { fromNumber as a } from "./index277.js";
2
- import { toRpc as e } from "./index357.js";
3
- function n(t) {
4
- return {
5
- ...typeof t.baseFeePerGas == "bigint" && {
6
- baseFeePerGas: a(t.baseFeePerGas)
7
- },
8
- ...typeof t.blobBaseFee == "bigint" && {
9
- blobBaseFee: a(t.blobBaseFee)
10
- },
11
- ...typeof t.feeRecipient == "string" && {
12
- feeRecipient: t.feeRecipient
13
- },
14
- ...typeof t.gasLimit == "bigint" && {
15
- gasLimit: a(t.gasLimit)
16
- },
17
- ...typeof t.number == "bigint" && {
18
- number: a(t.number)
19
- },
20
- ...typeof t.prevRandao == "bigint" && {
21
- prevRandao: a(t.prevRandao)
22
- },
23
- ...typeof t.time == "bigint" && {
24
- time: a(t.time)
25
- },
26
- ...t.withdrawals && {
27
- withdrawals: t.withdrawals.map(e)
28
- }
29
- };
1
+ import { getVersion as f } from "./index354.js";
2
+ class r extends Error {
3
+ static setStaticOptions(t) {
4
+ r.prototype.docsOrigin = t.docsOrigin, r.prototype.showVersion = t.showVersion, r.prototype.version = t.version;
5
+ }
6
+ constructor(t, e = {}) {
7
+ const i = (() => {
8
+ var a;
9
+ if (e.cause instanceof r) {
10
+ if (e.cause.details)
11
+ return e.cause.details;
12
+ if (e.cause.shortMessage)
13
+ return e.cause.shortMessage;
14
+ }
15
+ return e.cause && "details" in e.cause && typeof e.cause.details == "string" ? e.cause.details : (a = e.cause) != null && a.message ? e.cause.message : e.details;
16
+ })(), u = e.cause instanceof r && e.cause.docsPath || e.docsPath, n = e.docsOrigin ?? r.prototype.docsOrigin, l = `${n}${u ?? ""}`, c = !!(e.version ?? r.prototype.showVersion), o = e.version ?? r.prototype.version, b = [
17
+ t || "An error occurred.",
18
+ ...e.metaMessages ? ["", ...e.metaMessages] : [],
19
+ ...i || u || c ? [
20
+ "",
21
+ i ? `Details: ${i}` : void 0,
22
+ u ? `See: ${l}` : void 0,
23
+ c ? `Version: ${o}` : void 0
24
+ ] : []
25
+ ].filter((a) => typeof a == "string").join(`
26
+ `);
27
+ super(b, e.cause ? { cause: e.cause } : void 0), Object.defineProperty(this, "details", {
28
+ enumerable: !0,
29
+ configurable: !0,
30
+ writable: !0,
31
+ value: void 0
32
+ }), Object.defineProperty(this, "docs", {
33
+ enumerable: !0,
34
+ configurable: !0,
35
+ writable: !0,
36
+ value: void 0
37
+ }), Object.defineProperty(this, "docsOrigin", {
38
+ enumerable: !0,
39
+ configurable: !0,
40
+ writable: !0,
41
+ value: void 0
42
+ }), Object.defineProperty(this, "docsPath", {
43
+ enumerable: !0,
44
+ configurable: !0,
45
+ writable: !0,
46
+ value: void 0
47
+ }), Object.defineProperty(this, "shortMessage", {
48
+ enumerable: !0,
49
+ configurable: !0,
50
+ writable: !0,
51
+ value: void 0
52
+ }), Object.defineProperty(this, "showVersion", {
53
+ enumerable: !0,
54
+ configurable: !0,
55
+ writable: !0,
56
+ value: void 0
57
+ }), Object.defineProperty(this, "version", {
58
+ enumerable: !0,
59
+ configurable: !0,
60
+ writable: !0,
61
+ value: void 0
62
+ }), Object.defineProperty(this, "cause", {
63
+ enumerable: !0,
64
+ configurable: !0,
65
+ writable: !0,
66
+ value: void 0
67
+ }), Object.defineProperty(this, "name", {
68
+ enumerable: !0,
69
+ configurable: !0,
70
+ writable: !0,
71
+ value: "BaseError"
72
+ }), this.cause = e.cause, this.details = i, this.docs = l, this.docsOrigin = n, this.docsPath = u, this.shortMessage = t, this.showVersion = c, this.version = o;
73
+ }
74
+ walk(t) {
75
+ return d(this, t);
76
+ }
77
+ }
78
+ Object.defineProperty(r, "defaultStaticOptions", {
79
+ enumerable: !0,
80
+ configurable: !0,
81
+ writable: !0,
82
+ value: {
83
+ docsOrigin: "https://oxlib.sh",
84
+ showVersion: !1,
85
+ version: `ox@${f()}`
86
+ }
87
+ });
88
+ r.setStaticOptions(r.defaultStaticOptions);
89
+ function d(s, t) {
90
+ return t != null && t(s) ? s : s && typeof s == "object" && "cause" in s && s.cause ? d(s.cause, t) : t ? null : s;
30
91
  }
31
92
  export {
32
- n as toRpc
93
+ r as BaseError
33
94
  };
package/dist/index274.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0x82ad56cb";exports.aggregate3Signature=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index272.cjs");function n(t,e){if(i.size(t)>e)throw new i.SizeOverflowError({givenSize:i.size(t),maxSize:e})}function o(t,e){if(typeof e=="number"&&e>0&&e>i.size(t)-1)throw new i.SliceOffsetOutOfBoundsError({offset:e,position:"start",size:i.size(t)})}function z(t,e,r){if(typeof e=="number"&&typeof r=="number"&&i.size(t)!==r-e)throw new i.SliceOffsetOutOfBoundsError({offset:r,position:"end",size:i.size(t)})}function a(t,e={}){const{dir:r,size:s=32}=e;if(s===0)return t;const f=t.replace("0x","");if(f.length>s*2)throw new i.SizeExceedsPaddingSizeError({size:Math.ceil(f.length/2),targetSize:s,type:"Hex"});return`0x${f[r==="right"?"padEnd":"padStart"](s*2,"0")}`}exports.assertEndOffset=z;exports.assertSize=n;exports.assertStartOffset=o;exports.pad=a;
package/dist/index274.js CHANGED
@@ -1,4 +1,43 @@
1
- const a = "0x82ad56cb";
1
+ import { size as i, SliceOffsetOutOfBoundsError as f, SizeExceedsPaddingSizeError as s, SizeOverflowError as p } from "./index272.js";
2
+ function c(t, e) {
3
+ if (i(t) > e)
4
+ throw new p({
5
+ givenSize: i(t),
6
+ maxSize: e
7
+ });
8
+ }
9
+ function S(t, e) {
10
+ if (typeof e == "number" && e > 0 && e > i(t) - 1)
11
+ throw new f({
12
+ offset: e,
13
+ position: "start",
14
+ size: i(t)
15
+ });
16
+ }
17
+ function d(t, e, r) {
18
+ if (typeof e == "number" && typeof r == "number" && i(t) !== r - e)
19
+ throw new f({
20
+ offset: r,
21
+ position: "end",
22
+ size: i(t)
23
+ });
24
+ }
25
+ function u(t, e = {}) {
26
+ const { dir: r, size: n = 32 } = e;
27
+ if (n === 0)
28
+ return t;
29
+ const o = t.replace("0x", "");
30
+ if (o.length > n * 2)
31
+ throw new s({
32
+ size: Math.ceil(o.length / 2),
33
+ targetSize: n,
34
+ type: "Hex"
35
+ });
36
+ return `0x${o[r === "right" ? "padEnd" : "padStart"](n * 2, "0")}`;
37
+ }
2
38
  export {
3
- a as aggregate3Signature
39
+ d as assertEndOffset,
40
+ c as assertSize,
41
+ S as assertStartOffset,
42
+ u as pad
4
43
  };
package/dist/index275.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index78.cjs"),a=require("./index201.cjs"),f=require("./index198.cjs"),S=require("./index79.cjs"),c=require("./index81.cjs");function d(r){if(!(!r||r.length===0))return r.reduce((t,{slot:e,value:n})=>{if(e.length!==66)throw new a.InvalidBytesLengthError({size:e.length,targetSize:66,type:"hex"});if(n.length!==66)throw new a.InvalidBytesLengthError({size:n.length,targetSize:66,type:"hex"});return t[e]=n,t},{})}function u(r){const{balance:t,nonce:e,state:n,stateDiff:s,code:o}=r,i={};if(o!==void 0&&(i.code=o),t!==void 0&&(i.balance=c.numberToHex(t)),e!==void 0&&(i.nonce=c.numberToHex(e)),n!==void 0&&(i.state=d(n)),s!==void 0){if(i.state)throw new f.StateAssignmentConflictError;i.stateDiff=d(s)}return i}function h(r){if(!r)return;const t={};for(const{address:e,...n}of r){if(!S.isAddress(e,{strict:!1}))throw new l.InvalidAddressError({address:e});if(t[e])throw new f.AccountStateConflictError({address:e});t[e]=u(n)}return t}exports.serializeAccountStateOverride=u;exports.serializeStateMapping=d;exports.serializeStateOverride=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n="#__bigint";function e(i,f,r){return JSON.stringify(i,(g,t)=>typeof t=="bigint"?t.toString()+n:t,r)}exports.stringify=e;
package/dist/index275.js CHANGED
@@ -1,50 +1,7 @@
1
- import { InvalidAddressError as a } from "./index78.js";
2
- import { InvalidBytesLengthError as d } from "./index201.js";
3
- import { AccountStateConflictError as u, StateAssignmentConflictError as h } from "./index198.js";
4
- import { isAddress as l } from "./index79.js";
5
- import { numberToHex as c } from "./index81.js";
6
- function s(r) {
7
- if (!(!r || r.length === 0))
8
- return r.reduce((t, { slot: e, value: n }) => {
9
- if (e.length !== 66)
10
- throw new d({
11
- size: e.length,
12
- targetSize: 66,
13
- type: "hex"
14
- });
15
- if (n.length !== 66)
16
- throw new d({
17
- size: n.length,
18
- targetSize: 66,
19
- type: "hex"
20
- });
21
- return t[e] = n, t;
22
- }, {});
23
- }
24
- function m(r) {
25
- const { balance: t, nonce: e, state: n, stateDiff: o, code: f } = r, i = {};
26
- if (f !== void 0 && (i.code = f), t !== void 0 && (i.balance = c(t)), e !== void 0 && (i.nonce = c(e)), n !== void 0 && (i.state = s(n)), o !== void 0) {
27
- if (i.state)
28
- throw new h();
29
- i.stateDiff = s(o);
30
- }
31
- return i;
32
- }
33
- function A(r) {
34
- if (!r)
35
- return;
36
- const t = {};
37
- for (const { address: e, ...n } of r) {
38
- if (!l(e, { strict: !1 }))
39
- throw new a({ address: e });
40
- if (t[e])
41
- throw new u({ address: e });
42
- t[e] = m(n);
43
- }
44
- return t;
1
+ const r = "#__bigint";
2
+ function g(i, f, n) {
3
+ return JSON.stringify(i, (e, t) => typeof t == "bigint" ? t.toString() + r : t, n);
45
4
  }
46
5
  export {
47
- m as serializeAccountStateOverride,
48
- s as serializeStateMapping,
49
- A as serializeStateOverride
6
+ g as stringify
50
7
  };
package/dist/index276.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index289.cjs"),c=require("./index290.cjs"),o=require("./index291.cjs");function a(t){const n=c.parseStructs(t),r=[],i=t.length;for(let e=0;e<i;e++){const s=t[e];u.isStructSignature(s)||r.push(o.parseSignature(s,n))}return r}exports.parseAbi=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index102.cjs"),s=require("./index356.cjs");async function i(e){const{authorization:r,signature:t}=e;return o.recoverAddress({hash:s.hashAuthorization(r),signature:t??r})}exports.recoverAuthorizationAddress=i;
package/dist/index276.js CHANGED
@@ -1,14 +1,12 @@
1
- import { isStructSignature as c } from "./index289.js";
2
- import { parseStructs as s } from "./index290.js";
3
- import { parseSignature as p } from "./index291.js";
4
- function a(t) {
5
- const i = s(t), o = [], e = t.length;
6
- for (let r = 0; r < e; r++) {
7
- const n = t[r];
8
- c(n) || o.push(p(n, i));
9
- }
10
- return o;
1
+ import { recoverAddress as i } from "./index102.js";
2
+ import { hashAuthorization as e } from "./index356.js";
3
+ async function a(o) {
4
+ const { authorization: r, signature: t } = o;
5
+ return i({
6
+ hash: e(r),
7
+ signature: t ?? r
8
+ });
11
9
  }
12
10
  export {
13
- a as parseAbi
11
+ a as recoverAuthorizationAddress
14
12
  };
package/dist/index277.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index278.cjs"),o=require("./index279.cjs"),$=require("./index280.cjs"),p=new TextEncoder,h=Array.from({length:256},(e,r)=>r.toString(16).padStart(2,"0"));function x(e,r={}){const{strict:t=!1}=r;if(!e)throw new l(e);if(typeof e!="string")throw new l(e);if(t&&!/^0x[0-9a-fA-F]*$/.test(e))throw new d(e);if(!e.startsWith("0x"))throw new d(e)}function z(...e){return`0x${e.reduce((r,t)=>r+t.replace("0x",""),"")}`}function O(e){return e instanceof Uint8Array?c(e):Array.isArray(e)?c(new Uint8Array(e)):e}function S(e,r={}){const t=`0x${Number(e)}`;return typeof r.size=="number"?(o.assertSize(t,r.size),g(t,r.size)):t}function c(e,r={}){let t="";for(let s=0;s<e.length;s++)t+=h[e[s]];const n=`0x${t}`;return typeof r.size=="number"?(o.assertSize(n,r.size),m(n,r.size)):n}function w(e,r={}){const{signed:t,size:n}=r,s=BigInt(e);let i;n?t?i=(1n<<BigInt(n)*8n-1n)-1n:i=2n**(BigInt(n)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));const u=typeof i=="bigint"&&t?-i-1n:0;if(i&&s>i||s<u){const f=typeof e=="bigint"?"n":"";throw new E({max:i?`${i}${f}`:void 0,min:`${u}${f}`,signed:t,size:n,value:`${e}${f}`})}const b=`0x${(t&&s<0?BigInt.asUintN(n*8,BigInt(s)):s).toString(16)}`;return n?g(b,n):b}function B(e,r={}){return c(p.encode(e),r)}function g(e,r){return o.pad(e,{dir:"left",size:r})}function m(e,r){return o.pad(e,{dir:"right",size:r})}function I(e,r,t,n={}){const{strict:s}=n;o.assertStartOffset(e,r);const i=`0x${e.replace("0x","").slice((r??0)*2,(t??e.length)*2)}`;return s&&o.assertEndOffset(i,r,t),i}function H(e){return Math.ceil((e.length-2)/2)}function y(e,r={}){const{signed:t}=r;r.size&&o.assertSize(e,r.size);const n=BigInt(e);if(!t)return n;const s=(e.length-2)/2,i=(1n<<BigInt(s)*8n)-1n,u=i>>1n;return n<=u?n:n-i-1n}function N(e,r={}){const{signed:t,size:n}=r;return Number(!t&&!n?e:y(e,r))}function A(e,r={}){const{strict:t=!1}=r;try{return x(e,{strict:t}),!0}catch{return!1}}class E extends a.BaseError{constructor({max:r,min:t,signed:n,size:s,value:i}){super(`Number \`${i}\` is not in safe${s?` ${s*8}-bit`:""}${n?" signed":" unsigned"} integer range ${r?`(\`${t}\` to \`${r}\`)`:`(above \`${t}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class l extends a.BaseError{constructor(r){super(`Value \`${typeof r=="object"?$.stringify(r):r}\` of type \`${typeof r}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class d extends a.BaseError{constructor(r){super(`Value \`${r}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class P extends a.BaseError{constructor({givenSize:r,maxSize:t}){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${r}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class v extends a.BaseError{constructor({offset:r,position:t,size:n}){super(`Slice ${t==="start"?"starting":"ending"} at offset \`${r}\` is out-of-bounds (size: \`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class V extends a.BaseError{constructor({size:r,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${r}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}exports.IntegerOutOfRangeError=E;exports.InvalidHexTypeError=l;exports.InvalidHexValueError=d;exports.SizeExceedsPaddingSizeError=V;exports.SizeOverflowError=P;exports.SliceOffsetOutOfBoundsError=v;exports.assert=x;exports.concat=z;exports.from=O;exports.fromBoolean=S;exports.fromBytes=c;exports.fromNumber=w;exports.fromString=B;exports.padLeft=g;exports.padRight=m;exports.size=H;exports.slice=I;exports.toBigInt=y;exports.toNumber=N;exports.validate=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index272.cjs"),a=require("./index359.cjs");function i(t){return{...typeof t.baseFeePerGas=="bigint"&&{baseFeePerGas:e.fromNumber(t.baseFeePerGas)},...typeof t.blobBaseFee=="bigint"&&{blobBaseFee:e.fromNumber(t.blobBaseFee)},...typeof t.feeRecipient=="string"&&{feeRecipient:t.feeRecipient},...typeof t.gasLimit=="bigint"&&{gasLimit:e.fromNumber(t.gasLimit)},...typeof t.number=="bigint"&&{number:e.fromNumber(t.number)},...typeof t.prevRandao=="bigint"&&{prevRandao:e.fromNumber(t.prevRandao)},...typeof t.time=="bigint"&&{time:e.fromNumber(t.time)},...t.withdrawals&&{withdrawals:t.withdrawals.map(a.toRpc)}}}exports.toRpc=i;