@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,554 @@
|
|
|
1
|
+
import{j as b,l as x,h as D,C as w,x as j,Y as l,m as c,R as h,N as F,M as L,S as y,c as J,t as G,H as M,r as q,k as K,a0 as Q,a1 as X,E as Z}from"./index-48bd3fca.js";import{n as d,r as u,c as v,U as E}from"./index-84e8ecf6.js";import"./index-47e87339.js";import"./index-ff4dea43.js";import"./index-b65e06cc.js";import{e as z,n as H}from"./ref-88e1be05.js";import"./index-5da565ce.js";import"./index-a59b6662.js";import"./index-034d22a0.js";import{S as Y}from"./SwapController-7bfd6ce7.js";import"./index-9d970383.js";import"./index-e3222791.js";import"./index-42ce7246.js";import"./index-49cc5044.js";import{o as ee}from"./if-defined-0a35f675.js";import{C as te}from"./NetworkUtil-220ea128.js";import"./index-d70e4ab8.js";import"./BlockOverrides-9837a6f9.js";import"./index-4243d275.js";import"./index-07a61b45.js";import"./index-d7a6ceea.js";const ie=b`
|
|
2
|
+
:host {
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100px;
|
|
5
|
+
border-radius: ${({borderRadius:e})=>e[5]};
|
|
6
|
+
border: 1px solid ${({tokens:e})=>e.theme.foregroundPrimary};
|
|
7
|
+
background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
|
|
8
|
+
transition: background-color ${({durations:e})=>e.lg}
|
|
9
|
+
${({easings:e})=>e["ease-out-power-1"]};
|
|
10
|
+
will-change: background-color;
|
|
11
|
+
position: relative;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host(:hover) {
|
|
15
|
+
background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
wui-flex {
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: fit-content;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
wui-button {
|
|
24
|
+
display: ruby;
|
|
25
|
+
color: ${({tokens:e})=>e.theme.textPrimary};
|
|
26
|
+
margin: 0 ${({spacing:e})=>e[2]};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.instruction {
|
|
30
|
+
position: absolute;
|
|
31
|
+
top: 50%;
|
|
32
|
+
transform: translateY(-50%);
|
|
33
|
+
z-index: 2;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.paste {
|
|
37
|
+
display: inline-flex;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
textarea {
|
|
41
|
+
background: transparent;
|
|
42
|
+
width: 100%;
|
|
43
|
+
font-family: ${({fontFamily:e})=>e.regular};
|
|
44
|
+
font-style: normal;
|
|
45
|
+
font-size: ${({textSize:e})=>e.large};
|
|
46
|
+
font-weight: ${({fontWeight:e})=>e.regular};
|
|
47
|
+
line-height: ${({typography:e})=>e["lg-regular"].lineHeight};
|
|
48
|
+
letter-spacing: ${({typography:e})=>e["lg-regular"].letterSpacing};
|
|
49
|
+
color: ${({tokens:e})=>e.theme.textSecondary};
|
|
50
|
+
caret-color: ${({tokens:e})=>e.core.backgroundAccentPrimary};
|
|
51
|
+
box-sizing: border-box;
|
|
52
|
+
-webkit-appearance: none;
|
|
53
|
+
-moz-appearance: textfield;
|
|
54
|
+
padding: 0px;
|
|
55
|
+
border: none;
|
|
56
|
+
outline: none;
|
|
57
|
+
appearance: none;
|
|
58
|
+
resize: none;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
}
|
|
61
|
+
`;var P=globalThis&&globalThis.__decorate||function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let $=class extends x{constructor(){super(...arguments),this.inputElementRef=z(),this.instructionElementRef=z(),this.readOnly=!1,this.instructionHidden=!!this.value,this.pasting=!1,this.onDebouncedSearch=D.debounce(async t=>{if(!t.length){this.setReceiverAddress("");return}const i=w.state.activeChain;if(D.isAddress(t,i)){this.setReceiverAddress(t);return}try{const o=await j.getEnsAddress(t);if(o){l.setReceiverProfileName(t),l.setReceiverAddress(o);const n=await j.getEnsAvatar(t);l.setReceiverProfileImageUrl(n||void 0)}}catch{this.setReceiverAddress(t)}finally{l.setLoading(!1)}})}firstUpdated(){this.value&&(this.instructionHidden=!0),this.checkHidden()}render(){return this.readOnly?c` <wui-flex
|
|
62
|
+
flexDirection="column"
|
|
63
|
+
justifyContent="center"
|
|
64
|
+
gap="01"
|
|
65
|
+
.padding=${["8","4","5","4"]}
|
|
66
|
+
>
|
|
67
|
+
<textarea
|
|
68
|
+
spellcheck="false"
|
|
69
|
+
?disabled=${!0}
|
|
70
|
+
autocomplete="off"
|
|
71
|
+
.value=${this.value??""}
|
|
72
|
+
>
|
|
73
|
+
${this.value??""}</textarea
|
|
74
|
+
>
|
|
75
|
+
</wui-flex>`:c` <wui-flex
|
|
76
|
+
@click=${this.onBoxClick.bind(this)}
|
|
77
|
+
flexDirection="column"
|
|
78
|
+
justifyContent="center"
|
|
79
|
+
gap="01"
|
|
80
|
+
.padding=${["8","4","5","4"]}
|
|
81
|
+
>
|
|
82
|
+
<wui-text
|
|
83
|
+
${H(this.instructionElementRef)}
|
|
84
|
+
class="instruction"
|
|
85
|
+
color="secondary"
|
|
86
|
+
variant="md-medium"
|
|
87
|
+
>
|
|
88
|
+
Type or
|
|
89
|
+
<wui-button
|
|
90
|
+
class="paste"
|
|
91
|
+
size="md"
|
|
92
|
+
variant="neutral-secondary"
|
|
93
|
+
iconLeft="copy"
|
|
94
|
+
@click=${this.onPasteClick.bind(this)}
|
|
95
|
+
>
|
|
96
|
+
<wui-icon size="sm" color="inherit" slot="iconLeft" name="copy"></wui-icon>
|
|
97
|
+
Paste
|
|
98
|
+
</wui-button>
|
|
99
|
+
address
|
|
100
|
+
</wui-text>
|
|
101
|
+
<textarea
|
|
102
|
+
spellcheck="false"
|
|
103
|
+
?disabled=${!this.instructionHidden}
|
|
104
|
+
${H(this.inputElementRef)}
|
|
105
|
+
@input=${this.onInputChange.bind(this)}
|
|
106
|
+
@blur=${this.onBlur.bind(this)}
|
|
107
|
+
.value=${this.value??""}
|
|
108
|
+
autocomplete="off"
|
|
109
|
+
>
|
|
110
|
+
${this.value??""}</textarea
|
|
111
|
+
>
|
|
112
|
+
</wui-flex>`}async focusInput(){var t;this.instructionElementRef.value&&(this.instructionHidden=!0,await this.toggleInstructionFocus(!1),this.instructionElementRef.value.style.pointerEvents="none",(t=this.inputElementRef.value)==null||t.focus(),this.inputElementRef.value&&(this.inputElementRef.value.selectionStart=this.inputElementRef.value.selectionEnd=this.inputElementRef.value.value.length))}async focusInstruction(){var t;this.instructionElementRef.value&&(this.instructionHidden=!1,await this.toggleInstructionFocus(!0),this.instructionElementRef.value.style.pointerEvents="auto",(t=this.inputElementRef.value)==null||t.blur())}async toggleInstructionFocus(t){this.instructionElementRef.value&&await this.instructionElementRef.value.animate([{opacity:t?0:1},{opacity:t?1:0}],{duration:100,easing:"ease",fill:"forwards"}).finished}onBoxClick(){!this.value&&!this.instructionHidden&&this.focusInput()}onBlur(){!this.value&&this.instructionHidden&&!this.pasting&&this.focusInstruction()}checkHidden(){this.instructionHidden&&this.focusInput()}async onPasteClick(){this.pasting=!0;const t=await navigator.clipboard.readText();l.setReceiverAddress(t),this.focusInput()}onInputChange(t){var r;const i=t.target;this.pasting=!1,this.value=(r=t.target)==null?void 0:r.value,i.value&&!this.instructionHidden&&this.focusInput(),l.setLoading(!0),this.onDebouncedSearch(i.value)}setReceiverAddress(t){l.setReceiverAddress(t),l.setReceiverProfileName(void 0),l.setReceiverProfileImageUrl(void 0),l.setLoading(!1)}};$.styles=ie;P([d()],$.prototype,"value",void 0);P([d({type:Boolean})],$.prototype,"readOnly",void 0);P([u()],$.prototype,"instructionHidden",void 0);P([u()],$.prototype,"pasting",void 0);$=P([v("w3m-input-address")],$);const ne=b`
|
|
113
|
+
:host {
|
|
114
|
+
width: 100%;
|
|
115
|
+
height: 100px;
|
|
116
|
+
border-radius: ${({borderRadius:e})=>e[5]};
|
|
117
|
+
border: 1px solid ${({tokens:e})=>e.theme.foregroundPrimary};
|
|
118
|
+
background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
|
|
119
|
+
transition: background-color ${({durations:e})=>e.lg}
|
|
120
|
+
${({easings:e})=>e["ease-out-power-1"]};
|
|
121
|
+
will-change: background-color;
|
|
122
|
+
transition: all ${({easings:e})=>e["ease-out-power-1"]}
|
|
123
|
+
${({durations:e})=>e.lg};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
:host(:hover) {
|
|
127
|
+
background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
wui-flex {
|
|
131
|
+
width: 100%;
|
|
132
|
+
height: fit-content;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
wui-button {
|
|
136
|
+
width: 100%;
|
|
137
|
+
display: flex;
|
|
138
|
+
justify-content: flex-end;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
wui-input-amount {
|
|
142
|
+
mask-image: linear-gradient(
|
|
143
|
+
270deg,
|
|
144
|
+
transparent 0px,
|
|
145
|
+
transparent 8px,
|
|
146
|
+
black 24px,
|
|
147
|
+
black 25px,
|
|
148
|
+
black 32px,
|
|
149
|
+
black 100%
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.totalValue {
|
|
154
|
+
width: 100%;
|
|
155
|
+
}
|
|
156
|
+
`;var R=globalThis&&globalThis.__decorate||function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let T=class extends x{constructor(){super(...arguments),this.readOnly=!1,this.isInsufficientBalance=!1}render(){const t=this.readOnly||!this.token;return c` <wui-flex
|
|
157
|
+
flexDirection="column"
|
|
158
|
+
gap="01"
|
|
159
|
+
.padding=${["5","3","4","3"]}
|
|
160
|
+
>
|
|
161
|
+
<wui-flex alignItems="center">
|
|
162
|
+
<wui-input-amount
|
|
163
|
+
@inputChange=${this.onInputChange.bind(this)}
|
|
164
|
+
?disabled=${t}
|
|
165
|
+
.value=${this.sendTokenAmount?String(this.sendTokenAmount):""}
|
|
166
|
+
?error=${!!this.isInsufficientBalance}
|
|
167
|
+
></wui-input-amount>
|
|
168
|
+
${this.buttonTemplate()}
|
|
169
|
+
</wui-flex>
|
|
170
|
+
${this.bottomTemplate()}
|
|
171
|
+
</wui-flex>`}buttonTemplate(){return this.token?c`<wui-token-button
|
|
172
|
+
text=${this.token.symbol}
|
|
173
|
+
imageSrc=${this.token.iconUrl}
|
|
174
|
+
@click=${this.handleSelectButtonClick.bind(this)}
|
|
175
|
+
>
|
|
176
|
+
</wui-token-button>`:c`<wui-button
|
|
177
|
+
size="md"
|
|
178
|
+
variant="neutral-secondary"
|
|
179
|
+
@click=${this.handleSelectButtonClick.bind(this)}
|
|
180
|
+
>Select token</wui-button
|
|
181
|
+
>`}handleSelectButtonClick(){this.readOnly||h.push("WalletSendSelectToken")}sendValueTemplate(){if(!this.readOnly&&this.token&&this.sendTokenAmount){const i=this.token.price*this.sendTokenAmount;return c`<wui-text class="totalValue" variant="sm-regular" color="secondary"
|
|
182
|
+
>${i?`$${F.formatNumberToLocalString(i,2)}`:"Incorrect value"}</wui-text
|
|
183
|
+
>`}return null}maxAmountTemplate(){return this.token?c` <wui-text variant="sm-regular" color="secondary">
|
|
184
|
+
${E.roundNumber(Number(this.token.quantity.numeric),6,5)}
|
|
185
|
+
</wui-text>`:null}actionTemplate(){return this.token?c`<wui-link @click=${this.onMaxClick.bind(this)}>Max</wui-link>`:null}bottomTemplate(){return this.readOnly?null:c`<wui-flex alignItems="center" justifyContent="space-between">
|
|
186
|
+
${this.sendValueTemplate()}
|
|
187
|
+
<wui-flex alignItems="center" gap="01" justifyContent="flex-end">
|
|
188
|
+
${this.maxAmountTemplate()} ${this.actionTemplate()}
|
|
189
|
+
</wui-flex>
|
|
190
|
+
</wui-flex>`}onInputChange(t){l.setTokenAmount(t.detail)}onMaxClick(){if(this.token){const t=F.bigNumber(this.token.quantity.numeric);l.setTokenAmount(Number(t.toFixed(20)))}}};T.styles=ne;R([d({type:Object})],T.prototype,"token",void 0);R([d({type:Boolean})],T.prototype,"readOnly",void 0);R([d({type:Number})],T.prototype,"sendTokenAmount",void 0);R([d({type:Boolean})],T.prototype,"isInsufficientBalance",void 0);T=R([v("w3m-input-token")],T);const re=b`
|
|
191
|
+
:host {
|
|
192
|
+
display: block;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
wui-flex {
|
|
196
|
+
position: relative;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
wui-icon-box {
|
|
200
|
+
width: 32px;
|
|
201
|
+
height: 32px;
|
|
202
|
+
border-radius: ${({borderRadius:e})=>e[10]} !important;
|
|
203
|
+
border: 4px solid ${({tokens:e})=>e.theme.backgroundPrimary};
|
|
204
|
+
background: ${({tokens:e})=>e.theme.foregroundPrimary};
|
|
205
|
+
position: absolute;
|
|
206
|
+
top: 50%;
|
|
207
|
+
left: 50%;
|
|
208
|
+
transform: translate(-50%, -50%);
|
|
209
|
+
z-index: 3;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
wui-button {
|
|
213
|
+
--local-border-radius: ${({borderRadius:e})=>e[4]} !important;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.inputContainer {
|
|
217
|
+
height: fit-content;
|
|
218
|
+
}
|
|
219
|
+
`;var g=globalThis&&globalThis.__decorate||function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};const f={INSUFFICIENT_FUNDS:"Insufficient Funds",INCORRECT_VALUE:"Incorrect Value",INVALID_ADDRESS:"Invalid Address",ADD_ADDRESS:"Add Address",ADD_AMOUNT:"Add Amount",SELECT_TOKEN:"Select Token",PREVIEW_SEND:"Preview Send"};let p=class extends x{constructor(){var i,r;super(),this.unsubscribe=[],this.isTryingToChooseDifferentWallet=!1,this.token=l.state.token,this.sendTokenAmount=l.state.sendTokenAmount,this.receiverAddress=l.state.receiverAddress,this.receiverProfileName=l.state.receiverProfileName,this.loading=l.state.loading,this.params=(i=h.state.data)==null?void 0:i.send,this.caipAddress=(r=w.getAccountData())==null?void 0:r.caipAddress,this.message=f.PREVIEW_SEND,this.disconnecting=!1,this.token&&!this.params&&(this.fetchBalances(),this.fetchNetworkPrice());const t=w.subscribeKey("activeCaipAddress",o=>{!o&&this.isTryingToChooseDifferentWallet&&(this.isTryingToChooseDifferentWallet=!1,L.open({view:"Connect",data:{redirectView:"WalletSend"}}).catch(()=>null),t())});this.unsubscribe.push(w.subscribeAccountStateProp("caipAddress",o=>{this.caipAddress=o}),l.subscribe(o=>{this.token=o.token,this.sendTokenAmount=o.sendTokenAmount,this.receiverAddress=o.receiverAddress,this.receiverProfileName=o.receiverProfileName,this.loading=o.loading}))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}async firstUpdated(){await this.handleSendParameters()}render(){this.getMessage();const t=!!this.params;return c` <wui-flex flexDirection="column" .padding=${["0","4","4","4"]}>
|
|
220
|
+
<wui-flex class="inputContainer" gap="2" flexDirection="column">
|
|
221
|
+
<w3m-input-token
|
|
222
|
+
.token=${this.token}
|
|
223
|
+
.sendTokenAmount=${this.sendTokenAmount}
|
|
224
|
+
?readOnly=${t}
|
|
225
|
+
?isInsufficientBalance=${this.message===f.INSUFFICIENT_FUNDS}
|
|
226
|
+
></w3m-input-token>
|
|
227
|
+
<wui-icon-box size="md" variant="secondary" icon="arrowBottom"></wui-icon-box>
|
|
228
|
+
<w3m-input-address
|
|
229
|
+
?readOnly=${t}
|
|
230
|
+
.value=${this.receiverProfileName?this.receiverProfileName:this.receiverAddress}
|
|
231
|
+
></w3m-input-address>
|
|
232
|
+
</wui-flex>
|
|
233
|
+
${this.buttonTemplate()}
|
|
234
|
+
</wui-flex>`}async fetchBalances(){await l.fetchTokenBalance(),l.fetchNetworkBalance()}async fetchNetworkPrice(){await Y.getNetworkTokenPrice()}onButtonClick(){h.push("WalletSendPreview",{send:this.params})}onFundWalletClick(){h.push("FundWallet",{redirectView:"WalletSend"})}async onConnectDifferentWalletClick(){try{this.isTryingToChooseDifferentWallet=!0,this.disconnecting=!0,await j.disconnect()}finally{this.disconnecting=!1}}getMessage(){var t;this.message=f.PREVIEW_SEND,this.receiverAddress&&!D.isAddress(this.receiverAddress,w.state.activeChain)&&(this.message=f.INVALID_ADDRESS),this.receiverAddress||(this.message=f.ADD_ADDRESS),this.sendTokenAmount&&this.token&&this.sendTokenAmount>Number(this.token.quantity.numeric)&&(this.message=f.INSUFFICIENT_FUNDS),this.sendTokenAmount||(this.message=f.ADD_AMOUNT),this.sendTokenAmount&&((t=this.token)!=null&&t.price)&&(this.sendTokenAmount*this.token.price||(this.message=f.INCORRECT_VALUE)),this.token||(this.message=f.SELECT_TOKEN)}buttonTemplate(){const t=!this.message.startsWith(f.PREVIEW_SEND),i=this.message===f.INSUFFICIENT_FUNDS,r=!!this.params;return i&&!r?c`
|
|
235
|
+
<wui-flex .margin=${["4","0","0","0"]} flexDirection="column" gap="4">
|
|
236
|
+
<wui-button
|
|
237
|
+
@click=${this.onFundWalletClick.bind(this)}
|
|
238
|
+
size="lg"
|
|
239
|
+
variant="accent-secondary"
|
|
240
|
+
fullWidth
|
|
241
|
+
>
|
|
242
|
+
Fund Wallet
|
|
243
|
+
</wui-button>
|
|
244
|
+
|
|
245
|
+
<wui-separator data-testid="wui-separator" text="or"></wui-separator>
|
|
246
|
+
|
|
247
|
+
<wui-button
|
|
248
|
+
@click=${this.onConnectDifferentWalletClick.bind(this)}
|
|
249
|
+
size="lg"
|
|
250
|
+
variant="neutral-secondary"
|
|
251
|
+
fullWidth
|
|
252
|
+
?loading=${this.disconnecting}
|
|
253
|
+
>
|
|
254
|
+
Connect a different wallet
|
|
255
|
+
</wui-button>
|
|
256
|
+
</wui-flex>
|
|
257
|
+
`:c`<wui-flex .margin=${["4","0","0","0"]}>
|
|
258
|
+
<wui-button
|
|
259
|
+
@click=${this.onButtonClick.bind(this)}
|
|
260
|
+
?disabled=${t}
|
|
261
|
+
size="lg"
|
|
262
|
+
variant="accent-primary"
|
|
263
|
+
?loading=${this.loading}
|
|
264
|
+
fullWidth
|
|
265
|
+
>
|
|
266
|
+
${this.message}
|
|
267
|
+
</wui-button>
|
|
268
|
+
</wui-flex>`}async handleSendParameters(){if(this.loading=!0,!this.params){this.loading=!1;return}const t=Number(this.params.amount);if(isNaN(t)){y.showError("Invalid amount"),this.loading=!1;return}const{namespace:i,chainId:r,assetAddress:o}=this.params;if(!J.SEND_PARAMS_SUPPORTED_CHAINS.includes(i)){y.showError(`Chain "${i}" is not supported for send parameters`),this.loading=!1;return}const n=w.getCaipNetworkById(r,i);if(!n){y.showError(`Network with id "${r}" not found`),this.loading=!1;return}try{const{balance:s,name:a,symbol:W,decimals:V}=await G.fetchERC20Balance({caipAddress:this.caipAddress,assetAddress:o,caipNetwork:n});if(!a||!W||!V||!s){y.showError("Token not found");return}l.setToken({name:a,symbol:W,chainId:n.id.toString(),address:`${n.chainNamespace}:${n.id}:${o}`,value:0,price:0,quantity:{decimals:V.toString(),numeric:s.toString()},iconUrl:M.getTokenImage(W)??""}),l.setTokenAmount(t),l.setReceiverAddress(this.params.to)}catch(s){console.error("Failed to load token information:",s),y.showError("Failed to load token information")}finally{this.loading=!1}}};p.styles=re;g([u()],p.prototype,"token",void 0);g([u()],p.prototype,"sendTokenAmount",void 0);g([u()],p.prototype,"receiverAddress",void 0);g([u()],p.prototype,"receiverProfileName",void 0);g([u()],p.prototype,"loading",void 0);g([u()],p.prototype,"params",void 0);g([u()],p.prototype,"caipAddress",void 0);g([u()],p.prototype,"message",void 0);g([u()],p.prototype,"disconnecting",void 0);p=g([v("w3m-wallet-send-view")],p);const oe=b`
|
|
269
|
+
.contentContainer {
|
|
270
|
+
height: 440px;
|
|
271
|
+
overflow: scroll;
|
|
272
|
+
scrollbar-width: none;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.contentContainer::-webkit-scrollbar {
|
|
276
|
+
display: none;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
wui-icon-box {
|
|
280
|
+
width: 40px;
|
|
281
|
+
height: 40px;
|
|
282
|
+
border-radius: ${({borderRadius:e})=>e[3]};
|
|
283
|
+
}
|
|
284
|
+
`;var I=globalThis&&globalThis.__decorate||function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let A=class extends x{constructor(){super(),this.unsubscribe=[],this.tokenBalances=l.state.tokenBalances,this.search="",this.onDebouncedSearch=D.debounce(t=>{this.search=t}),this.fetchBalancesAndNetworkPrice(),this.unsubscribe.push(l.subscribe(t=>{this.tokenBalances=t.tokenBalances}))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){return c`
|
|
285
|
+
<wui-flex flexDirection="column">
|
|
286
|
+
${this.templateSearchInput()} <wui-separator></wui-separator> ${this.templateTokens()}
|
|
287
|
+
</wui-flex>
|
|
288
|
+
`}async fetchBalancesAndNetworkPrice(){var t;(!this.tokenBalances||((t=this.tokenBalances)==null?void 0:t.length)===0)&&(await this.fetchBalances(),await this.fetchNetworkPrice())}async fetchBalances(){await l.fetchTokenBalance(),l.fetchNetworkBalance()}async fetchNetworkPrice(){await Y.getNetworkTokenPrice()}templateSearchInput(){return c`
|
|
289
|
+
<wui-flex gap="2" padding="3">
|
|
290
|
+
<wui-input-text
|
|
291
|
+
@inputChange=${this.onInputChange.bind(this)}
|
|
292
|
+
class="network-search-input"
|
|
293
|
+
size="sm"
|
|
294
|
+
placeholder="Search token"
|
|
295
|
+
icon="search"
|
|
296
|
+
></wui-input-text>
|
|
297
|
+
</wui-flex>
|
|
298
|
+
`}templateTokens(){var t,i;return this.tokens=(t=this.tokenBalances)==null?void 0:t.filter(r=>{var o;return r.chainId===((o=w.state.activeCaipNetwork)==null?void 0:o.caipNetworkId)}),this.search?this.filteredTokens=(i=this.tokenBalances)==null?void 0:i.filter(r=>r.name.toLowerCase().includes(this.search.toLowerCase())):this.filteredTokens=this.tokens,c`
|
|
299
|
+
<wui-flex
|
|
300
|
+
class="contentContainer"
|
|
301
|
+
flexDirection="column"
|
|
302
|
+
.padding=${["0","3","0","3"]}
|
|
303
|
+
>
|
|
304
|
+
<wui-flex justifyContent="flex-start" .padding=${["4","3","3","3"]}>
|
|
305
|
+
<wui-text variant="md-medium" color="secondary">Your tokens</wui-text>
|
|
306
|
+
</wui-flex>
|
|
307
|
+
<wui-flex flexDirection="column" gap="2">
|
|
308
|
+
${this.filteredTokens&&this.filteredTokens.length>0?this.filteredTokens.map(r=>c`<wui-list-token
|
|
309
|
+
@click=${this.handleTokenClick.bind(this,r)}
|
|
310
|
+
?clickable=${!0}
|
|
311
|
+
tokenName=${r.name}
|
|
312
|
+
tokenImageUrl=${r.iconUrl}
|
|
313
|
+
tokenAmount=${r.quantity.numeric}
|
|
314
|
+
tokenValue=${r.value}
|
|
315
|
+
tokenCurrency=${r.symbol}
|
|
316
|
+
></wui-list-token>`):c`<wui-flex
|
|
317
|
+
.padding=${["20","0","0","0"]}
|
|
318
|
+
alignItems="center"
|
|
319
|
+
flexDirection="column"
|
|
320
|
+
gap="4"
|
|
321
|
+
>
|
|
322
|
+
<wui-icon-box icon="coinPlaceholder" color="default" size="lg"></wui-icon-box>
|
|
323
|
+
<wui-flex
|
|
324
|
+
class="textContent"
|
|
325
|
+
gap="2"
|
|
326
|
+
flexDirection="column"
|
|
327
|
+
justifyContent="center"
|
|
328
|
+
flexDirection="column"
|
|
329
|
+
>
|
|
330
|
+
<wui-text variant="lg-medium" align="center" color="primary">
|
|
331
|
+
No tokens found
|
|
332
|
+
</wui-text>
|
|
333
|
+
<wui-text variant="lg-regular" align="center" color="secondary">
|
|
334
|
+
Your tokens will appear here
|
|
335
|
+
</wui-text>
|
|
336
|
+
</wui-flex>
|
|
337
|
+
<wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link>
|
|
338
|
+
</wui-flex>`}
|
|
339
|
+
</wui-flex>
|
|
340
|
+
</wui-flex>
|
|
341
|
+
`}onBuyClick(){h.push("OnRampProviders")}onInputChange(t){this.onDebouncedSearch(t.detail)}handleTokenClick(t){l.setToken(t),l.setTokenAmount(void 0),h.goBack()}};A.styles=oe;I([u()],A.prototype,"tokenBalances",void 0);I([u()],A.prototype,"tokens",void 0);I([u()],A.prototype,"filteredTokens",void 0);I([u()],A.prototype,"search",void 0);A=I([v("w3m-wallet-send-select-token-view")],A);const se=b`
|
|
342
|
+
:host {
|
|
343
|
+
height: 32px;
|
|
344
|
+
display: flex;
|
|
345
|
+
align-items: center;
|
|
346
|
+
gap: ${({spacing:e})=>e[1]};
|
|
347
|
+
border-radius: ${({borderRadius:e})=>e[32]};
|
|
348
|
+
background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
|
|
349
|
+
padding: ${({spacing:e})=>e[1]};
|
|
350
|
+
padding-left: ${({spacing:e})=>e[2]};
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
wui-avatar,
|
|
354
|
+
wui-image {
|
|
355
|
+
width: 24px;
|
|
356
|
+
height: 24px;
|
|
357
|
+
border-radius: ${({borderRadius:e})=>e[16]};
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
wui-icon {
|
|
361
|
+
border-radius: ${({borderRadius:e})=>e[16]};
|
|
362
|
+
}
|
|
363
|
+
`;var _=globalThis&&globalThis.__decorate||function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let C=class extends x{constructor(){super(...arguments),this.text=""}render(){return c`<wui-text variant="lg-regular" color="primary">${this.text}</wui-text>
|
|
364
|
+
${this.imageTemplate()}`}imageTemplate(){return this.address?c`<wui-avatar address=${this.address} .imageSrc=${this.imageSrc}></wui-avatar>`:this.imageSrc?c`<wui-image src=${this.imageSrc}></wui-image>`:c`<wui-icon size="lg" color="inverse" name="networkPlaceholder"></wui-icon>`}};C.styles=[q,K,se];_([d({type:String})],C.prototype,"text",void 0);_([d({type:String})],C.prototype,"address",void 0);_([d({type:String})],C.prototype,"imageSrc",void 0);C=_([v("wui-preview-item")],C);const ae=b`
|
|
365
|
+
:host {
|
|
366
|
+
display: flex;
|
|
367
|
+
padding: ${({spacing:e})=>e[4]} ${({spacing:e})=>e[3]};
|
|
368
|
+
width: 100%;
|
|
369
|
+
background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
|
|
370
|
+
border-radius: ${({borderRadius:e})=>e[4]};
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
wui-image {
|
|
374
|
+
width: 20px;
|
|
375
|
+
height: 20px;
|
|
376
|
+
border-radius: ${({borderRadius:e})=>e[16]};
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
wui-icon {
|
|
380
|
+
width: 20px;
|
|
381
|
+
height: 20px;
|
|
382
|
+
}
|
|
383
|
+
`;var B=globalThis&&globalThis.__decorate||function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let S=class extends x{constructor(){super(...arguments),this.imageSrc=void 0,this.textTitle="",this.textValue=void 0}render(){return c`
|
|
384
|
+
<wui-flex justifyContent="space-between" alignItems="center">
|
|
385
|
+
<wui-text variant="lg-regular" color="primary"> ${this.textTitle} </wui-text>
|
|
386
|
+
${this.templateContent()}
|
|
387
|
+
</wui-flex>
|
|
388
|
+
`}templateContent(){return this.imageSrc?c`<wui-image src=${this.imageSrc} alt=${this.textTitle}></wui-image>`:this.textValue?c` <wui-text variant="md-regular" color="secondary"> ${this.textValue} </wui-text>`:c`<wui-icon size="inherit" color="default" name="networkPlaceholder"></wui-icon>`}};S.styles=[q,K,ae];B([d()],S.prototype,"imageSrc",void 0);B([d()],S.prototype,"textTitle",void 0);B([d()],S.prototype,"textValue",void 0);S=B([v("wui-list-content")],S);const le=b`
|
|
389
|
+
:host {
|
|
390
|
+
display: flex;
|
|
391
|
+
width: auto;
|
|
392
|
+
flex-direction: column;
|
|
393
|
+
gap: ${({spacing:e})=>e[1]};
|
|
394
|
+
border-radius: ${({borderRadius:e})=>e[5]};
|
|
395
|
+
background: ${({tokens:e})=>e.theme.foregroundPrimary};
|
|
396
|
+
padding: ${({spacing:e})=>e[3]} ${({spacing:e})=>e[2]}
|
|
397
|
+
${({spacing:e})=>e[2]} ${({spacing:e})=>e[2]};
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
wui-list-content {
|
|
401
|
+
width: -webkit-fill-available !important;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
wui-text {
|
|
405
|
+
padding: 0 ${({spacing:e})=>e[2]};
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
wui-flex {
|
|
409
|
+
margin-top: ${({spacing:e})=>e[2]};
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.network {
|
|
413
|
+
cursor: pointer;
|
|
414
|
+
transition: background-color ${({durations:e})=>e.lg}
|
|
415
|
+
${({easings:e})=>e["ease-out-power-1"]};
|
|
416
|
+
will-change: background-color;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.network:focus-visible {
|
|
420
|
+
border: 1px solid ${({tokens:e})=>e.core.textAccentPrimary};
|
|
421
|
+
background-color: ${({tokens:e})=>e.core.glass010};
|
|
422
|
+
-webkit-box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent010};
|
|
423
|
+
-moz-box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent010};
|
|
424
|
+
box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent010};
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.network:hover {
|
|
428
|
+
background-color: ${({tokens:e})=>e.core.glass010};
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.network:active {
|
|
432
|
+
background-color: ${({tokens:e})=>e.core.glass010};
|
|
433
|
+
}
|
|
434
|
+
`;var O=globalThis&&globalThis.__decorate||function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let N=class extends x{constructor(){var t;super(...arguments),this.params=(t=h.state.data)==null?void 0:t.send}render(){return c` <wui-text variant="sm-regular" color="secondary">Details</wui-text>
|
|
435
|
+
<wui-flex flexDirection="column" gap="1">
|
|
436
|
+
<wui-list-content
|
|
437
|
+
textTitle="Address"
|
|
438
|
+
textValue=${E.getTruncateString({string:this.receiverAddress??"",charsStart:4,charsEnd:4,truncate:"middle"})}
|
|
439
|
+
>
|
|
440
|
+
</wui-list-content>
|
|
441
|
+
${this.networkTemplate()}
|
|
442
|
+
</wui-flex>`}networkTemplate(){var t;return(t=this.caipNetwork)!=null&&t.name?c` <wui-list-content
|
|
443
|
+
@click=${()=>this.onNetworkClick(this.caipNetwork)}
|
|
444
|
+
class="network"
|
|
445
|
+
textTitle="Network"
|
|
446
|
+
imageSrc=${ee(M.getNetworkImage(this.caipNetwork))}
|
|
447
|
+
></wui-list-content>`:null}onNetworkClick(t){t&&!this.params&&h.push("Networks",{network:t})}};N.styles=le;O([d()],N.prototype,"receiverAddress",void 0);O([d({type:Object})],N.prototype,"caipNetwork",void 0);O([u()],N.prototype,"params",void 0);N=O([v("w3m-wallet-send-details")],N);const ce=b`
|
|
448
|
+
wui-avatar,
|
|
449
|
+
wui-image {
|
|
450
|
+
display: ruby;
|
|
451
|
+
width: 32px;
|
|
452
|
+
height: 32px;
|
|
453
|
+
border-radius: ${({borderRadius:e})=>e[20]};
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.sendButton {
|
|
457
|
+
width: 70%;
|
|
458
|
+
--local-width: 100% !important;
|
|
459
|
+
--local-border-radius: ${({borderRadius:e})=>e[4]} !important;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.cancelButton {
|
|
463
|
+
width: 30%;
|
|
464
|
+
--local-width: 100% !important;
|
|
465
|
+
--local-border-radius: ${({borderRadius:e})=>e[4]} !important;
|
|
466
|
+
}
|
|
467
|
+
`;var k=globalThis&&globalThis.__decorate||function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let m=class extends x{constructor(){var t;super(),this.unsubscribe=[],this.token=l.state.token,this.sendTokenAmount=l.state.sendTokenAmount,this.receiverAddress=l.state.receiverAddress,this.receiverProfileName=l.state.receiverProfileName,this.receiverProfileImageUrl=l.state.receiverProfileImageUrl,this.caipNetwork=w.state.activeCaipNetwork,this.loading=l.state.loading,this.params=(t=h.state.data)==null?void 0:t.send,this.unsubscribe.push(l.subscribe(i=>{this.token=i.token,this.sendTokenAmount=i.sendTokenAmount,this.receiverAddress=i.receiverAddress,this.receiverProfileName=i.receiverProfileName,this.receiverProfileImageUrl=i.receiverProfileImageUrl,this.loading=i.loading}),w.subscribeKey("activeCaipNetwork",i=>this.caipNetwork=i))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){var t,i;return c` <wui-flex flexDirection="column" .padding=${["0","4","4","4"]}>
|
|
468
|
+
<wui-flex gap="2" flexDirection="column" .padding=${["0","2","0","2"]}>
|
|
469
|
+
<wui-flex alignItems="center" justifyContent="space-between">
|
|
470
|
+
<wui-flex flexDirection="column" gap="01">
|
|
471
|
+
<wui-text variant="sm-regular" color="secondary">Send</wui-text>
|
|
472
|
+
${this.sendValueTemplate()}
|
|
473
|
+
</wui-flex>
|
|
474
|
+
<wui-preview-item
|
|
475
|
+
text="${this.sendTokenAmount?E.roundNumber(this.sendTokenAmount,6,5):"unknown"} ${(t=this.token)==null?void 0:t.symbol}"
|
|
476
|
+
.imageSrc=${(i=this.token)==null?void 0:i.iconUrl}
|
|
477
|
+
></wui-preview-item>
|
|
478
|
+
</wui-flex>
|
|
479
|
+
<wui-flex>
|
|
480
|
+
<wui-icon color="default" size="md" name="arrowBottom"></wui-icon>
|
|
481
|
+
</wui-flex>
|
|
482
|
+
<wui-flex alignItems="center" justifyContent="space-between">
|
|
483
|
+
<wui-text variant="sm-regular" color="secondary">To</wui-text>
|
|
484
|
+
<wui-preview-item
|
|
485
|
+
text="${this.receiverProfileName?E.getTruncateString({string:this.receiverProfileName,charsStart:20,charsEnd:0,truncate:"end"}):E.getTruncateString({string:this.receiverAddress?this.receiverAddress:"",charsStart:4,charsEnd:4,truncate:"middle"})}"
|
|
486
|
+
address=${this.receiverAddress??""}
|
|
487
|
+
.imageSrc=${this.receiverProfileImageUrl??void 0}
|
|
488
|
+
.isAddress=${!0}
|
|
489
|
+
></wui-preview-item>
|
|
490
|
+
</wui-flex>
|
|
491
|
+
</wui-flex>
|
|
492
|
+
<wui-flex flexDirection="column" .padding=${["6","0","0","0"]}>
|
|
493
|
+
<w3m-wallet-send-details
|
|
494
|
+
.caipNetwork=${this.caipNetwork}
|
|
495
|
+
.receiverAddress=${this.receiverAddress}
|
|
496
|
+
></w3m-wallet-send-details>
|
|
497
|
+
<wui-flex justifyContent="center" gap="1" .padding=${["3","0","0","0"]}>
|
|
498
|
+
<wui-icon size="sm" color="default" name="warningCircle"></wui-icon>
|
|
499
|
+
<wui-text variant="sm-regular" color="secondary">Review transaction carefully</wui-text>
|
|
500
|
+
</wui-flex>
|
|
501
|
+
<wui-flex justifyContent="center" gap="3" .padding=${["4","0","0","0"]}>
|
|
502
|
+
<wui-button
|
|
503
|
+
class="cancelButton"
|
|
504
|
+
@click=${this.onCancelClick.bind(this)}
|
|
505
|
+
size="lg"
|
|
506
|
+
variant="neutral-secondary"
|
|
507
|
+
>
|
|
508
|
+
Cancel
|
|
509
|
+
</wui-button>
|
|
510
|
+
<wui-button
|
|
511
|
+
class="sendButton"
|
|
512
|
+
@click=${this.onSendClick.bind(this)}
|
|
513
|
+
size="lg"
|
|
514
|
+
variant="accent-primary"
|
|
515
|
+
.loading=${this.loading}
|
|
516
|
+
>
|
|
517
|
+
Send
|
|
518
|
+
</wui-button>
|
|
519
|
+
</wui-flex>
|
|
520
|
+
</wui-flex></wui-flex
|
|
521
|
+
>`}sendValueTemplate(){if(!this.params&&this.token&&this.sendTokenAmount){const i=this.token.price*this.sendTokenAmount;return c`<wui-text variant="md-regular" color="primary"
|
|
522
|
+
>$${i.toFixed(2)}</wui-text
|
|
523
|
+
>`}return null}async onSendClick(){if(!this.sendTokenAmount||!this.receiverAddress){y.showError("Please enter a valid amount and receiver address");return}try{await l.sendToken(),this.params?h.reset("WalletSendConfirmed"):(y.showSuccess("Transaction started"),h.replace("Account"))}catch(t){let i="Failed to send transaction. Please try again.";const r=t instanceof Q&&t.originalName===X.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST;(w.state.activeChain===te.CHAIN.SOLANA||r)&&t instanceof Error&&(i=t.message),Z.sendEvent({type:"track",event:r?"SEND_REJECTED":"SEND_ERROR",properties:l.getSdkEventProperties(t)}),y.showError(i)}}onCancelClick(){h.goBack()}};m.styles=ce;k([u()],m.prototype,"token",void 0);k([u()],m.prototype,"sendTokenAmount",void 0);k([u()],m.prototype,"receiverAddress",void 0);k([u()],m.prototype,"receiverProfileName",void 0);k([u()],m.prototype,"receiverProfileImageUrl",void 0);k([u()],m.prototype,"caipNetwork",void 0);k([u()],m.prototype,"loading",void 0);k([u()],m.prototype,"params",void 0);m=k([v("w3m-wallet-send-preview-view")],m);const ue=b`
|
|
524
|
+
.icon-box {
|
|
525
|
+
width: 64px;
|
|
526
|
+
height: 64px;
|
|
527
|
+
border-radius: 16px;
|
|
528
|
+
background-color: ${({spacing:e})=>e[16]};
|
|
529
|
+
border: 8px solid ${({tokens:e})=>e.theme.borderPrimary};
|
|
530
|
+
border-radius: ${({borderRadius:e})=>e.round};
|
|
531
|
+
}
|
|
532
|
+
`;var de=globalThis&&globalThis.__decorate||function(e,t,i,r){var o=arguments.length,n=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(o<3?s(n):o>3?s(t,i,n):s(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let U=class extends x{constructor(){super(),this.unsubscribe=[],this.unsubscribe.push()}render(){return c`
|
|
533
|
+
<wui-flex
|
|
534
|
+
flexDirection="column"
|
|
535
|
+
alignItems="center"
|
|
536
|
+
gap="4"
|
|
537
|
+
.padding="${["1","3","4","3"]}"
|
|
538
|
+
>
|
|
539
|
+
<wui-flex justifyContent="center" alignItems="center" class="icon-box">
|
|
540
|
+
<wui-icon size="xxl" color="success" name="checkmark"></wui-icon>
|
|
541
|
+
</wui-flex>
|
|
542
|
+
|
|
543
|
+
<wui-text variant="h6-medium" color="primary">You successfully sent asset</wui-text>
|
|
544
|
+
|
|
545
|
+
<wui-button
|
|
546
|
+
fullWidth
|
|
547
|
+
@click=${this.onCloseClick.bind(this)}
|
|
548
|
+
size="lg"
|
|
549
|
+
variant="neutral-secondary"
|
|
550
|
+
>
|
|
551
|
+
Close
|
|
552
|
+
</wui-button>
|
|
553
|
+
</wui-flex>
|
|
554
|
+
`}onCloseClick(){L.close()}};U.styles=ue;U=de([v("w3m-send-confirmed-view")],U);export{U as W3mSendConfirmedView,A as W3mSendSelectTokenView,m as W3mWalletSendPreviewView,p as W3mWalletSendView};
|