@prohetamine/redstone 0.0.1
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/PhArrowCircleDown-BR-zH4LC.js +14 -0
- package/dist/PhArrowCircleDown-Sb38khBy.mjs +73 -0
- package/dist/PhArrowClockwise-BE5j9P0Z.mjs +73 -0
- package/dist/PhArrowClockwise-BRaehQGe.js +14 -0
- package/dist/PhArrowDown-B_WmmmY9.js +14 -0
- package/dist/PhArrowDown-CFEyR2dR.mjs +73 -0
- package/dist/PhArrowLeft-CYfU7NZj.mjs +73 -0
- package/dist/PhArrowLeft-CkEd70hm.js +14 -0
- package/dist/PhArrowRight-C07Qkx86.js +14 -0
- package/dist/PhArrowRight-EermNu0V.mjs +73 -0
- package/dist/PhArrowSquareOut-BjTBfzOP.js +14 -0
- package/dist/PhArrowSquareOut-DZwTtw54.mjs +73 -0
- package/dist/PhArrowUp-DB4CCSss.js +14 -0
- package/dist/PhArrowUp-xTpLFQkg.mjs +73 -0
- package/dist/PhArrowUpRight-CQbvn6NO.mjs +73 -0
- package/dist/PhArrowUpRight-GpCIMsAh.js +14 -0
- package/dist/PhArrowsClockwise-BgcIUg-Z.js +14 -0
- package/dist/PhArrowsClockwise-DnUYZTVx.mjs +73 -0
- package/dist/PhArrowsDownUp-C8KXUqtu.js +14 -0
- package/dist/PhArrowsDownUp-DgoprEe2.mjs +73 -0
- package/dist/PhArrowsLeftRight-CahChzCj.js +14 -0
- package/dist/PhArrowsLeftRight-FD4AZiLh.mjs +73 -0
- package/dist/PhBank-DIqIL4x_.js +14 -0
- package/dist/PhBank-DbQOQ9zJ.mjs +73 -0
- package/dist/PhBrowser-BCBXK2IM.mjs +73 -0
- package/dist/PhBrowser-laCKtn7T.js +14 -0
- package/dist/PhCaretDown-CnjP-QjZ.mjs +73 -0
- package/dist/PhCaretDown-DDe42xDU.js +14 -0
- package/dist/PhCaretLeft-Cskc5OY9.js +14 -0
- package/dist/PhCaretLeft-DkuXxjf_.mjs +73 -0
- package/dist/PhCaretRight-CBWpghxt.mjs +73 -0
- package/dist/PhCaretRight-DNgI5w_B.js +14 -0
- package/dist/PhCaretUp-CQ-OztBV.mjs +73 -0
- package/dist/PhCaretUp-CUZ4g_Me.js +14 -0
- package/dist/PhCheck-BVV_Dwfo.js +14 -0
- package/dist/PhCheck-t515emYS.mjs +73 -0
- package/dist/PhCircleHalf-BuQTmrKW.mjs +73 -0
- package/dist/PhCircleHalf-DDC7rige.js +14 -0
- package/dist/PhClock-BqynEKWl.js +14 -0
- package/dist/PhClock-D6XkTmM_.mjs +73 -0
- package/dist/PhCompass-2QeeX5Ad.mjs +73 -0
- package/dist/PhCompass-BsuJwXAE.js +14 -0
- package/dist/PhCopy-CO34-_xD.mjs +73 -0
- package/dist/PhCopy-MVqtRS6X.js +14 -0
- package/dist/PhCreditCard-Dq4kdjCw.js +14 -0
- package/dist/PhCreditCard-bfnqYflD.mjs +73 -0
- package/dist/PhCurrencyDollar-6k8UWxal.js +14 -0
- package/dist/PhCurrencyDollar-BekVYPtC.mjs +73 -0
- package/dist/PhDesktop-BkNzf3rT.mjs +73 -0
- package/dist/PhDesktop-CfsXQ0vC.js +14 -0
- package/dist/PhDeviceMobile-BT3Mg_b0.mjs +73 -0
- package/dist/PhDeviceMobile-BnrrDrwf.js +14 -0
- package/dist/PhDotsThree-6LRvhAcL.js +14 -0
- package/dist/PhDotsThree-kpf2OKxJ.mjs +73 -0
- package/dist/PhEnvelope-CHsfC2e0.js +14 -0
- package/dist/PhEnvelope-UFKpKtwf.mjs +73 -0
- package/dist/PhFunnelSimple-CdAqSIhK.mjs +73 -0
- package/dist/PhFunnelSimple-JAk7X9Wo.js +14 -0
- package/dist/PhGlobe-B3RYXl8h.mjs +73 -0
- package/dist/PhGlobe-Tfs4MfpG.js +14 -0
- package/dist/PhIdentificationCard-Dqmd6eY1.js +14 -0
- package/dist/PhIdentificationCard-rSq59Czm.mjs +73 -0
- package/dist/PhImage-aEryzfCi.js +14 -0
- package/dist/PhImage-ynsEnFd_.mjs +73 -0
- package/dist/PhInfo-B7lsWl6m.mjs +73 -0
- package/dist/PhInfo-D6oUrWpA.js +14 -0
- package/dist/PhLightbulb-FQDaMMqu.mjs +73 -0
- package/dist/PhLightbulb-qbEduhPa.js +14 -0
- package/dist/PhMagnifyingGlass-COdRH2k5.js +14 -0
- package/dist/PhMagnifyingGlass-_NXk13-0.mjs +73 -0
- package/dist/PhPaperPlaneRight-BYi7SorW.mjs +73 -0
- package/dist/PhPaperPlaneRight-DrpVAQOZ.js +14 -0
- package/dist/PhPlus-25KQTPHG.mjs +73 -0
- package/dist/PhPlus-BhUXef08.js +14 -0
- package/dist/PhPower-BKl7gzsB.mjs +73 -0
- package/dist/PhPower-BNJf1AGQ.js +14 -0
- package/dist/PhPuzzlePiece-BkZeF8CX.js +14 -0
- package/dist/PhPuzzlePiece-BqUI4GRs.mjs +73 -0
- package/dist/PhQrCode-C-tqZKPP.mjs +73 -0
- package/dist/PhQrCode-C0v0iXQN.js +14 -0
- package/dist/PhQuestion-BBAiRWgt.js +14 -0
- package/dist/PhQuestion-CtYvffyD.mjs +73 -0
- package/dist/PhQuestionMark-BNbtL2yx.mjs +73 -0
- package/dist/PhQuestionMark-BvGUBZ1h.js +14 -0
- package/dist/PhSealCheck-B0TEqWpq.mjs +73 -0
- package/dist/PhSealCheck-BwNkuF7G.js +14 -0
- package/dist/PhSignOut-C1rMSNaS.js +14 -0
- package/dist/PhSignOut-HX2_BVsD.mjs +73 -0
- package/dist/PhSpinner-CoDYLYOX.mjs +73 -0
- package/dist/PhSpinner-nmsGWDQl.js +14 -0
- package/dist/PhTrash-CALlKx3e.js +14 -0
- package/dist/PhTrash-DeQHS8ZP.mjs +73 -0
- package/dist/PhUser-CA0e5OPI.js +14 -0
- package/dist/PhUser-Cy5EY3vX.mjs +73 -0
- package/dist/PhVault-DdXjVOO9.mjs +73 -0
- package/dist/PhVault-DqxV75cz.js +14 -0
- package/dist/PhWallet-CeQrfGYc.mjs +73 -0
- package/dist/PhWallet-CyCuEs2U.js +14 -0
- package/dist/PhWarning-BKaHv_wT.mjs +73 -0
- package/dist/PhWarning-C7oj86bY.js +14 -0
- package/dist/PhWarningCircle-8MWw-QgE.mjs +73 -0
- package/dist/PhWarningCircle-CrNPXGj4.js +14 -0
- package/dist/PhX-9lsrXjyl.js +14 -0
- package/dist/PhX-DgXr_Fb0.mjs +73 -0
- package/dist/ReownAuthentication-Bfv31LzI.mjs +274 -0
- package/dist/ReownAuthentication-d8aYgGOq.js +5 -0
- package/dist/SwapController-4lzoYsYr.js +1 -0
- package/dist/SwapController-DjzUWRyQ.mjs +462 -0
- package/dist/ccip-CvwbEhki.js +1 -0
- package/dist/ccip-TuO68NeE.mjs +150 -0
- package/dist/data-capture-BwdjH2vc.mjs +489 -0
- package/dist/data-capture-xVUNZJ2T.js +242 -0
- package/dist/email-BCZObJCY.js +90 -0
- package/dist/email-m-wo60fN.mjs +338 -0
- package/dist/embedded-wallet-CGSri-4g.js +410 -0
- package/dist/embedded-wallet-DdZmv5qP.mjs +808 -0
- package/dist/features-BJ8kNaE8.js +1 -0
- package/dist/features-CJ34oImB.mjs +6 -0
- package/dist/index-4lfXeo30.js +132 -0
- package/dist/index-B6Mg114Z.mjs +69182 -0
- package/dist/index-BX7gAgT3.mjs +35 -0
- package/dist/index-BYQqNbCe.js +1 -0
- package/dist/index-BmdHwtJo.js +1 -0
- package/dist/index-BvUx3ULC.js +78 -0
- package/dist/index-CD-QGO70.mjs +196 -0
- package/dist/index-CJtXfdoM.mjs +29621 -0
- package/dist/index-CMzdgE-y.mjs +215 -0
- package/dist/index-CjZQCcwG.js +7203 -0
- package/dist/index-D7VuOaCI.js +19 -0
- package/dist/index-DV7SQwgn.mjs +2688 -0
- package/dist/index-DVf4BnNh.mjs +352 -0
- package/dist/index-DhN9vL4k.js +138 -0
- package/dist/index-DvllakY0.mjs +274 -0
- package/dist/index-Ho06VKh2.mjs +151 -0
- package/dist/index-a8mS2Eh1.js +1062 -0
- package/dist/index-aamBi9Tu.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.es.js +14 -0
- package/dist/onramp-DLlhSPQg.js +422 -0
- package/dist/onramp-k-EAEepC.mjs +842 -0
- package/dist/parseSignature-D1tZHglo.js +16 -0
- package/dist/parseSignature-DM0lwcDr.mjs +8883 -0
- package/dist/pay-with-exchange---G2M1Ag.js +280 -0
- package/dist/pay-with-exchange-CFIcUXUe.mjs +512 -0
- package/dist/property-Bd8U3_QP.mjs +618 -0
- package/dist/property-DissjCbZ.js +27 -0
- package/dist/receive-B9LCljO6.mjs +228 -0
- package/dist/receive-E8H6GDOX.js +131 -0
- package/dist/send-B-AooLph.js +554 -0
- package/dist/send-DZd_xhsd.mjs +1155 -0
- package/dist/socials-ChWFLEFe.mjs +611 -0
- package/dist/socials-YSUYSh8o.js +250 -0
- package/dist/swaps-DpR9W9Ld.js +1050 -0
- package/dist/swaps-Du7-Ui_V.mjs +1752 -0
- package/dist/transactions-DhsK5-QJ.mjs +35 -0
- package/dist/transactions-VPsz2OLe.js +16 -0
- package/dist/w3m-modal-DhomfjKU.js +891 -0
- package/dist/w3m-modal-KuYD-zqQ.mjs +1759 -0
- package/package.json +51 -0
- package/readme.md +1 -0
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CjZQCcwG.js");require("./index-BvUx3ULC.js");const x=e.css`
|
|
2
|
+
button {
|
|
3
|
+
border: none;
|
|
4
|
+
border-radius: ${({borderRadius:n})=>n[20]};
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
align-items: center;
|
|
8
|
+
padding: ${({spacing:n})=>n[1]};
|
|
9
|
+
transition:
|
|
10
|
+
background-color ${({durations:n})=>n.lg}
|
|
11
|
+
${({easings:n})=>n["ease-out-power-2"]},
|
|
12
|
+
box-shadow ${({durations:n})=>n.lg}
|
|
13
|
+
${({easings:n})=>n["ease-out-power-2"]};
|
|
14
|
+
will-change: background-color, box-shadow;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* -- Variants --------------------------------------------------------------- */
|
|
18
|
+
button[data-type='accent'] {
|
|
19
|
+
background-color: ${({tokens:n})=>n.core.backgroundAccentPrimary};
|
|
20
|
+
color: ${({tokens:n})=>n.theme.textPrimary};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
button[data-type='neutral'] {
|
|
24
|
+
background-color: ${({tokens:n})=>n.theme.foregroundSecondary};
|
|
25
|
+
color: ${({tokens:n})=>n.theme.textPrimary};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* -- Sizes --------------------------------------------------------------- */
|
|
29
|
+
button[data-size='sm'] {
|
|
30
|
+
height: 24px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
button[data-size='md'] {
|
|
34
|
+
height: 28px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
button[data-size='lg'] {
|
|
38
|
+
height: 32px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
button[data-size='sm'] > wui-image,
|
|
42
|
+
button[data-size='sm'] > wui-icon {
|
|
43
|
+
width: 16px;
|
|
44
|
+
height: 16px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
button[data-size='md'] > wui-image,
|
|
48
|
+
button[data-size='md'] > wui-icon {
|
|
49
|
+
width: 20px;
|
|
50
|
+
height: 20px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
button[data-size='lg'] > wui-image,
|
|
54
|
+
button[data-size='lg'] > wui-icon {
|
|
55
|
+
width: 24px;
|
|
56
|
+
height: 24px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
wui-text {
|
|
60
|
+
padding-left: ${({spacing:n})=>n[1]};
|
|
61
|
+
padding-right: ${({spacing:n})=>n[1]};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
wui-image {
|
|
65
|
+
border-radius: ${({borderRadius:n})=>n[3]};
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
user-drag: none;
|
|
68
|
+
user-select: none;
|
|
69
|
+
-moz-user-select: none;
|
|
70
|
+
-webkit-user-drag: none;
|
|
71
|
+
-webkit-user-select: none;
|
|
72
|
+
-ms-user-select: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* -- States --------------------------------------------------------------- */
|
|
76
|
+
@media (hover: hover) and (pointer: fine) {
|
|
77
|
+
button[data-type='accent']:not(:disabled):hover {
|
|
78
|
+
background-color: ${({tokens:n})=>n.core.foregroundAccent060};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
button[data-type='neutral']:not(:disabled):hover {
|
|
82
|
+
background-color: ${({tokens:n})=>n.theme.foregroundTertiary};
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
button[data-type='accent']:not(:disabled):focus-visible,
|
|
87
|
+
button[data-type='accent']:not(:disabled):active {
|
|
88
|
+
box-shadow: 0 0 0 4px ${({tokens:n})=>n.core.foregroundAccent020};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
button[data-type='neutral']:not(:disabled):focus-visible,
|
|
92
|
+
button[data-type='neutral']:not(:disabled):active {
|
|
93
|
+
box-shadow: 0 0 0 4px ${({tokens:n})=>n.core.foregroundAccent020};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
button:disabled {
|
|
97
|
+
opacity: 0.5;
|
|
98
|
+
}
|
|
99
|
+
`;var m=function(n,t,r,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,r):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,r,o);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(i=(s<3?a(i):s>3?a(t,r,i):a(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i};const w={sm:"sm-regular",md:"md-regular",lg:"lg-regular"};let u=class extends e.i{constructor(){super(...arguments),this.type="accent",this.size="md",this.imageSrc="",this.disabled=!1,this.leftIcon=void 0,this.rightIcon=void 0,this.text=""}render(){return e.b`
|
|
100
|
+
<button ?disabled=${this.disabled} data-type=${this.type} data-size=${this.size}>
|
|
101
|
+
${this.imageSrc?e.b`<wui-image src=${this.imageSrc}></wui-image>`:null}
|
|
102
|
+
${this.leftIcon?e.b`<wui-icon name=${this.leftIcon} color="inherit" size="inherit"></wui-icon>`:null}
|
|
103
|
+
<wui-text variant=${w[this.size]} color="inherit">${this.text}</wui-text>
|
|
104
|
+
${this.rightIcon?e.b`<wui-icon name=${this.rightIcon} color="inherit" size="inherit"></wui-icon>`:null}
|
|
105
|
+
</button>
|
|
106
|
+
`}};u.styles=[e.resetStyles,e.elementStyles,x];m([e.n()],u.prototype,"type",void 0);m([e.n()],u.prototype,"size",void 0);m([e.n()],u.prototype,"imageSrc",void 0);m([e.n({type:Boolean})],u.prototype,"disabled",void 0);m([e.n()],u.prototype,"leftIcon",void 0);m([e.n()],u.prototype,"rightIcon",void 0);m([e.n()],u.prototype,"text",void 0);u=m([e.customElement("wui-chip-button")],u);var h=function(n,t,r,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,r):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,r,o);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(i=(s<3?a(i):s>3?a(t,r,i):a(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i};let d=class extends e.i{constructor(){super(...arguments),this.maxDecimals=void 0,this.maxIntegers=void 0}render(){return e.b`
|
|
107
|
+
<wui-flex alignItems="center" gap="1">
|
|
108
|
+
<wui-input-amount
|
|
109
|
+
widthVariant="fit"
|
|
110
|
+
fontSize="h2"
|
|
111
|
+
.maxDecimals=${e.o(this.maxDecimals)}
|
|
112
|
+
.maxIntegers=${e.o(this.maxIntegers)}
|
|
113
|
+
.value=${this.amount?String(this.amount):""}
|
|
114
|
+
></wui-input-amount>
|
|
115
|
+
<wui-text variant="md-regular" color="secondary">USD</wui-text>
|
|
116
|
+
</wui-flex>
|
|
117
|
+
`}};h([e.n({type:Number})],d.prototype,"amount",void 0);h([e.n({type:Number})],d.prototype,"maxDecimals",void 0);h([e.n({type:Number})],d.prototype,"maxIntegers",void 0);d=h([e.customElement("w3m-fund-input")],d);const f=e.css`
|
|
118
|
+
.amount-input-container {
|
|
119
|
+
border-radius: ${({borderRadius:n})=>n[6]};
|
|
120
|
+
border-top-right-radius: 0;
|
|
121
|
+
border-top-left-radius: 0;
|
|
122
|
+
background-color: ${({tokens:n})=>n.theme.foregroundPrimary};
|
|
123
|
+
padding: ${({spacing:n})=>n[1]};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.container {
|
|
127
|
+
border-radius: 30px;
|
|
128
|
+
}
|
|
129
|
+
`;var l=function(n,t,r,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,r):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,r,o);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(i=(s<3?a(i):s>3?a(t,r,i):a(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i};const g=[10,50,100],b=6,y=10;exports.W3mDepositFromExchangeView=class extends e.i{constructor(){super(),this.unsubscribe=[],this.network=e.ChainController.state.activeCaipNetwork,this.exchanges=e.ExchangeController.state.exchanges,this.isLoading=e.ExchangeController.state.isLoading,this.amount=e.ExchangeController.state.amount,this.tokenAmount=e.ExchangeController.state.tokenAmount,this.priceLoading=e.ExchangeController.state.priceLoading,this.isPaymentInProgress=e.ExchangeController.state.isPaymentInProgress,this.currentPayment=e.ExchangeController.state.currentPayment,this.paymentId=e.ExchangeController.state.paymentId,this.paymentAsset=e.ExchangeController.state.paymentAsset,this.unsubscribe.push(e.ChainController.subscribeKey("activeCaipNetwork",t=>{this.network=t,this.setDefaultPaymentAsset()}),e.ExchangeController.subscribe(t=>{var o,s;this.exchanges=t.exchanges,this.isLoading=t.isLoading,this.amount=t.amount,this.tokenAmount=t.tokenAmount,this.priceLoading=t.priceLoading,this.paymentId=t.paymentId,this.isPaymentInProgress=t.isPaymentInProgress,this.currentPayment=t.currentPayment,this.paymentAsset=t.paymentAsset,t.isPaymentInProgress&&((o=t.currentPayment)==null?void 0:o.exchangeId)&&((s=t.currentPayment)==null?void 0:s.sessionId)&&t.paymentId&&this.handlePaymentInProgress()}))}disconnectedCallback(){this.unsubscribe.forEach(r=>r()),e.ExchangeController.state.isPaymentInProgress||e.ExchangeController.reset()}async firstUpdated(){await this.getPaymentAssets(),this.paymentAsset||await this.setDefaultPaymentAsset(),e.ExchangeController.setAmount(g[0]),await e.ExchangeController.fetchExchanges()}render(){return e.b`
|
|
130
|
+
<wui-flex flexDirection="column" class="container">
|
|
131
|
+
${this.amountInputTemplate()} ${this.exchangesTemplate()}
|
|
132
|
+
</wui-flex>
|
|
133
|
+
`}exchangesLoadingTemplate(){return Array.from({length:2}).map(()=>e.b`<wui-shimmer width="100%" height="65px" borderRadius="xxs"></wui-shimmer>`)}_exchangesTemplate(){return this.exchanges.length>0?this.exchanges.map(t=>e.b`<wui-list-item
|
|
134
|
+
@click=${()=>this.onExchangeClick(t)}
|
|
135
|
+
chevron
|
|
136
|
+
variant="image"
|
|
137
|
+
imageSrc=${t.imageUrl}
|
|
138
|
+
?loading=${this.isLoading}
|
|
139
|
+
>
|
|
140
|
+
<wui-text variant="md-regular" color="primary">
|
|
141
|
+
Deposit from ${t.name}
|
|
142
|
+
</wui-text>
|
|
143
|
+
</wui-list-item>`):e.b`<wui-flex flexDirection="column" alignItems="center" gap="4" padding="4">
|
|
144
|
+
<wui-text variant="lg-medium" align="center" color="primary">
|
|
145
|
+
No exchanges support this asset on this network
|
|
146
|
+
</wui-text>
|
|
147
|
+
</wui-flex>`}exchangesTemplate(){return e.b`<wui-flex
|
|
148
|
+
flexDirection="column"
|
|
149
|
+
gap="2"
|
|
150
|
+
.padding=${["3","3","3","3"]}
|
|
151
|
+
class="exchanges-container"
|
|
152
|
+
>
|
|
153
|
+
${this.isLoading?this.exchangesLoadingTemplate():this._exchangesTemplate()}
|
|
154
|
+
</wui-flex>`}amountInputTemplate(){var t,r;return e.b`
|
|
155
|
+
<wui-flex
|
|
156
|
+
flexDirection="column"
|
|
157
|
+
.padding=${["0","3","3","3"]}
|
|
158
|
+
class="amount-input-container"
|
|
159
|
+
>
|
|
160
|
+
<wui-flex
|
|
161
|
+
justifyContent="space-between"
|
|
162
|
+
alignItems="center"
|
|
163
|
+
.margin=${["0","0","6","0"]}
|
|
164
|
+
>
|
|
165
|
+
<wui-text variant="md-medium" color="secondary">Asset</wui-text>
|
|
166
|
+
<wui-token-button
|
|
167
|
+
data-testid="deposit-from-exchange-asset-button"
|
|
168
|
+
flexDirection="row-reverse"
|
|
169
|
+
text=${((t=this.paymentAsset)==null?void 0:t.metadata.symbol)||""}
|
|
170
|
+
imageSrc=${((r=this.paymentAsset)==null?void 0:r.metadata.iconUrl)||""}
|
|
171
|
+
@click=${()=>e.RouterController.push("PayWithExchangeSelectAsset")}
|
|
172
|
+
size="lg"
|
|
173
|
+
.chainImageSrc=${e.o(e.AssetUtil.getNetworkImage(this.network))}
|
|
174
|
+
>
|
|
175
|
+
</wui-token-button>
|
|
176
|
+
</wui-flex>
|
|
177
|
+
<wui-flex
|
|
178
|
+
flexDirection="column"
|
|
179
|
+
alignItems="center"
|
|
180
|
+
justifyContent="center"
|
|
181
|
+
.margin=${["0","0","4","0"]}
|
|
182
|
+
>
|
|
183
|
+
<w3m-fund-input
|
|
184
|
+
@inputChange=${this.onAmountChange.bind(this)}
|
|
185
|
+
.amount=${this.amount}
|
|
186
|
+
.maxDecimals=${b}
|
|
187
|
+
.maxIntegers=${y}
|
|
188
|
+
>
|
|
189
|
+
</w3m-fund-input>
|
|
190
|
+
${this.tokenAmountTemplate()}
|
|
191
|
+
</wui-flex>
|
|
192
|
+
<wui-flex justifyContent="center" gap="2">
|
|
193
|
+
${g.map(o=>e.b`<wui-chip-button
|
|
194
|
+
@click=${()=>e.ExchangeController.setAmount(o)}
|
|
195
|
+
type="neutral"
|
|
196
|
+
size="lg"
|
|
197
|
+
text=${`$${o}`}
|
|
198
|
+
></wui-chip-button>`)}
|
|
199
|
+
</wui-flex>
|
|
200
|
+
</wui-flex>
|
|
201
|
+
`}tokenAmountTemplate(){var t;return this.priceLoading?e.b`<wui-shimmer
|
|
202
|
+
width="65px"
|
|
203
|
+
height="20px"
|
|
204
|
+
borderRadius="xxs"
|
|
205
|
+
variant="light"
|
|
206
|
+
></wui-shimmer>`:e.b`
|
|
207
|
+
<wui-text variant="md-regular" color="secondary">
|
|
208
|
+
${this.tokenAmount.toFixed(4)} ${(t=this.paymentAsset)==null?void 0:t.metadata.symbol}
|
|
209
|
+
</wui-text>
|
|
210
|
+
`}async onExchangeClick(t){if(!this.amount){e.SnackController.showError("Please enter an amount");return}await e.ExchangeController.handlePayWithExchange(t.id)}handlePaymentInProgress(){var o,s;const t=e.ChainController.state.activeChain,{redirectView:r="Account"}=e.RouterController.state.data??{};this.isPaymentInProgress&&((o=this.currentPayment)!=null&&o.exchangeId)&&((s=this.currentPayment)!=null&&s.sessionId)&&this.paymentId&&(e.ExchangeController.waitUntilComplete({exchangeId:this.currentPayment.exchangeId,sessionId:this.currentPayment.sessionId,paymentId:this.paymentId}).then(i=>{i.status==="SUCCESS"?(e.SnackController.showSuccess("Deposit completed"),e.ExchangeController.reset(),t&&(e.ChainController.fetchTokenBalance(),e.ConnectionController.updateBalance(t)),e.RouterController.replace("Transactions")):i.status==="FAILED"&&e.SnackController.showError("Deposit failed")}),e.SnackController.showLoading("Deposit in progress..."),e.RouterController.replace(r))}onAmountChange({detail:t}){e.ExchangeController.setAmount(t?Number(t):null)}async getPaymentAssets(){this.network&&await e.ExchangeController.getAssetsForNetwork(this.network.caipNetworkId)}async setDefaultPaymentAsset(){if(this.network){const t=await e.ExchangeController.getAssetsForNetwork(this.network.caipNetworkId);t[0]&&e.ExchangeController.setPaymentAsset(t[0])}}};exports.W3mDepositFromExchangeView.styles=f;l([e.r()],exports.W3mDepositFromExchangeView.prototype,"network",void 0);l([e.r()],exports.W3mDepositFromExchangeView.prototype,"exchanges",void 0);l([e.r()],exports.W3mDepositFromExchangeView.prototype,"isLoading",void 0);l([e.r()],exports.W3mDepositFromExchangeView.prototype,"amount",void 0);l([e.r()],exports.W3mDepositFromExchangeView.prototype,"tokenAmount",void 0);l([e.r()],exports.W3mDepositFromExchangeView.prototype,"priceLoading",void 0);l([e.r()],exports.W3mDepositFromExchangeView.prototype,"isPaymentInProgress",void 0);l([e.r()],exports.W3mDepositFromExchangeView.prototype,"currentPayment",void 0);l([e.r()],exports.W3mDepositFromExchangeView.prototype,"paymentId",void 0);l([e.r()],exports.W3mDepositFromExchangeView.prototype,"paymentAsset",void 0);exports.W3mDepositFromExchangeView=l([e.customElement("w3m-deposit-from-exchange-view")],exports.W3mDepositFromExchangeView);const C=e.css`
|
|
211
|
+
.contentContainer {
|
|
212
|
+
height: 440px;
|
|
213
|
+
overflow: scroll;
|
|
214
|
+
scrollbar-width: none;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.contentContainer::-webkit-scrollbar {
|
|
218
|
+
display: none;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
wui-icon-box {
|
|
222
|
+
width: 40px;
|
|
223
|
+
height: 40px;
|
|
224
|
+
border-radius: ${({borderRadius:n})=>n[3]};
|
|
225
|
+
}
|
|
226
|
+
`;var p=function(n,t,r,o){var s=arguments.length,i=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,r):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,r,o);else for(var c=n.length-1;c>=0;c--)(a=n[c])&&(i=(s<3?a(i):s>3?a(t,r,i):a(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i};exports.W3mDepositFromExchangeSelectAssetView=class extends e.i{constructor(){super(),this.unsubscribe=[],this.assets=e.ExchangeController.state.assets,this.search="",this.onDebouncedSearch=e.CoreHelperUtil.debounce(t=>{this.search=t}),this.unsubscribe.push(e.ExchangeController.subscribe(t=>{this.assets=t.assets}))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){return e.b`
|
|
227
|
+
<wui-flex flexDirection="column">
|
|
228
|
+
${this.templateSearchInput()} <wui-separator></wui-separator> ${this.templateTokens()}
|
|
229
|
+
</wui-flex>
|
|
230
|
+
`}templateSearchInput(){return e.b`
|
|
231
|
+
<wui-flex gap="2" padding="3">
|
|
232
|
+
<wui-input-text
|
|
233
|
+
@inputChange=${this.onInputChange.bind(this)}
|
|
234
|
+
class="network-search-input"
|
|
235
|
+
size="sm"
|
|
236
|
+
placeholder="Search token"
|
|
237
|
+
icon="search"
|
|
238
|
+
></wui-input-text>
|
|
239
|
+
</wui-flex>
|
|
240
|
+
`}templateTokens(){const t=this.assets.filter(o=>o.metadata.name.toLowerCase().includes(this.search.toLowerCase())),r=t.length>0;return e.b`
|
|
241
|
+
<wui-flex
|
|
242
|
+
class="contentContainer"
|
|
243
|
+
flexDirection="column"
|
|
244
|
+
.padding=${["0","3","0","3"]}
|
|
245
|
+
>
|
|
246
|
+
<wui-flex justifyContent="flex-start" .padding=${["4","3","3","3"]}>
|
|
247
|
+
<wui-text variant="md-medium" color="secondary">Available tokens</wui-text>
|
|
248
|
+
</wui-flex>
|
|
249
|
+
<wui-flex flexDirection="column" gap="2">
|
|
250
|
+
${r?t.map(o=>e.b`<wui-list-item
|
|
251
|
+
.imageSrc=${o.metadata.iconUrl}
|
|
252
|
+
?clickable=${!0}
|
|
253
|
+
@click=${this.handleTokenClick.bind(this,o)}
|
|
254
|
+
>
|
|
255
|
+
<wui-text variant="md-medium" color="primary">${o.metadata.name}</wui-text>
|
|
256
|
+
<wui-text variant="md-regular" color="secondary"
|
|
257
|
+
>${o.metadata.symbol}</wui-text
|
|
258
|
+
>
|
|
259
|
+
</wui-list-item>`):e.b`<wui-flex
|
|
260
|
+
.padding=${["20","0","0","0"]}
|
|
261
|
+
alignItems="center"
|
|
262
|
+
flexDirection="column"
|
|
263
|
+
gap="4"
|
|
264
|
+
>
|
|
265
|
+
<wui-icon-box icon="coinPlaceholder" color="default" size="lg"></wui-icon-box>
|
|
266
|
+
<wui-flex
|
|
267
|
+
class="textContent"
|
|
268
|
+
gap="2"
|
|
269
|
+
flexDirection="column"
|
|
270
|
+
justifyContent="center"
|
|
271
|
+
>
|
|
272
|
+
<wui-text variant="lg-medium" align="center" color="primary">
|
|
273
|
+
No tokens found
|
|
274
|
+
</wui-text>
|
|
275
|
+
</wui-flex>
|
|
276
|
+
<wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link>
|
|
277
|
+
</wui-flex>`}
|
|
278
|
+
</wui-flex>
|
|
279
|
+
</wui-flex>
|
|
280
|
+
`}onBuyClick(){e.RouterController.push("OnRampProviders")}onInputChange(t){this.onDebouncedSearch(t.detail)}handleTokenClick(t){e.ExchangeController.setPaymentAsset(t),e.RouterController.goBack()}};exports.W3mDepositFromExchangeSelectAssetView.styles=C;p([e.r()],exports.W3mDepositFromExchangeSelectAssetView.prototype,"assets",void 0);p([e.r()],exports.W3mDepositFromExchangeSelectAssetView.prototype,"search",void 0);exports.W3mDepositFromExchangeSelectAssetView=p([e.customElement("w3m-deposit-from-exchange-select-asset-view")],exports.W3mDepositFromExchangeSelectAssetView);
|