@otoplo/wallet-common 0.1.11 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +42 -15
- package/dist/index.js +202 -199
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/utils/price.ts +21 -15
package/dist/index.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { AddressType as E, Networks as k, Address as
|
|
2
|
-
import { ElectrumClient as Ee, TransportScheme as L, ConnectionStatus as
|
|
3
|
-
import { mnemonicToSeedSync as
|
|
1
|
+
import { AddressType as E, Networks as k, Address as S, CommonUtils as W, BufferUtils as y, HDPrivateKey as Z, GroupToken as O, GroupIdType as I, TransactionBuilder as Q, Transaction as C, UnitUtils as ee, Script as A, Opcode as v, Hash as U, ScriptOpcode as q, BNExtended as z, Output as Ie, TxSigner as te, SighashType as se, ScriptFactory as xe, OutputSighashType as ae, BufferWriter as Ne } from "libnexa-ts";
|
|
2
|
+
import { ElectrumClient as Ee, TransportScheme as L, ConnectionStatus as Be } from "@otoplo/electrum-client";
|
|
3
|
+
import { mnemonicToSeedSync as Ce, generateMnemonic as Me, validateMnemonic as Pe } from "@scure/bip39";
|
|
4
4
|
import _e from "jszip";
|
|
5
5
|
import { DAppProvider as Oe } from "wallet-comms-sdk";
|
|
6
6
|
import { wordlist as de } from "@scure/bip39/wordlists/english.js";
|
|
7
|
-
import { createSlice as
|
|
7
|
+
import { createSlice as B, createAsyncThunk as Ue, createSelector as j } from "@reduxjs/toolkit";
|
|
8
8
|
import { useSelector as De } from "react-redux";
|
|
9
|
-
const
|
|
9
|
+
const g = -1, ne = 9223372036854775807n, Ve = 274710, St = "0014461ad25081cb0119d034385ff154c8d3ad6bdd76";
|
|
10
10
|
function T() {
|
|
11
11
|
return k.defaultNetwork == k.testnet;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function kt(a) {
|
|
14
14
|
return T() ? a == "508c843a4b98fb25f57cf9ebafb245a5c16468f06519cdd467059a91e7b79d52" : a == "edc7144fe1ba4edd0edf35d7eea90f6cb1dba42314aa85da8207e97c5339c801";
|
|
15
15
|
}
|
|
16
16
|
function F(a, e = E.PayToScriptTemplate) {
|
|
17
|
-
return
|
|
17
|
+
return S.isValid(a, k.defaultNetwork, e);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Tt() {
|
|
20
20
|
return `https://${T() ? "testnet-" : ""}explorer.nexa.org`;
|
|
21
21
|
}
|
|
22
22
|
function $() {
|
|
23
23
|
return Math.floor(Date.now() / 1e3);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function It(a, e) {
|
|
26
26
|
const t = (e - a) * 2, s = /* @__PURE__ */ new Date();
|
|
27
27
|
return s.setMinutes(s.getMinutes() + t), s.toLocaleDateString();
|
|
28
28
|
}
|
|
29
29
|
function P(a) {
|
|
30
30
|
return !a || a.length === 0;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function xt(a, e = 0) {
|
|
33
33
|
if (!a || a.length <= e)
|
|
34
34
|
return a || "";
|
|
35
35
|
const t = "...", s = Math.floor((e - t.length) / 2), n = a.slice(0, s), i = a.slice(a.length - s);
|
|
36
36
|
return n + t + i;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function Nt(a) {
|
|
39
39
|
return a.length === 0 ? "" : a.charAt(0).toUpperCase() + a.substring(1);
|
|
40
40
|
}
|
|
41
41
|
function R(a) {
|
|
42
|
-
return W.isHexa(a) ?
|
|
42
|
+
return W.isHexa(a) ? y.hexToBuffer(a) : S.fromString(a).data;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
return W.isHexa(a) ? a :
|
|
44
|
+
function b(a) {
|
|
45
|
+
return W.isHexa(a) ? a : y.bufferToHex(R(a));
|
|
46
46
|
}
|
|
47
47
|
function ie(a) {
|
|
48
|
-
return W.isHexa(a) ? new
|
|
48
|
+
return W.isHexa(a) ? new S(R(a), k.defaultNetwork, E.GroupIdAddress).toString() : a;
|
|
49
49
|
}
|
|
50
50
|
function D(a) {
|
|
51
51
|
return a == null || a === "" ? "" : BigInt(a) <= 0n ? "0" : a.toString();
|
|
@@ -86,19 +86,19 @@ const ue = {
|
|
|
86
86
|
".wav": { media: "audio", mime: "audio/wav" },
|
|
87
87
|
".m4a": { media: "audio", mime: "audio/mp4" }
|
|
88
88
|
};
|
|
89
|
-
function
|
|
89
|
+
function Et(a) {
|
|
90
90
|
const e = a.lastIndexOf(".");
|
|
91
91
|
if (e === -1) return "unknown";
|
|
92
92
|
const t = a.slice(e).toLowerCase();
|
|
93
93
|
return ue[t]?.media ?? "unknown";
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function Bt(a) {
|
|
96
96
|
const e = a.lastIndexOf(".");
|
|
97
97
|
if (e === -1) return "application/octet-stream";
|
|
98
98
|
const t = a.slice(e).toLowerCase();
|
|
99
99
|
return ue[t]?.mime ?? "application/octet-stream";
|
|
100
100
|
}
|
|
101
|
-
class
|
|
101
|
+
class Ct {
|
|
102
102
|
getPrefix() {
|
|
103
103
|
return T() ? "testnet-" : "";
|
|
104
104
|
}
|
|
@@ -183,8 +183,8 @@ class Mt {
|
|
|
183
183
|
await this.setValue("auto-lock", `${e}`);
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
var f = /* @__PURE__ */ ((a) => (a[a.MAIN = 0] = "MAIN", a[a.VAULT = 1] = "VAULT", a[a.DAPP = 2] = "DAPP", a))(f || {}), m = /* @__PURE__ */ ((a) => (a[a.RECEIVE = 0] = "RECEIVE", a[a.CHANGE = 1] = "CHANGE", a))(m || {}),
|
|
187
|
-
class
|
|
186
|
+
var f = /* @__PURE__ */ ((a) => (a[a.MAIN = 0] = "MAIN", a[a.VAULT = 1] = "VAULT", a[a.DAPP = 2] = "DAPP", a))(f || {}), m = /* @__PURE__ */ ((a) => (a[a.RECEIVE = 0] = "RECEIVE", a[a.CHANGE = 1] = "CHANGE", a))(m || {}), M = /* @__PURE__ */ ((a) => (a.SignMessage = "signMessage", a.AddToken = "addToken", a.SignTransaction = "signTransaction", a.SendTransaction = "sendTransaction", a))(M || {}), V = /* @__PURE__ */ ((a) => (a.TOKEN = "token", a.NFT = "nft", a))(V || {});
|
|
187
|
+
class Mt {
|
|
188
188
|
store;
|
|
189
189
|
updateCallback;
|
|
190
190
|
constructor(e) {
|
|
@@ -358,7 +358,7 @@ class Bt {
|
|
|
358
358
|
return this.store.upsertVault(t);
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
class
|
|
361
|
+
class Pt {
|
|
362
362
|
walletDb;
|
|
363
363
|
tokens = /* @__PURE__ */ new Map();
|
|
364
364
|
nfts = /* @__PURE__ */ new Map();
|
|
@@ -369,22 +369,22 @@ class Ct {
|
|
|
369
369
|
this.tokens.clear(), this.nfts.clear();
|
|
370
370
|
}
|
|
371
371
|
async getTokenById(e) {
|
|
372
|
-
if (e =
|
|
372
|
+
if (e = b(e), this.tokens.has(e))
|
|
373
373
|
return this.tokens.get(e);
|
|
374
374
|
const t = await this.walletDb.getToken(e);
|
|
375
375
|
return t && this.tokens.set(e, t), t;
|
|
376
376
|
}
|
|
377
377
|
async getNftById(e) {
|
|
378
|
-
if (e =
|
|
378
|
+
if (e = b(e), this.nfts.has(e))
|
|
379
379
|
return this.nfts.get(e);
|
|
380
380
|
const t = await this.walletDb.getLocalNft(e);
|
|
381
381
|
return t && this.nfts.set(e, t), t;
|
|
382
382
|
}
|
|
383
383
|
removeToken(e) {
|
|
384
|
-
this.tokens.delete(
|
|
384
|
+
this.tokens.delete(b(e));
|
|
385
385
|
}
|
|
386
386
|
removeNft(e) {
|
|
387
|
-
this.nfts.delete(
|
|
387
|
+
this.nfts.delete(b(e));
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
390
|
class le {
|
|
@@ -486,7 +486,7 @@ class le {
|
|
|
486
486
|
const t = Date.now();
|
|
487
487
|
return new Promise((s, n) => {
|
|
488
488
|
const i = () => {
|
|
489
|
-
if (this.client?.connectionStatus ==
|
|
489
|
+
if (this.client?.connectionStatus == Be.CONNECTED)
|
|
490
490
|
return s();
|
|
491
491
|
if (Date.now() - t > e)
|
|
492
492
|
return n(new Error("Rostrum Connection timeout"));
|
|
@@ -534,13 +534,13 @@ function Re(a) {
|
|
|
534
534
|
index: parseInt(e[2])
|
|
535
535
|
};
|
|
536
536
|
}
|
|
537
|
-
class
|
|
537
|
+
class _t {
|
|
538
538
|
seed;
|
|
539
539
|
masterKey;
|
|
540
540
|
accountKeys = /* @__PURE__ */ new Map();
|
|
541
541
|
walletKeys = /* @__PURE__ */ new Map();
|
|
542
542
|
init(e) {
|
|
543
|
-
this.seed = typeof e == "string" ?
|
|
543
|
+
this.seed = typeof e == "string" ? Ce(e) : e, this.masterKey = Z.fromSeed(this.seed).deriveChild(44, !0).deriveChild(29223, !0);
|
|
544
544
|
}
|
|
545
545
|
reset() {
|
|
546
546
|
if (!this.seed)
|
|
@@ -572,13 +572,13 @@ function he() {
|
|
|
572
572
|
decimals: 0
|
|
573
573
|
};
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function Ot(a) {
|
|
576
576
|
return Y(Le() + a, "raw");
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function J(a) {
|
|
579
579
|
try {
|
|
580
580
|
const e = R(a);
|
|
581
|
-
return O.isSubgroup(e) ?
|
|
581
|
+
return O.isSubgroup(e) ? y.bufferToHex(e.subarray(0, 32)) === he().tokenIdHex : !1;
|
|
582
582
|
} catch {
|
|
583
583
|
return !1;
|
|
584
584
|
}
|
|
@@ -592,7 +592,7 @@ function Ke(a) {
|
|
|
592
592
|
function oe(a, e) {
|
|
593
593
|
return a && typeof a == "string" ? a.startsWith("http") ? a.replace("http://", "https://") : a.startsWith("ipfs://") ? a : `${new URL(e).origin}${a}` : "";
|
|
594
594
|
}
|
|
595
|
-
function
|
|
595
|
+
function Ut(a) {
|
|
596
596
|
return a ? X(a) : null;
|
|
597
597
|
}
|
|
598
598
|
function X(a, e = "https://ipfs.nebula.markets/") {
|
|
@@ -615,7 +615,7 @@ async function Y(a, e) {
|
|
|
615
615
|
throw new Error(`Unexpected Error: ${t}`);
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
class
|
|
618
|
+
class Dt {
|
|
619
619
|
walletDb;
|
|
620
620
|
rostrumService;
|
|
621
621
|
walletCache;
|
|
@@ -629,11 +629,11 @@ class Ut {
|
|
|
629
629
|
if (c)
|
|
630
630
|
return c;
|
|
631
631
|
}
|
|
632
|
-
const s = await this.rostrumService.getTokenGenesis(e), n =
|
|
632
|
+
const s = await this.rostrumService.getTokenGenesis(e), n = y.hexToBuffer(s.token_id_hex);
|
|
633
633
|
let i = "", o = "";
|
|
634
|
-
if (s.op_return_id == I.NRC2 || s.op_return_id == I.NRC3 ||
|
|
634
|
+
if (s.op_return_id == I.NRC2 || s.op_return_id == I.NRC3 || J(e))
|
|
635
635
|
return;
|
|
636
|
-
if (O.isSubgroup(n) && (i = new
|
|
636
|
+
if (O.isSubgroup(n) && (i = new S(O.getParentGroupId(n), k.defaultNetwork, E.GroupIdAddress).toString()), s.document_url)
|
|
637
637
|
try {
|
|
638
638
|
if (s.op_return_id == I.NRC1) {
|
|
639
639
|
const c = await Ke(s.document_url), u = (await _e.loadAsync(c)).file("info.json");
|
|
@@ -664,7 +664,7 @@ class Ut {
|
|
|
664
664
|
}
|
|
665
665
|
async isNftToken(e) {
|
|
666
666
|
try {
|
|
667
|
-
if (
|
|
667
|
+
if (J(e) || await this.walletCache.getNftById(e) || (await this.rostrumService.getTokenGenesis(e)).op_return_id == I.NRC3)
|
|
668
668
|
return !0;
|
|
669
669
|
} catch (t) {
|
|
670
670
|
console.error(t);
|
|
@@ -675,7 +675,7 @@ class Ut {
|
|
|
675
675
|
let t = await this.getTokenInfo(e);
|
|
676
676
|
return t || await this.isNftToken(e) && (t = {
|
|
677
677
|
token: ie(e),
|
|
678
|
-
tokenIdHex:
|
|
678
|
+
tokenIdHex: b(e),
|
|
679
679
|
decimals: 0
|
|
680
680
|
}), t;
|
|
681
681
|
}
|
|
@@ -694,10 +694,10 @@ class Ut {
|
|
|
694
694
|
if (i.op_return_id == I.NRC3) {
|
|
695
695
|
const o = R(t);
|
|
696
696
|
if (O.isSubgroup(o)) {
|
|
697
|
-
const r = new
|
|
697
|
+
const r = new S(o.subarray(0, 32), k.defaultNetwork, E.GroupIdAddress).toString(), c = await this.rostrumService.getTokenGenesis(r);
|
|
698
698
|
c?.op_return_id == I.NRC2 && await this.saveNft(e, t, i.document_url ?? "", r, s, c?.name ?? "");
|
|
699
699
|
}
|
|
700
|
-
} else
|
|
700
|
+
} else J(t) && await this.saveNft(e, t, "nifty", he().token, s, "");
|
|
701
701
|
}
|
|
702
702
|
async saveNft(e, t, s, n, i, o) {
|
|
703
703
|
if (s)
|
|
@@ -732,12 +732,12 @@ class Ut {
|
|
|
732
732
|
for (const r of o)
|
|
733
733
|
await i(r.tokenIdHex);
|
|
734
734
|
for (const [r, c] of Object.entries(t)) {
|
|
735
|
-
const d =
|
|
735
|
+
const d = b(r), u = c && BigInt(c.confirmed) + BigInt(c.unconfirmed) > 0n, l = n?.some((p) => p.tokenIdHex == d);
|
|
736
736
|
!u && !l || u && l || !await this.isNftToken(d) || (!u && l ? await i(d) : await this.handleNftReceive(e, d, $()));
|
|
737
737
|
}
|
|
738
738
|
}
|
|
739
739
|
}
|
|
740
|
-
class
|
|
740
|
+
class Vt {
|
|
741
741
|
rostrumService;
|
|
742
742
|
keyManager;
|
|
743
743
|
walletDb;
|
|
@@ -840,17 +840,17 @@ class Dt {
|
|
|
840
840
|
prepareTransaction(e, t, s, n) {
|
|
841
841
|
if (!F(e) && !F(e, E.PayToPublicKeyHash))
|
|
842
842
|
throw new Error("Invalid Address.");
|
|
843
|
-
if (s && BigInt(t) < 1n || !s && parseInt(t) <
|
|
843
|
+
if (s && BigInt(t) < 1n || !s && parseInt(t) < C.DUST_AMOUNT)
|
|
844
844
|
throw new Error("The amount is too low.");
|
|
845
|
-
if (s && BigInt(t) > ne || !s && parseInt(t) >
|
|
845
|
+
if (s && BigInt(t) > ne || !s && parseInt(t) > C.MAX_MONEY)
|
|
846
846
|
throw new Error("The amount is too high.");
|
|
847
847
|
const i = new Q();
|
|
848
848
|
if (n && i.addData(n), s) {
|
|
849
849
|
if (!F(s, E.GroupIdAddress))
|
|
850
850
|
throw new Error("Invalid Token ID");
|
|
851
|
-
if (
|
|
851
|
+
if (S.getOutputType(e) === 0)
|
|
852
852
|
throw new Error("Token must be sent to script template address");
|
|
853
|
-
i.to(e,
|
|
853
|
+
i.to(e, C.DUST_AMOUNT, s, BigInt(t));
|
|
854
854
|
} else
|
|
855
855
|
i.to(e, t);
|
|
856
856
|
return i;
|
|
@@ -911,7 +911,7 @@ class Dt {
|
|
|
911
911
|
throw new Error(JSON.stringify(c));
|
|
912
912
|
}
|
|
913
913
|
async populateTokenInputsAndChange(e, t, s, n, i) {
|
|
914
|
-
const o =
|
|
914
|
+
const o = b(n), r = t.filter((u) => Object.keys(u.tokensBalance).includes(o));
|
|
915
915
|
if (P(r))
|
|
916
916
|
throw new Error("Not enough token balance.");
|
|
917
917
|
const c = /* @__PURE__ */ new Map();
|
|
@@ -937,7 +937,7 @@ class Dt {
|
|
|
937
937
|
if (d == i)
|
|
938
938
|
return c;
|
|
939
939
|
if (d > i)
|
|
940
|
-
return e.to(s,
|
|
940
|
+
return e.to(s, C.DUST_AMOUNT, n, d - i), c;
|
|
941
941
|
}
|
|
942
942
|
}
|
|
943
943
|
throw new Error("Not enough token balance");
|
|
@@ -956,8 +956,8 @@ class Dt {
|
|
|
956
956
|
return JSON.stringify(t, null, 2);
|
|
957
957
|
}
|
|
958
958
|
}
|
|
959
|
-
function
|
|
960
|
-
return
|
|
959
|
+
function Rt(a = 12) {
|
|
960
|
+
return Me(de, a === 24 ? 256 : 128);
|
|
961
961
|
}
|
|
962
962
|
function Fe(a) {
|
|
963
963
|
return Pe(a, de);
|
|
@@ -986,19 +986,19 @@ async function fe(a, e) {
|
|
|
986
986
|
["encrypt", "decrypt"]
|
|
987
987
|
);
|
|
988
988
|
}
|
|
989
|
-
async function
|
|
990
|
-
const t =
|
|
989
|
+
async function Ht(a, e) {
|
|
990
|
+
const t = y.utf8ToBuffer(e), s = y.getRandomBuffer(16), n = y.getRandomBuffer(12), i = y.utf8ToBuffer(a), o = await fe(t, s), r = await crypto.subtle.encrypt(
|
|
991
991
|
{
|
|
992
992
|
name: "AES-GCM",
|
|
993
993
|
iv: new Uint8Array(n)
|
|
994
994
|
},
|
|
995
995
|
o,
|
|
996
996
|
new Uint8Array(i)
|
|
997
|
-
), c =
|
|
998
|
-
return
|
|
997
|
+
), c = y.concat([s, n, new Uint8Array(r)]);
|
|
998
|
+
return y.bufferToBase64(c);
|
|
999
999
|
}
|
|
1000
1000
|
async function Ge(a, e) {
|
|
1001
|
-
const t =
|
|
1001
|
+
const t = y.utf8ToBuffer(e), s = y.base64ToBuffer(a), n = s.slice(0, 16), i = s.slice(16, 28), o = s.slice(28), r = await fe(t, n), c = await crypto.subtle.decrypt(
|
|
1002
1002
|
{
|
|
1003
1003
|
name: "AES-GCM",
|
|
1004
1004
|
iv: i
|
|
@@ -1006,9 +1006,9 @@ async function Ge(a, e) {
|
|
|
1006
1006
|
r,
|
|
1007
1007
|
o
|
|
1008
1008
|
);
|
|
1009
|
-
return
|
|
1009
|
+
return y.bufferToUtf8(new Uint8Array(c));
|
|
1010
1010
|
}
|
|
1011
|
-
async function
|
|
1011
|
+
async function Kt(a, e) {
|
|
1012
1012
|
try {
|
|
1013
1013
|
if (a) {
|
|
1014
1014
|
const t = await Ge(a, e);
|
|
@@ -1020,55 +1020,57 @@ async function Ht(a, e) {
|
|
|
1020
1020
|
return !1;
|
|
1021
1021
|
}
|
|
1022
1022
|
}
|
|
1023
|
-
const pe =
|
|
1024
|
-
usd: "$",
|
|
1025
|
-
eur: "€",
|
|
1026
|
-
gbp: "£",
|
|
1027
|
-
cny: "¥",
|
|
1028
|
-
jpy: "¥",
|
|
1029
|
-
aud: "A$",
|
|
1030
|
-
cad: "C$",
|
|
1031
|
-
chf: "Fr"
|
|
1032
|
-
|
|
1023
|
+
const pe = [
|
|
1024
|
+
{ code: "usd", symbol: "$", name: "US Dollar" },
|
|
1025
|
+
{ code: "eur", symbol: "€", name: "Euro" },
|
|
1026
|
+
{ code: "gbp", symbol: "£", name: "British Pound" },
|
|
1027
|
+
{ code: "cny", symbol: "¥", name: "Chinese Yuan" },
|
|
1028
|
+
{ code: "jpy", symbol: "¥", name: "Japanese Yen" },
|
|
1029
|
+
{ code: "aud", symbol: "A$", name: "Australian Dollar" },
|
|
1030
|
+
{ code: "cad", symbol: "C$", name: "Canadian Dollar" },
|
|
1031
|
+
{ code: "chf", symbol: "Fr", name: "Swiss Franc" }
|
|
1032
|
+
], Je = Object.fromEntries(
|
|
1033
|
+
pe.map((a) => [a.code, a.symbol])
|
|
1034
|
+
), ye = pe.map((a) => a.code);
|
|
1033
1035
|
async function qe() {
|
|
1034
|
-
const a =
|
|
1036
|
+
const a = ye.join(","), e = await fetch(`https://api.coingecko.com/api/v3/simple/price?ids=nexacoin&include_24hr_change=true&vs_currencies=${a}`);
|
|
1035
1037
|
if (!e.ok)
|
|
1036
1038
|
throw new Error("Failed to fetch price");
|
|
1037
1039
|
return (await e.json()).nexacoin || {};
|
|
1038
1040
|
}
|
|
1039
|
-
function
|
|
1040
|
-
return
|
|
1041
|
+
function Lt(a) {
|
|
1042
|
+
return Je[a] || a;
|
|
1041
1043
|
}
|
|
1042
|
-
function
|
|
1044
|
+
function ge() {
|
|
1043
1045
|
const a = {};
|
|
1044
|
-
return
|
|
1046
|
+
return ye.forEach((e) => {
|
|
1045
1047
|
a[e] = { value: 0, change: 0 };
|
|
1046
1048
|
}), a;
|
|
1047
1049
|
}
|
|
1048
|
-
function
|
|
1050
|
+
function ze() {
|
|
1049
1051
|
return A.empty().add(v.OP_FROMALTSTACK).add(v.OP_DROP).add(v.OP_FROMALTSTACK).add(v.OP_CHECKLOCKTIMEVERIFY).add(v.OP_DROP).add(v.OP_FROMALTSTACK).add(v.OP_CHECKSIGVERIFY);
|
|
1050
1052
|
}
|
|
1051
|
-
function
|
|
1052
|
-
const a =
|
|
1053
|
+
function We() {
|
|
1054
|
+
const a = ze();
|
|
1053
1055
|
return U.sha256ripemd160(a.toBuffer());
|
|
1054
1056
|
}
|
|
1055
|
-
function
|
|
1057
|
+
function je(a) {
|
|
1056
1058
|
return A.empty().add(a.toBuffer());
|
|
1057
1059
|
}
|
|
1058
|
-
function
|
|
1059
|
-
const e =
|
|
1060
|
+
function $e(a) {
|
|
1061
|
+
const e = je(a);
|
|
1060
1062
|
return U.sha256ripemd160(e.toBuffer());
|
|
1061
1063
|
}
|
|
1062
|
-
function
|
|
1063
|
-
return a.map((e) => e <= 16 ?
|
|
1064
|
+
function Xe(a) {
|
|
1065
|
+
return a.map((e) => e <= 16 ? q.smallInt(e) : z.fromNumber(e).toScriptNumBuffer());
|
|
1064
1066
|
}
|
|
1065
|
-
function
|
|
1067
|
+
function Ye(a, e) {
|
|
1066
1068
|
if (e.length !== 2)
|
|
1067
1069
|
return;
|
|
1068
|
-
const t =
|
|
1069
|
-
return
|
|
1070
|
+
const t = We(), s = $e(a), n = Xe(e);
|
|
1071
|
+
return S.fromScriptTemplate(t, s, n).toString();
|
|
1070
1072
|
}
|
|
1071
|
-
class
|
|
1073
|
+
class Ft {
|
|
1072
1074
|
walletDb;
|
|
1073
1075
|
keyManager;
|
|
1074
1076
|
providers;
|
|
@@ -1102,7 +1104,7 @@ class Lt {
|
|
|
1102
1104
|
}
|
|
1103
1105
|
async reload(e) {
|
|
1104
1106
|
for (const t of e.values()) {
|
|
1105
|
-
if (t.id ==
|
|
1107
|
+
if (t.id == g)
|
|
1106
1108
|
continue;
|
|
1107
1109
|
const s = await this.walletDb.getAccountSessions(t.id), n = this.providers.get(t.id), i = s.map(async (r) => {
|
|
1108
1110
|
if (n?.has(r.sessionId))
|
|
@@ -1175,7 +1177,7 @@ class Lt {
|
|
|
1175
1177
|
const n = (i, o) => new Promise((r, c) => {
|
|
1176
1178
|
this.handlers.set(i, { resolve: r, reject: c }), this.notify({ type: "new_request", request: { type: i, accountId: e.id, sessionId: s, request: o } });
|
|
1177
1179
|
});
|
|
1178
|
-
t.onSignMessage((i) => n(
|
|
1180
|
+
t.onSignMessage((i) => n(M.SignMessage, i)), t.onAddToken((i) => n(M.AddToken, i)), t.onSendTransaction((i) => n(M.SendTransaction, i)), t.onSignTransaction((i) => n(M.SignTransaction, i)), t.onGetAccount(() => {
|
|
1179
1181
|
const i = { account: f.DAPP, type: m.RECEIVE, index: e.id };
|
|
1180
1182
|
return {
|
|
1181
1183
|
name: e.name,
|
|
@@ -1193,7 +1195,7 @@ class Lt {
|
|
|
1193
1195
|
});
|
|
1194
1196
|
}
|
|
1195
1197
|
}
|
|
1196
|
-
class
|
|
1198
|
+
class Gt {
|
|
1197
1199
|
rostrumService;
|
|
1198
1200
|
keyManager;
|
|
1199
1201
|
assetService;
|
|
@@ -1210,7 +1212,7 @@ class Ft {
|
|
|
1210
1212
|
address: t.address,
|
|
1211
1213
|
privateKey: this.keyManager.getKey(t.keyPath).privateKey,
|
|
1212
1214
|
txDetails: {
|
|
1213
|
-
tx: new
|
|
1215
|
+
tx: new C(e),
|
|
1214
1216
|
send: [],
|
|
1215
1217
|
receive: []
|
|
1216
1218
|
},
|
|
@@ -1234,7 +1236,7 @@ class Ft {
|
|
|
1234
1236
|
await Promise.all(t);
|
|
1235
1237
|
}
|
|
1236
1238
|
async processInput(e, t) {
|
|
1237
|
-
const s = e.txDetails.tx.inputs[t], n = await this.rostrumService.getUtxo(
|
|
1239
|
+
const s = e.txDetails.tx.inputs[t], n = await this.rostrumService.getUtxo(y.bufferToHex(s.outpoint));
|
|
1238
1240
|
if (n.status == "spent")
|
|
1239
1241
|
throw new Error("Input UTXO is already spent.");
|
|
1240
1242
|
if (s.output = new Ie(n.amount, n.scriptpubkey), s.output.address == e.address) {
|
|
@@ -1253,7 +1255,7 @@ class Ft {
|
|
|
1253
1255
|
const s = e.txDetails.tx.outputs[t].toObject();
|
|
1254
1256
|
if (s.address !== e.address)
|
|
1255
1257
|
continue;
|
|
1256
|
-
const n = s.groupId ?
|
|
1258
|
+
const n = s.groupId ? b(s.groupId) : "NEXA", i = {
|
|
1257
1259
|
address: s.address,
|
|
1258
1260
|
nexaAmount: s.value.toString(),
|
|
1259
1261
|
assetId: n,
|
|
@@ -1291,7 +1293,7 @@ class Ft {
|
|
|
1291
1293
|
if (!e.scriptSig.isScriptTemplateIn())
|
|
1292
1294
|
throw new Error("Unsupported input script type.");
|
|
1293
1295
|
const t = e.output.scriptPubKey.getTemplateHash(), s = e.scriptSig.chunks[0].buf;
|
|
1294
|
-
if (
|
|
1296
|
+
if (y.equals(t, U.sha256ripemd160(s)) || y.equals(t, U.sha256sha256(s)))
|
|
1295
1297
|
return A.fromBuffer(s);
|
|
1296
1298
|
throw new Error("Invalid input script template.");
|
|
1297
1299
|
}
|
|
@@ -1333,8 +1335,8 @@ class Ft {
|
|
|
1333
1335
|
}
|
|
1334
1336
|
}
|
|
1335
1337
|
}
|
|
1336
|
-
const
|
|
1337
|
-
class
|
|
1338
|
+
const Ze = 274710, Qe = "0014461ad25081cb0119d034385ff154c8d3ad6bdd76";
|
|
1339
|
+
class et {
|
|
1338
1340
|
rostrumService;
|
|
1339
1341
|
keyManager;
|
|
1340
1342
|
constructor(e, t) {
|
|
@@ -1367,16 +1369,16 @@ class Qe {
|
|
|
1367
1369
|
}), n;
|
|
1368
1370
|
}
|
|
1369
1371
|
async checkVaultsForAddress(e) {
|
|
1370
|
-
const t = /* @__PURE__ */ new Set(), s = await this.rostrumService.getTransactionsHistory(e,
|
|
1372
|
+
const t = /* @__PURE__ */ new Set(), s = await this.rostrumService.getTransactionsHistory(e, Ze);
|
|
1371
1373
|
for (const n of s) {
|
|
1372
|
-
const o = (await this.rostrumService.getTransaction(n.tx_hash)).vout.filter((r) => r.scriptPubKey.hex.startsWith(
|
|
1374
|
+
const o = (await this.rostrumService.getTransaction(n.tx_hash)).vout.filter((r) => r.scriptPubKey.hex.startsWith(Qe));
|
|
1373
1375
|
for (const r of o)
|
|
1374
1376
|
t.add(r.scriptPubKey.hex);
|
|
1375
1377
|
}
|
|
1376
1378
|
return t;
|
|
1377
1379
|
}
|
|
1378
1380
|
parseVaultDetails(e) {
|
|
1379
|
-
const t = A.fromHex(e), s = new Ne().writeVarLengthBuf(t.toBuffer()).toBuffer(), n = new
|
|
1381
|
+
const t = A.fromHex(e), s = new Ne().writeVarLengthBuf(t.toBuffer()).toBuffer(), n = new S(s).toString(), i = t.getVisibleArgs(), o = z.fromScriptNumBuffer(i.chunks[0].buf).toNumber(), r = q.isSmallIntOp(i.chunks[1].opcodenum) ? q.decodeOP_N(i.chunks[1].opcodenum) : z.fromScriptNumBuffer(i.chunks[1].buf).toNumber(), c = [o, r], d = this.keyManager.getKey({ account: f.VAULT, type: m.RECEIVE, index: r }), u = Ye(d.publicKey, c);
|
|
1380
1382
|
return n != u ? void 0 : {
|
|
1381
1383
|
address: n,
|
|
1382
1384
|
block: o,
|
|
@@ -1391,7 +1393,7 @@ class Qe {
|
|
|
1391
1393
|
}
|
|
1392
1394
|
class N {
|
|
1393
1395
|
constructor(e, t, s, n, i, o, r) {
|
|
1394
|
-
this.keyManager = e, this.kvStore = t, this.walletDb = s, this.rostrumService = n, this.assetService = i, this.transactionService = o, this.sessionManager = r, this.discoveryService = new
|
|
1396
|
+
this.keyManager = e, this.kvStore = t, this.walletDb = s, this.rostrumService = n, this.assetService = i, this.transactionService = o, this.sessionManager = r, this.discoveryService = new et(this.rostrumService, this.keyManager), this.accounts = /* @__PURE__ */ new Map(), this.accountsAddressToId = /* @__PURE__ */ new Map(), this.receiveAddresses = [], this.changeAddresses = [], this.vaults = /* @__PURE__ */ new Map(), this.pendingUpdates = /* @__PURE__ */ new Map(), this.addressResolvers = /* @__PURE__ */ new Map();
|
|
1395
1397
|
}
|
|
1396
1398
|
static GAP_LIMIT = 20;
|
|
1397
1399
|
static DEBOUNCE_MS = 1e3;
|
|
@@ -1420,11 +1422,11 @@ class N {
|
|
|
1420
1422
|
getReceiveAddress() {
|
|
1421
1423
|
return this.receiveAddresses.find((e) => !e.used).address;
|
|
1422
1424
|
}
|
|
1423
|
-
getChangeAddress(e =
|
|
1424
|
-
return e !=
|
|
1425
|
+
getChangeAddress(e = g) {
|
|
1426
|
+
return e != g ? this.accounts.get(e).address : this.changeAddresses.find((t) => !t.used).address;
|
|
1425
1427
|
}
|
|
1426
|
-
getUsedAddressKeys(e =
|
|
1427
|
-
if (e !=
|
|
1428
|
+
getUsedAddressKeys(e = g) {
|
|
1429
|
+
if (e != g) {
|
|
1428
1430
|
const t = this.accounts.get(e);
|
|
1429
1431
|
return [{
|
|
1430
1432
|
address: t.address,
|
|
@@ -1464,7 +1466,7 @@ class N {
|
|
|
1464
1466
|
async initialSync() {
|
|
1465
1467
|
await this.subscribeAddresses(this.getAllAddresses(), !0);
|
|
1466
1468
|
const e = [];
|
|
1467
|
-
e.push(this.assetService.fetchAndSaveTokens(
|
|
1469
|
+
e.push(this.assetService.fetchAndSaveTokens(g, G(this.getMainAddresses().map((t) => t.tokensBalance))));
|
|
1468
1470
|
for (const t of this.accounts.values())
|
|
1469
1471
|
e.push(this.assetService.fetchAndSaveTokens(t.id, t.tokensBalance));
|
|
1470
1472
|
await Promise.all(e);
|
|
@@ -1480,7 +1482,7 @@ class N {
|
|
|
1480
1482
|
this.notify({
|
|
1481
1483
|
type: "new_account",
|
|
1482
1484
|
account: {
|
|
1483
|
-
id:
|
|
1485
|
+
id: g,
|
|
1484
1486
|
name: "Main Wallet",
|
|
1485
1487
|
address: this.getReceiveAddress(),
|
|
1486
1488
|
balance: re(e.map((t) => t.balance)),
|
|
@@ -1627,10 +1629,10 @@ class N {
|
|
|
1627
1629
|
t.set(c.tx_hash, c);
|
|
1628
1630
|
await this.checkGapLimit(m.RECEIVE), await this.checkGapLimit(m.CHANGE);
|
|
1629
1631
|
const s = this.getMainAddresses(), n = re(s.map((r) => r.balance)), i = G(s.map((r) => r.tokensBalance));
|
|
1630
|
-
this.notify({ type: "account_balance_updated", accountId:
|
|
1631
|
-
const o = this.assetService.syncNfts(
|
|
1632
|
+
this.notify({ type: "account_balance_updated", accountId: g, balance: n, tokensBalance: i }), this.notify({ type: "main_address_updated", address: this.getReceiveAddress() });
|
|
1633
|
+
const o = this.assetService.syncNfts(g, i);
|
|
1632
1634
|
for (const r of t.values())
|
|
1633
|
-
await this.transactionService.classifyAndSaveTransaction(
|
|
1635
|
+
await this.transactionService.classifyAndSaveTransaction(g, r.tx_hash, s.map((c) => c.address));
|
|
1634
1636
|
await o;
|
|
1635
1637
|
}
|
|
1636
1638
|
async postProcessAccountUpdate(e) {
|
|
@@ -1700,7 +1702,7 @@ class N {
|
|
|
1700
1702
|
s.name = t, await this.walletDb.updateAccountName(e, t);
|
|
1701
1703
|
}
|
|
1702
1704
|
rescanAccount(e) {
|
|
1703
|
-
if (e ==
|
|
1705
|
+
if (e == g) {
|
|
1704
1706
|
const t = this.getMainAddresses();
|
|
1705
1707
|
for (const s of t)
|
|
1706
1708
|
s.height = 0, this.registerUpdate({ address: s, result: s.statusHash });
|
|
@@ -1753,12 +1755,12 @@ class N {
|
|
|
1753
1755
|
return e.type == f.MAIN;
|
|
1754
1756
|
}
|
|
1755
1757
|
}
|
|
1756
|
-
const
|
|
1758
|
+
const tt = {
|
|
1757
1759
|
isWalletExist: !1,
|
|
1758
1760
|
isAuthorized: !1
|
|
1759
|
-
}, me =
|
|
1761
|
+
}, me = B({
|
|
1760
1762
|
name: "auth",
|
|
1761
|
-
initialState:
|
|
1763
|
+
initialState: tt,
|
|
1762
1764
|
reducers: {
|
|
1763
1765
|
setWalletExist: (a, e) => {
|
|
1764
1766
|
a.isWalletExist = e.payload;
|
|
@@ -1767,12 +1769,12 @@ const et = {
|
|
|
1767
1769
|
a.isAuthorized = e.payload;
|
|
1768
1770
|
}
|
|
1769
1771
|
}
|
|
1770
|
-
}),
|
|
1772
|
+
}), Jt = me.actions, st = me.reducer, at = {
|
|
1771
1773
|
modalType: null,
|
|
1772
1774
|
currentRequest: null
|
|
1773
|
-
}, we =
|
|
1775
|
+
}, we = B({
|
|
1774
1776
|
name: "dappModal",
|
|
1775
|
-
initialState:
|
|
1777
|
+
initialState: at,
|
|
1776
1778
|
reducers: {
|
|
1777
1779
|
showRequest(a, e) {
|
|
1778
1780
|
a.modalType = e.payload.type, a.currentRequest = e.payload;
|
|
@@ -1781,24 +1783,24 @@ const et = {
|
|
|
1781
1783
|
a.modalType = null, a.currentRequest = null;
|
|
1782
1784
|
}
|
|
1783
1785
|
}
|
|
1784
|
-
}), qt = we.actions,
|
|
1786
|
+
}), qt = we.actions, nt = we.reducer, it = {
|
|
1785
1787
|
counter: 0,
|
|
1786
1788
|
loading: !1
|
|
1787
|
-
}, ve =
|
|
1789
|
+
}, ve = B({
|
|
1788
1790
|
name: "loader",
|
|
1789
|
-
initialState:
|
|
1791
|
+
initialState: it,
|
|
1790
1792
|
reducers: {
|
|
1791
1793
|
setLoader: (a, e) => {
|
|
1792
1794
|
const t = e.payload.loading ? a.counter + 1 : Math.max(0, a.counter - 1);
|
|
1793
1795
|
a.counter = t, a.loading = t > 0, a.text = e.payload.text;
|
|
1794
1796
|
}
|
|
1795
1797
|
}
|
|
1796
|
-
}),
|
|
1798
|
+
}), zt = ve.actions, rt = ve.reducer, ot = {
|
|
1797
1799
|
wallet: {},
|
|
1798
1800
|
web3: {}
|
|
1799
|
-
}, Ae =
|
|
1801
|
+
}, Ae = B({
|
|
1800
1802
|
name: "notifications",
|
|
1801
|
-
initialState:
|
|
1803
|
+
initialState: ot,
|
|
1802
1804
|
reducers: {
|
|
1803
1805
|
addNotification: (a, e) => {
|
|
1804
1806
|
e.payload.type == "wallet" ? a.wallet[e.payload.id] = e.payload : e.payload.type == "web3" && (a.web3[e.payload.id] = e.payload);
|
|
@@ -1810,14 +1812,14 @@ const et = {
|
|
|
1810
1812
|
e.payload === "wallet" ? a.wallet = {} : e.payload === "web3" ? a.web3 = {} : e.payload === "all" && (a.wallet = {}, a.web3 = {});
|
|
1811
1813
|
}
|
|
1812
1814
|
}
|
|
1813
|
-
}),
|
|
1815
|
+
}), Wt = Ae.actions, ct = Ae.reducer, dt = {
|
|
1814
1816
|
status: "Offline",
|
|
1815
1817
|
height: 0,
|
|
1816
|
-
price:
|
|
1818
|
+
price: ge(),
|
|
1817
1819
|
hasNetwork: !0,
|
|
1818
1820
|
isSuspended: !1
|
|
1819
1821
|
}, ce = Ue("status/fetchPrice", async () => {
|
|
1820
|
-
const a =
|
|
1822
|
+
const a = ge();
|
|
1821
1823
|
try {
|
|
1822
1824
|
const e = await qe();
|
|
1823
1825
|
Object.keys(e).forEach((t) => {
|
|
@@ -1829,9 +1831,9 @@ const et = {
|
|
|
1829
1831
|
} catch {
|
|
1830
1832
|
}
|
|
1831
1833
|
return a;
|
|
1832
|
-
}),
|
|
1834
|
+
}), be = B({
|
|
1833
1835
|
name: "status",
|
|
1834
|
-
initialState:
|
|
1836
|
+
initialState: dt,
|
|
1835
1837
|
reducers: {
|
|
1836
1838
|
setHeight: (a, e) => {
|
|
1837
1839
|
e.payload > 0 && (a.status = "Online"), a.height = e.payload;
|
|
@@ -1853,12 +1855,12 @@ const et = {
|
|
|
1853
1855
|
console.error(t.error.message);
|
|
1854
1856
|
});
|
|
1855
1857
|
}
|
|
1856
|
-
}),
|
|
1858
|
+
}), jt = be.actions, ut = be.reducer, lt = {
|
|
1857
1859
|
isAuthorized: !1,
|
|
1858
|
-
selectedAccount:
|
|
1860
|
+
selectedAccount: g,
|
|
1859
1861
|
accounts: {
|
|
1860
1862
|
"-1": {
|
|
1861
|
-
id:
|
|
1863
|
+
id: g,
|
|
1862
1864
|
name: "Main Wallet",
|
|
1863
1865
|
address: "",
|
|
1864
1866
|
balance: { confirmed: "0", unconfirmed: "0" },
|
|
@@ -1872,9 +1874,9 @@ const et = {
|
|
|
1872
1874
|
initLoad: !0,
|
|
1873
1875
|
txUpdateTrigger: 0,
|
|
1874
1876
|
nftsUpdateTrigger: 0
|
|
1875
|
-
},
|
|
1877
|
+
}, Se = B({
|
|
1876
1878
|
name: "wallet",
|
|
1877
|
-
initialState:
|
|
1879
|
+
initialState: lt,
|
|
1878
1880
|
reducers: {
|
|
1879
1881
|
setInitLoad: (a, e) => {
|
|
1880
1882
|
a.initLoad = e.payload;
|
|
@@ -1895,7 +1897,7 @@ const et = {
|
|
|
1895
1897
|
a.accounts[e.payload.id] = e.payload;
|
|
1896
1898
|
},
|
|
1897
1899
|
setMainAddress: (a, e) => {
|
|
1898
|
-
a.accounts[
|
|
1900
|
+
a.accounts[g].address = e.payload;
|
|
1899
1901
|
},
|
|
1900
1902
|
setAccountBalance: (a, e) => {
|
|
1901
1903
|
a.accounts[e.payload.id].balance = e.payload.balance, a.accounts[e.payload.id].tokensBalance = e.payload.tokensBalance;
|
|
@@ -1930,109 +1932,110 @@ const et = {
|
|
|
1930
1932
|
a.accounts[e.payload.accountId].sessions = {};
|
|
1931
1933
|
}
|
|
1932
1934
|
}
|
|
1933
|
-
}),
|
|
1934
|
-
loader:
|
|
1935
|
-
dapp:
|
|
1936
|
-
status:
|
|
1937
|
-
wallet:
|
|
1938
|
-
auth:
|
|
1939
|
-
notifications:
|
|
1940
|
-
}, w = De.withTypes(),
|
|
1935
|
+
}), $t = Se.actions, ht = Se.reducer, Xt = {
|
|
1936
|
+
loader: rt,
|
|
1937
|
+
dapp: nt,
|
|
1938
|
+
status: ut,
|
|
1939
|
+
wallet: ht,
|
|
1940
|
+
auth: st,
|
|
1941
|
+
notifications: ct
|
|
1942
|
+
}, w = De.withTypes(), Yt = () => w((a) => a.auth), Zt = () => w((a) => a.status.height), Qt = (a) => w((e) => e.wallet.accounts[a]), es = () => w((a) => a.wallet.selectedAccount), ts = () => w((a) => Math.max(...Object.keys(a.wallet.accounts).map(Number))), ss = (a) => w((e) => e.wallet.accounts[a].address), as = (a) => w((e) => e.wallet.accounts[a].balance), ns = (a, e) => w((t) => t.wallet.accounts[a].tokensBalance[e]), is = (a, e) => w((t) => t.wallet.accounts[a].sessions[e]), rs = () => w((a) => a.wallet.vaults), ke = j(
|
|
1941
1943
|
[(a) => a.notifications.wallet],
|
|
1942
1944
|
(a) => Object.values(a).sort((e, t) => t.createdAt - e.createdAt)
|
|
1943
1945
|
), Te = j(
|
|
1944
1946
|
[(a) => a.notifications.web3],
|
|
1945
1947
|
(a) => Object.values(a).sort((e, t) => t.createdAt - e.createdAt)
|
|
1946
|
-
),
|
|
1948
|
+
), ft = j(
|
|
1947
1949
|
[ke, Te],
|
|
1948
1950
|
(a, e) => [...a, ...e].sort((t, s) => s.createdAt - t.createdAt)
|
|
1949
|
-
),
|
|
1951
|
+
), os = () => w(ke), cs = () => w(Te), ds = () => w(ft);
|
|
1950
1952
|
export {
|
|
1951
1953
|
f as AccountType,
|
|
1952
|
-
|
|
1954
|
+
Dt as AssetService,
|
|
1953
1955
|
V as AssetType,
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
+
pe as CURRENCIES,
|
|
1957
|
+
Ct as KVStore,
|
|
1958
|
+
_t as KeyManager,
|
|
1956
1959
|
m as KeySpace,
|
|
1957
|
-
|
|
1960
|
+
g as MAIN_WALLET_ID,
|
|
1958
1961
|
ne as MAX_INT64,
|
|
1959
1962
|
le as RostrumService,
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1963
|
+
Ft as SessionManager,
|
|
1964
|
+
M as SessionRequestType,
|
|
1965
|
+
Vt as TransactionService,
|
|
1966
|
+
Gt as TransactionTransformer,
|
|
1964
1967
|
Ve as VAULT_FIRST_BLOCK,
|
|
1965
1968
|
St as VAULT_SCRIPT_PREFIX,
|
|
1966
|
-
|
|
1967
|
-
|
|
1969
|
+
Pt as WalletCache,
|
|
1970
|
+
Mt as WalletDB,
|
|
1968
1971
|
N as WalletManager,
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1972
|
+
Jt as authActions,
|
|
1973
|
+
st as authReducer,
|
|
1974
|
+
Nt as capitalizeFirstLetter,
|
|
1975
|
+
ye as currencyCodes,
|
|
1976
|
+
Je as currencySymbols,
|
|
1974
1977
|
$ as currentTimestamp,
|
|
1975
1978
|
qt as dappModalActions,
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
+
nt as dappModalReducer,
|
|
1980
|
+
Ht as encryptMnemonic,
|
|
1981
|
+
It as estimateDateByFutureBlock,
|
|
1979
1982
|
Ke as fetchAssetBlob,
|
|
1980
1983
|
He as fetchAssetDoc,
|
|
1981
|
-
|
|
1984
|
+
Ot as fetchNiftyNFT,
|
|
1982
1985
|
ce as fetchPrice,
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1986
|
+
Rt as generateNewMnemonic,
|
|
1987
|
+
Ye as generateVaultAddress,
|
|
1988
|
+
je as generateVaultConstraint,
|
|
1989
|
+
Xe as generateVaultVisibleArgs,
|
|
1987
1990
|
R as getAddressBuffer,
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1991
|
+
Lt as getCurrencySymbol,
|
|
1992
|
+
Tt as getExplorerUrl,
|
|
1993
|
+
Et as getFileMediaType,
|
|
1994
|
+
Bt as getFileMimeType,
|
|
1992
1995
|
qe as getNexaPrices,
|
|
1993
1996
|
he as getNiftyToken,
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1997
|
+
$e as getVaultConstraintHash,
|
|
1998
|
+
ze as getVaultTemplate,
|
|
1999
|
+
We as getVaultTemplateHash,
|
|
2000
|
+
ge as initializePrices,
|
|
2001
|
+
kt as isGenesisHashValid,
|
|
1999
2002
|
Fe as isMnemonicValid,
|
|
2000
|
-
|
|
2003
|
+
J as isNiftySubgroup,
|
|
2001
2004
|
P as isNullOrEmpty,
|
|
2002
2005
|
T as isTestnet,
|
|
2003
2006
|
F as isValidNexaAddress,
|
|
2004
2007
|
x as keyPathToString,
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2008
|
+
zt as loaderActions,
|
|
2009
|
+
rt as loaderReducer,
|
|
2010
|
+
Wt as notificationsActions,
|
|
2011
|
+
ct as notificationsReducer,
|
|
2012
|
+
Ut as parseTokenDataUrl,
|
|
2013
|
+
Xt as sharedReducers,
|
|
2014
|
+
jt as statusActions,
|
|
2015
|
+
ut as statusReducer,
|
|
2013
2016
|
Re as stringToKeyPath,
|
|
2014
2017
|
re as sumBalance,
|
|
2015
2018
|
G as sumTokensBalance,
|
|
2016
2019
|
D as tokenAmountToAssetAmount,
|
|
2017
2020
|
ie as tokenHexToAddr,
|
|
2018
|
-
|
|
2021
|
+
b as tokenIdToHex,
|
|
2019
2022
|
oe as transformTokenIconUrl,
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2023
|
+
xt as truncateStringMiddle,
|
|
2024
|
+
Qt as useAccount,
|
|
2025
|
+
ds as useAllNotifications,
|
|
2026
|
+
Yt as useAuth,
|
|
2027
|
+
Zt as useBlockHeight,
|
|
2028
|
+
is as useDAppSession,
|
|
2029
|
+
ts as useLastAccountId,
|
|
2030
|
+
ss as useMainReceiveAddress,
|
|
2031
|
+
es as useSelectedAccount,
|
|
2032
|
+
ns as useTokenBalance,
|
|
2033
|
+
rs as useVaults,
|
|
2034
|
+
as as useWalletBalance,
|
|
2035
|
+
os as useWalletNotifications,
|
|
2036
|
+
cs as useWeb3Notifications,
|
|
2037
|
+
Kt as validateAndDecryptMnemonic,
|
|
2038
|
+
$t as walletActions,
|
|
2039
|
+
ht as walletReducer
|
|
2037
2040
|
};
|
|
2038
2041
|
//# sourceMappingURL=index.js.map
|