@dcl/governance-site 2.0.0 → 2.0.1-20995780683.commit-d6baf5e
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/assets/BlockOverrides-9837a6f9.js +5 -0
- package/assets/ConstantsUtil-298f7898.js +1 -0
- package/assets/ExchangeController-d2354ec6.js +1 -0
- package/assets/HelpersUtil-8cddb046.js +62 -0
- package/assets/MathUtil-b514a570.js +1 -0
- package/assets/NavigationUtil-a0d0ce87.js +1 -0
- package/assets/NetworkUtil-220ea128.js +1 -0
- package/assets/PhWallet-fd2006d2.js +14 -0
- package/assets/{features-b72c9430.js → ReownAuthentication-468828df.js} +4 -4
- package/assets/SwapController-7bfd6ce7.js +1 -0
- package/assets/{UserAvatar-78751cb5.js → UserAvatar-456716f1.js} +1 -1
- package/assets/ccip-ddcec720.js +1 -0
- package/assets/data-capture-3e424a2c.js +242 -0
- package/assets/email-ea617f9c.js +90 -0
- package/assets/embedded-wallet-814bf005.js +410 -0
- package/assets/features-fd521597.js +1 -0
- package/assets/fortmatic-f3cb4aa6.js +13 -0
- package/assets/if-defined-0a35f675.js +5 -0
- package/assets/index-034d22a0.js +138 -0
- package/assets/{index-a8255d1c.css → index-05771666.css} +4 -4
- package/assets/index-07a61b45.js +51 -0
- package/assets/index-1039ded0.js +132 -0
- package/assets/index-123c1362.js +224 -0
- package/assets/index-15bbaaa0.js +7 -0
- package/assets/{index-073512a1.js → index-206e3e77.js} +1 -1
- package/assets/index-27a991e4.js +53 -0
- package/assets/index-2d0efdd2.js +210 -0
- package/assets/index-32d53c87.js +189 -0
- package/assets/index-3b861a37.js +102 -0
- package/assets/index-4207595b.js +100 -0
- package/assets/index-4243d275.js +43 -0
- package/assets/index-42ce7246.js +63 -0
- package/assets/index-47e87339.js +152 -0
- package/assets/index-48bd3fca.js +277 -0
- package/assets/index-49cc5044.js +46 -0
- package/assets/index-5788a0d6.js +468 -0
- package/assets/index-5824c226.js +81 -0
- package/assets/index-5da565ce.js +78 -0
- package/assets/index-685e7949.js +425 -0
- package/assets/index-84e8ecf6.js +647 -0
- package/assets/index-965fdf98.js +3425 -0
- package/assets/index-9d970383.js +152 -0
- package/assets/index-a59b6662.js +68 -0
- package/assets/index-b457d047.js +1062 -0
- package/assets/index-b65e06cc.js +27 -0
- package/assets/{index-2ef9f1d1.js → index-d70e4ab8.js} +66 -66
- package/assets/index-d7a6ceea.js +30 -0
- package/assets/index-d9c55c27.js +77 -0
- package/assets/index-db5b7889.js +77 -0
- package/assets/index-e3222791.js +78 -0
- package/assets/index-eb060c20.js +1 -0
- package/assets/index-f3f03959.js +90 -0
- package/assets/index-fcda68c9.js +19 -0
- package/assets/index-ff4dea43.js +85 -0
- package/assets/networks-14f3c0d2.js +1 -0
- package/assets/onramp-dcdb1a34.js +422 -0
- package/assets/pay-with-exchange-a64f18a3.js +280 -0
- package/assets/receive-ca7bc867.js +131 -0
- package/assets/ref-88e1be05.js +13 -0
- package/assets/send-8739c9fb.js +554 -0
- package/assets/socials-ccc593f5.js +250 -0
- package/assets/swaps-0a90eb06.js +1050 -0
- package/assets/transactions-bb8cb277.js +16 -0
- package/assets/{tslib.es6-82b9ba96.js → tslib.es6-db2ec995.js} +2 -2
- package/assets/w3m-modal-869dafbc.js +891 -0
- package/assets/zoraTestnet-adc7b76b.js +36 -0
- package/index.html +4 -4
- package/package.json +3 -3
- package/assets/basic-ca749c4c.js +0 -1435
- package/assets/core-806d78ea.js +0 -249
- package/assets/fortmatic-12e0f2e5.js +0 -13
- package/assets/index-372705ba.js +0 -1321
- package/assets/index-4be588a0.js +0 -94
- package/assets/index-74e34dfb.js +0 -39
- package/assets/index-bbb36593.js +0 -7
- package/assets/index-c1c8440f.js +0 -47
- package/assets/w3m-modal-26eff9d9.js +0 -1209
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import{j as A,r as D,k as T,l as $,m as u,C as y,R as w,H as E,S as b,x as z,h as S}from"./index-48bd3fca.js";import{n as h,c as v,r as m}from"./index-84e8ecf6.js";import{o as P}from"./if-defined-0a35f675.js";import"./index-42ce7246.js";import"./index-d9c55c27.js";import"./index-db5b7889.js";import"./index-d7a6ceea.js";import"./index-47e87339.js";import"./index-5da565ce.js";import"./index-a59b6662.js";import{E as r}from"./ExchangeController-d2354ec6.js";import"./index-ff4dea43.js";import"./index-9d970383.js";import"./index-e3222791.js";import"./index-b65e06cc.js";import"./index-d70e4ab8.js";import"./NetworkUtil-220ea128.js";import"./BlockOverrides-9837a6f9.js";import"./index-4243d275.js";import"./index-07a61b45.js";import"./ref-88e1be05.js";const _=A`
|
|
2
|
+
button {
|
|
3
|
+
border: none;
|
|
4
|
+
border-radius: ${({borderRadius:t})=>t[20]};
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
align-items: center;
|
|
8
|
+
padding: ${({spacing:t})=>t[1]};
|
|
9
|
+
transition:
|
|
10
|
+
background-color ${({durations:t})=>t.lg}
|
|
11
|
+
${({easings:t})=>t["ease-out-power-2"]},
|
|
12
|
+
box-shadow ${({durations:t})=>t.lg}
|
|
13
|
+
${({easings:t})=>t["ease-out-power-2"]};
|
|
14
|
+
will-change: background-color, box-shadow;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* -- Variants --------------------------------------------------------------- */
|
|
18
|
+
button[data-type='accent'] {
|
|
19
|
+
background-color: ${({tokens:t})=>t.core.backgroundAccentPrimary};
|
|
20
|
+
color: ${({tokens:t})=>t.theme.textPrimary};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
button[data-type='neutral'] {
|
|
24
|
+
background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
|
|
25
|
+
color: ${({tokens:t})=>t.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:t})=>t[1]};
|
|
61
|
+
padding-right: ${({spacing:t})=>t[1]};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
wui-image {
|
|
65
|
+
border-radius: ${({borderRadius:t})=>t[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:t})=>t.core.foregroundAccent060};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
button[data-type='neutral']:not(:disabled):hover {
|
|
82
|
+
background-color: ${({tokens:t})=>t.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:t})=>t.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:t})=>t.core.foregroundAccent020};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
button:disabled {
|
|
97
|
+
opacity: 0.5;
|
|
98
|
+
}
|
|
99
|
+
`;var g=globalThis&&globalThis.__decorate||function(t,e,o,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(a=t[c])&&(i=(s<3?a(i):s>3?a(e,o,i):a(e,o))||i);return s>3&&i&&Object.defineProperty(e,o,i),i};const L={sm:"sm-regular",md:"md-regular",lg:"lg-regular"};let p=class extends ${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 u`
|
|
100
|
+
<button ?disabled=${this.disabled} data-type=${this.type} data-size=${this.size}>
|
|
101
|
+
${this.imageSrc?u`<wui-image src=${this.imageSrc}></wui-image>`:null}
|
|
102
|
+
${this.leftIcon?u`<wui-icon name=${this.leftIcon} color="inherit" size="inherit"></wui-icon>`:null}
|
|
103
|
+
<wui-text variant=${L[this.size]} color="inherit">${this.text}</wui-text>
|
|
104
|
+
${this.rightIcon?u`<wui-icon name=${this.rightIcon} color="inherit" size="inherit"></wui-icon>`:null}
|
|
105
|
+
</button>
|
|
106
|
+
`}};p.styles=[D,T,_];g([h()],p.prototype,"type",void 0);g([h()],p.prototype,"size",void 0);g([h()],p.prototype,"imageSrc",void 0);g([h({type:Boolean})],p.prototype,"disabled",void 0);g([h()],p.prototype,"leftIcon",void 0);g([h()],p.prototype,"rightIcon",void 0);g([h()],p.prototype,"text",void 0);p=g([v("wui-chip-button")],p);var I=globalThis&&globalThis.__decorate||function(t,e,o,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(a=t[c])&&(i=(s<3?a(i):s>3?a(e,o,i):a(e,o))||i);return s>3&&i&&Object.defineProperty(e,o,i),i};let f=class extends ${constructor(){super(...arguments),this.maxDecimals=void 0,this.maxIntegers=void 0}render(){return u`
|
|
107
|
+
<wui-flex alignItems="center" gap="1">
|
|
108
|
+
<wui-input-amount
|
|
109
|
+
widthVariant="fit"
|
|
110
|
+
fontSize="h2"
|
|
111
|
+
.maxDecimals=${P(this.maxDecimals)}
|
|
112
|
+
.maxIntegers=${P(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
|
+
`}};I([h({type:Number})],f.prototype,"amount",void 0);I([h({type:Number})],f.prototype,"maxDecimals",void 0);I([h({type:Number})],f.prototype,"maxIntegers",void 0);f=I([v("w3m-fund-input")],f);const R=A`
|
|
118
|
+
.amount-input-container {
|
|
119
|
+
border-radius: ${({borderRadius:t})=>t[6]};
|
|
120
|
+
border-top-right-radius: 0;
|
|
121
|
+
border-top-left-radius: 0;
|
|
122
|
+
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
123
|
+
padding: ${({spacing:t})=>t[1]};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.container {
|
|
127
|
+
border-radius: 30px;
|
|
128
|
+
}
|
|
129
|
+
`;var d=globalThis&&globalThis.__decorate||function(t,e,o,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(a=t[c])&&(i=(s<3?a(i):s>3?a(e,o,i):a(e,o))||i);return s>3&&i&&Object.defineProperty(e,o,i),i};const C=[10,50,100],j=6,N=10;let l=class extends ${constructor(){super(),this.unsubscribe=[],this.network=y.state.activeCaipNetwork,this.exchanges=r.state.exchanges,this.isLoading=r.state.isLoading,this.amount=r.state.amount,this.tokenAmount=r.state.tokenAmount,this.priceLoading=r.state.priceLoading,this.isPaymentInProgress=r.state.isPaymentInProgress,this.currentPayment=r.state.currentPayment,this.paymentId=r.state.paymentId,this.paymentAsset=r.state.paymentAsset,this.unsubscribe.push(y.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.setDefaultPaymentAsset()}),r.subscribe(e=>{var n,s;this.exchanges=e.exchanges,this.isLoading=e.isLoading,this.amount=e.amount,this.tokenAmount=e.tokenAmount,this.priceLoading=e.priceLoading,this.paymentId=e.paymentId,this.isPaymentInProgress=e.isPaymentInProgress,this.currentPayment=e.currentPayment,this.paymentAsset=e.paymentAsset,e.isPaymentInProgress&&((n=e.currentPayment)==null?void 0:n.exchangeId)&&((s=e.currentPayment)==null?void 0:s.sessionId)&&e.paymentId&&this.handlePaymentInProgress()}))}disconnectedCallback(){this.unsubscribe.forEach(o=>o()),r.state.isPaymentInProgress||r.reset()}async firstUpdated(){await this.getPaymentAssets(),this.paymentAsset||await this.setDefaultPaymentAsset(),r.setAmount(C[0]),await r.fetchExchanges()}render(){return u`
|
|
130
|
+
<wui-flex flexDirection="column" class="container">
|
|
131
|
+
${this.amountInputTemplate()} ${this.exchangesTemplate()}
|
|
132
|
+
</wui-flex>
|
|
133
|
+
`}exchangesLoadingTemplate(){return Array.from({length:2}).map(()=>u`<wui-shimmer width="100%" height="65px" borderRadius="xxs"></wui-shimmer>`)}_exchangesTemplate(){return this.exchanges.length>0?this.exchanges.map(e=>u`<wui-list-item
|
|
134
|
+
@click=${()=>this.onExchangeClick(e)}
|
|
135
|
+
chevron
|
|
136
|
+
variant="image"
|
|
137
|
+
imageSrc=${e.imageUrl}
|
|
138
|
+
?loading=${this.isLoading}
|
|
139
|
+
>
|
|
140
|
+
<wui-text variant="md-regular" color="primary">
|
|
141
|
+
Deposit from ${e.name}
|
|
142
|
+
</wui-text>
|
|
143
|
+
</wui-list-item>`):u`<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 u`<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 e,o;return u`
|
|
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=${((e=this.paymentAsset)==null?void 0:e.metadata.symbol)||""}
|
|
170
|
+
imageSrc=${((o=this.paymentAsset)==null?void 0:o.metadata.iconUrl)||""}
|
|
171
|
+
@click=${()=>w.push("PayWithExchangeSelectAsset")}
|
|
172
|
+
size="lg"
|
|
173
|
+
.chainImageSrc=${P(E.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=${j}
|
|
187
|
+
.maxIntegers=${N}
|
|
188
|
+
>
|
|
189
|
+
</w3m-fund-input>
|
|
190
|
+
${this.tokenAmountTemplate()}
|
|
191
|
+
</wui-flex>
|
|
192
|
+
<wui-flex justifyContent="center" gap="2">
|
|
193
|
+
${C.map(n=>u`<wui-chip-button
|
|
194
|
+
@click=${()=>r.setAmount(n)}
|
|
195
|
+
type="neutral"
|
|
196
|
+
size="lg"
|
|
197
|
+
text=${`$${n}`}
|
|
198
|
+
></wui-chip-button>`)}
|
|
199
|
+
</wui-flex>
|
|
200
|
+
</wui-flex>
|
|
201
|
+
`}tokenAmountTemplate(){var e;return this.priceLoading?u`<wui-shimmer
|
|
202
|
+
width="65px"
|
|
203
|
+
height="20px"
|
|
204
|
+
borderRadius="xxs"
|
|
205
|
+
variant="light"
|
|
206
|
+
></wui-shimmer>`:u`
|
|
207
|
+
<wui-text variant="md-regular" color="secondary">
|
|
208
|
+
${this.tokenAmount.toFixed(4)} ${(e=this.paymentAsset)==null?void 0:e.metadata.symbol}
|
|
209
|
+
</wui-text>
|
|
210
|
+
`}async onExchangeClick(e){if(!this.amount){b.showError("Please enter an amount");return}await r.handlePayWithExchange(e.id)}handlePaymentInProgress(){var n,s;const e=y.state.activeChain,{redirectView:o="Account"}=w.state.data??{};this.isPaymentInProgress&&((n=this.currentPayment)!=null&&n.exchangeId)&&((s=this.currentPayment)!=null&&s.sessionId)&&this.paymentId&&(r.waitUntilComplete({exchangeId:this.currentPayment.exchangeId,sessionId:this.currentPayment.sessionId,paymentId:this.paymentId}).then(i=>{i.status==="SUCCESS"?(b.showSuccess("Deposit completed"),r.reset(),e&&(y.fetchTokenBalance(),z.updateBalance(e)),w.replace("Transactions")):i.status==="FAILED"&&b.showError("Deposit failed")}),b.showLoading("Deposit in progress..."),w.replace(o))}onAmountChange({detail:e}){r.setAmount(e?Number(e):null)}async getPaymentAssets(){this.network&&await r.getAssetsForNetwork(this.network.caipNetworkId)}async setDefaultPaymentAsset(){if(this.network){const e=await r.getAssetsForNetwork(this.network.caipNetworkId);e[0]&&r.setPaymentAsset(e[0])}}};l.styles=R;d([m()],l.prototype,"network",void 0);d([m()],l.prototype,"exchanges",void 0);d([m()],l.prototype,"isLoading",void 0);d([m()],l.prototype,"amount",void 0);d([m()],l.prototype,"tokenAmount",void 0);d([m()],l.prototype,"priceLoading",void 0);d([m()],l.prototype,"isPaymentInProgress",void 0);d([m()],l.prototype,"currentPayment",void 0);d([m()],l.prototype,"paymentId",void 0);d([m()],l.prototype,"paymentAsset",void 0);l=d([v("w3m-deposit-from-exchange-view")],l);const O=A`
|
|
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:t})=>t[3]};
|
|
225
|
+
}
|
|
226
|
+
`;var k=globalThis&&globalThis.__decorate||function(t,e,o,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(a=t[c])&&(i=(s<3?a(i):s>3?a(e,o,i):a(e,o))||i);return s>3&&i&&Object.defineProperty(e,o,i),i};let x=class extends ${constructor(){super(),this.unsubscribe=[],this.assets=r.state.assets,this.search="",this.onDebouncedSearch=S.debounce(e=>{this.search=e}),this.unsubscribe.push(r.subscribe(e=>{this.assets=e.assets}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return u`
|
|
227
|
+
<wui-flex flexDirection="column">
|
|
228
|
+
${this.templateSearchInput()} <wui-separator></wui-separator> ${this.templateTokens()}
|
|
229
|
+
</wui-flex>
|
|
230
|
+
`}templateSearchInput(){return u`
|
|
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 e=this.assets.filter(n=>n.metadata.name.toLowerCase().includes(this.search.toLowerCase())),o=e.length>0;return u`
|
|
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
|
+
${o?e.map(n=>u`<wui-list-item
|
|
251
|
+
.imageSrc=${n.metadata.iconUrl}
|
|
252
|
+
?clickable=${!0}
|
|
253
|
+
@click=${this.handleTokenClick.bind(this,n)}
|
|
254
|
+
>
|
|
255
|
+
<wui-text variant="md-medium" color="primary">${n.metadata.name}</wui-text>
|
|
256
|
+
<wui-text variant="md-regular" color="secondary"
|
|
257
|
+
>${n.metadata.symbol}</wui-text
|
|
258
|
+
>
|
|
259
|
+
</wui-list-item>`):u`<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(){w.push("OnRampProviders")}onInputChange(e){this.onDebouncedSearch(e.detail)}handleTokenClick(e){r.setPaymentAsset(e),w.goBack()}};x.styles=O;k([m()],x.prototype,"assets",void 0);k([m()],x.prototype,"search",void 0);x=k([v("w3m-deposit-from-exchange-select-asset-view")],x);export{x as W3mDepositFromExchangeSelectAssetView,l as W3mDepositFromExchangeView};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import{j as k,r as v,k as N,l as x,m as u,C as c,S as h,H as w,T as f,y as R,W as T,R as A,h as S}from"./index-48bd3fca.js";import{n as $,c as C,U as I,r as b}from"./index-84e8ecf6.js";import{o as O}from"./if-defined-0a35f675.js";import"./index-42ce7246.js";import"./index-3b861a37.js";import"./index-d70e4ab8.js";import"./NetworkUtil-220ea128.js";import"./BlockOverrides-9837a6f9.js";import"./index-4243d275.js";const _=k`
|
|
2
|
+
button {
|
|
3
|
+
width: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
gap: ${({spacing:e})=>e[4]};
|
|
8
|
+
background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
|
|
9
|
+
border-radius: ${({borderRadius:e})=>e[3]};
|
|
10
|
+
border: none;
|
|
11
|
+
padding: ${({spacing:e})=>e[3]};
|
|
12
|
+
transition: background-color ${({durations:e})=>e.lg}
|
|
13
|
+
${({easings:e})=>e["ease-out-power-2"]};
|
|
14
|
+
will-change: background-color;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* -- Hover & Active states ----------------------------------------------------------- */
|
|
18
|
+
button:hover:enabled,
|
|
19
|
+
button:active:enabled {
|
|
20
|
+
background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
wui-text {
|
|
24
|
+
flex: 1;
|
|
25
|
+
color: ${({tokens:e})=>e.theme.textSecondary};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
wui-flex {
|
|
29
|
+
width: auto;
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: ${({spacing:e})=>e["01"]};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
wui-icon {
|
|
36
|
+
color: ${({tokens:e})=>e.theme.iconDefault};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.network-icon {
|
|
40
|
+
position: relative;
|
|
41
|
+
width: 20px;
|
|
42
|
+
height: 20px;
|
|
43
|
+
border-radius: ${({borderRadius:e})=>e[4]};
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
margin-left: -8px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.network-icon:first-child {
|
|
49
|
+
margin-left: 0px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.network-icon:after {
|
|
53
|
+
position: absolute;
|
|
54
|
+
inset: 0;
|
|
55
|
+
content: '';
|
|
56
|
+
display: block;
|
|
57
|
+
height: 100%;
|
|
58
|
+
width: 100%;
|
|
59
|
+
border-radius: ${({borderRadius:e})=>e[4]};
|
|
60
|
+
box-shadow: inset 0 0 0 1px ${({tokens:e})=>e.core.glass010};
|
|
61
|
+
}
|
|
62
|
+
`;var g=globalThis&&globalThis.__decorate||function(e,t,o,i){var s=arguments.length,r=s<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(s<3?n(r):s>3?n(t,o,r):n(t,o))||r);return s>3&&r&&Object.defineProperty(t,o,r),r};let p=class extends x{constructor(){super(...arguments),this.networkImages=[""],this.text=""}render(){return u`
|
|
63
|
+
<button>
|
|
64
|
+
<wui-text variant="md-regular" color="inherit">${this.text}</wui-text>
|
|
65
|
+
<wui-flex>
|
|
66
|
+
${this.networksTemplate()}
|
|
67
|
+
<wui-icon name="chevronRight" size="sm" color="inherit"></wui-icon>
|
|
68
|
+
</wui-flex>
|
|
69
|
+
</button>
|
|
70
|
+
`}networksTemplate(){const t=this.networkImages.slice(0,5);return u` <wui-flex class="networks">
|
|
71
|
+
${t==null?void 0:t.map(o=>u` <wui-flex class="network-icon"> <wui-image src=${o}></wui-image> </wui-flex>`)}
|
|
72
|
+
</wui-flex>`}};p.styles=[v,N,_];g([$({type:Array})],p.prototype,"networkImages",void 0);g([$()],p.prototype,"text",void 0);p=g([C("wui-compatible-network")],p);const E=k`
|
|
73
|
+
wui-compatible-network {
|
|
74
|
+
margin-top: ${({spacing:e})=>e[4]};
|
|
75
|
+
width: 100%;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
wui-qr-code {
|
|
79
|
+
width: unset !important;
|
|
80
|
+
height: unset !important;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
wui-icon {
|
|
84
|
+
align-items: normal;
|
|
85
|
+
}
|
|
86
|
+
`;var m=globalThis&&globalThis.__decorate||function(e,t,o,i){var s=arguments.length,r=s<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(s<3?n(r):s>3?n(t,o,r):n(t,o))||r);return s>3&&r&&Object.defineProperty(t,o,r),r};let d=class extends x{constructor(){var t,o;super(),this.unsubscribe=[],this.address=(t=c.getAccountData())==null?void 0:t.address,this.profileName=(o=c.getAccountData())==null?void 0:o.profileName,this.network=c.state.activeCaipNetwork,this.unsubscribe.push(c.subscribeChainProp("accountState",i=>{i?(this.address=i.address,this.profileName=i.profileName):h.showError("Account not found")}),c.subscribeKey("activeCaipNetwork",i=>{i!=null&&i.id&&(this.network=i)}))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){if(!this.address)throw new Error("w3m-wallet-receive-view: No account provided");const t=w.getNetworkImage(this.network);return u` <wui-flex
|
|
87
|
+
flexDirection="column"
|
|
88
|
+
.padding=${["0","4","4","4"]}
|
|
89
|
+
alignItems="center"
|
|
90
|
+
>
|
|
91
|
+
<wui-chip-button
|
|
92
|
+
data-testid="receive-address-copy-button"
|
|
93
|
+
@click=${this.onCopyClick.bind(this)}
|
|
94
|
+
text=${I.getTruncateString({string:this.profileName||this.address||"",charsStart:this.profileName?18:4,charsEnd:this.profileName?0:4,truncate:this.profileName?"end":"middle"})}
|
|
95
|
+
icon="copy"
|
|
96
|
+
size="sm"
|
|
97
|
+
imageSrc=${t||""}
|
|
98
|
+
variant="gray"
|
|
99
|
+
></wui-chip-button>
|
|
100
|
+
<wui-flex
|
|
101
|
+
flexDirection="column"
|
|
102
|
+
.padding=${["4","0","0","0"]}
|
|
103
|
+
alignItems="center"
|
|
104
|
+
gap="4"
|
|
105
|
+
>
|
|
106
|
+
<wui-qr-code
|
|
107
|
+
size=${232}
|
|
108
|
+
theme=${f.state.themeMode}
|
|
109
|
+
uri=${this.address}
|
|
110
|
+
?arenaClear=${!0}
|
|
111
|
+
color=${O(f.state.themeVariables["--apkt-qr-color"]??f.state.themeVariables["--w3m-qr-color"])}
|
|
112
|
+
data-testid="wui-qr-code"
|
|
113
|
+
></wui-qr-code>
|
|
114
|
+
<wui-text variant="lg-regular" color="primary" align="center">
|
|
115
|
+
Copy your address or scan this QR code
|
|
116
|
+
</wui-text>
|
|
117
|
+
<wui-button @click=${this.onCopyClick.bind(this)} size="sm" variant="neutral-secondary">
|
|
118
|
+
<wui-icon slot="iconLeft" size="sm" color="inherit" name="copy"></wui-icon>
|
|
119
|
+
<wui-text variant="md-regular" color="inherit">Copy address</wui-text>
|
|
120
|
+
</wui-button>
|
|
121
|
+
</wui-flex>
|
|
122
|
+
${this.networkTemplate()}
|
|
123
|
+
</wui-flex>`}networkTemplate(){var a;const t=c.getAllRequestedCaipNetworks(),o=c.checkIfSmartAccountEnabled(),i=c.state.activeCaipNetwork,s=t.filter(l=>(l==null?void 0:l.chainNamespace)===(i==null?void 0:i.chainNamespace));if(R(i==null?void 0:i.chainNamespace)===T.ACCOUNT_TYPES.SMART_ACCOUNT&&o)return i?u`<wui-compatible-network
|
|
124
|
+
@click=${this.onReceiveClick.bind(this)}
|
|
125
|
+
text="Only receive assets on this network"
|
|
126
|
+
.networkImages=${[w.getNetworkImage(i)??""]}
|
|
127
|
+
></wui-compatible-network>`:null;const n=((a=s==null?void 0:s.filter(l=>{var y;return(y=l==null?void 0:l.assets)==null?void 0:y.imageId}))==null?void 0:a.slice(0,5)).map(w.getNetworkImage).filter(Boolean);return u`<wui-compatible-network
|
|
128
|
+
@click=${this.onReceiveClick.bind(this)}
|
|
129
|
+
text="Only receive assets on these networks"
|
|
130
|
+
.networkImages=${n}
|
|
131
|
+
></wui-compatible-network>`}onReceiveClick(){A.push("WalletCompatibleNetworks")}onCopyClick(){try{this.address&&(S.copyToClopboard(this.address),h.showSuccess("Address copied"))}catch{h.showError("Failed to copy")}}};d.styles=E;m([b()],d.prototype,"address",void 0);m([b()],d.prototype,"profileName",void 0);m([b()],d.prototype,"network",void 0);d=m([C("w3m-wallet-receive-view")],d);export{d as W3mWalletReceiveView};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{A as d}from"./index-48bd3fca.js";import{i as $,t as _,e as A}from"./index-84e8ecf6.js";/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/const a=t=>t.strings===void 0;/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2017 Google LLC
|
|
8
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
+
*/const o=(t,s)=>{var i;const e=t._$AN;if(e===void 0)return!1;for(const h of e)(i=h._$AO)==null||i.call(h,s,!1),o(h,s);return!0},c=t=>{let s,e;do{if((s=t._$AM)===void 0)break;e=s._$AN,e.delete(t),t=s}while((e==null?void 0:e.size)===0)},l=t=>{for(let s;s=t._$AM;t=s){let e=s._$AN;if(e===void 0)s._$AN=e=new Set;else if(e.has(t))break;e.add(t),v(s)}};function f(t){this._$AN!==void 0?(c(this),this._$AM=t,l(this)):this._$AM=t}function u(t,s=!1,e=0){const i=this._$AH,h=this._$AN;if(h!==void 0&&h.size!==0)if(s)if(Array.isArray(i))for(let n=e;n<i.length;n++)o(i[n],!1),c(i[n]);else i!=null&&(o(i,!1),c(i));else o(this,t)}const v=t=>{t.type==_.CHILD&&(t._$AP??(t._$AP=u),t._$AQ??(t._$AQ=f))};class p extends ${constructor(){super(...arguments),this._$AN=void 0}_$AT(s,e,i){super._$AT(s,e,i),l(this),this.isConnected=s._$AU}_$AO(s,e=!0){var i,h;s!==this.isConnected&&(this.isConnected=s,s?(i=this.reconnected)==null||i.call(this):(h=this.disconnected)==null||h.call(this)),e&&(o(this,s),c(this))}setValue(s){if(a(this._$Ct))this._$Ct._$AI(s,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=s,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}/**
|
|
10
|
+
* @license
|
|
11
|
+
* Copyright 2020 Google LLC
|
|
12
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
+
*/const N=()=>new G;class G{}const r=new WeakMap,m=A(class extends p{render(t){return d}update(t,[s]){var i;const e=s!==this.G;return e&&this.G!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=s,this.ht=(i=t.options)==null?void 0:i.host,this.rt(this.ct=t.element)),d}rt(t){if(this.isConnected||(t=void 0),typeof this.G=="function"){const s=this.ht??globalThis;let e=r.get(s);e===void 0&&(e=new WeakMap,r.set(s,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,t),t!==void 0&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){var t,s;return typeof this.G=="function"?(t=r.get(this.ht??globalThis))==null?void 0:t.get(this.G):(s=this.G)==null?void 0:s.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});export{N as e,m as n};
|