@directcryptopay/sdk 0.2.3 → 0.3.0
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 +51 -87
- package/dist/core/config.d.ts +9 -46
- package/dist/core/iframe.d.ts +16 -0
- package/dist/dcp-sdk.umd.js +1 -12811
- package/dist/dcp.d.ts +12 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +219 -2
- package/dist/types.d.ts +26 -164
- package/package.json +3 -13
- package/dist/ExchangeController-CPMQq6Q-.js +0 -217
- package/dist/HelpersUtil-DfMFC7Bf.js +0 -120
- package/dist/NavigationUtil-kj9LEOOd.js +0 -8
- package/dist/PhArrowCircleDown-lsK25DCk.js +0 -73
- package/dist/PhArrowClockwise-NeKHZ1co.js +0 -73
- package/dist/PhArrowDown-C9AkNvLs.js +0 -73
- package/dist/PhArrowLeft-RNfIQP1X.js +0 -73
- package/dist/PhArrowRight-DM1tna0G.js +0 -73
- package/dist/PhArrowSquareOut-S5XYbAZj.js +0 -73
- package/dist/PhArrowUp-DmktzOWy.js +0 -73
- package/dist/PhArrowUpRight-BkNeW_5i.js +0 -73
- package/dist/PhArrowsClockwise-CQ4pG76b.js +0 -73
- package/dist/PhArrowsDownUp-H6gxaNM6.js +0 -73
- package/dist/PhArrowsLeftRight-DZSsfMR6.js +0 -73
- package/dist/PhBank-4_9QzqIB.js +0 -73
- package/dist/PhBrowser-B-JSznId.js +0 -73
- package/dist/PhCaretDown-vV5oHMNi.js +0 -73
- package/dist/PhCaretLeft-BLo6Y_f4.js +0 -73
- package/dist/PhCaretRight-CqQN4TT3.js +0 -73
- package/dist/PhCaretUp-Df7UCAHy.js +0 -73
- package/dist/PhCheck-gtpfK4ed.js +0 -73
- package/dist/PhCircleHalf-Uq7dwDYw.js +0 -73
- package/dist/PhClock-SDCW-NmF.js +0 -73
- package/dist/PhCompass-B7hgtdx-.js +0 -73
- package/dist/PhCopy-BcnhyXCy.js +0 -73
- package/dist/PhCreditCard-BJjByVgu.js +0 -73
- package/dist/PhCurrencyDollar-B7ZXqXBy.js +0 -73
- package/dist/PhDesktop-B3VKPuJx.js +0 -73
- package/dist/PhDeviceMobile-Bnd0TYEH.js +0 -73
- package/dist/PhDotsThree-yyMWyZ-R.js +0 -73
- package/dist/PhEnvelope-67uzHbI9.js +0 -73
- package/dist/PhFunnelSimple-B-DCsloI.js +0 -73
- package/dist/PhGlobe-TMm_6qGk.js +0 -73
- package/dist/PhIdentificationCard-CePPD2xc.js +0 -73
- package/dist/PhImage-gY96WtHR.js +0 -73
- package/dist/PhInfo-DRQM_ZDP.js +0 -73
- package/dist/PhLightbulb-B0TxPfZ1.js +0 -73
- package/dist/PhMagnifyingGlass-B8si5_6W.js +0 -73
- package/dist/PhPaperPlaneRight-DVu5PLYd.js +0 -73
- package/dist/PhPlus-BfTsQnUz.js +0 -73
- package/dist/PhPower-CxYUGOWn.js +0 -73
- package/dist/PhPuzzlePiece-CQ4wh0gV.js +0 -73
- package/dist/PhQrCode-BuJ97NYJ.js +0 -73
- package/dist/PhQuestion-kJoP8Mja.js +0 -73
- package/dist/PhQuestionMark-C46ZkFpu.js +0 -73
- package/dist/PhSealCheck-Eh8jVqSN.js +0 -73
- package/dist/PhSignOut-jk97OSVt.js +0 -73
- package/dist/PhSpinner-CiYOhwMg.js +0 -73
- package/dist/PhTrash-pxerMqzd.js +0 -73
- package/dist/PhUser-BMg0VV4A.js +0 -73
- package/dist/PhVault-DYQvx5A-.js +0 -73
- package/dist/PhWarning-NLC5Mj87.js +0 -73
- package/dist/PhWarningCircle-Ch2jU9fA.js +0 -73
- package/dist/PhX-Bx4wpwm3.js +0 -73
- package/dist/SwapController-Cti0Cyxa.js +0 -457
- package/dist/ccip-CKZd2XJ7.js +0 -150
- package/dist/core/api.d.ts +0 -39
- package/dist/core/logic.d.ts +0 -2
- package/dist/core/wallet.d.ts +0 -55
- package/dist/data-capture-7D5CL385.js +0 -490
- package/dist/email-AmK0INbZ.js +0 -344
- package/dist/embedded-wallet-Pn0I_XLn.js +0 -820
- package/dist/features-x8XNprEe.js +0 -274
- package/dist/hashTypedData-B50-z0AA.js +0 -197
- package/dist/if-defined-CdZSZ6UL.js +0 -10
- package/dist/index-4ewUtPPp.js +0 -7981
- package/dist/index-51l86yqx.js +0 -276
- package/dist/index-B6K56LF_.js +0 -85
- package/dist/index-BAmv9PxJ.js +0 -257
- package/dist/index-BEswjY9r.js +0 -117
- package/dist/index-BSKRq56S.js +0 -355
- package/dist/index-BaygXQxx.js +0 -172
- package/dist/index-BcPxaHr5.js +0 -118
- package/dist/index-Bjt7nGaJ.js +0 -199
- package/dist/index-BkTSyAJb.js +0 -21991
- package/dist/index-Bmnl7l2U.js +0 -555
- package/dist/index-BvPvouSq.js +0 -56
- package/dist/index-C-6iznUO.js +0 -174
- package/dist/index-C1QEJL-2.js +0 -572
- package/dist/index-C4M5s_AM.js +0 -228
- package/dist/index-CEqcN8QP.js +0 -1175
- package/dist/index-CM3YaYca.js +0 -8189
- package/dist/index-CclBLA5r.js +0 -517
- package/dist/index-ChTxJOiF.js +0 -46
- package/dist/index-CmAv0Tzr.js +0 -86
- package/dist/index-CmvoKY4x.js +0 -125
- package/dist/index-D7PmdQ9B.js +0 -1750
- package/dist/index-D7k2Pc4e.js +0 -1083
- package/dist/index-D7lmgqUR.js +0 -153
- package/dist/index-DG_-qYze.js +0 -107
- package/dist/index-DHot9Fdb.js +0 -218
- package/dist/index-DV2LrPtU.js +0 -123
- package/dist/index-DYBaJQ2W.js +0 -65
- package/dist/index-D_8VUmn1.js +0 -41543
- package/dist/index-D_gLn3rT.js +0 -100
- package/dist/index-DqcVUSC9.js +0 -62
- package/dist/index-I7VDqINw.js +0 -128
- package/dist/index-Oz72I9VP.js +0 -209
- package/dist/index-UclsHkJ0.js +0 -118
- package/dist/index-X8zir_1j.js +0 -110
- package/dist/index-XvlWKGCu.js +0 -1281
- package/dist/index-dO97xPlt.js +0 -171
- package/dist/index-uBeF6OAB.js +0 -387
- package/dist/index-zeA_RiCV.js +0 -159
- package/dist/localBatchGatewayRequest-BUZHGdjw.js +0 -91
- package/dist/onramp-CdnBuF0r.js +0 -855
- package/dist/parseSignature-CcyTNGr4.js +0 -3304
- package/dist/pay-with-exchange-CSM6WCOV.js +0 -525
- package/dist/property-Bd8U3_QP.js +0 -618
- package/dist/receive-DooMu4Dx.js +0 -232
- package/dist/ref-CpgjXAw7.js +0 -107
- package/dist/send-3T7CyYic.js +0 -1166
- package/dist/socials-Dt-iHL17.js +0 -620
- package/dist/swaps-CjA9Es42.js +0 -1760
- package/dist/transactions-nRm9DVzn.js +0 -37
- package/dist/ui/Modal.d.ts +0 -9
- package/dist/ui/index.d.ts +0 -6
- package/dist/w3m-modal-NV25AXhM.js +0 -1706
package/dist/index-XvlWKGCu.js
DELETED
|
@@ -1,1281 +0,0 @@
|
|
|
1
|
-
import { dN as yt, cU as nt, cX as ot, cY as w, cV as Ct, cE as pt, dO as R, cG as xt, d0 as Rt, cM as Nt, cF as Lt, d3 as kt, d4 as Ft } from "./index-D_8VUmn1.js";
|
|
2
|
-
import { U as _t, n as M, c as st, r as at } from "./index-CEqcN8QP.js";
|
|
3
|
-
import "./index-UclsHkJ0.js";
|
|
4
|
-
import "./index-X8zir_1j.js";
|
|
5
|
-
import { o as jt } from "./if-defined-CdZSZ6UL.js";
|
|
6
|
-
import "./index-I7VDqINw.js";
|
|
7
|
-
import "./index-DqcVUSC9.js";
|
|
8
|
-
var mt = { exports: {} }, zt = mt.exports, Mt;
|
|
9
|
-
function Yt() {
|
|
10
|
-
return Mt || (Mt = 1, (function(t, e) {
|
|
11
|
-
(function(i, r) {
|
|
12
|
-
t.exports = r();
|
|
13
|
-
})(zt, (function() {
|
|
14
|
-
var i = 1e3, r = 6e4, o = 36e5, n = "millisecond", s = "second", u = "minute", g = "hour", p = "day", y = "week", $ = "month", k = "quarter", T = "year", N = "date", E = "Invalid Date", Q = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, X = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, tt = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(h) {
|
|
15
|
-
var l = ["th", "st", "nd", "rd"], a = h % 100;
|
|
16
|
-
return "[" + h + (l[(a - 20) % 10] || l[a] || l[0]) + "]";
|
|
17
|
-
} }, et = function(h, l, a) {
|
|
18
|
-
var d = String(h);
|
|
19
|
-
return !d || d.length >= l ? h : "" + Array(l + 1 - d.length).join(a) + h;
|
|
20
|
-
}, U = { s: et, z: function(h) {
|
|
21
|
-
var l = -h.utcOffset(), a = Math.abs(l), d = Math.floor(a / 60), c = a % 60;
|
|
22
|
-
return (l <= 0 ? "+" : "-") + et(d, 2, "0") + ":" + et(c, 2, "0");
|
|
23
|
-
}, m: function h(l, a) {
|
|
24
|
-
if (l.date() < a.date()) return -h(a, l);
|
|
25
|
-
var d = 12 * (a.year() - l.year()) + (a.month() - l.month()), c = l.clone().add(d, $), m = a - c < 0, f = l.clone().add(d + (m ? -1 : 1), $);
|
|
26
|
-
return +(-(d + (a - c) / (m ? c - f : f - c)) || 0);
|
|
27
|
-
}, a: function(h) {
|
|
28
|
-
return h < 0 ? Math.ceil(h) || 0 : Math.floor(h);
|
|
29
|
-
}, p: function(h) {
|
|
30
|
-
return { M: $, y: T, w: y, d: p, D: N, h: g, m: u, s, ms: n, Q: k }[h] || String(h || "").toLowerCase().replace(/s$/, "");
|
|
31
|
-
}, u: function(h) {
|
|
32
|
-
return h === void 0;
|
|
33
|
-
} }, O = "en", I = {};
|
|
34
|
-
I[O] = tt;
|
|
35
|
-
var P = "$isDayjsObject", q = function(h) {
|
|
36
|
-
return h instanceof lt || !(!h || !h[P]);
|
|
37
|
-
}, ct = function h(l, a, d) {
|
|
38
|
-
var c;
|
|
39
|
-
if (!l) return O;
|
|
40
|
-
if (typeof l == "string") {
|
|
41
|
-
var m = l.toLowerCase();
|
|
42
|
-
I[m] && (c = m), a && (I[m] = a, c = m);
|
|
43
|
-
var f = l.split("-");
|
|
44
|
-
if (!c && f.length > 1) return h(f[0]);
|
|
45
|
-
} else {
|
|
46
|
-
var v = l.name;
|
|
47
|
-
I[v] = l, c = v;
|
|
48
|
-
}
|
|
49
|
-
return !d && c && (O = c), c || !d && O;
|
|
50
|
-
}, D = function(h, l) {
|
|
51
|
-
if (q(h)) return h.clone();
|
|
52
|
-
var a = typeof l == "object" ? l : {};
|
|
53
|
-
return a.date = h, a.args = arguments, new lt(a);
|
|
54
|
-
}, x = U;
|
|
55
|
-
x.l = ct, x.i = q, x.w = function(h, l) {
|
|
56
|
-
return D(h, { locale: l.$L, utc: l.$u, x: l.$x, $offset: l.$offset });
|
|
57
|
-
};
|
|
58
|
-
var lt = (function() {
|
|
59
|
-
function h(a) {
|
|
60
|
-
this.$L = ct(a.locale, null, !0), this.parse(a), this.$x = this.$x || a.x || {}, this[P] = !0;
|
|
61
|
-
}
|
|
62
|
-
var l = h.prototype;
|
|
63
|
-
return l.parse = function(a) {
|
|
64
|
-
this.$d = (function(d) {
|
|
65
|
-
var c = d.date, m = d.utc;
|
|
66
|
-
if (c === null) return /* @__PURE__ */ new Date(NaN);
|
|
67
|
-
if (x.u(c)) return /* @__PURE__ */ new Date();
|
|
68
|
-
if (c instanceof Date) return new Date(c);
|
|
69
|
-
if (typeof c == "string" && !/Z$/i.test(c)) {
|
|
70
|
-
var f = c.match(Q);
|
|
71
|
-
if (f) {
|
|
72
|
-
var v = f[2] - 1 || 0, b = (f[7] || "0").substring(0, 3);
|
|
73
|
-
return m ? new Date(Date.UTC(f[1], v, f[3] || 1, f[4] || 0, f[5] || 0, f[6] || 0, b)) : new Date(f[1], v, f[3] || 1, f[4] || 0, f[5] || 0, f[6] || 0, b);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return new Date(c);
|
|
77
|
-
})(a), this.init();
|
|
78
|
-
}, l.init = function() {
|
|
79
|
-
var a = this.$d;
|
|
80
|
-
this.$y = a.getFullYear(), this.$M = a.getMonth(), this.$D = a.getDate(), this.$W = a.getDay(), this.$H = a.getHours(), this.$m = a.getMinutes(), this.$s = a.getSeconds(), this.$ms = a.getMilliseconds();
|
|
81
|
-
}, l.$utils = function() {
|
|
82
|
-
return x;
|
|
83
|
-
}, l.isValid = function() {
|
|
84
|
-
return this.$d.toString() !== E;
|
|
85
|
-
}, l.isSame = function(a, d) {
|
|
86
|
-
var c = D(a);
|
|
87
|
-
return this.startOf(d) <= c && c <= this.endOf(d);
|
|
88
|
-
}, l.isAfter = function(a, d) {
|
|
89
|
-
return D(a) < this.startOf(d);
|
|
90
|
-
}, l.isBefore = function(a, d) {
|
|
91
|
-
return this.endOf(d) < D(a);
|
|
92
|
-
}, l.$g = function(a, d, c) {
|
|
93
|
-
return x.u(a) ? this[d] : this.set(c, a);
|
|
94
|
-
}, l.unix = function() {
|
|
95
|
-
return Math.floor(this.valueOf() / 1e3);
|
|
96
|
-
}, l.valueOf = function() {
|
|
97
|
-
return this.$d.getTime();
|
|
98
|
-
}, l.startOf = function(a, d) {
|
|
99
|
-
var c = this, m = !!x.u(d) || d, f = x.p(a), v = function(W, A) {
|
|
100
|
-
var z = x.w(c.$u ? Date.UTC(c.$y, A, W) : new Date(c.$y, A, W), c);
|
|
101
|
-
return m ? z : z.endOf(p);
|
|
102
|
-
}, b = function(W, A) {
|
|
103
|
-
return x.w(c.toDate()[W].apply(c.toDate("s"), (m ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(A)), c);
|
|
104
|
-
}, _ = this.$W, S = this.$M, C = this.$D, J = "set" + (this.$u ? "UTC" : "");
|
|
105
|
-
switch (f) {
|
|
106
|
-
case T:
|
|
107
|
-
return m ? v(1, 0) : v(31, 11);
|
|
108
|
-
case $:
|
|
109
|
-
return m ? v(1, S) : v(0, S + 1);
|
|
110
|
-
case y:
|
|
111
|
-
var B = this.$locale().weekStart || 0, it = (_ < B ? _ + 7 : _) - B;
|
|
112
|
-
return v(m ? C - it : C + (6 - it), S);
|
|
113
|
-
case p:
|
|
114
|
-
case N:
|
|
115
|
-
return b(J + "Hours", 0);
|
|
116
|
-
case g:
|
|
117
|
-
return b(J + "Minutes", 1);
|
|
118
|
-
case u:
|
|
119
|
-
return b(J + "Seconds", 2);
|
|
120
|
-
case s:
|
|
121
|
-
return b(J + "Milliseconds", 3);
|
|
122
|
-
default:
|
|
123
|
-
return this.clone();
|
|
124
|
-
}
|
|
125
|
-
}, l.endOf = function(a) {
|
|
126
|
-
return this.startOf(a, !1);
|
|
127
|
-
}, l.$set = function(a, d) {
|
|
128
|
-
var c, m = x.p(a), f = "set" + (this.$u ? "UTC" : ""), v = (c = {}, c[p] = f + "Date", c[N] = f + "Date", c[$] = f + "Month", c[T] = f + "FullYear", c[g] = f + "Hours", c[u] = f + "Minutes", c[s] = f + "Seconds", c[n] = f + "Milliseconds", c)[m], b = m === p ? this.$D + (d - this.$W) : d;
|
|
129
|
-
if (m === $ || m === T) {
|
|
130
|
-
var _ = this.clone().set(N, 1);
|
|
131
|
-
_.$d[v](b), _.init(), this.$d = _.set(N, Math.min(this.$D, _.daysInMonth())).$d;
|
|
132
|
-
} else v && this.$d[v](b);
|
|
133
|
-
return this.init(), this;
|
|
134
|
-
}, l.set = function(a, d) {
|
|
135
|
-
return this.clone().$set(a, d);
|
|
136
|
-
}, l.get = function(a) {
|
|
137
|
-
return this[x.p(a)]();
|
|
138
|
-
}, l.add = function(a, d) {
|
|
139
|
-
var c, m = this;
|
|
140
|
-
a = Number(a);
|
|
141
|
-
var f = x.p(d), v = function(S) {
|
|
142
|
-
var C = D(m);
|
|
143
|
-
return x.w(C.date(C.date() + Math.round(S * a)), m);
|
|
144
|
-
};
|
|
145
|
-
if (f === $) return this.set($, this.$M + a);
|
|
146
|
-
if (f === T) return this.set(T, this.$y + a);
|
|
147
|
-
if (f === p) return v(1);
|
|
148
|
-
if (f === y) return v(7);
|
|
149
|
-
var b = (c = {}, c[u] = r, c[g] = o, c[s] = i, c)[f] || 1, _ = this.$d.getTime() + a * b;
|
|
150
|
-
return x.w(_, this);
|
|
151
|
-
}, l.subtract = function(a, d) {
|
|
152
|
-
return this.add(-1 * a, d);
|
|
153
|
-
}, l.format = function(a) {
|
|
154
|
-
var d = this, c = this.$locale();
|
|
155
|
-
if (!this.isValid()) return c.invalidDate || E;
|
|
156
|
-
var m = a || "YYYY-MM-DDTHH:mm:ssZ", f = x.z(this), v = this.$H, b = this.$m, _ = this.$M, S = c.weekdays, C = c.months, J = c.meridiem, B = function(A, z, rt, dt) {
|
|
157
|
-
return A && (A[z] || A(d, m)) || rt[z].slice(0, dt);
|
|
158
|
-
}, it = function(A) {
|
|
159
|
-
return x.s(v % 12 || 12, A, "0");
|
|
160
|
-
}, W = J || function(A, z, rt) {
|
|
161
|
-
var dt = A < 12 ? "AM" : "PM";
|
|
162
|
-
return rt ? dt.toLowerCase() : dt;
|
|
163
|
-
};
|
|
164
|
-
return m.replace(X, (function(A, z) {
|
|
165
|
-
return z || (function(rt) {
|
|
166
|
-
switch (rt) {
|
|
167
|
-
case "YY":
|
|
168
|
-
return String(d.$y).slice(-2);
|
|
169
|
-
case "YYYY":
|
|
170
|
-
return x.s(d.$y, 4, "0");
|
|
171
|
-
case "M":
|
|
172
|
-
return _ + 1;
|
|
173
|
-
case "MM":
|
|
174
|
-
return x.s(_ + 1, 2, "0");
|
|
175
|
-
case "MMM":
|
|
176
|
-
return B(c.monthsShort, _, C, 3);
|
|
177
|
-
case "MMMM":
|
|
178
|
-
return B(C, _);
|
|
179
|
-
case "D":
|
|
180
|
-
return d.$D;
|
|
181
|
-
case "DD":
|
|
182
|
-
return x.s(d.$D, 2, "0");
|
|
183
|
-
case "d":
|
|
184
|
-
return String(d.$W);
|
|
185
|
-
case "dd":
|
|
186
|
-
return B(c.weekdaysMin, d.$W, S, 2);
|
|
187
|
-
case "ddd":
|
|
188
|
-
return B(c.weekdaysShort, d.$W, S, 3);
|
|
189
|
-
case "dddd":
|
|
190
|
-
return S[d.$W];
|
|
191
|
-
case "H":
|
|
192
|
-
return String(v);
|
|
193
|
-
case "HH":
|
|
194
|
-
return x.s(v, 2, "0");
|
|
195
|
-
case "h":
|
|
196
|
-
return it(1);
|
|
197
|
-
case "hh":
|
|
198
|
-
return it(2);
|
|
199
|
-
case "a":
|
|
200
|
-
return W(v, b, !0);
|
|
201
|
-
case "A":
|
|
202
|
-
return W(v, b, !1);
|
|
203
|
-
case "m":
|
|
204
|
-
return String(b);
|
|
205
|
-
case "mm":
|
|
206
|
-
return x.s(b, 2, "0");
|
|
207
|
-
case "s":
|
|
208
|
-
return String(d.$s);
|
|
209
|
-
case "ss":
|
|
210
|
-
return x.s(d.$s, 2, "0");
|
|
211
|
-
case "SSS":
|
|
212
|
-
return x.s(d.$ms, 3, "0");
|
|
213
|
-
case "Z":
|
|
214
|
-
return f;
|
|
215
|
-
}
|
|
216
|
-
return null;
|
|
217
|
-
})(A) || f.replace(":", "");
|
|
218
|
-
}));
|
|
219
|
-
}, l.utcOffset = function() {
|
|
220
|
-
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
221
|
-
}, l.diff = function(a, d, c) {
|
|
222
|
-
var m, f = this, v = x.p(d), b = D(a), _ = (b.utcOffset() - this.utcOffset()) * r, S = this - b, C = function() {
|
|
223
|
-
return x.m(f, b);
|
|
224
|
-
};
|
|
225
|
-
switch (v) {
|
|
226
|
-
case T:
|
|
227
|
-
m = C() / 12;
|
|
228
|
-
break;
|
|
229
|
-
case $:
|
|
230
|
-
m = C();
|
|
231
|
-
break;
|
|
232
|
-
case k:
|
|
233
|
-
m = C() / 3;
|
|
234
|
-
break;
|
|
235
|
-
case y:
|
|
236
|
-
m = (S - _) / 6048e5;
|
|
237
|
-
break;
|
|
238
|
-
case p:
|
|
239
|
-
m = (S - _) / 864e5;
|
|
240
|
-
break;
|
|
241
|
-
case g:
|
|
242
|
-
m = S / o;
|
|
243
|
-
break;
|
|
244
|
-
case u:
|
|
245
|
-
m = S / r;
|
|
246
|
-
break;
|
|
247
|
-
case s:
|
|
248
|
-
m = S / i;
|
|
249
|
-
break;
|
|
250
|
-
default:
|
|
251
|
-
m = S;
|
|
252
|
-
}
|
|
253
|
-
return c ? m : x.a(m);
|
|
254
|
-
}, l.daysInMonth = function() {
|
|
255
|
-
return this.endOf($).$D;
|
|
256
|
-
}, l.$locale = function() {
|
|
257
|
-
return I[this.$L];
|
|
258
|
-
}, l.locale = function(a, d) {
|
|
259
|
-
if (!a) return this.$L;
|
|
260
|
-
var c = this.clone(), m = ct(a, d, !0);
|
|
261
|
-
return m && (c.$L = m), c;
|
|
262
|
-
}, l.clone = function() {
|
|
263
|
-
return x.w(this.$d, this);
|
|
264
|
-
}, l.toDate = function() {
|
|
265
|
-
return new Date(this.valueOf());
|
|
266
|
-
}, l.toJSON = function() {
|
|
267
|
-
return this.isValid() ? this.toISOString() : null;
|
|
268
|
-
}, l.toISOString = function() {
|
|
269
|
-
return this.$d.toISOString();
|
|
270
|
-
}, l.toString = function() {
|
|
271
|
-
return this.$d.toUTCString();
|
|
272
|
-
}, h;
|
|
273
|
-
})(), Dt = lt.prototype;
|
|
274
|
-
return D.prototype = Dt, [["$ms", n], ["$s", s], ["$m", u], ["$H", g], ["$W", p], ["$M", $], ["$y", T], ["$D", N]].forEach((function(h) {
|
|
275
|
-
Dt[h[1]] = function(l) {
|
|
276
|
-
return this.$g(l, h[0], h[1]);
|
|
277
|
-
};
|
|
278
|
-
})), D.extend = function(h, l) {
|
|
279
|
-
return h.$i || (h(l, lt, D), h.$i = !0), D;
|
|
280
|
-
}, D.locale = ct, D.isDayjs = q, D.unix = function(h) {
|
|
281
|
-
return D(1e3 * h);
|
|
282
|
-
}, D.en = I[O], D.Ls = I, D.p = {}, D;
|
|
283
|
-
}));
|
|
284
|
-
})(mt)), mt.exports;
|
|
285
|
-
}
|
|
286
|
-
var Et = Yt();
|
|
287
|
-
const K = /* @__PURE__ */ yt(Et);
|
|
288
|
-
var ft = { exports: {} }, Ut = ft.exports, St;
|
|
289
|
-
function qt() {
|
|
290
|
-
return St || (St = 1, (function(t, e) {
|
|
291
|
-
(function(i, r) {
|
|
292
|
-
t.exports = r();
|
|
293
|
-
})(Ut, (function() {
|
|
294
|
-
return { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(i) {
|
|
295
|
-
var r = ["th", "st", "nd", "rd"], o = i % 100;
|
|
296
|
-
return "[" + i + (r[(o - 20) % 10] || r[o] || r[0]) + "]";
|
|
297
|
-
} };
|
|
298
|
-
}));
|
|
299
|
-
})(ft)), ft.exports;
|
|
300
|
-
}
|
|
301
|
-
var Bt = qt();
|
|
302
|
-
const Wt = /* @__PURE__ */ yt(Bt);
|
|
303
|
-
var gt = { exports: {} }, Ht = gt.exports, Ot;
|
|
304
|
-
function Gt() {
|
|
305
|
-
return Ot || (Ot = 1, (function(t, e) {
|
|
306
|
-
(function(i, r) {
|
|
307
|
-
t.exports = r();
|
|
308
|
-
})(Ht, (function() {
|
|
309
|
-
return function(i, r, o) {
|
|
310
|
-
i = i || {};
|
|
311
|
-
var n = r.prototype, s = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
|
|
312
|
-
function u(p, y, $, k) {
|
|
313
|
-
return n.fromToBase(p, y, $, k);
|
|
314
|
-
}
|
|
315
|
-
o.en.relativeTime = s, n.fromToBase = function(p, y, $, k, T) {
|
|
316
|
-
for (var N, E, Q, X = $.$locale().relativeTime || s, tt = i.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], et = tt.length, U = 0; U < et; U += 1) {
|
|
317
|
-
var O = tt[U];
|
|
318
|
-
O.d && (N = k ? o(p).diff($, O.d, !0) : $.diff(p, O.d, !0));
|
|
319
|
-
var I = (i.rounding || Math.round)(Math.abs(N));
|
|
320
|
-
if (Q = N > 0, I <= O.r || !O.r) {
|
|
321
|
-
I <= 1 && U > 0 && (O = tt[U - 1]);
|
|
322
|
-
var P = X[O.l];
|
|
323
|
-
T && (I = T("" + I)), E = typeof P == "string" ? P.replace("%d", I) : P(I, y, O.l, Q);
|
|
324
|
-
break;
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
if (y) return E;
|
|
328
|
-
var q = Q ? X.future : X.past;
|
|
329
|
-
return typeof q == "function" ? q(E) : q.replace("%s", E);
|
|
330
|
-
}, n.to = function(p, y) {
|
|
331
|
-
return u(p, y, this, !0);
|
|
332
|
-
}, n.from = function(p, y) {
|
|
333
|
-
return u(p, y, this);
|
|
334
|
-
};
|
|
335
|
-
var g = function(p) {
|
|
336
|
-
return p.$u ? o.utc() : o();
|
|
337
|
-
};
|
|
338
|
-
n.toNow = function(p) {
|
|
339
|
-
return this.to(g(this), p);
|
|
340
|
-
}, n.fromNow = function(p) {
|
|
341
|
-
return this.from(g(this), p);
|
|
342
|
-
};
|
|
343
|
-
};
|
|
344
|
-
}));
|
|
345
|
-
})(gt)), gt.exports;
|
|
346
|
-
}
|
|
347
|
-
var Vt = Gt();
|
|
348
|
-
const Pt = /* @__PURE__ */ yt(Vt);
|
|
349
|
-
var wt = { exports: {} }, Jt = wt.exports, It;
|
|
350
|
-
function Zt() {
|
|
351
|
-
return It || (It = 1, (function(t, e) {
|
|
352
|
-
(function(i, r) {
|
|
353
|
-
t.exports = r();
|
|
354
|
-
})(Jt, (function() {
|
|
355
|
-
return function(i, r, o) {
|
|
356
|
-
o.updateLocale = function(n, s) {
|
|
357
|
-
var u = o.Ls[n];
|
|
358
|
-
if (u) return (s ? Object.keys(s) : []).forEach((function(g) {
|
|
359
|
-
u[g] = s[g];
|
|
360
|
-
})), u;
|
|
361
|
-
};
|
|
362
|
-
};
|
|
363
|
-
}));
|
|
364
|
-
})(wt)), wt.exports;
|
|
365
|
-
}
|
|
366
|
-
var Kt = Zt();
|
|
367
|
-
const Qt = /* @__PURE__ */ yt(Kt);
|
|
368
|
-
K.extend(Pt);
|
|
369
|
-
K.extend(Qt);
|
|
370
|
-
const Xt = {
|
|
371
|
-
...Wt,
|
|
372
|
-
name: "en-web3-modal",
|
|
373
|
-
relativeTime: {
|
|
374
|
-
future: "in %s",
|
|
375
|
-
past: "%s ago",
|
|
376
|
-
s: "%d sec",
|
|
377
|
-
m: "1 min",
|
|
378
|
-
mm: "%d min",
|
|
379
|
-
h: "1 hr",
|
|
380
|
-
hh: "%d hrs",
|
|
381
|
-
d: "1 d",
|
|
382
|
-
dd: "%d d",
|
|
383
|
-
M: "1 mo",
|
|
384
|
-
MM: "%d mo",
|
|
385
|
-
y: "1 yr",
|
|
386
|
-
yy: "%d yr"
|
|
387
|
-
}
|
|
388
|
-
}, te = [
|
|
389
|
-
"January",
|
|
390
|
-
"February",
|
|
391
|
-
"March",
|
|
392
|
-
"April",
|
|
393
|
-
"May",
|
|
394
|
-
"June",
|
|
395
|
-
"July",
|
|
396
|
-
"August",
|
|
397
|
-
"September",
|
|
398
|
-
"October",
|
|
399
|
-
"November",
|
|
400
|
-
"December"
|
|
401
|
-
];
|
|
402
|
-
K.locale("en-web3-modal", Xt);
|
|
403
|
-
const $t = {
|
|
404
|
-
getMonthNameByIndex(t) {
|
|
405
|
-
return te[t];
|
|
406
|
-
},
|
|
407
|
-
getYear(t = (/* @__PURE__ */ new Date()).toISOString()) {
|
|
408
|
-
return K(t).year();
|
|
409
|
-
},
|
|
410
|
-
getRelativeDateFromNow(t) {
|
|
411
|
-
return K(t).locale("en-web3-modal").fromNow(!0);
|
|
412
|
-
},
|
|
413
|
-
formatDate(t, e = "DD MMM") {
|
|
414
|
-
return K(t).format(e);
|
|
415
|
-
}
|
|
416
|
-
}, ee = 3, ht = 0.1, ie = ["receive", "deposit", "borrow", "claim"], re = ["withdraw", "repay", "burn"], Z = {
|
|
417
|
-
getTransactionGroupTitle(t, e) {
|
|
418
|
-
const i = $t.getYear(), r = $t.getMonthNameByIndex(e);
|
|
419
|
-
return t === i ? r : `${r} ${t}`;
|
|
420
|
-
},
|
|
421
|
-
getTransactionImages(t) {
|
|
422
|
-
const [e] = t;
|
|
423
|
-
return (t == null ? void 0 : t.length) > 1 ? t.map((r) => this.getTransactionImage(r)) : [this.getTransactionImage(e)];
|
|
424
|
-
},
|
|
425
|
-
getTransactionImage(t) {
|
|
426
|
-
return {
|
|
427
|
-
type: Z.getTransactionTransferTokenType(t),
|
|
428
|
-
url: Z.getTransactionImageURL(t)
|
|
429
|
-
};
|
|
430
|
-
},
|
|
431
|
-
getTransactionImageURL(t) {
|
|
432
|
-
var o, n, s, u, g;
|
|
433
|
-
let e;
|
|
434
|
-
const i = !!(t != null && t.nft_info), r = !!(t != null && t.fungible_info);
|
|
435
|
-
return t && i ? e = (s = (n = (o = t == null ? void 0 : t.nft_info) == null ? void 0 : o.content) == null ? void 0 : n.preview) == null ? void 0 : s.url : t && r && (e = (g = (u = t == null ? void 0 : t.fungible_info) == null ? void 0 : u.icon) == null ? void 0 : g.url), e;
|
|
436
|
-
},
|
|
437
|
-
getTransactionTransferTokenType(t) {
|
|
438
|
-
if (t != null && t.fungible_info)
|
|
439
|
-
return "FUNGIBLE";
|
|
440
|
-
if (t != null && t.nft_info)
|
|
441
|
-
return "NFT";
|
|
442
|
-
},
|
|
443
|
-
getTransactionDescriptions(t, e) {
|
|
444
|
-
var k;
|
|
445
|
-
const i = (k = t == null ? void 0 : t.metadata) == null ? void 0 : k.operationType, r = e || (t == null ? void 0 : t.transfers), o = (r == null ? void 0 : r.length) > 0, n = (r == null ? void 0 : r.length) > 1, s = o && (r == null ? void 0 : r.every((T) => !!(T != null && T.fungible_info))), [u, g] = r;
|
|
446
|
-
let p = this.getTransferDescription(u), y = this.getTransferDescription(g);
|
|
447
|
-
if (!o)
|
|
448
|
-
return (i === "send" || i === "receive") && s ? (p = _t.getTruncateString({
|
|
449
|
-
string: t == null ? void 0 : t.metadata.sentFrom,
|
|
450
|
-
charsStart: 4,
|
|
451
|
-
charsEnd: 6,
|
|
452
|
-
truncate: "middle"
|
|
453
|
-
}), y = _t.getTruncateString({
|
|
454
|
-
string: t == null ? void 0 : t.metadata.sentTo,
|
|
455
|
-
charsStart: 4,
|
|
456
|
-
charsEnd: 6,
|
|
457
|
-
truncate: "middle"
|
|
458
|
-
}), [p, y]) : [t.metadata.status];
|
|
459
|
-
if (n)
|
|
460
|
-
return r.map((T) => this.getTransferDescription(T));
|
|
461
|
-
let $ = "";
|
|
462
|
-
return ie.includes(i) ? $ = "+" : re.includes(i) && ($ = "-"), p = $.concat(p), [p];
|
|
463
|
-
},
|
|
464
|
-
getTransferDescription(t) {
|
|
465
|
-
var i;
|
|
466
|
-
let e = "";
|
|
467
|
-
return t && (t != null && t.nft_info ? e = ((i = t == null ? void 0 : t.nft_info) == null ? void 0 : i.name) || "-" : t != null && t.fungible_info && (e = this.getFungibleTransferDescription(t) || "-")), e;
|
|
468
|
-
},
|
|
469
|
-
getFungibleTransferDescription(t) {
|
|
470
|
-
var r;
|
|
471
|
-
return t ? [this.getQuantityFixedValue(t == null ? void 0 : t.quantity.numeric), (r = t == null ? void 0 : t.fungible_info) == null ? void 0 : r.symbol].join(" ").trim() : null;
|
|
472
|
-
},
|
|
473
|
-
mergeTransfers(t) {
|
|
474
|
-
if ((t == null ? void 0 : t.length) <= 1)
|
|
475
|
-
return t;
|
|
476
|
-
const i = this.filterGasFeeTransfers(t).reduce((o, n) => {
|
|
477
|
-
var g;
|
|
478
|
-
const s = (g = n == null ? void 0 : n.fungible_info) == null ? void 0 : g.name, u = o.find(({ fungible_info: p, direction: y }) => s && s === (p == null ? void 0 : p.name) && y === n.direction);
|
|
479
|
-
if (u) {
|
|
480
|
-
const p = Number(u.quantity.numeric) + Number(n.quantity.numeric);
|
|
481
|
-
u.quantity.numeric = p.toString(), u.value = (u.value || 0) + (n.value || 0);
|
|
482
|
-
} else
|
|
483
|
-
o.push(n);
|
|
484
|
-
return o;
|
|
485
|
-
}, []);
|
|
486
|
-
let r = i;
|
|
487
|
-
return i.length > 2 && (r = i.sort((o, n) => (n.value || 0) - (o.value || 0)).slice(0, 2)), r = r.sort((o, n) => o.direction === "out" && n.direction === "in" ? -1 : o.direction === "in" && n.direction === "out" ? 1 : 0), r;
|
|
488
|
-
},
|
|
489
|
-
filterGasFeeTransfers(t) {
|
|
490
|
-
const e = t.reduce((r, o) => {
|
|
491
|
-
var s;
|
|
492
|
-
const n = (s = o == null ? void 0 : o.fungible_info) == null ? void 0 : s.name;
|
|
493
|
-
return n && (r[n] || (r[n] = []), r[n].push(o)), r;
|
|
494
|
-
}, {}), i = [];
|
|
495
|
-
return Object.values(e).forEach((r) => {
|
|
496
|
-
if (r.length === 1) {
|
|
497
|
-
const o = r[0];
|
|
498
|
-
o && i.push(o);
|
|
499
|
-
} else {
|
|
500
|
-
const o = r.filter((s) => s.direction === "in"), n = r.filter((s) => s.direction === "out");
|
|
501
|
-
if (o.length === 1 && n.length === 1) {
|
|
502
|
-
const s = o[0], u = n[0];
|
|
503
|
-
let g = !1;
|
|
504
|
-
if (s && u) {
|
|
505
|
-
const p = Number(s.quantity.numeric), y = Number(u.quantity.numeric);
|
|
506
|
-
y < p * ht ? (i.push(s), g = !0) : p < y * ht && (i.push(u), g = !0);
|
|
507
|
-
}
|
|
508
|
-
g || i.push(...r);
|
|
509
|
-
} else {
|
|
510
|
-
const s = this.filterGasFeesFromTokenGroup(r);
|
|
511
|
-
i.push(...s);
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
}), t.forEach((r) => {
|
|
515
|
-
var o;
|
|
516
|
-
(o = r == null ? void 0 : r.fungible_info) != null && o.name || i.push(r);
|
|
517
|
-
}), i;
|
|
518
|
-
},
|
|
519
|
-
filterGasFeesFromTokenGroup(t) {
|
|
520
|
-
if (t.length <= 1)
|
|
521
|
-
return t;
|
|
522
|
-
const e = t.map((u) => Number(u.quantity.numeric)), i = Math.max(...e), r = Math.min(...e), o = 0.01;
|
|
523
|
-
if (r < i * o)
|
|
524
|
-
return t.filter((g) => Number(g.quantity.numeric) >= i * o);
|
|
525
|
-
const n = t.filter((u) => u.direction === "in"), s = t.filter((u) => u.direction === "out");
|
|
526
|
-
if (n.length === 1 && s.length === 1) {
|
|
527
|
-
const u = n[0], g = s[0];
|
|
528
|
-
if (u && g) {
|
|
529
|
-
const p = Number(u.quantity.numeric), y = Number(g.quantity.numeric);
|
|
530
|
-
if (y < p * ht)
|
|
531
|
-
return [u];
|
|
532
|
-
if (p < y * ht)
|
|
533
|
-
return [g];
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
return t;
|
|
537
|
-
},
|
|
538
|
-
getQuantityFixedValue(t) {
|
|
539
|
-
return t ? parseFloat(t).toFixed(ee) : null;
|
|
540
|
-
}
|
|
541
|
-
};
|
|
542
|
-
var bt;
|
|
543
|
-
(function(t) {
|
|
544
|
-
t.approve = "approved", t.bought = "bought", t.borrow = "borrowed", t.burn = "burnt", t.cancel = "canceled", t.claim = "claimed", t.deploy = "deployed", t.deposit = "deposited", t.execute = "executed", t.mint = "minted", t.receive = "received", t.repay = "repaid", t.send = "sent", t.sell = "sold", t.stake = "staked", t.trade = "swapped", t.unstake = "unstaked", t.withdraw = "withdrawn";
|
|
545
|
-
})(bt || (bt = {}));
|
|
546
|
-
const ne = nt`
|
|
547
|
-
:host > wui-flex {
|
|
548
|
-
display: flex;
|
|
549
|
-
justify-content: center;
|
|
550
|
-
align-items: center;
|
|
551
|
-
position: relative;
|
|
552
|
-
width: 40px;
|
|
553
|
-
height: 40px;
|
|
554
|
-
box-shadow: inset 0 0 0 1px ${({ tokens: t }) => t.core.glass010};
|
|
555
|
-
background-color: ${({ tokens: t }) => t.core.glass010};
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
:host([data-no-images='true']) > wui-flex {
|
|
559
|
-
background-color: ${({ tokens: t }) => t.theme.foregroundPrimary};
|
|
560
|
-
border-radius: ${({ borderRadius: t }) => t[3]} !important;
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
:host > wui-flex wui-image {
|
|
564
|
-
display: block;
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
:host > wui-flex,
|
|
568
|
-
:host > wui-flex wui-image,
|
|
569
|
-
.swap-images-container,
|
|
570
|
-
.swap-images-container.nft,
|
|
571
|
-
wui-image.nft {
|
|
572
|
-
border-top-left-radius: var(--local-left-border-radius);
|
|
573
|
-
border-top-right-radius: var(--local-right-border-radius);
|
|
574
|
-
border-bottom-left-radius: var(--local-left-border-radius);
|
|
575
|
-
border-bottom-right-radius: var(--local-right-border-radius);
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
wui-icon {
|
|
579
|
-
width: 20px;
|
|
580
|
-
height: 20px;
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
.swap-images-container {
|
|
584
|
-
position: relative;
|
|
585
|
-
width: 40px;
|
|
586
|
-
height: 40px;
|
|
587
|
-
overflow: hidden;
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
.swap-images-container wui-image:first-child {
|
|
591
|
-
position: absolute;
|
|
592
|
-
width: 40px;
|
|
593
|
-
height: 40px;
|
|
594
|
-
top: 0;
|
|
595
|
-
left: 0%;
|
|
596
|
-
clip-path: inset(0px calc(50% + 2px) 0px 0%);
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
.swap-images-container wui-image:last-child {
|
|
600
|
-
clip-path: inset(0px 0px 0px calc(50% + 2px));
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
wui-flex.status-box {
|
|
604
|
-
position: absolute;
|
|
605
|
-
right: 0;
|
|
606
|
-
bottom: 0;
|
|
607
|
-
transform: translate(20%, 20%);
|
|
608
|
-
border-radius: ${({ borderRadius: t }) => t[4]};
|
|
609
|
-
background-color: ${({ tokens: t }) => t.theme.backgroundPrimary};
|
|
610
|
-
box-shadow: 0 0 0 2px ${({ tokens: t }) => t.theme.backgroundPrimary};
|
|
611
|
-
overflow: hidden;
|
|
612
|
-
width: 16px;
|
|
613
|
-
height: 16px;
|
|
614
|
-
}
|
|
615
|
-
`;
|
|
616
|
-
var G = function(t, e, i, r) {
|
|
617
|
-
var o = arguments.length, n = o < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, i) : r, s;
|
|
618
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(t, e, i, r);
|
|
619
|
-
else for (var u = t.length - 1; u >= 0; u--) (s = t[u]) && (n = (o < 3 ? s(n) : o > 3 ? s(e, i, n) : s(e, i)) || n);
|
|
620
|
-
return o > 3 && n && Object.defineProperty(e, i, n), n;
|
|
621
|
-
};
|
|
622
|
-
let F = class extends ot {
|
|
623
|
-
constructor() {
|
|
624
|
-
super(...arguments), this.images = [], this.secondImage = {
|
|
625
|
-
type: void 0,
|
|
626
|
-
url: ""
|
|
627
|
-
};
|
|
628
|
-
}
|
|
629
|
-
render() {
|
|
630
|
-
const [e, i] = this.images;
|
|
631
|
-
this.images.length || (this.dataset.noImages = "true");
|
|
632
|
-
const r = (e == null ? void 0 : e.type) === "NFT", o = i != null && i.url ? i.type === "NFT" : r, n = r ? "var(--apkt-borderRadius-3)" : "var(--apkt-borderRadius-5)", s = o ? "var(--apkt-borderRadius-3)" : "var(--apkt-borderRadius-5)";
|
|
633
|
-
return this.style.cssText = `
|
|
634
|
-
--local-left-border-radius: ${n};
|
|
635
|
-
--local-right-border-radius: ${s};
|
|
636
|
-
`, w`<wui-flex> ${this.templateVisual()} ${this.templateIcon()} </wui-flex>`;
|
|
637
|
-
}
|
|
638
|
-
templateVisual() {
|
|
639
|
-
const [e, i] = this.images, r = e == null ? void 0 : e.type;
|
|
640
|
-
return this.images.length === 2 && (e != null && e.url || i != null && i.url) ? w`<div class="swap-images-container">
|
|
641
|
-
${e != null && e.url ? w`<wui-image src=${e.url} alt="Transaction image"></wui-image>` : null}
|
|
642
|
-
${i != null && i.url ? w`<wui-image src=${i.url} alt="Transaction image"></wui-image>` : null}
|
|
643
|
-
</div>` : e != null && e.url ? w`<wui-image src=${e.url} alt="Transaction image"></wui-image>` : r === "NFT" ? w`<wui-icon size="inherit" color="default" name="nftPlaceholder"></wui-icon>` : w`<wui-icon size="inherit" color="default" name="coinPlaceholder"></wui-icon>`;
|
|
644
|
-
}
|
|
645
|
-
templateIcon() {
|
|
646
|
-
let e = "accent-primary", i;
|
|
647
|
-
return i = this.getIcon(), this.status && (e = this.getStatusColor()), i ? w`
|
|
648
|
-
<wui-flex alignItems="center" justifyContent="center" class="status-box">
|
|
649
|
-
<wui-icon-box size="sm" color=${e} icon=${i}></wui-icon-box>
|
|
650
|
-
</wui-flex>
|
|
651
|
-
` : null;
|
|
652
|
-
}
|
|
653
|
-
getDirectionIcon() {
|
|
654
|
-
switch (this.direction) {
|
|
655
|
-
case "in":
|
|
656
|
-
return "arrowBottom";
|
|
657
|
-
case "out":
|
|
658
|
-
return "arrowTop";
|
|
659
|
-
default:
|
|
660
|
-
return;
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
getIcon() {
|
|
664
|
-
return this.onlyDirectionIcon ? this.getDirectionIcon() : this.type === "trade" ? "swapHorizontal" : this.type === "approve" ? "checkmark" : this.type === "cancel" ? "close" : this.getDirectionIcon();
|
|
665
|
-
}
|
|
666
|
-
getStatusColor() {
|
|
667
|
-
switch (this.status) {
|
|
668
|
-
case "confirmed":
|
|
669
|
-
return "success";
|
|
670
|
-
case "failed":
|
|
671
|
-
return "error";
|
|
672
|
-
case "pending":
|
|
673
|
-
return "inverse";
|
|
674
|
-
default:
|
|
675
|
-
return "accent-primary";
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
};
|
|
679
|
-
F.styles = [ne];
|
|
680
|
-
G([
|
|
681
|
-
M()
|
|
682
|
-
], F.prototype, "type", void 0);
|
|
683
|
-
G([
|
|
684
|
-
M()
|
|
685
|
-
], F.prototype, "status", void 0);
|
|
686
|
-
G([
|
|
687
|
-
M()
|
|
688
|
-
], F.prototype, "direction", void 0);
|
|
689
|
-
G([
|
|
690
|
-
M({ type: Boolean })
|
|
691
|
-
], F.prototype, "onlyDirectionIcon", void 0);
|
|
692
|
-
G([
|
|
693
|
-
M({ type: Array })
|
|
694
|
-
], F.prototype, "images", void 0);
|
|
695
|
-
G([
|
|
696
|
-
M({ type: Object })
|
|
697
|
-
], F.prototype, "secondImage", void 0);
|
|
698
|
-
F = G([
|
|
699
|
-
st("wui-transaction-visual")
|
|
700
|
-
], F);
|
|
701
|
-
const oe = nt`
|
|
702
|
-
:host {
|
|
703
|
-
width: 100%;
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
:host > wui-flex:first-child {
|
|
707
|
-
align-items: center;
|
|
708
|
-
column-gap: ${({ spacing: t }) => t[2]};
|
|
709
|
-
padding: ${({ spacing: t }) => t[1]} ${({ spacing: t }) => t[2]};
|
|
710
|
-
width: 100%;
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
:host > wui-flex:first-child wui-text:nth-child(1) {
|
|
714
|
-
text-transform: capitalize;
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
wui-transaction-visual {
|
|
718
|
-
width: 40px;
|
|
719
|
-
height: 40px;
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
wui-flex {
|
|
723
|
-
flex: 1;
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
:host wui-flex wui-flex {
|
|
727
|
-
overflow: hidden;
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
:host .description-container wui-text span {
|
|
731
|
-
word-break: break-all;
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
:host .description-container wui-text {
|
|
735
|
-
overflow: hidden;
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
:host .description-separator-icon {
|
|
739
|
-
margin: 0px 6px;
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
:host wui-text > span {
|
|
743
|
-
overflow: hidden;
|
|
744
|
-
display: -webkit-box;
|
|
745
|
-
-webkit-box-orient: vertical;
|
|
746
|
-
-webkit-line-clamp: 1;
|
|
747
|
-
}
|
|
748
|
-
`;
|
|
749
|
-
var Y = function(t, e, i, r) {
|
|
750
|
-
var o = arguments.length, n = o < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, i) : r, s;
|
|
751
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(t, e, i, r);
|
|
752
|
-
else for (var u = t.length - 1; u >= 0; u--) (s = t[u]) && (n = (o < 3 ? s(n) : o > 3 ? s(e, i, n) : s(e, i)) || n);
|
|
753
|
-
return o > 3 && n && Object.defineProperty(e, i, n), n;
|
|
754
|
-
};
|
|
755
|
-
let L = class extends ot {
|
|
756
|
-
constructor() {
|
|
757
|
-
super(...arguments), this.type = "approve", this.onlyDirectionIcon = !1, this.images = [];
|
|
758
|
-
}
|
|
759
|
-
render() {
|
|
760
|
-
return w`
|
|
761
|
-
<wui-flex>
|
|
762
|
-
<wui-transaction-visual
|
|
763
|
-
.status=${this.status}
|
|
764
|
-
direction=${jt(this.direction)}
|
|
765
|
-
type=${this.type}
|
|
766
|
-
.onlyDirectionIcon=${this.onlyDirectionIcon}
|
|
767
|
-
.images=${this.images}
|
|
768
|
-
></wui-transaction-visual>
|
|
769
|
-
<wui-flex flexDirection="column" gap="1">
|
|
770
|
-
<wui-text variant="lg-medium" color="primary">
|
|
771
|
-
${bt[this.type] || this.type}
|
|
772
|
-
</wui-text>
|
|
773
|
-
<wui-flex class="description-container">
|
|
774
|
-
${this.templateDescription()} ${this.templateSecondDescription()}
|
|
775
|
-
</wui-flex>
|
|
776
|
-
</wui-flex>
|
|
777
|
-
<wui-text variant="sm-medium" color="secondary"><span>${this.date}</span></wui-text>
|
|
778
|
-
</wui-flex>
|
|
779
|
-
`;
|
|
780
|
-
}
|
|
781
|
-
templateDescription() {
|
|
782
|
-
var i;
|
|
783
|
-
const e = (i = this.descriptions) == null ? void 0 : i[0];
|
|
784
|
-
return e ? w`
|
|
785
|
-
<wui-text variant="md-regular" color="secondary">
|
|
786
|
-
<span>${e}</span>
|
|
787
|
-
</wui-text>
|
|
788
|
-
` : null;
|
|
789
|
-
}
|
|
790
|
-
templateSecondDescription() {
|
|
791
|
-
var i;
|
|
792
|
-
const e = (i = this.descriptions) == null ? void 0 : i[1];
|
|
793
|
-
return e ? w`
|
|
794
|
-
<wui-icon class="description-separator-icon" size="sm" name="arrowRight"></wui-icon>
|
|
795
|
-
<wui-text variant="md-regular" color="secondary">
|
|
796
|
-
<span>${e}</span>
|
|
797
|
-
</wui-text>
|
|
798
|
-
` : null;
|
|
799
|
-
}
|
|
800
|
-
};
|
|
801
|
-
L.styles = [Ct, oe];
|
|
802
|
-
Y([
|
|
803
|
-
M()
|
|
804
|
-
], L.prototype, "type", void 0);
|
|
805
|
-
Y([
|
|
806
|
-
M({ type: Array })
|
|
807
|
-
], L.prototype, "descriptions", void 0);
|
|
808
|
-
Y([
|
|
809
|
-
M()
|
|
810
|
-
], L.prototype, "date", void 0);
|
|
811
|
-
Y([
|
|
812
|
-
M({ type: Boolean })
|
|
813
|
-
], L.prototype, "onlyDirectionIcon", void 0);
|
|
814
|
-
Y([
|
|
815
|
-
M()
|
|
816
|
-
], L.prototype, "status", void 0);
|
|
817
|
-
Y([
|
|
818
|
-
M()
|
|
819
|
-
], L.prototype, "direction", void 0);
|
|
820
|
-
Y([
|
|
821
|
-
M({ type: Array })
|
|
822
|
-
], L.prototype, "images", void 0);
|
|
823
|
-
L = Y([
|
|
824
|
-
st("wui-transaction-list-item")
|
|
825
|
-
], L);
|
|
826
|
-
const se = nt`
|
|
827
|
-
wui-flex {
|
|
828
|
-
position: relative;
|
|
829
|
-
display: inline-flex;
|
|
830
|
-
justify-content: center;
|
|
831
|
-
align-items: center;
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
wui-image {
|
|
835
|
-
border-radius: ${({ borderRadius: t }) => t[128]};
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
.fallback-icon {
|
|
839
|
-
color: ${({ tokens: t }) => t.theme.iconInverse};
|
|
840
|
-
border-radius: ${({ borderRadius: t }) => t[3]};
|
|
841
|
-
background-color: ${({ tokens: t }) => t.theme.foregroundPrimary};
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
.direction-icon,
|
|
845
|
-
.status-image {
|
|
846
|
-
position: absolute;
|
|
847
|
-
right: 0;
|
|
848
|
-
bottom: 0;
|
|
849
|
-
border-radius: ${({ borderRadius: t }) => t[128]};
|
|
850
|
-
border: 2px solid ${({ tokens: t }) => t.theme.backgroundPrimary};
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
.direction-icon {
|
|
854
|
-
padding: ${({ spacing: t }) => t["01"]};
|
|
855
|
-
color: ${({ tokens: t }) => t.core.iconSuccess};
|
|
856
|
-
|
|
857
|
-
background-color: color-mix(
|
|
858
|
-
in srgb,
|
|
859
|
-
${({ tokens: t }) => t.core.textSuccess} 30%,
|
|
860
|
-
${({ tokens: t }) => t.theme.backgroundPrimary} 70%
|
|
861
|
-
);
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
/* -- Sizes --------------------------------------------------- */
|
|
865
|
-
:host([data-size='sm']) > wui-image:not(.status-image),
|
|
866
|
-
:host([data-size='sm']) > wui-flex {
|
|
867
|
-
width: 24px;
|
|
868
|
-
height: 24px;
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
:host([data-size='lg']) > wui-image:not(.status-image),
|
|
872
|
-
:host([data-size='lg']) > wui-flex {
|
|
873
|
-
width: 40px;
|
|
874
|
-
height: 40px;
|
|
875
|
-
}
|
|
876
|
-
|
|
877
|
-
:host([data-size='sm']) .fallback-icon {
|
|
878
|
-
height: 16px;
|
|
879
|
-
width: 16px;
|
|
880
|
-
padding: ${({ spacing: t }) => t[1]};
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
:host([data-size='lg']) .fallback-icon {
|
|
884
|
-
height: 32px;
|
|
885
|
-
width: 32px;
|
|
886
|
-
padding: ${({ spacing: t }) => t[1]};
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
:host([data-size='sm']) .direction-icon,
|
|
890
|
-
:host([data-size='sm']) .status-image {
|
|
891
|
-
transform: translate(40%, 30%);
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
:host([data-size='lg']) .direction-icon,
|
|
895
|
-
:host([data-size='lg']) .status-image {
|
|
896
|
-
transform: translate(40%, 10%);
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
:host([data-size='sm']) .status-image {
|
|
900
|
-
height: 14px;
|
|
901
|
-
width: 14px;
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
:host([data-size='lg']) .status-image {
|
|
905
|
-
height: 20px;
|
|
906
|
-
width: 20px;
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
/* -- Crop effects --------------------------------------------------- */
|
|
910
|
-
.swap-crop-left-image,
|
|
911
|
-
.swap-crop-right-image {
|
|
912
|
-
position: absolute;
|
|
913
|
-
top: 0;
|
|
914
|
-
bottom: 0;
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
.swap-crop-left-image {
|
|
918
|
-
left: 0;
|
|
919
|
-
clip-path: inset(0px calc(50% + 1.5px) 0px 0%);
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
.swap-crop-right-image {
|
|
923
|
-
right: 0;
|
|
924
|
-
clip-path: inset(0px 0px 0px calc(50% + 1.5px));
|
|
925
|
-
}
|
|
926
|
-
`;
|
|
927
|
-
var ut = function(t, e, i, r) {
|
|
928
|
-
var o = arguments.length, n = o < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, i) : r, s;
|
|
929
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(t, e, i, r);
|
|
930
|
-
else for (var u = t.length - 1; u >= 0; u--) (s = t[u]) && (n = (o < 3 ? s(n) : o > 3 ? s(e, i, n) : s(e, i)) || n);
|
|
931
|
-
return o > 3 && n && Object.defineProperty(e, i, n), n;
|
|
932
|
-
};
|
|
933
|
-
const vt = {
|
|
934
|
-
sm: "xxs",
|
|
935
|
-
lg: "md"
|
|
936
|
-
};
|
|
937
|
-
let H = class extends ot {
|
|
938
|
-
constructor() {
|
|
939
|
-
super(...arguments), this.type = "approve", this.size = "lg", this.statusImageUrl = "", this.images = [];
|
|
940
|
-
}
|
|
941
|
-
render() {
|
|
942
|
-
return w`<wui-flex>${this.templateVisual()} ${this.templateIcon()}</wui-flex>`;
|
|
943
|
-
}
|
|
944
|
-
templateVisual() {
|
|
945
|
-
switch (this.dataset.size = this.size, this.type) {
|
|
946
|
-
case "trade":
|
|
947
|
-
return this.swapTemplate();
|
|
948
|
-
case "fiat":
|
|
949
|
-
return this.fiatTemplate();
|
|
950
|
-
case "unknown":
|
|
951
|
-
return this.unknownTemplate();
|
|
952
|
-
default:
|
|
953
|
-
return this.tokenTemplate();
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
swapTemplate() {
|
|
957
|
-
const [e, i] = this.images;
|
|
958
|
-
return this.images.length === 2 && (e || i) ? w`
|
|
959
|
-
<wui-image class="swap-crop-left-image" src=${e} alt="Swap image"></wui-image>
|
|
960
|
-
<wui-image class="swap-crop-right-image" src=${i} alt="Swap image"></wui-image>
|
|
961
|
-
` : e ? w`<wui-image src=${e} alt="Swap image"></wui-image>` : null;
|
|
962
|
-
}
|
|
963
|
-
fiatTemplate() {
|
|
964
|
-
return w`<wui-icon
|
|
965
|
-
class="fallback-icon"
|
|
966
|
-
size=${vt[this.size]}
|
|
967
|
-
name="dollar"
|
|
968
|
-
></wui-icon>`;
|
|
969
|
-
}
|
|
970
|
-
unknownTemplate() {
|
|
971
|
-
return w`<wui-icon
|
|
972
|
-
class="fallback-icon"
|
|
973
|
-
size=${vt[this.size]}
|
|
974
|
-
name="questionMark"
|
|
975
|
-
></wui-icon>`;
|
|
976
|
-
}
|
|
977
|
-
tokenTemplate() {
|
|
978
|
-
const [e] = this.images;
|
|
979
|
-
return e ? w`<wui-image src=${e} alt="Token image"></wui-image> ` : w`<wui-icon
|
|
980
|
-
class="fallback-icon"
|
|
981
|
-
name=${this.type === "nft" ? "image" : "coinPlaceholder"}
|
|
982
|
-
></wui-icon>`;
|
|
983
|
-
}
|
|
984
|
-
templateIcon() {
|
|
985
|
-
return this.statusImageUrl ? w`<wui-image
|
|
986
|
-
class="status-image"
|
|
987
|
-
src=${this.statusImageUrl}
|
|
988
|
-
alt="Status image"
|
|
989
|
-
></wui-image>` : w`<wui-icon
|
|
990
|
-
class="direction-icon"
|
|
991
|
-
size=${vt[this.size]}
|
|
992
|
-
name=${this.getTemplateIcon()}
|
|
993
|
-
></wui-icon>`;
|
|
994
|
-
}
|
|
995
|
-
getTemplateIcon() {
|
|
996
|
-
return this.type === "trade" ? "arrowClockWise" : "arrowBottom";
|
|
997
|
-
}
|
|
998
|
-
};
|
|
999
|
-
H.styles = [se];
|
|
1000
|
-
ut([
|
|
1001
|
-
M()
|
|
1002
|
-
], H.prototype, "type", void 0);
|
|
1003
|
-
ut([
|
|
1004
|
-
M()
|
|
1005
|
-
], H.prototype, "size", void 0);
|
|
1006
|
-
ut([
|
|
1007
|
-
M()
|
|
1008
|
-
], H.prototype, "statusImageUrl", void 0);
|
|
1009
|
-
ut([
|
|
1010
|
-
M({ type: Array })
|
|
1011
|
-
], H.prototype, "images", void 0);
|
|
1012
|
-
H = ut([
|
|
1013
|
-
st("wui-transaction-thumbnail")
|
|
1014
|
-
], H);
|
|
1015
|
-
const ae = nt`
|
|
1016
|
-
:host > wui-flex:first-child {
|
|
1017
|
-
gap: ${({ spacing: t }) => t[2]};
|
|
1018
|
-
padding: ${({ spacing: t }) => t[3]};
|
|
1019
|
-
width: 100%;
|
|
1020
|
-
}
|
|
1021
|
-
|
|
1022
|
-
wui-flex {
|
|
1023
|
-
display: flex;
|
|
1024
|
-
flex: 1;
|
|
1025
|
-
}
|
|
1026
|
-
`;
|
|
1027
|
-
var ue = function(t, e, i, r) {
|
|
1028
|
-
var o = arguments.length, n = o < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, i) : r, s;
|
|
1029
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(t, e, i, r);
|
|
1030
|
-
else for (var u = t.length - 1; u >= 0; u--) (s = t[u]) && (n = (o < 3 ? s(n) : o > 3 ? s(e, i, n) : s(e, i)) || n);
|
|
1031
|
-
return o > 3 && n && Object.defineProperty(e, i, n), n;
|
|
1032
|
-
};
|
|
1033
|
-
let Tt = class extends ot {
|
|
1034
|
-
render() {
|
|
1035
|
-
return w`
|
|
1036
|
-
<wui-flex alignItems="center">
|
|
1037
|
-
<wui-shimmer width="40px" height="40px" rounded></wui-shimmer>
|
|
1038
|
-
<wui-flex flexDirection="column" gap="1">
|
|
1039
|
-
<wui-shimmer width="124px" height="16px" rounded></wui-shimmer>
|
|
1040
|
-
<wui-shimmer width="60px" height="14px" rounded></wui-shimmer>
|
|
1041
|
-
</wui-flex>
|
|
1042
|
-
<wui-shimmer width="24px" height="12px" rounded></wui-shimmer>
|
|
1043
|
-
</wui-flex>
|
|
1044
|
-
`;
|
|
1045
|
-
}
|
|
1046
|
-
};
|
|
1047
|
-
Tt.styles = [Ct, ae];
|
|
1048
|
-
Tt = ue([
|
|
1049
|
-
st("wui-transaction-list-item-loader")
|
|
1050
|
-
], Tt);
|
|
1051
|
-
const ce = nt`
|
|
1052
|
-
:host {
|
|
1053
|
-
min-height: 100%;
|
|
1054
|
-
}
|
|
1055
|
-
|
|
1056
|
-
.group-container[last-group='true'] {
|
|
1057
|
-
padding-bottom: ${({ spacing: t }) => t[3]};
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
.contentContainer {
|
|
1061
|
-
height: 280px;
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1064
|
-
.contentContainer > wui-icon-box {
|
|
1065
|
-
width: 40px;
|
|
1066
|
-
height: 40px;
|
|
1067
|
-
border-radius: ${({ borderRadius: t }) => t[3]};
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
.contentContainer > .textContent {
|
|
1071
|
-
width: 65%;
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
.emptyContainer {
|
|
1075
|
-
height: 100%;
|
|
1076
|
-
}
|
|
1077
|
-
`;
|
|
1078
|
-
var V = function(t, e, i, r) {
|
|
1079
|
-
var o = arguments.length, n = o < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, i) : r, s;
|
|
1080
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(t, e, i, r);
|
|
1081
|
-
else for (var u = t.length - 1; u >= 0; u--) (s = t[u]) && (n = (o < 3 ? s(n) : o > 3 ? s(e, i, n) : s(e, i)) || n);
|
|
1082
|
-
return o > 3 && n && Object.defineProperty(e, i, n), n;
|
|
1083
|
-
};
|
|
1084
|
-
const At = "last-transaction", le = 7;
|
|
1085
|
-
let j = class extends ot {
|
|
1086
|
-
constructor() {
|
|
1087
|
-
super(), this.unsubscribe = [], this.paginationObserver = void 0, this.page = "activity", this.caipAddress = pt.state.activeCaipAddress, this.transactionsByYear = R.state.transactionsByYear, this.loading = R.state.loading, this.empty = R.state.empty, this.next = R.state.next, R.clearCursor(), this.unsubscribe.push(pt.subscribeKey("activeCaipAddress", (e) => {
|
|
1088
|
-
e && this.caipAddress !== e && (R.resetTransactions(), R.fetchTransactions(e)), this.caipAddress = e;
|
|
1089
|
-
}), pt.subscribeKey("activeCaipNetwork", () => {
|
|
1090
|
-
this.updateTransactionView();
|
|
1091
|
-
}), R.subscribe((e) => {
|
|
1092
|
-
this.transactionsByYear = e.transactionsByYear, this.loading = e.loading, this.empty = e.empty, this.next = e.next;
|
|
1093
|
-
}));
|
|
1094
|
-
}
|
|
1095
|
-
firstUpdated() {
|
|
1096
|
-
this.updateTransactionView(), this.createPaginationObserver();
|
|
1097
|
-
}
|
|
1098
|
-
updated() {
|
|
1099
|
-
this.setPaginationObserver();
|
|
1100
|
-
}
|
|
1101
|
-
disconnectedCallback() {
|
|
1102
|
-
this.unsubscribe.forEach((e) => e());
|
|
1103
|
-
}
|
|
1104
|
-
render() {
|
|
1105
|
-
return w` ${this.empty ? null : this.templateTransactionsByYear()}
|
|
1106
|
-
${this.loading ? this.templateLoading() : null}
|
|
1107
|
-
${!this.loading && this.empty ? this.templateEmpty() : null}`;
|
|
1108
|
-
}
|
|
1109
|
-
updateTransactionView() {
|
|
1110
|
-
R.resetTransactions(), this.caipAddress && R.fetchTransactions(xt.getPlainAddress(this.caipAddress));
|
|
1111
|
-
}
|
|
1112
|
-
templateTransactionsByYear() {
|
|
1113
|
-
return Object.keys(this.transactionsByYear).sort().reverse().map((i) => {
|
|
1114
|
-
const r = parseInt(i, 10), o = new Array(12).fill(null).map((n, s) => {
|
|
1115
|
-
var p;
|
|
1116
|
-
const u = Z.getTransactionGroupTitle(r, s), g = (p = this.transactionsByYear[r]) == null ? void 0 : p[s];
|
|
1117
|
-
return {
|
|
1118
|
-
groupTitle: u,
|
|
1119
|
-
transactions: g
|
|
1120
|
-
};
|
|
1121
|
-
}).filter(({ transactions: n }) => n).reverse();
|
|
1122
|
-
return o.map(({ groupTitle: n, transactions: s }, u) => {
|
|
1123
|
-
const g = u === o.length - 1;
|
|
1124
|
-
return s ? w`
|
|
1125
|
-
<wui-flex
|
|
1126
|
-
flexDirection="column"
|
|
1127
|
-
class="group-container"
|
|
1128
|
-
last-group="${g ? "true" : "false"}"
|
|
1129
|
-
data-testid="month-indexes"
|
|
1130
|
-
>
|
|
1131
|
-
<wui-flex
|
|
1132
|
-
alignItems="center"
|
|
1133
|
-
flexDirection="row"
|
|
1134
|
-
.padding=${["2", "3", "3", "3"]}
|
|
1135
|
-
>
|
|
1136
|
-
<wui-text variant="md-medium" color="secondary" data-testid="group-title">
|
|
1137
|
-
${n}
|
|
1138
|
-
</wui-text>
|
|
1139
|
-
</wui-flex>
|
|
1140
|
-
<wui-flex flexDirection="column" gap="2">
|
|
1141
|
-
${this.templateTransactions(s, g)}
|
|
1142
|
-
</wui-flex>
|
|
1143
|
-
</wui-flex>
|
|
1144
|
-
` : null;
|
|
1145
|
-
});
|
|
1146
|
-
});
|
|
1147
|
-
}
|
|
1148
|
-
templateRenderTransaction(e, i) {
|
|
1149
|
-
const { date: r, descriptions: o, direction: n, images: s, status: u, type: g, transfers: p, isAllNFT: y } = this.getTransactionListItemProps(e);
|
|
1150
|
-
return w`
|
|
1151
|
-
<wui-transaction-list-item
|
|
1152
|
-
date=${r}
|
|
1153
|
-
.direction=${n}
|
|
1154
|
-
id=${i && this.next ? At : ""}
|
|
1155
|
-
status=${u}
|
|
1156
|
-
type=${g}
|
|
1157
|
-
.images=${s}
|
|
1158
|
-
.onlyDirectionIcon=${y || p.length === 1}
|
|
1159
|
-
.descriptions=${o}
|
|
1160
|
-
></wui-transaction-list-item>
|
|
1161
|
-
`;
|
|
1162
|
-
}
|
|
1163
|
-
templateTransactions(e, i) {
|
|
1164
|
-
return e.map((r, o) => {
|
|
1165
|
-
const n = i && o === e.length - 1;
|
|
1166
|
-
return w`${this.templateRenderTransaction(r, n)}`;
|
|
1167
|
-
});
|
|
1168
|
-
}
|
|
1169
|
-
emptyStateActivity() {
|
|
1170
|
-
return w`<wui-flex
|
|
1171
|
-
class="emptyContainer"
|
|
1172
|
-
flexGrow="1"
|
|
1173
|
-
flexDirection="column"
|
|
1174
|
-
justifyContent="center"
|
|
1175
|
-
alignItems="center"
|
|
1176
|
-
.padding=${["10", "5", "10", "5"]}
|
|
1177
|
-
gap="5"
|
|
1178
|
-
data-testid="empty-activity-state"
|
|
1179
|
-
>
|
|
1180
|
-
<wui-icon-box color="default" icon="wallet" size="xl"></wui-icon-box>
|
|
1181
|
-
<wui-flex flexDirection="column" alignItems="center" gap="2">
|
|
1182
|
-
<wui-text align="center" variant="lg-medium" color="primary">No Transactions yet</wui-text>
|
|
1183
|
-
<wui-text align="center" variant="lg-regular" color="secondary"
|
|
1184
|
-
>Start trading on dApps <br />
|
|
1185
|
-
to grow your wallet!</wui-text
|
|
1186
|
-
>
|
|
1187
|
-
</wui-flex>
|
|
1188
|
-
</wui-flex>`;
|
|
1189
|
-
}
|
|
1190
|
-
emptyStateAccount() {
|
|
1191
|
-
return w`<wui-flex
|
|
1192
|
-
class="contentContainer"
|
|
1193
|
-
alignItems="center"
|
|
1194
|
-
justifyContent="center"
|
|
1195
|
-
flexDirection="column"
|
|
1196
|
-
gap="4"
|
|
1197
|
-
data-testid="empty-account-state"
|
|
1198
|
-
>
|
|
1199
|
-
<wui-icon-box icon="swapHorizontal" size="lg" color="default"></wui-icon-box>
|
|
1200
|
-
<wui-flex
|
|
1201
|
-
class="textContent"
|
|
1202
|
-
gap="2"
|
|
1203
|
-
flexDirection="column"
|
|
1204
|
-
justifyContent="center"
|
|
1205
|
-
flexDirection="column"
|
|
1206
|
-
>
|
|
1207
|
-
<wui-text variant="md-regular" align="center" color="primary">No activity yet</wui-text>
|
|
1208
|
-
<wui-text variant="sm-regular" align="center" color="secondary"
|
|
1209
|
-
>Your next transactions will appear here</wui-text
|
|
1210
|
-
>
|
|
1211
|
-
</wui-flex>
|
|
1212
|
-
<wui-link @click=${this.onReceiveClick.bind(this)}>Trade</wui-link>
|
|
1213
|
-
</wui-flex>`;
|
|
1214
|
-
}
|
|
1215
|
-
templateEmpty() {
|
|
1216
|
-
return this.page === "account" ? w`${this.emptyStateAccount()}` : w`${this.emptyStateActivity()}`;
|
|
1217
|
-
}
|
|
1218
|
-
templateLoading() {
|
|
1219
|
-
return this.page === "activity" ? Array(le).fill(w` <wui-transaction-list-item-loader></wui-transaction-list-item-loader> `).map((e) => e) : null;
|
|
1220
|
-
}
|
|
1221
|
-
onReceiveClick() {
|
|
1222
|
-
Rt.push("WalletReceive");
|
|
1223
|
-
}
|
|
1224
|
-
createPaginationObserver() {
|
|
1225
|
-
const { projectId: e } = Nt.state;
|
|
1226
|
-
this.paginationObserver = new IntersectionObserver(([i]) => {
|
|
1227
|
-
i != null && i.isIntersecting && !this.loading && (R.fetchTransactions(xt.getPlainAddress(this.caipAddress)), Lt.sendEvent({
|
|
1228
|
-
type: "track",
|
|
1229
|
-
event: "LOAD_MORE_TRANSACTIONS",
|
|
1230
|
-
properties: {
|
|
1231
|
-
address: xt.getPlainAddress(this.caipAddress),
|
|
1232
|
-
projectId: e,
|
|
1233
|
-
cursor: this.next,
|
|
1234
|
-
isSmartAccount: kt(pt.state.activeChain) === Ft.ACCOUNT_TYPES.SMART_ACCOUNT
|
|
1235
|
-
}
|
|
1236
|
-
}));
|
|
1237
|
-
}, {}), this.setPaginationObserver();
|
|
1238
|
-
}
|
|
1239
|
-
setPaginationObserver() {
|
|
1240
|
-
var i, r, o;
|
|
1241
|
-
(i = this.paginationObserver) == null || i.disconnect();
|
|
1242
|
-
const e = (r = this.shadowRoot) == null ? void 0 : r.querySelector(`#${At}`);
|
|
1243
|
-
e && ((o = this.paginationObserver) == null || o.observe(e));
|
|
1244
|
-
}
|
|
1245
|
-
getTransactionListItemProps(e) {
|
|
1246
|
-
var g, p, y;
|
|
1247
|
-
const i = $t.formatDate((g = e == null ? void 0 : e.metadata) == null ? void 0 : g.minedAt), r = Z.mergeTransfers(e == null ? void 0 : e.transfers), o = Z.getTransactionDescriptions(e, r), n = r == null ? void 0 : r[0], s = !!n && (r == null ? void 0 : r.every(($) => !!$.nft_info)), u = Z.getTransactionImages(r);
|
|
1248
|
-
return {
|
|
1249
|
-
date: i,
|
|
1250
|
-
direction: n == null ? void 0 : n.direction,
|
|
1251
|
-
descriptions: o,
|
|
1252
|
-
isAllNFT: s,
|
|
1253
|
-
images: u,
|
|
1254
|
-
status: (p = e.metadata) == null ? void 0 : p.status,
|
|
1255
|
-
transfers: r,
|
|
1256
|
-
type: (y = e.metadata) == null ? void 0 : y.operationType
|
|
1257
|
-
};
|
|
1258
|
-
}
|
|
1259
|
-
};
|
|
1260
|
-
j.styles = ce;
|
|
1261
|
-
V([
|
|
1262
|
-
M()
|
|
1263
|
-
], j.prototype, "page", void 0);
|
|
1264
|
-
V([
|
|
1265
|
-
at()
|
|
1266
|
-
], j.prototype, "caipAddress", void 0);
|
|
1267
|
-
V([
|
|
1268
|
-
at()
|
|
1269
|
-
], j.prototype, "transactionsByYear", void 0);
|
|
1270
|
-
V([
|
|
1271
|
-
at()
|
|
1272
|
-
], j.prototype, "loading", void 0);
|
|
1273
|
-
V([
|
|
1274
|
-
at()
|
|
1275
|
-
], j.prototype, "empty", void 0);
|
|
1276
|
-
V([
|
|
1277
|
-
at()
|
|
1278
|
-
], j.prototype, "next", void 0);
|
|
1279
|
-
j = V([
|
|
1280
|
-
st("w3m-activity-list")
|
|
1281
|
-
], j);
|