@springmicro/auth 0.3.0 → 0.3.5

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 (148) hide show
  1. package/.eslintrc.cjs +0 -0
  2. package/README.md +60 -60
  3. package/dist/{Index-c419311f-DolmVisI.js → Index-64ac63ff-mcEPPGzJ.js} +101 -102
  4. package/dist/{Index-652aeb8c-Cr1mbyJJ.js → Index-6c094240-D4xpr8fA.js} +70 -71
  5. package/dist/{Web3Auth-C5tucK1E.js → Web3Auth-DB9s-qbl.js} +12454 -12511
  6. package/dist/alphawallet-B7eovdf-.js +0 -0
  7. package/dist/apexwallet-ysP20G9D.js +0 -0
  8. package/dist/atoken-BBnNTzcz.js +0 -0
  9. package/dist/bifrostwallet-CNNBO92h.js +0 -0
  10. package/dist/binance-DvPgAzCw.js +0 -0
  11. package/dist/bitget-DZOUrwgy.js +0 -0
  12. package/dist/bitpie-C_uxmEzw.js +0 -0
  13. package/dist/bitski-DpzkHNkv.js +0 -0
  14. package/dist/blockwallet-BL69cqkA.js +0 -0
  15. package/dist/brave-DnRzMQYW.js +0 -0
  16. package/dist/ccip-c78d2f16-DLcRlwod.js +0 -0
  17. package/dist/coin98wallet-CkFdOvXt.js +0 -0
  18. package/dist/coinbase-CaGNx5if.js +0 -0
  19. package/dist/core-9rK8tWud.js +0 -0
  20. package/dist/defiwallet-0AsgJBSy.js +0 -0
  21. package/dist/detected-CX_JZaUk.js +0 -0
  22. package/dist/echooo-CmaetT_Z.js +0 -0
  23. package/dist/enkrypt-BibtwvK7.js +0 -0
  24. package/dist/exodus-BxzkDWWP.js +0 -0
  25. package/dist/fordefi-CvKyVwhI.js +0 -0
  26. package/dist/foxwallet-D7c_LDTf.js +0 -0
  27. package/dist/frame-CDfNmjUy.js +0 -0
  28. package/dist/frontier-DqKNSj2z.js +0 -0
  29. package/dist/hashMessage-Dw0KdqMZ.js +2101 -0
  30. package/dist/huobiwallet-CxSwqa5L.js +0 -0
  31. package/dist/hyperpay-nmHE3WqM.js +0 -0
  32. package/dist/icon-2Zqy7pqQ.js +0 -0
  33. package/dist/icon-CGWI1Ies.js +0 -0
  34. package/dist/icon-C_O4nprO.js +0 -0
  35. package/dist/icon-DbgmZCnU.js +0 -0
  36. package/dist/icon-Dbjb6jc5.js +20 -0
  37. package/dist/icon-cAd7RhSC.js +0 -0
  38. package/dist/imtoken-yENtOTS3.js +0 -0
  39. package/dist/index-021f6a62-Zz543EDB.js +0 -0
  40. package/dist/index-40a497ea-Bn2mC0r7.js +0 -0
  41. package/dist/{index-YKlm7xSx.js → index-C0yeApwY.js} +750 -751
  42. package/dist/{index-C4uVsW-I.js → index-CDaoza_m.js} +2 -2
  43. package/dist/index-CiwBcaZ0.js +384 -0
  44. package/dist/{index-DOUI-2vv.js → index-CroNOC7e.js} +27 -29
  45. package/dist/{index-Boi-WcMK.js → index-Df5ie3cE.js} +2 -2
  46. package/dist/{index-DzOmdGpF.js → index-F-gl3DJX.js} +8 -10
  47. package/dist/index-wNV8PBAh.js +11412 -0
  48. package/dist/index.d.ts +0 -0
  49. package/dist/index.js +1 -1
  50. package/dist/index.umd.cjs +327 -291
  51. package/dist/infinitywallet-C8J4FUYw.js +0 -0
  52. package/dist/kayros-AIrUK1za.js +0 -0
  53. package/dist/keplr-CyLTca9B.js +36 -0
  54. package/dist/lif3wallet-C5D6r8pg.js +0 -0
  55. package/dist/liquality-nbCtErVq.js +0 -0
  56. package/dist/mathwallet-CWkivCXo.js +0 -0
  57. package/dist/meetone-kKmvI8md.js +0 -0
  58. package/dist/metamask-BN7yiDV1.js +0 -0
  59. package/dist/mykey-CQZ6UcLH.js +0 -0
  60. package/dist/native-FDN9oNjc.js +15 -0
  61. package/dist/{number-UhidYs-H.js → number-ByqdQYDu.js} +1 -1
  62. package/dist/okxwallet-CJLVogh2.js +0 -0
  63. package/dist/oneInch-CciyZ4Pz.js +0 -0
  64. package/dist/onekey-Dal8kYjU.js +0 -0
  65. package/dist/opera-DnKg-TJU.js +0 -0
  66. package/dist/ownbit-BshJUVuW.js +0 -0
  67. package/dist/phantom-CJ8dIcov.js +0 -0
  68. package/dist/rabby-D4thTcd6.js +0 -0
  69. package/dist/rainbow-mXld6yWV.js +0 -0
  70. package/dist/roninwallet-ZyYrd-D1.js +0 -0
  71. package/dist/safeheron-Eg1Jb29V.js +0 -0
  72. package/dist/safepal-DVIKy94N.js +0 -0
  73. package/dist/sequence-BS2IbtDg.js +0 -0
  74. package/dist/stablewallet-jyB079Wb.js +0 -0
  75. package/dist/status-FrAvQjfn.js +0 -0
  76. package/dist/subwallet-DMvFqKyY.js +0 -0
  77. package/dist/talisman-Bp8zUXqB.js +0 -0
  78. package/dist/tallywallet-B4OS9nIr.js +0 -0
  79. package/dist/tokenary-C7jjcbQa.js +0 -0
  80. package/dist/tokenpocket-9ZRPmAFA.js +0 -0
  81. package/dist/tp-V2em5bdl.js +0 -0
  82. package/dist/transactionRequest-be6a8ea9-CUKWo5mx.js +0 -0
  83. package/dist/trust-SgHubMq7.js +20 -0
  84. package/dist/xdefi-COVIyGz4.js +0 -0
  85. package/dist/zeal-DxHbDqm0.js +0 -0
  86. package/dist/zerion-BfW0UElc.js +0 -0
  87. package/dist/zodiacpilot-CrId6F4w.js +0 -0
  88. package/index.html +0 -0
  89. package/package.json +2 -2
  90. package/src/auth/config.ts +91 -91
  91. package/src/components/SignUp.tsx +442 -442
  92. package/src/components/forms/AgreementModal.tsx +88 -88
  93. package/src/components/forms/CaptchaController.tsx +94 -94
  94. package/src/components/forms/CaptchaModal.jsx +171 -171
  95. package/src/components/forms/CaptchaWidget.jsx +146 -146
  96. package/src/components/forms/PasswordChecker.ts +88 -88
  97. package/src/components/forms/SendCodeInput.tsx +149 -149
  98. package/src/components/forms/SignUpFormItem.tsx +704 -704
  99. package/src/components/forms/util/application-api.ts +155 -155
  100. package/src/components/forms/util/auth-api.ts +198 -198
  101. package/src/components/forms/util/auth-util.tsx +346 -346
  102. package/src/components/forms/util/core.ts +493 -493
  103. package/src/components/forms/util/invitation-api.ts +132 -132
  104. package/src/components/forms/util/provider.tsx +603 -603
  105. package/src/components/forms/util/user-api.ts +303 -303
  106. package/src/components/provider/AdfsLoginButton.jsx +38 -38
  107. package/src/components/provider/AlipayLoginButton.jsx +38 -38
  108. package/src/components/provider/AppleLoginButton.jsx +38 -38
  109. package/src/components/provider/AzureADB2CLoginButton.jsx +38 -38
  110. package/src/components/provider/AzureADLoginButton.jsx +38 -38
  111. package/src/components/provider/BaiduLoginButton.jsx +38 -38
  112. package/src/components/provider/BilibiliLoginButton.jsx +37 -37
  113. package/src/components/provider/CasdoorLoginButton.jsx +38 -38
  114. package/src/components/provider/DingTalkLoginButton.jsx +37 -37
  115. package/src/components/provider/DouyinLoginButton.jsx +38 -38
  116. package/src/components/provider/FacebookLoginButton.jsx +37 -37
  117. package/src/components/provider/GitHubLoginButton.jsx +37 -37
  118. package/src/components/provider/GitLabLoginButton.jsx +38 -38
  119. package/src/components/provider/GiteeLoginButton.jsx +34 -34
  120. package/src/components/provider/GoogleLoginButton.jsx +68 -68
  121. package/src/components/provider/InfoflowLoginButton.jsx +38 -38
  122. package/src/components/provider/LarkLoginButton.jsx +38 -38
  123. package/src/components/provider/LinkedInLoginButton.jsx +37 -37
  124. package/src/components/provider/LoginButton.jsx +33 -33
  125. package/src/components/provider/OktaLoginButton.jsx +38 -38
  126. package/src/components/provider/Provider.jsx +3 -3
  127. package/src/components/provider/ProviderButton.jsx +327 -327
  128. package/src/components/provider/QqLoginButton.jsx +31 -31
  129. package/src/components/provider/SelfLoginButton.jsx +47 -47
  130. package/src/components/provider/SlackLoginButton.jsx +38 -38
  131. package/src/components/provider/SteamLoginButton.jsx +38 -38
  132. package/src/components/provider/WeComLoginButton.jsx +34 -34
  133. package/src/components/provider/Web3Auth.jsx +365 -365
  134. package/src/components/provider/WechatLoginButton.jsx +37 -37
  135. package/src/components/provider/WeiboLoginButton.jsx +34 -34
  136. package/src/components/util.tsx +173 -173
  137. package/src/i18n/en/signup.json +48 -48
  138. package/src/i18n/index.ts +17 -17
  139. package/src/index.tsx +8 -8
  140. package/src/vite-env.d.ts +0 -0
  141. package/tsconfig.json +0 -0
  142. package/tsconfig.node.json +0 -0
  143. package/vite.config.ts +33 -33
  144. package/dist/icon-duCa3gfT.js +0 -11
  145. package/dist/index-BtLU53lm.js +0 -6023
  146. package/dist/index-CLfsMiG4.js +0 -2021
  147. package/dist/index-DPq81SIn.js +0 -161
  148. package/dist/trust-gPypS1O7.js +0 -11
@@ -0,0 +1,2101 @@
1
+ import { bK as L } from "./Web3Auth-DB9s-qbl.js";
2
+ var xt = {}, I = {}, T = {}, ne = L && L.__awaiter || function(e, t, n, i) {
3
+ function r(s) {
4
+ return s instanceof n ? s : new n(function(o) {
5
+ o(s);
6
+ });
7
+ }
8
+ return new (n || (n = Promise))(function(s, o) {
9
+ function c(h) {
10
+ try {
11
+ y(i.next(h));
12
+ } catch (E) {
13
+ o(E);
14
+ }
15
+ }
16
+ function g(h) {
17
+ try {
18
+ y(i.throw(h));
19
+ } catch (E) {
20
+ o(E);
21
+ }
22
+ }
23
+ function y(h) {
24
+ h.done ? s(h.value) : r(h.value).then(c, g);
25
+ }
26
+ y((i = i.apply(e, t || [])).next());
27
+ });
28
+ };
29
+ Object.defineProperty(T, "__esModule", { value: !0 });
30
+ T.getData = T.fetchData = T.stringifyQuery = T.insertParams = void 0;
31
+ const Qt = (e) => typeof e == "object" && e !== null && "code" in e && "message" in e;
32
+ function qt(e, t, n) {
33
+ return e.replace(new RegExp(`\\{${t}\\}`, "g"), n);
34
+ }
35
+ function Yt(e, t) {
36
+ return t ? Object.keys(t).reduce((n, i) => qt(n, i, String(t[i])), e) : e;
37
+ }
38
+ T.insertParams = Yt;
39
+ function Jt(e) {
40
+ if (!e)
41
+ return "";
42
+ const t = new URLSearchParams();
43
+ Object.keys(e).forEach((i) => {
44
+ e[i] != null && t.append(i, String(e[i]));
45
+ });
46
+ const n = t.toString();
47
+ return n ? `?${n}` : "";
48
+ }
49
+ T.stringifyQuery = Jt;
50
+ function Ie(e) {
51
+ return ne(this, void 0, void 0, function* () {
52
+ let t;
53
+ try {
54
+ t = yield e.json();
55
+ } catch {
56
+ t = {};
57
+ }
58
+ if (!e.ok) {
59
+ const n = Qt(t) ? `CGW error - ${t.code}: ${t.message}` : `CGW error - status ${e.statusText}`;
60
+ throw new Error(n);
61
+ }
62
+ return t;
63
+ });
64
+ }
65
+ function Zt(e, t, n, i, r) {
66
+ return ne(this, void 0, void 0, function* () {
67
+ const s = Object.assign({ "Content-Type": "application/json" }, i), o = {
68
+ method: t ?? "POST",
69
+ headers: s
70
+ };
71
+ r && (o.credentials = r), n != null && (o.body = typeof n == "string" ? n : JSON.stringify(n));
72
+ const c = yield fetch(e, o);
73
+ return Ie(c);
74
+ });
75
+ }
76
+ T.fetchData = Zt;
77
+ function en(e, t, n) {
78
+ return ne(this, void 0, void 0, function* () {
79
+ const i = {
80
+ method: "GET"
81
+ };
82
+ t && (i.headers = Object.assign(Object.assign({}, t), { "Content-Type": "application/json" })), n && (i.credentials = n);
83
+ const r = yield fetch(e, i);
84
+ return Ie(r);
85
+ });
86
+ }
87
+ T.getData = en;
88
+ Object.defineProperty(I, "__esModule", { value: !0 });
89
+ I.getEndpoint = I.deleteEndpoint = I.putEndpoint = I.postEndpoint = void 0;
90
+ const $ = T;
91
+ function V(e, t, n, i) {
92
+ const r = (0, $.insertParams)(t, n), s = (0, $.stringifyQuery)(i);
93
+ return `${e}${r}${s}`;
94
+ }
95
+ function tn(e, t, n) {
96
+ const i = V(e, t, n == null ? void 0 : n.path, n == null ? void 0 : n.query);
97
+ return (0, $.fetchData)(i, "POST", n == null ? void 0 : n.body, n == null ? void 0 : n.headers, n == null ? void 0 : n.credentials);
98
+ }
99
+ I.postEndpoint = tn;
100
+ function nn(e, t, n) {
101
+ const i = V(e, t, n == null ? void 0 : n.path, n == null ? void 0 : n.query);
102
+ return (0, $.fetchData)(i, "PUT", n == null ? void 0 : n.body, n == null ? void 0 : n.headers, n == null ? void 0 : n.credentials);
103
+ }
104
+ I.putEndpoint = nn;
105
+ function rn(e, t, n) {
106
+ const i = V(e, t, n == null ? void 0 : n.path, n == null ? void 0 : n.query);
107
+ return (0, $.fetchData)(i, "DELETE", n == null ? void 0 : n.body, n == null ? void 0 : n.headers, n == null ? void 0 : n.credentials);
108
+ }
109
+ I.deleteEndpoint = rn;
110
+ function sn(e, t, n, i) {
111
+ if (i)
112
+ return (0, $.getData)(i, void 0, n == null ? void 0 : n.credentials);
113
+ const r = V(e, t, n == null ? void 0 : n.path, n == null ? void 0 : n.query);
114
+ return (0, $.getData)(r, n == null ? void 0 : n.headers, n == null ? void 0 : n.credentials);
115
+ }
116
+ I.getEndpoint = sn;
117
+ var K = {};
118
+ Object.defineProperty(K, "__esModule", { value: !0 });
119
+ K.DEFAULT_BASE_URL = void 0;
120
+ K.DEFAULT_BASE_URL = "https://safe-client.safe.global";
121
+ var Te = {};
122
+ (function(e) {
123
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.ImplementationVersionState = void 0, function(t) {
124
+ t.UP_TO_DATE = "UP_TO_DATE", t.OUTDATED = "OUTDATED", t.UNKNOWN = "UNKNOWN";
125
+ }(e.ImplementationVersionState || (e.ImplementationVersionState = {}));
126
+ })(Te);
127
+ var me = {};
128
+ (function(e) {
129
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.SafeAppSocialPlatforms = e.SafeAppFeatures = e.SafeAppAccessPolicyTypes = void 0, function(t) {
130
+ t.NoRestrictions = "NO_RESTRICTIONS", t.DomainAllowlist = "DOMAIN_ALLOWLIST";
131
+ }(e.SafeAppAccessPolicyTypes || (e.SafeAppAccessPolicyTypes = {})), function(t) {
132
+ t.BATCHED_TRANSACTIONS = "BATCHED_TRANSACTIONS";
133
+ }(e.SafeAppFeatures || (e.SafeAppFeatures = {})), function(t) {
134
+ t.TWITTER = "TWITTER", t.GITHUB = "GITHUB", t.DISCORD = "DISCORD";
135
+ }(e.SafeAppSocialPlatforms || (e.SafeAppSocialPlatforms = {}));
136
+ })(me);
137
+ var ve = {};
138
+ (function(e) {
139
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.LabelValue = e.StartTimeValue = e.DurationType = e.DetailedExecutionInfoType = e.TransactionListItemType = e.ConflictType = e.TransactionInfoType = e.SettingsInfoType = e.TransactionTokenType = e.TransferDirection = e.TransactionStatus = e.Operation = void 0, function(t) {
140
+ t[t.CALL = 0] = "CALL", t[t.DELEGATE = 1] = "DELEGATE";
141
+ }(e.Operation || (e.Operation = {})), function(t) {
142
+ t.AWAITING_CONFIRMATIONS = "AWAITING_CONFIRMATIONS", t.AWAITING_EXECUTION = "AWAITING_EXECUTION", t.CANCELLED = "CANCELLED", t.FAILED = "FAILED", t.SUCCESS = "SUCCESS";
143
+ }(e.TransactionStatus || (e.TransactionStatus = {})), function(t) {
144
+ t.INCOMING = "INCOMING", t.OUTGOING = "OUTGOING", t.UNKNOWN = "UNKNOWN";
145
+ }(e.TransferDirection || (e.TransferDirection = {})), function(t) {
146
+ t.ERC20 = "ERC20", t.ERC721 = "ERC721", t.NATIVE_COIN = "NATIVE_COIN";
147
+ }(e.TransactionTokenType || (e.TransactionTokenType = {})), function(t) {
148
+ t.SET_FALLBACK_HANDLER = "SET_FALLBACK_HANDLER", t.ADD_OWNER = "ADD_OWNER", t.REMOVE_OWNER = "REMOVE_OWNER", t.SWAP_OWNER = "SWAP_OWNER", t.CHANGE_THRESHOLD = "CHANGE_THRESHOLD", t.CHANGE_IMPLEMENTATION = "CHANGE_IMPLEMENTATION", t.ENABLE_MODULE = "ENABLE_MODULE", t.DISABLE_MODULE = "DISABLE_MODULE", t.SET_GUARD = "SET_GUARD", t.DELETE_GUARD = "DELETE_GUARD";
149
+ }(e.SettingsInfoType || (e.SettingsInfoType = {})), function(t) {
150
+ t.TRANSFER = "Transfer", t.SETTINGS_CHANGE = "SettingsChange", t.CUSTOM = "Custom", t.CREATION = "Creation", t.SWAP_ORDER = "SwapOrder", t.TWAP_ORDER = "TwapOrder", t.SWAP_TRANSFER = "SwapTransfer", t.NATIVE_STAKING_DEPOSIT = "NativeStakingDeposit", t.NATIVE_STAKING_VALIDATORS_EXIT = "NativeStakingValidatorsExit", t.NATIVE_STAKING_WITHDRAW = "NativeStakingWithdraw";
151
+ }(e.TransactionInfoType || (e.TransactionInfoType = {})), function(t) {
152
+ t.NONE = "None", t.HAS_NEXT = "HasNext", t.END = "End";
153
+ }(e.ConflictType || (e.ConflictType = {})), function(t) {
154
+ t.TRANSACTION = "TRANSACTION", t.LABEL = "LABEL", t.CONFLICT_HEADER = "CONFLICT_HEADER", t.DATE_LABEL = "DATE_LABEL";
155
+ }(e.TransactionListItemType || (e.TransactionListItemType = {})), function(t) {
156
+ t.MULTISIG = "MULTISIG", t.MODULE = "MODULE";
157
+ }(e.DetailedExecutionInfoType || (e.DetailedExecutionInfoType = {})), function(t) {
158
+ t.AUTO = "AUTO", t.LIMIT_DURATION = "LIMIT_DURATION";
159
+ }(e.DurationType || (e.DurationType = {})), function(t) {
160
+ t.AT_MINING_TIME = "AT_MINING_TIME", t.AT_EPOCH = "AT_EPOCH";
161
+ }(e.StartTimeValue || (e.StartTimeValue = {})), function(t) {
162
+ t.Queued = "Queued", t.Next = "Next";
163
+ }(e.LabelValue || (e.LabelValue = {}));
164
+ })(ve);
165
+ var Se = {};
166
+ (function(e) {
167
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.FEATURES = e.GAS_PRICE_TYPE = e.RPC_AUTHENTICATION = void 0, function(t) {
168
+ t.API_KEY_PATH = "API_KEY_PATH", t.NO_AUTHENTICATION = "NO_AUTHENTICATION", t.UNKNOWN = "UNKNOWN";
169
+ }(e.RPC_AUTHENTICATION || (e.RPC_AUTHENTICATION = {})), function(t) {
170
+ t.ORACLE = "ORACLE", t.FIXED = "FIXED", t.FIXED_1559 = "FIXED1559", t.UNKNOWN = "UNKNOWN";
171
+ }(e.GAS_PRICE_TYPE || (e.GAS_PRICE_TYPE = {})), function(t) {
172
+ t.ERC721 = "ERC721", t.SAFE_APPS = "SAFE_APPS", t.CONTRACT_INTERACTION = "CONTRACT_INTERACTION", t.DOMAIN_LOOKUP = "DOMAIN_LOOKUP", t.SPENDING_LIMIT = "SPENDING_LIMIT", t.EIP1559 = "EIP1559", t.SAFE_TX_GAS_OPTIONAL = "SAFE_TX_GAS_OPTIONAL", t.TX_SIMULATION = "TX_SIMULATION", t.EIP1271 = "EIP1271";
173
+ }(e.FEATURES || (e.FEATURES = {}));
174
+ })(Se);
175
+ var _e = {};
176
+ (function(e) {
177
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.TokenType = void 0, function(t) {
178
+ t.ERC20 = "ERC20", t.ERC721 = "ERC721", t.NATIVE_TOKEN = "NATIVE_TOKEN";
179
+ }(e.TokenType || (e.TokenType = {}));
180
+ })(_e);
181
+ var Ne = {};
182
+ Object.defineProperty(Ne, "__esModule", { value: !0 });
183
+ var Oe = {};
184
+ (function(e) {
185
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.NativeStakingStatus = e.ConfirmationViewTypes = void 0, function(t) {
186
+ t.GENERIC = "GENERIC", t.COW_SWAP_ORDER = "COW_SWAP_ORDER", t.COW_SWAP_TWAP_ORDER = "COW_SWAP_TWAP_ORDER", t.KILN_NATIVE_STAKING_DEPOSIT = "KILN_NATIVE_STAKING_DEPOSIT", t.KILN_NATIVE_STAKING_VALIDATORS_EXIT = "KILN_NATIVE_STAKING_VALIDATORS_EXIT", t.KILN_NATIVE_STAKING_WITHDRAW = "KILN_NATIVE_STAKING_WITHDRAW";
187
+ }(e.ConfirmationViewTypes || (e.ConfirmationViewTypes = {})), function(t) {
188
+ t.NOT_STAKED = "NOT_STAKED", t.ACTIVATING = "ACTIVATING", t.DEPOSIT_IN_PROGRESS = "DEPOSIT_IN_PROGRESS", t.ACTIVE = "ACTIVE", t.EXIT_REQUESTED = "EXIT_REQUESTED", t.EXITING = "EXITING", t.EXITED = "EXITED", t.SLASHED = "SLASHED";
189
+ }(e.NativeStakingStatus || (e.NativeStakingStatus = {}));
190
+ })(Oe);
191
+ var De = {};
192
+ (function(e) {
193
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.SafeMessageStatus = e.SafeMessageListItemType = void 0, function(t) {
194
+ t.DATE_LABEL = "DATE_LABEL", t.MESSAGE = "MESSAGE";
195
+ }(e.SafeMessageListItemType || (e.SafeMessageListItemType = {})), function(t) {
196
+ t.NEEDS_CONFIRMATION = "NEEDS_CONFIRMATION", t.CONFIRMED = "CONFIRMED";
197
+ }(e.SafeMessageStatus || (e.SafeMessageStatus = {}));
198
+ })(De);
199
+ var we = {};
200
+ (function(e) {
201
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.DeviceType = void 0, function(t) {
202
+ t.ANDROID = "ANDROID", t.IOS = "IOS", t.WEB = "WEB";
203
+ }(e.DeviceType || (e.DeviceType = {}));
204
+ })(we);
205
+ var $e = {};
206
+ Object.defineProperty($e, "__esModule", { value: !0 });
207
+ (function(e) {
208
+ var t = L && L.__createBinding || (Object.create ? function(a, u, d, l) {
209
+ l === void 0 && (l = d);
210
+ var A = Object.getOwnPropertyDescriptor(u, d);
211
+ (!A || ("get" in A ? !u.__esModule : A.writable || A.configurable)) && (A = { enumerable: !0, get: function() {
212
+ return u[d];
213
+ } }), Object.defineProperty(a, l, A);
214
+ } : function(a, u, d, l) {
215
+ l === void 0 && (l = d), a[l] = u[d];
216
+ }), n = L && L.__exportStar || function(a, u) {
217
+ for (var d in a) d !== "default" && !Object.prototype.hasOwnProperty.call(u, d) && t(u, a, d);
218
+ };
219
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.getAccount = e.createAccount = e.verifyAuth = e.getAuthNonce = e.getContract = e.getSafeOverviews = e.unsubscribeAll = e.unsubscribeSingle = e.registerRecoveryModule = e.deleteRegisteredEmail = e.getRegisteredEmail = e.verifyEmail = e.resendEmailVerificationCode = e.changeEmail = e.registerEmail = e.unregisterDevice = e.unregisterSafe = e.registerDevice = e.getDelegates = e.confirmSafeMessage = e.proposeSafeMessage = e.getSafeMessage = e.getSafeMessages = e.getDecodedData = e.getMasterCopies = e.getSafeApps = e.getChainConfig = e.getChainsConfig = e.getTxPreview = e.getConfirmationView = e.proposeTransaction = e.getNonces = e.postSafeGasEstimation = e.deleteTransaction = e.getTransactionDetails = e.getTransactionQueue = e.getTransactionHistory = e.getCollectiblesPage = e.getCollectibles = e.getAllOwnedSafes = e.getOwnedSafes = e.getFiatCurrencies = e.getBalances = e.getMultisigTransactions = e.getModuleTransactions = e.getIncomingTransfers = e.getSafeInfo = e.getRelayCount = e.relayTransaction = e.setBaseUrl = void 0, e.getIndexingStatus = e.putAccountDataSettings = e.getAccountDataSettings = e.getAccountDataTypes = e.deleteAccount = void 0;
220
+ const i = I, r = K;
221
+ n(Te, e), n(me, e), n(ve, e), n(Se, e), n(_e, e), n(Ne, e), n(Oe, e), n(De, e), n(we, e), n($e, e);
222
+ let s = r.DEFAULT_BASE_URL;
223
+ const o = (a) => {
224
+ s = a;
225
+ };
226
+ e.setBaseUrl = o;
227
+ function c(a, u) {
228
+ return (0, i.postEndpoint)(s, "/v1/chains/{chainId}/relay", { path: { chainId: a }, body: u });
229
+ }
230
+ e.relayTransaction = c;
231
+ function g(a, u) {
232
+ return (0, i.getEndpoint)(s, "/v1/chains/{chainId}/relay/{address}", { path: { chainId: a, address: u } });
233
+ }
234
+ e.getRelayCount = g;
235
+ function y(a, u) {
236
+ return (0, i.getEndpoint)(s, "/v1/chains/{chainId}/safes/{address}", { path: { chainId: a, address: u } });
237
+ }
238
+ e.getSafeInfo = y;
239
+ function h(a, u, d, l) {
240
+ return (0, i.getEndpoint)(s, "/v1/chains/{chainId}/safes/{address}/incoming-transfers/", {
241
+ path: { chainId: a, address: u },
242
+ query: d
243
+ }, l);
244
+ }
245
+ e.getIncomingTransfers = h;
246
+ function E(a, u, d, l) {
247
+ return (0, i.getEndpoint)(s, "/v1/chains/{chainId}/safes/{address}/module-transactions/", {
248
+ path: { chainId: a, address: u },
249
+ query: d
250
+ }, l);
251
+ }
252
+ e.getModuleTransactions = E;
253
+ function v(a, u, d, l) {
254
+ return (0, i.getEndpoint)(s, "/v1/chains/{chainId}/safes/{address}/multisig-transactions/", {
255
+ path: { chainId: a, address: u },
256
+ query: d
257
+ }, l);
258
+ }
259
+ e.getMultisigTransactions = v;
260
+ function b(a, u, d = "usd", l = {}) {
261
+ return (0, i.getEndpoint)(s, "/v1/chains/{chainId}/safes/{address}/balances/{currency}", {
262
+ path: { chainId: a, address: u, currency: d },
263
+ query: l
264
+ });
265
+ }
266
+ e.getBalances = b;
267
+ function j() {
268
+ return (0, i.getEndpoint)(s, "/v1/balances/supported-fiat-codes");
269
+ }
270
+ e.getFiatCurrencies = j;
271
+ function q(a, u) {
272
+ return (0, i.getEndpoint)(s, "/v1/chains/{chainId}/owners/{address}/safes", { path: { chainId: a, address: u } });
273
+ }
274
+ e.getOwnedSafes = q;
275
+ function w(a) {
276
+ return (0, i.getEndpoint)(s, "/v1/owners/{address}/safes", { path: { address: a } });
277
+ }
278
+ e.getAllOwnedSafes = w;
279
+ function Y(a, u, d = {}) {
280
+ return (0, i.getEndpoint)(s, "/v1/chains/{chainId}/safes/{address}/collectibles", {
281
+ path: { chainId: a, address: u },
282
+ query: d
283
+ });
284
+ }
285
+ e.getCollectibles = Y;
286
+ function st(a, u, d = {}, l) {
287
+ return (0, i.getEndpoint)(s, "/v2/chains/{chainId}/safes/{address}/collectibles", { path: { chainId: a, address: u }, query: d }, l);
288
+ }
289
+ e.getCollectiblesPage = st;
290
+ function ot(a, u, d = {}, l) {
291
+ return (0, i.getEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/transactions/history", { path: { chainId: a, safe_address: u }, query: d }, l);
292
+ }
293
+ e.getTransactionHistory = ot;
294
+ function at(a, u, d = {}, l) {
295
+ return (0, i.getEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/transactions/queued", { path: { chainId: a, safe_address: u }, query: d }, l);
296
+ }
297
+ e.getTransactionQueue = at;
298
+ function ct(a, u) {
299
+ return (0, i.getEndpoint)(s, "/v1/chains/{chainId}/transactions/{transactionId}", {
300
+ path: { chainId: a, transactionId: u }
301
+ });
302
+ }
303
+ e.getTransactionDetails = ct;
304
+ function ut(a, u, d) {
305
+ return (0, i.deleteEndpoint)(s, "/v1/chains/{chainId}/transactions/{safeTxHash}", {
306
+ path: { chainId: a, safeTxHash: u },
307
+ body: { signature: d }
308
+ });
309
+ }
310
+ e.deleteTransaction = ut;
311
+ function dt(a, u, d) {
312
+ return (0, i.postEndpoint)(s, "/v2/chains/{chainId}/safes/{safe_address}/multisig-transactions/estimations", {
313
+ path: { chainId: a, safe_address: u },
314
+ body: d
315
+ });
316
+ }
317
+ e.postSafeGasEstimation = dt;
318
+ function ft(a, u) {
319
+ return (0, i.getEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/nonces", {
320
+ path: { chainId: a, safe_address: u }
321
+ });
322
+ }
323
+ e.getNonces = ft;
324
+ function lt(a, u, d) {
325
+ return (0, i.postEndpoint)(s, "/v1/chains/{chainId}/transactions/{safe_address}/propose", {
326
+ path: { chainId: a, safe_address: u },
327
+ body: d
328
+ });
329
+ }
330
+ e.proposeTransaction = lt;
331
+ function ht(a, u, d, l, A) {
332
+ return (0, i.postEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/views/transaction-confirmation", {
333
+ path: { chainId: a, safe_address: u },
334
+ body: { data: d, to: l, value: A }
335
+ });
336
+ }
337
+ e.getConfirmationView = ht;
338
+ function gt(a, u, d, l, A) {
339
+ return (0, i.postEndpoint)(s, "/v1/chains/{chainId}/transactions/{safe_address}/preview", {
340
+ path: { chainId: a, safe_address: u },
341
+ body: { data: d, to: l, value: A }
342
+ });
343
+ }
344
+ e.getTxPreview = gt;
345
+ function yt(a) {
346
+ return (0, i.getEndpoint)(s, "/v1/chains", {
347
+ query: a
348
+ });
349
+ }
350
+ e.getChainsConfig = yt;
351
+ function Et(a) {
352
+ return (0, i.getEndpoint)(s, "/v1/chains/{chainId}", {
353
+ path: { chainId: a }
354
+ });
355
+ }
356
+ e.getChainConfig = Et;
357
+ function pt(a, u = {}) {
358
+ return (0, i.getEndpoint)(s, "/v1/chains/{chainId}/safe-apps", {
359
+ path: { chainId: a },
360
+ query: u
361
+ });
362
+ }
363
+ e.getSafeApps = pt;
364
+ function At(a) {
365
+ return (0, i.getEndpoint)(s, "/v1/chains/{chainId}/about/master-copies", {
366
+ path: { chainId: a }
367
+ });
368
+ }
369
+ e.getMasterCopies = At;
370
+ function bt(a, u, d) {
371
+ return (0, i.postEndpoint)(s, "/v1/chains/{chainId}/data-decoder", {
372
+ path: { chainId: a },
373
+ body: { data: u, to: d }
374
+ });
375
+ }
376
+ e.getDecodedData = bt;
377
+ function It(a, u, d) {
378
+ return (0, i.getEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/messages", { path: { chainId: a, safe_address: u }, query: {} }, d);
379
+ }
380
+ e.getSafeMessages = It;
381
+ function Tt(a, u) {
382
+ return (0, i.getEndpoint)(s, "/v1/chains/{chainId}/messages/{message_hash}", {
383
+ path: { chainId: a, message_hash: u }
384
+ });
385
+ }
386
+ e.getSafeMessage = Tt;
387
+ function mt(a, u, d) {
388
+ return (0, i.postEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/messages", {
389
+ path: { chainId: a, safe_address: u },
390
+ body: d
391
+ });
392
+ }
393
+ e.proposeSafeMessage = mt;
394
+ function vt(a, u, d) {
395
+ return (0, i.postEndpoint)(s, "/v1/chains/{chainId}/messages/{message_hash}/signatures", {
396
+ path: { chainId: a, message_hash: u },
397
+ body: d
398
+ });
399
+ }
400
+ e.confirmSafeMessage = vt;
401
+ function St(a, u = {}) {
402
+ return (0, i.getEndpoint)(s, "/v2/chains/{chainId}/delegates", {
403
+ path: { chainId: a },
404
+ query: u
405
+ });
406
+ }
407
+ e.getDelegates = St;
408
+ function _t(a) {
409
+ return (0, i.postEndpoint)(s, "/v1/register/notifications", {
410
+ body: a
411
+ });
412
+ }
413
+ e.registerDevice = _t;
414
+ function Nt(a, u, d) {
415
+ return (0, i.deleteEndpoint)(s, "/v1/chains/{chainId}/notifications/devices/{uuid}/safes/{safe_address}", {
416
+ path: { chainId: a, safe_address: u, uuid: d }
417
+ });
418
+ }
419
+ e.unregisterSafe = Nt;
420
+ function Ot(a, u) {
421
+ return (0, i.deleteEndpoint)(s, "/v1/chains/{chainId}/notifications/devices/{uuid}", {
422
+ path: { chainId: a, uuid: u }
423
+ });
424
+ }
425
+ e.unregisterDevice = Ot;
426
+ function Dt(a, u, d, l) {
427
+ return (0, i.postEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/emails", {
428
+ path: { chainId: a, safe_address: u },
429
+ body: d,
430
+ headers: l
431
+ });
432
+ }
433
+ e.registerEmail = Dt;
434
+ function wt(a, u, d, l, A) {
435
+ return (0, i.putEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}", {
436
+ path: { chainId: a, safe_address: u, signer: d },
437
+ body: l,
438
+ headers: A
439
+ });
440
+ }
441
+ e.changeEmail = wt;
442
+ function $t(a, u, d) {
443
+ return (0, i.postEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}/verify-resend", {
444
+ path: { chainId: a, safe_address: u, signer: d },
445
+ body: ""
446
+ });
447
+ }
448
+ e.resendEmailVerificationCode = $t;
449
+ function Ct(a, u, d, l) {
450
+ return (0, i.putEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}/verify", {
451
+ path: { chainId: a, safe_address: u, signer: d },
452
+ body: l
453
+ });
454
+ }
455
+ e.verifyEmail = Ct;
456
+ function Mt(a, u, d, l) {
457
+ return (0, i.getEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}", {
458
+ path: { chainId: a, safe_address: u, signer: d },
459
+ headers: l
460
+ });
461
+ }
462
+ e.getRegisteredEmail = Mt;
463
+ function Lt(a, u, d, l) {
464
+ return (0, i.deleteEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}", {
465
+ path: { chainId: a, safe_address: u, signer: d },
466
+ headers: l
467
+ });
468
+ }
469
+ e.deleteRegisteredEmail = Lt;
470
+ function Pt(a, u, d) {
471
+ return (0, i.postEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/recovery", {
472
+ path: { chainId: a, safe_address: u },
473
+ body: d
474
+ });
475
+ }
476
+ e.registerRecoveryModule = Pt;
477
+ function Rt(a) {
478
+ return (0, i.deleteEndpoint)(s, "/v1/subscriptions", { query: a });
479
+ }
480
+ e.unsubscribeSingle = Rt;
481
+ function Bt(a) {
482
+ return (0, i.deleteEndpoint)(s, "/v1/subscriptions/all", { query: a });
483
+ }
484
+ e.unsubscribeAll = Bt;
485
+ function zt(a, u) {
486
+ return (0, i.getEndpoint)(s, "/v1/safes", {
487
+ query: Object.assign(Object.assign({}, u), { safes: a.join(",") })
488
+ });
489
+ }
490
+ e.getSafeOverviews = zt;
491
+ function Ut(a, u) {
492
+ return (0, i.getEndpoint)(s, "/v1/chains/{chainId}/contracts/{contractAddress}", {
493
+ path: {
494
+ chainId: a,
495
+ contractAddress: u
496
+ }
497
+ });
498
+ }
499
+ e.getContract = Ut;
500
+ function jt() {
501
+ return (0, i.getEndpoint)(s, "/v1/auth/nonce", { credentials: "include" });
502
+ }
503
+ e.getAuthNonce = jt;
504
+ function Ft(a) {
505
+ return (0, i.postEndpoint)(s, "/v1/auth/verify", {
506
+ body: a,
507
+ credentials: "include"
508
+ });
509
+ }
510
+ e.verifyAuth = Ft;
511
+ function Ht(a) {
512
+ return (0, i.postEndpoint)(s, "/v1/accounts", {
513
+ body: a,
514
+ credentials: "include"
515
+ });
516
+ }
517
+ e.createAccount = Ht;
518
+ function Gt(a) {
519
+ return (0, i.getEndpoint)(s, "/v1/accounts/{address}", {
520
+ path: { address: a },
521
+ credentials: "include"
522
+ });
523
+ }
524
+ e.getAccount = Gt;
525
+ function Wt(a) {
526
+ return (0, i.deleteEndpoint)(s, "/v1/accounts/{address}", {
527
+ path: { address: a },
528
+ credentials: "include"
529
+ });
530
+ }
531
+ e.deleteAccount = Wt;
532
+ function kt() {
533
+ return (0, i.getEndpoint)(s, "/v1/accounts/data-types");
534
+ }
535
+ e.getAccountDataTypes = kt;
536
+ function Vt(a) {
537
+ return (0, i.getEndpoint)(s, "/v1/accounts/{address}/data-settings", {
538
+ path: { address: a },
539
+ credentials: "include"
540
+ });
541
+ }
542
+ e.getAccountDataSettings = Vt;
543
+ function Kt(a, u) {
544
+ return (0, i.putEndpoint)(s, "/v1/accounts/{address}/data-settings", {
545
+ path: { address: a },
546
+ body: u,
547
+ credentials: "include"
548
+ });
549
+ }
550
+ e.putAccountDataSettings = Kt;
551
+ function Xt(a) {
552
+ return (0, i.getEndpoint)(s, "/v1/chains/{chainId}/about/indexing", {
553
+ path: { chainId: a }
554
+ });
555
+ }
556
+ e.getIndexingStatus = Xt;
557
+ })(xt);
558
+ function on(e, t) {
559
+ const n = e.exec(t);
560
+ return n == null ? void 0 : n.groups;
561
+ }
562
+ const $i = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/, Ci = /^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/, Mi = /^\(.+?\).*?$/, de = /^tuple(?<array>(\[(\d*)\])*)$/;
563
+ function ee(e) {
564
+ let t = e.type;
565
+ if (de.test(e.type) && "components" in e) {
566
+ t = "(";
567
+ const n = e.components.length;
568
+ for (let r = 0; r < n; r++) {
569
+ const s = e.components[r];
570
+ t += ee(s), r < n - 1 && (t += ", ");
571
+ }
572
+ const i = on(de, e.type);
573
+ return t += `)${(i == null ? void 0 : i.array) ?? ""}`, ee({
574
+ ...e,
575
+ type: t
576
+ });
577
+ }
578
+ return "indexed" in e && e.indexed && (t = `${t} indexed`), e.name ? `${t} ${e.name}` : t;
579
+ }
580
+ function B(e) {
581
+ let t = "";
582
+ const n = e.length;
583
+ for (let i = 0; i < n; i++) {
584
+ const r = e[i];
585
+ t += ee(r), i !== n - 1 && (t += ", ");
586
+ }
587
+ return t;
588
+ }
589
+ function an(e) {
590
+ return e.type === "function" ? `function ${e.name}(${B(e.inputs)})${e.stateMutability && e.stateMutability !== "nonpayable" ? ` ${e.stateMutability}` : ""}${e.outputs.length ? ` returns (${B(e.outputs)})` : ""}` : e.type === "event" ? `event ${e.name}(${B(e.inputs)})` : e.type === "error" ? `error ${e.name}(${B(e.inputs)})` : e.type === "constructor" ? `constructor(${B(e.inputs)})${e.stateMutability === "payable" ? " payable" : ""}` : e.type === "fallback" ? "fallback()" : "receive() external payable";
591
+ }
592
+ function G(e, { includeName: t = !1 } = {}) {
593
+ if (e.type !== "function" && e.type !== "event" && e.type !== "error")
594
+ throw new En(e.type);
595
+ return `${e.name}(${X(e.inputs, { includeName: t })})`;
596
+ }
597
+ function X(e, { includeName: t = !1 } = {}) {
598
+ return e ? e.map((n) => cn(n, { includeName: t })).join(t ? ", " : ",") : "";
599
+ }
600
+ function cn(e, { includeName: t }) {
601
+ return e.type.startsWith("tuple") ? `(${X(e.components, { includeName: t })})${e.type.slice(5)}` : e.type + (t && e.name ? ` ${e.name}` : "");
602
+ }
603
+ function U(e, { strict: t = !0 } = {}) {
604
+ return !e || typeof e != "string" ? !1 : t ? /^0x[0-9a-fA-F]*$/.test(e) : e.startsWith("0x");
605
+ }
606
+ function p(e) {
607
+ return U(e, { strict: !1 }) ? Math.ceil((e.length - 2) / 2) : e.length;
608
+ }
609
+ const Ce = "2.21.51";
610
+ let M = {
611
+ getDocsUrl: ({ docsBaseUrl: e, docsPath: t = "", docsSlug: n }) => t ? `${e ?? "https://viem.sh"}${t}${n ? `#${n}` : ""}` : void 0,
612
+ version: `viem@${Ce}`
613
+ };
614
+ function Li(e) {
615
+ M = e;
616
+ }
617
+ class f extends Error {
618
+ constructor(t, n = {}) {
619
+ var c;
620
+ const i = (() => {
621
+ var g;
622
+ return n.cause instanceof f ? n.cause.details : (g = n.cause) != null && g.message ? n.cause.message : n.details;
623
+ })(), r = n.cause instanceof f && n.cause.docsPath || n.docsPath, s = (c = M.getDocsUrl) == null ? void 0 : c.call(M, { ...n, docsPath: r }), o = [
624
+ t || "An error occurred.",
625
+ "",
626
+ ...n.metaMessages ? [...n.metaMessages, ""] : [],
627
+ ...s ? [`Docs: ${s}`] : [],
628
+ ...i ? [`Details: ${i}`] : [],
629
+ ...M.version ? [`Version: ${M.version}`] : []
630
+ ].join(`
631
+ `);
632
+ super(o, n.cause ? { cause: n.cause } : void 0), Object.defineProperty(this, "details", {
633
+ enumerable: !0,
634
+ configurable: !0,
635
+ writable: !0,
636
+ value: void 0
637
+ }), Object.defineProperty(this, "docsPath", {
638
+ enumerable: !0,
639
+ configurable: !0,
640
+ writable: !0,
641
+ value: void 0
642
+ }), Object.defineProperty(this, "metaMessages", {
643
+ enumerable: !0,
644
+ configurable: !0,
645
+ writable: !0,
646
+ value: void 0
647
+ }), Object.defineProperty(this, "shortMessage", {
648
+ enumerable: !0,
649
+ configurable: !0,
650
+ writable: !0,
651
+ value: void 0
652
+ }), Object.defineProperty(this, "version", {
653
+ enumerable: !0,
654
+ configurable: !0,
655
+ writable: !0,
656
+ value: void 0
657
+ }), Object.defineProperty(this, "name", {
658
+ enumerable: !0,
659
+ configurable: !0,
660
+ writable: !0,
661
+ value: "BaseError"
662
+ }), this.details = i, this.docsPath = r, this.metaMessages = n.metaMessages, this.name = n.name ?? this.name, this.shortMessage = t, this.version = Ce;
663
+ }
664
+ walk(t) {
665
+ return Me(this, t);
666
+ }
667
+ }
668
+ function Me(e, t) {
669
+ return t != null && t(e) ? e : e && typeof e == "object" && "cause" in e && e.cause !== void 0 ? Me(e.cause, t) : t ? null : e;
670
+ }
671
+ class Pi extends f {
672
+ constructor({ docsPath: t }) {
673
+ super([
674
+ "A constructor was not found on the ABI.",
675
+ "Make sure you are using the correct ABI and that the constructor exists on it."
676
+ ].join(`
677
+ `), {
678
+ docsPath: t,
679
+ name: "AbiConstructorNotFoundError"
680
+ });
681
+ }
682
+ }
683
+ class Ri extends f {
684
+ constructor({ docsPath: t }) {
685
+ super([
686
+ "Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.",
687
+ "Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."
688
+ ].join(`
689
+ `), {
690
+ docsPath: t,
691
+ name: "AbiConstructorParamsNotFoundError"
692
+ });
693
+ }
694
+ }
695
+ class Bi extends f {
696
+ constructor({ data: t, size: n }) {
697
+ super([
698
+ `Data size of ${n} bytes is invalid.`,
699
+ "Size must be in increments of 32 bytes (size % 32 === 0)."
700
+ ].join(`
701
+ `), {
702
+ metaMessages: [`Data: ${t} (${n} bytes)`],
703
+ name: "AbiDecodingDataSizeInvalidError"
704
+ });
705
+ }
706
+ }
707
+ class zi extends f {
708
+ constructor({ data: t, params: n, size: i }) {
709
+ super([`Data size of ${i} bytes is too small for given parameters.`].join(`
710
+ `), {
711
+ metaMessages: [
712
+ `Params: (${X(n, { includeName: !0 })})`,
713
+ `Data: ${t} (${i} bytes)`
714
+ ],
715
+ name: "AbiDecodingDataSizeTooSmallError"
716
+ }), Object.defineProperty(this, "data", {
717
+ enumerable: !0,
718
+ configurable: !0,
719
+ writable: !0,
720
+ value: void 0
721
+ }), Object.defineProperty(this, "params", {
722
+ enumerable: !0,
723
+ configurable: !0,
724
+ writable: !0,
725
+ value: void 0
726
+ }), Object.defineProperty(this, "size", {
727
+ enumerable: !0,
728
+ configurable: !0,
729
+ writable: !0,
730
+ value: void 0
731
+ }), this.data = t, this.params = n, this.size = i;
732
+ }
733
+ }
734
+ class Ui extends f {
735
+ constructor() {
736
+ super('Cannot decode zero data ("0x") with ABI parameters.', {
737
+ name: "AbiDecodingZeroDataError"
738
+ });
739
+ }
740
+ }
741
+ class un extends f {
742
+ constructor({ expectedLength: t, givenLength: n, type: i }) {
743
+ super([
744
+ `ABI encoding array length mismatch for type ${i}.`,
745
+ `Expected length: ${t}`,
746
+ `Given length: ${n}`
747
+ ].join(`
748
+ `), { name: "AbiEncodingArrayLengthMismatchError" });
749
+ }
750
+ }
751
+ class dn extends f {
752
+ constructor({ expectedSize: t, value: n }) {
753
+ super(`Size of bytes "${n}" (bytes${p(n)}) does not match expected size (bytes${t}).`, { name: "AbiEncodingBytesSizeMismatchError" });
754
+ }
755
+ }
756
+ class fn extends f {
757
+ constructor({ expectedLength: t, givenLength: n }) {
758
+ super([
759
+ "ABI encoding params/values length mismatch.",
760
+ `Expected length (params): ${t}`,
761
+ `Given length (values): ${n}`
762
+ ].join(`
763
+ `), { name: "AbiEncodingLengthMismatchError" });
764
+ }
765
+ }
766
+ class ji extends f {
767
+ constructor(t, { docsPath: n }) {
768
+ super([
769
+ `Arguments (\`args\`) were provided to "${t}", but "${t}" on the ABI does not contain any parameters (\`inputs\`).`,
770
+ "Cannot encode error result without knowing what the parameter types are.",
771
+ "Make sure you are using the correct ABI and that the inputs exist on it."
772
+ ].join(`
773
+ `), {
774
+ docsPath: n,
775
+ name: "AbiErrorInputsNotFoundError"
776
+ });
777
+ }
778
+ }
779
+ class Fi extends f {
780
+ constructor(t, { docsPath: n } = {}) {
781
+ super([
782
+ `Error ${t ? `"${t}" ` : ""}not found on ABI.`,
783
+ "Make sure you are using the correct ABI and that the error exists on it."
784
+ ].join(`
785
+ `), {
786
+ docsPath: n,
787
+ name: "AbiErrorNotFoundError"
788
+ });
789
+ }
790
+ }
791
+ class Hi extends f {
792
+ constructor(t, { docsPath: n }) {
793
+ super([
794
+ `Encoded error signature "${t}" not found on ABI.`,
795
+ "Make sure you are using the correct ABI and that the error exists on it.",
796
+ `You can look up the decoded signature here: https://openchain.xyz/signatures?query=${t}.`
797
+ ].join(`
798
+ `), {
799
+ docsPath: n,
800
+ name: "AbiErrorSignatureNotFoundError"
801
+ }), Object.defineProperty(this, "signature", {
802
+ enumerable: !0,
803
+ configurable: !0,
804
+ writable: !0,
805
+ value: void 0
806
+ }), this.signature = t;
807
+ }
808
+ }
809
+ class Gi extends f {
810
+ constructor({ docsPath: t }) {
811
+ super("Cannot extract event signature from empty topics.", {
812
+ docsPath: t,
813
+ name: "AbiEventSignatureEmptyTopicsError"
814
+ });
815
+ }
816
+ }
817
+ class Wi extends f {
818
+ constructor(t, { docsPath: n }) {
819
+ super([
820
+ `Encoded event signature "${t}" not found on ABI.`,
821
+ "Make sure you are using the correct ABI and that the event exists on it.",
822
+ `You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`
823
+ ].join(`
824
+ `), {
825
+ docsPath: n,
826
+ name: "AbiEventSignatureNotFoundError"
827
+ });
828
+ }
829
+ }
830
+ class ki extends f {
831
+ constructor(t, { docsPath: n } = {}) {
832
+ super([
833
+ `Event ${t ? `"${t}" ` : ""}not found on ABI.`,
834
+ "Make sure you are using the correct ABI and that the event exists on it."
835
+ ].join(`
836
+ `), {
837
+ docsPath: n,
838
+ name: "AbiEventNotFoundError"
839
+ });
840
+ }
841
+ }
842
+ class fe extends f {
843
+ constructor(t, { docsPath: n } = {}) {
844
+ super([
845
+ `Function ${t ? `"${t}" ` : ""}not found on ABI.`,
846
+ "Make sure you are using the correct ABI and that the function exists on it."
847
+ ].join(`
848
+ `), {
849
+ docsPath: n,
850
+ name: "AbiFunctionNotFoundError"
851
+ });
852
+ }
853
+ }
854
+ class Vi extends f {
855
+ constructor(t, { docsPath: n }) {
856
+ super([
857
+ `Function "${t}" does not contain any \`outputs\` on ABI.`,
858
+ "Cannot decode function result without knowing what the parameter types are.",
859
+ "Make sure you are using the correct ABI and that the function exists on it."
860
+ ].join(`
861
+ `), {
862
+ docsPath: n,
863
+ name: "AbiFunctionOutputsNotFoundError"
864
+ });
865
+ }
866
+ }
867
+ class Ki extends f {
868
+ constructor(t, { docsPath: n }) {
869
+ super([
870
+ `Encoded function signature "${t}" not found on ABI.`,
871
+ "Make sure you are using the correct ABI and that the function exists on it.",
872
+ `You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`
873
+ ].join(`
874
+ `), {
875
+ docsPath: n,
876
+ name: "AbiFunctionSignatureNotFoundError"
877
+ });
878
+ }
879
+ }
880
+ class ln extends f {
881
+ constructor(t, n) {
882
+ super("Found ambiguous types in overloaded ABI items.", {
883
+ metaMessages: [
884
+ `\`${t.type}\` in \`${G(t.abiItem)}\`, and`,
885
+ `\`${n.type}\` in \`${G(n.abiItem)}\``,
886
+ "",
887
+ "These types encode differently and cannot be distinguished at runtime.",
888
+ "Remove one of the ambiguous items in the ABI."
889
+ ],
890
+ name: "AbiItemAmbiguityError"
891
+ });
892
+ }
893
+ }
894
+ class hn extends f {
895
+ constructor({ expectedSize: t, givenSize: n }) {
896
+ super(`Expected bytes${t}, got bytes${n}.`, {
897
+ name: "BytesSizeMismatchError"
898
+ });
899
+ }
900
+ }
901
+ class Xi extends f {
902
+ constructor({ abiItem: t, data: n, params: i, size: r }) {
903
+ super([
904
+ `Data size of ${r} bytes is too small for non-indexed event parameters.`
905
+ ].join(`
906
+ `), {
907
+ metaMessages: [
908
+ `Params: (${X(i, { includeName: !0 })})`,
909
+ `Data: ${n} (${r} bytes)`
910
+ ],
911
+ name: "DecodeLogDataMismatch"
912
+ }), Object.defineProperty(this, "abiItem", {
913
+ enumerable: !0,
914
+ configurable: !0,
915
+ writable: !0,
916
+ value: void 0
917
+ }), Object.defineProperty(this, "data", {
918
+ enumerable: !0,
919
+ configurable: !0,
920
+ writable: !0,
921
+ value: void 0
922
+ }), Object.defineProperty(this, "params", {
923
+ enumerable: !0,
924
+ configurable: !0,
925
+ writable: !0,
926
+ value: void 0
927
+ }), Object.defineProperty(this, "size", {
928
+ enumerable: !0,
929
+ configurable: !0,
930
+ writable: !0,
931
+ value: void 0
932
+ }), this.abiItem = t, this.data = n, this.params = i, this.size = r;
933
+ }
934
+ }
935
+ class xi extends f {
936
+ constructor({ abiItem: t, param: n }) {
937
+ super([
938
+ `Expected a topic for indexed event parameter${n.name ? ` "${n.name}"` : ""} on event "${G(t, { includeName: !0 })}".`
939
+ ].join(`
940
+ `), { name: "DecodeLogTopicsMismatch" }), Object.defineProperty(this, "abiItem", {
941
+ enumerable: !0,
942
+ configurable: !0,
943
+ writable: !0,
944
+ value: void 0
945
+ }), this.abiItem = t;
946
+ }
947
+ }
948
+ class gn extends f {
949
+ constructor(t, { docsPath: n }) {
950
+ super([
951
+ `Type "${t}" is not a valid encoding type.`,
952
+ "Please provide a valid ABI type."
953
+ ].join(`
954
+ `), { docsPath: n, name: "InvalidAbiEncodingType" });
955
+ }
956
+ }
957
+ class Qi extends f {
958
+ constructor(t, { docsPath: n }) {
959
+ super([
960
+ `Type "${t}" is not a valid decoding type.`,
961
+ "Please provide a valid ABI type."
962
+ ].join(`
963
+ `), { docsPath: n, name: "InvalidAbiDecodingType" });
964
+ }
965
+ }
966
+ class yn extends f {
967
+ constructor(t) {
968
+ super([`Value "${t}" is not a valid array.`].join(`
969
+ `), {
970
+ name: "InvalidArrayError"
971
+ });
972
+ }
973
+ }
974
+ class En extends f {
975
+ constructor(t) {
976
+ super([
977
+ `"${t}" is not a valid definition type.`,
978
+ 'Valid types: "function", "event", "error"'
979
+ ].join(`
980
+ `), { name: "InvalidDefinitionTypeError" });
981
+ }
982
+ }
983
+ class qi extends f {
984
+ constructor(t) {
985
+ super(`Type "${t}" is not supported for packed encoding.`, {
986
+ name: "UnsupportedPackedAbiType"
987
+ });
988
+ }
989
+ }
990
+ class Le extends f {
991
+ constructor({ offset: t, position: n, size: i }) {
992
+ super(`Slice ${n === "start" ? "starting" : "ending"} at offset "${t}" is out-of-bounds (size: ${i}).`, { name: "SliceOffsetOutOfBoundsError" });
993
+ }
994
+ }
995
+ class Pe extends f {
996
+ constructor({ size: t, targetSize: n, type: i }) {
997
+ super(`${i.charAt(0).toUpperCase()}${i.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`, { name: "SizeExceedsPaddingSizeError" });
998
+ }
999
+ }
1000
+ class Yi extends f {
1001
+ constructor({ size: t, targetSize: n, type: i }) {
1002
+ super(`${i.charAt(0).toUpperCase()}${i.slice(1).toLowerCase()} is expected to be ${n} ${i} long, but is ${t} ${i} long.`, { name: "InvalidBytesLengthError" });
1003
+ }
1004
+ }
1005
+ function R(e, { dir: t, size: n = 32 } = {}) {
1006
+ return typeof e == "string" ? _(e, { dir: t, size: n }) : pn(e, { dir: t, size: n });
1007
+ }
1008
+ function _(e, { dir: t, size: n = 32 } = {}) {
1009
+ if (n === null)
1010
+ return e;
1011
+ const i = e.replace("0x", "");
1012
+ if (i.length > n * 2)
1013
+ throw new Pe({
1014
+ size: Math.ceil(i.length / 2),
1015
+ targetSize: n,
1016
+ type: "hex"
1017
+ });
1018
+ return `0x${i[t === "right" ? "padEnd" : "padStart"](n * 2, "0")}`;
1019
+ }
1020
+ function pn(e, { dir: t, size: n = 32 } = {}) {
1021
+ if (n === null)
1022
+ return e;
1023
+ if (e.length > n)
1024
+ throw new Pe({
1025
+ size: e.length,
1026
+ targetSize: n,
1027
+ type: "bytes"
1028
+ });
1029
+ const i = new Uint8Array(n);
1030
+ for (let r = 0; r < n; r++) {
1031
+ const s = t === "right";
1032
+ i[s ? r : n - r - 1] = e[s ? r : e.length - r - 1];
1033
+ }
1034
+ return i;
1035
+ }
1036
+ class An extends f {
1037
+ constructor({ max: t, min: n, signed: i, size: r, value: s }) {
1038
+ super(`Number "${s}" is not in safe ${r ? `${r * 8}-bit ${i ? "signed" : "unsigned"} ` : ""}integer range ${t ? `(${n} to ${t})` : `(above ${n})`}`, { name: "IntegerOutOfRangeError" });
1039
+ }
1040
+ }
1041
+ class Ji extends f {
1042
+ constructor(t) {
1043
+ super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`, {
1044
+ name: "InvalidBytesBooleanError"
1045
+ });
1046
+ }
1047
+ }
1048
+ class bn extends f {
1049
+ constructor(t) {
1050
+ super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`, { name: "InvalidHexBooleanError" });
1051
+ }
1052
+ }
1053
+ class Zi extends f {
1054
+ constructor(t) {
1055
+ super(`Hex value "${t}" is an odd length (${t.length}). It must be an even length.`, { name: "InvalidHexValueError" });
1056
+ }
1057
+ }
1058
+ class In extends f {
1059
+ constructor({ givenSize: t, maxSize: n }) {
1060
+ super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`, { name: "SizeOverflowError" });
1061
+ }
1062
+ }
1063
+ function H(e, { dir: t = "left" } = {}) {
1064
+ let n = typeof e == "string" ? e.replace("0x", "") : e, i = 0;
1065
+ for (let r = 0; r < n.length - 1 && n[t === "left" ? r : n.length - r - 1].toString() === "0"; r++)
1066
+ i++;
1067
+ return n = t === "left" ? n.slice(i) : n.slice(0, n.length - i), typeof e == "string" ? (n.length === 1 && t === "right" && (n = `${n}0`), `0x${n.length % 2 === 1 ? `0${n}` : n}`) : n;
1068
+ }
1069
+ function O(e, { size: t }) {
1070
+ if (p(e) > t)
1071
+ throw new In({
1072
+ givenSize: p(e),
1073
+ maxSize: t
1074
+ });
1075
+ }
1076
+ function er(e, t) {
1077
+ const n = typeof t == "string" ? { to: t } : t, i = n.to;
1078
+ return i === "number" ? mn(e, n) : i === "bigint" ? Re(e, n) : i === "string" ? vn(e, n) : i === "boolean" ? Tn(e, n) : x(e, n);
1079
+ }
1080
+ function Re(e, t = {}) {
1081
+ const { signed: n } = t;
1082
+ t.size && O(e, { size: t.size });
1083
+ const i = BigInt(e);
1084
+ if (!n)
1085
+ return i;
1086
+ const r = (e.length - 2) / 2, s = (1n << BigInt(r) * 8n - 1n) - 1n;
1087
+ return i <= s ? i : i - BigInt(`0x${"f".padStart(r * 2, "f")}`) - 1n;
1088
+ }
1089
+ function Tn(e, t = {}) {
1090
+ let n = e;
1091
+ if (t.size && (O(n, { size: t.size }), n = H(n)), H(n) === "0x00")
1092
+ return !1;
1093
+ if (H(n) === "0x01")
1094
+ return !0;
1095
+ throw new bn(n);
1096
+ }
1097
+ function mn(e, t = {}) {
1098
+ return Number(Re(e, t));
1099
+ }
1100
+ function vn(e, t = {}) {
1101
+ let n = x(e);
1102
+ return t.size && (O(n, { size: t.size }), n = H(n, { dir: "right" })), new TextDecoder().decode(n);
1103
+ }
1104
+ const Sn = /* @__PURE__ */ Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
1105
+ function ie(e, t = {}) {
1106
+ return typeof e == "number" || typeof e == "bigint" ? D(e, t) : typeof e == "string" ? W(e, t) : typeof e == "boolean" ? Be(e, t) : re(e, t);
1107
+ }
1108
+ function Be(e, t = {}) {
1109
+ const n = `0x${Number(e)}`;
1110
+ return typeof t.size == "number" ? (O(n, { size: t.size }), R(n, { size: t.size })) : n;
1111
+ }
1112
+ function re(e, t = {}) {
1113
+ let n = "";
1114
+ for (let r = 0; r < e.length; r++)
1115
+ n += Sn[e[r]];
1116
+ const i = `0x${n}`;
1117
+ return typeof t.size == "number" ? (O(i, { size: t.size }), R(i, { dir: "right", size: t.size })) : i;
1118
+ }
1119
+ function D(e, t = {}) {
1120
+ const { signed: n, size: i } = t, r = BigInt(e);
1121
+ let s;
1122
+ i ? n ? s = (1n << BigInt(i) * 8n - 1n) - 1n : s = 2n ** (BigInt(i) * 8n) - 1n : typeof e == "number" && (s = BigInt(Number.MAX_SAFE_INTEGER));
1123
+ const o = typeof s == "bigint" && n ? -s - 1n : 0;
1124
+ if (s && r > s || r < o) {
1125
+ const g = typeof e == "bigint" ? "n" : "";
1126
+ throw new An({
1127
+ max: s ? `${s}${g}` : void 0,
1128
+ min: `${o}${g}`,
1129
+ signed: n,
1130
+ size: i,
1131
+ value: `${e}${g}`
1132
+ });
1133
+ }
1134
+ const c = `0x${(n && r < 0 ? (1n << BigInt(i * 8)) + BigInt(r) : r).toString(16)}`;
1135
+ return i ? R(c, { size: i }) : c;
1136
+ }
1137
+ const _n = /* @__PURE__ */ new TextEncoder();
1138
+ function W(e, t = {}) {
1139
+ const n = _n.encode(e);
1140
+ return re(n, t);
1141
+ }
1142
+ const Nn = /* @__PURE__ */ new TextEncoder();
1143
+ function ze(e, t = {}) {
1144
+ return typeof e == "number" || typeof e == "bigint" ? Dn(e, t) : typeof e == "boolean" ? On(e, t) : U(e) ? x(e, t) : Ue(e, t);
1145
+ }
1146
+ function On(e, t = {}) {
1147
+ const n = new Uint8Array(1);
1148
+ return n[0] = Number(e), typeof t.size == "number" ? (O(n, { size: t.size }), R(n, { size: t.size })) : n;
1149
+ }
1150
+ const S = {
1151
+ zero: 48,
1152
+ nine: 57,
1153
+ A: 65,
1154
+ F: 70,
1155
+ a: 97,
1156
+ f: 102
1157
+ };
1158
+ function le(e) {
1159
+ if (e >= S.zero && e <= S.nine)
1160
+ return e - S.zero;
1161
+ if (e >= S.A && e <= S.F)
1162
+ return e - (S.A - 10);
1163
+ if (e >= S.a && e <= S.f)
1164
+ return e - (S.a - 10);
1165
+ }
1166
+ function x(e, t = {}) {
1167
+ let n = e;
1168
+ t.size && (O(n, { size: t.size }), n = R(n, { dir: "right", size: t.size }));
1169
+ let i = n.slice(2);
1170
+ i.length % 2 && (i = `0${i}`);
1171
+ const r = i.length / 2, s = new Uint8Array(r);
1172
+ for (let o = 0, c = 0; o < r; o++) {
1173
+ const g = le(i.charCodeAt(c++)), y = le(i.charCodeAt(c++));
1174
+ if (g === void 0 || y === void 0)
1175
+ throw new f(`Invalid byte sequence ("${i[c - 2]}${i[c - 1]}" in "${i}").`);
1176
+ s[o] = g * 16 + y;
1177
+ }
1178
+ return s;
1179
+ }
1180
+ function Dn(e, t) {
1181
+ const n = D(e, t);
1182
+ return x(n);
1183
+ }
1184
+ function Ue(e, t = {}) {
1185
+ const n = Nn.encode(e);
1186
+ return typeof t.size == "number" ? (O(n, { size: t.size }), R(n, { dir: "right", size: t.size })) : n;
1187
+ }
1188
+ function k(e) {
1189
+ if (!Number.isSafeInteger(e) || e < 0)
1190
+ throw new Error(`positive integer expected, not ${e}`);
1191
+ }
1192
+ function wn(e) {
1193
+ return e instanceof Uint8Array || e != null && typeof e == "object" && e.constructor.name === "Uint8Array";
1194
+ }
1195
+ function Q(e, ...t) {
1196
+ if (!wn(e))
1197
+ throw new Error("Uint8Array expected");
1198
+ if (t.length > 0 && !t.includes(e.length))
1199
+ throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`);
1200
+ }
1201
+ function tr(e) {
1202
+ if (typeof e != "function" || typeof e.create != "function")
1203
+ throw new Error("Hash should be wrapped by utils.wrapConstructor");
1204
+ k(e.outputLen), k(e.blockLen);
1205
+ }
1206
+ function he(e, t = !0) {
1207
+ if (e.destroyed)
1208
+ throw new Error("Hash instance has been destroyed");
1209
+ if (t && e.finished)
1210
+ throw new Error("Hash#digest() has already been called");
1211
+ }
1212
+ function $n(e, t) {
1213
+ Q(e);
1214
+ const n = t.outputLen;
1215
+ if (e.length < n)
1216
+ throw new Error(`digestInto() expects output buffer of length at least ${n}`);
1217
+ }
1218
+ const F = /* @__PURE__ */ BigInt(2 ** 32 - 1), ge = /* @__PURE__ */ BigInt(32);
1219
+ function Cn(e, t = !1) {
1220
+ return t ? { h: Number(e & F), l: Number(e >> ge & F) } : { h: Number(e >> ge & F) | 0, l: Number(e & F) | 0 };
1221
+ }
1222
+ function Mn(e, t = !1) {
1223
+ let n = new Uint32Array(e.length), i = new Uint32Array(e.length);
1224
+ for (let r = 0; r < e.length; r++) {
1225
+ const { h: s, l: o } = Cn(e[r], t);
1226
+ [n[r], i[r]] = [s, o];
1227
+ }
1228
+ return [n, i];
1229
+ }
1230
+ const Ln = (e, t, n) => e << n | t >>> 32 - n, Pn = (e, t, n) => t << n | e >>> 32 - n, Rn = (e, t, n) => t << n - 32 | e >>> 64 - n, Bn = (e, t, n) => e << n - 32 | t >>> 64 - n, C = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
1231
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
1232
+ const zn = (e) => new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4)), nr = (e) => new DataView(e.buffer, e.byteOffset, e.byteLength), ir = (e, t) => e << 32 - t | e >>> t, rr = (e, t) => e << t | e >>> 32 - t >>> 0, ye = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68, Un = (e) => e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
1233
+ function Ee(e) {
1234
+ for (let t = 0; t < e.length; t++)
1235
+ e[t] = Un(e[t]);
1236
+ }
1237
+ function jn(e) {
1238
+ if (typeof e != "string")
1239
+ throw new Error(`utf8ToBytes expected string, got ${typeof e}`);
1240
+ return new Uint8Array(new TextEncoder().encode(e));
1241
+ }
1242
+ function je(e) {
1243
+ return typeof e == "string" && (e = jn(e)), Q(e), e;
1244
+ }
1245
+ function sr(...e) {
1246
+ let t = 0;
1247
+ for (let i = 0; i < e.length; i++) {
1248
+ const r = e[i];
1249
+ Q(r), t += r.length;
1250
+ }
1251
+ const n = new Uint8Array(t);
1252
+ for (let i = 0, r = 0; i < e.length; i++) {
1253
+ const s = e[i];
1254
+ n.set(s, r), r += s.length;
1255
+ }
1256
+ return n;
1257
+ }
1258
+ class Fn {
1259
+ // Safe version that clones internal state
1260
+ clone() {
1261
+ return this._cloneInto();
1262
+ }
1263
+ }
1264
+ function Hn(e) {
1265
+ const t = (i) => e().update(je(i)).digest(), n = e();
1266
+ return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = () => e(), t;
1267
+ }
1268
+ function or(e = 32) {
1269
+ if (C && typeof C.getRandomValues == "function")
1270
+ return C.getRandomValues(new Uint8Array(e));
1271
+ if (C && typeof C.randomBytes == "function")
1272
+ return C.randomBytes(e);
1273
+ throw new Error("crypto.getRandomValues must be defined");
1274
+ }
1275
+ const Fe = [], He = [], Ge = [], Gn = /* @__PURE__ */ BigInt(0), z = /* @__PURE__ */ BigInt(1), Wn = /* @__PURE__ */ BigInt(2), kn = /* @__PURE__ */ BigInt(7), Vn = /* @__PURE__ */ BigInt(256), Kn = /* @__PURE__ */ BigInt(113);
1276
+ for (let e = 0, t = z, n = 1, i = 0; e < 24; e++) {
1277
+ [n, i] = [i, (2 * n + 3 * i) % 5], Fe.push(2 * (5 * i + n)), He.push((e + 1) * (e + 2) / 2 % 64);
1278
+ let r = Gn;
1279
+ for (let s = 0; s < 7; s++)
1280
+ t = (t << z ^ (t >> kn) * Kn) % Vn, t & Wn && (r ^= z << (z << /* @__PURE__ */ BigInt(s)) - z);
1281
+ Ge.push(r);
1282
+ }
1283
+ const [Xn, xn] = /* @__PURE__ */ Mn(Ge, !0), pe = (e, t, n) => n > 32 ? Rn(e, t, n) : Ln(e, t, n), Ae = (e, t, n) => n > 32 ? Bn(e, t, n) : Pn(e, t, n);
1284
+ function Qn(e, t = 24) {
1285
+ const n = new Uint32Array(10);
1286
+ for (let i = 24 - t; i < 24; i++) {
1287
+ for (let o = 0; o < 10; o++)
1288
+ n[o] = e[o] ^ e[o + 10] ^ e[o + 20] ^ e[o + 30] ^ e[o + 40];
1289
+ for (let o = 0; o < 10; o += 2) {
1290
+ const c = (o + 8) % 10, g = (o + 2) % 10, y = n[g], h = n[g + 1], E = pe(y, h, 1) ^ n[c], v = Ae(y, h, 1) ^ n[c + 1];
1291
+ for (let b = 0; b < 50; b += 10)
1292
+ e[o + b] ^= E, e[o + b + 1] ^= v;
1293
+ }
1294
+ let r = e[2], s = e[3];
1295
+ for (let o = 0; o < 24; o++) {
1296
+ const c = He[o], g = pe(r, s, c), y = Ae(r, s, c), h = Fe[o];
1297
+ r = e[h], s = e[h + 1], e[h] = g, e[h + 1] = y;
1298
+ }
1299
+ for (let o = 0; o < 50; o += 10) {
1300
+ for (let c = 0; c < 10; c++)
1301
+ n[c] = e[o + c];
1302
+ for (let c = 0; c < 10; c++)
1303
+ e[o + c] ^= ~n[(c + 2) % 10] & n[(c + 4) % 10];
1304
+ }
1305
+ e[0] ^= Xn[i], e[1] ^= xn[i];
1306
+ }
1307
+ n.fill(0);
1308
+ }
1309
+ class se extends Fn {
1310
+ // NOTE: we accept arguments in bytes instead of bits here.
1311
+ constructor(t, n, i, r = !1, s = 24) {
1312
+ if (super(), this.blockLen = t, this.suffix = n, this.outputLen = i, this.enableXOF = r, this.rounds = s, this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, k(i), 0 >= this.blockLen || this.blockLen >= 200)
1313
+ throw new Error("Sha3 supports only keccak-f1600 function");
1314
+ this.state = new Uint8Array(200), this.state32 = zn(this.state);
1315
+ }
1316
+ keccak() {
1317
+ ye || Ee(this.state32), Qn(this.state32, this.rounds), ye || Ee(this.state32), this.posOut = 0, this.pos = 0;
1318
+ }
1319
+ update(t) {
1320
+ he(this);
1321
+ const { blockLen: n, state: i } = this;
1322
+ t = je(t);
1323
+ const r = t.length;
1324
+ for (let s = 0; s < r; ) {
1325
+ const o = Math.min(n - this.pos, r - s);
1326
+ for (let c = 0; c < o; c++)
1327
+ i[this.pos++] ^= t[s++];
1328
+ this.pos === n && this.keccak();
1329
+ }
1330
+ return this;
1331
+ }
1332
+ finish() {
1333
+ if (this.finished)
1334
+ return;
1335
+ this.finished = !0;
1336
+ const { state: t, suffix: n, pos: i, blockLen: r } = this;
1337
+ t[i] ^= n, n & 128 && i === r - 1 && this.keccak(), t[r - 1] ^= 128, this.keccak();
1338
+ }
1339
+ writeInto(t) {
1340
+ he(this, !1), Q(t), this.finish();
1341
+ const n = this.state, { blockLen: i } = this;
1342
+ for (let r = 0, s = t.length; r < s; ) {
1343
+ this.posOut >= i && this.keccak();
1344
+ const o = Math.min(i - this.posOut, s - r);
1345
+ t.set(n.subarray(this.posOut, this.posOut + o), r), this.posOut += o, r += o;
1346
+ }
1347
+ return t;
1348
+ }
1349
+ xofInto(t) {
1350
+ if (!this.enableXOF)
1351
+ throw new Error("XOF is not possible for this instance");
1352
+ return this.writeInto(t);
1353
+ }
1354
+ xof(t) {
1355
+ return k(t), this.xofInto(new Uint8Array(t));
1356
+ }
1357
+ digestInto(t) {
1358
+ if ($n(t, this), this.finished)
1359
+ throw new Error("digest() was already called");
1360
+ return this.writeInto(t), this.destroy(), t;
1361
+ }
1362
+ digest() {
1363
+ return this.digestInto(new Uint8Array(this.outputLen));
1364
+ }
1365
+ destroy() {
1366
+ this.destroyed = !0, this.state.fill(0);
1367
+ }
1368
+ _cloneInto(t) {
1369
+ const { blockLen: n, suffix: i, outputLen: r, rounds: s, enableXOF: o } = this;
1370
+ return t || (t = new se(n, i, r, o, s)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = s, t.suffix = i, t.outputLen = r, t.enableXOF = o, t.destroyed = this.destroyed, t;
1371
+ }
1372
+ }
1373
+ const qn = (e, t, n) => Hn(() => new se(t, e, n)), Yn = /* @__PURE__ */ qn(1, 136, 256 / 8);
1374
+ function m(e, t) {
1375
+ const n = t || "hex", i = Yn(U(e, { strict: !1 }) ? ze(e) : e);
1376
+ return n === "bytes" ? i : ie(i);
1377
+ }
1378
+ const Jn = (e) => m(ze(e));
1379
+ function Zn(e) {
1380
+ return Jn(e);
1381
+ }
1382
+ function ei(e) {
1383
+ let t = !0, n = "", i = 0, r = "", s = !1;
1384
+ for (let o = 0; o < e.length; o++) {
1385
+ const c = e[o];
1386
+ if (["(", ")", ","].includes(c) && (t = !0), c === "(" && i++, c === ")" && i--, !!t) {
1387
+ if (i === 0) {
1388
+ if (c === " " && ["event", "function", ""].includes(r))
1389
+ r = "";
1390
+ else if (r += c, c === ")") {
1391
+ s = !0;
1392
+ break;
1393
+ }
1394
+ continue;
1395
+ }
1396
+ if (c === " ") {
1397
+ e[o - 1] !== "," && n !== "," && n !== ",(" && (n = "", t = !1);
1398
+ continue;
1399
+ }
1400
+ r += c, n += c;
1401
+ }
1402
+ }
1403
+ if (!s)
1404
+ throw new f("Unable to normalize signature.");
1405
+ return r;
1406
+ }
1407
+ const ti = (e) => {
1408
+ const t = typeof e == "string" ? e : an(e);
1409
+ return ei(t);
1410
+ };
1411
+ function We(e) {
1412
+ return Zn(ti(e));
1413
+ }
1414
+ const ni = We;
1415
+ class oe extends f {
1416
+ constructor({ address: t }) {
1417
+ super(`Address "${t}" is invalid.`, {
1418
+ metaMessages: [
1419
+ "- Address must be a hex value of 20 bytes (40 hex characters).",
1420
+ "- Address must match its checksum counterpart."
1421
+ ],
1422
+ name: "InvalidAddressError"
1423
+ });
1424
+ }
1425
+ }
1426
+ class ke extends Map {
1427
+ constructor(t) {
1428
+ super(), Object.defineProperty(this, "maxSize", {
1429
+ enumerable: !0,
1430
+ configurable: !0,
1431
+ writable: !0,
1432
+ value: void 0
1433
+ }), this.maxSize = t;
1434
+ }
1435
+ get(t) {
1436
+ const n = super.get(t);
1437
+ return super.has(t) && n !== void 0 && (this.delete(t), super.set(t, n)), n;
1438
+ }
1439
+ set(t, n) {
1440
+ if (super.set(t, n), this.maxSize && this.size > this.maxSize) {
1441
+ const i = this.keys().next().value;
1442
+ i && this.delete(i);
1443
+ }
1444
+ return this;
1445
+ }
1446
+ }
1447
+ const J = /* @__PURE__ */ new ke(8192);
1448
+ function Ve(e, t) {
1449
+ if (J.has(`${e}.${t}`))
1450
+ return J.get(`${e}.${t}`);
1451
+ const n = t ? `${t}${e.toLowerCase()}` : e.substring(2).toLowerCase(), i = m(Ue(n), "bytes"), r = (t ? n.substring(`${t}0x`.length) : n).split("");
1452
+ for (let o = 0; o < 40; o += 2)
1453
+ i[o >> 1] >> 4 >= 8 && r[o] && (r[o] = r[o].toUpperCase()), (i[o >> 1] & 15) >= 8 && r[o + 1] && (r[o + 1] = r[o + 1].toUpperCase());
1454
+ const s = `0x${r.join("")}`;
1455
+ return J.set(`${e}.${t}`, s), s;
1456
+ }
1457
+ function ar(e, t) {
1458
+ if (!P(e, { strict: !1 }))
1459
+ throw new oe({ address: e });
1460
+ return Ve(e, t);
1461
+ }
1462
+ const ii = /^0x[a-fA-F0-9]{40}$/, Z = /* @__PURE__ */ new ke(8192);
1463
+ function P(e, t) {
1464
+ const { strict: n = !0 } = t ?? {}, i = `${e}.${n}`;
1465
+ if (Z.has(i))
1466
+ return Z.get(i);
1467
+ const r = ii.test(e) ? e.toLowerCase() === e ? !0 : n ? Ve(e) === e : !0 : !1;
1468
+ return Z.set(i, r), r;
1469
+ }
1470
+ function N(e) {
1471
+ return typeof e[0] == "string" ? Ke(e) : ri(e);
1472
+ }
1473
+ function ri(e) {
1474
+ let t = 0;
1475
+ for (const r of e)
1476
+ t += r.length;
1477
+ const n = new Uint8Array(t);
1478
+ let i = 0;
1479
+ for (const r of e)
1480
+ n.set(r, i), i += r.length;
1481
+ return n;
1482
+ }
1483
+ function Ke(e) {
1484
+ return `0x${e.reduce((t, n) => t + n.replace("0x", ""), "")}`;
1485
+ }
1486
+ function Xe(e, t, n, { strict: i } = {}) {
1487
+ return U(e, { strict: !1 }) ? oi(e, t, n, {
1488
+ strict: i
1489
+ }) : si(e, t, n, {
1490
+ strict: i
1491
+ });
1492
+ }
1493
+ function xe(e, t) {
1494
+ if (typeof t == "number" && t > 0 && t > p(e) - 1)
1495
+ throw new Le({
1496
+ offset: t,
1497
+ position: "start",
1498
+ size: p(e)
1499
+ });
1500
+ }
1501
+ function Qe(e, t, n) {
1502
+ if (typeof t == "number" && typeof n == "number" && p(e) !== n - t)
1503
+ throw new Le({
1504
+ offset: n,
1505
+ position: "end",
1506
+ size: p(e)
1507
+ });
1508
+ }
1509
+ function si(e, t, n, { strict: i } = {}) {
1510
+ xe(e, t);
1511
+ const r = e.slice(t, n);
1512
+ return i && Qe(r, t, n), r;
1513
+ }
1514
+ function oi(e, t, n, { strict: i } = {}) {
1515
+ xe(e, t);
1516
+ const r = `0x${e.replace("0x", "").slice((t ?? 0) * 2, (n ?? e.length) * 2)}`;
1517
+ return i && Qe(r, t, n), r;
1518
+ }
1519
+ function ae(e, t) {
1520
+ if (e.length !== t.length)
1521
+ throw new fn({
1522
+ expectedLength: e.length,
1523
+ givenLength: t.length
1524
+ });
1525
+ const n = ai({
1526
+ params: e,
1527
+ values: t
1528
+ }), i = ue(n);
1529
+ return i.length === 0 ? "0x" : i;
1530
+ }
1531
+ function ai({ params: e, values: t }) {
1532
+ const n = [];
1533
+ for (let i = 0; i < e.length; i++)
1534
+ n.push(ce({ param: e[i], value: t[i] }));
1535
+ return n;
1536
+ }
1537
+ function ce({ param: e, value: t }) {
1538
+ const n = yi(e.type);
1539
+ if (n) {
1540
+ const [i, r] = n;
1541
+ return ui(t, { length: i, param: { ...e, type: r } });
1542
+ }
1543
+ if (e.type === "tuple")
1544
+ return gi(t, {
1545
+ param: e
1546
+ });
1547
+ if (e.type === "address")
1548
+ return ci(t);
1549
+ if (e.type === "bool")
1550
+ return fi(t);
1551
+ if (e.type.startsWith("uint") || e.type.startsWith("int")) {
1552
+ const i = e.type.startsWith("int");
1553
+ return li(t, { signed: i });
1554
+ }
1555
+ if (e.type.startsWith("bytes"))
1556
+ return di(t, { param: e });
1557
+ if (e.type === "string")
1558
+ return hi(t);
1559
+ throw new gn(e.type, {
1560
+ docsPath: "/docs/contract/encodeAbiParameters"
1561
+ });
1562
+ }
1563
+ function ue(e) {
1564
+ let t = 0;
1565
+ for (let s = 0; s < e.length; s++) {
1566
+ const { dynamic: o, encoded: c } = e[s];
1567
+ o ? t += 32 : t += p(c);
1568
+ }
1569
+ const n = [], i = [];
1570
+ let r = 0;
1571
+ for (let s = 0; s < e.length; s++) {
1572
+ const { dynamic: o, encoded: c } = e[s];
1573
+ o ? (n.push(D(t + r, { size: 32 })), i.push(c), r += p(c)) : n.push(c);
1574
+ }
1575
+ return N([...n, ...i]);
1576
+ }
1577
+ function ci(e) {
1578
+ if (!P(e))
1579
+ throw new oe({ address: e });
1580
+ return { dynamic: !1, encoded: _(e.toLowerCase()) };
1581
+ }
1582
+ function ui(e, { length: t, param: n }) {
1583
+ const i = t === null;
1584
+ if (!Array.isArray(e))
1585
+ throw new yn(e);
1586
+ if (!i && e.length !== t)
1587
+ throw new un({
1588
+ expectedLength: t,
1589
+ givenLength: e.length,
1590
+ type: `${n.type}[${t}]`
1591
+ });
1592
+ let r = !1;
1593
+ const s = [];
1594
+ for (let o = 0; o < e.length; o++) {
1595
+ const c = ce({ param: n, value: e[o] });
1596
+ c.dynamic && (r = !0), s.push(c);
1597
+ }
1598
+ if (i || r) {
1599
+ const o = ue(s);
1600
+ if (i) {
1601
+ const c = D(s.length, { size: 32 });
1602
+ return {
1603
+ dynamic: !0,
1604
+ encoded: s.length > 0 ? N([c, o]) : c
1605
+ };
1606
+ }
1607
+ if (r)
1608
+ return { dynamic: !0, encoded: o };
1609
+ }
1610
+ return {
1611
+ dynamic: !1,
1612
+ encoded: N(s.map(({ encoded: o }) => o))
1613
+ };
1614
+ }
1615
+ function di(e, { param: t }) {
1616
+ const [, n] = t.type.split("bytes"), i = p(e);
1617
+ if (!n) {
1618
+ let r = e;
1619
+ return i % 32 !== 0 && (r = _(r, {
1620
+ dir: "right",
1621
+ size: Math.ceil((e.length - 2) / 2 / 32) * 32
1622
+ })), {
1623
+ dynamic: !0,
1624
+ encoded: N([_(D(i, { size: 32 })), r])
1625
+ };
1626
+ }
1627
+ if (i !== Number.parseInt(n))
1628
+ throw new dn({
1629
+ expectedSize: Number.parseInt(n),
1630
+ value: e
1631
+ });
1632
+ return { dynamic: !1, encoded: _(e, { dir: "right" }) };
1633
+ }
1634
+ function fi(e) {
1635
+ if (typeof e != "boolean")
1636
+ throw new f(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);
1637
+ return { dynamic: !1, encoded: _(Be(e)) };
1638
+ }
1639
+ function li(e, { signed: t }) {
1640
+ return {
1641
+ dynamic: !1,
1642
+ encoded: D(e, {
1643
+ size: 32,
1644
+ signed: t
1645
+ })
1646
+ };
1647
+ }
1648
+ function hi(e) {
1649
+ const t = W(e), n = Math.ceil(p(t) / 32), i = [];
1650
+ for (let r = 0; r < n; r++)
1651
+ i.push(_(Xe(t, r * 32, (r + 1) * 32), {
1652
+ dir: "right"
1653
+ }));
1654
+ return {
1655
+ dynamic: !0,
1656
+ encoded: N([
1657
+ _(D(p(t), { size: 32 })),
1658
+ ...i
1659
+ ])
1660
+ };
1661
+ }
1662
+ function gi(e, { param: t }) {
1663
+ let n = !1;
1664
+ const i = [];
1665
+ for (let r = 0; r < t.components.length; r++) {
1666
+ const s = t.components[r], o = Array.isArray(e) ? r : s.name, c = ce({
1667
+ param: s,
1668
+ value: e[o]
1669
+ });
1670
+ i.push(c), c.dynamic && (n = !0);
1671
+ }
1672
+ return {
1673
+ dynamic: n,
1674
+ encoded: n ? ue(i) : N(i.map(({ encoded: r }) => r))
1675
+ };
1676
+ }
1677
+ function yi(e) {
1678
+ const t = e.match(/^(.*)\[(\d+)?\]$/);
1679
+ return t ? (
1680
+ // Return `null` if the array is dynamic.
1681
+ [t[2] ? Number(t[2]) : null, t[1]]
1682
+ ) : void 0;
1683
+ }
1684
+ const qe = (e) => Xe(We(e), 0, 4);
1685
+ function Ei(e) {
1686
+ const { abi: t, args: n = [], name: i } = e, r = U(i, { strict: !1 }), s = t.filter((c) => r ? c.type === "function" ? qe(c) === i : c.type === "event" ? ni(c) === i : !1 : "name" in c && c.name === i);
1687
+ if (s.length === 0)
1688
+ return;
1689
+ if (s.length === 1)
1690
+ return s[0];
1691
+ let o;
1692
+ for (const c of s) {
1693
+ if (!("inputs" in c))
1694
+ continue;
1695
+ if (!n || n.length === 0) {
1696
+ if (!c.inputs || c.inputs.length === 0)
1697
+ return c;
1698
+ continue;
1699
+ }
1700
+ if (!c.inputs || c.inputs.length === 0 || c.inputs.length !== n.length)
1701
+ continue;
1702
+ if (n.every((y, h) => {
1703
+ const E = "inputs" in c && c.inputs[h];
1704
+ return E ? te(y, E) : !1;
1705
+ })) {
1706
+ if (o && "inputs" in o && o.inputs) {
1707
+ const y = Ye(c.inputs, o.inputs, n);
1708
+ if (y)
1709
+ throw new ln({
1710
+ abiItem: c,
1711
+ type: y[0]
1712
+ }, {
1713
+ abiItem: o,
1714
+ type: y[1]
1715
+ });
1716
+ }
1717
+ o = c;
1718
+ }
1719
+ }
1720
+ return o || s[0];
1721
+ }
1722
+ function te(e, t) {
1723
+ const n = typeof e, i = t.type;
1724
+ switch (i) {
1725
+ case "address":
1726
+ return P(e, { strict: !1 });
1727
+ case "bool":
1728
+ return n === "boolean";
1729
+ case "function":
1730
+ return n === "string";
1731
+ case "string":
1732
+ return n === "string";
1733
+ default:
1734
+ return i === "tuple" && "components" in t ? Object.values(t.components).every((r, s) => te(Object.values(e)[s], r)) : /^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(i) ? n === "number" || n === "bigint" : /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(i) ? n === "string" || e instanceof Uint8Array : /[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(i) ? Array.isArray(e) && e.every((r) => te(r, {
1735
+ ...t,
1736
+ // Pop off `[]` or `[M]` from end of type
1737
+ type: i.replace(/(\[[0-9]{0,}\])$/, "")
1738
+ })) : !1;
1739
+ }
1740
+ }
1741
+ function Ye(e, t, n) {
1742
+ for (const i in e) {
1743
+ const r = e[i], s = t[i];
1744
+ if (r.type === "tuple" && s.type === "tuple" && "components" in r && "components" in s)
1745
+ return Ye(r.components, s.components, n[i]);
1746
+ const o = [r.type, s.type];
1747
+ if (o.includes("address") && o.includes("bytes20") ? !0 : o.includes("address") && o.includes("string") ? P(n[i], { strict: !1 }) : o.includes("address") && o.includes("bytes") ? P(n[i], { strict: !1 }) : !1)
1748
+ return o;
1749
+ }
1750
+ }
1751
+ const be = "/docs/contract/encodeFunctionData";
1752
+ function pi(e) {
1753
+ const { abi: t, args: n, functionName: i } = e;
1754
+ let r = t[0];
1755
+ if (i) {
1756
+ const s = Ei({
1757
+ abi: t,
1758
+ args: n,
1759
+ name: i
1760
+ });
1761
+ if (!s)
1762
+ throw new fe(i, { docsPath: be });
1763
+ r = s;
1764
+ }
1765
+ if (r.type !== "function")
1766
+ throw new fe(void 0, { docsPath: be });
1767
+ return {
1768
+ abi: [r],
1769
+ functionName: qe(G(r))
1770
+ };
1771
+ }
1772
+ function cr(e) {
1773
+ const { args: t } = e, { abi: n, functionName: i } = (() => {
1774
+ var c;
1775
+ return e.abi.length === 1 && ((c = e.functionName) != null && c.startsWith("0x")) ? e : pi(e);
1776
+ })(), r = n[0], s = i, o = "inputs" in r && r.inputs ? ae(r.inputs, t ?? []) : void 0;
1777
+ return Ke([s, o ?? "0x"]);
1778
+ }
1779
+ const Je = (e, t, n) => JSON.stringify(e, (i, r) => {
1780
+ const s = typeof r == "bigint" ? r.toString() : r;
1781
+ return typeof t == "function" ? t(i, s) : s;
1782
+ }, n), ur = /^(.*)\[([0-9]*)\]$/, Ai = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/, bi = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
1783
+ class Ii extends f {
1784
+ constructor({ domain: t }) {
1785
+ super(`Invalid domain "${Je(t)}".`, {
1786
+ metaMessages: ["Must be a valid EIP-712 domain."]
1787
+ });
1788
+ }
1789
+ }
1790
+ class Ti extends f {
1791
+ constructor({ primaryType: t, types: n }) {
1792
+ super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`, {
1793
+ docsPath: "/api/glossary/Errors#typeddatainvalidprimarytypeerror",
1794
+ metaMessages: ["Check that the primary type is a key in `types`."]
1795
+ });
1796
+ }
1797
+ }
1798
+ class mi extends f {
1799
+ constructor({ type: t }) {
1800
+ super(`Struct type "${t}" is invalid.`, {
1801
+ metaMessages: ["Struct type must not be a Solidity type."],
1802
+ name: "InvalidStructTypeError"
1803
+ });
1804
+ }
1805
+ }
1806
+ function dr(e) {
1807
+ const { domain: t = {}, message: n, primaryType: i } = e, r = {
1808
+ EIP712Domain: rt({ domain: t }),
1809
+ ...e.types
1810
+ };
1811
+ _i({
1812
+ domain: t,
1813
+ message: n,
1814
+ primaryType: i,
1815
+ types: r
1816
+ });
1817
+ const s = ["0x1901"];
1818
+ return t && s.push(Ze({
1819
+ domain: t,
1820
+ types: r
1821
+ })), i !== "EIP712Domain" && s.push(et({
1822
+ data: n,
1823
+ primaryType: i,
1824
+ types: r
1825
+ })), m(N(s));
1826
+ }
1827
+ function Ze({ domain: e, types: t }) {
1828
+ return et({
1829
+ data: e,
1830
+ primaryType: "EIP712Domain",
1831
+ types: t
1832
+ });
1833
+ }
1834
+ function et({ data: e, primaryType: t, types: n }) {
1835
+ const i = tt({
1836
+ data: e,
1837
+ primaryType: t,
1838
+ types: n
1839
+ });
1840
+ return m(i);
1841
+ }
1842
+ function tt({ data: e, primaryType: t, types: n }) {
1843
+ const i = [{ type: "bytes32" }], r = [vi({ primaryType: t, types: n })];
1844
+ for (const s of n[t]) {
1845
+ const [o, c] = it({
1846
+ types: n,
1847
+ name: s.name,
1848
+ type: s.type,
1849
+ value: e[s.name]
1850
+ });
1851
+ i.push(o), r.push(c);
1852
+ }
1853
+ return ae(i, r);
1854
+ }
1855
+ function vi({ primaryType: e, types: t }) {
1856
+ const n = ie(Si({ primaryType: e, types: t }));
1857
+ return m(n);
1858
+ }
1859
+ function Si({ primaryType: e, types: t }) {
1860
+ let n = "";
1861
+ const i = nt({ primaryType: e, types: t });
1862
+ i.delete(e);
1863
+ const r = [e, ...Array.from(i).sort()];
1864
+ for (const s of r)
1865
+ n += `${s}(${t[s].map(({ name: o, type: c }) => `${c} ${o}`).join(",")})`;
1866
+ return n;
1867
+ }
1868
+ function nt({ primaryType: e, types: t }, n = /* @__PURE__ */ new Set()) {
1869
+ const i = e.match(/^\w*/u), r = i == null ? void 0 : i[0];
1870
+ if (n.has(r) || t[r] === void 0)
1871
+ return n;
1872
+ n.add(r);
1873
+ for (const s of t[r])
1874
+ nt({ primaryType: s.type, types: t }, n);
1875
+ return n;
1876
+ }
1877
+ function it({ types: e, name: t, type: n, value: i }) {
1878
+ if (e[n] !== void 0)
1879
+ return [
1880
+ { type: "bytes32" },
1881
+ m(tt({ data: i, primaryType: n, types: e }))
1882
+ ];
1883
+ if (n === "bytes")
1884
+ return i = `0x${(i.length % 2 ? "0" : "") + i.slice(2)}`, [{ type: "bytes32" }, m(i)];
1885
+ if (n === "string")
1886
+ return [{ type: "bytes32" }, m(ie(i))];
1887
+ if (n.lastIndexOf("]") === n.length - 1) {
1888
+ const r = n.slice(0, n.lastIndexOf("[")), s = i.map((o) => it({
1889
+ name: t,
1890
+ type: r,
1891
+ types: e,
1892
+ value: o
1893
+ }));
1894
+ return [
1895
+ { type: "bytes32" },
1896
+ m(ae(s.map(([o]) => o), s.map(([, o]) => o)))
1897
+ ];
1898
+ }
1899
+ return [{ type: n }, i];
1900
+ }
1901
+ function fr(e) {
1902
+ const { domain: t, message: n, primaryType: i, types: r } = e, s = (g, y) => {
1903
+ const h = { ...y };
1904
+ for (const E of g) {
1905
+ const { name: v, type: b } = E;
1906
+ b === "address" && (h[v] = h[v].toLowerCase());
1907
+ }
1908
+ return h;
1909
+ }, o = r.EIP712Domain ? t ? s(r.EIP712Domain, t) : {} : {}, c = (() => {
1910
+ if (i !== "EIP712Domain")
1911
+ return s(r[i], n);
1912
+ })();
1913
+ return Je({ domain: o, message: c, primaryType: i, types: r });
1914
+ }
1915
+ function _i(e) {
1916
+ const { domain: t, message: n, primaryType: i, types: r } = e, s = (o, c) => {
1917
+ for (const g of o) {
1918
+ const { name: y, type: h } = g, E = c[y], v = h.match(bi);
1919
+ if (v && (typeof E == "number" || typeof E == "bigint")) {
1920
+ const [q, w, Y] = v;
1921
+ D(E, {
1922
+ signed: w === "int",
1923
+ size: Number.parseInt(Y) / 8
1924
+ });
1925
+ }
1926
+ if (h === "address" && typeof E == "string" && !P(E))
1927
+ throw new oe({ address: E });
1928
+ const b = h.match(Ai);
1929
+ if (b) {
1930
+ const [q, w] = b;
1931
+ if (w && p(E) !== Number.parseInt(w))
1932
+ throw new hn({
1933
+ expectedSize: Number.parseInt(w),
1934
+ givenSize: p(E)
1935
+ });
1936
+ }
1937
+ const j = r[h];
1938
+ j && (Ni(h), s(j, E));
1939
+ }
1940
+ };
1941
+ if (r.EIP712Domain && t) {
1942
+ if (typeof t != "object")
1943
+ throw new Ii({ domain: t });
1944
+ s(r.EIP712Domain, t);
1945
+ }
1946
+ if (i !== "EIP712Domain")
1947
+ if (r[i])
1948
+ s(r[i], n);
1949
+ else
1950
+ throw new Ti({ primaryType: i, types: r });
1951
+ }
1952
+ function rt({ domain: e }) {
1953
+ return [
1954
+ typeof (e == null ? void 0 : e.name) == "string" && { name: "name", type: "string" },
1955
+ (e == null ? void 0 : e.version) && { name: "version", type: "string" },
1956
+ typeof (e == null ? void 0 : e.chainId) == "number" && {
1957
+ name: "chainId",
1958
+ type: "uint256"
1959
+ },
1960
+ (e == null ? void 0 : e.verifyingContract) && {
1961
+ name: "verifyingContract",
1962
+ type: "address"
1963
+ },
1964
+ (e == null ? void 0 : e.salt) && { name: "salt", type: "bytes32" }
1965
+ ].filter(Boolean);
1966
+ }
1967
+ function lr({ domain: e }) {
1968
+ return Ze({
1969
+ domain: e,
1970
+ types: {
1971
+ EIP712Domain: rt({ domain: e })
1972
+ }
1973
+ });
1974
+ }
1975
+ function Ni(e) {
1976
+ if (e === "address" || e === "bool" || e === "string" || e.startsWith("bytes") || e.startsWith("uint") || e.startsWith("int"))
1977
+ throw new mi({ type: e });
1978
+ }
1979
+ const Oi = `Ethereum Signed Message:
1980
+ `;
1981
+ function Di(e) {
1982
+ const t = typeof e == "string" ? W(e) : typeof e.raw == "string" ? e.raw : re(e.raw), n = W(`${Oi}${p(t)}`);
1983
+ return N([n, t]);
1984
+ }
1985
+ function hr(e, t) {
1986
+ return m(Di(e), t);
1987
+ }
1988
+ export {
1989
+ Pi as $,
1990
+ ki as A,
1991
+ f as B,
1992
+ si as C,
1993
+ Xe as D,
1994
+ qe as E,
1995
+ Hi as F,
1996
+ Je as G,
1997
+ U as H,
1998
+ Ji as I,
1999
+ ie as J,
2000
+ Ke as K,
2001
+ P as L,
2002
+ oe as M,
2003
+ Yi as N,
2004
+ Fn as O,
2005
+ nr as P,
2006
+ he as Q,
2007
+ je as R,
2008
+ $n as S,
2009
+ Hn as T,
2010
+ ir as U,
2011
+ Gi as V,
2012
+ Wi as W,
2013
+ xi as X,
2014
+ Xi as Y,
2015
+ fe as Z,
2016
+ Vi as _,
2017
+ dr as a,
2018
+ Ri as a0,
2019
+ ke as a1,
2020
+ W as a2,
2021
+ Ue as a3,
2022
+ N as a4,
2023
+ Ki as a5,
2024
+ Fi as a6,
2025
+ ji as a7,
2026
+ fn as a8,
2027
+ R as a9,
2028
+ Ii as aA,
2029
+ bn as aB,
2030
+ Ti as aC,
2031
+ mi as aD,
2032
+ Pe as aE,
2033
+ In as aF,
2034
+ Le as aG,
2035
+ On as aH,
2036
+ ri as aI,
2037
+ lr as aJ,
2038
+ er as aK,
2039
+ ti as aL,
2040
+ Ze as aM,
2041
+ vn as aN,
2042
+ Dn as aO,
2043
+ pn as aP,
2044
+ pi as aQ,
2045
+ Oi as aR,
2046
+ Li as aS,
2047
+ We as aT,
2048
+ Di as aU,
2049
+ xt as aV,
2050
+ Be as aa,
2051
+ bi as ab,
2052
+ Ai as ac,
2053
+ hn as ad,
2054
+ ur as ae,
2055
+ qi as af,
2056
+ ar as ag,
2057
+ Zi as ah,
2058
+ rr as ai,
2059
+ oi as aj,
2060
+ _ as ak,
2061
+ tr as al,
2062
+ Q as am,
2063
+ sr as an,
2064
+ or as ao,
2065
+ Tn as ap,
2066
+ rt as aq,
2067
+ _i as ar,
2068
+ fr as as,
2069
+ Bi as at,
2070
+ un as au,
2071
+ dn as av,
2072
+ An as aw,
2073
+ gn as ax,
2074
+ yn as ay,
2075
+ En as az,
2076
+ on as b,
2077
+ $i as c,
2078
+ Mi as d,
2079
+ cr as e,
2080
+ G as f,
2081
+ Ei as g,
2082
+ hr as h,
2083
+ Ci as i,
2084
+ ze as j,
2085
+ m as k,
2086
+ ae as l,
2087
+ re as m,
2088
+ D as n,
2089
+ O as o,
2090
+ Re as p,
2091
+ H as q,
2092
+ mn as r,
2093
+ x as s,
2094
+ ni as t,
2095
+ p as u,
2096
+ Ui as v,
2097
+ zi as w,
2098
+ yi as x,
2099
+ Qi as y,
2100
+ Ve as z
2101
+ };