@cartridge/controller 0.7.9 → 0.7.10
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/.turbo/turbo-build$colon$deps.log +15 -15
- package/.turbo/turbo-build.log +11 -11
- package/dist/index.js +80 -68
- package/dist/index.js.map +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/dist/{provider-CH2PlazB.js → provider-Dr912mPw.js} +2 -2
- package/dist/{provider-CH2PlazB.js.map → provider-Dr912mPw.js.map} +1 -1
- package/dist/session.js +2 -2
- package/dist/session.js.map +1 -1
- package/dist/stats.html +1 -1
- package/package.json +3 -3
- package/src/iframe/base.ts +19 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
|
|
2
|
-
> @cartridge/controller@0.7.
|
|
2
|
+
> @cartridge/controller@0.7.10 build:deps /home/runner/work/controller/controller/packages/controller
|
|
3
3
|
> pnpm build
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @cartridge/controller@0.7.
|
|
6
|
+
> @cartridge/controller@0.7.10 build /home/runner/work/controller/controller/packages/controller
|
|
7
7
|
> pnpm build:browser && pnpm build:node
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
> @cartridge/controller@0.7.
|
|
10
|
+
> @cartridge/controller@0.7.10 build:browser /home/runner/work/controller/controller/packages/controller
|
|
11
11
|
> vite build
|
|
12
12
|
|
|
13
13
|
[36mvite v6.1.0 [32mbuilding for production...[36m[39m
|
|
@@ -18,14 +18,14 @@ rendering chunks...
|
|
|
18
18
|
|
|
19
19
|
[vite:dts] Start generate declaration files...
|
|
20
20
|
computing gzip size...
|
|
21
|
-
[2mdist/[22m[36msession.js [39m[1m[2m 10.81 kB[22m[1m[22m[2m │ gzip: 3.
|
|
22
|
-
[2mdist/[22m[36mprovider-
|
|
23
|
-
[2mdist/[22m[36mindex.js [39m[1m[2m135.
|
|
24
|
-
[vite:dts] Declaration files built in
|
|
21
|
+
[2mdist/[22m[36msession.js [39m[1m[2m 10.81 kB[22m[1m[22m[2m │ gzip: 3.36 kB[22m[2m │ map: 56.40 kB[22m
|
|
22
|
+
[2mdist/[22m[36mprovider-Dr912mPw.js [39m[1m[2m 23.20 kB[22m[1m[22m[2m │ gzip: 13.54 kB[22m[2m │ map: 40.69 kB[22m
|
|
23
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m135.80 kB[22m[1m[22m[2m │ gzip: 24.34 kB[22m[2m │ map: 258.51 kB[22m
|
|
24
|
+
[vite:dts] Declaration files built in 3451ms.
|
|
25
25
|
|
|
26
|
-
[32m✓ built in 4.
|
|
26
|
+
[32m✓ built in 4.21s[39m
|
|
27
27
|
|
|
28
|
-
> @cartridge/controller@0.7.
|
|
28
|
+
> @cartridge/controller@0.7.10 build:node /home/runner/work/controller/controller/packages/controller
|
|
29
29
|
> tsup --config tsup.node.config.ts
|
|
30
30
|
|
|
31
31
|
[34mCLI[39m Building entry: src/node/index.ts
|
|
@@ -36,16 +36,16 @@ computing gzip size...
|
|
|
36
36
|
[34mCLI[39m Cleaning output folder
|
|
37
37
|
[34mESM[39m Build start
|
|
38
38
|
[34mCJS[39m Build start
|
|
39
|
+
"constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
|
|
39
40
|
"constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.cjs".
|
|
40
41
|
Entry module "dist/node/index.cjs" is using named and default exports together. Consumers of your bundle will have to use `chunk.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
|
|
41
|
-
"constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
|
|
42
|
-
[32mCJS[39m [1mdist/node/index.cjs [22m[32m31.90 KB[39m
|
|
43
|
-
[32mCJS[39m [1mdist/node/index.cjs.map [22m[32m58.78 KB[39m
|
|
44
|
-
[32mCJS[39m ⚡️ Build success in 402ms
|
|
45
42
|
[32mESM[39m [1mdist/node/index.js [22m[32m31.14 KB[39m
|
|
46
43
|
[32mESM[39m [1mdist/node/index.js.map [22m[32m58.58 KB[39m
|
|
47
|
-
[32mESM[39m ⚡️ Build success in
|
|
44
|
+
[32mESM[39m ⚡️ Build success in 395ms
|
|
45
|
+
[32mCJS[39m [1mdist/node/index.cjs [22m[32m31.90 KB[39m
|
|
46
|
+
[32mCJS[39m [1mdist/node/index.cjs.map [22m[32m58.78 KB[39m
|
|
47
|
+
[32mCJS[39m ⚡️ Build success in 395ms
|
|
48
48
|
[34mDTS[39m Build start
|
|
49
|
-
[32mDTS[39m ⚡️ Build success in
|
|
49
|
+
[32mDTS[39m ⚡️ Build success in 3035ms
|
|
50
50
|
[32mDTS[39m [1mdist/node/index.d.ts [22m[32m5.09 KB[39m
|
|
51
51
|
[32mDTS[39m [1mdist/node/index.d.cts [22m[32m5.09 KB[39m
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @cartridge/controller@0.7.
|
|
2
|
+
> @cartridge/controller@0.7.10 build /home/runner/work/controller/controller/packages/controller
|
|
3
3
|
> pnpm build:browser && pnpm build:node
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @cartridge/controller@0.7.
|
|
6
|
+
> @cartridge/controller@0.7.10 build:browser /home/runner/work/controller/controller/packages/controller
|
|
7
7
|
> vite build
|
|
8
8
|
|
|
9
9
|
[36mvite v6.1.0 [32mbuilding for production...[36m[39m
|
|
@@ -14,14 +14,14 @@ rendering chunks...
|
|
|
14
14
|
|
|
15
15
|
[vite:dts] Start generate declaration files...
|
|
16
16
|
computing gzip size...
|
|
17
|
-
[2mdist/[22m[36msession.js [39m[1m[2m 10.81 kB[22m[1m[22m[2m │ gzip: 3.
|
|
18
|
-
[2mdist/[22m[36mprovider-
|
|
19
|
-
[2mdist/[22m[36mindex.js [39m[1m[2m135.
|
|
20
|
-
[vite:dts] Declaration files built in
|
|
17
|
+
[2mdist/[22m[36msession.js [39m[1m[2m 10.81 kB[22m[1m[22m[2m │ gzip: 3.36 kB[22m[2m │ map: 56.40 kB[22m
|
|
18
|
+
[2mdist/[22m[36mprovider-Dr912mPw.js [39m[1m[2m 23.20 kB[22m[1m[22m[2m │ gzip: 13.54 kB[22m[2m │ map: 40.69 kB[22m
|
|
19
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m135.80 kB[22m[1m[22m[2m │ gzip: 24.34 kB[22m[2m │ map: 258.51 kB[22m
|
|
20
|
+
[vite:dts] Declaration files built in 3300ms.
|
|
21
21
|
|
|
22
|
-
[32m✓ built in 4.
|
|
22
|
+
[32m✓ built in 4.20s[39m
|
|
23
23
|
|
|
24
|
-
> @cartridge/controller@0.7.
|
|
24
|
+
> @cartridge/controller@0.7.10 build:node /home/runner/work/controller/controller/packages/controller
|
|
25
25
|
> tsup --config tsup.node.config.ts
|
|
26
26
|
|
|
27
27
|
[34mCLI[39m Building entry: src/node/index.ts
|
|
@@ -37,11 +37,11 @@ computing gzip size...
|
|
|
37
37
|
Entry module "dist/node/index.cjs" is using named and default exports together. Consumers of your bundle will have to use `chunk.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
|
|
38
38
|
[32mESM[39m [1mdist/node/index.js [22m[32m31.14 KB[39m
|
|
39
39
|
[32mESM[39m [1mdist/node/index.js.map [22m[32m58.58 KB[39m
|
|
40
|
-
[32mESM[39m ⚡️ Build success in
|
|
40
|
+
[32mESM[39m ⚡️ Build success in 289ms
|
|
41
41
|
[32mCJS[39m [1mdist/node/index.cjs [22m[32m31.90 KB[39m
|
|
42
42
|
[32mCJS[39m [1mdist/node/index.cjs.map [22m[32m58.78 KB[39m
|
|
43
|
-
[32mCJS[39m ⚡️ Build success in
|
|
43
|
+
[32mCJS[39m ⚡️ Build success in 293ms
|
|
44
44
|
[34mDTS[39m Build start
|
|
45
|
-
[32mDTS[39m ⚡️ Build success in
|
|
45
|
+
[32mDTS[39m ⚡️ Build success in 3297ms
|
|
46
46
|
[32mDTS[39m [1mdist/node/index.d.ts [22m[32m5.09 KB[39m
|
|
47
47
|
[32mDTS[39m [1mdist/node/index.d.cts [22m[32m5.09 KB[39m
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WalletAccount as L, shortString as M, num as O } from "starknet";
|
|
2
|
-
import { R as A, t as Y, K as $, P as W, B as H, N as
|
|
3
|
-
import { h as Oe, n as Ye, a as $e, b as We } from "./provider-
|
|
2
|
+
import { R as A, t as Y, K as $, P as W, B as H, N as u, p as K, A as q } from "./provider-Dr912mPw.js";
|
|
3
|
+
import { h as Oe, n as Ye, a as $e, b as We } from "./provider-Dr912mPw.js";
|
|
4
4
|
import { MetaMaskSDK as G } from "@metamask/sdk";
|
|
5
5
|
import { Transaction as V } from "@solana/web3.js";
|
|
6
6
|
import { connect as J } from "starknetkit";
|
|
@@ -77,18 +77,18 @@ class z extends L {
|
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
var
|
|
80
|
+
var y;
|
|
81
81
|
(function(o) {
|
|
82
82
|
o.Call = "call", o.Reply = "reply", o.Syn = "syn", o.SynAck = "synAck", o.Ack = "ack";
|
|
83
|
-
})(
|
|
83
|
+
})(y || (y = {}));
|
|
84
84
|
var C;
|
|
85
85
|
(function(o) {
|
|
86
86
|
o.Fulfilled = "fulfilled", o.Rejected = "rejected";
|
|
87
87
|
})(C || (C = {}));
|
|
88
|
-
var
|
|
88
|
+
var E;
|
|
89
89
|
(function(o) {
|
|
90
90
|
o.ConnectionDestroyed = "ConnectionDestroyed", o.ConnectionTimeout = "ConnectionTimeout", o.NoIframeSrc = "NoIframeSrc";
|
|
91
|
-
})(
|
|
91
|
+
})(E || (E = {}));
|
|
92
92
|
var D;
|
|
93
93
|
(function(o) {
|
|
94
94
|
o.DataCloneError = "DataCloneError";
|
|
@@ -134,43 +134,43 @@ const Z = (o, e) => {
|
|
|
134
134
|
const { localName: n, local: r, remote: a, originForSending: c, originForReceiving: i } = o;
|
|
135
135
|
let s = !1;
|
|
136
136
|
const l = (d) => {
|
|
137
|
-
if (d.source !== a || d.data.penpal !==
|
|
137
|
+
if (d.source !== a || d.data.penpal !== y.Call)
|
|
138
138
|
return;
|
|
139
139
|
if (i !== "*" && d.origin !== i) {
|
|
140
140
|
t(`${n} received message from origin ${d.origin} which did not match expected origin ${i}`);
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
|
-
const p = d.data, { methodName: h, args:
|
|
143
|
+
const p = d.data, { methodName: h, args: g, id: f } = p;
|
|
144
144
|
t(`${n}: Received ${h}() call`);
|
|
145
|
-
const w = (
|
|
145
|
+
const w = (b) => (k) => {
|
|
146
146
|
if (t(`${n}: Sending ${h}() reply`), s) {
|
|
147
147
|
t(`${n}: Unable to send ${h}() reply due to destroyed connection`);
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
|
-
const
|
|
151
|
-
penpal:
|
|
152
|
-
id:
|
|
153
|
-
resolution:
|
|
150
|
+
const v = {
|
|
151
|
+
penpal: y.Reply,
|
|
152
|
+
id: f,
|
|
153
|
+
resolution: b,
|
|
154
154
|
returnValue: k
|
|
155
155
|
};
|
|
156
|
-
|
|
156
|
+
b === C.Rejected && k instanceof Error && (v.returnValue = N(k), v.returnValueIsError = !0);
|
|
157
157
|
try {
|
|
158
|
-
a.postMessage(
|
|
159
|
-
} catch (
|
|
160
|
-
if (
|
|
158
|
+
a.postMessage(v, c);
|
|
159
|
+
} catch (m) {
|
|
160
|
+
if (m.name === D.DataCloneError) {
|
|
161
161
|
const I = {
|
|
162
|
-
penpal:
|
|
163
|
-
id:
|
|
162
|
+
penpal: y.Reply,
|
|
163
|
+
id: f,
|
|
164
164
|
resolution: C.Rejected,
|
|
165
|
-
returnValue: N(
|
|
165
|
+
returnValue: N(m),
|
|
166
166
|
returnValueIsError: !0
|
|
167
167
|
};
|
|
168
168
|
a.postMessage(I, c);
|
|
169
169
|
}
|
|
170
|
-
throw
|
|
170
|
+
throw m;
|
|
171
171
|
}
|
|
172
172
|
};
|
|
173
|
-
new Promise((
|
|
173
|
+
new Promise((b) => b(e[h].call(e, d.origin).apply(e, g))).then(w(C.Fulfilled), w(C.Rejected));
|
|
174
174
|
};
|
|
175
175
|
return r.addEventListener(_.Message, l), () => {
|
|
176
176
|
s = !0, r.removeEventListener(_.Message, l);
|
|
@@ -198,8 +198,8 @@ const ce = () => ++se, j = ".", B = (o) => o ? o.split(j) : [], de = (o) => o.jo
|
|
|
198
198
|
const { localName: a, local: c, remote: i, originForSending: s, originForReceiving: l } = e;
|
|
199
199
|
let d = !1;
|
|
200
200
|
r(`${a}: Connecting call sender`);
|
|
201
|
-
const p = (
|
|
202
|
-
r(`${a}: Sending ${
|
|
201
|
+
const p = (g) => (...f) => {
|
|
202
|
+
r(`${a}: Sending ${g}() call`);
|
|
203
203
|
let w;
|
|
204
204
|
try {
|
|
205
205
|
i.closed && (w = !0);
|
|
@@ -207,32 +207,32 @@ const ce = () => ++se, j = ".", B = (o) => o ? o.split(j) : [], de = (o) => o.jo
|
|
|
207
207
|
w = !0;
|
|
208
208
|
}
|
|
209
209
|
if (w && n(), d) {
|
|
210
|
-
const
|
|
211
|
-
throw
|
|
210
|
+
const b = new Error(`Unable to send ${g}() call due to destroyed connection`);
|
|
211
|
+
throw b.code = E.ConnectionDestroyed, b;
|
|
212
212
|
}
|
|
213
|
-
return new Promise((
|
|
214
|
-
const
|
|
215
|
-
if (x.source !== i || x.data.penpal !==
|
|
213
|
+
return new Promise((b, k) => {
|
|
214
|
+
const v = ce(), m = (x) => {
|
|
215
|
+
if (x.source !== i || x.data.penpal !== y.Reply || x.data.id !== v)
|
|
216
216
|
return;
|
|
217
217
|
if (l !== "*" && x.origin !== l) {
|
|
218
218
|
r(`${a} received message from origin ${x.origin} which did not match expected origin ${l}`);
|
|
219
219
|
return;
|
|
220
220
|
}
|
|
221
|
-
const
|
|
222
|
-
r(`${a}: Received ${
|
|
223
|
-
let P =
|
|
224
|
-
|
|
221
|
+
const S = x.data;
|
|
222
|
+
r(`${a}: Received ${g}() reply`), c.removeEventListener(_.Message, m);
|
|
223
|
+
let P = S.returnValue;
|
|
224
|
+
S.returnValueIsError && (P = ae(P)), (S.resolution === C.Fulfilled ? b : k)(P);
|
|
225
225
|
};
|
|
226
|
-
c.addEventListener(_.Message,
|
|
226
|
+
c.addEventListener(_.Message, m);
|
|
227
227
|
const I = {
|
|
228
|
-
penpal:
|
|
229
|
-
id:
|
|
230
|
-
methodName:
|
|
231
|
-
args:
|
|
228
|
+
penpal: y.Call,
|
|
229
|
+
id: v,
|
|
230
|
+
methodName: g,
|
|
231
|
+
args: f
|
|
232
232
|
};
|
|
233
233
|
i.postMessage(I, s);
|
|
234
234
|
});
|
|
235
|
-
}, h = t.reduce((
|
|
235
|
+
}, h = t.reduce((g, f) => (g[f] = p(f), g), {});
|
|
236
236
|
return Object.assign(o, ge(h)), () => {
|
|
237
237
|
d = !0;
|
|
238
238
|
};
|
|
@@ -253,8 +253,8 @@ const ce = () => ++se, j = ".", B = (o) => o ? o.split(j) : [], de = (o) => o.jo
|
|
|
253
253
|
originForSending: t,
|
|
254
254
|
originForReceiving: e
|
|
255
255
|
};
|
|
256
|
-
i && i(), i = ie(p, o, r), c(i), s && s.forEach((
|
|
257
|
-
delete l[
|
|
256
|
+
i && i(), i = ie(p, o, r), c(i), s && s.forEach((g) => {
|
|
257
|
+
delete l[g];
|
|
258
258
|
}), s = d.data.methodNames;
|
|
259
259
|
const h = me(l, p, s, a, r);
|
|
260
260
|
return c(h), l;
|
|
@@ -268,7 +268,7 @@ const ce = () => ++se, j = ".", B = (o) => o ? o.split(j) : [], de = (o) => o.jo
|
|
|
268
268
|
}
|
|
269
269
|
o("Parent: Handshake - Received SYN, responding with SYN-ACK");
|
|
270
270
|
const a = {
|
|
271
|
-
penpal:
|
|
271
|
+
penpal: y.SynAck,
|
|
272
272
|
methodNames: Object.keys(e)
|
|
273
273
|
};
|
|
274
274
|
r.source.postMessage(a, n);
|
|
@@ -283,37 +283,37 @@ const ce = () => ++se, j = ".", B = (o) => o ? o.split(j) : [], de = (o) => o.jo
|
|
|
283
283
|
let t;
|
|
284
284
|
return o !== void 0 && (t = window.setTimeout(() => {
|
|
285
285
|
const n = new Error(`Connection timed out after ${o}ms`);
|
|
286
|
-
n.code =
|
|
286
|
+
n.code = E.ConnectionTimeout, e(n);
|
|
287
287
|
}, o)), () => {
|
|
288
288
|
clearTimeout(t);
|
|
289
289
|
};
|
|
290
290
|
}, ve = (o) => {
|
|
291
291
|
if (!o.src && !o.srcdoc) {
|
|
292
292
|
const e = new Error("Iframe must have src or srcdoc property defined.");
|
|
293
|
-
throw e.code =
|
|
293
|
+
throw e.code = E.NoIframeSrc, e;
|
|
294
294
|
}
|
|
295
295
|
}, we = (o) => {
|
|
296
296
|
let { iframe: e, methods: t = {}, childOrigin: n, timeout: r, debug: a = !1 } = o;
|
|
297
297
|
const c = ee(a), i = Z("Parent", c), { onDestroy: s, destroy: l } = i;
|
|
298
298
|
n || (ve(e), n = re(e.src));
|
|
299
|
-
const d = n === "null" ? "*" : n, p = T(t), h = fe(c, p, n, d),
|
|
299
|
+
const d = n === "null" ? "*" : n, p = T(t), h = fe(c, p, n, d), g = he(p, n, d, i, c);
|
|
300
300
|
return {
|
|
301
|
-
promise: new Promise((w,
|
|
302
|
-
const k = ye(r, l),
|
|
303
|
-
if (!(
|
|
304
|
-
if (
|
|
305
|
-
h(
|
|
301
|
+
promise: new Promise((w, b) => {
|
|
302
|
+
const k = ye(r, l), v = (m) => {
|
|
303
|
+
if (!(m.source !== e.contentWindow || !m.data)) {
|
|
304
|
+
if (m.data.penpal === y.Syn) {
|
|
305
|
+
h(m);
|
|
306
306
|
return;
|
|
307
307
|
}
|
|
308
|
-
if (
|
|
309
|
-
const I = m
|
|
308
|
+
if (m.data.penpal === y.Ack) {
|
|
309
|
+
const I = g(m);
|
|
310
310
|
I && (k(), w(I));
|
|
311
311
|
return;
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
};
|
|
315
|
-
window.addEventListener(_.Message,
|
|
316
|
-
window.removeEventListener(_.Message,
|
|
315
|
+
window.addEventListener(_.Message, v), c("Parent: Awaiting handshake"), ue(e, i), s((m) => {
|
|
316
|
+
window.removeEventListener(_.Message, v), m && b(m);
|
|
317
317
|
});
|
|
318
318
|
}),
|
|
319
319
|
destroy() {
|
|
@@ -342,7 +342,19 @@ class Q {
|
|
|
342
342
|
const s = document.createElement("div");
|
|
343
343
|
s.id = "controller", s.style.position = "fixed", s.style.height = "100%", s.style.width = "100%", s.style.top = "0", s.style.left = "0", s.style.zIndex = "10000", s.style.backgroundColor = "rgba(0,0,0,0.6)", s.style.display = "flex", s.style.alignItems = "center", s.style.justifyContent = "center", s.style.visibility = "hidden", s.style.opacity = "0", s.style.transition = "opacity 0.2s ease", s.appendChild(i), this.iframe = i, this.container = s, we({
|
|
344
344
|
iframe: this.iframe,
|
|
345
|
-
methods: {
|
|
345
|
+
methods: {
|
|
346
|
+
close: (p) => () => this.close(),
|
|
347
|
+
closeAll: (p) => () => {
|
|
348
|
+
document.querySelectorAll(
|
|
349
|
+
'iframe[id^="controller-"]'
|
|
350
|
+
).forEach((g) => {
|
|
351
|
+
const f = g.parentElement;
|
|
352
|
+
f && (f.style.visibility = "hidden", f.style.opacity = "0");
|
|
353
|
+
}), document.body.style.overflow = "auto";
|
|
354
|
+
},
|
|
355
|
+
reload: (p) => () => window.location.reload(),
|
|
356
|
+
...c
|
|
357
|
+
}
|
|
346
358
|
}).promise.then(a), this.resize(), window.addEventListener("resize", () => this.resize());
|
|
347
359
|
const l = new MutationObserver(() => {
|
|
348
360
|
const p = document.getElementById("controller");
|
|
@@ -839,7 +851,7 @@ class xe extends Q {
|
|
|
839
851
|
encodeURIComponent(i.erc20.toString())
|
|
840
852
|
), s?.contracts) {
|
|
841
853
|
const h = Object.values(s.contracts).flatMap(
|
|
842
|
-
(
|
|
854
|
+
(g) => g.methods
|
|
843
855
|
);
|
|
844
856
|
p.searchParams.set(
|
|
845
857
|
"methods",
|
|
@@ -874,7 +886,7 @@ class Ne extends H {
|
|
|
874
886
|
async probe() {
|
|
875
887
|
try {
|
|
876
888
|
if (await this.waitForKeychain(), !this.keychain) {
|
|
877
|
-
console.error(new
|
|
889
|
+
console.error(new u().message);
|
|
878
890
|
return;
|
|
879
891
|
}
|
|
880
892
|
const e = await this.keychain.probe(this.rpcUrl());
|
|
@@ -914,7 +926,7 @@ class Ne extends H {
|
|
|
914
926
|
if (this.account)
|
|
915
927
|
return this.account;
|
|
916
928
|
if (!this.keychain || !this.iframes.keychain) {
|
|
917
|
-
console.error(new
|
|
929
|
+
console.error(new u().message);
|
|
918
930
|
return;
|
|
919
931
|
}
|
|
920
932
|
document.hasStorageAccess && (await document.hasStorageAccess() || await document.requestStorageAccess()), this.iframes.keychain.open();
|
|
@@ -941,7 +953,7 @@ class Ne extends H {
|
|
|
941
953
|
}
|
|
942
954
|
async switchStarknetChain(e) {
|
|
943
955
|
if (!this.keychain || !this.iframes.keychain)
|
|
944
|
-
return console.error(new
|
|
956
|
+
return console.error(new u().message), !1;
|
|
945
957
|
try {
|
|
946
958
|
if (this.selectedChain = e, (await this.keychain.probe(this.rpcUrl())).rpcUrl === this.rpcUrl())
|
|
947
959
|
return !0;
|
|
@@ -956,7 +968,7 @@ class Ne extends H {
|
|
|
956
968
|
}
|
|
957
969
|
async disconnect() {
|
|
958
970
|
if (!this.keychain) {
|
|
959
|
-
console.error(new
|
|
971
|
+
console.error(new u().message);
|
|
960
972
|
return;
|
|
961
973
|
}
|
|
962
974
|
return document.hasStorageAccess && (await document.hasStorageAccess() || await document.requestStorageAccess()), this.account = void 0, this.keychain.disconnect();
|
|
@@ -996,13 +1008,13 @@ class Ne extends H {
|
|
|
996
1008
|
}
|
|
997
1009
|
async openSettings() {
|
|
998
1010
|
if (!this.keychain || !this.iframes.keychain)
|
|
999
|
-
return console.error(new
|
|
1011
|
+
return console.error(new u().message), null;
|
|
1000
1012
|
this.iframes.profile?.sendBackward ? this.iframes.profile?.sendBackward() : this.iframes.profile?.close(), this.iframes.keychain.open();
|
|
1001
1013
|
const e = await this.keychain.openSettings();
|
|
1002
1014
|
return this.iframes.keychain.close(), this.iframes.profile?.sendForward?.(), !(e && e.code === A.NOT_CONNECTED);
|
|
1003
1015
|
}
|
|
1004
1016
|
revoke(e, t) {
|
|
1005
|
-
return this.keychain ? this.keychain.revoke(e) : (console.error(new
|
|
1017
|
+
return this.keychain ? this.keychain.revoke(e) : (console.error(new u().message), null);
|
|
1006
1018
|
}
|
|
1007
1019
|
rpcUrl() {
|
|
1008
1020
|
const e = this.chains.get(this.selectedChain);
|
|
@@ -1018,14 +1030,14 @@ class Ne extends H {
|
|
|
1018
1030
|
}
|
|
1019
1031
|
username() {
|
|
1020
1032
|
if (!this.keychain) {
|
|
1021
|
-
console.error(new
|
|
1033
|
+
console.error(new u().message);
|
|
1022
1034
|
return;
|
|
1023
1035
|
}
|
|
1024
1036
|
return this.keychain.username();
|
|
1025
1037
|
}
|
|
1026
1038
|
openPurchaseCredits() {
|
|
1027
1039
|
if (!this.keychain || !this.iframes.keychain) {
|
|
1028
|
-
console.error(new
|
|
1040
|
+
console.error(new u().message);
|
|
1029
1041
|
return;
|
|
1030
1042
|
}
|
|
1031
1043
|
if (!this.iframes.profile) {
|
|
@@ -1036,7 +1048,7 @@ class Ne extends H {
|
|
|
1036
1048
|
}
|
|
1037
1049
|
openStarterPack() {
|
|
1038
1050
|
if (!this.keychain || !this.iframes.keychain) {
|
|
1039
|
-
console.error(new
|
|
1051
|
+
console.error(new u().message);
|
|
1040
1052
|
return;
|
|
1041
1053
|
}
|
|
1042
1054
|
if (!this.iframes.profile) {
|
|
@@ -1047,7 +1059,7 @@ class Ne extends H {
|
|
|
1047
1059
|
}
|
|
1048
1060
|
async openExecute(e, t) {
|
|
1049
1061
|
if (!this.keychain || !this.iframes.keychain) {
|
|
1050
|
-
console.error(new
|
|
1062
|
+
console.error(new u().message);
|
|
1051
1063
|
return;
|
|
1052
1064
|
}
|
|
1053
1065
|
if (!this.iframes.profile) {
|
|
@@ -1060,7 +1072,7 @@ class Ne extends H {
|
|
|
1060
1072
|
return this.iframes.profile?.open(), this.iframes.keychain.close(), this.iframes.profile?.sendForward(), t && this.switchStarknetChain(n), !(r && (r.code === A.NOT_CONNECTED || r.code === A.CANCELED));
|
|
1061
1073
|
}
|
|
1062
1074
|
async delegateAccount() {
|
|
1063
|
-
return this.keychain ? await this.keychain.delegateAccount() : (console.error(new
|
|
1075
|
+
return this.keychain ? await this.keychain.delegateAccount() : (console.error(new u().message), null);
|
|
1064
1076
|
}
|
|
1065
1077
|
async validateChains(e) {
|
|
1066
1078
|
for (const t of e)
|
|
@@ -4352,7 +4364,7 @@ var U = {
|
|
|
4352
4364
|
export {
|
|
4353
4365
|
Ae as ArgentWallet,
|
|
4354
4366
|
_e as MetaMaskWallet,
|
|
4355
|
-
|
|
4367
|
+
u as NotReadyToConnect,
|
|
4356
4368
|
ke as PhantomWallet,
|
|
4357
4369
|
A as ResponseCodes,
|
|
4358
4370
|
Ce as WalletBridge,
|