@cartridge/controller 0.11.2-alpha.3 → 0.11.2-alpha.4
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 +16 -11
- package/.turbo/turbo-build.log +15 -10
- package/dist/iframe/keychain.d.ts +4 -1
- package/dist/index.js +182 -168
- 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-CjC60jKm.js → provider-Baak9Kvr.js} +2 -2
- package/dist/provider-Baak9Kvr.js.map +1 -0
- package/dist/session.js +2 -2
- package/dist/stats.html +1 -1
- package/dist/types.d.ts +0 -2
- package/package.json +3 -3
- package/src/controller.ts +35 -37
- package/src/iframe/keychain.ts +23 -1
- package/src/types.ts +0 -2
- package/dist/provider-CjC60jKm.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WalletAccount as Rt, constants as K, num as nt, shortString as Oe } from "starknet";
|
|
2
|
-
import { R as Q, t as Ut, i as Tt, K as be, B as zt, N as E, p as Lt, v as Dt, A as Ot } from "./provider-
|
|
3
|
-
import { a as Xn, d as Jn, E as Zn, f as es, e as ts, F as rs, I as ns, h as ss, n as os, b as is, c as as } from "./provider-
|
|
2
|
+
import { R as Q, t as Ut, i as Tt, K as be, B as zt, N as E, p as Lt, v as Dt, A as Ot } from "./provider-Baak9Kvr.js";
|
|
3
|
+
import { a as Xn, d as Jn, E as Zn, f as es, e as ts, F as rs, I as ns, h as ss, n as os, b as is, c as as } from "./provider-Baak9Kvr.js";
|
|
4
4
|
class Me extends Rt {
|
|
5
5
|
keychain;
|
|
6
6
|
modal;
|
|
@@ -142,7 +142,7 @@ const Mt = (t, e) => {
|
|
|
142
142
|
}
|
|
143
143
|
const h = d.data, { methodName: f, args: u, id: w } = h;
|
|
144
144
|
r(`${n}: Received ${f}() call`);
|
|
145
|
-
const
|
|
145
|
+
const b = (p) => (v) => {
|
|
146
146
|
if (r(`${n}: Sending ${f}() reply`), l) {
|
|
147
147
|
r(`${n}: Unable to send ${f}() reply due to destroyed connection`);
|
|
148
148
|
return;
|
|
@@ -150,27 +150,27 @@ const Mt = (t, e) => {
|
|
|
150
150
|
const k = {
|
|
151
151
|
penpal: B.Reply,
|
|
152
152
|
id: w,
|
|
153
|
-
resolution:
|
|
154
|
-
returnValue:
|
|
153
|
+
resolution: p,
|
|
154
|
+
returnValue: v
|
|
155
155
|
};
|
|
156
|
-
|
|
156
|
+
p === z.Rejected && v instanceof Error && (k.returnValue = Qe(v), k.returnValueIsError = !0);
|
|
157
157
|
try {
|
|
158
158
|
o.postMessage(k, i);
|
|
159
|
-
} catch (
|
|
160
|
-
if (
|
|
161
|
-
const
|
|
159
|
+
} catch (y) {
|
|
160
|
+
if (y.name === _e.DataCloneError) {
|
|
161
|
+
const x = {
|
|
162
162
|
penpal: B.Reply,
|
|
163
163
|
id: w,
|
|
164
164
|
resolution: z.Rejected,
|
|
165
|
-
returnValue: Qe(
|
|
165
|
+
returnValue: Qe(y),
|
|
166
166
|
returnValueIsError: !0
|
|
167
167
|
};
|
|
168
|
-
o.postMessage(
|
|
168
|
+
o.postMessage(x, i);
|
|
169
169
|
}
|
|
170
|
-
throw
|
|
170
|
+
throw y;
|
|
171
171
|
}
|
|
172
172
|
};
|
|
173
|
-
new Promise((
|
|
173
|
+
new Promise((p) => p(e[f].call(e, d.origin).apply(e, u))).then(b(z.Fulfilled), b(z.Rejected));
|
|
174
174
|
};
|
|
175
175
|
return s.addEventListener(U.Message, c), () => {
|
|
176
176
|
l = !0, s.removeEventListener(U.Message, c);
|
|
@@ -200,18 +200,18 @@ const qt = () => ++Kt, st = ".", ot = (t) => t ? t.split(st) : [], Gt = (t) => t
|
|
|
200
200
|
s(`${o}: Connecting call sender`);
|
|
201
201
|
const h = (u) => (...w) => {
|
|
202
202
|
s(`${o}: Sending ${u}() call`);
|
|
203
|
-
let
|
|
203
|
+
let b;
|
|
204
204
|
try {
|
|
205
|
-
a.closed && (
|
|
205
|
+
a.closed && (b = !0);
|
|
206
206
|
} catch {
|
|
207
|
-
|
|
207
|
+
b = !0;
|
|
208
208
|
}
|
|
209
|
-
if (
|
|
210
|
-
const
|
|
211
|
-
throw
|
|
209
|
+
if (b && n(), d) {
|
|
210
|
+
const p = new Error(`Unable to send ${u}() call due to destroyed connection`);
|
|
211
|
+
throw p.code = G.ConnectionDestroyed, p;
|
|
212
212
|
}
|
|
213
|
-
return new Promise((
|
|
214
|
-
const k = qt(),
|
|
213
|
+
return new Promise((p, v) => {
|
|
214
|
+
const k = qt(), y = (C) => {
|
|
215
215
|
if (C.source !== a || C.data.penpal !== B.Reply || C.data.id !== k)
|
|
216
216
|
return;
|
|
217
217
|
if (c !== "*" && C.origin !== c) {
|
|
@@ -219,18 +219,18 @@ const qt = () => ++Kt, st = ".", ot = (t) => t ? t.split(st) : [], Gt = (t) => t
|
|
|
219
219
|
return;
|
|
220
220
|
}
|
|
221
221
|
const de = C.data;
|
|
222
|
-
s(`${o}: Received ${u}() reply`), i.removeEventListener(U.Message,
|
|
222
|
+
s(`${o}: Received ${u}() reply`), i.removeEventListener(U.Message, y);
|
|
223
223
|
let he = de.returnValue;
|
|
224
|
-
de.returnValueIsError && (he = Ht(he)), (de.resolution === z.Fulfilled ?
|
|
224
|
+
de.returnValueIsError && (he = Ht(he)), (de.resolution === z.Fulfilled ? p : v)(he);
|
|
225
225
|
};
|
|
226
|
-
i.addEventListener(U.Message,
|
|
227
|
-
const
|
|
226
|
+
i.addEventListener(U.Message, y);
|
|
227
|
+
const x = {
|
|
228
228
|
penpal: B.Call,
|
|
229
229
|
id: k,
|
|
230
230
|
methodName: u,
|
|
231
231
|
args: w
|
|
232
232
|
};
|
|
233
|
-
a.postMessage(
|
|
233
|
+
a.postMessage(x, l);
|
|
234
234
|
});
|
|
235
235
|
}, f = r.reduce((u, w) => (u[w] = h(w), u), {});
|
|
236
236
|
return Object.assign(t, Zt(f)), () => {
|
|
@@ -298,22 +298,22 @@ const qt = () => ++Kt, st = ".", ot = (t) => t ? t.split(st) : [], Gt = (t) => t
|
|
|
298
298
|
n || (ir(e), n = Yt(e.src));
|
|
299
299
|
const d = n === "null" ? "*" : n, h = it(r), f = rr(i, h, n, d), u = tr(h, n, d, a, i);
|
|
300
300
|
return {
|
|
301
|
-
promise: new Promise((
|
|
302
|
-
const
|
|
303
|
-
if (!(
|
|
304
|
-
if (
|
|
305
|
-
f(
|
|
301
|
+
promise: new Promise((b, p) => {
|
|
302
|
+
const v = or(s, c), k = (y) => {
|
|
303
|
+
if (!(y.source !== e.contentWindow || !y.data)) {
|
|
304
|
+
if (y.data.penpal === B.Syn) {
|
|
305
|
+
f(y);
|
|
306
306
|
return;
|
|
307
307
|
}
|
|
308
|
-
if (
|
|
309
|
-
const
|
|
310
|
-
|
|
308
|
+
if (y.data.penpal === B.Ack) {
|
|
309
|
+
const x = u(y);
|
|
310
|
+
x && (v(), b(x));
|
|
311
311
|
return;
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
};
|
|
315
|
-
window.addEventListener(U.Message, k), i("Parent: Awaiting handshake"), sr(e, a), l((
|
|
316
|
-
window.removeEventListener(U.Message, k),
|
|
315
|
+
window.addEventListener(U.Message, k), i("Parent: Awaiting handshake"), sr(e, a), l((y) => {
|
|
316
|
+
window.removeEventListener(U.Message, k), y && p(y);
|
|
317
317
|
});
|
|
318
318
|
}),
|
|
319
319
|
destroy() {
|
|
@@ -595,7 +595,7 @@ function vr(t, e = !1) {
|
|
|
595
595
|
}
|
|
596
596
|
return [n, s];
|
|
597
597
|
}
|
|
598
|
-
const xr = (t, e, r) => t << r | e >>> 32 - r, $r = (t, e, r) => e << r | t >>> 32 - r,
|
|
598
|
+
const xr = (t, e, r) => t << r | e >>> 32 - r, $r = (t, e, r) => e << r | t >>> 32 - r, Ir = (t, e, r) => e << r - 32 | t >>> 64 - r, Sr = (t, e, r) => t << r - 32 | e >>> 64 - r, Cr = BigInt(0), j = BigInt(1), Pr = BigInt(2), Br = BigInt(7), Nr = BigInt(256), Rr = BigInt(113), lt = [], dt = [], ht = [];
|
|
599
599
|
for (let t = 0, e = j, r = 1, n = 0; t < 24; t++) {
|
|
600
600
|
[r, n] = [n, (2 * r + 3 * n) % 5], lt.push(2 * (5 * n + r)), dt.push((t + 1) * (t + 2) / 2 % 64);
|
|
601
601
|
let s = Cr;
|
|
@@ -603,7 +603,7 @@ for (let t = 0, e = j, r = 1, n = 0; t < 24; t++) {
|
|
|
603
603
|
e = (e << j ^ (e >> Br) * Rr) % Nr, e & Pr && (s ^= j << (j << /* @__PURE__ */ BigInt(o)) - j);
|
|
604
604
|
ht.push(s);
|
|
605
605
|
}
|
|
606
|
-
const ft = vr(ht, !0), Ur = ft[0], Tr = ft[1], Ke = (t, e, r) => r > 32 ?
|
|
606
|
+
const ft = vr(ht, !0), Ur = ft[0], Tr = ft[1], Ke = (t, e, r) => r > 32 ? Ir(t, e, r) : xr(t, e, r), qe = (t, e, r) => r > 32 ? Sr(t, e, r) : $r(t, e, r);
|
|
607
607
|
function zr(t, e = 24) {
|
|
608
608
|
const r = new Uint32Array(10);
|
|
609
609
|
for (let n = 24 - e; n < 24; n++) {
|
|
@@ -629,7 +629,7 @@ function zr(t, e = 24) {
|
|
|
629
629
|
}
|
|
630
630
|
at(r);
|
|
631
631
|
}
|
|
632
|
-
class
|
|
632
|
+
class Ie extends kr {
|
|
633
633
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
634
634
|
constructor(e, r, n, s = !1, o = 24) {
|
|
635
635
|
if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = e, this.suffix = r, this.outputLen = n, this.enableXOF = s, this.rounds = o, je(n), !(0 < e && e < 200))
|
|
@@ -691,10 +691,10 @@ class Se extends kr {
|
|
|
691
691
|
}
|
|
692
692
|
_cloneInto(e) {
|
|
693
693
|
const { blockLen: r, suffix: n, outputLen: s, rounds: o, enableXOF: i } = this;
|
|
694
|
-
return e || (e = new
|
|
694
|
+
return e || (e = new Ie(r, n, s, i, o)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = o, e.suffix = n, e.outputLen = s, e.enableXOF = i, e.destroyed = this.destroyed, e;
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
-
const Lr = (t, e, r) => Ar(() => new
|
|
697
|
+
const Lr = (t, e, r) => Ar(() => new Ie(e, t, r)), Dr = Lr(1, 136, 256 / 8);
|
|
698
698
|
let ut = !1;
|
|
699
699
|
const wt = function(t) {
|
|
700
700
|
return Dr(t);
|
|
@@ -725,15 +725,15 @@ function Ge(t) {
|
|
|
725
725
|
n[s >> 1] >> 4 >= 8 && (e[s] = e[s].toUpperCase()), (n[s >> 1] & 15) >= 8 && (e[s + 1] = e[s + 1].toUpperCase());
|
|
726
726
|
return "0x" + e.join("");
|
|
727
727
|
}
|
|
728
|
-
const
|
|
728
|
+
const Se = {};
|
|
729
729
|
for (let t = 0; t < 10; t++)
|
|
730
|
-
|
|
730
|
+
Se[String(t)] = String(t);
|
|
731
731
|
for (let t = 0; t < 26; t++)
|
|
732
|
-
|
|
732
|
+
Se[String.fromCharCode(65 + t)] = String(10 + t);
|
|
733
733
|
const Xe = 15;
|
|
734
734
|
function Qr(t) {
|
|
735
735
|
t = t.toUpperCase(), t = t.substring(4) + t.substring(0, 2) + "00";
|
|
736
|
-
let e = t.split("").map((n) =>
|
|
736
|
+
let e = t.split("").map((n) => Se[n]).join("");
|
|
737
737
|
for (; e.length >= Xe; ) {
|
|
738
738
|
let n = e.substring(0, Xe);
|
|
739
739
|
e = parseInt(n, 10) % 97 + e.substring(n.length);
|
|
@@ -1818,7 +1818,7 @@ function vt(t, e) {
|
|
|
1818
1818
|
}
|
|
1819
1819
|
});
|
|
1820
1820
|
}
|
|
1821
|
-
const
|
|
1821
|
+
const $ = (t) => {
|
|
1822
1822
|
const e = Et(t);
|
|
1823
1823
|
return t.validate ? vt(e, t.validate) : e;
|
|
1824
1824
|
}, ce = (t) => O(t) && typeof t.decode == "function" && typeof t.encode == "function";
|
|
@@ -1953,7 +1953,7 @@ const wn = (t) => {
|
|
|
1953
1953
|
if (typeof n != "boolean")
|
|
1954
1954
|
throw new Error(`bigint/sized: expected boolean, got ${typeof n}`);
|
|
1955
1955
|
const s = BigInt(t), o = 2n ** (8n * s - 1n);
|
|
1956
|
-
return
|
|
1956
|
+
return $({
|
|
1957
1957
|
size: n ? t : void 0,
|
|
1958
1958
|
encodeStream: (i, a) => {
|
|
1959
1959
|
r && a < 0 && (a = a | o);
|
|
@@ -1982,7 +1982,7 @@ const wn = (t) => {
|
|
|
1982
1982
|
return cn(i, 8n * s, !!r), i;
|
|
1983
1983
|
}
|
|
1984
1984
|
});
|
|
1985
|
-
},
|
|
1985
|
+
}, _ = /* @__PURE__ */ gn(8, !0), pn = (t, e) => $({
|
|
1986
1986
|
size: t,
|
|
1987
1987
|
encodeStream: (r, n) => r.writeView(t, (s) => e.write(s, n)),
|
|
1988
1988
|
decodeStream: (r) => r.readView(t, e.read),
|
|
@@ -2011,10 +2011,10 @@ const wn = (t) => {
|
|
|
2011
2011
|
}, ie = /* @__PURE__ */ xt(4, !1, {
|
|
2012
2012
|
read: (t, e) => t.getUint32(e, !0),
|
|
2013
2013
|
write: (t, e) => t.setUint32(0, e, !0)
|
|
2014
|
-
}),
|
|
2014
|
+
}), I = /* @__PURE__ */ xt(1, !1, {
|
|
2015
2015
|
read: (t, e) => t.getUint8(e),
|
|
2016
2016
|
write: (t, e) => t.setUint8(0, e)
|
|
2017
|
-
}), ve = /* @__PURE__ */
|
|
2017
|
+
}), ve = /* @__PURE__ */ $({
|
|
2018
2018
|
size: 1,
|
|
2019
2019
|
encodeStream: (t, e) => t.byte(e ? 1 : 0),
|
|
2020
2020
|
decodeStream: (t) => {
|
|
@@ -2032,7 +2032,7 @@ const wn = (t) => {
|
|
|
2032
2032
|
if (typeof e != "boolean")
|
|
2033
2033
|
throw new Error(`bytes/le: expected boolean, got ${typeof e}`);
|
|
2034
2034
|
const r = At(t), n = R(t);
|
|
2035
|
-
return
|
|
2035
|
+
return $({
|
|
2036
2036
|
size: typeof t == "number" ? t : void 0,
|
|
2037
2037
|
encodeStream: (s, o) => {
|
|
2038
2038
|
n || r.encodeStream(s, o.length), s.bytes(e ? Ee(o) : o), n && s.bytes(t);
|
|
@@ -2064,7 +2064,7 @@ function mn(t, e) {
|
|
|
2064
2064
|
throw new Error(`apply: invalid inner value ${t}`);
|
|
2065
2065
|
if (!ce(e))
|
|
2066
2066
|
throw new Error(`apply: invalid base value ${t}`);
|
|
2067
|
-
return
|
|
2067
|
+
return $({
|
|
2068
2068
|
size: t.size,
|
|
2069
2069
|
encodeStream: (r, n) => {
|
|
2070
2070
|
let s;
|
|
@@ -2088,7 +2088,7 @@ function mn(t, e) {
|
|
|
2088
2088
|
function q(t, e, r) {
|
|
2089
2089
|
if (!S(t) || !S(e))
|
|
2090
2090
|
throw new Error(`optional: invalid flag or inner value flag=${t} inner=${e}`);
|
|
2091
|
-
return
|
|
2091
|
+
return $({
|
|
2092
2092
|
size: r !== void 0 && t.size && e.size ? t.size + e.size : void 0,
|
|
2093
2093
|
encodeStream: (n, s) => {
|
|
2094
2094
|
t.encodeStream(n, !!s), s ? e.encodeStream(n, s) : r !== void 0 && e.encodeStream(n, r);
|
|
@@ -2101,7 +2101,7 @@ function q(t, e, r) {
|
|
|
2101
2101
|
});
|
|
2102
2102
|
}
|
|
2103
2103
|
function bn(t) {
|
|
2104
|
-
return
|
|
2104
|
+
return $({
|
|
2105
2105
|
encodeStream: (e, r) => {
|
|
2106
2106
|
if (r !== t)
|
|
2107
2107
|
throw new Error(`constant: invalid value ${r} (exp: ${t})`);
|
|
@@ -2126,7 +2126,7 @@ function g(t) {
|
|
|
2126
2126
|
for (const e in t)
|
|
2127
2127
|
if (!S(t[e]))
|
|
2128
2128
|
throw new Error(`struct: field ${e} is not CoderType`);
|
|
2129
|
-
return
|
|
2129
|
+
return $({
|
|
2130
2130
|
size: _n(Object.values(t)),
|
|
2131
2131
|
encodeStream: (e, r) => {
|
|
2132
2132
|
e.pushObj(r, (n) => {
|
|
@@ -2152,7 +2152,7 @@ function te(t, e) {
|
|
|
2152
2152
|
if (!S(e))
|
|
2153
2153
|
throw new Error(`array: invalid inner value ${e}`);
|
|
2154
2154
|
const r = At(typeof t == "string" ? `../${t}` : t);
|
|
2155
|
-
return
|
|
2155
|
+
return $({
|
|
2156
2156
|
size: typeof t == "number" && e.size ? t * e.size : void 0,
|
|
2157
2157
|
encodeStream: (n, s) => {
|
|
2158
2158
|
const o = n;
|
|
@@ -2208,7 +2208,7 @@ function Te(t, e) {
|
|
|
2208
2208
|
const r = /* @__PURE__ */ new Map();
|
|
2209
2209
|
for (const n in e)
|
|
2210
2210
|
r.set(e[n], n);
|
|
2211
|
-
return
|
|
2211
|
+
return $({
|
|
2212
2212
|
size: t.size,
|
|
2213
2213
|
encodeStream: (n, s) => t.encodeStream(n, e[s]),
|
|
2214
2214
|
decodeStream: (n) => {
|
|
@@ -2234,7 +2234,7 @@ function kn(t, e) {
|
|
|
2234
2234
|
for (const r in e)
|
|
2235
2235
|
if (!S(e[r]))
|
|
2236
2236
|
throw new Error(`tag: variant ${r} is not CoderType`);
|
|
2237
|
-
return
|
|
2237
|
+
return $({
|
|
2238
2238
|
size: t.size,
|
|
2239
2239
|
encodeStream: (r, n) => {
|
|
2240
2240
|
const { TAG: s, data: o } = n, i = e[s];
|
|
@@ -2266,7 +2266,7 @@ function $t(t, e, r) {
|
|
|
2266
2266
|
if (r !== void 0 && typeof r != "function")
|
|
2267
2267
|
throw new Error(`padRight: wrong padFn=${typeof r}`);
|
|
2268
2268
|
const n = r || An;
|
|
2269
|
-
return
|
|
2269
|
+
return $({
|
|
2270
2270
|
size: e.size ? e.size + ge(t, e.size) : void 0,
|
|
2271
2271
|
encodeStream: (s, o) => {
|
|
2272
2272
|
const i = s, a = i.pos;
|
|
@@ -2281,7 +2281,7 @@ function $t(t, e, r) {
|
|
|
2281
2281
|
}
|
|
2282
2282
|
});
|
|
2283
2283
|
}
|
|
2284
|
-
const En = 9, pe = H.decimal(En), V =
|
|
2284
|
+
const En = 9, pe = H.decimal(En), V = $({
|
|
2285
2285
|
encodeStream: (t, e) => {
|
|
2286
2286
|
if (!e)
|
|
2287
2287
|
return t.byte(0);
|
|
@@ -2299,30 +2299,30 @@ const En = 9, pe = H.decimal(En), V = x({
|
|
|
2299
2299
|
}
|
|
2300
2300
|
}), ee = yn($t(8, ie, void 0)), vn = () => {
|
|
2301
2301
|
const t = le(32);
|
|
2302
|
-
return
|
|
2302
|
+
return $({
|
|
2303
2303
|
size: t.size,
|
|
2304
2304
|
encodeStream: (e, r) => t.encodeStream(e, ke.decode(r)),
|
|
2305
2305
|
decodeStream: (e) => ke.encode(t.decodeStream(e))
|
|
2306
2306
|
});
|
|
2307
|
-
},
|
|
2308
|
-
requiredSignatures:
|
|
2309
|
-
readSigned:
|
|
2310
|
-
readUnsigned:
|
|
2311
|
-
keys: te(V,
|
|
2312
|
-
blockhash:
|
|
2313
|
-
instructions: te(V, g({ programIdx:
|
|
2307
|
+
}, m = vn(), xn = g({
|
|
2308
|
+
requiredSignatures: I,
|
|
2309
|
+
readSigned: I,
|
|
2310
|
+
readUnsigned: I,
|
|
2311
|
+
keys: te(V, m),
|
|
2312
|
+
blockhash: m,
|
|
2313
|
+
instructions: te(V, g({ programIdx: I, keys: te(V, I), data: le(V) }))
|
|
2314
2314
|
});
|
|
2315
2315
|
function $n(t) {
|
|
2316
2316
|
if (ke.decode(t).length !== 32)
|
|
2317
2317
|
throw new Error("Invalid Solana address");
|
|
2318
2318
|
}
|
|
2319
|
-
const
|
|
2319
|
+
const In = (t, e, r, n, s) => ({
|
|
2320
2320
|
sign: t < e,
|
|
2321
2321
|
write: t < e - r || t >= e && t < s - n
|
|
2322
2322
|
}), et = g({
|
|
2323
2323
|
signatures: te(V, le(64)),
|
|
2324
2324
|
msg: xn
|
|
2325
|
-
}), xe =
|
|
2325
|
+
}), xe = $({
|
|
2326
2326
|
encodeStream: (t, e) => {
|
|
2327
2327
|
const { msg: r, signatures: n } = e, s = {}, o = (h, f, u) => {
|
|
2328
2328
|
let w = s[h] || (s[h] = { sign: !1, write: !1 });
|
|
@@ -2374,7 +2374,7 @@ const Sn = (t, e, r, n, s) => ({
|
|
|
2374
2374
|
for (let o = 0; o < r.keys.length; o++)
|
|
2375
2375
|
s.push({
|
|
2376
2376
|
address: r.keys[o],
|
|
2377
|
-
...
|
|
2377
|
+
...In(o, r.requiredSignatures, r.readSigned, r.readUnsigned, r.keys.length)
|
|
2378
2378
|
});
|
|
2379
2379
|
if (!s.length)
|
|
2380
2380
|
throw new Error("SOL.tx: empty accounts array");
|
|
@@ -2425,9 +2425,9 @@ function ze(t, e, r) {
|
|
|
2425
2425
|
});
|
|
2426
2426
|
return i;
|
|
2427
2427
|
}
|
|
2428
|
-
const ye = "SysvarRecentB1ockHashes11111111111111111111", L = "SysvarRent111111111111111111111111111111111",
|
|
2428
|
+
const ye = "SysvarRecentB1ockHashes11111111111111111111", L = "SysvarRent111111111111111111111111111111111", It = "11111111111111111111111111111111", St = ze(It, ie, {
|
|
2429
2429
|
createAccount: {
|
|
2430
|
-
coder: g({ lamports:
|
|
2430
|
+
coder: g({ lamports: _, space: _, owner: m }),
|
|
2431
2431
|
keys: {
|
|
2432
2432
|
source: { sign: !0, write: !0 },
|
|
2433
2433
|
newAccount: { sign: !0, write: !0 }
|
|
@@ -2435,22 +2435,22 @@ const ye = "SysvarRecentB1ockHashes11111111111111111111", L = "SysvarRent1111111
|
|
|
2435
2435
|
hint: (t) => `Create new account=${t.newAccount} with balance of ${pe.encode(t.lamports)} and owner program ${t.owner}, using funding account ${t.source}`
|
|
2436
2436
|
},
|
|
2437
2437
|
assign: {
|
|
2438
|
-
coder: g({ owner:
|
|
2438
|
+
coder: g({ owner: m }),
|
|
2439
2439
|
keys: { account: { sign: !0, write: !0 } },
|
|
2440
2440
|
hint: (t) => `Assign account=${t.account} to owner program=${t.owner}`
|
|
2441
2441
|
},
|
|
2442
2442
|
transfer: {
|
|
2443
|
-
coder: g({ lamports:
|
|
2443
|
+
coder: g({ lamports: _ }),
|
|
2444
2444
|
keys: { source: { sign: !0, write: !0 }, destination: { sign: !1, write: !0 } },
|
|
2445
2445
|
hint: (t) => `Transfer ${pe.encode(t.lamports)} SOL from ${t.source} to ${t.destination}`
|
|
2446
2446
|
},
|
|
2447
2447
|
createAccountWithSeed: {
|
|
2448
2448
|
coder: g({
|
|
2449
|
-
base:
|
|
2449
|
+
base: m,
|
|
2450
2450
|
seed: ee,
|
|
2451
|
-
lamports:
|
|
2452
|
-
space:
|
|
2453
|
-
owner:
|
|
2451
|
+
lamports: _,
|
|
2452
|
+
space: _,
|
|
2453
|
+
owner: m
|
|
2454
2454
|
}),
|
|
2455
2455
|
keys: {
|
|
2456
2456
|
source: { sign: !0, write: !0 },
|
|
@@ -2468,7 +2468,7 @@ const ye = "SysvarRecentB1ockHashes11111111111111111111", L = "SysvarRent1111111
|
|
|
2468
2468
|
hint: (t) => `Consume nonce in nonce account=${t.nonceAccount} (owner: ${t.nonceAuthority})`
|
|
2469
2469
|
},
|
|
2470
2470
|
withdrawFromNonce: {
|
|
2471
|
-
coder: g({ lamports:
|
|
2471
|
+
coder: g({ lamports: _ }),
|
|
2472
2472
|
keys: {
|
|
2473
2473
|
nonceAccount: { sign: !1, write: !0 },
|
|
2474
2474
|
destination: { sign: !1, write: !0 },
|
|
@@ -2479,7 +2479,7 @@ const ye = "SysvarRecentB1ockHashes11111111111111111111", L = "SysvarRent1111111
|
|
|
2479
2479
|
hint: (t) => `Withdraw ${pe.encode(t.lamports)} SOL from nonce account=${t.nonceAccount} (owner: ${t.nonceAuthority}) to ${t.destination}`
|
|
2480
2480
|
},
|
|
2481
2481
|
initializeNonce: {
|
|
2482
|
-
coder: g({ nonceAuthority:
|
|
2482
|
+
coder: g({ nonceAuthority: m }),
|
|
2483
2483
|
keys: {
|
|
2484
2484
|
nonceAccount: { sign: !1, write: !0 },
|
|
2485
2485
|
_recent_bh: { address: ye, sign: !1, write: !1 },
|
|
@@ -2487,7 +2487,7 @@ const ye = "SysvarRecentB1ockHashes11111111111111111111", L = "SysvarRent1111111
|
|
|
2487
2487
|
}
|
|
2488
2488
|
},
|
|
2489
2489
|
authorizeNonce: {
|
|
2490
|
-
coder: g({ newAuthorized:
|
|
2490
|
+
coder: g({ newAuthorized: m }),
|
|
2491
2491
|
keys: {
|
|
2492
2492
|
nonceAccount: { sign: !1, write: !0 },
|
|
2493
2493
|
nonceAuthority: { sign: !0, write: !1 }
|
|
@@ -2495,17 +2495,17 @@ const ye = "SysvarRecentB1ockHashes11111111111111111111", L = "SysvarRent1111111
|
|
|
2495
2495
|
hint: (t) => `Change owner of nonce account=${t.nonceAccount} from ${t.nonceAuthority} to ${t.newAuthorized}`
|
|
2496
2496
|
},
|
|
2497
2497
|
allocate: {
|
|
2498
|
-
coder: g({ space:
|
|
2498
|
+
coder: g({ space: _ }),
|
|
2499
2499
|
keys: {
|
|
2500
2500
|
account: { sign: !0, write: !0 }
|
|
2501
2501
|
}
|
|
2502
2502
|
},
|
|
2503
2503
|
allocateWithSeed: {
|
|
2504
2504
|
coder: g({
|
|
2505
|
-
base:
|
|
2505
|
+
base: m,
|
|
2506
2506
|
seed: ee,
|
|
2507
|
-
space:
|
|
2508
|
-
owner:
|
|
2507
|
+
space: _,
|
|
2508
|
+
owner: m
|
|
2509
2509
|
}),
|
|
2510
2510
|
keys: {
|
|
2511
2511
|
account: { sign: !1, write: !0 },
|
|
@@ -2514,9 +2514,9 @@ const ye = "SysvarRecentB1ockHashes11111111111111111111", L = "SysvarRent1111111
|
|
|
2514
2514
|
},
|
|
2515
2515
|
assignWithSeed: {
|
|
2516
2516
|
coder: g({
|
|
2517
|
-
base:
|
|
2517
|
+
base: m,
|
|
2518
2518
|
seed: ee,
|
|
2519
|
-
owner:
|
|
2519
|
+
owner: m
|
|
2520
2520
|
}),
|
|
2521
2521
|
keys: {
|
|
2522
2522
|
account: { sign: !1, write: !0 },
|
|
@@ -2525,9 +2525,9 @@ const ye = "SysvarRecentB1ockHashes11111111111111111111", L = "SysvarRent1111111
|
|
|
2525
2525
|
},
|
|
2526
2526
|
transferWithSeed: {
|
|
2527
2527
|
coder: g({
|
|
2528
|
-
lamports:
|
|
2528
|
+
lamports: _,
|
|
2529
2529
|
sourceSeed: ee,
|
|
2530
|
-
sourceOwner:
|
|
2530
|
+
sourceOwner: m
|
|
2531
2531
|
}),
|
|
2532
2532
|
keys: {
|
|
2533
2533
|
source: { sign: !1, write: !0 },
|
|
@@ -2537,20 +2537,20 @@ const ye = "SysvarRecentB1ockHashes11111111111111111111", L = "SysvarRent1111111
|
|
|
2537
2537
|
}
|
|
2538
2538
|
}), Ct = (t) => {
|
|
2539
2539
|
};
|
|
2540
|
-
Ct(
|
|
2541
|
-
Ct(
|
|
2542
|
-
const
|
|
2540
|
+
Ct(St.transfer);
|
|
2541
|
+
Ct(St.advanceNonce);
|
|
2542
|
+
const Sn = Te(I, {
|
|
2543
2543
|
MintTokens: 0,
|
|
2544
2544
|
FreezeAccount: 1,
|
|
2545
2545
|
AccountOwner: 2,
|
|
2546
2546
|
CloseAccount: 3
|
|
2547
2547
|
}), T = (t, e) => e[t]?.symbol || t, Pt = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
2548
|
-
ze(Pt,
|
|
2548
|
+
ze(Pt, I, {
|
|
2549
2549
|
initializeMint: {
|
|
2550
2550
|
coder: g({
|
|
2551
|
-
decimals:
|
|
2552
|
-
mintAuthority:
|
|
2553
|
-
freezeAuthority: q(ve,
|
|
2551
|
+
decimals: I,
|
|
2552
|
+
mintAuthority: m,
|
|
2553
|
+
freezeAuthority: q(ve, m, "11111111111111111111111111111111")
|
|
2554
2554
|
}),
|
|
2555
2555
|
keys: {
|
|
2556
2556
|
mint: { sign: !1, write: !0 },
|
|
@@ -2569,7 +2569,7 @@ ze(Pt, $, {
|
|
|
2569
2569
|
},
|
|
2570
2570
|
// TODO: multisig support?
|
|
2571
2571
|
initializeMultisig: {
|
|
2572
|
-
coder: g({ m:
|
|
2572
|
+
coder: g({ m: I }),
|
|
2573
2573
|
keys: {
|
|
2574
2574
|
account: { sign: !1, write: !0 },
|
|
2575
2575
|
_rent: { address: L, sign: !1, write: !1 }
|
|
@@ -2577,7 +2577,7 @@ ze(Pt, $, {
|
|
|
2577
2577
|
hint: (t, e) => `Initialize multi-sig token account=${t.account} with signatures=${t.m}`
|
|
2578
2578
|
},
|
|
2579
2579
|
transfer: {
|
|
2580
|
-
coder: g({ amount:
|
|
2580
|
+
coder: g({ amount: _ }),
|
|
2581
2581
|
keys: {
|
|
2582
2582
|
source: { sign: !1, write: !0 },
|
|
2583
2583
|
destination: { sign: !1, write: !0 },
|
|
@@ -2586,7 +2586,7 @@ ze(Pt, $, {
|
|
|
2586
2586
|
hint: (t, e) => `Transfer ${t.amount} from token account=${t.source} of owner=${t.owner} to ${t.destination}`
|
|
2587
2587
|
},
|
|
2588
2588
|
approve: {
|
|
2589
|
-
coder: g({ amount:
|
|
2589
|
+
coder: g({ amount: _ }),
|
|
2590
2590
|
keys: {
|
|
2591
2591
|
account: { sign: !1, write: !0 },
|
|
2592
2592
|
delegate: { sign: !1, write: !1 },
|
|
@@ -2604,8 +2604,8 @@ ze(Pt, $, {
|
|
|
2604
2604
|
},
|
|
2605
2605
|
setAuthority: {
|
|
2606
2606
|
coder: g({
|
|
2607
|
-
authorityType:
|
|
2608
|
-
newAuthority: q(ve,
|
|
2607
|
+
authorityType: Sn,
|
|
2608
|
+
newAuthority: q(ve, m, "11111111111111111111111111111111")
|
|
2609
2609
|
}),
|
|
2610
2610
|
keys: {
|
|
2611
2611
|
account: { sign: !1, write: !0 },
|
|
@@ -2614,7 +2614,7 @@ ze(Pt, $, {
|
|
|
2614
2614
|
hint: (t, e) => `Sets a new authority=${t.newAuthority} of a mint or account=${t.account}. Current authority=${t.currentAuthority}. Authority Type: ${t.authorityType}`
|
|
2615
2615
|
},
|
|
2616
2616
|
mintTo: {
|
|
2617
|
-
coder: g({ amount:
|
|
2617
|
+
coder: g({ amount: _ }),
|
|
2618
2618
|
keys: {
|
|
2619
2619
|
mint: { sign: !1, write: !0 },
|
|
2620
2620
|
dest: { sign: !1, write: !0 },
|
|
@@ -2622,7 +2622,7 @@ ze(Pt, $, {
|
|
|
2622
2622
|
}
|
|
2623
2623
|
},
|
|
2624
2624
|
burn: {
|
|
2625
|
-
coder: g({ amount:
|
|
2625
|
+
coder: g({ amount: _ }),
|
|
2626
2626
|
keys: {
|
|
2627
2627
|
account: { sign: !1, write: !0 },
|
|
2628
2628
|
mint: { sign: !1, write: !0 },
|
|
@@ -2658,7 +2658,7 @@ ze(Pt, $, {
|
|
|
2658
2658
|
hint: (t, e) => `Thaw a frozne token account=${t.account} of mint=${t.mint} using freeze_authority=${t.authority}`
|
|
2659
2659
|
},
|
|
2660
2660
|
transferChecked: {
|
|
2661
|
-
coder: g({ amount:
|
|
2661
|
+
coder: g({ amount: _, decimals: I }),
|
|
2662
2662
|
keys: {
|
|
2663
2663
|
source: { sign: !1, write: !0 },
|
|
2664
2664
|
mint: { sign: !1, write: !1 },
|
|
@@ -2668,7 +2668,7 @@ ze(Pt, $, {
|
|
|
2668
2668
|
hint: (t, e) => `Transfer ${H.decimal(t.decimals).encode(t.amount)} ${T(t.mint, e)} from token account=${t.source} of owner=${t.owner} to ${t.destination}`
|
|
2669
2669
|
},
|
|
2670
2670
|
approveChecked: {
|
|
2671
|
-
coder: g({ amount:
|
|
2671
|
+
coder: g({ amount: _, decimals: I }),
|
|
2672
2672
|
keys: {
|
|
2673
2673
|
source: { sign: !1, write: !0 },
|
|
2674
2674
|
mint: { sign: !1, write: !1 },
|
|
@@ -2678,7 +2678,7 @@ ze(Pt, $, {
|
|
|
2678
2678
|
hint: (t, e) => `Approve delgate=${t.delegate} authority on behalf account=${t.source} owner=${t.owner} over ${H.decimal(t.decimals).encode(t.amount)} ${T(t.mint, e)}`
|
|
2679
2679
|
},
|
|
2680
2680
|
mintToChecked: {
|
|
2681
|
-
coder: g({ amount:
|
|
2681
|
+
coder: g({ amount: _, decimals: I }),
|
|
2682
2682
|
keys: {
|
|
2683
2683
|
mint: { sign: !1, write: !0 },
|
|
2684
2684
|
dest: { sign: !1, write: !0 },
|
|
@@ -2687,7 +2687,7 @@ ze(Pt, $, {
|
|
|
2687
2687
|
hint: (t, e) => `Mint new tokens (${H.decimal(t.decimals).encode(t.amount)} ${T(t.mint, e)}) to account=${t.dest} using authority=${t.authority}`
|
|
2688
2688
|
},
|
|
2689
2689
|
burnChecked: {
|
|
2690
|
-
coder: g({ amount:
|
|
2690
|
+
coder: g({ amount: _, decimals: I }),
|
|
2691
2691
|
keys: {
|
|
2692
2692
|
mint: { sign: !1, write: !0 },
|
|
2693
2693
|
account: { sign: !1, write: !0 },
|
|
@@ -2696,7 +2696,7 @@ ze(Pt, $, {
|
|
|
2696
2696
|
hint: (t, e) => `Burn tokens (${H.decimal(t.decimals).encode(t.amount)} ${T(t.mint, e)}) on account=${t.account} of owner=${t.owner}`
|
|
2697
2697
|
},
|
|
2698
2698
|
initializeAccount2: {
|
|
2699
|
-
coder: g({ owner:
|
|
2699
|
+
coder: g({ owner: m }),
|
|
2700
2700
|
keys: {
|
|
2701
2701
|
account: { sign: !1, write: !0 },
|
|
2702
2702
|
mint: { sign: !1, write: !1 },
|
|
@@ -2713,9 +2713,9 @@ ze(Pt, $, {
|
|
|
2713
2713
|
g({
|
|
2714
2714
|
version: ie,
|
|
2715
2715
|
state: ie,
|
|
2716
|
-
authority:
|
|
2717
|
-
nonce:
|
|
2718
|
-
lamportPerSignature:
|
|
2716
|
+
authority: m,
|
|
2717
|
+
nonce: m,
|
|
2718
|
+
lamportPerSignature: _
|
|
2719
2719
|
});
|
|
2720
2720
|
const Cn = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
2721
2721
|
ze(Cn, bn(0), {
|
|
@@ -2726,7 +2726,7 @@ ze(Cn, bn(0), {
|
|
|
2726
2726
|
account: { sign: !1, write: !0 },
|
|
2727
2727
|
wallet: { sign: !1, write: !1 },
|
|
2728
2728
|
mint: { sign: !1, write: !1 },
|
|
2729
|
-
_sys: { address:
|
|
2729
|
+
_sys: { address: It, sign: !1, write: !1 },
|
|
2730
2730
|
_token: { address: Pt, sign: !1, write: !1 },
|
|
2731
2731
|
_rent: { address: L, sign: !1, write: !1 }
|
|
2732
2732
|
},
|
|
@@ -2735,18 +2735,18 @@ ze(Cn, bn(0), {
|
|
|
2735
2735
|
});
|
|
2736
2736
|
const me = $t(4, ve, () => 0);
|
|
2737
2737
|
g({
|
|
2738
|
-
mint:
|
|
2739
|
-
owner:
|
|
2740
|
-
amount:
|
|
2741
|
-
delegate: q(me,
|
|
2742
|
-
state: Te(
|
|
2738
|
+
mint: m,
|
|
2739
|
+
owner: m,
|
|
2740
|
+
amount: _,
|
|
2741
|
+
delegate: q(me, m, "11111111111111111111111111111111"),
|
|
2742
|
+
state: Te(I, {
|
|
2743
2743
|
uninitialized: 0,
|
|
2744
2744
|
initialized: 1,
|
|
2745
2745
|
frozen: 2
|
|
2746
2746
|
}),
|
|
2747
|
-
isNative: q(me,
|
|
2748
|
-
delegateAmount:
|
|
2749
|
-
closeAuthority: q(me,
|
|
2747
|
+
isNative: q(me, _, 0n),
|
|
2748
|
+
delegateAmount: _,
|
|
2749
|
+
closeAuthority: q(me, m, "11111111111111111111111111111111")
|
|
2750
2750
|
});
|
|
2751
2751
|
function rt(t, e, r) {
|
|
2752
2752
|
if (!e.length)
|
|
@@ -2778,22 +2778,22 @@ function Pn(t) {
|
|
|
2778
2778
|
const u = c.length;
|
|
2779
2779
|
for (; f !== u && c[f] === 0; )
|
|
2780
2780
|
f++, d++;
|
|
2781
|
-
const w = (u - f) * o + 1 >>> 0,
|
|
2781
|
+
const w = (u - f) * o + 1 >>> 0, b = new Uint8Array(w);
|
|
2782
2782
|
for (; f !== u; ) {
|
|
2783
|
-
let k = c[f],
|
|
2784
|
-
for (let
|
|
2785
|
-
k += 256 *
|
|
2783
|
+
let k = c[f], y = 0;
|
|
2784
|
+
for (let x = w - 1; (k !== 0 || y < h) && x !== -1; x--, y++)
|
|
2785
|
+
k += 256 * b[x] >>> 0, b[x] = k % r >>> 0, k = k / r >>> 0;
|
|
2786
2786
|
if (k !== 0)
|
|
2787
2787
|
throw new Error("Non-zero carry");
|
|
2788
|
-
h =
|
|
2788
|
+
h = y, f++;
|
|
2789
2789
|
}
|
|
2790
|
-
let
|
|
2791
|
-
for (;
|
|
2792
|
-
|
|
2793
|
-
let
|
|
2794
|
-
for (;
|
|
2795
|
-
|
|
2796
|
-
return
|
|
2790
|
+
let p = w - h;
|
|
2791
|
+
for (; p !== w && b[p] === 0; )
|
|
2792
|
+
p++;
|
|
2793
|
+
let v = n.repeat(d);
|
|
2794
|
+
for (; p < w; ++p)
|
|
2795
|
+
v += t.charAt(b[p]);
|
|
2796
|
+
return v;
|
|
2797
2797
|
}
|
|
2798
2798
|
function a(c) {
|
|
2799
2799
|
if (typeof c != "string")
|
|
@@ -2808,24 +2808,24 @@ function Pn(t) {
|
|
|
2808
2808
|
const k = c.charCodeAt(d);
|
|
2809
2809
|
if (k > 255)
|
|
2810
2810
|
return;
|
|
2811
|
-
let
|
|
2812
|
-
if (
|
|
2811
|
+
let y = e[k];
|
|
2812
|
+
if (y === 255)
|
|
2813
2813
|
return;
|
|
2814
|
-
let
|
|
2815
|
-
for (let C = u - 1; (
|
|
2816
|
-
|
|
2817
|
-
if (
|
|
2814
|
+
let x = 0;
|
|
2815
|
+
for (let C = u - 1; (y !== 0 || x < f) && C !== -1; C--, x++)
|
|
2816
|
+
y += r * w[C] >>> 0, w[C] = y % 256 >>> 0, y = y / 256 >>> 0;
|
|
2817
|
+
if (y !== 0)
|
|
2818
2818
|
throw new Error("Non-zero carry");
|
|
2819
|
-
f =
|
|
2819
|
+
f = x, d++;
|
|
2820
2820
|
}
|
|
2821
|
-
let
|
|
2822
|
-
for (;
|
|
2823
|
-
|
|
2824
|
-
const
|
|
2825
|
-
let
|
|
2826
|
-
for (;
|
|
2827
|
-
|
|
2828
|
-
return
|
|
2821
|
+
let b = u - f;
|
|
2822
|
+
for (; b !== u && w[b] === 0; )
|
|
2823
|
+
b++;
|
|
2824
|
+
const p = new Uint8Array(h + (u - b));
|
|
2825
|
+
let v = h;
|
|
2826
|
+
for (; b !== u; )
|
|
2827
|
+
p[v++] = w[b++];
|
|
2828
|
+
return p;
|
|
2829
2829
|
}
|
|
2830
2830
|
function l(c) {
|
|
2831
2831
|
const d = a(c);
|
|
@@ -3312,21 +3312,30 @@ class zn extends cr {
|
|
|
3312
3312
|
rpcUrl: c,
|
|
3313
3313
|
ref: d,
|
|
3314
3314
|
refGroup: h,
|
|
3315
|
-
|
|
3315
|
+
needsSessionCreation: f,
|
|
3316
|
+
username: u,
|
|
3317
|
+
onSessionCreated: w,
|
|
3318
|
+
...b
|
|
3316
3319
|
}) {
|
|
3317
|
-
const
|
|
3318
|
-
n &&
|
|
3320
|
+
const p = new URL(e ?? be), v = new Tn();
|
|
3321
|
+
n && p.searchParams.set("v", encodeURIComponent(n)), s && p.searchParams.set("ps", encodeURIComponent(s)), o && p.searchParams.set("ns", encodeURIComponent(o)), i?.erc20 && p.searchParams.set(
|
|
3319
3322
|
"erc20",
|
|
3320
3323
|
encodeURIComponent(i.erc20.toString())
|
|
3321
|
-
), c &&
|
|
3324
|
+
), c && p.searchParams.set("rpc_url", encodeURIComponent(c)), d && p.searchParams.set("ref", encodeURIComponent(d)), h && p.searchParams.set("ref_group", encodeURIComponent(h)), f && p.searchParams.set("needs_session_creation", "true"), u && p.searchParams.set("username", encodeURIComponent(u)), (!a || l) && r ? p.searchParams.set(
|
|
3322
3325
|
"policies",
|
|
3323
3326
|
encodeURIComponent(JSON.stringify(r))
|
|
3324
|
-
) : a &&
|
|
3325
|
-
...
|
|
3327
|
+
) : a && p.searchParams.set("preset", a), super({
|
|
3328
|
+
...b,
|
|
3326
3329
|
id: "controller-keychain",
|
|
3327
|
-
url:
|
|
3328
|
-
methods:
|
|
3329
|
-
|
|
3330
|
+
url: p,
|
|
3331
|
+
methods: {
|
|
3332
|
+
...v.getIFrameMethods(),
|
|
3333
|
+
// Expose callback for keychain to notify parent that session was created and storage access granted
|
|
3334
|
+
onSessionCreated: (k) => () => {
|
|
3335
|
+
w && w();
|
|
3336
|
+
}
|
|
3337
|
+
}
|
|
3338
|
+
}), this.walletBridge = v, typeof window < "u" && (window.external_wallets = this.walletBridge);
|
|
3330
3339
|
}
|
|
3331
3340
|
getWalletBridge() {
|
|
3332
3341
|
return this.walletBridge;
|
|
@@ -3456,7 +3465,7 @@ class Qn extends zt {
|
|
|
3456
3465
|
console.error(new E().message);
|
|
3457
3466
|
return;
|
|
3458
3467
|
}
|
|
3459
|
-
|
|
3468
|
+
this.iframes.keychain.open();
|
|
3460
3469
|
try {
|
|
3461
3470
|
let e = await this.keychain.connect(this.options.signupOptions);
|
|
3462
3471
|
if (e.code !== Q.SUCCESS)
|
|
@@ -3497,7 +3506,7 @@ class Qn extends zt {
|
|
|
3497
3506
|
console.error(new E().message);
|
|
3498
3507
|
return;
|
|
3499
3508
|
}
|
|
3500
|
-
return
|
|
3509
|
+
return this.account = void 0, this.keychain.disconnect();
|
|
3501
3510
|
}
|
|
3502
3511
|
async openProfile(e = "inventory") {
|
|
3503
3512
|
if (!this.iframes)
|
|
@@ -3667,22 +3676,27 @@ class Qn extends zt {
|
|
|
3667
3676
|
);
|
|
3668
3677
|
}
|
|
3669
3678
|
createKeychainIframe() {
|
|
3670
|
-
|
|
3679
|
+
const e = typeof window < "u" && typeof sessionStorage < "u" && sessionStorage.getItem("controller_standalone") === "1", n = (typeof window < "u" ? new URLSearchParams(window.location.search) : void 0)?.get("username") ?? void 0;
|
|
3680
|
+
e && sessionStorage.removeItem("controller_standalone");
|
|
3681
|
+
const s = new zn({
|
|
3671
3682
|
...this.options,
|
|
3672
3683
|
rpcUrl: this.rpcUrl(),
|
|
3673
3684
|
onClose: this.keychain?.reset,
|
|
3674
|
-
onConnect: (
|
|
3675
|
-
this.keychain =
|
|
3676
|
-
console.warn(
|
|
3677
|
-
"Failed to request storage access after redirect:",
|
|
3678
|
-
n
|
|
3679
|
-
);
|
|
3680
|
-
}));
|
|
3685
|
+
onConnect: (o) => {
|
|
3686
|
+
this.keychain = o;
|
|
3681
3687
|
},
|
|
3682
3688
|
version: Dt,
|
|
3683
3689
|
ref: this.referral.ref,
|
|
3684
|
-
refGroup: this.referral.refGroup
|
|
3690
|
+
refGroup: this.referral.refGroup,
|
|
3691
|
+
needsSessionCreation: e,
|
|
3692
|
+
username: n,
|
|
3693
|
+
onSessionCreated: async () => {
|
|
3694
|
+
await this.probe();
|
|
3695
|
+
}
|
|
3685
3696
|
});
|
|
3697
|
+
return e && setTimeout(() => {
|
|
3698
|
+
s.open();
|
|
3699
|
+
}, 100), s;
|
|
3686
3700
|
}
|
|
3687
3701
|
waitForKeychain({
|
|
3688
3702
|
timeout: e = 5e4,
|