astra-modal-test 1.0.11 → 1.0.12

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 (111) hide show
  1. package/README.md +224 -122
  2. package/dist/{SwapController-Ck3TYcMp.js → SwapController-mYFErPzx.js} +1 -1
  3. package/dist/{add-BmBLHIEe.js → add-CXtFvysR.js} +1 -1
  4. package/dist/{all-wallets-H2aaJ2oP.js → all-wallets-B9fFXw5x.js} +1 -1
  5. package/dist/{app-store-Bvhe1BkA.js → app-store-BXf1yvR8.js} +1 -1
  6. package/dist/{apple-BCIKns5c.js → apple-DtcOcX1n.js} +1 -1
  7. package/dist/{arrow-bottom-i1ChNkSf.js → arrow-bottom-BXeLKqSV.js} +1 -1
  8. package/dist/{arrow-bottom-circle-Dpcn0z0p.js → arrow-bottom-circle-BVUU200N.js} +1 -1
  9. package/dist/{arrow-left-Dj8tzUf6.js → arrow-left-LguJPyNR.js} +1 -1
  10. package/dist/{arrow-right-DVd3R-0K.js → arrow-right-D9kKZzGG.js} +1 -1
  11. package/dist/{arrow-top-DcD5wbZL.js → arrow-top-C5JcaCqz.js} +1 -1
  12. package/dist/{bank-CToLOTy3.js → bank-DgbCzr0A.js} +1 -1
  13. package/dist/{bin-D8m48Dk5.js → bin-ykHym2bC.js} +1 -1
  14. package/dist/{bitcoin-y6S4LO0p.js → bitcoin-B8jzy_uV.js} +1 -1
  15. package/dist/{browser-DRhVaQQT.js → browser-Bk8u8PAA.js} +1 -1
  16. package/dist/{card-BK0q3S4W.js → card-DcwQMUca.js} +1 -1
  17. package/dist/ccip-CwJvuExU.js +239 -0
  18. package/dist/{checkmark-C7H1vH4H.js → checkmark-D3aEYZ8B.js} +1 -1
  19. package/dist/{checkmark-bold-DfvIWKpu.js → checkmark-bold-5H7N-CDG.js} +1 -1
  20. package/dist/{chevron-bottom-CcAEP6cD.js → chevron-bottom-BA3C4MR1.js} +1 -1
  21. package/dist/{chevron-left-DMnhSBVl.js → chevron-left-BX18UWKM.js} +1 -1
  22. package/dist/{chevron-right-pPhw9ZBC.js → chevron-right-DG7ovxTe.js} +1 -1
  23. package/dist/{chevron-top-DjqOCRAL.js → chevron-top-DHfev7lV.js} +1 -1
  24. package/dist/{chrome-store-B-9bRAPM.js → chrome-store-BSVzpGdu.js} +1 -1
  25. package/dist/{circle-SPbxfVZq.js → circle-SYFB9f2-.js} +1 -1
  26. package/dist/{clock-BLAT4wv4.js → clock-Cygqlf1g.js} +1 -1
  27. package/dist/{close-D1AyyJzy.js → close-B43cuuko.js} +1 -1
  28. package/dist/{coinPlaceholder-DGk1in74.js → coinPlaceholder-BHdR6bKb.js} +1 -1
  29. package/dist/{compass-C0-SVkSt.js → compass-7S6b6wyA.js} +1 -1
  30. package/dist/{copy-CPcvwITz.js → copy-CT53bEwd.js} +1 -1
  31. package/dist/{cursor-transparent-BJsEpe-G.js → cursor-transparent-LmjzjsFm.js} +1 -1
  32. package/dist/{cursor-ChlOWEcO.js → cursor-vtqRnrF7.js} +1 -1
  33. package/dist/{desktop-Z8iZvVCW.js → desktop-Doa7TQsq.js} +1 -1
  34. package/dist/{disconnect-DkPQjiLk.js → disconnect-C5G6Ncu_.js} +1 -1
  35. package/dist/{discord-CwRdgvGZ.js → discord-DX7Cl3Ko.js} +1 -1
  36. package/dist/{email-DA_5xt-j.js → email-CyHWh9wL.js} +1 -1
  37. package/dist/{embedded-wallet-DYnGl5tL.js → embedded-wallet-BZQImi7s.js} +8 -8
  38. package/dist/{ethereum-Dwse3Umc.js → ethereum-Bwvtk5-_.js} +1 -1
  39. package/dist/{etherscan-CNmwyrRn.js → etherscan-CyVRICvw.js} +1 -1
  40. package/dist/{exclamation-triangle-CU8gn-bU.js → exclamation-triangle-BDbPL3nL.js} +1 -1
  41. package/dist/{extension-rikwXWrg.js → extension-Cx3t2k-R.js} +1 -1
  42. package/dist/{external-link-mDp8JVE0.js → external-link-DZCYpOZI.js} +1 -1
  43. package/dist/{facebook-c0IS1D9G.js → facebook-BEnPrhG3.js} +1 -1
  44. package/dist/{farcaster-DpvSDnGl.js → farcaster-DyBPLb_k.js} +1 -1
  45. package/dist/{filters-B42-1BLn.js → filters-CTwxivn_.js} +1 -1
  46. package/dist/{github-DvjZxkXF.js → github-kzQb61pT.js} +1 -1
  47. package/dist/{google-CLHf_zAz.js → google-DSC-rYNu.js} +1 -1
  48. package/dist/{help-circle-BI5xgPAz.js → help-circle-C5XfimVx.js} +1 -1
  49. package/dist/{id-BxI79dX4.js → id-B9fQOT4E.js} +1 -1
  50. package/dist/{image-Cr1qAxG-.js → image-1CCj36XM.js} +1 -1
  51. package/dist/{index-C_3PUMa7.js → index-Bjik7E9u.js} +1 -1
  52. package/dist/{index-DtAG8k9M.js → index-C1fgrzi0.js} +16 -16
  53. package/dist/{index-D7jufxlk.js → index-CyeGBcX0.js} +1 -1
  54. package/dist/{index-C49-8bCQ.js → index-DKEMW9N8.js} +25 -25
  55. package/dist/{index-Zh6wUpmX.js → index-LucuShOc.js} +45070 -56076
  56. package/dist/{info-BUp5BYav.js → info-Begf9tO0.js} +1 -1
  57. package/dist/{info-circle-D5anzkYK.js → info-circle-Bo1H2OXh.js} +1 -1
  58. package/dist/{lightbulb-DmuhLv29.js → lightbulb-C-SU_z2I.js} +1 -1
  59. package/dist/{mail-D2hRmmgi.js → mail-CXsYiNAT.js} +1 -1
  60. package/dist/{mobile-Cq-9uJHv.js → mobile-C7bUjgog.js} +1 -1
  61. package/dist/{more-DJMBaB2z.js → more-29BC-wmy.js} +1 -1
  62. package/dist/{network-placeholder-3ip1roR0.js → network-placeholder-B-x3-6jN.js} +1 -1
  63. package/dist/{nftPlaceholder-C7r74zYS.js → nftPlaceholder-pM-Hmswq.js} +1 -1
  64. package/dist/nodeflow-sdk.es.js +15 -0
  65. package/dist/{off-CJE6Z_MK.js → off-DEa_uc7_.js} +1 -1
  66. package/dist/{onramp-BMRgbt2I.js → onramp-ZXqyloYt.js} +10 -10
  67. package/dist/{play-store-CxusWynI.js → play-store-WgSEpEI1.js} +1 -1
  68. package/dist/{plus-Bjkqj5g6.js → plus-u4UZhYAg.js} +1 -1
  69. package/dist/{qr-code-4C0zboga.js → qr-code-DxZGxoPE.js} +1 -1
  70. package/dist/{receive-Cc8moHBZ.js → receive-Ct_mQWzk.js} +1 -1
  71. package/dist/{recycle-horizontal-BdSgk84g.js → recycle-horizontal-BWVpmHJc.js} +1 -1
  72. package/dist/{refresh-BsRodAS7.js → refresh-gi4TfgEU.js} +1 -1
  73. package/dist/{reown-logo-DOVlqCDK.js → reown-logo-Bg731n4w.js} +1 -1
  74. package/dist/{search-BIyHtky-.js → search-BQv7DVJG.js} +1 -1
  75. package/dist/{send-9eSi58hW.js → send-BzmnFT2p.js} +1 -1
  76. package/dist/{send-CBFTcYtn.js → send-CyxKtrQ9.js} +17 -17
  77. package/dist/{socials-CeOJULFV.js → socials-vziOn4zi.js} +5 -5
  78. package/dist/{solana-BNptwYvn.js → solana-Dz48awbr.js} +1 -1
  79. package/dist/{swapHorizontal-COlgqyzt.js → swapHorizontal-Cwe1PoMp.js} +1 -1
  80. package/dist/{swapHorizontalBold-Odce2JOe.js → swapHorizontalBold-Dxu58sRG.js} +1 -1
  81. package/dist/{swapHorizontalMedium-B9nkEBPD.js → swapHorizontalMedium-DOZZthlB.js} +1 -1
  82. package/dist/{swapHorizontalRoundedBold-DPMzz6nz.js → swapHorizontalRoundedBold-BkIZQXnD.js} +1 -1
  83. package/dist/{swapVertical-FqQP9GBP.js → swapVertical-LSq66ctC.js} +1 -1
  84. package/dist/{swaps-BG9GOayX.js → swaps-C2EO6dQA.js} +9 -9
  85. package/dist/{telegram-BMY9Hs9Z.js → telegram-ITq9s69Y.js} +1 -1
  86. package/dist/{three-dots-DDKmexHU.js → three-dots-JH3A1TFR.js} +1 -1
  87. package/dist/{transactions-C_GII6kW.js → transactions-DpMVZVap.js} +1 -1
  88. package/dist/{twitch-x_s0neNg.js → twitch-BKs5FlDf.js} +1 -1
  89. package/dist/{twitterIcon-CKsSxEuJ.js → twitterIcon-CCXEj_Nv.js} +1 -1
  90. package/dist/{ui-CZH-vf5h.js → ui-D5ULRvGt.js} +6 -6
  91. package/dist/{user-CZfvQDJ_.js → user-CBgAUjZv.js} +1 -1
  92. package/dist/{verify-Bnvbadnx.js → verify-BPlPPkhG.js} +1 -1
  93. package/dist/{verify-filled-CnEopkW-.js → verify-filled-qTRg0OWM.js} +1 -1
  94. package/dist/{w3m-modal-DkI2TPJW.js → w3m-modal-DSdDfy32.js} +27 -27
  95. package/dist/{wallet-B3oN4n4q.js → wallet-BuDEi_8z.js} +1 -1
  96. package/dist/{wallet-placeholder-CI0oiAcd.js → wallet-placeholder-D4DKTuB_.js} +1 -1
  97. package/dist/{walletconnect-D4vMcjqO.js → walletconnect-Dt3q5XFc.js} +1 -1
  98. package/dist/{warning-circle-DjI8aRBs.js → warning-circle-B8Fkc0_4.js} +1 -1
  99. package/dist/{x-BgRWY62H.js → x-Cm_V3zUI.js} +1 -1
  100. package/dist/{x-mark-Cdqd-Hm4.js → x-mark-BVvwdxda.js} +1 -1
  101. package/package.json +6 -10
  102. package/dist/astra-sdk.es.js +0 -9
  103. package/dist/ccip-CH1B6Zeh.js +0 -149
  104. package/dist/clsx.m-DCYaa4RU.js +0 -20
  105. package/dist/index-C0USsgDi.js +0 -15911
  106. package/dist/index-CH4T0JAz.js +0 -10785
  107. package/dist/index-CWAoFGd1.js +0 -315
  108. package/dist/index-ChxXyuZj.js +0 -572
  109. package/dist/index-DZiQey0J.js +0 -386
  110. package/dist/index-utoSbRla.js +0 -21034
  111. package/dist/secp256k1-B2Gq-iIr.js +0 -1257
@@ -1,386 +0,0 @@
1
- import { r as T } from "./index-ChxXyuZj.js";
2
- import { b2 as y, b3 as k, b4 as I } from "./index-Zh6wUpmX.js";
3
- const q = () => "9.1.0", v = (t) => t.toString(16).padStart(2, "0"), C = (t) => {
4
- const e = new Uint8Array(t / 2);
5
- return window.crypto.getRandomValues(e), Array.from(e, v).join("");
6
- }, R = () => typeof window < "u" ? C(10) : (/* @__PURE__ */ new Date()).getTime().toString(36);
7
- class g {
8
- }
9
- g.makeRequest = (t, e) => ({
10
- id: R(),
11
- method: t,
12
- params: e,
13
- env: {
14
- sdkVersion: q()
15
- }
16
- });
17
- g.makeResponse = (t, e, s) => ({
18
- id: t,
19
- success: !0,
20
- version: s,
21
- data: e
22
- });
23
- g.makeErrorResponse = (t, e, s) => ({
24
- id: t,
25
- success: !1,
26
- error: e,
27
- version: s
28
- });
29
- var r;
30
- (function(t) {
31
- t.sendTransactions = "sendTransactions", t.rpcCall = "rpcCall", t.getChainInfo = "getChainInfo", t.getSafeInfo = "getSafeInfo", t.getTxBySafeTxHash = "getTxBySafeTxHash", t.getSafeBalances = "getSafeBalances", t.signMessage = "signMessage", t.signTypedMessage = "signTypedMessage", t.getEnvironmentInfo = "getEnvironmentInfo", t.getOffChainSignature = "getOffChainSignature", t.requestAddressBook = "requestAddressBook", t.wallet_getPermissions = "wallet_getPermissions", t.wallet_requestPermissions = "wallet_requestPermissions";
32
- })(r || (r = {}));
33
- var m;
34
- (function(t) {
35
- t.requestAddressBook = "requestAddressBook";
36
- })(m || (m = {}));
37
- class H {
38
- constructor(e = null, s = !1) {
39
- this.allowedOrigins = null, this.callbacks = /* @__PURE__ */ new Map(), this.debugMode = !1, this.isServer = typeof window > "u", this.isValidMessage = ({ origin: a, data: n, source: i }) => {
40
- const o = !n, l = !this.isServer && i === window.parent, u = typeof n.version < "u" && parseInt(n.version.split(".")[0]), B = typeof u == "number" && u >= 1;
41
- let p = !0;
42
- return Array.isArray(this.allowedOrigins) && (p = this.allowedOrigins.find((P) => P.test(a)) !== void 0), !o && l && B && p;
43
- }, this.logIncomingMessage = (a) => {
44
- console.info(`Safe Apps SDK v1: A message was received from origin ${a.origin}. `, a.data);
45
- }, this.onParentMessage = (a) => {
46
- this.isValidMessage(a) && (this.debugMode && this.logIncomingMessage(a), this.handleIncomingMessage(a.data));
47
- }, this.handleIncomingMessage = (a) => {
48
- const { id: n } = a, i = this.callbacks.get(n);
49
- i && (i(a), this.callbacks.delete(n));
50
- }, this.send = (a, n) => {
51
- const i = g.makeRequest(a, n);
52
- if (this.isServer)
53
- throw new Error("Window doesn't exist");
54
- return window.parent.postMessage(i, "*"), new Promise((o, l) => {
55
- this.callbacks.set(i.id, (u) => {
56
- if (!u.success) {
57
- l(new Error(u.error));
58
- return;
59
- }
60
- o(u);
61
- });
62
- });
63
- }, this.allowedOrigins = e, this.debugMode = s, this.isServer || window.addEventListener("message", this.onParentMessage);
64
- }
65
- }
66
- const b = (t) => typeof t == "object" && t != null && "domain" in t && "types" in t && "message" in t;
67
- T();
68
- class E {
69
- constructor(e) {
70
- this.communicator = e;
71
- }
72
- async getBySafeTxHash(e) {
73
- if (!e)
74
- throw new Error("Invalid safeTxHash");
75
- return (await this.communicator.send(r.getTxBySafeTxHash, { safeTxHash: e })).data;
76
- }
77
- async signMessage(e) {
78
- const s = {
79
- message: e
80
- };
81
- return (await this.communicator.send(r.signMessage, s)).data;
82
- }
83
- async signTypedMessage(e) {
84
- if (!b(e))
85
- throw new Error("Invalid typed data");
86
- return (await this.communicator.send(r.signTypedMessage, { typedData: e })).data;
87
- }
88
- async send({ txs: e, params: s }) {
89
- if (!e || !e.length)
90
- throw new Error("No transactions were passed");
91
- const a = {
92
- txs: e,
93
- params: s
94
- };
95
- return (await this.communicator.send(r.sendTransactions, a)).data;
96
- }
97
- }
98
- const c = {
99
- eth_call: "eth_call",
100
- eth_gasPrice: "eth_gasPrice",
101
- eth_getLogs: "eth_getLogs",
102
- eth_getBalance: "eth_getBalance",
103
- eth_getCode: "eth_getCode",
104
- eth_getBlockByHash: "eth_getBlockByHash",
105
- eth_getBlockByNumber: "eth_getBlockByNumber",
106
- eth_getStorageAt: "eth_getStorageAt",
107
- eth_getTransactionByHash: "eth_getTransactionByHash",
108
- eth_getTransactionReceipt: "eth_getTransactionReceipt",
109
- eth_getTransactionCount: "eth_getTransactionCount",
110
- eth_estimateGas: "eth_estimateGas",
111
- safe_setSettings: "safe_setSettings"
112
- }, h = {
113
- defaultBlockParam: (t = "latest") => t,
114
- returnFullTxObjectParam: (t = !1) => t,
115
- blockNumberToHex: (t) => Number.isInteger(t) ? `0x${t.toString(16)}` : t
116
- };
117
- class A {
118
- constructor(e) {
119
- this.communicator = e, this.call = this.buildRequest({
120
- call: c.eth_call,
121
- formatters: [null, h.defaultBlockParam]
122
- }), this.getBalance = this.buildRequest({
123
- call: c.eth_getBalance,
124
- formatters: [null, h.defaultBlockParam]
125
- }), this.getCode = this.buildRequest({
126
- call: c.eth_getCode,
127
- formatters: [null, h.defaultBlockParam]
128
- }), this.getStorageAt = this.buildRequest({
129
- call: c.eth_getStorageAt,
130
- formatters: [null, h.blockNumberToHex, h.defaultBlockParam]
131
- }), this.getPastLogs = this.buildRequest({
132
- call: c.eth_getLogs
133
- }), this.getBlockByHash = this.buildRequest({
134
- call: c.eth_getBlockByHash,
135
- formatters: [null, h.returnFullTxObjectParam]
136
- }), this.getBlockByNumber = this.buildRequest({
137
- call: c.eth_getBlockByNumber,
138
- formatters: [h.blockNumberToHex, h.returnFullTxObjectParam]
139
- }), this.getTransactionByHash = this.buildRequest({
140
- call: c.eth_getTransactionByHash
141
- }), this.getTransactionReceipt = this.buildRequest({
142
- call: c.eth_getTransactionReceipt
143
- }), this.getTransactionCount = this.buildRequest({
144
- call: c.eth_getTransactionCount,
145
- formatters: [null, h.defaultBlockParam]
146
- }), this.getGasPrice = this.buildRequest({
147
- call: c.eth_gasPrice
148
- }), this.getEstimateGas = (s) => this.buildRequest({
149
- call: c.eth_estimateGas
150
- })([s]), this.setSafeSettings = this.buildRequest({
151
- call: c.safe_setSettings
152
- });
153
- }
154
- buildRequest(e) {
155
- const { call: s, formatters: a } = e;
156
- return async (n) => {
157
- a && Array.isArray(n) && a.forEach((l, u) => {
158
- l && (n[u] = l(n[u]));
159
- });
160
- const i = {
161
- call: s,
162
- params: n || []
163
- };
164
- return (await this.communicator.send(r.rpcCall, i)).data;
165
- };
166
- }
167
- }
168
- const x = "0x1626ba7e", O = "0x20c13b0b", f = 4001;
169
- class d extends Error {
170
- constructor(e, s, a) {
171
- super(e), this.code = s, this.data = a, Object.setPrototypeOf(this, d.prototype);
172
- }
173
- }
174
- class S {
175
- constructor(e) {
176
- this.communicator = e;
177
- }
178
- async getPermissions() {
179
- return (await this.communicator.send(r.wallet_getPermissions, void 0)).data;
180
- }
181
- async requestPermissions(e) {
182
- if (!this.isPermissionRequestValid(e))
183
- throw new d("Permissions request is invalid", f);
184
- try {
185
- return (await this.communicator.send(r.wallet_requestPermissions, e)).data;
186
- } catch {
187
- throw new d("Permissions rejected", f);
188
- }
189
- }
190
- isPermissionRequestValid(e) {
191
- return e.every((s) => typeof s == "object" ? Object.keys(s).every((a) => !!Object.values(m).includes(a)) : !1);
192
- }
193
- }
194
- const w = (t, e) => e.some((s) => s.parentCapability === t), V = () => (t, e, s) => {
195
- const a = s.value;
196
- return s.value = async function() {
197
- const n = new S(this.communicator);
198
- let i = await n.getPermissions();
199
- if (w(e, i) || (i = await n.requestPermissions([{ [e]: {} }])), !w(e, i))
200
- throw new d("Permissions rejected", f);
201
- return a.apply(this);
202
- }, s;
203
- };
204
- var M = function(t, e, s, a) {
205
- var n = arguments.length, i = n < 3 ? e : a === null ? a = Object.getOwnPropertyDescriptor(e, s) : a, o;
206
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, s, a);
207
- else for (var l = t.length - 1; l >= 0; l--) (o = t[l]) && (i = (n < 3 ? o(i) : n > 3 ? o(e, s, i) : o(e, s)) || i);
208
- return n > 3 && i && Object.defineProperty(e, s, i), i;
209
- };
210
- class _ {
211
- constructor(e) {
212
- this.communicator = e;
213
- }
214
- async getChainInfo() {
215
- return (await this.communicator.send(r.getChainInfo, void 0)).data;
216
- }
217
- async getInfo() {
218
- return (await this.communicator.send(r.getSafeInfo, void 0)).data;
219
- }
220
- // There is a possibility that this method will change because we may add pagination to the endpoint
221
- async experimental_getBalances({ currency: e = "usd" } = {}) {
222
- return (await this.communicator.send(r.getSafeBalances, {
223
- currency: e
224
- })).data;
225
- }
226
- async check1271Signature(e, s = "0x") {
227
- const a = await this.getInfo(), n = y({
228
- abi: [
229
- {
230
- constant: !1,
231
- inputs: [
232
- {
233
- name: "_dataHash",
234
- type: "bytes32"
235
- },
236
- {
237
- name: "_signature",
238
- type: "bytes"
239
- }
240
- ],
241
- name: "isValidSignature",
242
- outputs: [
243
- {
244
- name: "",
245
- type: "bytes4"
246
- }
247
- ],
248
- payable: !1,
249
- stateMutability: "nonpayable",
250
- type: "function"
251
- }
252
- ],
253
- functionName: "isValidSignature",
254
- args: [e, s]
255
- }), i = {
256
- call: c.eth_call,
257
- params: [
258
- {
259
- to: a.safeAddress,
260
- data: n
261
- },
262
- "latest"
263
- ]
264
- };
265
- try {
266
- return (await this.communicator.send(r.rpcCall, i)).data.slice(0, 10).toLowerCase() === x;
267
- } catch {
268
- return !1;
269
- }
270
- }
271
- async check1271SignatureBytes(e, s = "0x") {
272
- const a = await this.getInfo(), n = y({
273
- abi: [
274
- {
275
- constant: !1,
276
- inputs: [
277
- {
278
- name: "_data",
279
- type: "bytes"
280
- },
281
- {
282
- name: "_signature",
283
- type: "bytes"
284
- }
285
- ],
286
- name: "isValidSignature",
287
- outputs: [
288
- {
289
- name: "",
290
- type: "bytes4"
291
- }
292
- ],
293
- payable: !1,
294
- stateMutability: "nonpayable",
295
- type: "function"
296
- }
297
- ],
298
- functionName: "isValidSignature",
299
- args: [e, s]
300
- }), i = {
301
- call: c.eth_call,
302
- params: [
303
- {
304
- to: a.safeAddress,
305
- data: n
306
- },
307
- "latest"
308
- ]
309
- };
310
- try {
311
- return (await this.communicator.send(r.rpcCall, i)).data.slice(0, 10).toLowerCase() === O;
312
- } catch {
313
- return !1;
314
- }
315
- }
316
- calculateMessageHash(e) {
317
- return k(e);
318
- }
319
- calculateTypedMessageHash(e) {
320
- const s = typeof e.domain.chainId == "object" ? e.domain.chainId.toNumber() : Number(e.domain.chainId);
321
- let a = e.primaryType;
322
- if (!a) {
323
- const n = Object.values(e.types), i = Object.keys(e.types).filter((o) => n.every((l) => l.every(({ type: u }) => u.replace("[", "").replace("]", "") !== o)));
324
- if (i.length === 0 || i.length > 1)
325
- throw new Error("Please specify primaryType");
326
- a = i[0];
327
- }
328
- return I({
329
- message: e.message,
330
- domain: {
331
- ...e.domain,
332
- chainId: s,
333
- verifyingContract: e.domain.verifyingContract,
334
- salt: e.domain.salt
335
- },
336
- types: e.types,
337
- primaryType: a
338
- });
339
- }
340
- async getOffChainSignature(e) {
341
- return (await this.communicator.send(r.getOffChainSignature, e)).data;
342
- }
343
- async isMessageSigned(e, s = "0x") {
344
- let a;
345
- if (typeof e == "string" && (a = async () => {
346
- const n = this.calculateMessageHash(e);
347
- return await this.isMessageHashSigned(n, s);
348
- }), b(e) && (a = async () => {
349
- const n = this.calculateTypedMessageHash(e);
350
- return await this.isMessageHashSigned(n, s);
351
- }), a)
352
- return await a();
353
- throw new Error("Invalid message type");
354
- }
355
- async isMessageHashSigned(e, s = "0x") {
356
- const a = [this.check1271Signature.bind(this), this.check1271SignatureBytes.bind(this)];
357
- for (const n of a)
358
- if (await n(e, s))
359
- return !0;
360
- return !1;
361
- }
362
- async getEnvironmentInfo() {
363
- return (await this.communicator.send(r.getEnvironmentInfo, void 0)).data;
364
- }
365
- async requestAddressBook() {
366
- return (await this.communicator.send(r.requestAddressBook, void 0)).data;
367
- }
368
- }
369
- M([
370
- V()
371
- ], _.prototype, "requestAddressBook", null);
372
- class D {
373
- constructor(e = {}) {
374
- const { allowedDomains: s = null, debug: a = !1 } = e;
375
- this.communicator = new H(s, a), this.eth = new A(this.communicator), this.txs = new E(this.communicator), this.safe = new _(this.communicator), this.wallet = new S(this.communicator);
376
- }
377
- }
378
- export {
379
- g as MessageFormatter,
380
- r as Methods,
381
- c as RPC_CALLS,
382
- m as RestrictedMethods,
383
- D as default,
384
- q as getSDKVersion,
385
- b as isObjectEIP712TypedData
386
- };