@gardenfi/utils 2.5.2 → 2.5.3-beta.0

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 (200) hide show
  1. package/README.md +9 -0
  2. package/dist/index.cjs +1 -1
  3. package/dist/index.js +37 -36
  4. package/dist/index10.cjs +1 -1
  5. package/dist/index10.js +4 -4
  6. package/dist/index11.cjs +1 -1
  7. package/dist/index11.js +16 -20
  8. package/dist/index112.cjs +1 -1
  9. package/dist/index112.js +15 -15
  10. package/dist/index121.cjs +1 -1
  11. package/dist/index121.js +1 -1
  12. package/dist/index130.cjs +1 -1
  13. package/dist/index130.js +1 -1
  14. package/dist/index16.cjs +1 -1
  15. package/dist/index16.js +4 -4
  16. package/dist/index18.cjs +1 -1
  17. package/dist/index18.js +20 -9
  18. package/dist/index197.cjs +1 -1
  19. package/dist/index197.js +17 -30
  20. package/dist/index22.cjs +1 -1
  21. package/dist/index22.js +84 -51
  22. package/dist/index226.cjs +1 -1
  23. package/dist/index226.js +2 -2
  24. package/dist/index229.cjs +1 -1
  25. package/dist/index229.js +2 -2
  26. package/dist/index230.cjs +1 -1
  27. package/dist/index230.js +1 -1
  28. package/dist/index234.cjs +1 -1
  29. package/dist/index234.js +7 -8
  30. package/dist/index235.cjs +1 -1
  31. package/dist/index235.js +1 -1
  32. package/dist/index236.cjs +1 -1
  33. package/dist/index236.js +1 -1
  34. package/dist/index237.cjs +1 -1
  35. package/dist/index237.js +2 -2
  36. package/dist/index24.cjs +1 -1
  37. package/dist/index24.js +30 -13
  38. package/dist/index249.cjs +1 -1
  39. package/dist/index249.js +3 -3
  40. package/dist/index25.cjs +1 -1
  41. package/dist/index25.js +30 -58
  42. package/dist/index250.cjs +1 -1
  43. package/dist/index250.js +3 -3
  44. package/dist/index256.cjs +1 -1
  45. package/dist/index256.js +17 -12
  46. package/dist/index26.cjs +1 -16
  47. package/dist/index26.js +11 -113
  48. package/dist/index269.cjs +1 -1
  49. package/dist/index269.js +4 -4
  50. package/dist/index27.cjs +1 -1
  51. package/dist/index27.js +58 -32
  52. package/dist/index270.cjs +1 -1
  53. package/dist/index270.js +5 -5
  54. package/dist/index271.cjs +1 -1
  55. package/dist/index271.js +27 -21
  56. package/dist/index272.cjs +1 -1
  57. package/dist/index272.js +54 -20
  58. package/dist/index273.cjs +1 -1
  59. package/dist/index273.js +18 -54
  60. package/dist/index274.cjs +1 -1
  61. package/dist/index274.js +10 -34
  62. package/dist/index275.cjs +1 -1
  63. package/dist/index275.js +7 -10
  64. package/dist/index276.cjs +1 -1
  65. package/dist/index276.js +12 -13
  66. package/dist/index277.cjs +1 -1
  67. package/dist/index277.js +11 -12
  68. package/dist/index28.cjs +1 -1
  69. package/dist/index28.js +13 -31
  70. package/dist/index280.cjs +1 -1
  71. package/dist/index280.js +103 -11
  72. package/dist/index281.cjs +1 -1
  73. package/dist/index281.js +6 -103
  74. package/dist/index282.cjs +1 -1
  75. package/dist/index282.js +243 -5
  76. package/dist/index283.cjs +1 -1
  77. package/dist/index283.js +6 -224
  78. package/dist/index284.cjs +1 -1
  79. package/dist/index284.js +7 -7
  80. package/dist/index285.cjs +1 -1
  81. package/dist/index285.js +27 -7
  82. package/dist/index286.cjs +1 -1
  83. package/dist/index286.js +18 -25
  84. package/dist/index287.cjs +1 -1
  85. package/dist/index287.js +145 -18
  86. package/dist/index288.cjs +1 -1
  87. package/dist/index288.js +3 -146
  88. package/dist/index289.cjs +1 -1
  89. package/dist/index289.js +155 -3
  90. package/dist/index29.cjs +16 -1
  91. package/dist/index29.js +113 -11
  92. package/dist/index290.cjs +1 -1
  93. package/dist/index290.js +7 -138
  94. package/dist/index291.cjs +1 -1
  95. package/dist/index291.js +128 -143
  96. package/dist/index292.cjs +1 -1
  97. package/dist/index292.js +111 -7
  98. package/dist/index293.cjs +2 -1
  99. package/dist/index293.js +116 -95
  100. package/dist/index294.cjs +1 -2
  101. package/dist/index294.js +35 -127
  102. package/dist/index295.cjs +1 -1
  103. package/dist/index295.js +66 -30
  104. package/dist/index296.cjs +1 -1
  105. package/dist/index296.js +2 -79
  106. package/dist/index297.cjs +1 -1
  107. package/dist/index297.js +12 -2
  108. package/dist/index298.cjs +1 -1
  109. package/dist/index298.js +19 -11
  110. package/dist/index299.cjs +1 -1
  111. package/dist/index299.js +68 -19
  112. package/dist/index3.cjs +1 -1
  113. package/dist/index3.js +10 -8
  114. package/dist/index300.cjs +1 -1
  115. package/dist/index300.js +786 -66
  116. package/dist/index301.cjs +1 -1
  117. package/dist/index301.js +134 -684
  118. package/dist/index302.cjs +1 -1
  119. package/dist/index302.js +185 -124
  120. package/dist/index303.cjs +2 -1
  121. package/dist/index303.js +63 -198
  122. package/dist/index304.cjs +1 -2
  123. package/dist/index304.js +7 -66
  124. package/dist/index305.cjs +1 -1
  125. package/dist/index305.js +62 -4
  126. package/dist/index306.cjs +1 -1
  127. package/dist/index306.js +22 -40
  128. package/dist/index307.cjs +1 -1
  129. package/dist/index307.js +5 -7
  130. package/dist/index308.cjs +1 -1
  131. package/dist/index308.js +72 -57
  132. package/dist/index309.cjs +1 -1
  133. package/dist/index309.js +4 -78
  134. package/dist/index310.cjs +1 -1
  135. package/dist/index310.js +195 -4
  136. package/dist/index311.cjs +1 -1
  137. package/dist/index311.js +4 -194
  138. package/dist/index312.cjs +1 -1
  139. package/dist/index312.js +35 -58
  140. package/dist/index313.cjs +2 -1
  141. package/dist/index313.js +40 -43
  142. package/dist/index314.cjs +1 -1
  143. package/dist/index314.js +2 -5
  144. package/dist/index315.cjs +1 -1
  145. package/dist/index315.js +11 -5
  146. package/dist/index316.cjs +1 -1
  147. package/dist/index316.js +20 -2
  148. package/dist/index317.cjs +1 -1
  149. package/dist/index317.js +8 -21
  150. package/dist/index318.cjs +1 -0
  151. package/dist/index318.js +45 -0
  152. package/dist/index319.cjs +1 -0
  153. package/dist/index319.js +69 -0
  154. package/dist/index320.cjs +1 -0
  155. package/dist/index320.js +68 -0
  156. package/dist/index321.cjs +1 -0
  157. package/dist/index321.js +191 -0
  158. package/dist/index322.cjs +1 -0
  159. package/dist/index322.js +79 -0
  160. package/dist/index323.cjs +1 -0
  161. package/dist/index323.js +43 -0
  162. package/dist/index324.cjs +1 -0
  163. package/dist/index324.js +19 -0
  164. package/dist/index325.cjs +1 -0
  165. package/dist/index325.js +16 -0
  166. package/dist/index326.cjs +1 -0
  167. package/dist/index326.js +7 -0
  168. package/dist/index327.cjs +1 -0
  169. package/dist/index327.js +66 -0
  170. package/dist/index328.cjs +1 -0
  171. package/dist/index328.js +7 -0
  172. package/dist/index329.cjs +1 -0
  173. package/dist/index329.js +47 -0
  174. package/dist/index330.cjs +1 -0
  175. package/dist/index330.js +71 -0
  176. package/dist/index331.cjs +1 -0
  177. package/dist/index331.js +4 -0
  178. package/dist/index332.cjs +1 -0
  179. package/dist/index332.js +24 -0
  180. package/dist/index55.cjs +1 -1
  181. package/dist/index55.js +1 -1
  182. package/dist/index58.cjs +1 -1
  183. package/dist/index58.js +35 -34
  184. package/dist/index60.cjs +1 -1
  185. package/dist/index60.js +26 -30
  186. package/dist/index61.cjs +1 -1
  187. package/dist/index61.js +13 -9
  188. package/dist/index62.cjs +1 -1
  189. package/dist/index62.js +19 -19
  190. package/dist/index89.cjs +1 -1
  191. package/dist/index89.js +31 -30
  192. package/dist/index9.cjs +1 -1
  193. package/dist/index9.js +2 -2
  194. package/dist/index95.cjs +1 -1
  195. package/dist/index95.js +73 -73
  196. package/dist/src/lib/auth/apikey/apikey.d.ts +1 -1
  197. package/dist/src/lib/auth/auth.types.d.ts +1 -1
  198. package/dist/src/lib/fetcher/fetcher.d.ts +2 -0
  199. package/dist/src/lib/utils.d.ts +1 -0
  200. package/package.json +2 -2
package/README.md CHANGED
@@ -0,0 +1,9 @@
1
+ # @gardenfi/utils
2
+
3
+ The `@gardenfi/utils` package provides utility functions used in garden.
4
+
5
+ ## Installation
6
+
7
+ ```
8
+ yarn add @gardenfi/utils
9
+ ```
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index2.cjs"),e=require("./index3.cjs"),t=require("./index4.cjs"),r=require("./index5.cjs"),i=require("./index6.cjs"),s=require("./index7.cjs"),n=require("./index8.cjs"),c=require("./index9.cjs"),a=require("./index10.cjs"),u=require("./index11.cjs"),y=require("./index12.cjs"),p=require("./index13.cjs"),h=require("./index14.cjs"),k=require("./index15.cjs"),l=require("./index16.cjs"),q=require("./index17.cjs"),A=require("./index18.cjs");exports.ApiStatus=o.ApiStatus;exports.Authorization=e.Authorization;exports.Environment=e.Environment;exports.Network=e.Network;exports.add0x=e.add0x;exports.hexToU32Array=e.hexToU32Array;exports.parseJwt=e.parseJwt;exports.sleep=e.sleep;exports.trim0x=e.trim0x;exports.with0x=e.with0x;exports.checkAllowanceAndApprove=t.checkAllowanceAndApprove;exports.waitForTransactionReceipt=t.waitForTransactionReceipt;exports.Err=r.Err;exports.Ok=r.Ok;exports.Void=r.Void;exports.DigestKey=i.DigestKey;exports.executeWithTryCatch=s.executeWithTryCatch;exports.Url=n.Url;exports.AuthHeaderEnum=c.AuthHeaderEnum;exports.Siwe=a.Siwe;exports.ApiKey=u.ApiKey;exports.Passkey=y.Passkey;exports.PasskeyLogin=p.PasskeyLogin;exports.MemoryStorage=h.MemoryStorage;exports.StoreKeys=k.StoreKeys;exports.fetchEVMBlockNumber=l.fetchEVMBlockNumber;exports.EventBroker=q.EventBroker;exports.Fetcher=A.Fetcher;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index2.cjs"),e=require("./index3.cjs"),t=require("./index4.cjs"),r=require("./index5.cjs"),i=require("./index6.cjs"),s=require("./index7.cjs"),n=require("./index8.cjs"),c=require("./index9.cjs"),a=require("./index10.cjs"),u=require("./index11.cjs"),y=require("./index12.cjs"),p=require("./index13.cjs"),h=require("./index14.cjs"),k=require("./index15.cjs"),l=require("./index16.cjs"),q=require("./index17.cjs"),A=require("./index18.cjs");exports.ApiStatus=o.ApiStatus;exports.Authorization=e.Authorization;exports.Environment=e.Environment;exports.Network=e.Network;exports.add0x=e.add0x;exports.hasKeys=e.hasKeys;exports.hexToU32Array=e.hexToU32Array;exports.parseJwt=e.parseJwt;exports.sleep=e.sleep;exports.trim0x=e.trim0x;exports.with0x=e.with0x;exports.checkAllowanceAndApprove=t.checkAllowanceAndApprove;exports.waitForTransactionReceipt=t.waitForTransactionReceipt;exports.Err=r.Err;exports.Ok=r.Ok;exports.Void=r.Void;exports.DigestKey=i.DigestKey;exports.executeWithTryCatch=s.executeWithTryCatch;exports.Url=n.Url;exports.AuthHeaderEnum=c.AuthHeaderEnum;exports.Siwe=a.Siwe;exports.ApiKey=u.ApiKey;exports.Passkey=y.Passkey;exports.PasskeyLogin=p.PasskeyLogin;exports.MemoryStorage=h.MemoryStorage;exports.StoreKeys=k.StoreKeys;exports.fetchEVMBlockNumber=l.fetchEVMBlockNumber;exports.EventBroker=q.EventBroker;exports.Fetcher=A.Fetcher;
package/dist/index.js CHANGED
@@ -1,47 +1,48 @@
1
- import { ApiStatus as e } from "./index2.js";
2
- import { Authorization as p, Environment as m, Network as x, add0x as f, hexToU32Array as i, parseJwt as a, sleep as n, trim0x as c, with0x as s } from "./index3.js";
3
- import { checkAllowanceAndApprove as y, waitForTransactionReceipt as A } from "./index4.js";
4
- import { Err as u, Ok as w, Void as d } from "./index5.js";
5
- import { DigestKey as E } from "./index6.js";
1
+ import { ApiStatus as o } from "./index2.js";
2
+ import { Authorization as p, Environment as m, Network as x, add0x as f, hasKeys as a, hexToU32Array as i, parseJwt as s, sleep as n, trim0x as c, with0x as h } from "./index3.js";
3
+ import { checkAllowanceAndApprove as A, waitForTransactionReceipt as k } from "./index4.js";
4
+ import { Err as w, Ok as d, Void as l } from "./index5.js";
5
+ import { DigestKey as K } from "./index6.js";
6
6
  import { executeWithTryCatch as g } from "./index7.js";
7
- import { Url as K } from "./index8.js";
8
- import { AuthHeaderEnum as B } from "./index9.js";
9
- import { Siwe as M } from "./index10.js";
10
- import { ApiKey as P } from "./index11.js";
11
- import { Passkey as V } from "./index12.js";
12
- import { PasskeyLogin as z } from "./index13.js";
13
- import { MemoryStorage as D } from "./index14.js";
14
- import { StoreKeys as J } from "./index15.js";
15
- import { fetchEVMBlockNumber as O } from "./index16.js";
16
- import { EventBroker as W } from "./index17.js";
17
- import { Fetcher as q } from "./index18.js";
7
+ import { Url as T } from "./index8.js";
8
+ import { AuthHeaderEnum as F } from "./index9.js";
9
+ import { Siwe as N } from "./index10.js";
10
+ import { ApiKey as U } from "./index11.js";
11
+ import { Passkey as b } from "./index12.js";
12
+ import { PasskeyLogin as C } from "./index13.js";
13
+ import { MemoryStorage as H } from "./index14.js";
14
+ import { StoreKeys as L } from "./index15.js";
15
+ import { fetchEVMBlockNumber as R } from "./index16.js";
16
+ import { EventBroker as j } from "./index17.js";
17
+ import { Fetcher as G } from "./index18.js";
18
18
  export {
19
- P as ApiKey,
20
- e as ApiStatus,
21
- B as AuthHeaderEnum,
19
+ U as ApiKey,
20
+ o as ApiStatus,
21
+ F as AuthHeaderEnum,
22
22
  p as Authorization,
23
- E as DigestKey,
23
+ K as DigestKey,
24
24
  m as Environment,
25
- u as Err,
26
- W as EventBroker,
27
- q as Fetcher,
28
- D as MemoryStorage,
25
+ w as Err,
26
+ j as EventBroker,
27
+ G as Fetcher,
28
+ H as MemoryStorage,
29
29
  x as Network,
30
- w as Ok,
31
- V as Passkey,
32
- z as PasskeyLogin,
33
- M as Siwe,
34
- J as StoreKeys,
35
- K as Url,
36
- d as Void,
30
+ d as Ok,
31
+ b as Passkey,
32
+ C as PasskeyLogin,
33
+ N as Siwe,
34
+ L as StoreKeys,
35
+ T as Url,
36
+ l as Void,
37
37
  f as add0x,
38
- y as checkAllowanceAndApprove,
38
+ A as checkAllowanceAndApprove,
39
39
  g as executeWithTryCatch,
40
- O as fetchEVMBlockNumber,
40
+ R as fetchEVMBlockNumber,
41
+ a as hasKeys,
41
42
  i as hexToU32Array,
42
- a as parseJwt,
43
+ s as parseJwt,
43
44
  n as sleep,
44
45
  c as trim0x,
45
- A as waitForTransactionReceipt,
46
- s as with0x
46
+ k as waitForTransactionReceipt,
47
+ h as with0x
47
48
  };
package/dist/index10.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("tough-cookie"),g=require("fetch-cookie"),k=require("./index14.cjs"),f=require("./index15.cjs"),h=require("./index3.cjs"),n=require("./index5.cjs"),m=require("./index24.cjs"),y=require("./index25.cjs"),C=require("./index23.cjs"),T=require("./index26.cjs"),v=require("./index27.cjs"),S=c=>c&&c.__esModule?c:{default:c},p=S(g);class u{constructor(t,i,e){if(this.url=t.endpoint("siwe"),this.walletClient=i,this.domain=(e==null?void 0:e.domain)||"app.garden.finance",this.domain.startsWith("https://")&&(this.domain=this.domain.split("https://")[1]),this.signingStatement=(e==null?void 0:e.signingStatement)??"Garden.fi",this.store=(e==null?void 0:e.store)??(typeof window<"u"?window.localStorage:new k.MemoryStorage),typeof window>"u"){const r=new w.CookieJar;this.fetchWithCookies=p.default(fetch,r)}else this.fetchWithCookies=window.fetch.bind(window)}static fromDigestKey(t,i,e){const r=m.createWalletClient({account:C.privateKeyToAccount(h.add0x(i.digestKey)),transport:y.http(),chain:v.mainnet});return new u(t,r,e)}verifyToken(t,i){try{const e=h.parseJwt(t);if(!e)return n.Ok(!1);const r=Math.floor(Date.now()/1e3)+120;return n.Ok(e.exp>r&&e.user_id.toLowerCase()===i.toLowerCase())}catch{return n.Ok(!1)}}async getToken(){var s;if(!((s=this.walletClient.account)!=null&&s.address))return n.Err("Wallet client does not have an account");const t=this.store.getItem(f.StoreKeys.AUTH_TOKEN);if(t){const o=this.verifyToken(t,this.walletClient.account.address);if(o.ok&&o.val)return n.Ok(t)}const i=await this.signStatement();if(i.error)return n.Err(i.error);let e;try{const a=await(await this.fetchWithCookies(this.url.endpoint("tokens"),{method:"POST",body:JSON.stringify({...i.val}),headers:{"Content-Type":"application/json"},credentials:"include"})).json();if(a.error||!a.result)return n.Err(a.error??"Failed to get token");e=a.result}catch(o){return n.Err("Failed to get token",o)}if(!this.verifyToken(e,this.walletClient.account.address).val)throw new Error("Token verification failed");return this.store.setItem(f.StoreKeys.AUTH_TOKEN,e),n.Ok(e)}async signStatement(){var a;if(!((a=this.walletClient.account)!=null&&a.address))return n.Err("Wallet client does not have a valid account");const t=new Date,i=new Date(t.getTime()+300*1e3);let e;try{const l=await(await this.fetchWithCookies(this.url.endpoint("challenges"),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"})).json();if(l.error||!l.result)return n.Err("Failed to get nonce");e=l.result}catch(d){return n.Err("Failed to get nonce",d)}const r=await this.walletClient.getChainId(),s=T.createSiweMessage({domain:this.domain,address:this.walletClient.account.address,statement:this.signingStatement,nonce:e,uri:"https://"+this.domain,version:"1",chainId:r,notBefore:i}),o=await this.walletClient.signMessage({account:this.walletClient.account,message:s});return n.Ok({message:s,signature:o,nonce:e})}async getAuthHeaders(){const t=await this.getToken();return t.ok?n.Ok({Authorization:h.Authorization(t.val)}):n.Err(t.error)}}exports.Siwe=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("tough-cookie"),g=require("fetch-cookie"),k=require("./index14.cjs"),f=require("./index15.cjs"),h=require("./index3.cjs"),n=require("./index5.cjs"),m=require("./index28.cjs"),y=require("./index27.cjs"),C=require("./index23.cjs"),T=require("./index29.cjs"),v=require("./index25.cjs"),S=c=>c&&c.__esModule?c:{default:c},p=S(g);class u{constructor(t,i,e){if(this.url=t.endpoint("siwe"),this.walletClient=i,this.domain=(e==null?void 0:e.domain)||"app.garden.finance",this.domain.startsWith("https://")&&(this.domain=this.domain.split("https://")[1]),this.signingStatement=(e==null?void 0:e.signingStatement)??"Garden.fi",this.store=(e==null?void 0:e.store)??(typeof window<"u"?window.localStorage:new k.MemoryStorage),typeof window>"u"){const r=new w.CookieJar;this.fetchWithCookies=p.default(fetch,r)}else this.fetchWithCookies=window.fetch.bind(window)}static fromDigestKey(t,i,e){const r=m.createWalletClient({account:C.privateKeyToAccount(h.add0x(i.digestKey)),transport:y.http(),chain:v.mainnet});return new u(t,r,e)}verifyToken(t,i){try{const e=h.parseJwt(t);if(!e)return n.Ok(!1);const r=Math.floor(Date.now()/1e3)+120;return n.Ok(e.exp>r&&e.user_id.toLowerCase()===i.toLowerCase())}catch{return n.Ok(!1)}}async getToken(){var s;if(!((s=this.walletClient.account)!=null&&s.address))return n.Err("Wallet client does not have an account");const t=this.store.getItem(f.StoreKeys.AUTH_TOKEN);if(t){const o=this.verifyToken(t,this.walletClient.account.address);if(o.ok&&o.val)return n.Ok(t)}const i=await this.signStatement();if(i.error)return n.Err(i.error);let e;try{const a=await(await this.fetchWithCookies(this.url.endpoint("tokens"),{method:"POST",body:JSON.stringify({...i.val}),headers:{"Content-Type":"application/json"},credentials:"include"})).json();if(a.error||!a.result)return n.Err(a.error??"Failed to get token");e=a.result}catch(o){return n.Err("Failed to get token",o)}if(!this.verifyToken(e,this.walletClient.account.address).val)throw new Error("Token verification failed");return this.store.setItem(f.StoreKeys.AUTH_TOKEN,e),n.Ok(e)}async signStatement(){var a;if(!((a=this.walletClient.account)!=null&&a.address))return n.Err("Wallet client does not have a valid account");const t=new Date,i=new Date(t.getTime()+300*1e3);let e;try{const l=await(await this.fetchWithCookies(this.url.endpoint("challenges"),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"})).json();if(l.error||!l.result)return n.Err("Failed to get nonce");e=l.result}catch(d){return n.Err("Failed to get nonce",d)}const r=await this.walletClient.getChainId(),s=T.createSiweMessage({domain:this.domain,address:this.walletClient.account.address,statement:this.signingStatement,nonce:e,uri:"https://"+this.domain,version:"1",chainId:r,notBefore:i}),o=await this.walletClient.signMessage({account:this.walletClient.account,message:s});return n.Ok({message:s,signature:o,nonce:e})}async getAuthHeaders(){const t=await this.getToken();return t.ok?n.Ok({Authorization:h.Authorization(t.val)}):n.Err(t.error)}}exports.Siwe=u;
package/dist/index10.js CHANGED
@@ -4,11 +4,11 @@ import { MemoryStorage as w } from "./index14.js";
4
4
  import { StoreKeys as d } from "./index15.js";
5
5
  import { add0x as g, parseJwt as k, Authorization as p } from "./index3.js";
6
6
  import { Ok as s, Err as r } from "./index5.js";
7
- import { createWalletClient as y } from "./index24.js";
8
- import { http as C } from "./index25.js";
7
+ import { createWalletClient as y } from "./index28.js";
8
+ import { http as C } from "./index27.js";
9
9
  import { privateKeyToAccount as T } from "./index23.js";
10
- import { createSiweMessage as v } from "./index26.js";
11
- import { mainnet as S } from "./index27.js";
10
+ import { createSiweMessage as v } from "./index29.js";
11
+ import { mainnet as S } from "./index25.js";
12
12
  class f {
13
13
  constructor(e, n, t) {
14
14
  if (this.url = e.endpoint("siwe"), this.walletClient = n, this.domain = (t == null ? void 0 : t.domain) || "app.garden.finance", this.domain.startsWith("https://") && (this.domain = this.domain.split("https://")[1]), this.signingStatement = (t == null ? void 0 : t.signingStatement) ?? "Garden.fi", this.store = (t == null ? void 0 : t.store) ?? (typeof window < "u" ? window.localStorage : new w()), typeof window > "u") {
package/dist/index11.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index5.cjs"),d=require("./index9.cjs");class f{constructor(e){this.apiKey=e}async getToken(){const e=this.verifyToken();return e.error?t.Err(e.error):e.val?t.Ok(this.apiKey):t.Err("Token verification failed")}verifyToken(){const e=this.decodeBase64UrlSafe(this.apiKey),r=this.extractData(e);if(!r.ok)return t.Err(r.error);const{expiryTimestamp:i}=r.val;return i<new Date?t.Err("Token expired"):t.Ok(!0)}decodeBase64UrlSafe(e){let r=e.replace(/_/g,"/").replace(/-/g,"+");for(;r.length%4!==0;)r+="=";return Uint8Array.from(atob(r),i=>i.charCodeAt(0))}extractData(e){const r=new TextEncoder().encode("::"),i=e.findIndex((n,a)=>e.slice(a,a+r.length).every((u,l)=>u===r[l]));if(i===-1)return t.Err("Invalid format: delimiter not found");const o=e.slice(0,8),s=new DataView(o.buffer).getBigUint64(0,!1),c=e.slice(i+r.length);return t.Ok({expiryTimestamp:new Date(Number(s)*1e3),signature:Array.from(c).map(n=>n.toString(16).padStart(2,"0")).join("")})}async getAuthHeaders(){const e=await this.getToken();return e.ok?t.Ok({[d.AuthHeaderEnum.ApiKey]:e.val}):t.Err(e.error??"Failed to get auth token")}}exports.ApiKey=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index5.cjs"),f=require("./index9.cjs");class y{constructor(e){this._apiKey=e}async getToken(){const e=this.verifyToken();return e.error?r.Err(e.error):e.val?r.Ok(this._apiKey):r.Err("Token verification failed")}verifyToken(){return this._apiKey.length===64?r.Ok(!0):r.Err("Invalid API key length")}decodeBase64UrlSafe(e){let t=e.replace(/_/g,"/").replace(/-/g,"+");for(;t.length%4!==0;)t+="=";return Uint8Array.from(atob(t),n=>n.charCodeAt(0))}extractData(e){const t=new TextEncoder().encode("::"),n=e.findIndex((i,a)=>e.slice(a,a+t.length).every((l,u)=>l===t[u]));if(n===-1)return r.Err("Invalid format: delimiter not found");const o=e.slice(0,8),s=new DataView(o.buffer).getBigUint64(0,!1),c=e.slice(n+t.length);return r.Ok({expiryTimestamp:new Date(Number(s)*1e3),signature:Array.from(c).map(i=>i.toString(16).padStart(2,"0")).join("")})}async getAuthHeaders(){const e=await this.getToken();return e.ok?r.Ok({[f.AuthHeaderEnum.ApiKey]:e.val}):r.Err(e.error??"Failed to get auth token")}}exports.ApiKey=y;
package/dist/index11.js CHANGED
@@ -1,46 +1,42 @@
1
- import { Err as i, Ok as n } from "./index5.js";
2
- import { AuthHeaderEnum as u } from "./index9.js";
3
- class h {
1
+ import { Err as t, Ok as i } from "./index5.js";
2
+ import { AuthHeaderEnum as d } from "./index9.js";
3
+ class y {
4
4
  constructor(e) {
5
- this.apiKey = e;
5
+ this._apiKey = e;
6
6
  }
7
7
  async getToken() {
8
8
  const e = this.verifyToken();
9
- return e.error ? i(e.error) : e.val ? n(this.apiKey) : i("Token verification failed");
9
+ return e.error ? t(e.error) : e.val ? i(this._apiKey) : t("Token verification failed");
10
10
  }
11
11
  verifyToken() {
12
- const e = this.decodeBase64UrlSafe(this.apiKey), r = this.extractData(e);
13
- if (!r.ok)
14
- return i(r.error);
15
- const { expiryTimestamp: t } = r.val;
16
- return t < /* @__PURE__ */ new Date() ? i("Token expired") : n(!0);
12
+ return this._apiKey.length === 64 ? i(!0) : t("Invalid API key length");
17
13
  }
18
14
  decodeBase64UrlSafe(e) {
19
15
  let r = e.replace(/_/g, "/").replace(/-/g, "+");
20
16
  for (; r.length % 4 !== 0; )
21
17
  r += "=";
22
- return Uint8Array.from(atob(r), (t) => t.charCodeAt(0));
18
+ return Uint8Array.from(atob(r), (n) => n.charCodeAt(0));
23
19
  }
24
20
  extractData(e) {
25
- const r = new TextEncoder().encode("::"), t = e.findIndex(
26
- (a, o) => e.slice(o, o + r.length).every((f, l) => f === r[l])
21
+ const r = new TextEncoder().encode("::"), n = e.findIndex(
22
+ (a, o) => e.slice(o, o + r.length).every((f, u) => f === r[u])
27
23
  );
28
- if (t === -1)
29
- return i("Invalid format: delimiter not found");
24
+ if (n === -1)
25
+ return t("Invalid format: delimiter not found");
30
26
  const s = e.slice(0, 8), c = new DataView(s.buffer).getBigUint64(
31
27
  0,
32
28
  !1
33
- ), d = e.slice(t + r.length);
34
- return n({
29
+ ), l = e.slice(n + r.length);
30
+ return i({
35
31
  expiryTimestamp: new Date(Number(c) * 1e3),
36
- signature: Array.from(d).map((a) => a.toString(16).padStart(2, "0")).join("")
32
+ signature: Array.from(l).map((a) => a.toString(16).padStart(2, "0")).join("")
37
33
  });
38
34
  }
39
35
  async getAuthHeaders() {
40
36
  const e = await this.getToken();
41
- return e.ok ? n({ [u.ApiKey]: e.val }) : i(e.error ?? "Failed to get auth token");
37
+ return e.ok ? i({ [d.ApiKey]: e.val }) : t(e.error ?? "Failed to get auth token");
42
38
  }
43
39
  }
44
40
  export {
45
- h as ApiKey
41
+ y as ApiKey
46
42
  };
package/dist/index112.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./index50.cjs"),h=require("./index41.cjs"),w=require("./index143.cjs"),N=require("./index182.cjs"),g=require("./index159.cjs"),M=require("./index187.cjs"),c=require("./index155.cjs"),S=require("./index251.cjs"),_=require("./index113.cjs"),T="0x5792579257925792579257925792579257925792579257925792579257925792",v=c.numberToHex(0,{size:32});async function H(i,s){const{account:f=i.account,capabilities:l,chain:u=i.chain,experimental_fallback:x,experimental_fallbackDelay:m=32,forceAtomic:b=!1,id:y,version:C="2.0.0"}=s,r=f?k.parseAccount(f):null,d=s.calls.map(a=>{const e=a,o=e.abi?N.encodeFunctionData({abi:e.abi,functionName:e.functionName,args:e.args}):e.data;return{data:e.dataSuffix&&o?g.concat([o,e.dataSuffix]):o,to:e.to,value:e.value?c.numberToHex(e.value):void 0}});try{const a=await i.request({method:"wallet_sendCalls",params:[{atomicRequired:b,calls:d,capabilities:l,chainId:c.numberToHex(u.id),from:r==null?void 0:r.address,id:y,version:C}]},{retryCount:0});return typeof a=="string"?{id:a}:a}catch(a){const e=a;if(x&&(e.name==="MethodNotFoundRpcError"||e.name==="MethodNotSupportedRpcError"||e.name==="UnknownRpcError"||e.details.toLowerCase().includes("does not exist / is not available")||e.details.toLowerCase().includes("missing or invalid. request()")||e.details.toLowerCase().includes("did not match any variant of untagged enum")||e.details.toLowerCase().includes("account upgraded to unsupported contract")||e.details.toLowerCase().includes("eip-7702 not supported")||e.details.toLowerCase().includes("unsupported wc_ method"))){if(l&&Object.values(l).some(n=>!n.optional)){const n="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new w.UnsupportedNonOptionalCapabilityError(new h.BaseError(n,{details:n}))}if(b&&d.length>1){const t="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new w.AtomicityNotSupportedError(new h.BaseError(t,{details:t}))}const o=[];for(const t of d){const n=_.sendTransaction(i,{account:r,chain:u,data:t.data,to:t.to,value:t.value?M.hexToBigInt(t.value):void 0});o.push(n),m>0&&await new Promise(E=>setTimeout(E,m))}const p=await Promise.allSettled(o);if(p.every(t=>t.status==="rejected"))throw p[0].reason;const q=p.map(t=>t.status==="fulfilled"?t.value:v);return{id:g.concat([...q,c.numberToHex(u.id,{size:32}),T])}}throw S.getTransactionError(a,{...s,account:r,chain:s.chain})}}exports.fallbackMagicIdentifier=T;exports.fallbackTransactionErrorMagicIdentifier=v;exports.sendCalls=H;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./index50.cjs"),h=require("./index41.cjs"),g=require("./index143.cjs"),N=require("./index182.cjs"),w=require("./index159.cjs"),L=require("./index187.cjs"),c=require("./index155.cjs"),M=require("./index251.cjs"),S=require("./index113.cjs"),T="0x5792579257925792579257925792579257925792579257925792579257925792",v=c.numberToHex(0,{size:32});async function _(i,s){const{account:p=i.account,capabilities:l,chain:u=i.chain,experimental_fallback:C,experimental_fallbackDelay:m=32,forceAtomic:b=!1,id:x,version:y="2.0.0"}=s,r=p?k.parseAccount(p):null,d=s.calls.map(a=>{const e=a,o=e.abi?N.encodeFunctionData({abi:e.abi,functionName:e.functionName,args:e.args}):e.data;return{data:e.dataSuffix&&o?w.concat([o,e.dataSuffix]):o,to:e.to,value:e.value?c.numberToHex(e.value):void 0}});try{const a=await i.request({method:"wallet_sendCalls",params:[{atomicRequired:b,calls:d,capabilities:l,chainId:c.numberToHex(u.id),from:r==null?void 0:r.address,id:x,version:y}]},{retryCount:0});return typeof a=="string"?{id:a}:a}catch(a){const e=a;if(C&&(e.name==="MethodNotFoundRpcError"||e.name==="MethodNotSupportedRpcError"||e.name==="UnknownRpcError"||e.details.toLowerCase().includes("does not exist / is not available")||e.details.toLowerCase().includes("missing or invalid. request()")||e.details.toLowerCase().includes("did not match any variant of untagged enum")||e.details.toLowerCase().includes("account upgraded to unsupported contract")||e.details.toLowerCase().includes("eip-7702 not supported")||e.details.toLowerCase().includes("unsupported wc_ method")||e.details.toLowerCase().includes("feature toggled misconfigured"))){if(l&&Object.values(l).some(n=>!n.optional)){const n="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new g.UnsupportedNonOptionalCapabilityError(new h.BaseError(n,{details:n}))}if(b&&d.length>1){const t="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new g.AtomicityNotSupportedError(new h.BaseError(t,{details:t}))}const o=[];for(const t of d){const n=S.sendTransaction(i,{account:r,chain:u,data:t.data,to:t.to,value:t.value?L.hexToBigInt(t.value):void 0});o.push(n),m>0&&await new Promise(E=>setTimeout(E,m))}const f=await Promise.allSettled(o);if(f.every(t=>t.status==="rejected"))throw f[0].reason;const q=f.map(t=>t.status==="fulfilled"?t.value:v);return{id:w.concat([...q,c.numberToHex(u.id,{size:32}),T])}}throw M.getTransactionError(a,{...s,account:r,chain:s.chain})}}exports.fallbackMagicIdentifier=T;exports.fallbackTransactionErrorMagicIdentifier=v;exports.sendCalls=_;
package/dist/index112.js CHANGED
@@ -3,28 +3,28 @@ import { BaseError as w } from "./index41.js";
3
3
  import { UnsupportedNonOptionalCapabilityError as N, AtomicityNotSupportedError as T } from "./index143.js";
4
4
  import { encodeFunctionData as k } from "./index182.js";
5
5
  import { concat as b } from "./index159.js";
6
- import { hexToBigInt as _ } from "./index187.js";
6
+ import { hexToBigInt as L } from "./index187.js";
7
7
  import { numberToHex as c } from "./index155.js";
8
- import { getTransactionError as L } from "./index251.js";
8
+ import { getTransactionError as _ } from "./index251.js";
9
9
  import { sendTransaction as S } from "./index113.js";
10
10
  const A = "0x5792579257925792579257925792579257925792579257925792579257925792", I = c(0, {
11
11
  size: 32
12
12
  });
13
13
  async function P(i, s) {
14
- const { account: f = i.account, capabilities: l, chain: d = i.chain, experimental_fallback: g, experimental_fallbackDelay: m = 32, forceAtomic: h = !1, id: v, version: C = "2.0.0" } = s, r = f ? E(f) : null, u = s.calls.map((a) => {
15
- const t = a, e = t.abi ? k({
14
+ const { account: f = i.account, capabilities: l, chain: d = i.chain, experimental_fallback: g, experimental_fallbackDelay: m = 32, forceAtomic: h = !1, id: v, version: C = "2.0.0" } = s, r = f ? E(f) : null, u = s.calls.map((e) => {
15
+ const t = e, a = t.abi ? k({
16
16
  abi: t.abi,
17
17
  functionName: t.functionName,
18
18
  args: t.args
19
19
  }) : t.data;
20
20
  return {
21
- data: t.dataSuffix && e ? b([e, t.dataSuffix]) : e,
21
+ data: t.dataSuffix && a ? b([a, t.dataSuffix]) : a,
22
22
  to: t.to,
23
23
  value: t.value ? c(t.value) : void 0
24
24
  };
25
25
  });
26
26
  try {
27
- const a = await i.request({
27
+ const e = await i.request({
28
28
  method: "wallet_sendCalls",
29
29
  params: [
30
30
  {
@@ -38,10 +38,10 @@ async function P(i, s) {
38
38
  }
39
39
  ]
40
40
  }, { retryCount: 0 });
41
- return typeof a == "string" ? { id: a } : a;
42
- } catch (a) {
43
- const t = a;
44
- if (g && (t.name === "MethodNotFoundRpcError" || t.name === "MethodNotSupportedRpcError" || t.name === "UnknownRpcError" || t.details.toLowerCase().includes("does not exist / is not available") || t.details.toLowerCase().includes("missing or invalid. request()") || t.details.toLowerCase().includes("did not match any variant of untagged enum") || t.details.toLowerCase().includes("account upgraded to unsupported contract") || t.details.toLowerCase().includes("eip-7702 not supported") || t.details.toLowerCase().includes("unsupported wc_ method"))) {
41
+ return typeof e == "string" ? { id: e } : e;
42
+ } catch (e) {
43
+ const t = e;
44
+ if (g && (t.name === "MethodNotFoundRpcError" || t.name === "MethodNotSupportedRpcError" || t.name === "UnknownRpcError" || t.details.toLowerCase().includes("does not exist / is not available") || t.details.toLowerCase().includes("missing or invalid. request()") || t.details.toLowerCase().includes("did not match any variant of untagged enum") || t.details.toLowerCase().includes("account upgraded to unsupported contract") || t.details.toLowerCase().includes("eip-7702 not supported") || t.details.toLowerCase().includes("unsupported wc_ method") || t.details.toLowerCase().includes("feature toggled misconfigured"))) {
45
45
  if (l && Object.values(l).some((n) => !n.optional)) {
46
46
  const n = "non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";
47
47
  throw new N(new w(n, {
@@ -54,18 +54,18 @@ async function P(i, s) {
54
54
  details: o
55
55
  }));
56
56
  }
57
- const e = [];
57
+ const a = [];
58
58
  for (const o of u) {
59
59
  const n = S(i, {
60
60
  account: r,
61
61
  chain: d,
62
62
  data: o.data,
63
63
  to: o.to,
64
- value: o.value ? _(o.value) : void 0
64
+ value: o.value ? L(o.value) : void 0
65
65
  });
66
- e.push(n), m > 0 && await new Promise((x) => setTimeout(x, m));
66
+ a.push(n), m > 0 && await new Promise((x) => setTimeout(x, m));
67
67
  }
68
- const p = await Promise.allSettled(e);
68
+ const p = await Promise.allSettled(a);
69
69
  if (p.every((o) => o.status === "rejected"))
70
70
  throw p[0].reason;
71
71
  const y = p.map((o) => o.status === "fulfilled" ? o.value : I);
@@ -77,7 +77,7 @@ async function P(i, s) {
77
77
  ])
78
78
  };
79
79
  }
80
- throw L(a, {
80
+ throw _(e, {
81
81
  ...s,
82
82
  account: r,
83
83
  chain: s.chain
package/dist/index121.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("./index41.cjs"),p=require("./index52.cjs"),e=require("./index143.cjs"),I=require("./index155.cjs"),q=require("./index280.cjs"),m=require("./index46.cjs"),v=require("./index47.cjs");function N(t,E={}){return async(c,h={})=>{var i;const{dedupe:s=!1,methods:o,retryDelay:R=150,retryCount:l=3,uid:f}={...E,...h},{method:d}=c;if((i=o==null?void 0:o.exclude)!=null&&i.includes(d))throw new e.MethodNotSupportedRpcError(new Error("method not supported"),{method:d});if(o!=null&&o.include&&!o.include.includes(d))throw new e.MethodNotSupportedRpcError(new Error("method not supported"),{method:d});const y=s?I.stringToHex(`${f}.${v.stringify(c)}`):void 0;return q.withDedupe(()=>m.withRetry(async()=>{try{return await t(c)}catch(n){const r=n;switch(r.code){case e.ParseRpcError.code:throw new e.ParseRpcError(r);case e.InvalidRequestRpcError.code:throw new e.InvalidRequestRpcError(r);case e.MethodNotFoundRpcError.code:throw new e.MethodNotFoundRpcError(r,{method:c.method});case e.InvalidParamsRpcError.code:throw new e.InvalidParamsRpcError(r);case e.InternalRpcError.code:throw new e.InternalRpcError(r);case e.InvalidInputRpcError.code:throw new e.InvalidInputRpcError(r);case e.ResourceNotFoundRpcError.code:throw new e.ResourceNotFoundRpcError(r);case e.ResourceUnavailableRpcError.code:throw new e.ResourceUnavailableRpcError(r);case e.TransactionRejectedRpcError.code:throw new e.TransactionRejectedRpcError(r);case e.MethodNotSupportedRpcError.code:throw new e.MethodNotSupportedRpcError(r,{method:c.method});case e.LimitExceededRpcError.code:throw new e.LimitExceededRpcError(r);case e.JsonRpcVersionUnsupportedError.code:throw new e.JsonRpcVersionUnsupportedError(r);case e.UserRejectedRequestError.code:throw new e.UserRejectedRequestError(r);case e.UnauthorizedProviderError.code:throw new e.UnauthorizedProviderError(r);case e.UnsupportedProviderMethodError.code:throw new e.UnsupportedProviderMethodError(r);case e.ProviderDisconnectedError.code:throw new e.ProviderDisconnectedError(r);case e.ChainDisconnectedError.code:throw new e.ChainDisconnectedError(r);case e.SwitchChainError.code:throw new e.SwitchChainError(r);case e.UnsupportedNonOptionalCapabilityError.code:throw new e.UnsupportedNonOptionalCapabilityError(r);case e.UnsupportedChainIdError.code:throw new e.UnsupportedChainIdError(r);case e.DuplicateIdError.code:throw new e.DuplicateIdError(r);case e.UnknownBundleIdError.code:throw new e.UnknownBundleIdError(r);case e.BundleTooLargeError.code:throw new e.BundleTooLargeError(r);case e.AtomicReadyWalletRejectedUpgradeError.code:throw new e.AtomicReadyWalletRejectedUpgradeError(r);case e.AtomicityNotSupportedError.code:throw new e.AtomicityNotSupportedError(r);case 5e3:throw new e.UserRejectedRequestError(r);default:throw n instanceof U.BaseError?n:new e.UnknownRpcError(r)}}},{delay:({count:n,error:r})=>{var a;if(r&&r instanceof p.HttpRequestError){const u=(a=r==null?void 0:r.headers)==null?void 0:a.get("Retry-After");if(u!=null&&u.match(/\d/))return Number.parseInt(u)*1e3}return~~(1<<n)*R},retryCount:l,shouldRetry:({error:n})=>w(n)}),{enabled:s,id:y})}}function w(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===e.LimitExceededRpcError.code||t.code===e.InternalRpcError.code:t instanceof p.HttpRequestError&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}exports.buildRequest=N;exports.shouldRetry=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("./index41.cjs"),p=require("./index52.cjs"),e=require("./index143.cjs"),I=require("./index155.cjs"),q=require("./index277.cjs"),m=require("./index46.cjs"),v=require("./index47.cjs");function N(t,E={}){return async(c,h={})=>{var i;const{dedupe:s=!1,methods:o,retryDelay:R=150,retryCount:l=3,uid:f}={...E,...h},{method:d}=c;if((i=o==null?void 0:o.exclude)!=null&&i.includes(d))throw new e.MethodNotSupportedRpcError(new Error("method not supported"),{method:d});if(o!=null&&o.include&&!o.include.includes(d))throw new e.MethodNotSupportedRpcError(new Error("method not supported"),{method:d});const y=s?I.stringToHex(`${f}.${v.stringify(c)}`):void 0;return q.withDedupe(()=>m.withRetry(async()=>{try{return await t(c)}catch(n){const r=n;switch(r.code){case e.ParseRpcError.code:throw new e.ParseRpcError(r);case e.InvalidRequestRpcError.code:throw new e.InvalidRequestRpcError(r);case e.MethodNotFoundRpcError.code:throw new e.MethodNotFoundRpcError(r,{method:c.method});case e.InvalidParamsRpcError.code:throw new e.InvalidParamsRpcError(r);case e.InternalRpcError.code:throw new e.InternalRpcError(r);case e.InvalidInputRpcError.code:throw new e.InvalidInputRpcError(r);case e.ResourceNotFoundRpcError.code:throw new e.ResourceNotFoundRpcError(r);case e.ResourceUnavailableRpcError.code:throw new e.ResourceUnavailableRpcError(r);case e.TransactionRejectedRpcError.code:throw new e.TransactionRejectedRpcError(r);case e.MethodNotSupportedRpcError.code:throw new e.MethodNotSupportedRpcError(r,{method:c.method});case e.LimitExceededRpcError.code:throw new e.LimitExceededRpcError(r);case e.JsonRpcVersionUnsupportedError.code:throw new e.JsonRpcVersionUnsupportedError(r);case e.UserRejectedRequestError.code:throw new e.UserRejectedRequestError(r);case e.UnauthorizedProviderError.code:throw new e.UnauthorizedProviderError(r);case e.UnsupportedProviderMethodError.code:throw new e.UnsupportedProviderMethodError(r);case e.ProviderDisconnectedError.code:throw new e.ProviderDisconnectedError(r);case e.ChainDisconnectedError.code:throw new e.ChainDisconnectedError(r);case e.SwitchChainError.code:throw new e.SwitchChainError(r);case e.UnsupportedNonOptionalCapabilityError.code:throw new e.UnsupportedNonOptionalCapabilityError(r);case e.UnsupportedChainIdError.code:throw new e.UnsupportedChainIdError(r);case e.DuplicateIdError.code:throw new e.DuplicateIdError(r);case e.UnknownBundleIdError.code:throw new e.UnknownBundleIdError(r);case e.BundleTooLargeError.code:throw new e.BundleTooLargeError(r);case e.AtomicReadyWalletRejectedUpgradeError.code:throw new e.AtomicReadyWalletRejectedUpgradeError(r);case e.AtomicityNotSupportedError.code:throw new e.AtomicityNotSupportedError(r);case 5e3:throw new e.UserRejectedRequestError(r);default:throw n instanceof U.BaseError?n:new e.UnknownRpcError(r)}}},{delay:({count:n,error:r})=>{var a;if(r&&r instanceof p.HttpRequestError){const u=(a=r==null?void 0:r.headers)==null?void 0:a.get("Retry-After");if(u!=null&&u.match(/\d/))return Number.parseInt(u)*1e3}return~~(1<<n)*R},retryCount:l,shouldRetry:({error:n})=>w(n)}),{enabled:s,id:y})}}function w(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===e.LimitExceededRpcError.code||t.code===e.InternalRpcError.code:t instanceof p.HttpRequestError&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}exports.buildRequest=N;exports.shouldRetry=w;
package/dist/index121.js CHANGED
@@ -2,7 +2,7 @@ import { BaseError as z } from "./index41.js";
2
2
  import { HttpRequestError as k } from "./index52.js";
3
3
  import { MethodNotSupportedRpcError as s, UnknownRpcError as J, UserRejectedRequestError as u, AtomicityNotSupportedError as f, AtomicReadyWalletRejectedUpgradeError as E, BundleTooLargeError as l, UnknownBundleIdError as R, DuplicateIdError as m, UnsupportedChainIdError as y, UnsupportedNonOptionalCapabilityError as I, SwitchChainError as U, ChainDisconnectedError as v, ProviderDisconnectedError as b, UnsupportedProviderMethodError as N, UnauthorizedProviderError as q, JsonRpcVersionUnsupportedError as C, LimitExceededRpcError as a, TransactionRejectedRpcError as D, ResourceUnavailableRpcError as P, ResourceNotFoundRpcError as x, InvalidInputRpcError as j, InternalRpcError as i, InvalidParamsRpcError as B, MethodNotFoundRpcError as M, InvalidRequestRpcError as S, ParseRpcError as T } from "./index143.js";
4
4
  import { stringToHex as O } from "./index155.js";
5
- import { withDedupe as V } from "./index280.js";
5
+ import { withDedupe as V } from "./index277.js";
6
6
  import { withRetry as W } from "./index46.js";
7
7
  import { stringify as _ } from "./index47.js";
8
8
  function te(r, A = {}) {
package/dist/index130.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="2.33.3";exports.version=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="2.35.1";exports.version=e;
package/dist/index130.js CHANGED
@@ -1,4 +1,4 @@
1
- const o = "2.33.3";
1
+ const o = "2.35.1";
2
2
  export {
3
3
  o as version
4
4
  };
package/dist/index16.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index5.cjs"),a=require("./index28.cjs"),s=require("./index27.cjs"),l=require("./index29.cjs"),b=require("./index25.cjs"),n={42161:s.mainnet,421614:a.sepolia},h=async r=>{const{chain:e}=r;if(!e)return c.Err("No chain found");const o=(u=>u in n)(e.id)?n[e.id]:e;return await i(o)},i=async r=>{const e=l.createPublicClient({chain:r,transport:b.http()});try{const t=await e.getBlockNumber();return c.Ok(Number(t))}catch(t){return c.Err("Failed to fetch evm block number",t)}};exports._fetchEVMBlockNumber=i;exports.fetchEVMBlockNumber=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index5.cjs"),a=require("./index24.cjs"),s=require("./index25.cjs"),l=require("./index26.cjs"),b=require("./index27.cjs"),n={42161:s.mainnet,421614:a.sepolia},h=async r=>{const{chain:e}=r;if(!e)return c.Err("No chain found");const o=(u=>u in n)(e.id)?n[e.id]:e;return await i(o)},i=async r=>{const e=l.createPublicClient({chain:r,transport:b.http()});try{const t=await e.getBlockNumber();return c.Ok(Number(t))}catch(t){return c.Err("Failed to fetch evm block number",t)}};exports._fetchEVMBlockNumber=i;exports.fetchEVMBlockNumber=h;
package/dist/index16.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Err as c, Ok as a } from "./index5.js";
2
- import { sepolia as m } from "./index28.js";
3
- import { mainnet as s } from "./index27.js";
4
- import { createPublicClient as u } from "./index29.js";
5
- import { http as l } from "./index25.js";
2
+ import { sepolia as m } from "./index24.js";
3
+ import { mainnet as s } from "./index25.js";
4
+ import { createPublicClient as u } from "./index26.js";
5
+ import { http as l } from "./index27.js";
6
6
  const n = {
7
7
  42161: s,
8
8
  421614: m
package/dist/index18.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index30.cjs"),u=require("./index31.cjs");class l{static async _postWithFallback(a,t){let r="";for(const n of a)try{const s=await fetch(n,{method:"POST",...t});if(s.status>=500){r=await(s.text()||s.json());continue}return await this.parse(s)}catch(s){r=o(s);continue}throw new Error(r||"All APIs failed")}static async postWithFallback(a,t){return await c(t).retry(()=>this._postWithFallback(a,t))}static async _getWithFallback(a,t){let r="";for(const n of a)try{const s=await fetch(n,t);if(s.status>=500){r=await(s.text()||s.json());continue}return await this.parse(s)}catch(s){r=o(s);continue}throw new Error(r||"All APIs failed")}static async getWithFallback(a,t){return await c(t).retry(()=>this._getWithFallback(a,t))}static async _get(a,t){return await this.parse(await fetch(a,t))}static async get(a,t){return await c(t).retry(()=>this._get(a,t))}static async _post(a,t){return await this.parse(await fetch(a,{method:"POST",...t}))}static async post(a,t){return await c(t).retry(()=>this._post(a,t))}static async parse(a){const t=await a.text();if(a.status>=200&&a.status<300)return u.safeParseJson(t);throw new Error(t)}}function o(e){return(e==null?void 0:e.message)||(e==null?void 0:e.toString())||"unknown error"}const c=e=>new i.Retry((e==null?void 0:e.retryCount)??2,(e==null?void 0:e.retryDelay)??1e3);exports.Fetcher=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./index30.cjs"),i=require("./index31.cjs");class u{static async _postWithFallback(a,t){let r="";for(const n of a)try{const s=await fetch(n,{method:"POST",...t});if(s.status>=500){r=await(s.text()||s.json());continue}return await this.parse(s)}catch(s){r=o(s);continue}throw new Error(r||"All APIs failed")}static async postWithFallback(a,t){return await c(t).retry(()=>this._postWithFallback(a,t))}static async _getWithFallback(a,t){let r="";for(const n of a)try{const s=await fetch(n,t);if(s.status>=500){r=await(s.text()||s.json());continue}return await this.parse(s)}catch(s){r=o(s);continue}throw new Error(r||"All APIs failed")}static async getWithFallback(a,t){return await c(t).retry(()=>this._getWithFallback(a,t))}static async _get(a,t){return await this.parse(await fetch(a,t))}static async get(a,t){return await c(t).retry(()=>this._get(a,t))}static async _post(a,t){return await this.parse(await fetch(a,{method:"POST",...t}))}static async post(a,t){return await c(t).retry(()=>this._post(a,t))}static async _patch(a,t){return await this.parse(await fetch(a,{method:"PATCH",...t}))}static async patch(a,t){return await c(t).retry(()=>this._patch(a,t))}static async parse(a){const t=await a.text();if(a.status>=200&&a.status<300)return i.safeParseJson(t);throw new Error(t)}}function o(e){return(e==null?void 0:e.message)||(e==null?void 0:e.toString())||"unknown error"}const c=e=>new h.Retry((e==null?void 0:e.retryCount)??2,(e==null?void 0:e.retryDelay)??1e3);exports.Fetcher=u;
package/dist/index18.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { Retry as h } from "./index30.js";
2
2
  import { safeParseJson as i } from "./index31.js";
3
- class w {
3
+ class l {
4
4
  static async _postWithFallback(a, t) {
5
5
  let r = "";
6
- for (const o of a)
6
+ for (const n of a)
7
7
  try {
8
- const e = await fetch(o, {
8
+ const e = await fetch(n, {
9
9
  method: "POST",
10
10
  ...t
11
11
  });
@@ -15,7 +15,7 @@ class w {
15
15
  }
16
16
  return await this.parse(e);
17
17
  } catch (e) {
18
- r = n(e);
18
+ r = o(e);
19
19
  continue;
20
20
  }
21
21
  throw new Error(r || "All APIs failed");
@@ -34,16 +34,16 @@ class w {
34
34
  }
35
35
  static async _getWithFallback(a, t) {
36
36
  let r = "";
37
- for (const o of a)
37
+ for (const n of a)
38
38
  try {
39
- const e = await fetch(o, t);
39
+ const e = await fetch(n, t);
40
40
  if (e.status >= 500) {
41
41
  r = await (e.text() || e.json());
42
42
  continue;
43
43
  }
44
44
  return await this.parse(e);
45
45
  } catch (e) {
46
- r = n(e);
46
+ r = o(e);
47
47
  continue;
48
48
  }
49
49
  throw new Error(r || "All APIs failed");
@@ -87,6 +87,17 @@ class w {
87
87
  static async post(a, t) {
88
88
  return await c(t).retry(() => this._post(a, t));
89
89
  }
90
+ static async _patch(a, t) {
91
+ return await this.parse(
92
+ await fetch(a, {
93
+ method: "PATCH",
94
+ ...t
95
+ })
96
+ );
97
+ }
98
+ static async patch(a, t) {
99
+ return await c(t).retry(() => this._patch(a, t));
100
+ }
90
101
  /**
91
102
  * Parses the response and returns the result as the specified type.
92
103
  *
@@ -100,10 +111,10 @@ class w {
100
111
  throw new Error(t);
101
112
  }
102
113
  }
103
- function n(s) {
114
+ function o(s) {
104
115
  return (s == null ? void 0 : s.message) || (s == null ? void 0 : s.toString()) || "unknown error";
105
116
  }
106
117
  const c = (s) => new h((s == null ? void 0 : s.retryCount) ?? 2, (s == null ? void 0 : s.retryDelay) ?? 1e3);
107
118
  export {
108
- w as Fetcher
119
+ l as Fetcher
109
120
  };
package/dist/index197.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./index281.cjs"),F=require("./index282.cjs"),n=require("./index283.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const p={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")};BigInt(0);const P=BigInt(1),u=BigInt(2),h=(t,f)=>(t+f/u)/f;function G(t){const f=p.p,e=BigInt(3),a=BigInt(6),B=BigInt(11),r=BigInt(22),s=BigInt(23),i=BigInt(44),d=BigInt(88),o=t*t*t%f,c=o*o*t%f,b=n.pow2(c,e,f)*c%f,g=n.pow2(b,e,f)*c%f,_=n.pow2(g,u,f)*o%f,I=n.pow2(_,B,f)*_%f,w=n.pow2(I,r,f)*I%f,x=n.pow2(w,i,f)*w%f,k=n.pow2(x,d,f)*x%f,m=n.pow2(k,i,f)*w%f,S=n.pow2(m,e,f)*c%f,E=n.pow2(S,s,f)*I%f,v=n.pow2(E,a,f)*o%f,q=n.pow2(v,u,f);if(!l.eql(l.sqr(q),t))throw new Error("Cannot find square root");return q}const l=n.Field(p.p,void 0,void 0,{sqrt:G}),M=F.createCurve({...p,Fp:l,lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const f=p.n,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),a=-P*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),B=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),r=e,s=BigInt("0x100000000000000000000000000000000"),i=h(r*t,f),d=h(-a*t,f);let o=n.mod(t-i*e-d*B,f),c=n.mod(-i*a-d*r,f);const b=o>s,g=c>s;if(b&&(o=f-o),g&&(c=f-c),o>s||c>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:b,k1:o,k2neg:g,k2:c}}}},C.sha256);exports.secp256k1=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./index280.cjs"),m=require("./index281.cjs"),t=require("./index282.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const i={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},v={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},B=BigInt(2);function G(n){const f=i.p,o=BigInt(3),I=BigInt(6),w=BigInt(11),u=BigInt(22),_=BigInt(23),d=BigInt(44),x=BigInt(88),c=n*n*n%f,e=c*c*n%f,l=t.pow2(e,o,f)*e%f,q=t.pow2(l,o,f)*e%f,r=t.pow2(q,B,f)*c%f,s=t.pow2(r,w,f)*r%f,b=t.pow2(s,u,f)*s%f,g=t.pow2(b,d,f)*b%f,h=t.pow2(g,x,f)*g%f,k=t.pow2(h,d,f)*b%f,C=t.pow2(k,o,f)*e%f,E=t.pow2(C,_,f)*s%f,F=t.pow2(E,I,f)*c%f,p=t.pow2(F,B,f);if(!a.eql(a.sqr(p),n))throw new Error("Cannot find square root");return p}const a=t.Field(i.p,{sqrt:G}),M=m.createCurve({...i,Fp:a,lowS:!0,endo:v},S.sha256);exports.secp256k1=M;
package/dist/index197.js CHANGED
@@ -1,8 +1,8 @@
1
- import { sha256 as v } from "./index281.js";
2
- import { createCurve as G } from "./index282.js";
3
- import { Field as P, mod as h, pow2 as t } from "./index283.js";
1
+ import { sha256 as F } from "./index280.js";
2
+ import { createCurve as G } from "./index281.js";
3
+ import { Field as v, pow2 as n } from "./index282.js";
4
4
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
5
- const B = {
5
+ const i = {
6
6
  p: BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),
7
7
  n: BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),
8
8
  h: BigInt(1),
@@ -10,33 +10,20 @@ const B = {
10
10
  b: BigInt(7),
11
11
  Gx: BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),
12
12
  Gy: BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")
13
- };
14
- BigInt(0);
15
- const M = BigInt(1), x = BigInt(2), k = (n, f) => (n + f / x) / f;
16
- function N(n) {
17
- const f = B.p, e = BigInt(3), a = BigInt(6), I = BigInt(11), b = BigInt(22), s = BigInt(23), i = BigInt(44), r = BigInt(88), c = n * n * n % f, o = c * c * n % f, d = t(o, e, f) * o % f, g = t(d, e, f) * o % f, m = t(g, x, f) * c % f, p = t(m, I, f) * m % f, _ = t(p, b, f) * p % f, u = t(_, i, f) * _ % f, q = t(u, r, f) * u % f, E = t(q, i, f) * _ % f, C = t(E, e, f) * o % f, F = t(C, s, f) * p % f, S = t(F, a, f) * c % f, w = t(S, x, f);
18
- if (!l.eql(l.sqr(w), n))
13
+ }, D = {
14
+ beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),
15
+ basises: [
16
+ [BigInt("0x3086d221a7d46bcde86c90e49284eb15"), -BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],
17
+ [BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"), BigInt("0x3086d221a7d46bcde86c90e49284eb15")]
18
+ ]
19
+ }, I = /* @__PURE__ */ BigInt(2);
20
+ function M(t) {
21
+ const f = i.p, o = BigInt(3), p = BigInt(6), x = BigInt(11), _ = BigInt(22), m = BigInt(23), d = BigInt(44), q = BigInt(88), c = t * t * t % f, e = c * c * t % f, u = n(e, o, f) * e % f, k = n(u, o, f) * e % f, r = n(k, I, f) * c % f, b = n(r, x, f) * r % f, s = n(b, _, f) * b % f, g = n(s, d, f) * s % f, w = n(g, q, f) * g % f, h = n(w, d, f) * s % f, l = n(h, o, f) * e % f, C = n(l, m, f) * b % f, E = n(C, p, f) * c % f, B = n(E, I, f);
22
+ if (!a.eql(a.sqr(B), t))
19
23
  throw new Error("Cannot find square root");
20
- return w;
24
+ return B;
21
25
  }
22
- const l = P(B.p, void 0, void 0, { sqrt: N }), V = G({
23
- ...B,
24
- Fp: l,
25
- lowS: !0,
26
- // Allow only low-S signatures by default in sign() and verify()
27
- endo: {
28
- // Endomorphism, see above
29
- beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),
30
- splitScalar: (n) => {
31
- const f = B.n, e = BigInt("0x3086d221a7d46bcde86c90e49284eb15"), a = -M * BigInt("0xe4437ed6010e88286f547fa90abfe4c3"), I = BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"), b = e, s = BigInt("0x100000000000000000000000000000000"), i = k(b * n, f), r = k(-a * n, f);
32
- let c = h(n - i * e - r * I, f), o = h(-i * a - r * b, f);
33
- const d = c > s, g = o > s;
34
- if (d && (c = f - c), g && (o = f - o), c > s || o > s)
35
- throw new Error("splitScalar: Endomorphism failed, k=" + n);
36
- return { k1neg: d, k1: c, k2neg: g, k2: o };
37
- }
38
- }
39
- }, v);
26
+ const a = v(i.p, { sqrt: M }), R = G({ ...i, Fp: a, lowS: !0, endo: D }, F);
40
27
  export {
41
- V as secp256k1
28
+ R as secp256k1
42
29
  };
package/dist/index22.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],n=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],e=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],a=[...e,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],s=[...e,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],p=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],i=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],r=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],y=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}];exports.addressResolverAbi=i;exports.batchGatewayAbi=n;exports.erc20Abi=y;exports.multicall3Abi=t;exports.textResolverAbi=p;exports.universalResolverResolveAbi=a;exports.universalResolverReverseAbi=s;exports.universalSignatureValidatorAbi=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],n=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],e=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],a=[...e,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],s=[...e,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],p=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],i=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],r=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],y=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}];exports.addressResolverAbi=i;exports.batchGatewayAbi=n;exports.erc20Abi=y;exports.multicall3Abi=t;exports.textResolverAbi=p;exports.universalResolverResolveAbi=a;exports.universalResolverReverseAbi=s;exports.universalSignatureValidatorAbi=r;