@directcryptopay/sdk 0.1.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 +357 -0
- package/dist/ConstantsUtil-B-_-u8aQ.js +6 -0
- package/dist/add-KF4m4jFK.js +19 -0
- package/dist/all-wallets-D6NAjQgX.js +10 -0
- package/dist/app-store-D7TTn-EO.js +21 -0
- package/dist/apple-DjX2E2hE.js +22 -0
- package/dist/arrow-bottom-C0YrNJYB.js +12 -0
- package/dist/arrow-bottom-circle-Dlxvx_XG.js +15 -0
- package/dist/arrow-left-x8_-lUyK.js +12 -0
- package/dist/arrow-right-BTZybj80.js +12 -0
- package/dist/arrow-top-LzH7iLCp.js +12 -0
- package/dist/bank-23jp-IV_.js +18 -0
- package/dist/browser-EjoorDid.js +18 -0
- package/dist/card-DGgWwtwC.js +18 -0
- package/dist/ccip-BMANewTU.js +150 -0
- package/dist/checkmark-B1qcQhBo.js +15 -0
- package/dist/checkmark-bold-Cyc4IEEJ.js +12 -0
- package/dist/chevron-bottom-ClHs08rB.js +12 -0
- package/dist/chevron-left-O8h_551_.js +12 -0
- package/dist/chevron-right-DP3xpyIA.js +12 -0
- package/dist/chevron-top-CuwkBUs9.js +12 -0
- package/dist/chrome-store-zfT_aJ3R.js +65 -0
- package/dist/clock-DHZqivIS.js +12 -0
- package/dist/close-Cp9rNAw4.js +12 -0
- package/dist/coinPlaceholder-U7-T1KKQ.js +12 -0
- package/dist/compass-Ds5-PRSR.js +12 -0
- package/dist/copy-Jg4HdIMf.js +19 -0
- package/dist/core/api.d.ts +30 -0
- package/dist/core/config.d.ts +59 -0
- package/dist/core/logic.d.ts +2 -0
- package/dist/core/wallet.d.ts +34 -0
- package/dist/cursor-DmMevduB.js +7 -0
- package/dist/cursor-transparent-Dn9-1SV8.js +16 -0
- package/dist/dcp-sdk.umd.js +12000 -0
- package/dist/dcp.d.ts +10 -0
- package/dist/desktop-C4udXXlZ.js +13 -0
- package/dist/disconnect-wd1BYLxt.js +12 -0
- package/dist/discord-DthxuCAP.js +21 -0
- package/dist/email-B3jSnUFE.js +696 -0
- package/dist/embedded-wallet-CJHmoBI2.js +468 -0
- package/dist/etherscan-Cjp4xfMW.js +10 -0
- package/dist/exclamation-triangle-CRNR5WOy.js +8 -0
- package/dist/extension-Cydk0mZt.js +12 -0
- package/dist/external-link-CuPTAoq9.js +12 -0
- package/dist/facebook-CghqXmdf.js +30 -0
- package/dist/farcaster-BREqMX4y.js +16 -0
- package/dist/filters-Dn_Ys7ew.js +12 -0
- package/dist/github-C-A7JmIY.js +22 -0
- package/dist/google-CCdM_naE.js +22 -0
- package/dist/hashTypedData-D2Qmzscs.js +197 -0
- package/dist/help-circle-DIH4vyj3.js +16 -0
- package/dist/id-DkJ0gBuy.js +16 -0
- package/dist/if-defined-BciplFKz.js +744 -0
- package/dist/image-qMjyiXM0.js +8 -0
- package/dist/index--3Zp0jAb.js +45 -0
- package/dist/index-1adX-Fit.js +65 -0
- package/dist/index-AvC0IGDl.js +7864 -0
- package/dist/index-B2-vKLd8.js +276 -0
- package/dist/index-B2iDt0TJ.js +146 -0
- package/dist/index-B5zkXsLJ.js +320 -0
- package/dist/index-B7K86vWu.js +1742 -0
- package/dist/index-BBkcvSiY.js +511 -0
- package/dist/index-BdjxQs66.js +181 -0
- package/dist/index-Bijd4_Ns.js +294 -0
- package/dist/index-BpXOsxzU.js +387 -0
- package/dist/index-C1QEJL-2.js +572 -0
- package/dist/index-C27dwOyE.js +243 -0
- package/dist/index-C4BX3QW8.js +58 -0
- package/dist/index-CMPIqsB1.js +170 -0
- package/dist/index-CTYngdl0.js +21991 -0
- package/dist/index-CUdQyyFn.js +51 -0
- package/dist/index-CX60z_g2.js +573 -0
- package/dist/index-CppCc1n8.js +65 -0
- package/dist/index-CqVegmN4.js +559 -0
- package/dist/index-CuiyMA8F.js +78 -0
- package/dist/index-CwB_qRfM.js +305 -0
- package/dist/index-CxOF7GqE.js +265 -0
- package/dist/index-D-IzHD_8.js +54 -0
- package/dist/index-DRNiFv9I.js +218 -0
- package/dist/index-Da8oZh8H.js +838 -0
- package/dist/index-DiHImG4L.js +44236 -0
- package/dist/index-DmOMXRG1.js +181 -0
- package/dist/index-DoSYqTQg.js +199 -0
- package/dist/index-DpHXq5_E.js +603 -0
- package/dist/index-DtCsAVBg.js +78 -0
- package/dist/index-Ij6XA6_4.js +77 -0
- package/dist/index-SzyBYfzA.js +8490 -0
- package/dist/index-eW8y-mXH.js +257 -0
- package/dist/index-fxzIDZsb.js +75 -0
- package/dist/index-lbhz9evJ.js +97 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -0
- package/dist/info-DMIGgjkL.js +7 -0
- package/dist/info-circle-CJuIKZSx.js +16 -0
- package/dist/lightbulb-qFT6WEWV.js +7 -0
- package/dist/localBatchGatewayRequest-CsMVMFBc.js +91 -0
- package/dist/mail-DoYgQvOt.js +12 -0
- package/dist/mobile-URtsh7o-.js +13 -0
- package/dist/more-DoQd10TF.js +15 -0
- package/dist/network-placeholder-BBA2Ue6C.js +18 -0
- package/dist/nftPlaceholder-C9RXWz9k.js +12 -0
- package/dist/off-YcuDQczT.js +12 -0
- package/dist/onramp-BfqDIx4o.js +1279 -0
- package/dist/parseSignature-280HB24T.js +3560 -0
- package/dist/play-store-sFaloG_r.js +36 -0
- package/dist/plus-l0wekSht.js +17 -0
- package/dist/qr-code-CihrUU4G.js +10 -0
- package/dist/receive-dfY1Cu-g.js +186 -0
- package/dist/recycle-horizontal-nXu6YaPw.js +13 -0
- package/dist/ref-huAzXCX0.js +41 -0
- package/dist/refresh-D2ZbVeNC.js +12 -0
- package/dist/reown-logo-BMaTMJmc.js +16 -0
- package/dist/search-YVM9q3J-.js +12 -0
- package/dist/secp256k1-BrysY3Sv.js +1302 -0
- package/dist/secp256k1-DPQgTBwQ.js +1510 -0
- package/dist/send-BwQZPKxI.js +19 -0
- package/dist/send-GyetMVu1.js +1038 -0
- package/dist/socials-B0W91J9k.js +574 -0
- package/dist/swapHorizontal-Dy_oQEkp.js +12 -0
- package/dist/swapHorizontalBold-C4JpaMpc.js +12 -0
- package/dist/swapHorizontalMedium-D5NuVZFh.js +20 -0
- package/dist/swapHorizontalRoundedBold-Bq4P2MCj.js +12 -0
- package/dist/swapVertical-CVQ8Mg03.js +12 -0
- package/dist/swaps-CA04SSdK.js +1637 -0
- package/dist/telegram-BP4SgW_L.js +20 -0
- package/dist/three-dots-BJYGJ-dQ.js +9 -0
- package/dist/transactions-Bq-98Tsg.js +37 -0
- package/dist/twitch-DTATWo9M.js +22 -0
- package/dist/twitterIcon-D5UWPInb.js +10 -0
- package/dist/types.d.ts +128 -0
- package/dist/ui/Modal.d.ts +9 -0
- package/dist/ui/index.d.ts +6 -0
- package/dist/verify-Byvj8Wi1.js +12 -0
- package/dist/verify-filled-B40taNm0.js +12 -0
- package/dist/w3m-modal-HV6SE74G.js +1037 -0
- package/dist/wallet-Cp-6Kk88.js +12 -0
- package/dist/wallet-placeholder-C3juwA9o.js +18 -0
- package/dist/walletconnect-CRkIiLCx.js +36 -0
- package/dist/warning-circle-DtvCLwG4.js +16 -0
- package/dist/x-Cqyx5eCt.js +16 -0
- package/package.json +70 -0
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
import { cz as R, cA as k, cB as a, cC as Y, cT as v, dc as p, cY as O, cE as L, dd as z, d3 as V, cS as E, cX as F } from "./index-DiHImG4L.js";
|
|
2
|
+
import { n as l, c as _, o as j, r as b } from "./if-defined-BciplFKz.js";
|
|
3
|
+
import { T as A, D as W } from "./index-BBkcvSiY.js";
|
|
4
|
+
import "./index-fxzIDZsb.js";
|
|
5
|
+
import "./index-D-IzHD_8.js";
|
|
6
|
+
import "./index-CUdQyyFn.js";
|
|
7
|
+
var N;
|
|
8
|
+
(function(s) {
|
|
9
|
+
s.approve = "approved", s.bought = "bought", s.borrow = "borrowed", s.burn = "burnt", s.cancel = "canceled", s.claim = "claimed", s.deploy = "deployed", s.deposit = "deposited", s.execute = "executed", s.mint = "minted", s.receive = "received", s.repay = "repaid", s.send = "sent", s.sell = "sold", s.stake = "staked", s.trade = "swapped", s.unstake = "unstaked", s.withdraw = "withdrawn";
|
|
10
|
+
})(N || (N = {}));
|
|
11
|
+
const U = R`
|
|
12
|
+
:host > wui-flex {
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
align-items: center;
|
|
16
|
+
position: relative;
|
|
17
|
+
width: 40px;
|
|
18
|
+
height: 40px;
|
|
19
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
|
|
20
|
+
background-color: var(--wui-color-gray-glass-005);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:host > wui-flex wui-image {
|
|
24
|
+
display: block;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:host > wui-flex,
|
|
28
|
+
:host > wui-flex wui-image,
|
|
29
|
+
.swap-images-container,
|
|
30
|
+
.swap-images-container.nft,
|
|
31
|
+
wui-image.nft {
|
|
32
|
+
border-top-left-radius: var(--local-left-border-radius);
|
|
33
|
+
border-top-right-radius: var(--local-right-border-radius);
|
|
34
|
+
border-bottom-left-radius: var(--local-left-border-radius);
|
|
35
|
+
border-bottom-right-radius: var(--local-right-border-radius);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
wui-icon {
|
|
39
|
+
width: 20px;
|
|
40
|
+
height: 20px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
wui-icon-box {
|
|
44
|
+
position: absolute;
|
|
45
|
+
right: 0;
|
|
46
|
+
bottom: 0;
|
|
47
|
+
transform: translate(20%, 20%);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.swap-images-container {
|
|
51
|
+
position: relative;
|
|
52
|
+
width: 40px;
|
|
53
|
+
height: 40px;
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.swap-images-container wui-image:first-child {
|
|
58
|
+
position: absolute;
|
|
59
|
+
width: 40px;
|
|
60
|
+
height: 40px;
|
|
61
|
+
top: 0;
|
|
62
|
+
left: 0%;
|
|
63
|
+
clip-path: inset(0px calc(50% + 2px) 0px 0%);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.swap-images-container wui-image:last-child {
|
|
67
|
+
clip-path: inset(0px 0px 0px calc(50% + 2px));
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
var m = function(s, t, e, r) {
|
|
71
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, e) : r, n;
|
|
72
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(s, t, e, r);
|
|
73
|
+
else for (var c = s.length - 1; c >= 0; c--) (n = s[c]) && (i = (o < 3 ? n(i) : o > 3 ? n(t, e, i) : n(t, e)) || i);
|
|
74
|
+
return o > 3 && i && Object.defineProperty(t, e, i), i;
|
|
75
|
+
};
|
|
76
|
+
let f = class extends k {
|
|
77
|
+
constructor() {
|
|
78
|
+
super(...arguments), this.images = [], this.secondImage = {
|
|
79
|
+
type: void 0,
|
|
80
|
+
url: ""
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
render() {
|
|
84
|
+
const [t, e] = this.images, r = (t == null ? void 0 : t.type) === "NFT", o = e != null && e.url ? e.type === "NFT" : r, i = r ? "var(--wui-border-radius-xxs)" : "var(--wui-border-radius-s)", n = o ? "var(--wui-border-radius-xxs)" : "var(--wui-border-radius-s)";
|
|
85
|
+
return this.style.cssText = `
|
|
86
|
+
--local-left-border-radius: ${i};
|
|
87
|
+
--local-right-border-radius: ${n};
|
|
88
|
+
`, a`<wui-flex> ${this.templateVisual()} ${this.templateIcon()} </wui-flex>`;
|
|
89
|
+
}
|
|
90
|
+
templateVisual() {
|
|
91
|
+
const [t, e] = this.images, r = t == null ? void 0 : t.type;
|
|
92
|
+
return this.images.length === 2 && (t != null && t.url || e != null && e.url) ? a`<div class="swap-images-container">
|
|
93
|
+
${t != null && t.url ? a`<wui-image src=${t.url} alt="Transaction image"></wui-image>` : null}
|
|
94
|
+
${e != null && e.url ? a`<wui-image src=${e.url} alt="Transaction image"></wui-image>` : null}
|
|
95
|
+
</div>` : t != null && t.url ? a`<wui-image src=${t.url} alt="Transaction image"></wui-image>` : r === "NFT" ? a`<wui-icon size="inherit" color="fg-200" name="nftPlaceholder"></wui-icon>` : a`<wui-icon size="inherit" color="fg-200" name="coinPlaceholder"></wui-icon>`;
|
|
96
|
+
}
|
|
97
|
+
templateIcon() {
|
|
98
|
+
let t = "accent-100", e;
|
|
99
|
+
return e = this.getIcon(), this.status && (t = this.getStatusColor()), e ? a`
|
|
100
|
+
<wui-icon-box
|
|
101
|
+
size="xxs"
|
|
102
|
+
iconColor=${t}
|
|
103
|
+
backgroundColor=${t}
|
|
104
|
+
background="opaque"
|
|
105
|
+
icon=${e}
|
|
106
|
+
?border=${!0}
|
|
107
|
+
borderColor="wui-color-bg-125"
|
|
108
|
+
></wui-icon-box>
|
|
109
|
+
` : null;
|
|
110
|
+
}
|
|
111
|
+
getDirectionIcon() {
|
|
112
|
+
switch (this.direction) {
|
|
113
|
+
case "in":
|
|
114
|
+
return "arrowBottom";
|
|
115
|
+
case "out":
|
|
116
|
+
return "arrowTop";
|
|
117
|
+
default:
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
getIcon() {
|
|
122
|
+
return this.onlyDirectionIcon ? this.getDirectionIcon() : this.type === "trade" ? "swapHorizontalBold" : this.type === "approve" ? "checkmark" : this.type === "cancel" ? "close" : this.getDirectionIcon();
|
|
123
|
+
}
|
|
124
|
+
getStatusColor() {
|
|
125
|
+
switch (this.status) {
|
|
126
|
+
case "confirmed":
|
|
127
|
+
return "success-100";
|
|
128
|
+
case "failed":
|
|
129
|
+
return "error-100";
|
|
130
|
+
case "pending":
|
|
131
|
+
return "inverse-100";
|
|
132
|
+
default:
|
|
133
|
+
return "accent-100";
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
f.styles = [U];
|
|
138
|
+
m([
|
|
139
|
+
l()
|
|
140
|
+
], f.prototype, "type", void 0);
|
|
141
|
+
m([
|
|
142
|
+
l()
|
|
143
|
+
], f.prototype, "status", void 0);
|
|
144
|
+
m([
|
|
145
|
+
l()
|
|
146
|
+
], f.prototype, "direction", void 0);
|
|
147
|
+
m([
|
|
148
|
+
l({ type: Boolean })
|
|
149
|
+
], f.prototype, "onlyDirectionIcon", void 0);
|
|
150
|
+
m([
|
|
151
|
+
l({ type: Array })
|
|
152
|
+
], f.prototype, "images", void 0);
|
|
153
|
+
m([
|
|
154
|
+
l({ type: Object })
|
|
155
|
+
], f.prototype, "secondImage", void 0);
|
|
156
|
+
f = m([
|
|
157
|
+
_("wui-transaction-visual")
|
|
158
|
+
], f);
|
|
159
|
+
const G = R`
|
|
160
|
+
:host > wui-flex:first-child {
|
|
161
|
+
align-items: center;
|
|
162
|
+
column-gap: var(--wui-spacing-s);
|
|
163
|
+
padding: 6.5px var(--wui-spacing-xs) 6.5px var(--wui-spacing-xs);
|
|
164
|
+
width: 100%;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
:host > wui-flex:first-child wui-text:nth-child(1) {
|
|
168
|
+
text-transform: capitalize;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
wui-transaction-visual {
|
|
172
|
+
width: 40px;
|
|
173
|
+
height: 40px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
wui-flex {
|
|
177
|
+
flex: 1;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
:host wui-flex wui-flex {
|
|
181
|
+
overflow: hidden;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
:host .description-container wui-text span {
|
|
185
|
+
word-break: break-all;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
:host .description-container wui-text {
|
|
189
|
+
overflow: hidden;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
:host .description-separator-icon {
|
|
193
|
+
margin: 0px 6px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
:host wui-text > span {
|
|
197
|
+
overflow: hidden;
|
|
198
|
+
display: -webkit-box;
|
|
199
|
+
-webkit-box-orient: vertical;
|
|
200
|
+
-webkit-line-clamp: 1;
|
|
201
|
+
}
|
|
202
|
+
`;
|
|
203
|
+
var w = function(s, t, e, r) {
|
|
204
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, e) : r, n;
|
|
205
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(s, t, e, r);
|
|
206
|
+
else for (var c = s.length - 1; c >= 0; c--) (n = s[c]) && (i = (o < 3 ? n(i) : o > 3 ? n(t, e, i) : n(t, e)) || i);
|
|
207
|
+
return o > 3 && i && Object.defineProperty(t, e, i), i;
|
|
208
|
+
};
|
|
209
|
+
let d = class extends k {
|
|
210
|
+
constructor() {
|
|
211
|
+
super(...arguments), this.type = "approve", this.onlyDirectionIcon = !1, this.images = [], this.price = [], this.amount = [], this.symbol = [];
|
|
212
|
+
}
|
|
213
|
+
render() {
|
|
214
|
+
return a`
|
|
215
|
+
<wui-flex>
|
|
216
|
+
<wui-transaction-visual
|
|
217
|
+
.status=${this.status}
|
|
218
|
+
direction=${j(this.direction)}
|
|
219
|
+
type=${this.type}
|
|
220
|
+
onlyDirectionIcon=${j(this.onlyDirectionIcon)}
|
|
221
|
+
.images=${this.images}
|
|
222
|
+
></wui-transaction-visual>
|
|
223
|
+
<wui-flex flexDirection="column" gap="3xs">
|
|
224
|
+
<wui-text variant="paragraph-600" color="fg-100">
|
|
225
|
+
${N[this.type] || this.type}
|
|
226
|
+
</wui-text>
|
|
227
|
+
<wui-flex class="description-container">
|
|
228
|
+
${this.templateDescription()} ${this.templateSecondDescription()}
|
|
229
|
+
</wui-flex>
|
|
230
|
+
</wui-flex>
|
|
231
|
+
<wui-text variant="micro-700" color="fg-300"><span>${this.date}</span></wui-text>
|
|
232
|
+
</wui-flex>
|
|
233
|
+
`;
|
|
234
|
+
}
|
|
235
|
+
templateDescription() {
|
|
236
|
+
var e;
|
|
237
|
+
const t = (e = this.descriptions) == null ? void 0 : e[0];
|
|
238
|
+
return t ? a`
|
|
239
|
+
<wui-text variant="small-500" color="fg-200">
|
|
240
|
+
<span>${t}</span>
|
|
241
|
+
</wui-text>
|
|
242
|
+
` : null;
|
|
243
|
+
}
|
|
244
|
+
templateSecondDescription() {
|
|
245
|
+
var e;
|
|
246
|
+
const t = (e = this.descriptions) == null ? void 0 : e[1];
|
|
247
|
+
return t ? a`
|
|
248
|
+
<wui-icon class="description-separator-icon" size="xxs" name="arrowRight"></wui-icon>
|
|
249
|
+
<wui-text variant="small-400" color="fg-200">
|
|
250
|
+
<span>${t}</span>
|
|
251
|
+
</wui-text>
|
|
252
|
+
` : null;
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
d.styles = [Y, G];
|
|
256
|
+
w([
|
|
257
|
+
l()
|
|
258
|
+
], d.prototype, "type", void 0);
|
|
259
|
+
w([
|
|
260
|
+
l({ type: Array })
|
|
261
|
+
], d.prototype, "descriptions", void 0);
|
|
262
|
+
w([
|
|
263
|
+
l()
|
|
264
|
+
], d.prototype, "date", void 0);
|
|
265
|
+
w([
|
|
266
|
+
l({ type: Boolean })
|
|
267
|
+
], d.prototype, "onlyDirectionIcon", void 0);
|
|
268
|
+
w([
|
|
269
|
+
l()
|
|
270
|
+
], d.prototype, "status", void 0);
|
|
271
|
+
w([
|
|
272
|
+
l()
|
|
273
|
+
], d.prototype, "direction", void 0);
|
|
274
|
+
w([
|
|
275
|
+
l({ type: Array })
|
|
276
|
+
], d.prototype, "images", void 0);
|
|
277
|
+
w([
|
|
278
|
+
l({ type: Array })
|
|
279
|
+
], d.prototype, "price", void 0);
|
|
280
|
+
w([
|
|
281
|
+
l({ type: Array })
|
|
282
|
+
], d.prototype, "amount", void 0);
|
|
283
|
+
w([
|
|
284
|
+
l({ type: Array })
|
|
285
|
+
], d.prototype, "symbol", void 0);
|
|
286
|
+
d = w([
|
|
287
|
+
_("wui-transaction-list-item")
|
|
288
|
+
], d);
|
|
289
|
+
const M = R`
|
|
290
|
+
:host {
|
|
291
|
+
min-height: 100%;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.group-container[last-group='true'] {
|
|
295
|
+
padding-bottom: var(--wui-spacing-m);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.contentContainer {
|
|
299
|
+
height: 280px;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.contentContainer > wui-icon-box {
|
|
303
|
+
width: 40px;
|
|
304
|
+
height: 40px;
|
|
305
|
+
border-radius: var(--wui-border-radius-xxs);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.contentContainer > .textContent {
|
|
309
|
+
width: 65%;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.emptyContainer {
|
|
313
|
+
height: 100%;
|
|
314
|
+
}
|
|
315
|
+
`;
|
|
316
|
+
var x = function(s, t, e, r) {
|
|
317
|
+
var o = arguments.length, i = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, e) : r, n;
|
|
318
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(s, t, e, r);
|
|
319
|
+
else for (var c = s.length - 1; c >= 0; c--) (n = s[c]) && (i = (o < 3 ? n(i) : o > 3 ? n(t, e, i) : n(t, e)) || i);
|
|
320
|
+
return o > 3 && i && Object.defineProperty(t, e, i), i;
|
|
321
|
+
};
|
|
322
|
+
const D = "last-transaction", K = 7;
|
|
323
|
+
let g = class extends k {
|
|
324
|
+
constructor() {
|
|
325
|
+
super(), this.unsubscribe = [], this.paginationObserver = void 0, this.page = "activity", this.caipAddress = v.state.activeCaipAddress, this.transactionsByYear = p.state.transactionsByYear, this.loading = p.state.loading, this.empty = p.state.empty, this.next = p.state.next, p.clearCursor(), this.unsubscribe.push(v.subscribeKey("activeCaipAddress", (t) => {
|
|
326
|
+
t && this.caipAddress !== t && (p.resetTransactions(), p.fetchTransactions(t)), this.caipAddress = t;
|
|
327
|
+
}), v.subscribeKey("activeCaipNetwork", () => {
|
|
328
|
+
this.updateTransactionView();
|
|
329
|
+
}), p.subscribe((t) => {
|
|
330
|
+
this.transactionsByYear = t.transactionsByYear, this.loading = t.loading, this.empty = t.empty, this.next = t.next;
|
|
331
|
+
}));
|
|
332
|
+
}
|
|
333
|
+
firstUpdated() {
|
|
334
|
+
this.updateTransactionView(), this.createPaginationObserver();
|
|
335
|
+
}
|
|
336
|
+
updated() {
|
|
337
|
+
this.setPaginationObserver();
|
|
338
|
+
}
|
|
339
|
+
disconnectedCallback() {
|
|
340
|
+
this.unsubscribe.forEach((t) => t());
|
|
341
|
+
}
|
|
342
|
+
render() {
|
|
343
|
+
return a` ${this.empty ? null : this.templateTransactionsByYear()}
|
|
344
|
+
${this.loading ? this.templateLoading() : null}
|
|
345
|
+
${!this.loading && this.empty ? this.templateEmpty() : null}`;
|
|
346
|
+
}
|
|
347
|
+
updateTransactionView() {
|
|
348
|
+
var r;
|
|
349
|
+
const t = (r = v.state.activeCaipNetwork) == null ? void 0 : r.caipNetworkId;
|
|
350
|
+
p.state.lastNetworkInView !== t && (p.resetTransactions(), this.caipAddress && p.fetchTransactions(O.getPlainAddress(this.caipAddress))), p.setLastNetworkInView(t);
|
|
351
|
+
}
|
|
352
|
+
templateTransactionsByYear() {
|
|
353
|
+
return Object.keys(this.transactionsByYear).sort().reverse().map((e) => {
|
|
354
|
+
const r = parseInt(e, 10), o = new Array(12).fill(null).map((i, n) => {
|
|
355
|
+
var u;
|
|
356
|
+
const c = A.getTransactionGroupTitle(r, n), h = (u = this.transactionsByYear[r]) == null ? void 0 : u[n];
|
|
357
|
+
return {
|
|
358
|
+
groupTitle: c,
|
|
359
|
+
transactions: h
|
|
360
|
+
};
|
|
361
|
+
}).filter(({ transactions: i }) => i).reverse();
|
|
362
|
+
return o.map(({ groupTitle: i, transactions: n }, c) => {
|
|
363
|
+
const h = c === o.length - 1;
|
|
364
|
+
return n ? a`
|
|
365
|
+
<wui-flex
|
|
366
|
+
flexDirection="column"
|
|
367
|
+
class="group-container"
|
|
368
|
+
last-group="${h ? "true" : "false"}"
|
|
369
|
+
data-testid="month-indexes"
|
|
370
|
+
>
|
|
371
|
+
<wui-flex
|
|
372
|
+
alignItems="center"
|
|
373
|
+
flexDirection="row"
|
|
374
|
+
.padding=${["xs", "s", "s", "s"]}
|
|
375
|
+
>
|
|
376
|
+
<wui-text variant="paragraph-500" color="fg-200" data-testid="group-title"
|
|
377
|
+
>${i}</wui-text
|
|
378
|
+
>
|
|
379
|
+
</wui-flex>
|
|
380
|
+
<wui-flex flexDirection="column" gap="xs">
|
|
381
|
+
${this.templateTransactions(n, h)}
|
|
382
|
+
</wui-flex>
|
|
383
|
+
</wui-flex>
|
|
384
|
+
` : null;
|
|
385
|
+
});
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
templateRenderTransaction(t, e) {
|
|
389
|
+
const { date: r, descriptions: o, direction: i, isAllNFT: n, images: c, status: h, transfers: u, type: y } = this.getTransactionListItemProps(t), $ = (u == null ? void 0 : u.length) > 1;
|
|
390
|
+
return (u == null ? void 0 : u.length) === 2 && !n ? a`
|
|
391
|
+
<wui-transaction-list-item
|
|
392
|
+
date=${r}
|
|
393
|
+
.direction=${i}
|
|
394
|
+
id=${e && this.next ? D : ""}
|
|
395
|
+
status=${h}
|
|
396
|
+
type=${y}
|
|
397
|
+
.images=${c}
|
|
398
|
+
.descriptions=${o}
|
|
399
|
+
></wui-transaction-list-item>
|
|
400
|
+
` : $ ? u.map((C, S) => {
|
|
401
|
+
const B = A.getTransferDescription(C), T = e && S === u.length - 1;
|
|
402
|
+
return a` <wui-transaction-list-item
|
|
403
|
+
date=${r}
|
|
404
|
+
direction=${C.direction}
|
|
405
|
+
id=${T && this.next ? D : ""}
|
|
406
|
+
status=${h}
|
|
407
|
+
type=${y}
|
|
408
|
+
.onlyDirectionIcon=${!0}
|
|
409
|
+
.images=${[c[S]]}
|
|
410
|
+
.descriptions=${[B]}
|
|
411
|
+
></wui-transaction-list-item>`;
|
|
412
|
+
}) : a`
|
|
413
|
+
<wui-transaction-list-item
|
|
414
|
+
date=${r}
|
|
415
|
+
.direction=${i}
|
|
416
|
+
id=${e && this.next ? D : ""}
|
|
417
|
+
status=${h}
|
|
418
|
+
type=${y}
|
|
419
|
+
.images=${c}
|
|
420
|
+
.descriptions=${o}
|
|
421
|
+
></wui-transaction-list-item>
|
|
422
|
+
`;
|
|
423
|
+
}
|
|
424
|
+
templateTransactions(t, e) {
|
|
425
|
+
return t.map((r, o) => {
|
|
426
|
+
const i = e && o === t.length - 1;
|
|
427
|
+
return a`${this.templateRenderTransaction(r, i)}`;
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
emptyStateActivity() {
|
|
431
|
+
return a`<wui-flex
|
|
432
|
+
class="emptyContainer"
|
|
433
|
+
flexGrow="1"
|
|
434
|
+
flexDirection="column"
|
|
435
|
+
justifyContent="center"
|
|
436
|
+
alignItems="center"
|
|
437
|
+
.padding=${["3xl", "xl", "3xl", "xl"]}
|
|
438
|
+
gap="xl"
|
|
439
|
+
data-testid="empty-activity-state"
|
|
440
|
+
>
|
|
441
|
+
<wui-icon-box
|
|
442
|
+
backgroundColor="gray-glass-005"
|
|
443
|
+
background="gray"
|
|
444
|
+
iconColor="fg-200"
|
|
445
|
+
icon="wallet"
|
|
446
|
+
size="lg"
|
|
447
|
+
?border=${!0}
|
|
448
|
+
borderColor="wui-color-bg-125"
|
|
449
|
+
></wui-icon-box>
|
|
450
|
+
<wui-flex flexDirection="column" alignItems="center" gap="xs">
|
|
451
|
+
<wui-text align="center" variant="paragraph-500" color="fg-100"
|
|
452
|
+
>No Transactions yet</wui-text
|
|
453
|
+
>
|
|
454
|
+
<wui-text align="center" variant="small-500" color="fg-200"
|
|
455
|
+
>Start trading on dApps <br />
|
|
456
|
+
to grow your wallet!</wui-text
|
|
457
|
+
>
|
|
458
|
+
</wui-flex>
|
|
459
|
+
</wui-flex>`;
|
|
460
|
+
}
|
|
461
|
+
emptyStateAccount() {
|
|
462
|
+
return a`<wui-flex
|
|
463
|
+
class="contentContainer"
|
|
464
|
+
alignItems="center"
|
|
465
|
+
justifyContent="center"
|
|
466
|
+
flexDirection="column"
|
|
467
|
+
gap="l"
|
|
468
|
+
data-testid="empty-account-state"
|
|
469
|
+
>
|
|
470
|
+
<wui-icon-box
|
|
471
|
+
icon="swapHorizontal"
|
|
472
|
+
size="inherit"
|
|
473
|
+
iconColor="fg-200"
|
|
474
|
+
backgroundColor="fg-200"
|
|
475
|
+
iconSize="lg"
|
|
476
|
+
></wui-icon-box>
|
|
477
|
+
<wui-flex
|
|
478
|
+
class="textContent"
|
|
479
|
+
gap="xs"
|
|
480
|
+
flexDirection="column"
|
|
481
|
+
justifyContent="center"
|
|
482
|
+
flexDirection="column"
|
|
483
|
+
>
|
|
484
|
+
<wui-text variant="paragraph-500" align="center" color="fg-100">No activity yet</wui-text>
|
|
485
|
+
<wui-text variant="small-400" align="center" color="fg-200"
|
|
486
|
+
>Your next transactions will appear here</wui-text
|
|
487
|
+
>
|
|
488
|
+
</wui-flex>
|
|
489
|
+
<wui-link @click=${this.onReceiveClick.bind(this)}>Trade</wui-link>
|
|
490
|
+
</wui-flex>`;
|
|
491
|
+
}
|
|
492
|
+
templateEmpty() {
|
|
493
|
+
return this.page === "account" ? a`${this.emptyStateAccount()}` : a`${this.emptyStateActivity()}`;
|
|
494
|
+
}
|
|
495
|
+
templateLoading() {
|
|
496
|
+
return this.page === "activity" ? Array(K).fill(a` <wui-transaction-list-item-loader></wui-transaction-list-item-loader> `).map((t) => t) : null;
|
|
497
|
+
}
|
|
498
|
+
onReceiveClick() {
|
|
499
|
+
L.push("WalletReceive");
|
|
500
|
+
}
|
|
501
|
+
createPaginationObserver() {
|
|
502
|
+
const t = v.state.activeChain, { projectId: e } = z.state;
|
|
503
|
+
this.paginationObserver = new IntersectionObserver(([r]) => {
|
|
504
|
+
var o;
|
|
505
|
+
r != null && r.isIntersecting && !this.loading && (p.fetchTransactions(O.getPlainAddress(this.caipAddress)), V.sendEvent({
|
|
506
|
+
type: "track",
|
|
507
|
+
event: "LOAD_MORE_TRANSACTIONS",
|
|
508
|
+
properties: {
|
|
509
|
+
address: O.getPlainAddress(this.caipAddress),
|
|
510
|
+
projectId: e,
|
|
511
|
+
cursor: this.next,
|
|
512
|
+
isSmartAccount: ((o = E.state.preferredAccountTypes) == null ? void 0 : o[t]) === F.ACCOUNT_TYPES.SMART_ACCOUNT
|
|
513
|
+
}
|
|
514
|
+
}));
|
|
515
|
+
}, {}), this.setPaginationObserver();
|
|
516
|
+
}
|
|
517
|
+
setPaginationObserver() {
|
|
518
|
+
var e, r, o;
|
|
519
|
+
(e = this.paginationObserver) == null || e.disconnect();
|
|
520
|
+
const t = (r = this.shadowRoot) == null ? void 0 : r.querySelector(`#${D}`);
|
|
521
|
+
t && ((o = this.paginationObserver) == null || o.observe(t));
|
|
522
|
+
}
|
|
523
|
+
getTransactionListItemProps(t) {
|
|
524
|
+
var h, u, y, $, I;
|
|
525
|
+
const e = W.formatDate((h = t == null ? void 0 : t.metadata) == null ? void 0 : h.minedAt), r = A.getTransactionDescriptions(t), o = t == null ? void 0 : t.transfers, i = (u = t == null ? void 0 : t.transfers) == null ? void 0 : u[0], n = !!i && ((y = t == null ? void 0 : t.transfers) == null ? void 0 : y.every((C) => !!C.nft_info)), c = A.getTransactionImages(o);
|
|
526
|
+
return {
|
|
527
|
+
date: e,
|
|
528
|
+
direction: i == null ? void 0 : i.direction,
|
|
529
|
+
descriptions: r,
|
|
530
|
+
isAllNFT: n,
|
|
531
|
+
images: c,
|
|
532
|
+
status: ($ = t.metadata) == null ? void 0 : $.status,
|
|
533
|
+
transfers: o,
|
|
534
|
+
type: (I = t.metadata) == null ? void 0 : I.operationType
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
g.styles = M;
|
|
539
|
+
x([
|
|
540
|
+
l()
|
|
541
|
+
], g.prototype, "page", void 0);
|
|
542
|
+
x([
|
|
543
|
+
b()
|
|
544
|
+
], g.prototype, "caipAddress", void 0);
|
|
545
|
+
x([
|
|
546
|
+
b()
|
|
547
|
+
], g.prototype, "transactionsByYear", void 0);
|
|
548
|
+
x([
|
|
549
|
+
b()
|
|
550
|
+
], g.prototype, "loading", void 0);
|
|
551
|
+
x([
|
|
552
|
+
b()
|
|
553
|
+
], g.prototype, "empty", void 0);
|
|
554
|
+
x([
|
|
555
|
+
b()
|
|
556
|
+
], g.prototype, "next", void 0);
|
|
557
|
+
g = x([
|
|
558
|
+
_("w3m-activity-list")
|
|
559
|
+
], g);
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { cz as p, cA as u, cE as f, cN as b, cB as d } from "./index-DiHImG4L.js";
|
|
2
|
+
import { n as g, r as m, c as v } from "./if-defined-BciplFKz.js";
|
|
3
|
+
import { T as l } from "./index-B2iDt0TJ.js";
|
|
4
|
+
const R = {
|
|
5
|
+
interpolate(i, e, o) {
|
|
6
|
+
if (i.length !== 2 || e.length !== 2)
|
|
7
|
+
throw new Error("inputRange and outputRange must be an array of length 2");
|
|
8
|
+
const n = i[0] || 0, r = i[1] || 0, t = e[0] || 0, s = e[1] || 0;
|
|
9
|
+
return o < n ? t : o > r ? s : (s - t) / (r - n) * (o - n) + t;
|
|
10
|
+
}
|
|
11
|
+
}, w = p`
|
|
12
|
+
:host {
|
|
13
|
+
width: 100%;
|
|
14
|
+
display: block;
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
var a = function(i, e, o, n) {
|
|
18
|
+
var r = arguments.length, t = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, o) : n, s;
|
|
19
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(i, e, o, n);
|
|
20
|
+
else for (var h = i.length - 1; h >= 0; h--) (s = i[h]) && (t = (r < 3 ? s(t) : r > 3 ? s(e, o, t) : s(e, o)) || t);
|
|
21
|
+
return r > 3 && t && Object.defineProperty(e, o, t), t;
|
|
22
|
+
};
|
|
23
|
+
let c = class extends u {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(), this.unsubscribe = [], this.text = "", this.open = l.state.open, this.unsubscribe.push(f.subscribeKey("view", () => {
|
|
26
|
+
l.hide();
|
|
27
|
+
}), b.subscribeKey("open", (e) => {
|
|
28
|
+
e || l.hide();
|
|
29
|
+
}), l.subscribeKey("open", (e) => {
|
|
30
|
+
this.open = e;
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
disconnectedCallback() {
|
|
34
|
+
this.unsubscribe.forEach((e) => e()), l.hide();
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
return d`
|
|
38
|
+
<div
|
|
39
|
+
@pointermove=${this.onMouseEnter.bind(this)}
|
|
40
|
+
@pointerleave=${this.onMouseLeave.bind(this)}
|
|
41
|
+
>
|
|
42
|
+
${this.renderChildren()}
|
|
43
|
+
</div>
|
|
44
|
+
`;
|
|
45
|
+
}
|
|
46
|
+
renderChildren() {
|
|
47
|
+
return d`<slot></slot> `;
|
|
48
|
+
}
|
|
49
|
+
onMouseEnter() {
|
|
50
|
+
const e = this.getBoundingClientRect();
|
|
51
|
+
this.open || l.showTooltip({
|
|
52
|
+
message: this.text,
|
|
53
|
+
triggerRect: {
|
|
54
|
+
width: e.width,
|
|
55
|
+
height: e.height,
|
|
56
|
+
left: e.left,
|
|
57
|
+
top: e.top
|
|
58
|
+
},
|
|
59
|
+
variant: "shade"
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
onMouseLeave(e) {
|
|
63
|
+
this.contains(e.relatedTarget) || l.hide();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
c.styles = [w];
|
|
67
|
+
a([
|
|
68
|
+
g()
|
|
69
|
+
], c.prototype, "text", void 0);
|
|
70
|
+
a([
|
|
71
|
+
m()
|
|
72
|
+
], c.prototype, "open", void 0);
|
|
73
|
+
c = a([
|
|
74
|
+
v("w3m-tooltip-trigger")
|
|
75
|
+
], c);
|
|
76
|
+
export {
|
|
77
|
+
R as M
|
|
78
|
+
};
|