@wormhole-foundation/wormhole-connect 2.0.0-beta.2-development → 2.1.0-beta.0-development
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 +1 -0
- package/dist/assets/{ccip-B8McgJws.js → ccip-B5XelJyO.js} +1 -1
- package/dist/assets/{evm-B2eiT45I.js → evm-90nXZZVS.js} +3 -3
- package/dist/assets/{index.es-BO6bR5S4.js → index.es-Ed25jZ6s.js} +1 -1
- package/dist/assets/sui-DbbCSZ5V.js +1 -0
- package/dist/main.js +75 -75
- package/dist/src/config/constants.d.ts.map +1 -1
- package/dist/src/config/devnet/chains.d.ts.map +1 -1
- package/dist/src/config/devnet/index.d.ts.map +1 -1
- package/dist/src/config/devnet/rpcs.d.ts +0 -6
- package/dist/src/config/devnet/rpcs.d.ts.map +1 -1
- package/dist/src/config/index.d.ts.map +1 -1
- package/dist/src/config/mainnet/chains.d.ts.map +1 -1
- package/dist/src/config/mainnet/index.d.ts.map +1 -1
- package/dist/src/config/mainnet/rpcs.d.ts +0 -6
- package/dist/src/config/mainnet/rpcs.d.ts.map +1 -1
- package/dist/src/config/mainnet/tokens.d.ts.map +1 -1
- package/dist/src/config/testnet/chains.d.ts.map +1 -1
- package/dist/src/config/testnet/index.d.ts.map +1 -1
- package/dist/src/config/testnet/rpcs.d.ts +0 -6
- package/dist/src/config/testnet/rpcs.d.ts.map +1 -1
- package/dist/src/config/testnet/tokens.d.ts.map +1 -1
- package/dist/src/config/tokens.d.ts +4 -0
- package/dist/src/config/tokens.d.ts.map +1 -1
- package/dist/src/config/types.d.ts +2 -9
- package/dist/src/config/types.d.ts.map +1 -1
- package/dist/src/contexts/TokensContext.d.ts +1 -0
- package/dist/src/contexts/TokensContext.d.ts.map +1 -1
- package/dist/src/icons/ChainIcons.d.ts.map +1 -1
- package/dist/src/icons/Chains/UNI.d.ts +4 -0
- package/dist/src/icons/Chains/UNI.d.ts.map +1 -0
- package/dist/src/icons/TokenIcons.d.ts.map +1 -1
- package/dist/src/routes/sdkv2/route.d.ts.map +1 -1
- package/dist/src/sdklegacy/config/DEVNET.d.ts.map +1 -1
- package/dist/src/sdklegacy/config/MAINNET.d.ts.map +1 -1
- package/dist/src/sdklegacy/config/TESTNET.d.ts.map +1 -1
- package/dist/src/sdklegacy/types.d.ts +0 -4
- package/dist/src/sdklegacy/types.d.ts.map +1 -1
- package/dist/src/utils/sdkv2.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/AssetPicker/TokenList.d.ts.map +1 -1
- package/dist/src/views/v2/TxHistory/Widget/Item.d.ts.map +1 -1
- package/dist/src/views/v2/TxHistory/Widget/index.d.ts.map +1 -1
- package/lib/{aptos-Dbfuz96f.js → aptos--edUC0Jm.js} +1 -1
- package/lib/{aptos-KMTKpvnn.mjs → aptos-BrgNOgGM.mjs} +2 -2
- package/lib/{aptos-DTHJQbIb.js → aptos-CGjKms8W.js} +2 -2
- package/lib/{aptos-B3TWiavl.mjs → aptos-dXuHBY5i.mjs} +5 -5
- package/lib/{base64-Ci4lr2or.js → base64-BbtWjSSq.js} +1 -1
- package/lib/{base64-D-sBGnCV.mjs → base64-Cx-uEAcH.mjs} +1 -1
- package/lib/{ccip-CBfsTddJ.js → ccip-BRw4HAHQ.js} +1 -1
- package/lib/{ccip-IV8wn7mX.mjs → ccip-BiTI0Vsw.mjs} +1 -1
- package/lib/{chunk-OR6GFWLG-CFPMvzOj.js → chunk-OR6GFWLG-S-Fr6JAP.js} +1 -1
- package/lib/{chunk-OR6GFWLG-m97dlZZV.mjs → chunk-OR6GFWLG-r6sLFcMR.mjs} +3 -3
- package/lib/{events-CjPLRE-d.js → events-BIriznPM.js} +1 -1
- package/lib/{events-Dtbo0st9.mjs → events-CpW8AkTD.mjs} +1 -1
- package/lib/{evm-BFBdsLYZ.js → evm-BSyj6JzA.js} +11 -11
- package/lib/{evm-kkjU8AsQ.mjs → evm-CxlQ91gJ.mjs} +5 -5
- package/lib/{evm-JbOZ35C0.mjs → evm-Cyvodxhp.mjs} +388 -323
- package/lib/{evm-DuCtpTHQ.js → evm-DYaM3YMG.js} +1 -1
- package/lib/{index-DL2KYGb2.mjs → index--NM0JjnQ.mjs} +1 -1
- package/lib/{index-HF2DcpAR.mjs → index-Amhia1ZS.mjs} +2 -2
- package/lib/{index-DmkA2z4q.js → index-B0dvPq6m.js} +1 -1
- package/lib/{index-DFDFr1Hv.mjs → index-B2EArRT7.mjs} +1 -1
- package/lib/{index-Br4OTc1S.js → index-BBfGNpdz.js} +101 -101
- package/lib/{index-Bo9bOQTx.mjs → index-BEZxctGp.mjs} +1 -1
- package/lib/{index-D9NMKVsX.mjs → index-BJMqYpY6.mjs} +2 -2
- package/lib/{index-BE5ihayy.mjs → index-BMcGCzso.mjs} +2 -2
- package/lib/{index-MdL7XQBR.mjs → index-BND6j-zd.mjs} +1 -1
- package/lib/{index-SrHywpn-.js → index-BQ9AZknw.js} +1 -1
- package/lib/{index-DtJ3gwwu.js → index-BXyAX-bb.js} +1 -1
- package/lib/{index-DCfPCVGM.mjs → index-B_oqyOcL.mjs} +1 -1
- package/lib/{index-DUrL3GHD.mjs → index-Bhz1Rs3C.mjs} +3 -3
- package/lib/{index-CM5aJCsU.mjs → index-BnV0tUca.mjs} +3 -3
- package/lib/{index-BL5dRh07.mjs → index-C-Dl1g5N.mjs} +2 -2
- package/lib/{index-DWTXe9yU.mjs → index-CC6Tw8Ue.mjs} +4 -4
- package/lib/{index-DPlTznQs.js → index-CCzyci2v.js} +1 -1
- package/lib/{index-DzgnqJ7-.js → index-CHBZ4cXy.js} +1 -1
- package/lib/{index-B0lJ-tdN.js → index-CVYH-ljt.js} +1 -1
- package/lib/{index-D2v_ZH9c.mjs → index-CXN2TSeM.mjs} +2 -2
- package/lib/{index-DcKePNaA.js → index-Cajic-Zj.js} +1 -1
- package/lib/{index-gUz3Q8gE.js → index-ChdEfYe-.js} +1 -1
- package/lib/{index-IbmfT3Tg.mjs → index-ChzcO2lh.mjs} +5 -5
- package/lib/{index-CS3m8qJT.js → index-CjdAAhpi.js} +1 -1
- package/lib/{index-B3CeIlMx.mjs → index-CttRUMXZ.mjs} +6922 -6947
- package/lib/{index-Dy3WJQ-h.js → index-DBFaWeUh.js} +1 -1
- package/lib/{index-DLegUdzU.js → index-DCxu_9fC.js} +1 -1
- package/lib/{index-BoYglZwX.mjs → index-DFp-75l7.mjs} +2 -2
- package/lib/{index-CWSjFjhh.mjs → index-DM6ABGI6.mjs} +2 -2
- package/lib/{index-B4_J2HAU.js → index-DOOjj9wv.js} +1 -1
- package/lib/{index-DNNfs5Ot.js → index-DSooDhqr.js} +1 -1
- package/lib/{index-BdUX86K5.js → index-DkXzI9E6.js} +1 -1
- package/lib/{index-vlui53ey.mjs → index-Dt2sCuyA.mjs} +2 -2
- package/lib/{index-BasVT8K7.js → index-DzwZyiM9.js} +1 -1
- package/lib/{index-pi5LLTZ3.js → index-OgMy4QSY.js} +1 -1
- package/lib/{index-B2h28IP4.mjs → index-PQxGZteo.mjs} +2 -2
- package/lib/{index-QzouONBY.js → index-eY3JxOiX.js} +1 -1
- package/lib/{index-CfVm24rf.mjs → index-mdH3MkQ5.mjs} +1 -1
- package/lib/{index-DlMM2TKj.js → index-nFX-Pkvm.js} +1 -1
- package/lib/{index-B1ELgSA6.js → index-zxhCTPTL.js} +1 -1
- package/lib/{index.es-SaEPft-i.mjs → index.es-C2Qro_0A.mjs} +6 -6
- package/lib/{index.es-DFpbuPuY.js → index.es-DU7kQxBj.js} +2 -2
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{signer-RSvbDa7c.mjs → signer-Bxzj_sfg.mjs} +1 -1
- package/lib/{signer-CeSFiipD.js → signer-Oenym_zt.js} +1 -1
- package/lib/solana-BsoOVBn3.js +1 -0
- package/lib/{solana-DwgjV-W7.js → solana-Bwr_Oe17.js} +1 -1
- package/lib/{solana-ClVJj67l.mjs → solana-CvLCZYlJ.mjs} +4 -4
- package/lib/{solana-DmG1qAvz.mjs → solana-D7_c2sjy.mjs} +5 -5
- package/lib/{solanaEmbed.esm-Cu2iyuQy.mjs → solanaEmbed.esm-C5KdLEHG.mjs} +2 -2
- package/lib/{solanaEmbed.esm-DY919Dj0.js → solanaEmbed.esm-CrRRGcT6.js} +1 -1
- package/lib/src/config/constants.d.ts.map +1 -1
- package/lib/src/config/devnet/chains.d.ts.map +1 -1
- package/lib/src/config/devnet/index.d.ts.map +1 -1
- package/lib/src/config/devnet/rpcs.d.ts +0 -6
- package/lib/src/config/devnet/rpcs.d.ts.map +1 -1
- package/lib/src/config/index.d.ts.map +1 -1
- package/lib/src/config/mainnet/chains.d.ts.map +1 -1
- package/lib/src/config/mainnet/index.d.ts.map +1 -1
- package/lib/src/config/mainnet/rpcs.d.ts +0 -6
- package/lib/src/config/mainnet/rpcs.d.ts.map +1 -1
- package/lib/src/config/mainnet/tokens.d.ts.map +1 -1
- package/lib/src/config/testnet/chains.d.ts.map +1 -1
- package/lib/src/config/testnet/index.d.ts.map +1 -1
- package/lib/src/config/testnet/rpcs.d.ts +0 -6
- package/lib/src/config/testnet/rpcs.d.ts.map +1 -1
- package/lib/src/config/testnet/tokens.d.ts.map +1 -1
- package/lib/src/config/tokens.d.ts +4 -0
- package/lib/src/config/tokens.d.ts.map +1 -1
- package/lib/src/config/types.d.ts +2 -9
- package/lib/src/config/types.d.ts.map +1 -1
- package/lib/src/contexts/TokensContext.d.ts +1 -0
- package/lib/src/contexts/TokensContext.d.ts.map +1 -1
- package/lib/src/icons/ChainIcons.d.ts.map +1 -1
- package/lib/src/icons/Chains/UNI.d.ts +4 -0
- package/lib/src/icons/Chains/UNI.d.ts.map +1 -0
- package/lib/src/icons/TokenIcons.d.ts.map +1 -1
- package/lib/src/routes/sdkv2/route.d.ts.map +1 -1
- package/lib/src/sdklegacy/config/DEVNET.d.ts.map +1 -1
- package/lib/src/sdklegacy/config/MAINNET.d.ts.map +1 -1
- package/lib/src/sdklegacy/config/TESTNET.d.ts.map +1 -1
- package/lib/src/sdklegacy/types.d.ts +0 -4
- package/lib/src/sdklegacy/types.d.ts.map +1 -1
- package/lib/src/utils/sdkv2.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/AssetPicker/TokenList.d.ts.map +1 -1
- package/lib/src/views/v2/TxHistory/Widget/Item.d.ts.map +1 -1
- package/lib/src/views/v2/TxHistory/Widget/index.d.ts.map +1 -1
- package/lib/{sui-D1lxvss1.mjs → sui-BQq3s7Q3.mjs} +5 -5
- package/lib/{sui-CIBoUTGj.mjs → sui-C7ivLHLu.mjs} +323 -319
- package/lib/{sui-BzgBbOVR.js → sui-CDzPbVuH.js} +2 -2
- package/lib/sui-CbH-5eUE.js +1 -0
- package/lib/{utf8-BZ7GX1-B.mjs → utf8-CDOzcEr-.mjs} +1 -1
- package/lib/{utf8-CQNNfvVV.js → utf8-Dez257K6.js} +1 -1
- package/package.json +20 -20
- package/dist/assets/sui-C-nd2a3Y.js +0 -1
- package/lib/solana-Bwjjv4LB.js +0 -1
- package/lib/sui-C0CqiXaB.js +0 -1
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
import { g as
|
|
1
|
+
import { g as nM } from "./wallets-B2tqS5lZ.mjs";
|
|
2
2
|
import { R as SM } from "./util-C5OREj1L.mjs";
|
|
3
|
-
import { Z as CM, a1 as q, av as
|
|
3
|
+
import { Z as CM, a1 as q, av as EM, aw as _, $ as zM, a8 as O } from "./index-CttRUMXZ.mjs";
|
|
4
4
|
class wM extends TypeError {
|
|
5
|
-
constructor(
|
|
6
|
-
let
|
|
7
|
-
const { message: I, explanation: e, ...
|
|
8
|
-
super(e ??
|
|
5
|
+
constructor(A, i) {
|
|
6
|
+
let t;
|
|
7
|
+
const { message: I, explanation: e, ...s } = A, { path: c } = A, n = c.length === 0 ? I : `At path: ${c.join(".")} -- ${I}`;
|
|
8
|
+
super(e ?? n), e != null && (this.cause = n), Object.assign(this, s), this.name = this.constructor.name, this.failures = () => t ?? (t = [A, ...i()]);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
function dM(M) {
|
|
12
|
-
return
|
|
12
|
+
return z(M) && typeof M[Symbol.iterator] == "function";
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function z(M) {
|
|
15
15
|
return typeof M == "object" && M != null;
|
|
16
16
|
}
|
|
17
17
|
function w(M) {
|
|
18
18
|
return typeof M == "symbol" ? M.toString() : typeof M == "string" ? JSON.stringify(M) : `${M}`;
|
|
19
19
|
}
|
|
20
20
|
function xM(M) {
|
|
21
|
-
const { done:
|
|
22
|
-
return
|
|
21
|
+
const { done: A, value: i } = M.next();
|
|
22
|
+
return A ? void 0 : i;
|
|
23
23
|
}
|
|
24
|
-
function mM(M, i, t
|
|
24
|
+
function mM(M, A, i, t) {
|
|
25
25
|
if (M === !0)
|
|
26
26
|
return;
|
|
27
27
|
M === !1 ? M = {} : typeof M == "string" && (M = { message: M });
|
|
28
|
-
const { path: I, branch: e } =
|
|
28
|
+
const { path: I, branch: e } = A, { type: s } = i, { refinement: c, message: n = `Expected a value of type \`${s}\`${c ? ` with refinement \`${c}\`` : ""}, but received: \`${w(t)}\`` } = M;
|
|
29
29
|
return {
|
|
30
|
-
value:
|
|
31
|
-
type:
|
|
32
|
-
refinement:
|
|
30
|
+
value: t,
|
|
31
|
+
type: s,
|
|
32
|
+
refinement: c,
|
|
33
33
|
key: I[I.length - 1],
|
|
34
34
|
path: I,
|
|
35
35
|
branch: e,
|
|
36
36
|
...M,
|
|
37
|
-
message:
|
|
37
|
+
message: n
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
function* $(M, i, t
|
|
40
|
+
function* $(M, A, i, t) {
|
|
41
41
|
dM(M) || (M = [M]);
|
|
42
42
|
for (const I of M) {
|
|
43
|
-
const e = mM(I, i, t
|
|
43
|
+
const e = mM(I, A, i, t);
|
|
44
44
|
e && (yield e);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
function*
|
|
48
|
-
const { path:
|
|
49
|
-
if (e && (M =
|
|
50
|
-
for (const
|
|
51
|
-
|
|
52
|
-
let
|
|
53
|
-
for (const
|
|
54
|
-
|
|
55
|
-
for (let [
|
|
56
|
-
const
|
|
57
|
-
path:
|
|
58
|
-
branch:
|
|
47
|
+
function* H(M, A, i = {}) {
|
|
48
|
+
const { path: t = [], branch: I = [M], coerce: e = !1, mask: s = !1 } = i, c = { path: t, branch: I };
|
|
49
|
+
if (e && (M = A.coercer(M, c), s && A.type !== "type" && z(A.schema) && z(M) && !Array.isArray(M)))
|
|
50
|
+
for (const g in M)
|
|
51
|
+
A.schema[g] === void 0 && delete M[g];
|
|
52
|
+
let n = "valid";
|
|
53
|
+
for (const g of A.validator(M, c))
|
|
54
|
+
g.explanation = i.message, n = "not_valid", yield [g, void 0];
|
|
55
|
+
for (let [g, u, TM] of A.entries(M, c)) {
|
|
56
|
+
const lM = H(u, TM, {
|
|
57
|
+
path: g === void 0 ? t : [...t, g],
|
|
58
|
+
branch: g === void 0 ? I : [...I, u],
|
|
59
59
|
coerce: e,
|
|
60
|
-
mask:
|
|
61
|
-
message:
|
|
60
|
+
mask: s,
|
|
61
|
+
message: i.message
|
|
62
62
|
});
|
|
63
|
-
for (const
|
|
64
|
-
|
|
63
|
+
for (const b of lM)
|
|
64
|
+
b[0] ? (n = b[0].refinement != null ? "not_refined" : "not_valid", yield [b[0], void 0]) : e && (u = b[1], g === void 0 ? M = u : M instanceof Map ? M.set(g, u) : M instanceof Set ? M.add(u) : z(M) && (u !== void 0 || g in M) && (M[g] = u));
|
|
65
65
|
}
|
|
66
|
-
if (
|
|
67
|
-
for (const
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
if (n !== "not_valid")
|
|
67
|
+
for (const g of A.refiner(M, c))
|
|
68
|
+
g.explanation = i.message, n = "not_refined", yield [g, void 0];
|
|
69
|
+
n === "valid" && (yield [void 0, M]);
|
|
70
70
|
}
|
|
71
71
|
class m {
|
|
72
|
-
constructor(
|
|
73
|
-
const { type:
|
|
74
|
-
} } =
|
|
75
|
-
this.type =
|
|
76
|
-
const u = I(
|
|
77
|
-
return $(u,
|
|
78
|
-
} : this.validator = () => [], e ? this.refiner = (
|
|
79
|
-
const u = e(
|
|
80
|
-
return $(u,
|
|
72
|
+
constructor(A) {
|
|
73
|
+
const { type: i, schema: t, validator: I, refiner: e, coercer: s = (n) => n, entries: c = function* () {
|
|
74
|
+
} } = A;
|
|
75
|
+
this.type = i, this.schema = t, this.entries = c, this.coercer = s, I ? this.validator = (n, g) => {
|
|
76
|
+
const u = I(n, g);
|
|
77
|
+
return $(u, g, this, n);
|
|
78
|
+
} : this.validator = () => [], e ? this.refiner = (n, g) => {
|
|
79
|
+
const u = e(n, g);
|
|
80
|
+
return $(u, g, this, n);
|
|
81
81
|
} : this.refiner = () => [];
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
* Assert that a value passes the struct's validation, throwing if it doesn't.
|
|
85
85
|
*/
|
|
86
|
-
assert(
|
|
87
|
-
return pM(
|
|
86
|
+
assert(A, i) {
|
|
87
|
+
return pM(A, this, i);
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
90
|
* Create a value with the struct's coercion logic, then validate it.
|
|
91
91
|
*/
|
|
92
|
-
create(
|
|
93
|
-
return hM(
|
|
92
|
+
create(A, i) {
|
|
93
|
+
return hM(A, this, i);
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
96
|
* Check if a value passes the struct's validation.
|
|
97
97
|
*/
|
|
98
|
-
is(
|
|
99
|
-
return
|
|
98
|
+
is(A) {
|
|
99
|
+
return YM(A, this);
|
|
100
100
|
}
|
|
101
101
|
/**
|
|
102
102
|
* Mask a value, coercing and validating it, but returning only the subset of
|
|
103
103
|
* properties defined by the struct's schema.
|
|
104
104
|
*/
|
|
105
|
-
mask(
|
|
106
|
-
return
|
|
105
|
+
mask(A, i) {
|
|
106
|
+
return QM(A, this, i);
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* Validate a value with the struct's validation logic, returning a tuple
|
|
@@ -113,168 +113,168 @@ class m {
|
|
|
113
113
|
* the value before attempting to validate it. If you do, the result will
|
|
114
114
|
* contain the coerced result when successful.
|
|
115
115
|
*/
|
|
116
|
-
validate(
|
|
117
|
-
return
|
|
116
|
+
validate(A, i = {}) {
|
|
117
|
+
return Q(A, this, i);
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
function pM(M,
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
123
|
-
throw
|
|
120
|
+
function pM(M, A, i) {
|
|
121
|
+
const t = Q(M, A, { message: i });
|
|
122
|
+
if (t[0])
|
|
123
|
+
throw t[0];
|
|
124
124
|
}
|
|
125
|
-
function hM(M,
|
|
126
|
-
const
|
|
127
|
-
if (
|
|
128
|
-
throw
|
|
129
|
-
return
|
|
125
|
+
function hM(M, A, i) {
|
|
126
|
+
const t = Q(M, A, { coerce: !0, message: i });
|
|
127
|
+
if (t[0])
|
|
128
|
+
throw t[0];
|
|
129
|
+
return t[1];
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
const
|
|
133
|
-
if (
|
|
134
|
-
throw
|
|
135
|
-
return
|
|
131
|
+
function QM(M, A, i) {
|
|
132
|
+
const t = Q(M, A, { coerce: !0, mask: !0, message: i });
|
|
133
|
+
if (t[0])
|
|
134
|
+
throw t[0];
|
|
135
|
+
return t[1];
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
return !
|
|
137
|
+
function YM(M, A) {
|
|
138
|
+
return !Q(M, A)[0];
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
const
|
|
140
|
+
function Q(M, A, i = {}) {
|
|
141
|
+
const t = H(M, A, i), I = xM(t);
|
|
142
142
|
return I[0] ? [new wM(I[0], function* () {
|
|
143
|
-
for (const
|
|
144
|
-
|
|
143
|
+
for (const s of t)
|
|
144
|
+
s[0] && (yield s[0]);
|
|
145
145
|
}), void 0] : [void 0, I[1]];
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
return new m({ type: M, schema: null, validator:
|
|
147
|
+
function V(M, A) {
|
|
148
|
+
return new m({ type: M, schema: null, validator: A });
|
|
149
149
|
}
|
|
150
150
|
function MM(M) {
|
|
151
151
|
return new m({
|
|
152
152
|
type: "array",
|
|
153
153
|
schema: M,
|
|
154
|
-
*entries(
|
|
155
|
-
if (M && Array.isArray(
|
|
156
|
-
for (const [
|
|
157
|
-
yield [
|
|
154
|
+
*entries(A) {
|
|
155
|
+
if (M && Array.isArray(A))
|
|
156
|
+
for (const [i, t] of A.entries())
|
|
157
|
+
yield [i, t, M];
|
|
158
158
|
},
|
|
159
|
-
coercer(
|
|
160
|
-
return Array.isArray(
|
|
159
|
+
coercer(A) {
|
|
160
|
+
return Array.isArray(A) ? A.slice() : A;
|
|
161
161
|
},
|
|
162
|
-
validator(
|
|
163
|
-
return Array.isArray(
|
|
162
|
+
validator(A) {
|
|
163
|
+
return Array.isArray(A) || `Expected an array value, but received: ${w(A)}`;
|
|
164
164
|
}
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
167
|
function d() {
|
|
168
|
-
return
|
|
168
|
+
return V("boolean", (M) => typeof M == "boolean");
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
const
|
|
170
|
+
function Z(M) {
|
|
171
|
+
const A = w(M), i = typeof M;
|
|
172
172
|
return new m({
|
|
173
173
|
type: "literal",
|
|
174
|
-
schema:
|
|
175
|
-
validator(
|
|
176
|
-
return
|
|
174
|
+
schema: i === "string" || i === "number" || i === "boolean" ? M : null,
|
|
175
|
+
validator(t) {
|
|
176
|
+
return t === M || `Expected the literal \`${A}\`, but received: ${w(t)}`;
|
|
177
177
|
}
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
|
-
function
|
|
181
|
-
return
|
|
180
|
+
function bM() {
|
|
181
|
+
return V("never", () => !1);
|
|
182
182
|
}
|
|
183
183
|
function p(M) {
|
|
184
|
-
const
|
|
184
|
+
const A = M ? Object.keys(M) : [], i = bM();
|
|
185
185
|
return new m({
|
|
186
186
|
type: "object",
|
|
187
187
|
schema: M || null,
|
|
188
|
-
*entries(
|
|
189
|
-
if (M &&
|
|
190
|
-
const I = new Set(Object.keys(
|
|
191
|
-
for (const e of
|
|
192
|
-
I.delete(e), yield [e,
|
|
188
|
+
*entries(t) {
|
|
189
|
+
if (M && z(t)) {
|
|
190
|
+
const I = new Set(Object.keys(t));
|
|
191
|
+
for (const e of A)
|
|
192
|
+
I.delete(e), yield [e, t[e], M[e]];
|
|
193
193
|
for (const e of I)
|
|
194
|
-
yield [e,
|
|
194
|
+
yield [e, t[e], i];
|
|
195
195
|
}
|
|
196
196
|
},
|
|
197
|
-
validator(
|
|
198
|
-
return
|
|
197
|
+
validator(t) {
|
|
198
|
+
return z(t) || `Expected an object, but received: ${w(t)}`;
|
|
199
199
|
},
|
|
200
|
-
coercer(
|
|
201
|
-
return
|
|
200
|
+
coercer(t) {
|
|
201
|
+
return z(t) ? { ...t } : t;
|
|
202
202
|
}
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
205
|
function o(M) {
|
|
206
206
|
return new m({
|
|
207
207
|
...M,
|
|
208
|
-
validator: (
|
|
209
|
-
refiner: (
|
|
208
|
+
validator: (A, i) => A === void 0 || M.validator(A, i),
|
|
209
|
+
refiner: (A, i) => A === void 0 || M.refiner(A, i)
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
212
|
function j() {
|
|
213
|
-
return
|
|
213
|
+
return V("string", (M) => typeof M == "string" || `Expected a string, but received: ${w(M)}`);
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
const
|
|
215
|
+
function OM(M) {
|
|
216
|
+
const A = M.map((i) => i.type).join(" | ");
|
|
217
217
|
return new m({
|
|
218
218
|
type: "union",
|
|
219
219
|
schema: null,
|
|
220
|
-
coercer(
|
|
221
|
-
for (const
|
|
222
|
-
const [I, e] =
|
|
220
|
+
coercer(i) {
|
|
221
|
+
for (const t of M) {
|
|
222
|
+
const [I, e] = t.validate(i, { coerce: !0 });
|
|
223
223
|
if (!I)
|
|
224
224
|
return e;
|
|
225
225
|
}
|
|
226
|
-
return
|
|
226
|
+
return i;
|
|
227
227
|
},
|
|
228
|
-
validator(
|
|
228
|
+
validator(i, t) {
|
|
229
229
|
const I = [];
|
|
230
230
|
for (const e of M) {
|
|
231
|
-
const [...
|
|
232
|
-
if (
|
|
233
|
-
for (const [
|
|
234
|
-
|
|
231
|
+
const [...s] = H(i, e, t), [c] = s;
|
|
232
|
+
if (c[0])
|
|
233
|
+
for (const [n] of s)
|
|
234
|
+
n && I.push(n);
|
|
235
235
|
else
|
|
236
236
|
return [];
|
|
237
237
|
}
|
|
238
238
|
return [
|
|
239
|
-
`Expected the value to satisfy a union of \`${
|
|
239
|
+
`Expected the value to satisfy a union of \`${A}\`, but received: ${w(i)}`,
|
|
240
240
|
...I
|
|
241
241
|
];
|
|
242
242
|
}
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
|
-
function
|
|
246
|
-
return Uint8Array.from(atob(M), (
|
|
245
|
+
function ZM(M) {
|
|
246
|
+
return Uint8Array.from(atob(M), (A) => A.charCodeAt(0));
|
|
247
247
|
}
|
|
248
248
|
const f = 8192;
|
|
249
|
-
function
|
|
249
|
+
function sM(M) {
|
|
250
250
|
if (M.length < f)
|
|
251
251
|
return btoa(String.fromCharCode(...M));
|
|
252
|
-
let
|
|
253
|
-
for (var
|
|
254
|
-
const
|
|
255
|
-
|
|
252
|
+
let A = "";
|
|
253
|
+
for (var i = 0; i < M.length; i += f) {
|
|
254
|
+
const t = M.slice(i, i + f);
|
|
255
|
+
A += String.fromCharCode(...t);
|
|
256
256
|
}
|
|
257
|
-
return btoa(
|
|
257
|
+
return btoa(A);
|
|
258
258
|
}
|
|
259
|
-
const
|
|
260
|
-
function fM(M,
|
|
261
|
-
let
|
|
262
|
-
return !
|
|
259
|
+
const BM = 32;
|
|
260
|
+
function fM(M, A = !1) {
|
|
261
|
+
let i = M.toLowerCase();
|
|
262
|
+
return !A && i.startsWith("0x") && (i = i.slice(2)), `0x${i.padStart(BM * 2, "0")}`;
|
|
263
263
|
}
|
|
264
|
-
function
|
|
265
|
-
return fM(M,
|
|
264
|
+
function cM(M, A = !1) {
|
|
265
|
+
return fM(M, A);
|
|
266
266
|
}
|
|
267
267
|
BigInt(1e9);
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
var
|
|
271
|
-
if (!
|
|
272
|
-
throw TypeError("Cannot " +
|
|
273
|
-
}, r = (M,
|
|
274
|
-
if (
|
|
268
|
+
cM("0x6");
|
|
269
|
+
cM("0x5");
|
|
270
|
+
var GM = Object.defineProperty, kM = (M, A, i) => A in M ? GM(M, A, { enumerable: !0, configurable: !0, writable: !0, value: i }) : M[A] = i, D = (M, A, i) => (kM(M, typeof A != "symbol" ? A + "" : A, i), i), NM = (M, A, i) => {
|
|
271
|
+
if (!A.has(M))
|
|
272
|
+
throw TypeError("Cannot " + i);
|
|
273
|
+
}, r = (M, A, i) => (NM(M, A, "read from private field"), i ? i.call(M) : A.get(M)), y = (M, A, i) => {
|
|
274
|
+
if (A.has(M))
|
|
275
275
|
throw TypeError("Cannot add the same private member more than once");
|
|
276
|
-
|
|
277
|
-
}, a = (M, i, t
|
|
276
|
+
A instanceof WeakSet ? A.add(M) : A.set(M, i);
|
|
277
|
+
}, a = (M, A, i, t) => (NM(M, A, "write to private field"), A.set(M, i), i), F = p({
|
|
278
278
|
address: j(),
|
|
279
279
|
publicKey: j(),
|
|
280
280
|
chains: MM(j()),
|
|
@@ -285,19 +285,19 @@ var kM = Object.defineProperty, BM = (M, i, t) => i in M ? kM(M, i, { enumerable
|
|
|
285
285
|
function X(M) {
|
|
286
286
|
return {
|
|
287
287
|
address: M.address,
|
|
288
|
-
publicKey:
|
|
288
|
+
publicKey: sM(M.publicKey),
|
|
289
289
|
features: [...M.features],
|
|
290
290
|
chains: [...M.chains],
|
|
291
291
|
label: M.label,
|
|
292
292
|
icon: M.icon
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function WM(M) {
|
|
296
296
|
return {
|
|
297
297
|
address: M.address,
|
|
298
|
-
publicKey:
|
|
299
|
-
chains: M.chains.map((
|
|
300
|
-
features: M.features.map((
|
|
298
|
+
publicKey: ZM(M.publicKey),
|
|
299
|
+
chains: M.chains.map((A) => A),
|
|
300
|
+
features: M.features.map((A) => A),
|
|
301
301
|
label: M.label,
|
|
302
302
|
icon: M.icon
|
|
303
303
|
};
|
|
@@ -306,9 +306,9 @@ p({
|
|
|
306
306
|
message: j(),
|
|
307
307
|
account: F
|
|
308
308
|
});
|
|
309
|
-
function
|
|
309
|
+
function UM(M) {
|
|
310
310
|
return {
|
|
311
|
-
message:
|
|
311
|
+
message: sM(M.message),
|
|
312
312
|
account: X(M.account)
|
|
313
313
|
};
|
|
314
314
|
}
|
|
@@ -349,83 +349,83 @@ function vM(M) {
|
|
|
349
349
|
};
|
|
350
350
|
}
|
|
351
351
|
p({
|
|
352
|
-
network:
|
|
352
|
+
network: OM([Z("mainnet"), Z("testnet"), Z("devnet"), Z("localnet")]),
|
|
353
353
|
url: j()
|
|
354
354
|
});
|
|
355
|
-
const JM = "sui:devnet",
|
|
355
|
+
const JM = "sui:devnet", HM = "sui:testnet", VM = "sui:localnet", FM = "sui:mainnet", XM = [
|
|
356
356
|
JM,
|
|
357
|
-
VM,
|
|
358
357
|
HM,
|
|
358
|
+
VM,
|
|
359
359
|
FM
|
|
360
360
|
];
|
|
361
361
|
var KM = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIGlkPSJMYXllcl8xIiB4PSIwIiB5PSIwIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAzMTguNiAzMTguNiI+CiAgPHN0eWxlPgogICAgLnN0MSwuc3Q2e2ZpbGw6I2U0NzYxYjtzdHJva2U6I2U0NzYxYj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l6Ii8+CiAgPHBhdGggZmlsbD0iIzE2MTYxNiIgc3Ryb2tlPSIjMTYxNjE2IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Im0xNzcuOSAyMzAuOS00LjgtMy4zaC0yNy43bC00LjggMy4zLTIuNSAyMi4xIDIuMy0yLjJoMzcuN2wyLjUgMi4yeiIvPgogIDxwYXRoIGZpbGw9IiM3NjNkMTYiIHN0cm9rZT0iIzc2M2QxNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBkPSJtMjc4LjMgMTE0LjIgOC41LTQwLjgtMTIuNy0zNy45LTk2LjIgNzEuNCAzNyAzMS4zIDUyLjMgMTUuMyAxMS42LTEzLjUtNS0zLjYgOC03LjMtNi4yLTQuOCA4LTYuMXpNMzEuOCA3My40bDguNSA0MC44LTUuNCA0IDggNi4xLTYuMSA0LjggOCA3LjMtNSAzLjYgMTEuNSAxMy41IDUyLjMtMTUuMyAzNy0zMS4zLTk2LjItNzEuNHoiLz4KICA8cGF0aCBkPSJtMjY3LjIgMTUzLjUtNTIuMy0xNS4zIDE1LjkgMjMuOS0yMy43IDQ2IDMxLjItLjRoNDYuNXptLTE2My42LTE1LjMtNTIuMyAxNS4zLTE3LjQgNTQuMmg0Ni40bDMxLjEuNC0yMy42LTQ2em03MSAyNi40IDMuMy01Ny43IDE1LjItNDEuMWgtNjcuNWwxNSA0MS4xIDMuNSA1Ny43IDEuMiAxOC4yLjEgNDQuOGgyNy43bC4yLTQ0Ljh6IiBjbGFzcz0ic3Q2Ii8+Cjwvc3ZnPg==", jM = class S extends Error {
|
|
362
|
-
constructor(
|
|
363
|
-
super(`${S.type}: ${
|
|
362
|
+
constructor(A) {
|
|
363
|
+
super(`${S.type}: ${A}}`), D(this, "type", S.type);
|
|
364
364
|
}
|
|
365
|
-
static asSimpleError(
|
|
366
|
-
return new Error(`${S.type}: ${
|
|
365
|
+
static asSimpleError(A) {
|
|
366
|
+
return new Error(`${S.type}: ${A}`);
|
|
367
367
|
}
|
|
368
|
-
static isSimpleErrorMessage(
|
|
369
|
-
return
|
|
368
|
+
static isSimpleErrorMessage(A) {
|
|
369
|
+
return A.startsWith(S.type + ": ");
|
|
370
370
|
}
|
|
371
|
-
static fromSimpleErrorMessage(
|
|
372
|
-
return new S(
|
|
371
|
+
static fromSimpleErrorMessage(A) {
|
|
372
|
+
return new S(A.slice(S.type.length + 2));
|
|
373
373
|
}
|
|
374
374
|
};
|
|
375
375
|
D(jM, "type", "INVALID_REQUEST_PARAMS");
|
|
376
|
-
var
|
|
376
|
+
var AM = jM, uM = class h extends Error {
|
|
377
377
|
constructor() {
|
|
378
378
|
super(h.type), D(this, "type", h.type);
|
|
379
379
|
}
|
|
380
380
|
static asSimpleError() {
|
|
381
381
|
return new Error(h.type);
|
|
382
382
|
}
|
|
383
|
-
static isSimpleErrorMessage(
|
|
384
|
-
return
|
|
383
|
+
static isSimpleErrorMessage(A) {
|
|
384
|
+
return A === h.type;
|
|
385
385
|
}
|
|
386
386
|
};
|
|
387
387
|
D(uM, "type", "USER_REJECTION");
|
|
388
|
-
var
|
|
389
|
-
constructor(
|
|
390
|
-
super(`${C.type}: ${
|
|
388
|
+
var G = uM, aM = class C extends Error {
|
|
389
|
+
constructor(A) {
|
|
390
|
+
super(`${C.type}: ${A}`), D(this, "type", C.type);
|
|
391
391
|
}
|
|
392
|
-
static asSimpleError(
|
|
393
|
-
return new Error(`${C.type}: ${
|
|
392
|
+
static asSimpleError(A) {
|
|
393
|
+
return new Error(`${C.type}: ${A}`);
|
|
394
394
|
}
|
|
395
|
-
static isSimpleErrorMessage(
|
|
396
|
-
return
|
|
395
|
+
static isSimpleErrorMessage(A) {
|
|
396
|
+
return A.startsWith(C.type + ": ");
|
|
397
397
|
}
|
|
398
|
-
static fromSimpleErrorMessage(
|
|
399
|
-
return new C(
|
|
398
|
+
static fromSimpleErrorMessage(A) {
|
|
399
|
+
return new C(A.slice(C.type.length + 2));
|
|
400
400
|
}
|
|
401
401
|
};
|
|
402
402
|
D(aM, "type", "INVALID_REQUEST_METHOD");
|
|
403
|
-
var
|
|
404
|
-
constructor(
|
|
405
|
-
let
|
|
406
|
-
|
|
403
|
+
var iM = aM, rM = class E extends Error {
|
|
404
|
+
constructor(A) {
|
|
405
|
+
let i = E.type;
|
|
406
|
+
A && (i += ": " + A), super(i), D(this, "type", E.type);
|
|
407
407
|
}
|
|
408
|
-
static asSimpleError(
|
|
409
|
-
let
|
|
410
|
-
return
|
|
408
|
+
static asSimpleError(A) {
|
|
409
|
+
let i = E.type;
|
|
410
|
+
return A && (i += ": " + A), new Error(i);
|
|
411
411
|
}
|
|
412
|
-
static isSimpleErrorMessage(
|
|
413
|
-
return
|
|
412
|
+
static isSimpleErrorMessage(A) {
|
|
413
|
+
return A.startsWith(E.type);
|
|
414
414
|
}
|
|
415
|
-
static fromSimpleErrorMessage(
|
|
416
|
-
return new
|
|
415
|
+
static fromSimpleErrorMessage(A) {
|
|
416
|
+
return new E(A.slice(E.type.length + 2));
|
|
417
417
|
}
|
|
418
418
|
};
|
|
419
419
|
D(rM, "type", "DRY_RUN_FAILED");
|
|
420
|
-
var
|
|
420
|
+
var tM = rM, DM = class B extends Error {
|
|
421
421
|
constructor() {
|
|
422
|
-
super(
|
|
422
|
+
super(B.type), D(this, "type", G.type);
|
|
423
423
|
}
|
|
424
424
|
static asSimpleError() {
|
|
425
|
-
return new Error(
|
|
425
|
+
return new Error(B.type);
|
|
426
426
|
}
|
|
427
|
-
static isSimpleErrorMessage(
|
|
428
|
-
return
|
|
427
|
+
static isSimpleErrorMessage(A) {
|
|
428
|
+
return A === B.type;
|
|
429
429
|
}
|
|
430
430
|
};
|
|
431
431
|
D(DM, "type", "NON_ADMIN_ORIGIN");
|
|
@@ -434,87 +434,87 @@ function qM(M) {
|
|
|
434
434
|
return typeof M == "object" && M !== null && "message" in M;
|
|
435
435
|
}
|
|
436
436
|
function K(M) {
|
|
437
|
-
return qM(M) ?
|
|
437
|
+
return qM(M) ? AM.isSimpleErrorMessage(M.message) ? AM.fromSimpleErrorMessage(M.message) : G.isSimpleErrorMessage(M.message) ? new G() : iM.isSimpleErrorMessage(M.message) ? iM.fromSimpleErrorMessage(M.message) : tM.isSimpleErrorMessage(M.message) ? tM.fromSimpleErrorMessage(M.message) : IM.isSimpleErrorMessage(M.message) ? new IM() : M : M;
|
|
438
438
|
}
|
|
439
|
-
var
|
|
439
|
+
var Y = "npm:@kunalabs-io/sui-metamask-snap", _M = "^1.0.0";
|
|
440
440
|
function $M() {
|
|
441
|
-
const M =
|
|
442
|
-
for (const
|
|
443
|
-
if (
|
|
444
|
-
return console.warn("SuiSnapWallet already registered"),
|
|
445
|
-
const
|
|
446
|
-
return M.register(
|
|
447
|
-
}
|
|
448
|
-
async function
|
|
441
|
+
const M = nM();
|
|
442
|
+
for (const i of M.get())
|
|
443
|
+
if (i.name === eM.NAME)
|
|
444
|
+
return console.warn("SuiSnapWallet already registered"), i;
|
|
445
|
+
const A = new eM();
|
|
446
|
+
return M.register(A), A;
|
|
447
|
+
}
|
|
448
|
+
async function MA(M) {
|
|
449
449
|
return (await M.request({
|
|
450
450
|
method: "wallet_invokeSnap",
|
|
451
451
|
params: {
|
|
452
|
-
snapId:
|
|
452
|
+
snapId: Y,
|
|
453
453
|
request: {
|
|
454
454
|
method: "getAccounts"
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
|
-
})).map((
|
|
457
|
+
})).map((i) => new SM(WM(i)));
|
|
458
458
|
}
|
|
459
|
-
async function LM(M,
|
|
460
|
-
const
|
|
459
|
+
async function LM(M, A) {
|
|
460
|
+
const i = UM(A);
|
|
461
461
|
try {
|
|
462
462
|
return await M.request({
|
|
463
463
|
method: "wallet_invokeSnap",
|
|
464
464
|
params: {
|
|
465
|
-
snapId:
|
|
465
|
+
snapId: Y,
|
|
466
466
|
request: {
|
|
467
467
|
method: "signPersonalMessage",
|
|
468
|
-
params: JSON.parse(JSON.stringify(
|
|
468
|
+
params: JSON.parse(JSON.stringify(i))
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
471
|
});
|
|
472
|
-
} catch (
|
|
473
|
-
throw K(
|
|
472
|
+
} catch (t) {
|
|
473
|
+
throw K(t);
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
|
-
async function
|
|
477
|
-
const
|
|
476
|
+
async function AA(M, A) {
|
|
477
|
+
const i = await LM(M, A);
|
|
478
478
|
return {
|
|
479
|
-
messageBytes:
|
|
480
|
-
signature:
|
|
479
|
+
messageBytes: i.bytes,
|
|
480
|
+
signature: i.signature
|
|
481
481
|
};
|
|
482
482
|
}
|
|
483
|
-
async function
|
|
484
|
-
const
|
|
483
|
+
async function iA(M, A) {
|
|
484
|
+
const i = PM(A);
|
|
485
485
|
try {
|
|
486
486
|
return await M.request({
|
|
487
487
|
method: "wallet_invokeSnap",
|
|
488
488
|
params: {
|
|
489
|
-
snapId:
|
|
489
|
+
snapId: Y,
|
|
490
490
|
request: {
|
|
491
491
|
method: "signTransactionBlock",
|
|
492
|
-
params: JSON.parse(JSON.stringify(
|
|
492
|
+
params: JSON.parse(JSON.stringify(i))
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
495
|
});
|
|
496
|
-
} catch (
|
|
497
|
-
throw K(
|
|
496
|
+
} catch (t) {
|
|
497
|
+
throw K(t);
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
async function
|
|
501
|
-
const
|
|
500
|
+
async function tA(M, A) {
|
|
501
|
+
const i = vM(A);
|
|
502
502
|
try {
|
|
503
503
|
return await M.request({
|
|
504
504
|
method: "wallet_invokeSnap",
|
|
505
505
|
params: {
|
|
506
|
-
snapId:
|
|
506
|
+
snapId: Y,
|
|
507
507
|
request: {
|
|
508
508
|
method: "signAndExecuteTransactionBlock",
|
|
509
|
-
params: JSON.parse(JSON.stringify(
|
|
509
|
+
params: JSON.parse(JSON.stringify(i))
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
512
|
});
|
|
513
|
-
} catch (
|
|
514
|
-
throw K(
|
|
513
|
+
} catch (t) {
|
|
514
|
+
throw K(t);
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
|
-
async function
|
|
517
|
+
async function IA() {
|
|
518
518
|
const M = window.ethereum;
|
|
519
519
|
if (!M)
|
|
520
520
|
return {
|
|
@@ -529,47 +529,47 @@ async function Ii() {
|
|
|
529
529
|
supportsSnaps: !1
|
|
530
530
|
};
|
|
531
531
|
try {
|
|
532
|
-
const
|
|
532
|
+
const A = await M.request({ method: "web3_clientVersion" }), i = await M.request({ method: "wallet_getSnaps" }), t = !!i && "npm:@kunalabs-io/sui-metamask-snap" in i;
|
|
533
533
|
return {
|
|
534
534
|
available: !0,
|
|
535
|
-
version:
|
|
535
|
+
version: A,
|
|
536
536
|
supportsSnaps: !0,
|
|
537
|
-
suiSnapInstalled:
|
|
537
|
+
suiSnapInstalled: t
|
|
538
538
|
};
|
|
539
|
-
} catch (
|
|
540
|
-
return console.warn(
|
|
539
|
+
} catch (A) {
|
|
540
|
+
return console.warn(A), {
|
|
541
541
|
available: !0,
|
|
542
542
|
supportsSnaps: !1,
|
|
543
543
|
suiSnapInstalled: !1
|
|
544
544
|
};
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
|
-
var
|
|
547
|
+
var T, l, x, k, W, U, P, R, v, oM = class yM {
|
|
548
548
|
constructor() {
|
|
549
|
-
y(this,
|
|
550
|
-
if (r(this,
|
|
549
|
+
y(this, T, void 0), y(this, l, void 0), y(this, x, null), y(this, k, async () => {
|
|
550
|
+
if (r(this, T))
|
|
551
551
|
throw new Error("Already connecting");
|
|
552
|
-
a(this,
|
|
552
|
+
a(this, T, !0), a(this, l, !1);
|
|
553
553
|
try {
|
|
554
|
-
const
|
|
555
|
-
if (!(await
|
|
554
|
+
const A = window.ethereum;
|
|
555
|
+
if (!(await IA()).available)
|
|
556
556
|
throw new Error("MetaMask not detected!");
|
|
557
|
-
return await
|
|
557
|
+
return await A.request({
|
|
558
558
|
method: "wallet_requestSnaps",
|
|
559
559
|
params: {
|
|
560
|
-
[
|
|
560
|
+
[Y]: {
|
|
561
561
|
version: _M
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
|
-
}), a(this, x, await
|
|
564
|
+
}), a(this, x, await MA(A)), a(this, T, !1), a(this, l, !0), {
|
|
565
565
|
accounts: this.accounts
|
|
566
566
|
};
|
|
567
|
-
} catch (
|
|
568
|
-
throw a(this,
|
|
567
|
+
} catch (A) {
|
|
568
|
+
throw a(this, T, !1), a(this, l, !1), A;
|
|
569
569
|
}
|
|
570
|
-
}), y(this,
|
|
571
|
-
a(this,
|
|
572
|
-
}), y(this,
|
|
570
|
+
}), y(this, W, async () => {
|
|
571
|
+
a(this, T, !1), a(this, l, !1), a(this, x, null);
|
|
572
|
+
}), y(this, U, async (A) => LM(window.ethereum, A)), y(this, P, async (A) => AA(window.ethereum, A)), y(this, R, async (A) => iA(window.ethereum, A)), y(this, v, async (A) => tA(window.ethereum, A)), a(this, T, !1), a(this, l, !1);
|
|
573
573
|
}
|
|
574
574
|
get version() {
|
|
575
575
|
return "1.0.0";
|
|
@@ -584,24 +584,24 @@ var l, T, x, B, U, W, P, R, v, oM = class yM {
|
|
|
584
584
|
return XM;
|
|
585
585
|
}
|
|
586
586
|
get connecting() {
|
|
587
|
-
return r(this,
|
|
587
|
+
return r(this, T);
|
|
588
588
|
}
|
|
589
589
|
get accounts() {
|
|
590
|
-
return r(this,
|
|
590
|
+
return r(this, l) && r(this, x) ? r(this, x) : [];
|
|
591
591
|
}
|
|
592
592
|
get features() {
|
|
593
593
|
return {
|
|
594
594
|
"standard:connect": {
|
|
595
595
|
version: "1.0.0",
|
|
596
|
-
connect: r(this,
|
|
596
|
+
connect: r(this, k)
|
|
597
597
|
},
|
|
598
598
|
"standard:disconnect": {
|
|
599
599
|
version: "1.0.0",
|
|
600
|
-
disconnect: r(this,
|
|
600
|
+
disconnect: r(this, W)
|
|
601
601
|
},
|
|
602
602
|
"sui:signPersonalMessage": {
|
|
603
603
|
version: "1.0.0",
|
|
604
|
-
signPersonalMessage: r(this,
|
|
604
|
+
signPersonalMessage: r(this, U)
|
|
605
605
|
},
|
|
606
606
|
"sui:signMessage": {
|
|
607
607
|
version: "1.0.0",
|
|
@@ -623,19 +623,19 @@ var l, T, x, B, U, W, P, R, v, oM = class yM {
|
|
|
623
623
|
};
|
|
624
624
|
}
|
|
625
625
|
};
|
|
626
|
-
l = /* @__PURE__ */ new WeakMap();
|
|
627
626
|
T = /* @__PURE__ */ new WeakMap();
|
|
627
|
+
l = /* @__PURE__ */ new WeakMap();
|
|
628
628
|
x = /* @__PURE__ */ new WeakMap();
|
|
629
|
-
|
|
630
|
-
U = /* @__PURE__ */ new WeakMap();
|
|
629
|
+
k = /* @__PURE__ */ new WeakMap();
|
|
631
630
|
W = /* @__PURE__ */ new WeakMap();
|
|
631
|
+
U = /* @__PURE__ */ new WeakMap();
|
|
632
632
|
P = /* @__PURE__ */ new WeakMap();
|
|
633
633
|
R = /* @__PURE__ */ new WeakMap();
|
|
634
634
|
v = /* @__PURE__ */ new WeakMap();
|
|
635
635
|
D(oM, "NAME", "Sui MetaMask Snap");
|
|
636
636
|
var eM = oM, N;
|
|
637
637
|
(function(M) {
|
|
638
|
-
M.SUI_WALLET = "Sui Wallet", M.SUIET_WALLET = "Suiet", M.ETHOS_WALLET = "Ethos Wallet", M.SURF_WALLET = "Surf Wallet", M.GLASS_WALLET = "GlassWallet", M.MORPHIS_WALLET = "Morphis Wallet", M.MARTIAN_WALLET = "Martian Sui Wallet", M.ONEKEY_WALLET = "OneKey Wallet", M.SPACECY_WALLET = "Spacecy Sui Wallet", M.NIGHTLY_WALLET = "Nightly Wallet", M.BITGET_WALLET = "Bitget Wallet", M.OKX_WALLET = "OKX Wallet", M.SUI_SNAP_WALLET = "Sui MetaMask Snap";
|
|
638
|
+
M.SUI_WALLET = "Sui Wallet", M.SUIET_WALLET = "Suiet", M.ETHOS_WALLET = "Ethos Wallet", M.SURF_WALLET = "Surf Wallet", M.GLASS_WALLET = "GlassWallet", M.MORPHIS_WALLET = "Morphis Wallet", M.MARTIAN_WALLET = "Martian Sui Wallet", M.ONEKEY_WALLET = "OneKey Wallet", M.SPACECY_WALLET = "Spacecy Sui Wallet", M.NIGHTLY_WALLET = "Nightly Wallet", M.BITGET_WALLET = "Bitget Wallet", M.OKX_WALLET = "OKX Wallet", M.SUI_SNAP_WALLET = "Sui MetaMask Snap", M.PHANTOM_WALLET = "Phantom";
|
|
639
639
|
})(N || (N = {}));
|
|
640
640
|
const J = {
|
|
641
641
|
[N.BITGET_WALLET]: {
|
|
@@ -689,8 +689,12 @@ const J = {
|
|
|
689
689
|
[N.SUI_SNAP_WALLET]: {
|
|
690
690
|
icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIGlkPSJMYXllcl8xIiB4PSIwIiB5PSIwIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAzMTguNiAzMTguNiI+CiAgPHN0eWxlPgogICAgLnN0MSwuc3Q2e2ZpbGw6I2U0NzYxYjtzdHJva2U6I2U0NzYxYjtzdHJva2UtbGluZWNhcDpyb3VuZDtzdHJva2UtbGluZWpvaW46cm91bmR9LnN0NntmaWxsOiNmNjg1MWI7c3Ryb2tlOiNmNjg1MWJ9CiAgPC9zdHlsZT4KICA8cGF0aCBmaWxsPSIjZTI3NjFiIiBzdHJva2U9IiNlMjc2MWIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0ibTI3NC4xIDM1LjUtOTkuNSA3My45TDE5MyA2NS44eiIvPgogIDxwYXRoIGQ9Im00NC40IDM1LjUgOTguNyA3NC42LTE3LjUtNDQuM3ptMTkz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
|
+
url: "https://phantom.com/"
|
|
692
696
|
}
|
|
693
|
-
},
|
|
697
|
+
}, gM = {
|
|
694
698
|
icon: J[N.SUI_WALLET].icon,
|
|
695
699
|
url: "https://sui.io"
|
|
696
700
|
};
|
|
@@ -698,87 +702,87 @@ var L;
|
|
|
698
702
|
(function(M) {
|
|
699
703
|
M.STANDARD__CONNECT = "standard:connect", M.STANDARD__DISCONNECT = "standard:disconnect", M.STANDARD__EVENTS = "standard:events", M.SUI__SIGN_AND_EXECUTE_TRANSACTION_BLOCK = "sui:signAndExecuteTransactionBlock", M.SUI__SIGN_TRANSACTION_BLOCK = "sui:signTransactionBlock", M.SUI__SIGN_MESSAGE = "sui:signMessage";
|
|
700
704
|
})(L || (L = {}));
|
|
701
|
-
const
|
|
702
|
-
class
|
|
703
|
-
constructor(
|
|
704
|
-
super(), this.wallet =
|
|
705
|
+
const eA = ["OKX", "Bitget"];
|
|
706
|
+
class gA extends CM {
|
|
707
|
+
constructor(A, i) {
|
|
708
|
+
super(), this.wallet = A, this.connection = i, this.accounts = [], eA.find((t) => A.name.includes(t)) ? this._name = A.name : this._name = A.name.replace("Wallet", "").trim();
|
|
705
709
|
}
|
|
706
710
|
async connect() {
|
|
707
|
-
const { connect:
|
|
708
|
-
return this.accounts = [...
|
|
711
|
+
const { connect: A } = this.getFeature(L.STANDARD__CONNECT), { accounts: i } = await A();
|
|
712
|
+
return this.accounts = [...i], this.activeAccount = i[0], this.emit("connect"), this.accounts.map((t) => t.address);
|
|
709
713
|
}
|
|
710
714
|
async disconnect() {
|
|
711
|
-
const { disconnect:
|
|
712
|
-
|
|
715
|
+
const { disconnect: A } = this.getFeature(L.STANDARD__DISCONNECT, !1) || {};
|
|
716
|
+
A && await A(), this.accounts = [], this.emit("disconnect");
|
|
713
717
|
}
|
|
714
|
-
signTransaction(
|
|
718
|
+
signTransaction(A) {
|
|
715
719
|
if (!this.activeAccount)
|
|
716
720
|
throw new q();
|
|
717
|
-
const { signTransactionBlock:
|
|
718
|
-
return
|
|
719
|
-
transactionBlock:
|
|
721
|
+
const { signTransactionBlock: i } = this.getFeature(L.SUI__SIGN_TRANSACTION_BLOCK);
|
|
722
|
+
return i({
|
|
723
|
+
transactionBlock: A,
|
|
720
724
|
account: this.activeAccount,
|
|
721
725
|
chain: this.activeAccount.chains[0]
|
|
722
726
|
});
|
|
723
727
|
}
|
|
724
|
-
async sendTransaction(
|
|
728
|
+
async sendTransaction(A) {
|
|
725
729
|
if (!this.connection)
|
|
726
730
|
throw new Error("Connection not provided");
|
|
727
|
-
const
|
|
728
|
-
signature:
|
|
729
|
-
transactionBlock:
|
|
731
|
+
const t = await new EM(this.connection).executeTransactionBlock({
|
|
732
|
+
signature: A.signature,
|
|
733
|
+
transactionBlock: A.transactionBlockBytes
|
|
730
734
|
});
|
|
731
735
|
return {
|
|
732
|
-
id:
|
|
733
|
-
data:
|
|
736
|
+
id: t.digest,
|
|
737
|
+
data: t
|
|
734
738
|
};
|
|
735
739
|
}
|
|
736
|
-
async signAndSendTransaction(
|
|
740
|
+
async signAndSendTransaction(A) {
|
|
737
741
|
if (!this.activeAccount)
|
|
738
742
|
throw new q();
|
|
739
|
-
const { signAndExecuteTransactionBlock:
|
|
740
|
-
...
|
|
743
|
+
const { signAndExecuteTransactionBlock: i } = this.getFeature(L.SUI__SIGN_AND_EXECUTE_TRANSACTION_BLOCK), t = await i({
|
|
744
|
+
...A,
|
|
741
745
|
account: this.activeAccount,
|
|
742
746
|
chain: this.activeAccount.chains[0]
|
|
743
747
|
});
|
|
744
748
|
return {
|
|
745
|
-
id:
|
|
746
|
-
data:
|
|
749
|
+
id: t.digest,
|
|
750
|
+
data: t
|
|
747
751
|
};
|
|
748
752
|
}
|
|
749
753
|
getName() {
|
|
750
754
|
return this._name;
|
|
751
755
|
}
|
|
752
756
|
getUrl() {
|
|
753
|
-
const
|
|
754
|
-
return (
|
|
757
|
+
const A = J[this.wallet.name];
|
|
758
|
+
return (A == null ? void 0 : A.url) || gM.url;
|
|
755
759
|
}
|
|
756
760
|
getChainId() {
|
|
757
761
|
return _;
|
|
758
762
|
}
|
|
759
763
|
getAddress() {
|
|
760
|
-
var
|
|
761
|
-
return (
|
|
764
|
+
var A;
|
|
765
|
+
return (A = this.activeAccount) == null ? void 0 : A.address;
|
|
762
766
|
}
|
|
763
767
|
getAddresses() {
|
|
764
|
-
return this.accounts.map((
|
|
768
|
+
return this.accounts.map((A) => A.address);
|
|
765
769
|
}
|
|
766
|
-
setMainAddress(
|
|
767
|
-
const
|
|
768
|
-
if (!
|
|
770
|
+
setMainAddress(A) {
|
|
771
|
+
const i = this.accounts.find((t) => t.address === A);
|
|
772
|
+
if (!i)
|
|
769
773
|
throw new Error("Account not found");
|
|
770
|
-
this.activeAccount =
|
|
774
|
+
this.activeAccount = i;
|
|
771
775
|
}
|
|
772
776
|
getBalance() {
|
|
773
777
|
throw new Error("Method not implemented.");
|
|
774
778
|
}
|
|
775
|
-
signMessage(
|
|
776
|
-
const { signMessage:
|
|
777
|
-
return
|
|
779
|
+
signMessage(A) {
|
|
780
|
+
const { signMessage: i } = this.getFeature(L.SUI__SIGN_MESSAGE);
|
|
781
|
+
return i(A);
|
|
778
782
|
}
|
|
779
783
|
getIcon() {
|
|
780
|
-
const
|
|
781
|
-
return (
|
|
784
|
+
const A = J[this.wallet.name];
|
|
785
|
+
return (A == null ? void 0 : A.icon) || gM.icon;
|
|
782
786
|
}
|
|
783
787
|
isConnected() {
|
|
784
788
|
return this.accounts.length > 0;
|
|
@@ -786,49 +790,49 @@ class ni extends CM {
|
|
|
786
790
|
getNetworkInfo() {
|
|
787
791
|
return this.activeAccount ? { chain: this.activeAccount.chains[0] } : void 0;
|
|
788
792
|
}
|
|
789
|
-
getFeature(
|
|
790
|
-
const
|
|
791
|
-
if (!
|
|
792
|
-
throw new
|
|
793
|
-
return
|
|
793
|
+
getFeature(A, i = !0) {
|
|
794
|
+
const t = this.wallet.features[A];
|
|
795
|
+
if (!t && i)
|
|
796
|
+
throw new zM();
|
|
797
|
+
return t;
|
|
794
798
|
}
|
|
795
799
|
getFeatures() {
|
|
796
|
-
const
|
|
797
|
-
return this.wallet.features[L.SUI__SIGN_TRANSACTION_BLOCK] &&
|
|
800
|
+
const A = [O.SendTransaction];
|
|
801
|
+
return this.wallet.features[L.SUI__SIGN_TRANSACTION_BLOCK] && A.push(O.SignTransaction), this.wallet.features[L.SUI__SIGN_AND_EXECUTE_TRANSACTION_BLOCK] && A.push(O.SignAndSendTransaction), this.wallet.features[L.SUI__SIGN_MESSAGE] && A.push(O.SignMessage), A;
|
|
798
802
|
}
|
|
799
|
-
supportsChain(
|
|
800
|
-
return
|
|
803
|
+
supportsChain(A) {
|
|
804
|
+
return A === _;
|
|
801
805
|
}
|
|
802
806
|
}
|
|
803
|
-
const
|
|
804
|
-
const { features:
|
|
805
|
-
return Object.entries(
|
|
806
|
-
},
|
|
807
|
-
const { timeout:
|
|
807
|
+
const nA = 250, sA = (M) => {
|
|
808
|
+
const { features: A } = M;
|
|
809
|
+
return Object.entries(A).some(([i]) => i.startsWith("sui:"));
|
|
810
|
+
}, cA = async (M = {}) => {
|
|
811
|
+
const { timeout: A = nA, connection: i } = M, t = nM(), I = [...t.get()];
|
|
808
812
|
return new Promise((e) => {
|
|
809
|
-
let
|
|
810
|
-
const
|
|
811
|
-
|
|
812
|
-
},
|
|
813
|
-
let
|
|
814
|
-
|
|
815
|
-
I.push(
|
|
813
|
+
let s;
|
|
814
|
+
const c = () => setTimeout(() => {
|
|
815
|
+
s && s(), e(I.filter(sA).map((g) => new gA(g, i)));
|
|
816
|
+
}, A);
|
|
817
|
+
let n = c();
|
|
818
|
+
s = t.on("register", (g) => {
|
|
819
|
+
I.push(g), clearTimeout(n), n = c();
|
|
816
820
|
});
|
|
817
821
|
});
|
|
818
822
|
};
|
|
819
823
|
$M();
|
|
820
|
-
async function
|
|
821
|
-
return (await
|
|
824
|
+
async function aA() {
|
|
825
|
+
return (await cA({ timeout: 0 })).reduce((A, i) => (A[i.getName()] = i, A), {});
|
|
822
826
|
}
|
|
823
|
-
const
|
|
824
|
-
if (!
|
|
827
|
+
const rA = async (M, A) => {
|
|
828
|
+
if (!A || !A.signAndSendTransaction)
|
|
825
829
|
throw new Error("wallet.signAndSendTransaction is undefined");
|
|
826
|
-
return await
|
|
830
|
+
return await A.signAndSendTransaction({
|
|
827
831
|
/* @ts-ignore */
|
|
828
832
|
transactionBlock: M.transaction
|
|
829
833
|
});
|
|
830
834
|
};
|
|
831
835
|
export {
|
|
832
|
-
|
|
833
|
-
|
|
836
|
+
aA as fetchOptions,
|
|
837
|
+
rA as signAndSendTransaction
|
|
834
838
|
};
|