@mezo-org/passport 0.4.0-dev.20 → 0.4.0-dev.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -22
- package/dist/src/api/portal.d.ts +1 -0
- package/dist/src/api/portal.d.ts.map +1 -1
- package/dist/src/api/portal.js.map +1 -1
- package/dist/src/components/Dropdown/Content.d.ts +16 -2
- package/dist/src/components/Dropdown/Content.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Content.js +5 -3
- package/dist/src/components/Dropdown/Content.js.map +1 -1
- package/dist/src/components/Dropdown/Dropdown.d.ts +1 -5
- package/dist/src/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Dropdown.js +7 -6
- package/dist/src/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/src/components/Dropdown/ListingItem.d.ts +13 -0
- package/dist/src/components/Dropdown/ListingItem.d.ts.map +1 -0
- package/dist/src/components/Dropdown/ListingItem.js +34 -0
- package/dist/src/components/Dropdown/ListingItem.js.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountAssetItem.d.ts +11 -0
- package/dist/src/components/Dropdown/Root/AccountAssetItem.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountAssetItem.js +9 -0
- package/dist/src/components/Dropdown/Root/AccountAssetItem.js.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountBalance.d.ts +2 -1
- package/dist/src/components/Dropdown/Root/AccountBalance.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Root/AccountBalance.js +7 -8
- package/dist/src/components/Dropdown/Root/AccountBalance.js.map +1 -1
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.d.ts +9 -0
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.js +48 -0
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.js.map +1 -0
- package/dist/src/components/Dropdown/Root/Root.d.ts +17 -2
- package/dist/src/components/Dropdown/Root/Root.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Root/Root.js +15 -22
- package/dist/src/components/Dropdown/Root/Root.js.map +1 -1
- package/dist/src/components/Dropdown/Root/WalletAddress.js +5 -6
- package/dist/src/components/Dropdown/Root/WalletAddress.js.map +1 -1
- package/dist/src/components/Dropdown/Root/WelcomeBlock.js +4 -3
- package/dist/src/components/Dropdown/Root/WelcomeBlock.js.map +1 -1
- package/dist/src/components/Dropdown/TestnetTopBanner.d.ts +3 -0
- package/dist/src/components/Dropdown/TestnetTopBanner.d.ts.map +1 -0
- package/dist/src/components/Dropdown/TestnetTopBanner.js +14 -0
- package/dist/src/components/Dropdown/TestnetTopBanner.js.map +1 -0
- package/dist/src/config.js +2 -2
- package/dist/src/config.js.map +1 -1
- package/dist/src/constants.d.ts +2 -1
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +5 -4
- package/dist/src/constants.js.map +1 -1
- package/dist/src/hooks/index.d.ts +2 -0
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/index.js +2 -0
- package/dist/src/hooks/index.js.map +1 -1
- package/dist/src/hooks/useAssetsConversionRates.d.ts +7 -0
- package/dist/src/hooks/useAssetsConversionRates.d.ts.map +1 -0
- package/dist/src/hooks/{useAssetsUSDConversion.js → useAssetsConversionRates.js} +8 -5
- package/dist/src/hooks/useAssetsConversionRates.js.map +1 -0
- package/dist/src/hooks/useAuthenticateWithWallet.d.ts.map +1 -1
- package/dist/src/hooks/useAuthenticateWithWallet.js +4 -4
- package/dist/src/hooks/useAuthenticateWithWallet.js.map +1 -1
- package/dist/src/hooks/useBorrowData.d.ts +1418 -0
- package/dist/src/hooks/useBorrowData.d.ts.map +1 -0
- package/dist/src/hooks/useBorrowData.js +65 -0
- package/dist/src/hooks/useBorrowData.js.map +1 -0
- package/dist/src/hooks/useDropdownData.d.ts +28 -34
- package/dist/src/hooks/useDropdownData.d.ts.map +1 -1
- package/dist/src/hooks/useDropdownData.js +61 -65
- package/dist/src/hooks/useDropdownData.js.map +1 -1
- package/dist/src/hooks/useRefreshPassport.d.ts +2 -0
- package/dist/src/hooks/useRefreshPassport.d.ts.map +1 -1
- package/dist/src/hooks/useRefreshPassport.js +6 -0
- package/dist/src/hooks/useRefreshPassport.js.map +1 -1
- package/dist/src/hooks/useTokensBalances.d.ts +74 -0
- package/dist/src/hooks/useTokensBalances.d.ts.map +1 -0
- package/dist/src/hooks/useTokensBalances.js +140 -0
- package/dist/src/hooks/useTokensBalances.js.map +1 -0
- package/dist/src/hooks/useWalletAccount.d.ts +2 -1
- package/dist/src/hooks/useWalletAccount.d.ts.map +1 -1
- package/dist/src/hooks/useWalletAccount.js +2 -1
- package/dist/src/hooks/useWalletAccount.js.map +1 -1
- package/dist/src/lib/contracts/index.d.ts +10 -0
- package/dist/src/lib/contracts/index.d.ts.map +1 -0
- package/dist/src/lib/contracts/index.js +49 -0
- package/dist/src/lib/contracts/index.js.map +1 -0
- package/dist/src/lib/contracts/musd.d.ts +107 -0
- package/dist/src/lib/contracts/musd.d.ts.map +1 -0
- package/dist/src/lib/contracts/musd.js +1070 -0
- package/dist/src/lib/contracts/musd.js.map +1 -0
- package/dist/src/lib/contracts/troveManager.d.ts +1401 -0
- package/dist/src/lib/contracts/troveManager.d.ts.map +1 -0
- package/dist/src/lib/contracts/troveManager.js +1820 -0
- package/dist/src/lib/contracts/troveManager.js.map +1 -0
- package/dist/src/utils/cryptoAssets.d.ts +17 -1
- package/dist/src/utils/cryptoAssets.d.ts.map +1 -1
- package/dist/src/utils/cryptoAssets.js +89 -31
- package/dist/src/utils/cryptoAssets.js.map +1 -1
- package/dist/src/utils/cryptoAssets.test.js +50 -33
- package/dist/src/utils/cryptoAssets.test.js.map +1 -1
- package/dist/src/utils/numbers.d.ts +13 -0
- package/dist/src/utils/numbers.d.ts.map +1 -1
- package/dist/src/utils/numbers.js +46 -0
- package/dist/src/utils/numbers.js.map +1 -1
- package/package.json +7 -6
- package/src/api/portal.ts +1 -0
- package/src/components/Dropdown/Content.tsx +47 -11
- package/src/components/Dropdown/Dropdown.tsx +28 -13
- package/src/components/Dropdown/ListingItem.tsx +80 -0
- package/src/components/Dropdown/README.md +0 -14
- package/src/components/Dropdown/Root/AccountAssetItem.tsx +26 -0
- package/src/components/Dropdown/Root/AccountBalance.tsx +13 -18
- package/src/components/Dropdown/Root/AccountOtherAssets.tsx +68 -0
- package/src/components/Dropdown/Root/Root.tsx +59 -53
- package/src/components/Dropdown/Root/WalletAddress.tsx +7 -7
- package/src/components/Dropdown/Root/WelcomeBlock.tsx +3 -3
- package/src/components/Dropdown/TestnetTopBanner.tsx +32 -0
- package/src/config.ts +2 -2
- package/src/constants.ts +5 -4
- package/src/hooks/index.ts +5 -0
- package/src/hooks/{useAssetsUSDConversion.ts → useAssetsConversionRates.ts} +8 -7
- package/src/hooks/useAuthenticateWithWallet.ts +11 -7
- package/src/hooks/useBorrowData.ts +79 -0
- package/src/hooks/useDropdownData.ts +76 -121
- package/src/hooks/useRefreshPassport.ts +6 -0
- package/src/hooks/useTokensBalances.ts +187 -0
- package/src/hooks/useWalletAccount.ts +4 -2
- package/src/lib/contracts/index.ts +75 -0
- package/src/lib/contracts/musd.ts +1071 -0
- package/src/lib/contracts/troveManager.ts +1819 -0
- package/src/utils/cryptoAssets.test.ts +55 -37
- package/src/utils/cryptoAssets.ts +115 -35
- package/src/utils/numbers.ts +68 -0
- package/dist/src/components/Dropdown/Root/AccountAssets.d.ts +0 -13
- package/dist/src/components/Dropdown/Root/AccountAssets.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountAssets.js +0 -43
- package/dist/src/components/Dropdown/Root/AccountAssets.js.map +0 -1
- package/dist/src/hooks/useAssetsUSDConversion.d.ts +0 -8
- package/dist/src/hooks/useAssetsUSDConversion.d.ts.map +0 -1
- package/dist/src/hooks/useAssetsUSDConversion.js.map +0 -1
- package/src/components/Dropdown/Root/AccountAssets.tsx +0 -108
package/README.md
CHANGED
|
@@ -96,12 +96,12 @@ Mezo Passport provides a `getConfig` method, which returns a default
|
|
|
96
96
|
configuration for Mezo Matsnet. We just have to pass it further to
|
|
97
97
|
`WagmiProvider`:
|
|
98
98
|
|
|
99
|
-
```
|
|
99
|
+
```tsx
|
|
100
100
|
import { RainbowKitProvider } from "@rainbow-me/rainbowkit"
|
|
101
101
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
|
|
102
102
|
import { WagmiProvider } from "wagmi"
|
|
103
103
|
import "@rainbow-me/rainbowkit/styles.css"
|
|
104
|
-
import { getConfig,
|
|
104
|
+
import { getConfig, mezoTestnet } from "@mezo-org/passport"
|
|
105
105
|
|
|
106
106
|
const queryClient = new QueryClient()
|
|
107
107
|
|
|
@@ -109,7 +109,7 @@ ReactDOM.createRoot(document.getElementById("root")!).render(
|
|
|
109
109
|
<React.StrictMode>
|
|
110
110
|
<WagmiProvider config={getConfig({ appName: "Your app name" })}>
|
|
111
111
|
<QueryClientProvider client={queryClient}>
|
|
112
|
-
<RainbowKitProvider initialChain={
|
|
112
|
+
<RainbowKitProvider initialChain={mezoTestnet}>
|
|
113
113
|
{/* Your App component */}
|
|
114
114
|
</RainbowKitProvider>
|
|
115
115
|
</QueryClientProvider>
|
|
@@ -127,7 +127,7 @@ support. By default, the lib supports Unisat, OKX and Xverse wallets. If you
|
|
|
127
127
|
want to include Unisat wallet only, you can pass it through `bitcoinWallet`
|
|
128
128
|
property to `getConfig` function:
|
|
129
129
|
|
|
130
|
-
```
|
|
130
|
+
```tsx
|
|
131
131
|
import { getConfig, unisatWallet } from "@mezo-org/passport"
|
|
132
132
|
|
|
133
133
|
const customBitcoinWallets = [
|
|
@@ -169,11 +169,8 @@ There are two ways to connect the Mezo Passport wallet:
|
|
|
169
169
|
|
|
170
170
|
We can connect to the specific wallet directly through `wagmi`:
|
|
171
171
|
|
|
172
|
-
```
|
|
173
|
-
import {
|
|
174
|
-
useChainId,
|
|
175
|
-
useConnect,
|
|
176
|
-
} from "wagmi"
|
|
172
|
+
```tsx
|
|
173
|
+
import { useChainId, useConnect } from "wagmi"
|
|
177
174
|
|
|
178
175
|
export const YourApp = () => {
|
|
179
176
|
const chainId = useChainId()
|
|
@@ -194,8 +191,7 @@ export const YourApp = () => {
|
|
|
194
191
|
))}
|
|
195
192
|
</div>
|
|
196
193
|
)
|
|
197
|
-
|
|
198
|
-
};
|
|
194
|
+
}
|
|
199
195
|
```
|
|
200
196
|
|
|
201
197
|
This will render a button for each wallet that we've added to the rainbowKit
|
|
@@ -208,12 +204,12 @@ We can also implement wallet connection through RainbowKit, where we import the
|
|
|
208
204
|
`ConnectButton` component, which will handle the connection process under the
|
|
209
205
|
hood:
|
|
210
206
|
|
|
211
|
-
```
|
|
207
|
+
```tsx
|
|
212
208
|
import { ConnectButton } from "@rainbow-me/rainbowkit"
|
|
213
209
|
|
|
214
210
|
export const YourApp = () => {
|
|
215
|
-
return <ConnectButton label="Connect wallet"
|
|
216
|
-
}
|
|
211
|
+
return <ConnectButton label="Connect wallet" />
|
|
212
|
+
}
|
|
217
213
|
```
|
|
218
214
|
|
|
219
215
|
### Getting addresses and wallet balances
|
|
@@ -224,7 +220,7 @@ For bitcoin account Mezo Passport exports a helper hook -
|
|
|
224
220
|
`useBitcoinAccount()` - which can be used to obtain address and balance of the
|
|
225
221
|
connected bitcoin account:
|
|
226
222
|
|
|
227
|
-
```
|
|
223
|
+
```ts
|
|
228
224
|
import { useBitcoinAccount } from "@mezo-org/passport"
|
|
229
225
|
|
|
230
226
|
const { btcAddress, btcBalance } = useBitcoinAccount()
|
|
@@ -237,7 +233,7 @@ useEffect(() => {
|
|
|
237
233
|
|
|
238
234
|
This hook returns the bitcoin balance in satoshis, in the following format:
|
|
239
235
|
|
|
240
|
-
```
|
|
236
|
+
```ts
|
|
241
237
|
{
|
|
242
238
|
confirmed: number,
|
|
243
239
|
unconfirmed: number,
|
|
@@ -250,7 +246,7 @@ This hook returns the bitcoin balance in satoshis, in the following format:
|
|
|
250
246
|
To get an address and a balance of the underlying Mezo Matsnet account, we can
|
|
251
247
|
use `wagmi` hooks:
|
|
252
248
|
|
|
253
|
-
```
|
|
249
|
+
```ts
|
|
254
250
|
const { address } = useAccount()
|
|
255
251
|
const { data } = useBalance({ address })
|
|
256
252
|
|
|
@@ -265,14 +261,14 @@ useEffect(() => {
|
|
|
265
261
|
The Mezo Passport wallets supports message signing from `wagmi` lib, so signing
|
|
266
262
|
functions the same way as it does in `wagmi`:
|
|
267
263
|
|
|
268
|
-
```
|
|
269
|
-
import { useSignMessage } from
|
|
264
|
+
```tsx
|
|
265
|
+
import { useSignMessage } from "wagmi"
|
|
270
266
|
|
|
271
267
|
function App() {
|
|
272
268
|
const { signMessage } = useSignMessage()
|
|
273
269
|
|
|
274
270
|
return (
|
|
275
|
-
<button onClick={() => signMessage({ message:
|
|
271
|
+
<button onClick={() => signMessage({ message: "hello world" })}>
|
|
276
272
|
Sign message
|
|
277
273
|
</button>
|
|
278
274
|
)
|
|
@@ -286,7 +282,7 @@ Contracts integrations are handled the same way as in RainbowKit and Wagmi.
|
|
|
286
282
|
To send a specific Mezo Matsnet transaction from the underlying Mezo Matsnet
|
|
287
283
|
account, we can use a `useSendTransaction` hook from `@mezo-org/passport`:
|
|
288
284
|
|
|
289
|
-
```
|
|
285
|
+
```ts
|
|
290
286
|
import { useSendTransaction } from "@mezo-org/passport"
|
|
291
287
|
|
|
292
288
|
const { sendTransaction } = useSendTransaction()
|
|
@@ -314,7 +310,7 @@ With `@mezo-org/passport` it's also possible to send BTC transactions from your
|
|
|
314
310
|
original Bitcoin account (not the underlying Mezo Matsnet account). For that, we
|
|
315
311
|
can use `useSendBitcoin` hook:
|
|
316
312
|
|
|
317
|
-
```
|
|
313
|
+
```ts
|
|
318
314
|
import { useSendBitcoin } from "@mezo-org/passport"
|
|
319
315
|
|
|
320
316
|
const { sendBitcoin } = useSendBitcoin()
|
package/dist/src/api/portal.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../src/api/portal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEpC,KAAK,gBAAgB,GAAG;IACtB,OAAO,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,MAAM,CAAA;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,gBAAgB,EAAE,MAAM,CAAA;IACxB,gBAAgB,EAAE,MAAM,CAAA;IACxB,kBAAkB,EAAE,MAAM,CAAA;CAC3B,CAAA;AAED,KAAK,UAAU,GAAG;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,gBAAgB,EAAE,MAAM,CAAA;IACxB,iBAAiB,EAAE,MAAM,CAAA;IACzB,0BAA0B,EAAE,MAAM,CAAA;IAClC,kBAAkB,EAAE,MAAM,CAAA;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,sBAAsB,EAAE,MAAM,CAAA;IAC9B,+BAA+B,EAAE,MAAM,CAAA;CACxC,CAAA;AAED,eAAO,MAAM,2BAA2B;;;CAGvC,CAAA;AAED,qBAAa,eAAgB,SAAQ,SAAS;gBAE1C,WAAW,GAAE,MAAM,OAAO,2BAAuC,EACjE,MAAM,CAAC,EAAE,MAAM;IAKX,mBAAmB;IAQnB,aAAa,CAAC,OAAO,EAAE,MAAM;CAUpC"}
|
|
1
|
+
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../src/api/portal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEpC,KAAK,gBAAgB,GAAG;IACtB,OAAO,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,MAAM,CAAA;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,gBAAgB,EAAE,MAAM,CAAA;IACxB,gBAAgB,EAAE,MAAM,CAAA;IACxB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,kBAAkB,EAAE,MAAM,CAAA;CAC3B,CAAA;AAED,KAAK,UAAU,GAAG;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,gBAAgB,EAAE,MAAM,CAAA;IACxB,iBAAiB,EAAE,MAAM,CAAA;IACzB,0BAA0B,EAAE,MAAM,CAAA;IAClC,kBAAkB,EAAE,MAAM,CAAA;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,sBAAsB,EAAE,MAAM,CAAA;IAC9B,+BAA+B,EAAE,MAAM,CAAA;CACxC,CAAA;AAED,eAAO,MAAM,2BAA2B;;;CAGvC,CAAA;AAED,qBAAa,eAAgB,SAAQ,SAAS;gBAE1C,WAAW,GAAE,MAAM,OAAO,2BAAuC,EACjE,MAAM,CAAC,EAAE,MAAM;IAKX,mBAAmB;IAQnB,aAAa,CAAC,OAAO,EAAE,MAAM;CAUpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal.js","sourceRoot":"","sources":["../../../src/api/portal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"portal.js","sourceRoot":"","sources":["../../../src/api/portal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAyBpC,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,OAAO,EAAE,6BAA6B;IACtC,OAAO,EAAE,kCAAkC;CAC5C,CAAA;AAED,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C,YACE,cAAwD,SAAS,EACjE,MAAe;QAEf,KAAK,CAAC,MAAM,IAAI,2BAA2B,CAAC,WAAW,CAAC,CAAC,CAAA;IAC3D,CAAC;IAED,KAAK,CAAC,mBAAmB;QACvB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,aAAa,CAAmB,aAAa,EAAE;YACrE,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;QAEF,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,OAAe;QACjC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,aAAa,CACnC,aAAa,OAAO,OAAO,EAC3B;YACE,MAAM,EAAE,KAAK;SACd,CACF,CAAA;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CACF"}
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { DetailedCryptoAsset } from "../../utils/cryptoAssets";
|
|
3
3
|
type ContentProps = {
|
|
4
|
-
|
|
4
|
+
mezoId: string;
|
|
5
|
+
matsBalance: number;
|
|
6
|
+
accountAddress: string;
|
|
7
|
+
walletAddress: string;
|
|
8
|
+
walletType: "bitcoin" | "evm";
|
|
9
|
+
usdTotalBalance: number;
|
|
10
|
+
usdTroveDebt: number;
|
|
11
|
+
usdCollateral: number;
|
|
12
|
+
assets: {
|
|
13
|
+
btc: DetailedCryptoAsset;
|
|
14
|
+
musd: DetailedCryptoAsset;
|
|
15
|
+
};
|
|
16
|
+
otherAssetsCount: number;
|
|
17
|
+
otherAssetsUsdTotal: number;
|
|
5
18
|
onSignOut?: () => void;
|
|
19
|
+
onOtherAssetsClick?: () => void;
|
|
6
20
|
};
|
|
7
21
|
declare function Content(props: ContentProps): React.JSX.Element;
|
|
8
22
|
export default Content;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/Content.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/Content.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAIxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAG9D,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,SAAS,GAAG,KAAK,CAAA;IAC7B,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE;QACN,GAAG,EAAE,mBAAmB,CAAA;QACxB,IAAI,EAAE,mBAAmB,CAAA;KAC1B,CAAA;IACD,gBAAgB,EAAE,MAAM,CAAA;IACxB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;CAChC,CAAA;AAED,iBAAS,OAAO,CAAC,KAAK,EAAE,YAAY,qBAoEnC;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -3,8 +3,9 @@ import React, { useEffect } from "react";
|
|
|
3
3
|
import useDropdownStore, { DropdownView } from "../../stores/dropdownStore";
|
|
4
4
|
import Root from "./Root/Root";
|
|
5
5
|
import Receive from "./Receive/Receive";
|
|
6
|
+
import TestnetTopBanner from "./TestnetTopBanner";
|
|
6
7
|
function Content(props) {
|
|
7
|
-
const {
|
|
8
|
+
const { mezoId, accountAddress, walletAddress, walletType, usdTotalBalance, assets, matsBalance, usdTroveDebt, usdCollateral, otherAssetsCount, otherAssetsUsdTotal, onSignOut, onOtherAssetsClick, } = props;
|
|
8
9
|
const [_, theme] = useStyletron();
|
|
9
10
|
const currentView = useDropdownStore((state) => state.view);
|
|
10
11
|
const setView = useDropdownStore((state) => state.setView);
|
|
@@ -18,8 +19,9 @@ function Content(props) {
|
|
|
18
19
|
},
|
|
19
20
|
},
|
|
20
21
|
} },
|
|
21
|
-
|
|
22
|
-
currentView === DropdownView.
|
|
22
|
+
React.createElement(TestnetTopBanner, null),
|
|
23
|
+
currentView === DropdownView.ROOT && (React.createElement(Root, { mezoId: mezoId, accountAddress: accountAddress, walletAddress: walletAddress, walletType: walletType, usdTotalBalance: usdTotalBalance, assets: assets, matsBalance: matsBalance, usdTroveDebt: usdTroveDebt, usdCollateral: usdCollateral, otherAssetsCount: otherAssetsCount, otherAssetsUsdTotal: otherAssetsUsdTotal, onSignOut: onSignOut, onOtherAssetsClick: onOtherAssetsClick })),
|
|
24
|
+
currentView === DropdownView.RECEIVE && (React.createElement(Receive, { address: accountAddress }))));
|
|
23
25
|
}
|
|
24
26
|
export default Content;
|
|
25
27
|
//# sourceMappingURL=Content.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/Content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Content.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/Content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,gBAAgB,EAAE,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC3E,OAAO,IAAI,MAAM,aAAa,CAAA;AAC9B,OAAO,OAAO,MAAM,mBAAmB,CAAA;AAEvC,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AAqBjD,SAAS,OAAO,CAAC,KAAmB;IAClC,MAAM,EACJ,MAAM,EACN,cAAc,EACd,aAAa,EACb,UAAU,EACV,eAAe,EACf,MAAM,EACN,WAAW,EACX,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,SAAS,EACT,kBAAkB,GACnB,GAAG,KAAK,CAAA;IAET,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEjC,MAAM,WAAW,GAAG,gBAAgB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC3D,MAAM,OAAO,GAAG,gBAAgB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IAE1D,SAAS,CACP,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;IAC5B,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAA;IAED,OAAO,CACL,oBAAC,KAAK,IACJ,OAAO,EAAC,aAAa,EACrB,aAAa,EAAC,QAAQ,EACtB,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,iBAAiB,EAC/C,KAAK,EAAC,MAAM,EACZ,SAAS,EAAE;YACT,KAAK,EAAE;gBACL,KAAK,EAAE;oBACL,SAAS,EAAE,YAAY;iBACxB;aACF;SACF;QAED,oBAAC,gBAAgB,OAAG;QAEnB,WAAW,KAAK,YAAY,CAAC,IAAI,IAAI,CACpC,oBAAC,IAAI,IACH,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,mBAAmB,EAAE,mBAAmB,EACxC,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,GACtC,CACH;QAEA,WAAW,KAAK,YAAY,CAAC,OAAO,IAAI,CACvC,oBAAC,OAAO,IAAC,OAAO,EAAE,cAAc,GAAI,CACrC,CACK,CACT,CAAA;AACH,CAAC;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { ButtonProps, StatefulPopoverProps } from "@mezo-org/mezo-clay";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { DropdownCryptoAsset } from "../../hooks/useDropdownData";
|
|
4
3
|
export type DropdownProps = {
|
|
5
4
|
/** The callback to be called when the user clicks the sign-out button */
|
|
6
5
|
onSignOut?: () => void;
|
|
7
6
|
/** The callback to be called when the user clicks the button in sign-in state */
|
|
8
7
|
onSignIn?: () => void;
|
|
9
|
-
/** The set of EVM native assets to be displayed in the dropdown */
|
|
10
|
-
evmNativeAssets?: DropdownCryptoAsset<"tbtc" | "wbtc">[];
|
|
11
|
-
/** The set of Matsnet assets to be displayed in the dropdown */
|
|
12
|
-
matsnetAssets?: DropdownCryptoAsset<"mbtc" | "musd">[];
|
|
13
8
|
/** The props to be passed to the trigger button */
|
|
14
9
|
triggerProps?: {
|
|
15
10
|
signedIn?: Omit<ButtonProps, "onClick" | "size"> & {
|
|
@@ -17,6 +12,7 @@ export type DropdownProps = {
|
|
|
17
12
|
};
|
|
18
13
|
signedOut?: Omit<ButtonProps, "onClick">;
|
|
19
14
|
};
|
|
15
|
+
onOtherAssetsClick?: () => void;
|
|
20
16
|
} & Omit<StatefulPopoverProps, "children" | "content">;
|
|
21
17
|
/**
|
|
22
18
|
* Passport Dropdown component that displays user's wallet and assets information.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAEX,oBAAoB,EAErB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,
|
|
1
|
+
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAEX,oBAAoB,EAErB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,KAA6B,MAAM,OAAO,CAAA;AAUjD,MAAM,MAAM,aAAa,GAAG;IAC1B,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,mDAAmD;IACnD,YAAY,CAAC,EAAE;QACb,QAAQ,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,CAAC,GAAG;YACjD,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAA;SACzB,CAAA;QACD,SAAS,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;KACzC,CAAA;IACD,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;CAChC,GAAG,IAAI,CAAC,oBAAoB,EAAE,UAAU,GAAG,SAAS,CAAC,CAAA;AAEtD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,qBAqG5C"}
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { StatefulPopover, useStyletron, } from "@mezo-org/mezo-clay";
|
|
2
2
|
import { useConnectModal } from "@rainbow-me/rainbowkit";
|
|
3
|
-
import React, { useEffect } from "react";
|
|
3
|
+
import React, { useEffect, useMemo } from "react";
|
|
4
4
|
import { useDisconnect } from "wagmi";
|
|
5
5
|
import DefaultAvatar from "../../assets/DefaultAvatar";
|
|
6
|
-
import useDropdownData from "../../hooks/useDropdownData";
|
|
7
6
|
import useWalletAccount from "../../hooks/useWalletAccount";
|
|
8
7
|
import ConnectedTrigger from "./ConnectedTrigger";
|
|
9
8
|
import Content from "./Content";
|
|
10
9
|
import DisconnectedTrigger from "./DisconnectedTrigger";
|
|
11
10
|
import { useSignInWithWallet } from "../../hooks";
|
|
11
|
+
import useDropdownData from "../../hooks/useDropdownData";
|
|
12
12
|
/**
|
|
13
13
|
* Passport Dropdown component that displays user's wallet and assets information.
|
|
14
14
|
* @param {DropdownProps} props - Component props.
|
|
15
15
|
* @returns {JSX.Element}
|
|
16
16
|
*/
|
|
17
17
|
export function Dropdown(props) {
|
|
18
|
-
const { placement = "bottomRight", animateOutTime = 120, onSignIn, onSignOut,
|
|
18
|
+
const { placement = "bottomRight", animateOutTime = 120, onSignIn, onSignOut, overrides, triggerProps, onOtherAssetsClick, ...restProps } = props;
|
|
19
19
|
const [, theme] = useStyletron();
|
|
20
|
-
const
|
|
20
|
+
const data = useDropdownData();
|
|
21
|
+
const isCriticalDropdownDataLoaded = useMemo(() => Boolean(data.mezoId && data.accountAddress && data.walletAddress), [data]);
|
|
21
22
|
const { openConnectModal } = useConnectModal();
|
|
22
23
|
const { isConnected } = useWalletAccount();
|
|
23
24
|
const { signInWithWalletAsync, isPending } = useSignInWithWallet();
|
|
@@ -37,7 +38,7 @@ export function Dropdown(props) {
|
|
|
37
38
|
};
|
|
38
39
|
handleSignIn();
|
|
39
40
|
}, [disconnectAsync, isConnected, onSignIn, signInWithWalletAsync]);
|
|
40
|
-
if (!
|
|
41
|
+
if (!isConnected || !isCriticalDropdownDataLoaded) {
|
|
41
42
|
return (React.createElement(DisconnectedTrigger
|
|
42
43
|
// If connect wallet flow is not provided it fallbacks to RainbowKit's
|
|
43
44
|
// connect modal
|
|
@@ -46,7 +47,7 @@ export function Dropdown(props) {
|
|
|
46
47
|
// connect modal
|
|
47
48
|
onClick: onSignIn || openConnectModal, isLoading: isPending, ...triggerProps?.signedOut }, "Sign in"));
|
|
48
49
|
}
|
|
49
|
-
return (React.createElement(StatefulPopover, { content: React.createElement(Content, { data:
|
|
50
|
+
return (React.createElement(StatefulPopover, { content: React.createElement(Content, { mezoId: data.mezoId, matsBalance: data.matsBalance, accountAddress: data.accountAddress, walletAddress: data.walletAddress, walletType: data.walletType, usdTotalBalance: data.usdTotalBalance, usdTroveDebt: data.usdTroveDebt, usdCollateral: data.usdCollateral, assets: data.assets, otherAssetsCount: data.otherAssetsCount, otherAssetsUsdTotal: data.otherAssetsUsdTotal, onSignOut: onSignOut, onOtherAssetsClick: onOtherAssetsClick }), placement: placement, animateOutTime: animateOutTime, overrides: {
|
|
50
51
|
...overrides,
|
|
51
52
|
Body: {
|
|
52
53
|
...overrides?.Body,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEf,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IconProps, ListItemProps } from "@mezo-org/mezo-clay";
|
|
2
|
+
import React, { FC } from "react";
|
|
3
|
+
type ListingItemProps = {
|
|
4
|
+
icon?: FC<IconProps>;
|
|
5
|
+
label: string;
|
|
6
|
+
subLabel?: string;
|
|
7
|
+
value: string;
|
|
8
|
+
subValue?: string;
|
|
9
|
+
overrides?: ListItemProps["overrides"];
|
|
10
|
+
};
|
|
11
|
+
export default function ListingItem(props: ListingItemProps): React.JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=ListingItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListingItem.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/ListingItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,SAAS,EACT,aAAa,EACd,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAUjC,KAAK,gBAAgB,GAAG;IACtB,IAAI,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAA;CACvC,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,gBAAgB,qBAoD1D"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ListItem, ListItemLabel, mergeOverrides, } from "@mezo-org/mezo-clay";
|
|
2
|
+
import React from "react";
|
|
3
|
+
const SHARED_LABEL_OVERRIDES = {
|
|
4
|
+
LabelDescription: {
|
|
5
|
+
style: {
|
|
6
|
+
color: "#4B4B4B", // contentSecondary
|
|
7
|
+
},
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
export default function ListingItem(props) {
|
|
11
|
+
const { icon: Icon, label, subLabel = "", value, subValue = "", overrides, } = props;
|
|
12
|
+
return (React.createElement(ListItem, { artwork: Icon,
|
|
13
|
+
// eslint-disable-next-line react/no-unstable-nested-components
|
|
14
|
+
endEnhancer: () => (React.createElement(ListItemLabel, { description: subValue, overrides: mergeOverrides({
|
|
15
|
+
LabelRoot: {
|
|
16
|
+
style: {
|
|
17
|
+
textAlign: "right",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
}, SHARED_LABEL_OVERRIDES) }, value)), overrides: mergeOverrides({
|
|
21
|
+
Root: {
|
|
22
|
+
style: {
|
|
23
|
+
backgroundColor: "transparent",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
Content: {
|
|
27
|
+
style: {
|
|
28
|
+
border: 0,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
}, overrides) },
|
|
32
|
+
React.createElement(ListItemLabel, { description: subLabel, overrides: SHARED_LABEL_OVERRIDES }, label)));
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=ListingItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListingItem.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/ListingItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,aAAa,EACb,cAAc,GAIf,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAa,MAAM,OAAO,CAAA;AAEjC,MAAM,sBAAsB,GAAoC;IAC9D,gBAAgB,EAAE;QAChB,KAAK,EAAE;YACL,KAAK,EAAE,SAAS,EAAE,mBAAmB;SACtC;KACF;CACF,CAAA;AAWD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAuB;IACzD,MAAM,EACJ,IAAI,EAAE,IAAI,EACV,KAAK,EACL,QAAQ,GAAG,EAAE,EACb,KAAK,EACL,QAAQ,GAAG,EAAE,EACb,SAAS,GACV,GAAG,KAAK,CAAA;IAET,OAAO,CACL,oBAAC,QAAQ,IACP,OAAO,EAAE,IAAI;QACb,+DAA+D;QAC/D,WAAW,EAAE,GAAG,EAAE,CAAC,CACjB,oBAAC,aAAa,IACZ,WAAW,EAAE,QAAQ,EACrB,SAAS,EAAE,cAAc,CACvB;gBACE,SAAS,EAAE;oBACT,KAAK,EAAE;wBACL,SAAS,EAAE,OAAO;qBACnB;iBACF;aACF,EACD,sBAAsB,CACvB,IAEA,KAAK,CACQ,CACjB,EACD,SAAS,EAAE,cAAc,CACvB;YACE,IAAI,EAAE;gBACJ,KAAK,EAAE;oBACL,eAAe,EAAE,aAAa;iBAC/B;aACF;YACD,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,CAAC;iBACV;aACF;SACF,EACD,SAAS,CACV;QAED,oBAAC,aAAa,IAAC,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,sBAAsB,IACpE,KAAK,CACQ,CACP,CACZ,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CryptoAssetKey } from "../../../utils/cryptoAssets";
|
|
3
|
+
type AccountAssetItemProps = {
|
|
4
|
+
type: CryptoAssetKey;
|
|
5
|
+
amount: string;
|
|
6
|
+
subLabel: string;
|
|
7
|
+
subValue: string;
|
|
8
|
+
};
|
|
9
|
+
export default function AccountAssetItem(props: AccountAssetItemProps): React.JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=AccountAssetItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountAssetItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountAssetItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAkB,MAAM,6BAA6B,CAAA;AAG5E,KAAK,qBAAqB,GAAG;IAC3B,IAAI,EAAE,cAAc,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qBAcpE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { getCryptoAsset } from "../../../utils/cryptoAssets";
|
|
3
|
+
import ListingItem from "../ListingItem";
|
|
4
|
+
export default function AccountAssetItem(props) {
|
|
5
|
+
const { type, amount, subLabel, subValue } = props;
|
|
6
|
+
const { icon: Icon, name: label } = getCryptoAsset(type);
|
|
7
|
+
return (React.createElement(ListingItem, { icon: Icon, label: label, subLabel: subLabel, value: amount, subValue: subValue }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=AccountAssetItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountAssetItem.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountAssetItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAkB,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,WAAW,MAAM,gBAAgB,CAAA;AASxC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAA4B;IACnE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAA;IAElD,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,cAAc,CAAC,IAAI,CAAC,CAAA;IAExD,OAAO,CACL,oBAAC,WAAW,IACV,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountBalance.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountBalance.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AccountBalance.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountBalance.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,KAAK,mBAAmB,GAAG;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBAoBhE"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { Block, HeadingSmall, ParagraphSmall, useStyletron, } from "@mezo-org/mezo-clay";
|
|
2
1
|
import React from "react";
|
|
2
|
+
import { useStyletron } from "@mezo-org/mezo-clay";
|
|
3
|
+
import ListingItem from "../ListingItem";
|
|
3
4
|
export default function AccountBalance(props) {
|
|
4
|
-
const {
|
|
5
|
+
const { totalBalance, totalDebt } = props;
|
|
5
6
|
const [, theme] = useStyletron();
|
|
6
|
-
return (React.createElement(
|
|
7
|
-
|
|
7
|
+
return (React.createElement(ListingItem, { label: "Total assets", value: totalBalance, subLabel: "Total liabilities", subValue: totalDebt, overrides: {
|
|
8
|
+
Root: {
|
|
8
9
|
style: {
|
|
9
|
-
borderBottom: `1px solid ${theme.colors.
|
|
10
|
+
borderBottom: `1px solid ${theme.colors.borderInverseSelected}`,
|
|
10
11
|
},
|
|
11
12
|
},
|
|
12
|
-
} }
|
|
13
|
-
React.createElement(ParagraphSmall, { margin: 0, color: theme.colors.gray800 }, "Available balance"),
|
|
14
|
-
React.createElement(HeadingSmall, { margin: 0 }, amount)));
|
|
13
|
+
} }));
|
|
15
14
|
}
|
|
16
15
|
//# sourceMappingURL=AccountBalance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountBalance.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountBalance.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"AccountBalance.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountBalance.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,WAAW,MAAM,gBAAgB,CAAA;AAOxC,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAA0B;IAC/D,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;IAEzC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEhC,OAAO,CACL,oBAAC,WAAW,IACV,KAAK,EAAC,cAAc,EACpB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAC,mBAAmB,EAC5B,QAAQ,EAAE,SAAS,EACnB,SAAS,EAAE;YACT,IAAI,EAAE;gBACJ,KAAK,EAAE;oBACL,YAAY,EAAE,aAAa,KAAK,CAAC,MAAM,CAAC,qBAAqB,EAAE;iBAChE;aACF;SACF,GACD,CACH,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type AccountOtherAssetsProps = {
|
|
3
|
+
assetsCount: number;
|
|
4
|
+
assetsUsdTotal: number;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
};
|
|
7
|
+
export default function AccountOtherAssets(props: AccountOtherAssetsProps): React.JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=AccountOtherAssets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountOtherAssets.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountOtherAssets.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAKtC,KAAK,uBAAuB,GAAG;IAC7B,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,qBAwDxE"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
|
+
import { Block, useStyletron, CoinsStacked02 } from "@mezo-org/mezo-clay";
|
|
3
|
+
import ListingItem from "../ListingItem";
|
|
4
|
+
import { formatUsd } from "../../../utils/currency";
|
|
5
|
+
export default function AccountOtherAssets(props) {
|
|
6
|
+
const { assetsCount, assetsUsdTotal, onClick } = props;
|
|
7
|
+
const [, theme] = useStyletron();
|
|
8
|
+
const label = useMemo(() => {
|
|
9
|
+
if (assetsCount === 0)
|
|
10
|
+
return "No other assets";
|
|
11
|
+
if (assetsCount === 1)
|
|
12
|
+
return "1 more asset";
|
|
13
|
+
return `${assetsCount} more assets`;
|
|
14
|
+
}, [assetsCount]);
|
|
15
|
+
const formattedAssetsUsdTotal = formatUsd(assetsUsdTotal);
|
|
16
|
+
return (React.createElement(Block, { "aria-label": label, as: "li", overrides: {
|
|
17
|
+
Block: {
|
|
18
|
+
style: {
|
|
19
|
+
listStyle: "none",
|
|
20
|
+
borderTop: `1px solid ${theme.colors.borderInverseSelected}`,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
} },
|
|
24
|
+
React.createElement(ListingItem, { icon: CoinsStacked02, label: label, value: formattedAssetsUsdTotal, overrides: {
|
|
25
|
+
Root: {
|
|
26
|
+
props: {
|
|
27
|
+
$as: "button",
|
|
28
|
+
onClick,
|
|
29
|
+
},
|
|
30
|
+
style: {
|
|
31
|
+
border: 0,
|
|
32
|
+
padding: 0,
|
|
33
|
+
cursor: "pointer",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
ArtworkContainer: {
|
|
37
|
+
style: {
|
|
38
|
+
stroke: theme.colors.contentPrimary,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
Content: {
|
|
42
|
+
style: {
|
|
43
|
+
minHeight: theme.sizing.scale1200,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
} })));
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=AccountOtherAssets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountOtherAssets.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountOtherAssets.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACzE,OAAO,WAAW,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAQnD,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,KAA8B;IACvE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,KAAK,CAAA;IAEtD,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEhC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE;QACzB,IAAI,WAAW,KAAK,CAAC;YAAE,OAAO,iBAAiB,CAAA;QAC/C,IAAI,WAAW,KAAK,CAAC;YAAE,OAAO,cAAc,CAAA;QAC5C,OAAO,GAAG,WAAW,cAAc,CAAA;IACrC,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAA;IAEjB,MAAM,uBAAuB,GAAG,SAAS,CAAC,cAAc,CAAC,CAAA;IAEzD,OAAO,CACL,oBAAC,KAAK,kBACQ,KAAK,EACjB,EAAE,EAAC,IAAI,EACP,SAAS,EAAE;YACT,KAAK,EAAE;gBACL,KAAK,EAAE;oBACL,SAAS,EAAE,MAAM;oBACjB,SAAS,EAAE,aAAa,KAAK,CAAC,MAAM,CAAC,qBAAqB,EAAE;iBAC7D;aACF;SACF;QAED,oBAAC,WAAW,IACV,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,uBAAuB,EAC9B,SAAS,EAAE;gBACT,IAAI,EAAE;oBACJ,KAAK,EAAE;wBACL,GAAG,EAAE,QAAQ;wBACb,OAAO;qBACR;oBACD,KAAK,EAAE;wBACL,MAAM,EAAE,CAAC;wBACT,OAAO,EAAE,CAAC;wBACV,MAAM,EAAE,SAAS;qBAClB;iBACF;gBACD,gBAAgB,EAAE;oBAChB,KAAK,EAAE;wBACL,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc;qBACpC;iBACF;gBACD,OAAO,EAAE;oBACP,KAAK,EAAE;wBACL,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS;qBAClC;iBACF;aACF,GACD,CACI,CACT,CAAA;AACH,CAAC"}
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
type RootProps =
|
|
2
|
+
import { DetailedCryptoAsset } from "../../../utils/cryptoAssets";
|
|
3
|
+
type RootProps = {
|
|
4
|
+
mezoId: string;
|
|
5
|
+
matsBalance: number;
|
|
6
|
+
accountAddress: string;
|
|
7
|
+
walletAddress: string;
|
|
8
|
+
walletType: "bitcoin" | "evm";
|
|
9
|
+
usdTotalBalance: number;
|
|
10
|
+
usdTroveDebt: number;
|
|
11
|
+
usdCollateral: number;
|
|
12
|
+
assets: {
|
|
13
|
+
btc: DetailedCryptoAsset;
|
|
14
|
+
musd: DetailedCryptoAsset;
|
|
15
|
+
};
|
|
16
|
+
otherAssetsCount: number;
|
|
17
|
+
otherAssetsUsdTotal: number;
|
|
4
18
|
onSignOut?: () => void;
|
|
19
|
+
onOtherAssetsClick?: () => void;
|
|
5
20
|
};
|
|
6
21
|
export default function Root(props: RootProps): React.JSX.Element;
|
|
7
22
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Root.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/Root.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Root.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/Root.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAQ1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAKjE,KAAK,SAAS,GAAG;IACf,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,SAAS,GAAG,KAAK,CAAA;IAC7B,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE;QACN,GAAG,EAAE,mBAAmB,CAAA;QACxB,IAAI,EAAE,mBAAmB,CAAA;KAC1B,CAAA;IACD,gBAAgB,EAAE,MAAM,CAAA;IACxB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;CAChC,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,SAAS,qBAiH5C"}
|
|
@@ -1,26 +1,17 @@
|
|
|
1
|
-
import { Block, Button, LogOut01,
|
|
1
|
+
import { Block, Button, LogOut01, useStyletron } from "@mezo-org/mezo-clay";
|
|
2
2
|
import React, { useCallback } from "react";
|
|
3
3
|
import { useDisconnect } from "wagmi";
|
|
4
4
|
import { useSignOut } from "../../../hooks";
|
|
5
5
|
import WalletAddress from "./WalletAddress";
|
|
6
|
-
import AccountAssets from "./AccountAssets";
|
|
7
6
|
import AccountBalance from "./AccountBalance";
|
|
8
7
|
import WelcomeBlock from "./WelcomeBlock";
|
|
9
8
|
import AccountAddressActions from "./AccountAddressActions";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Svg: {
|
|
15
|
-
style: {
|
|
16
|
-
marginRight: theme.sizing.scale300,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
} }),
|
|
20
|
-
"Matsnet Assets"));
|
|
21
|
-
}
|
|
9
|
+
import AccountAssetItem from "./AccountAssetItem";
|
|
10
|
+
import { formatNumberToCompactString } from "../../../utils/numbers";
|
|
11
|
+
import { formatUsd } from "../../../utils/currency";
|
|
12
|
+
import AccountOtherAssets from "./AccountOtherAssets";
|
|
22
13
|
export default function Root(props) {
|
|
23
|
-
const { mezoId, walletAddress, accountAddress, walletType,
|
|
14
|
+
const { mezoId, walletAddress, accountAddress, walletType, usdTotalBalance, usdTroveDebt, usdCollateral, matsBalance, assets, otherAssetsCount, otherAssetsUsdTotal, onSignOut, onOtherAssetsClick, } = props;
|
|
24
15
|
const [, theme] = useStyletron();
|
|
25
16
|
const { disconnect } = useDisconnect();
|
|
26
17
|
const { signOut } = useSignOut();
|
|
@@ -32,19 +23,21 @@ export default function Root(props) {
|
|
|
32
23
|
signOut();
|
|
33
24
|
disconnect();
|
|
34
25
|
}, [signOut, disconnect, onSignOut]);
|
|
26
|
+
const formattedMatsBalance = formatNumberToCompactString(matsBalance, 2);
|
|
27
|
+
const formattedUsdTotalBalance = formatUsd(usdTotalBalance);
|
|
28
|
+
const formattedUsdTroveDebt = formatUsd(usdTroveDebt);
|
|
29
|
+
const formattedUsdCollateral = formatUsd(usdCollateral);
|
|
35
30
|
return (React.createElement(Block, { display: "inline-flex", flexDirection: "column", padding: theme.sizing.scale600 },
|
|
36
|
-
React.createElement(WelcomeBlock, { mezoId: mezoId, matsBalance:
|
|
31
|
+
React.createElement(WelcomeBlock, { mezoId: mezoId, matsBalance: formattedMatsBalance }),
|
|
37
32
|
React.createElement(AccountAddressActions, { address: accountAddress }),
|
|
38
33
|
React.createElement(Block, { display: "flex", flexDirection: "column", backgroundColor: theme.colors.backgroundSecondary, overflow: "hidden", overrides: {
|
|
39
34
|
Block: { style: { borderRadius: theme.borders.radius300 } },
|
|
40
35
|
} },
|
|
41
36
|
React.createElement(WalletAddress, { address: walletAddress, type: walletType }),
|
|
42
|
-
React.createElement(AccountBalance, {
|
|
43
|
-
React.createElement(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
} },
|
|
47
|
-
React.createElement(AccountAssets, { label: React.createElement(MatsnetLabel, null), assets: matsnet.formattedAssets }))),
|
|
37
|
+
React.createElement(AccountBalance, { totalBalance: formattedUsdTotalBalance, totalDebt: formattedUsdTroveDebt }),
|
|
38
|
+
React.createElement(AccountAssetItem, { type: "BTC", amount: assets.btc.formattedUsdBalance, subLabel: "Locked collateral", subValue: formattedUsdCollateral }),
|
|
39
|
+
React.createElement(AccountAssetItem, { type: "MUSD", amount: assets.musd.formattedUsdBalance, subLabel: "Borrowed", subValue: formattedUsdTroveDebt }),
|
|
40
|
+
React.createElement(AccountOtherAssets, { assetsCount: otherAssetsCount, assetsUsdTotal: otherAssetsUsdTotal, onClick: onOtherAssetsClick })),
|
|
48
41
|
React.createElement(Block, { marginTop: theme.sizing.scale700, padding: `0 ${theme.sizing.scale100}` },
|
|
49
42
|
React.createElement(Button, { size: "small", kind: "tertiary", startEnhancer: React.createElement(LogOut01, { color: "currentColor", size: 12 }), onClick: () => handleLogOut(), overrides: {
|
|
50
43
|
Root: {
|