astra-modal-test 1.0.11 → 1.0.13
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.
- package/README.md +224 -122
- package/dist/nodeflow-sdk.es.js +12646 -0
- package/package.json +10 -10
- package/dist/SwapController-Ck3TYcMp.js +0 -447
- package/dist/add-BmBLHIEe.js +0 -19
- package/dist/all-wallets-H2aaJ2oP.js +0 -10
- package/dist/app-store-Bvhe1BkA.js +0 -21
- package/dist/apple-BCIKns5c.js +0 -22
- package/dist/arrow-bottom-circle-Dpcn0z0p.js +0 -15
- package/dist/arrow-bottom-i1ChNkSf.js +0 -12
- package/dist/arrow-left-Dj8tzUf6.js +0 -12
- package/dist/arrow-right-DVd3R-0K.js +0 -12
- package/dist/arrow-top-DcD5wbZL.js +0 -12
- package/dist/astra-sdk.es.js +0 -9
- package/dist/bank-CToLOTy3.js +0 -18
- package/dist/bin-D8m48Dk5.js +0 -8
- package/dist/bitcoin-y6S4LO0p.js +0 -17
- package/dist/browser-DRhVaQQT.js +0 -18
- package/dist/card-BK0q3S4W.js +0 -18
- package/dist/ccip-CH1B6Zeh.js +0 -149
- package/dist/checkmark-C7H1vH4H.js +0 -15
- package/dist/checkmark-bold-DfvIWKpu.js +0 -12
- package/dist/chevron-bottom-CcAEP6cD.js +0 -12
- package/dist/chevron-left-DMnhSBVl.js +0 -12
- package/dist/chevron-right-pPhw9ZBC.js +0 -12
- package/dist/chevron-top-DjqOCRAL.js +0 -12
- package/dist/chrome-store-B-9bRAPM.js +0 -65
- package/dist/circle-SPbxfVZq.js +0 -8
- package/dist/clock-BLAT4wv4.js +0 -12
- package/dist/close-D1AyyJzy.js +0 -12
- package/dist/clsx.m-DCYaa4RU.js +0 -20
- package/dist/coinPlaceholder-DGk1in74.js +0 -12
- package/dist/compass-C0-SVkSt.js +0 -12
- package/dist/copy-CPcvwITz.js +0 -19
- package/dist/cursor-ChlOWEcO.js +0 -7
- package/dist/cursor-transparent-BJsEpe-G.js +0 -16
- package/dist/desktop-Z8iZvVCW.js +0 -13
- package/dist/disconnect-DkPQjiLk.js +0 -12
- package/dist/discord-CwRdgvGZ.js +0 -21
- package/dist/email-DA_5xt-j.js +0 -10
- package/dist/embedded-wallet-DYnGl5tL.js +0 -464
- package/dist/ethereum-Dwse3Umc.js +0 -14
- package/dist/etherscan-CNmwyrRn.js +0 -10
- package/dist/exclamation-triangle-CU8gn-bU.js +0 -8
- package/dist/extension-rikwXWrg.js +0 -12
- package/dist/external-link-mDp8JVE0.js +0 -12
- package/dist/facebook-c0IS1D9G.js +0 -30
- package/dist/farcaster-DpvSDnGl.js +0 -16
- package/dist/filters-B42-1BLn.js +0 -12
- package/dist/github-DvjZxkXF.js +0 -22
- package/dist/google-CLHf_zAz.js +0 -22
- package/dist/help-circle-BI5xgPAz.js +0 -16
- package/dist/id-BxI79dX4.js +0 -16
- package/dist/image-Cr1qAxG-.js +0 -8
- package/dist/index-C0USsgDi.js +0 -15911
- package/dist/index-C49-8bCQ.js +0 -709
- package/dist/index-CH4T0JAz.js +0 -10785
- package/dist/index-CWAoFGd1.js +0 -315
- package/dist/index-C_3PUMa7.js +0 -70
- package/dist/index-ChxXyuZj.js +0 -572
- package/dist/index-D7jufxlk.js +0 -33
- package/dist/index-DZiQey0J.js +0 -386
- package/dist/index-DtAG8k9M.js +0 -1060
- package/dist/index-Zh6wUpmX.js +0 -74596
- package/dist/index-utoSbRla.js +0 -21034
- package/dist/info-BUp5BYav.js +0 -7
- package/dist/info-circle-D5anzkYK.js +0 -16
- package/dist/lightbulb-DmuhLv29.js +0 -7
- package/dist/mail-D2hRmmgi.js +0 -12
- package/dist/mobile-Cq-9uJHv.js +0 -13
- package/dist/more-DJMBaB2z.js +0 -15
- package/dist/network-placeholder-3ip1roR0.js +0 -18
- package/dist/nftPlaceholder-C7r74zYS.js +0 -12
- package/dist/off-CJE6Z_MK.js +0 -8
- package/dist/onramp-BMRgbt2I.js +0 -917
- package/dist/play-store-CxusWynI.js +0 -36
- package/dist/plus-Bjkqj5g6.js +0 -17
- package/dist/qr-code-4C0zboga.js +0 -10
- package/dist/receive-Cc8moHBZ.js +0 -179
- package/dist/recycle-horizontal-BdSgk84g.js +0 -13
- package/dist/refresh-BsRodAS7.js +0 -12
- package/dist/reown-logo-DOVlqCDK.js +0 -16
- package/dist/search-BIyHtky-.js +0 -12
- package/dist/secp256k1-B2Gq-iIr.js +0 -1257
- package/dist/send-9eSi58hW.js +0 -19
- package/dist/send-CBFTcYtn.js +0 -1039
- package/dist/socials-CeOJULFV.js +0 -589
- package/dist/solana-BNptwYvn.js +0 -17
- package/dist/swapHorizontal-COlgqyzt.js +0 -12
- package/dist/swapHorizontalBold-Odce2JOe.js +0 -12
- package/dist/swapHorizontalMedium-B9nkEBPD.js +0 -20
- package/dist/swapHorizontalRoundedBold-DPMzz6nz.js +0 -12
- package/dist/swapVertical-FqQP9GBP.js +0 -12
- package/dist/swaps-BG9GOayX.js +0 -1713
- package/dist/telegram-BMY9Hs9Z.js +0 -20
- package/dist/three-dots-DDKmexHU.js +0 -9
- package/dist/transactions-C_GII6kW.js +0 -35
- package/dist/twitch-x_s0neNg.js +0 -22
- package/dist/twitterIcon-CKsSxEuJ.js +0 -10
- package/dist/ui-CZH-vf5h.js +0 -812
- package/dist/user-CZfvQDJ_.js +0 -7
- package/dist/verify-Bnvbadnx.js +0 -12
- package/dist/verify-filled-CnEopkW-.js +0 -12
- package/dist/w3m-modal-DkI2TPJW.js +0 -1041
- package/dist/wallet-B3oN4n4q.js +0 -12
- package/dist/wallet-placeholder-CI0oiAcd.js +0 -18
- package/dist/walletconnect-D4vMcjqO.js +0 -36
- package/dist/warning-circle-DjI8aRBs.js +0 -16
- package/dist/x-BgRWY62H.js +0 -16
- package/dist/x-mark-Cdqd-Hm4.js +0 -7
package/dist/index-DZiQey0J.js
DELETED
|
@@ -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
|
-
};
|