@gardenfi/utils 2.1.3-beta.2 → 2.1.3-beta.21

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 (233) hide show
  1. package/dist/index104.cjs +1 -1
  2. package/dist/index104.js +1 -1
  3. package/dist/index107.cjs +1 -1
  4. package/dist/index107.js +75 -46
  5. package/dist/index108.cjs +1 -1
  6. package/dist/index108.js +4 -4
  7. package/dist/index110.cjs +1 -1
  8. package/dist/index110.js +1 -1
  9. package/dist/index111.cjs +1 -1
  10. package/dist/index111.js +1 -1
  11. package/dist/index112.cjs +1 -1
  12. package/dist/index112.js +1 -1
  13. package/dist/index113.cjs +1 -1
  14. package/dist/index113.js +1 -1
  15. package/dist/index125.cjs +1 -1
  16. package/dist/index125.js +1 -1
  17. package/dist/index166.cjs +1 -1
  18. package/dist/index166.js +36 -34
  19. package/dist/index192.cjs +1 -1
  20. package/dist/index192.js +27 -25
  21. package/dist/index203.cjs +1 -1
  22. package/dist/index203.js +16 -16
  23. package/dist/index22.cjs +1 -1
  24. package/dist/index22.js +6 -6
  25. package/dist/index222.cjs +1 -1
  26. package/dist/index222.js +2 -2
  27. package/dist/index225.cjs +1 -1
  28. package/dist/index225.js +43 -43
  29. package/dist/index226.cjs +1 -1
  30. package/dist/index226.js +3 -113
  31. package/dist/index228.cjs +1 -1
  32. package/dist/index228.js +14 -14
  33. package/dist/index230.cjs +1 -1
  34. package/dist/index230.js +10 -25
  35. package/dist/index231.cjs +1 -1
  36. package/dist/index231.js +16 -13
  37. package/dist/index232.cjs +1 -1
  38. package/dist/index232.js +21 -14
  39. package/dist/index233.cjs +1 -1
  40. package/dist/index233.js +30 -5
  41. package/dist/index234.cjs +1 -1
  42. package/dist/index234.js +2 -14
  43. package/dist/index235.cjs +1 -1
  44. package/dist/index235.js +12 -9
  45. package/dist/index236.cjs +1 -1
  46. package/dist/index236.js +12 -16
  47. package/dist/index237.cjs +1 -1
  48. package/dist/index237.js +47 -10
  49. package/dist/index238.cjs +1 -1
  50. package/dist/index238.js +10 -15
  51. package/dist/index239.cjs +1 -1
  52. package/dist/index239.js +7 -22
  53. package/dist/index240.cjs +1 -1
  54. package/dist/index240.js +9 -30
  55. package/dist/index241.cjs +1 -1
  56. package/dist/index241.js +14 -2
  57. package/dist/index242.cjs +1 -1
  58. package/dist/index242.js +14 -13
  59. package/dist/index243.cjs +1 -1
  60. package/dist/index243.js +9 -12
  61. package/dist/index244.cjs +1 -1
  62. package/dist/index244.js +24 -47
  63. package/dist/index245.cjs +1 -1
  64. package/dist/index245.js +12 -11
  65. package/dist/index246.cjs +1 -1
  66. package/dist/index246.js +24 -7
  67. package/dist/index247.cjs +1 -1
  68. package/dist/index247.js +12 -8
  69. package/dist/index248.cjs +1 -1
  70. package/dist/index248.js +15 -13
  71. package/dist/index249.cjs +2 -1
  72. package/dist/index249.js +21 -11
  73. package/dist/index250.cjs +1 -1
  74. package/dist/index250.js +52 -9
  75. package/dist/index251.cjs +1 -1
  76. package/dist/index251.js +25 -24
  77. package/dist/index252.cjs +1 -1
  78. package/dist/index252.js +13 -12
  79. package/dist/index253.cjs +1 -1
  80. package/dist/index253.js +15 -24
  81. package/dist/index254.cjs +1 -2
  82. package/dist/index254.js +5 -24
  83. package/dist/index255.cjs +1 -1
  84. package/dist/index255.js +12 -12
  85. package/dist/index256.cjs +1 -1
  86. package/dist/index256.js +10 -15
  87. package/dist/index257.cjs +1 -1
  88. package/dist/index257.js +16 -52
  89. package/dist/index266.cjs +1 -1
  90. package/dist/index266.js +1 -1
  91. package/dist/index277.cjs +1 -1
  92. package/dist/index277.js +103 -16
  93. package/dist/index278.cjs +1 -1
  94. package/dist/index278.js +5 -222
  95. package/dist/index279.cjs +1 -1
  96. package/dist/index279.js +224 -6
  97. package/dist/index28.cjs +1 -1
  98. package/dist/index28.js +2 -2
  99. package/dist/index280.cjs +1 -1
  100. package/dist/index280.js +7 -7
  101. package/dist/index281.cjs +1 -1
  102. package/dist/index281.js +7 -27
  103. package/dist/index282.cjs +1 -1
  104. package/dist/index282.js +26 -34
  105. package/dist/index283.cjs +1 -1
  106. package/dist/index283.js +13 -12
  107. package/dist/index284.cjs +1 -1
  108. package/dist/index284.js +124 -48
  109. package/dist/index285.cjs +1 -1
  110. package/dist/index285.js +3 -67
  111. package/dist/index286.cjs +1 -1
  112. package/dist/index286.js +137 -37
  113. package/dist/index287.cjs +1 -1
  114. package/dist/index287.js +156 -2
  115. package/dist/index288.cjs +1 -1
  116. package/dist/index288.js +8 -205
  117. package/dist/index289.cjs +1 -1
  118. package/dist/index289.js +113 -3
  119. package/dist/index290.cjs +2 -1
  120. package/dist/index290.js +122 -128
  121. package/dist/index291.cjs +1 -1
  122. package/dist/index291.js +137 -153
  123. package/dist/index292.cjs +1 -1
  124. package/dist/index292.js +42 -9
  125. package/dist/index293.cjs +1 -1
  126. package/dist/index293.js +72 -107
  127. package/dist/index294.cjs +1 -2
  128. package/dist/index294.js +2 -135
  129. package/dist/index295.cjs +1 -1
  130. package/dist/index295.js +68 -11
  131. package/dist/index296.cjs +1 -1
  132. package/dist/index296.js +696 -17
  133. package/dist/index297.cjs +1 -1
  134. package/dist/index297.js +200 -67
  135. package/dist/index298.cjs +2 -1
  136. package/dist/index298.js +63 -639
  137. package/dist/index299.cjs +1 -1
  138. package/dist/index299.js +4 -172
  139. package/dist/index30.cjs +1 -1
  140. package/dist/index30.js +1 -1
  141. package/dist/index300.cjs +1 -2
  142. package/dist/index300.js +39 -65
  143. package/dist/index301.cjs +1 -1
  144. package/dist/index301.js +7 -4
  145. package/dist/index302.cjs +1 -1
  146. package/dist/index302.js +60 -38
  147. package/dist/index303.cjs +1 -1
  148. package/dist/index303.js +77 -7
  149. package/dist/index304.cjs +1 -1
  150. package/dist/index304.js +4 -63
  151. package/dist/index305.cjs +1 -1
  152. package/dist/index305.js +181 -64
  153. package/dist/index306.cjs +1 -1
  154. package/dist/index306.js +12 -4
  155. package/dist/index307.cjs +1 -1
  156. package/dist/index307.js +19 -194
  157. package/dist/index308.cjs +1 -1
  158. package/dist/index308.js +3 -3
  159. package/dist/index310.cjs +1 -1
  160. package/dist/index310.js +1 -1
  161. package/dist/index311.cjs +1 -1
  162. package/dist/index311.js +5 -105
  163. package/dist/index312.cjs +1 -1
  164. package/dist/index312.js +2 -5
  165. package/dist/index313.cjs +1 -1
  166. package/dist/index313.js +22 -2
  167. package/dist/index35.cjs +1 -1
  168. package/dist/index35.js +41 -41
  169. package/dist/index36.cjs +1 -1
  170. package/dist/index36.js +1 -1
  171. package/dist/index39.cjs +1 -1
  172. package/dist/index39.js +29 -24
  173. package/dist/index43.cjs +1 -1
  174. package/dist/index43.js +40 -21
  175. package/dist/index44.cjs +1 -1
  176. package/dist/index44.js +24 -24
  177. package/dist/index53.cjs +1 -1
  178. package/dist/index53.js +2 -2
  179. package/dist/index54.cjs +1 -1
  180. package/dist/index54.js +1 -1
  181. package/dist/index55.cjs +1 -1
  182. package/dist/index55.js +2 -2
  183. package/dist/index56.cjs +1 -1
  184. package/dist/index56.js +1 -1
  185. package/dist/index57.cjs +1 -1
  186. package/dist/index57.js +2 -2
  187. package/dist/index58.cjs +1 -1
  188. package/dist/index58.js +98 -97
  189. package/dist/index59.cjs +1 -1
  190. package/dist/index59.js +2 -2
  191. package/dist/index60.cjs +1 -1
  192. package/dist/index60.js +1 -1
  193. package/dist/index61.cjs +1 -1
  194. package/dist/index61.js +1 -1
  195. package/dist/index62.cjs +1 -1
  196. package/dist/index62.js +1 -1
  197. package/dist/index64.cjs +1 -1
  198. package/dist/index64.js +4 -4
  199. package/dist/index73.cjs +1 -1
  200. package/dist/index73.js +1 -1
  201. package/dist/index74.cjs +1 -1
  202. package/dist/index74.js +1 -1
  203. package/dist/index79.cjs +1 -1
  204. package/dist/index79.js +1 -1
  205. package/dist/index84.cjs +1 -1
  206. package/dist/index84.js +53 -51
  207. package/dist/index85.cjs +1 -1
  208. package/dist/index85.js +56 -55
  209. package/dist/index86.cjs +1 -1
  210. package/dist/index86.js +55 -59
  211. package/dist/index88.cjs +1 -1
  212. package/dist/index88.js +1 -1
  213. package/dist/index89.cjs +1 -1
  214. package/dist/index89.js +1 -1
  215. package/dist/index90.cjs +1 -1
  216. package/dist/index90.js +44 -42
  217. package/dist/index91.cjs +1 -1
  218. package/dist/index91.js +41 -41
  219. package/dist/index92.cjs +1 -1
  220. package/dist/index92.js +35 -34
  221. package/dist/index93.cjs +1 -1
  222. package/dist/index93.js +28 -28
  223. package/dist/index94.cjs +1 -1
  224. package/dist/index94.js +26 -26
  225. package/dist/index95.cjs +1 -1
  226. package/dist/index95.js +1 -1
  227. package/package.json +1 -1
  228. package/dist/index314.cjs +0 -1
  229. package/dist/index314.js +0 -22
  230. package/dist/index315.cjs +0 -1
  231. package/dist/index315.js +0 -74
  232. package/dist/index316.cjs +0 -1
  233. package/dist/index316.js +0 -24
package/dist/index311.js CHANGED
@@ -1,107 +1,7 @@
1
- import { split as L, rotlSH as T, rotlSL as S, rotlBH as m, rotlBL as F } from "./index314.js";
2
- import { createHasher as X, Hash as E, anumber as d, u32 as U, swap32IfBE as I, aexists as x, toBytes as P, abytes as k, aoutput as M, clean as y } from "./index315.js";
3
- const R = BigInt(0), f = BigInt(1), j = BigInt(2), q = BigInt(7), v = BigInt(256), z = BigInt(113), _ = [], g = [], B = [];
4
- for (let n = 0, t = f, s = 1, i = 0; n < 24; n++) {
5
- [s, i] = [i, (2 * s + 3 * i) % 5], _.push(2 * (5 * i + s)), g.push((n + 1) * (n + 2) / 2 % 64);
6
- let o = R;
7
- for (let r = 0; r < 7; r++)
8
- t = (t << f ^ (t >> q) * z) % v, t & j && (o ^= f << (f << /* @__PURE__ */ BigInt(r)) - f);
9
- B.push(o);
10
- }
11
- const A = L(B, !0), C = A[0], D = A[1], O = (n, t, s) => s > 32 ? m(n, t, s) : T(n, t, s), w = (n, t, s) => s > 32 ? F(n, t, s) : S(n, t, s);
12
- function G(n, t = 24) {
13
- const s = new Uint32Array(10);
14
- for (let i = 24 - t; i < 24; i++) {
15
- for (let e = 0; e < 10; e++)
16
- s[e] = n[e] ^ n[e + 10] ^ n[e + 20] ^ n[e + 30] ^ n[e + 40];
17
- for (let e = 0; e < 10; e += 2) {
18
- const h = (e + 8) % 10, l = (e + 2) % 10, u = s[l], c = s[l + 1], b = O(u, c, 1) ^ s[h], H = w(u, c, 1) ^ s[h + 1];
19
- for (let a = 0; a < 50; a += 10)
20
- n[e + a] ^= b, n[e + a + 1] ^= H;
21
- }
22
- let o = n[2], r = n[3];
23
- for (let e = 0; e < 24; e++) {
24
- const h = g[e], l = O(o, r, h), u = w(o, r, h), c = _[e];
25
- o = n[c], r = n[c + 1], n[c] = l, n[c + 1] = u;
26
- }
27
- for (let e = 0; e < 50; e += 10) {
28
- for (let h = 0; h < 10; h++)
29
- s[h] = n[e + h];
30
- for (let h = 0; h < 10; h++)
31
- n[e + h] ^= ~s[(h + 2) % 10] & s[(h + 4) % 10];
32
- }
33
- n[0] ^= C[i], n[1] ^= D[i];
34
- }
35
- y(s);
36
- }
37
- class p extends E {
38
- // NOTE: we accept arguments in bytes instead of bits here.
39
- constructor(t, s, i, o = !1, r = 24) {
40
- if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = t, this.suffix = s, this.outputLen = i, this.enableXOF = o, this.rounds = r, d(i), !(0 < t && t < 200))
41
- throw new Error("only keccak-f1600 function is supported");
42
- this.state = new Uint8Array(200), this.state32 = U(this.state);
43
- }
44
- clone() {
45
- return this._cloneInto();
46
- }
47
- keccak() {
48
- I(this.state32), G(this.state32, this.rounds), I(this.state32), this.posOut = 0, this.pos = 0;
49
- }
50
- update(t) {
51
- x(this), t = P(t), k(t);
52
- const { blockLen: s, state: i } = this, o = t.length;
53
- for (let r = 0; r < o; ) {
54
- const e = Math.min(s - this.pos, o - r);
55
- for (let h = 0; h < e; h++)
56
- i[this.pos++] ^= t[r++];
57
- this.pos === s && this.keccak();
58
- }
59
- return this;
60
- }
61
- finish() {
62
- if (this.finished)
63
- return;
64
- this.finished = !0;
65
- const { state: t, suffix: s, pos: i, blockLen: o } = this;
66
- t[i] ^= s, s & 128 && i === o - 1 && this.keccak(), t[o - 1] ^= 128, this.keccak();
67
- }
68
- writeInto(t) {
69
- x(this, !1), k(t), this.finish();
70
- const s = this.state, { blockLen: i } = this;
71
- for (let o = 0, r = t.length; o < r; ) {
72
- this.posOut >= i && this.keccak();
73
- const e = Math.min(i - this.posOut, r - o);
74
- t.set(s.subarray(this.posOut, this.posOut + e), o), this.posOut += e, o += e;
75
- }
76
- return t;
77
- }
78
- xofInto(t) {
79
- if (!this.enableXOF)
80
- throw new Error("XOF is not possible for this instance");
81
- return this.writeInto(t);
82
- }
83
- xof(t) {
84
- return d(t), this.xofInto(new Uint8Array(t));
85
- }
86
- digestInto(t) {
87
- if (M(t, this), this.finished)
88
- throw new Error("digest() was already called");
89
- return this.writeInto(t), this.destroy(), t;
90
- }
91
- digest() {
92
- return this.digestInto(new Uint8Array(this.outputLen));
93
- }
94
- destroy() {
95
- this.destroyed = !0, y(this.state);
96
- }
97
- _cloneInto(t) {
98
- const { blockLen: s, suffix: i, outputLen: o, rounds: r, enableXOF: e } = this;
99
- return t || (t = new p(s, i, o, e, r)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = r, t.suffix = i, t.outputLen = o, t.enableXOF = e, t.destroyed = this.destroyed, t;
100
- }
101
- }
102
- const J = (n, t, s) => X(() => new p(t, n, s)), Q = J(1, 136, 256 / 8);
1
+ import { LruMap as c } from "./index313.js";
2
+ const e = {
3
+ checksum: /* @__PURE__ */ new c(8192)
4
+ }, m = e.checksum;
103
5
  export {
104
- p as Keccak,
105
- G as keccakP,
106
- Q as keccak_256
6
+ m as checksum
107
7
  };
package/dist/index312.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index316.cjs"),e={checksum:new c.LruMap(8192)},s=e.checksum;exports.checksum=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.1.1";exports.version=e;
package/dist/index312.js CHANGED
@@ -1,7 +1,4 @@
1
- import { LruMap as c } from "./index316.js";
2
- const e = {
3
- checksum: /* @__PURE__ */ new c(8192)
4
- }, m = e.checksum;
1
+ const o = "0.1.1";
5
2
  export {
6
- m as checksum
3
+ o as version
7
4
  };
package/dist/index313.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.1.1";exports.version=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class i extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&t!==void 0&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const s=this.keys().next().value;s&&this.delete(s)}return this}}exports.LruMap=i;
package/dist/index313.js CHANGED
@@ -1,4 +1,24 @@
1
- const o = "0.1.1";
1
+ class r extends Map {
2
+ constructor(e) {
3
+ super(), Object.defineProperty(this, "maxSize", {
4
+ enumerable: !0,
5
+ configurable: !0,
6
+ writable: !0,
7
+ value: void 0
8
+ }), this.maxSize = e;
9
+ }
10
+ get(e) {
11
+ const t = super.get(e);
12
+ return super.has(e) && t !== void 0 && (this.delete(e), super.set(e, t)), t;
13
+ }
14
+ set(e, t) {
15
+ if (super.set(e, t), this.maxSize && this.size > this.maxSize) {
16
+ const s = this.keys().next().value;
17
+ s && this.delete(s);
18
+ }
19
+ return this;
20
+ }
21
+ }
2
22
  export {
3
- o as version
23
+ r as LruMap
4
24
  };
package/dist/index35.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./index122.cjs"),M=require("./index138.cjs"),P=require("./index166.cjs"),_=require("./index176.cjs"),I=require("./index157.cjs"),p=require("./index29.cjs"),A=require("./index39.cjs"),O=require("./index40.cjs"),S=require("./index42.cjs"),$=require("./index30.cjs"),j=require("./index69.cjs"),z=require("./index32.cjs"),R=require("./index75.cjs"),U=require("./index87.cjs");function G(e,D){const{abi:v,address:l,args:u,batch:C=!0,eventName:c,fromBlock:g,onError:f,onLogs:k,poll:L,pollingInterval:h=e.pollingInterval,strict:d}=D;return(typeof L<"u"?L:typeof g=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"))?(()=>{const b=d??!1,q=S.stringify(["watchContractEvent",l,u,C,e.uid,c,h,b,g]);return A.observe(q,{onLogs:k,onError:f},o=>{let s;g!==void 0&&(s=g-1n);let n,a=!1;const w=O.poll(async()=>{var E;if(!a){try{n=await p.getAction(e,$.createContractEventFilter,"createContractEventFilter")({abi:v,address:l,args:u,eventName:c,strict:b,fromBlock:g})}catch{}a=!0;return}try{let t;if(n)t=await p.getAction(e,R.getFilterChanges,"getFilterChanges")({filter:n});else{const r=await p.getAction(e,j.getBlockNumber,"getBlockNumber")({});s&&s<r?t=await p.getAction(e,z.getContractEvents,"getContractEvents")({abi:v,address:l,args:u,eventName:c,fromBlock:s+1n,toBlock:r,strict:b}):t=[],s=r}if(t.length===0)return;if(C)o.onLogs(t);else for(const r of t)o.onLogs([r])}catch(t){n&&t instanceof M.InvalidInputRpcError&&(a=!1),(E=o.onError)==null||E.call(o,t)}},{emitOnBegin:!0,interval:h});return async()=>{n&&await p.getAction(e,U.uninstallFilter,"uninstallFilter")({filter:n}),w()}})})():(()=>{const b=d??!1,q=S.stringify(["watchContractEvent",l,u,C,e.uid,c,h,b]);let o=!0,s=()=>o=!1;return A.observe(q,{onLogs:k,onError:f},n=>((async()=>{try{const a=(()=>{if(e.transport.type==="fallback"){const t=e.transport.transports.find(r=>r.config.type==="webSocket");return t?t.value:e.transport}return e.transport})(),w=c?_.encodeEventTopics({abi:v,eventName:c,args:u}):[],{unsubscribe:E}=await a.subscribe({params:["logs",{address:l,topics:w}],onData(t){var N;if(!o)return;const r=t.result;try{const{eventName:i,args:y}=P.decodeEventLog({abi:v,data:r.data,topics:r.topics,strict:d}),m=I.formatLog(r,{args:y,eventName:i});n.onLogs([m])}catch(i){let y,m;if(i instanceof B.DecodeLogDataMismatch||i instanceof B.DecodeLogTopicsMismatch){if(d)return;y=i.abiItem.name,m=(N=i.abiItem.inputs)==null?void 0:N.some(F=>!("name"in F&&F.name))}const T=I.formatLog(r,{args:m?[]:{},eventName:y});n.onLogs([T])}},onError(t){var r;(r=n.onError)==null||r.call(n,t)}});s=E,o||s()}catch(a){f==null||f(a)}})(),()=>s()))})()}exports.watchContractEvent=G;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./index122.cjs"),M=require("./index138.cjs"),P=require("./index166.cjs"),_=require("./index176.cjs"),I=require("./index157.cjs"),b=require("./index29.cjs"),A=require("./index39.cjs"),O=require("./index40.cjs"),S=require("./index42.cjs"),$=require("./index30.cjs"),j=require("./index69.cjs"),z=require("./index32.cjs"),R=require("./index75.cjs"),U=require("./index87.cjs");function G(t,D){const{abi:v,address:l,args:u,batch:C=!0,eventName:c,fromBlock:g,onError:f,onLogs:k,poll:L,pollingInterval:h=t.pollingInterval,strict:d}=D;return(typeof L<"u"?L:typeof g=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].config.type==="webSocket"||t.transport.transports[0].config.type==="ipc")))?(()=>{const p=d??!1,q=S.stringify(["watchContractEvent",l,u,C,t.uid,c,h,p,g]);return A.observe(q,{onLogs:k,onError:f},o=>{let s;g!==void 0&&(s=g-1n);let n,a=!1;const w=O.poll(async()=>{var y;if(!a){try{n=await b.getAction(t,$.createContractEventFilter,"createContractEventFilter")({abi:v,address:l,args:u,eventName:c,strict:p,fromBlock:g})}catch{}a=!0;return}try{let e;if(n)e=await b.getAction(t,R.getFilterChanges,"getFilterChanges")({filter:n});else{const r=await b.getAction(t,j.getBlockNumber,"getBlockNumber")({});s&&s<r?e=await b.getAction(t,z.getContractEvents,"getContractEvents")({abi:v,address:l,args:u,eventName:c,fromBlock:s+1n,toBlock:r,strict:p}):e=[],s=r}if(e.length===0)return;if(C)o.onLogs(e);else for(const r of e)o.onLogs([r])}catch(e){n&&e instanceof M.InvalidInputRpcError&&(a=!1),(y=o.onError)==null||y.call(o,e)}},{emitOnBegin:!0,interval:h});return async()=>{n&&await b.getAction(t,U.uninstallFilter,"uninstallFilter")({filter:n}),w()}})})():(()=>{const p=d??!1,q=S.stringify(["watchContractEvent",l,u,C,t.uid,c,h,p]);let o=!0,s=()=>o=!1;return A.observe(q,{onLogs:k,onError:f},n=>((async()=>{try{const a=(()=>{if(t.transport.type==="fallback"){const e=t.transport.transports.find(r=>r.config.type==="webSocket"||r.config.type==="ipc");return e?e.value:t.transport}return t.transport})(),w=c?_.encodeEventTopics({abi:v,eventName:c,args:u}):[],{unsubscribe:y}=await a.subscribe({params:["logs",{address:l,topics:w}],onData(e){var N;if(!o)return;const r=e.result;try{const{eventName:i,args:E}=P.decodeEventLog({abi:v,data:r.data,topics:r.topics,strict:d}),m=I.formatLog(r,{args:E,eventName:i});n.onLogs([m])}catch(i){let E,m;if(i instanceof B.DecodeLogDataMismatch||i instanceof B.DecodeLogTopicsMismatch){if(d)return;E=i.abiItem.name,m=(N=i.abiItem.inputs)==null?void 0:N.some(F=>!("name"in F&&F.name))}const T=I.formatLog(r,{args:m?[]:{},eventName:E});n.onLogs([T])}},onError(e){var r;(r=n.onError)==null||r.call(n,e)}});s=y,o||s()}catch(a){f==null||f(a)}})(),()=>s()))})()}exports.watchContractEvent=G;
package/dist/index35.js CHANGED
@@ -12,35 +12,35 @@ import { getBlockNumber as j } from "./index69.js";
12
12
  import { getContractEvents as q } from "./index32.js";
13
13
  import { getFilterChanges as x } from "./index75.js";
14
14
  import { uninstallFilter as G } from "./index87.js";
15
- function ct(r, _) {
16
- const { abi: b, address: f, args: l, batch: h = !0, eventName: c, fromBlock: p, onError: u, onLogs: N, poll: L, pollingInterval: w = r.pollingInterval, strict: v } = _;
17
- return (typeof L < "u" ? L : typeof p == "bigint" ? !0 : !(r.transport.type === "webSocket" || r.transport.type === "fallback" && r.transport.transports[0].config.type === "webSocket")) ? (() => {
15
+ function ct(t, _) {
16
+ const { abi: b, address: f, args: p, batch: h = !0, eventName: c, fromBlock: l, onError: u, onLogs: N, poll: L, pollingInterval: w = t.pollingInterval, strict: v } = _;
17
+ return (typeof L < "u" ? L : typeof l == "bigint" ? !0 : !(t.transport.type === "webSocket" || t.transport.type === "ipc" || t.transport.type === "fallback" && (t.transport.transports[0].config.type === "webSocket" || t.transport.transports[0].config.type === "ipc"))) ? (() => {
18
18
  const m = v ?? !1, C = S([
19
19
  "watchContractEvent",
20
20
  f,
21
- l,
21
+ p,
22
22
  h,
23
- r.uid,
23
+ t.uid,
24
24
  c,
25
25
  w,
26
26
  m,
27
- p
27
+ l
28
28
  ]);
29
29
  return D(C, { onLogs: N, onError: u }, (n) => {
30
30
  let a;
31
- p !== void 0 && (a = p - 1n);
31
+ l !== void 0 && (a = l - 1n);
32
32
  let e, s = !1;
33
33
  const k = R(async () => {
34
34
  var d;
35
35
  if (!s) {
36
36
  try {
37
- e = await g(r, U, "createContractEventFilter")({
37
+ e = await g(t, U, "createContractEventFilter")({
38
38
  abi: b,
39
39
  address: f,
40
- args: l,
40
+ args: p,
41
41
  eventName: c,
42
42
  strict: m,
43
- fromBlock: p
43
+ fromBlock: l
44
44
  });
45
45
  } catch {
46
46
  }
@@ -48,46 +48,46 @@ function ct(r, _) {
48
48
  return;
49
49
  }
50
50
  try {
51
- let t;
51
+ let r;
52
52
  if (e)
53
- t = await g(r, x, "getFilterChanges")({ filter: e });
53
+ r = await g(t, x, "getFilterChanges")({ filter: e });
54
54
  else {
55
- const o = await g(r, j, "getBlockNumber")({});
56
- a && a < o ? t = await g(r, q, "getContractEvents")({
55
+ const o = await g(t, j, "getBlockNumber")({});
56
+ a && a < o ? r = await g(t, q, "getContractEvents")({
57
57
  abi: b,
58
58
  address: f,
59
- args: l,
59
+ args: p,
60
60
  eventName: c,
61
61
  fromBlock: a + 1n,
62
62
  toBlock: o,
63
63
  strict: m
64
- }) : t = [], a = o;
64
+ }) : r = [], a = o;
65
65
  }
66
- if (t.length === 0)
66
+ if (r.length === 0)
67
67
  return;
68
68
  if (h)
69
- n.onLogs(t);
69
+ n.onLogs(r);
70
70
  else
71
- for (const o of t)
71
+ for (const o of r)
72
72
  n.onLogs([o]);
73
- } catch (t) {
74
- e && t instanceof z && (s = !1), (d = n.onError) == null || d.call(n, t);
73
+ } catch (r) {
74
+ e && r instanceof z && (s = !1), (d = n.onError) == null || d.call(n, r);
75
75
  }
76
76
  }, {
77
77
  emitOnBegin: !0,
78
78
  interval: w
79
79
  });
80
80
  return async () => {
81
- e && await g(r, G, "uninstallFilter")({ filter: e }), k();
81
+ e && await g(t, G, "uninstallFilter")({ filter: e }), k();
82
82
  };
83
83
  });
84
84
  })() : (() => {
85
85
  const m = v ?? !1, C = S([
86
86
  "watchContractEvent",
87
87
  f,
88
- l,
88
+ p,
89
89
  h,
90
- r.uid,
90
+ t.uid,
91
91
  c,
92
92
  w,
93
93
  m
@@ -96,50 +96,50 @@ function ct(r, _) {
96
96
  return D(C, { onLogs: N, onError: u }, (e) => ((async () => {
97
97
  try {
98
98
  const s = (() => {
99
- if (r.transport.type === "fallback") {
100
- const t = r.transport.transports.find((o) => o.config.type === "webSocket");
101
- return t ? t.value : r.transport;
99
+ if (t.transport.type === "fallback") {
100
+ const r = t.transport.transports.find((o) => o.config.type === "webSocket" || o.config.type === "ipc");
101
+ return r ? r.value : t.transport;
102
102
  }
103
- return r.transport;
103
+ return t.transport;
104
104
  })(), k = c ? O({
105
105
  abi: b,
106
106
  eventName: c,
107
- args: l
107
+ args: p
108
108
  }) : [], { unsubscribe: d } = await s.subscribe({
109
109
  params: ["logs", { address: f, topics: k }],
110
- onData(t) {
110
+ onData(r) {
111
111
  var I;
112
112
  if (!n)
113
113
  return;
114
- const o = t.result;
114
+ const o = r.result;
115
115
  try {
116
- const { eventName: i, args: E } = A({
116
+ const { eventName: i, args: y } = A({
117
117
  abi: b,
118
118
  data: o.data,
119
119
  topics: o.topics,
120
120
  strict: v
121
- }), y = F(o, {
122
- args: E,
121
+ }), E = F(o, {
122
+ args: y,
123
123
  eventName: i
124
124
  });
125
- e.onLogs([y]);
125
+ e.onLogs([E]);
126
126
  } catch (i) {
127
- let E, y;
127
+ let y, E;
128
128
  if (i instanceof P || i instanceof T) {
129
129
  if (v)
130
130
  return;
131
- E = i.abiItem.name, y = (I = i.abiItem.inputs) == null ? void 0 : I.some((B) => !("name" in B && B.name));
131
+ y = i.abiItem.name, E = (I = i.abiItem.inputs) == null ? void 0 : I.some((B) => !("name" in B && B.name));
132
132
  }
133
133
  const M = F(o, {
134
- args: y ? [] : {},
135
- eventName: E
134
+ args: E ? [] : {},
135
+ eventName: y
136
136
  });
137
137
  e.onLogs([M]);
138
138
  }
139
139
  },
140
- onError(t) {
140
+ onError(r) {
141
141
  var o;
142
- (o = e.onError) == null || o.call(e, t);
142
+ (o = e.onError) == null || o.call(e, r);
143
143
  }
144
144
  });
145
145
  a = d, n || a();
package/dist/index36.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./index45.cjs"),g=require("./index254.cjs"),q=require("./index177.cjs"),C=require("./index221.cjs"),h=require("./index29.cjs"),l=require("./index108.cjs");async function p(n,i){const{abi:c,account:r=n.account,address:o,args:e,dataSuffix:a,functionName:s,...u}=i;if(typeof r>"u")throw new g.AccountNotFoundError({docsPath:"/docs/contract/writeContract"});const t=r?w.parseAccount(r):null,d=q.encodeFunctionData({abi:c,args:e,functionName:s});try{return await h.getAction(n,l.sendTransaction,"sendTransaction")({data:`${d}${a?a.replace("0x",""):""}`,to:o,account:t,...u})}catch(f){throw C.getContractError(f,{abi:c,address:o,args:e,docsPath:"/docs/contract/writeContract",functionName:s,sender:t==null?void 0:t.address})}}exports.writeContract=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./index45.cjs"),g=require("./index249.cjs"),q=require("./index177.cjs"),C=require("./index221.cjs"),h=require("./index29.cjs"),l=require("./index108.cjs");async function p(n,i){const{abi:c,account:r=n.account,address:o,args:e,dataSuffix:a,functionName:s,...u}=i;if(typeof r>"u")throw new g.AccountNotFoundError({docsPath:"/docs/contract/writeContract"});const t=r?w.parseAccount(r):null,d=q.encodeFunctionData({abi:c,args:e,functionName:s});try{return await h.getAction(n,l.sendTransaction,"sendTransaction")({data:`${d}${a?a.replace("0x",""):""}`,to:o,account:t,...u})}catch(f){throw C.getContractError(f,{abi:c,address:o,args:e,docsPath:"/docs/contract/writeContract",functionName:s,sender:t==null?void 0:t.address})}}exports.writeContract=p;
package/dist/index36.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { parseAccount as u } from "./index45.js";
2
- import { AccountNotFoundError as p } from "./index254.js";
2
+ import { AccountNotFoundError as p } from "./index249.js";
3
3
  import { encodeFunctionData as w } from "./index177.js";
4
4
  import { getContractError as h } from "./index221.js";
5
5
  import { getAction as C } from "./index29.js";
package/dist/index39.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=new Map,r=new Map;let m=0;function w(n,u,C){const o=++m,s=()=>i.get(n)||[],y=()=>{const t=s();i.set(n,t.filter(e=>e.id!==o))},a=()=>{const t=s();if(!t.some(c=>c.id===o))return;const e=r.get(n);t.length===1&&e&&e(),y()},l=s();if(i.set(n,[...l,{id:o,fns:u}]),l&&l.length>0)return a;const f={};for(const t in u)f[t]=(...e)=>{var h,p;const c=s();if(c.length!==0)for(const b of c)(p=(h=b.fns)[t])==null||p.call(h,...e)};const g=C(f);return typeof g=="function"&&r.set(n,g),a}exports.cleanupCache=r;exports.listenersCache=i;exports.observe=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=new Map,r=new Map;let b=0;function w(s,a,C){const o=++b,c=()=>i.get(s)||[],m=()=>{const t=c();i.set(s,t.filter(n=>n.id!==o))},f=()=>{const t=c();if(!t.some(e=>e.id===o))return;const n=r.get(s);if(t.length===1&&n){const e=n();e instanceof Promise&&e.catch(()=>{})}m()},l=c();if(i.set(s,[...l,{id:o,fns:a}]),l&&l.length>0)return f;const u={};for(const t in a)u[t]=(...n)=>{var p,g;const e=c();if(e.length!==0)for(const y of e)(g=(p=y.fns)[t])==null||g.call(p,...n)};const h=C(u);return typeof h=="function"&&r.set(s,h),f}exports.cleanupCache=r;exports.listenersCache=i;exports.observe=w;
package/dist/index39.js CHANGED
@@ -1,35 +1,40 @@
1
- const l = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map();
2
- let m = 0;
3
- function y(e, f, w) {
4
- const i = ++m, s = () => l.get(e) || [], C = () => {
5
- const n = s();
6
- l.set(e, n.filter((t) => t.id !== i));
1
+ const f = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
2
+ let k = 0;
3
+ function y(s, l, m) {
4
+ const i = ++k, c = () => f.get(s) || [], w = () => {
5
+ const n = c();
6
+ f.set(s, n.filter((e) => e.id !== i));
7
7
  }, r = () => {
8
- const n = s();
9
- if (!n.some((c) => c.id === i))
8
+ const n = c();
9
+ if (!n.some((t) => t.id === i))
10
10
  return;
11
- const t = h.get(e);
12
- n.length === 1 && t && t(), C();
13
- }, o = s();
14
- if (l.set(e, [
11
+ const e = g.get(s);
12
+ if (n.length === 1 && e) {
13
+ const t = e();
14
+ t instanceof Promise && t.catch(() => {
15
+ });
16
+ }
17
+ w();
18
+ }, o = c();
19
+ if (f.set(s, [
15
20
  ...o,
16
- { id: i, fns: f }
21
+ { id: i, fns: l }
17
22
  ]), o && o.length > 0)
18
23
  return r;
19
24
  const u = {};
20
- for (const n in f)
21
- u[n] = (...t) => {
22
- var p, g;
23
- const c = s();
24
- if (c.length !== 0)
25
- for (const k of c)
26
- (g = (p = k.fns)[n]) == null || g.call(p, ...t);
25
+ for (const n in l)
26
+ u[n] = (...e) => {
27
+ var p, h;
28
+ const t = c();
29
+ if (t.length !== 0)
30
+ for (const C of t)
31
+ (h = (p = C.fns)[n]) == null || h.call(p, ...e);
27
32
  };
28
- const a = w(u);
29
- return typeof a == "function" && h.set(e, a), r;
33
+ const a = m(u);
34
+ return typeof a == "function" && g.set(s, a), r;
30
35
  }
31
36
  export {
32
- h as cleanupCache,
33
- l as listenersCache,
37
+ g as cleanupCache,
38
+ f as listenersCache,
34
39
  y as observe
35
40
  };
package/dist/index43.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index182.cjs"),l=require("./index183.cjs");async function f(a,r){const{atomic:i=!1,chainId:n,receipts:e,version:o="2.0.0",...u}=await a.request({method:"wallet_getCallsStatus",params:[r.id]}),[c,d]=(()=>{const t=u.status;return t>=100&&t<200?["pending",t]:t>=200&&t<300?["success",t]:t>=300&&t<700?["failure",t]:t==="CONFIRMED"?["success",200]:t==="PENDING"?["pending",100]:[void 0,t]})();return{...u,atomic:i,chainId:n?s.hexToNumber(n):void 0,receipts:(e==null?void 0:e.map(t=>({...t,blockNumber:s.hexToBigInt(t.blockNumber),gasUsed:s.hexToBigInt(t.gasUsed),status:l.receiptStatuses[t.status]})))??[],statusCode:d,status:c,version:o}}exports.getCallsStatus=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index161.cjs"),I=require("./index162.cjs"),n=require("./index182.cjs"),T=require("./index183.cjs"),o=require("./index107.cjs");async function q(r,l){async function d(e){if(e.endsWith(o.fallbackMagicIdentifier.slice(2))){const p=I.trim(c.sliceHex(e,-64,-32)),b=c.sliceHex(e,0,-64).slice(2).match(/.{1,64}/g),s=await Promise.all(b.map(t=>o.fallbackTransactionErrorMagicIdentifier.slice(2)!==t?r.request({method:"eth_getTransactionReceipt",params:[`0x${t}`]},{dedupe:!0}):void 0)),x=s.some(t=>t===null)?100:s.every(t=>(t==null?void 0:t.status)==="0x1")?200:s.every(t=>(t==null?void 0:t.status)==="0x0")?500:600;return{atomic:!1,chainId:n.hexToNumber(p),receipts:s.filter(Boolean),status:x,version:"2.0.0"}}return r.request({method:"wallet_getCallsStatus",params:[e]})}const{atomic:f=!1,chainId:i,receipts:a,version:m="2.0.0",...u}=await d(l.id),[g,h]=(()=>{const e=u.status;return e>=100&&e<200?["pending",e]:e>=200&&e<300?["success",e]:e>=300&&e<700?["failure",e]:e==="CONFIRMED"?["success",200]:e==="PENDING"?["pending",100]:[void 0,e]})();return{...u,atomic:f,chainId:i?n.hexToNumber(i):void 0,receipts:(a==null?void 0:a.map(e=>({...e,blockNumber:n.hexToBigInt(e.blockNumber),gasUsed:n.hexToBigInt(e.gasUsed),status:T.receiptStatuses[e.status]})))??[],statusCode:h,status:g,version:m}}exports.getCallsStatus=q;
package/dist/index43.js CHANGED
@@ -1,29 +1,48 @@
1
- import { hexToNumber as f, hexToBigInt as u } from "./index182.js";
2
- import { receiptStatuses as m } from "./index183.js";
3
- async function p(a, r) {
4
- const { atomic: o = !1, chainId: e, receipts: t, version: i = "2.0.0", ...n } = await a.request({
5
- method: "wallet_getCallsStatus",
6
- params: [r.id]
7
- }), [d, c] = (() => {
8
- const s = n.status;
9
- return s >= 100 && s < 200 ? ["pending", s] : s >= 200 && s < 300 ? ["success", s] : s >= 300 && s < 700 ? ["failure", s] : s === "CONFIRMED" ? ["success", 200] : s === "PENDING" ? ["pending", 100] : [void 0, s];
1
+ import { sliceHex as o } from "./index161.js";
2
+ import { trim as x } from "./index162.js";
3
+ import { hexToNumber as u, hexToBigInt as c } from "./index182.js";
4
+ import { receiptStatuses as N } from "./index183.js";
5
+ import { fallbackMagicIdentifier as T, fallbackTransactionErrorMagicIdentifier as C } from "./index107.js";
6
+ async function M(a, f) {
7
+ async function m(t) {
8
+ if (t.endsWith(T.slice(2))) {
9
+ const h = x(o(t, -64, -32)), I = o(t, 0, -64).slice(2).match(/.{1,64}/g), s = await Promise.all(I.map((e) => C.slice(2) !== e ? a.request({
10
+ method: "eth_getTransactionReceipt",
11
+ params: [`0x${e}`]
12
+ }, { dedupe: !0 }) : void 0)), b = s.some((e) => e === null) ? 100 : s.every((e) => (e == null ? void 0 : e.status) === "0x1") ? 200 : s.every((e) => (e == null ? void 0 : e.status) === "0x0") ? 500 : 600;
13
+ return {
14
+ atomic: !1,
15
+ chainId: u(h),
16
+ receipts: s.filter(Boolean),
17
+ status: b,
18
+ version: "2.0.0"
19
+ };
20
+ }
21
+ return a.request({
22
+ method: "wallet_getCallsStatus",
23
+ params: [t]
24
+ });
25
+ }
26
+ const { atomic: l = !1, chainId: r, receipts: n, version: d = "2.0.0", ...i } = await m(f.id), [p, g] = (() => {
27
+ const t = i.status;
28
+ return t >= 100 && t < 200 ? ["pending", t] : t >= 200 && t < 300 ? ["success", t] : t >= 300 && t < 700 ? ["failure", t] : t === "CONFIRMED" ? ["success", 200] : t === "PENDING" ? ["pending", 100] : [void 0, t];
10
29
  })();
11
30
  return {
12
- ...n,
13
- atomic: o,
31
+ ...i,
32
+ atomic: l,
14
33
  // @ts-expect-error: for backwards compatibility
15
- chainId: e ? f(e) : void 0,
16
- receipts: (t == null ? void 0 : t.map((s) => ({
17
- ...s,
18
- blockNumber: u(s.blockNumber),
19
- gasUsed: u(s.gasUsed),
20
- status: m[s.status]
34
+ chainId: r ? u(r) : void 0,
35
+ receipts: (n == null ? void 0 : n.map((t) => ({
36
+ ...t,
37
+ blockNumber: c(t.blockNumber),
38
+ gasUsed: c(t.gasUsed),
39
+ status: N[t.status]
21
40
  }))) ?? [],
22
- statusCode: c,
23
- status: d,
24
- version: i
41
+ statusCode: g,
42
+ status: p,
43
+ version: d
25
44
  };
26
45
  }
27
46
  export {
28
- p as getCallsStatus
47
+ M as getCallsStatus
29
48
  };
package/dist/index44.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./index45.cjs"),C=require("./index46.cjs");function O(n){const{batch:r,cacheTime:d=n.pollingInterval??4e3,ccipRead:l,key:a="base",name:b="Base Client",pollingInterval:t=4e3,type:g="base"}=n,c=n.chain,f=n.account?q.parseAccount(n.account):void 0,{config:y,request:h,value:p}=n.transport({chain:c,pollingInterval:t}),v={...y,...p},e={account:f,batch:r,cacheTime:d,ccipRead:l,chain:c,key:a,name:b,pollingInterval:t,request:h,transport:v,type:g,uid:C.uid()};function o(i){return x=>{const u=x(i);for(const j in e)delete u[j];const s={...i,...u};return Object.assign(s,{extend:o(s)})}}return Object.assign(e,{extend:o(e)})}exports.createClient=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./index45.cjs"),j=require("./index46.cjs");function q(n){const{batch:u,chain:t,ccipRead:a,key:r="base",name:d="Base Client",type:b="base"}=n,f=(t==null?void 0:t.blockTime)??12e3,g=Math.min(Math.max(Math.floor(f/2),500),4e3),e=n.pollingInterval??g,h=n.cacheTime??e,v=n.account?M.parseAccount(n.account):void 0,{config:x,request:y,value:T}=n.transport({chain:t,pollingInterval:e}),k={...x,...T},c={account:v,batch:u,cacheTime:h,ccipRead:a,chain:t,key:r,name:d,pollingInterval:e,request:y,transport:k,type:b,uid:j.uid()};function o(i){return m=>{const l=m(i);for(const p in c)delete l[p];const s={...i,...l};return Object.assign(s,{extend:o(s)})}}return Object.assign(c,{extend:o(c)})}exports.createClient=q;
package/dist/index44.js CHANGED
@@ -1,33 +1,33 @@
1
- import { parseAccount as k } from "./index45.js";
2
- import { uid as m } from "./index46.js";
1
+ import { parseAccount as I } from "./index45.js";
2
+ import { uid as M } from "./index46.js";
3
3
  function O(n) {
4
- const { batch: d, cacheTime: l = n.pollingInterval ?? 4e3, ccipRead: r, key: a = "base", name: f = "Base Client", pollingInterval: c = 4e3, type: b = "base" } = n, e = n.chain, g = n.account ? k(n.account) : void 0, { config: p, request: x, value: h } = n.transport({
5
- chain: e,
6
- pollingInterval: c
7
- }), v = { ...p, ...h }, t = {
8
- account: g,
9
- batch: d,
10
- cacheTime: l,
11
- ccipRead: r,
12
- chain: e,
13
- key: a,
14
- name: f,
15
- pollingInterval: c,
16
- request: x,
4
+ const { batch: u, chain: t, ccipRead: a, key: d = "base", name: r = "Base Client", type: f = "base" } = n, b = (t == null ? void 0 : t.blockTime) ?? 12e3, m = Math.min(Math.max(Math.floor(b / 2), 500), 4e3), e = n.pollingInterval ?? m, g = n.cacheTime ?? e, x = n.account ? I(n.account) : void 0, { config: h, request: p, value: k } = n.transport({
5
+ chain: t,
6
+ pollingInterval: e
7
+ }), v = { ...h, ...k }, c = {
8
+ account: x,
9
+ batch: u,
10
+ cacheTime: g,
11
+ ccipRead: a,
12
+ chain: t,
13
+ key: d,
14
+ name: r,
15
+ pollingInterval: e,
16
+ request: p,
17
17
  transport: v,
18
- type: b,
19
- uid: m()
18
+ type: f,
19
+ uid: M()
20
20
  };
21
21
  function o(i) {
22
- return (y) => {
23
- const s = y(i);
24
- for (const j in t)
25
- delete s[j];
26
- const u = { ...i, ...s };
27
- return Object.assign(u, { extend: o(u) });
22
+ return (T) => {
23
+ const l = T(i);
24
+ for (const y in c)
25
+ delete l[y];
26
+ const s = { ...i, ...l };
27
+ return Object.assign(s, { extend: o(s) });
28
28
  };
29
29
  }
30
- return Object.assign(t, { extend: o(t) });
30
+ return Object.assign(c, { extend: o(c) });
31
31
  }
32
32
  export {
33
33
  O as createClient
package/dist/index53.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index21.cjs"),q=require("./index170.cjs"),R=require("./index177.cjs"),b=require("./index214.cjs"),m=require("./index162.cjs"),y=require("./index150.cjs"),C=require("./index237.cjs"),w=require("./index203.cjs"),i=require("./index153.cjs"),B=require("./index238.cjs"),T=require("./index29.cjs"),x=require("./index33.cjs");async function N(c,s){const{blockNumber:u,blockTag:v,coinType:n,name:r,gatewayUrls:g,strict:h}=s,{chain:t}=c,f=(()=>{if(s.universalResolverAddress)return s.universalResolverAddress;if(!t)throw new Error("client chain not configured. universalResolverAddress is required.");return b.getChainContractAddress({blockNumber:u,chain:t,contract:"ensUniversalResolver"})})(),d=t==null?void 0:t.ensTlds;if(d&&!d.some(e=>r.endsWith(e)))return null;try{const e=R.encodeFunctionData({abi:a.addressResolverAbi,functionName:"addr",...n!=null?{args:[i.namehash(r),BigInt(n)]}:{args:[i.namehash(r)]}}),A={address:f,abi:a.universalResolverResolveAbi,functionName:"resolve",args:[y.toHex(B.packetToBytes(r)),e,g??[w.localBatchGatewayUrl]],blockNumber:u,blockTag:v},l=await T.getAction(c,x.readContract,"readContract")(A);if(l[0]==="0x")return null;const o=q.decodeFunctionResult({abi:a.addressResolverAbi,args:n!=null?[i.namehash(r),BigInt(n)]:void 0,functionName:"addr",data:l[0]});return o==="0x"||m.trim(o)==="0x00"?null:o}catch(e){if(h)throw e;if(C.isNullUniversalResolverError(e,"resolve"))return null;throw e}}exports.getEnsAddress=N;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index21.cjs"),q=require("./index170.cjs"),R=require("./index177.cjs"),b=require("./index214.cjs"),m=require("./index162.cjs"),y=require("./index150.cjs"),C=require("./index230.cjs"),w=require("./index203.cjs"),i=require("./index153.cjs"),B=require("./index231.cjs"),T=require("./index29.cjs"),x=require("./index33.cjs");async function N(c,s){const{blockNumber:u,blockTag:v,coinType:n,name:r,gatewayUrls:g,strict:h}=s,{chain:t}=c,f=(()=>{if(s.universalResolverAddress)return s.universalResolverAddress;if(!t)throw new Error("client chain not configured. universalResolverAddress is required.");return b.getChainContractAddress({blockNumber:u,chain:t,contract:"ensUniversalResolver"})})(),d=t==null?void 0:t.ensTlds;if(d&&!d.some(e=>r.endsWith(e)))return null;try{const e=R.encodeFunctionData({abi:a.addressResolverAbi,functionName:"addr",...n!=null?{args:[i.namehash(r),BigInt(n)]}:{args:[i.namehash(r)]}}),A={address:f,abi:a.universalResolverResolveAbi,functionName:"resolve",args:[y.toHex(B.packetToBytes(r)),e,g??[w.localBatchGatewayUrl]],blockNumber:u,blockTag:v},l=await T.getAction(c,x.readContract,"readContract")(A);if(l[0]==="0x")return null;const o=q.decodeFunctionResult({abi:a.addressResolverAbi,args:n!=null?[i.namehash(r),BigInt(n)]:void 0,functionName:"addr",data:l[0]});return o==="0x"||m.trim(o)==="0x00"?null:o}catch(e){if(h)throw e;if(C.isNullUniversalResolverError(e,"resolve"))return null;throw e}}exports.getEnsAddress=N;
package/dist/index53.js CHANGED
@@ -4,10 +4,10 @@ import { encodeFunctionData as h } from "./index177.js";
4
4
  import { getChainContractAddress as b } from "./index214.js";
5
5
  import { trim as w } from "./index162.js";
6
6
  import { toHex as C } from "./index150.js";
7
- import { isNullUniversalResolverError as y } from "./index237.js";
7
+ import { isNullUniversalResolverError as y } from "./index230.js";
8
8
  import { localBatchGatewayUrl as x } from "./index203.js";
9
9
  import { namehash as i } from "./index153.js";
10
- import { packetToBytes as N } from "./index238.js";
10
+ import { packetToBytes as N } from "./index231.js";
11
11
  import { getAction as B } from "./index29.js";
12
12
  import { readContract as T } from "./index33.js";
13
13
  async function J(a, n) {
package/dist/index54.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index239.cjs"),g=require("./index29.cjs"),l=require("./index57.cjs");async function v(t,{blockNumber:r,blockTag:a,assetGatewayUrls:n,name:s,gatewayUrls:c,strict:o,universalResolverAddress:u}){const e=await g.getAction(t,l.getEnsText,"getEnsText")({blockNumber:r,blockTag:a,key:"avatar",name:s,universalResolverAddress:u,gatewayUrls:c,strict:o});if(!e)return null;try{return await i.parseAvatarRecord(t,{record:e,gatewayUrls:n})}catch{return null}}exports.getEnsAvatar=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index232.cjs"),g=require("./index29.cjs"),l=require("./index57.cjs");async function v(t,{blockNumber:r,blockTag:a,assetGatewayUrls:n,name:s,gatewayUrls:c,strict:o,universalResolverAddress:u}){const e=await g.getAction(t,l.getEnsText,"getEnsText")({blockNumber:r,blockTag:a,key:"avatar",name:s,universalResolverAddress:u,gatewayUrls:c,strict:o});if(!e)return null;try{return await i.parseAvatarRecord(t,{record:e,gatewayUrls:n})}catch{return null}}exports.getEnsAvatar=v;
package/dist/index54.js CHANGED
@@ -1,4 +1,4 @@
1
- import { parseAvatarRecord as m } from "./index239.js";
1
+ import { parseAvatarRecord as m } from "./index232.js";
2
2
  import { getAction as u } from "./index29.js";
3
3
  import { getEnsText as f } from "./index57.js";
4
4
  async function y(t, { blockNumber: a, blockTag: e, assetGatewayUrls: n, name: o, gatewayUrls: c, strict: i, universalResolverAddress: s }) {