0xtrails 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aave.d.ts +8 -0
- package/dist/aave.d.ts.map +1 -1
- package/dist/abortController.d.ts +8 -0
- package/dist/abortController.d.ts.map +1 -0
- package/dist/{ccip-BlV1Mry3.js → ccip-Xjh9d1gb.js} +7 -7
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/constants.d.ts +3 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/error.d.ts +1 -0
- package/dist/error.d.ts.map +1 -1
- package/dist/estimate.d.ts +52 -0
- package/dist/estimate.d.ts.map +1 -1
- package/dist/fees.d.ts +19 -0
- package/dist/fees.d.ts.map +1 -0
- package/dist/{index-BNWCIGfQ.js → index-BnhdZ8Ho.js} +76406 -75798
- package/dist/index.js +726 -520
- package/dist/intents.d.ts +40 -0
- package/dist/intents.d.ts.map +1 -1
- package/dist/metaTxnMonitor.d.ts +3 -3
- package/dist/metaTxnMonitor.d.ts.map +1 -1
- package/dist/metaTxns.d.ts +3 -3
- package/dist/metaTxns.d.ts.map +1 -1
- package/dist/morpho.d.ts +8 -0
- package/dist/morpho.d.ts.map +1 -1
- package/dist/prepareSend.d.ts +19 -75
- package/dist/prepareSend.d.ts.map +1 -1
- package/dist/queryParams.d.ts.map +1 -1
- package/dist/relayer.d.ts +6 -6
- package/dist/relayer.d.ts.map +1 -1
- package/dist/sequenceWallet.d.ts +2 -2
- package/dist/sequenceWallet.d.ts.map +1 -1
- package/dist/tokens.d.ts.map +1 -1
- package/dist/transactions.d.ts +4 -2
- package/dist/transactions.d.ts.map +1 -1
- package/dist/wallets.d.ts.map +1 -1
- package/dist/widget/components/AccountActionsDropdown.d.ts.map +1 -1
- package/dist/widget/components/AccountIntentTransactionHistoryButton.d.ts +4 -0
- package/dist/widget/components/AccountIntentTransactionHistoryButton.d.ts.map +1 -0
- package/dist/widget/components/AccountSettings.d.ts.map +1 -1
- package/dist/widget/components/ChainFilterDropdown.d.ts.map +1 -1
- package/dist/widget/components/ClassicSwap.d.ts +4 -2
- package/dist/widget/components/ClassicSwap.d.ts.map +1 -1
- package/dist/widget/components/ConnectWallet.d.ts.map +1 -1
- package/dist/widget/components/ConnectedWallets.d.ts +4 -0
- package/dist/widget/components/ConnectedWallets.d.ts.map +1 -1
- package/dist/widget/components/DynamicInputStyles.d.ts +18 -0
- package/dist/widget/components/DynamicInputStyles.d.ts.map +1 -0
- package/dist/widget/components/Earn.d.ts +2 -2
- package/dist/widget/components/Earn.d.ts.map +1 -1
- package/dist/widget/components/ErrorAnimationIcon.d.ts +2 -0
- package/dist/widget/components/ErrorAnimationIcon.d.ts.map +1 -0
- package/dist/widget/components/FeeBreakdown.d.ts +9 -0
- package/dist/widget/components/FeeBreakdown.d.ts.map +1 -0
- package/dist/widget/components/Fund.d.ts +2 -2
- package/dist/widget/components/Fund.d.ts.map +1 -1
- package/dist/widget/components/FundMethods.d.ts.map +1 -1
- package/dist/widget/components/{FundSendForm.d.ts → FundSwap.d.ts} +13 -7
- package/dist/widget/components/FundSwap.d.ts.map +1 -0
- package/dist/widget/components/FundingMethodSelectorButton.d.ts +4 -0
- package/dist/widget/components/FundingMethodSelectorButton.d.ts.map +1 -0
- package/dist/widget/components/Identicon.d.ts.map +1 -1
- package/dist/widget/components/MeshConnectExchanges.d.ts +0 -3
- package/dist/widget/components/MeshConnectExchanges.d.ts.map +1 -1
- package/dist/widget/components/Modal.d.ts.map +1 -1
- package/dist/widget/components/Pay.d.ts +2 -2
- package/dist/widget/components/Pay.d.ts.map +1 -1
- package/dist/widget/components/PercentageMaxButtons.d.ts +12 -0
- package/dist/widget/components/PercentageMaxButtons.d.ts.map +1 -0
- package/dist/widget/components/{PaySendForm.d.ts → PoolDeposit.d.ts} +14 -36
- package/dist/widget/components/PoolDeposit.d.ts.map +1 -0
- package/dist/widget/components/{SimpleSwap.d.ts → PoolWithdraw.d.ts} +19 -10
- package/dist/widget/components/PoolWithdraw.d.ts.map +1 -0
- package/dist/widget/components/QuoteDetails.d.ts +1 -0
- package/dist/widget/components/QuoteDetails.d.ts.map +1 -1
- package/dist/widget/components/Receipt.d.ts.map +1 -1
- package/dist/widget/components/Receive.d.ts.map +1 -1
- package/dist/widget/components/RecipientSelectorButton.d.ts +4 -0
- package/dist/widget/components/RecipientSelectorButton.d.ts.map +1 -0
- package/dist/widget/components/Recipients.d.ts.map +1 -1
- package/dist/widget/components/RequiredPropsError.d.ts +8 -0
- package/dist/widget/components/RequiredPropsError.d.ts.map +1 -0
- package/dist/widget/components/ScreenHeader.d.ts.map +1 -1
- package/dist/widget/components/SlippageToleranceSettings.d.ts.map +1 -1
- package/dist/widget/components/Swap.d.ts +3 -2
- package/dist/widget/components/Swap.d.ts.map +1 -1
- package/dist/widget/components/SwapSettings.d.ts.map +1 -1
- package/dist/widget/components/ThemeProvider.d.ts.map +1 -1
- package/dist/widget/components/TokenDisplayNonSelectable.d.ts +11 -0
- package/dist/widget/components/TokenDisplayNonSelectable.d.ts.map +1 -0
- package/dist/widget/components/TokenImage.d.ts +1 -0
- package/dist/widget/components/TokenImage.d.ts.map +1 -1
- package/dist/widget/components/TokenList.d.ts.map +1 -1
- package/dist/widget/components/TokenSelector.d.ts.map +1 -1
- package/dist/widget/components/TokenSelectorButton.d.ts +16 -0
- package/dist/widget/components/TokenSelectorButton.d.ts.map +1 -0
- package/dist/widget/components/Tooltip.d.ts +9 -0
- package/dist/widget/components/Tooltip.d.ts.map +1 -0
- package/dist/widget/components/UserPreferences.d.ts.map +1 -1
- package/dist/widget/components/WaasFeeOptions.d.ts +9 -0
- package/dist/widget/components/WaasFeeOptions.d.ts.map +1 -0
- package/dist/widget/components/WalletConfirmation.d.ts.map +1 -1
- package/dist/widget/components/WalletConnect.d.ts.map +1 -1
- package/dist/widget/components/WalletList.d.ts.map +1 -1
- package/dist/widget/css/compiled.css +2 -0
- package/dist/widget/css/index.css +554 -0
- package/dist/widget/hooks/useBack.d.ts +1 -0
- package/dist/widget/hooks/useBack.d.ts.map +1 -1
- package/dist/widget/hooks/useCheckout.d.ts +1 -1
- package/dist/widget/hooks/useCheckout.d.ts.map +1 -1
- package/dist/widget/hooks/useCurrentScreen.d.ts +1 -1
- package/dist/widget/hooks/useCurrentScreen.d.ts.map +1 -1
- package/dist/widget/hooks/useDefaultTokenSelection.d.ts +3 -3
- package/dist/widget/hooks/useDefaultTokenSelection.d.ts.map +1 -1
- package/dist/widget/hooks/usePayMessage.d.ts.map +1 -1
- package/dist/widget/hooks/useQuote.d.ts +83 -0
- package/dist/widget/hooks/useQuote.d.ts.map +1 -0
- package/dist/widget/hooks/useSelectedFundMethod.d.ts +12 -0
- package/dist/widget/hooks/useSelectedFundMethod.d.ts.map +1 -0
- package/dist/widget/hooks/useSelectedRecipient.d.ts.map +1 -1
- package/dist/widget/hooks/useSendForm.d.ts +2 -2
- package/dist/widget/hooks/useSendForm.d.ts.map +1 -1
- package/dist/widget/index.js +2 -2
- package/dist/widget/widget.d.ts +9 -4
- package/dist/widget/widget.d.ts.map +1 -1
- package/package.json +18 -12
- package/src/aave.ts +32 -0
- package/src/abortController.ts +35 -0
- package/src/config.ts +12 -4
- package/src/constants.ts +5 -0
- package/src/error.ts +19 -1
- package/src/estimate.ts +416 -5
- package/src/fees.ts +199 -0
- package/src/intents.ts +161 -11
- package/src/metaTxnMonitor.ts +3 -3
- package/src/metaTxns.ts +3 -5
- package/src/morpho.ts +32 -0
- package/src/prepareSend.ts +714 -550
- package/src/queryParams.ts +2 -1
- package/src/relayer.ts +11 -11
- package/src/sequenceWallet.ts +2 -2
- package/src/tokens.ts +7 -1
- package/src/trails.ts +3 -3
- package/src/transactions.ts +62 -18
- package/src/wallets.ts +8 -0
- package/src/widget/compiled.css +2 -2
- package/src/widget/components/AccountActionsDropdown.tsx +3 -13
- package/src/widget/components/AccountIntentTransactionHistoryButton.tsx +22 -0
- package/src/widget/components/AccountSettings.tsx +48 -54
- package/src/widget/components/ChainFilterDropdown.tsx +24 -3
- package/src/widget/components/ClassicSwap.tsx +131 -213
- package/src/widget/components/ConnectWallet.tsx +8 -38
- package/src/widget/components/ConnectedWallets.tsx +132 -77
- package/src/widget/components/DynamicInputStyles.tsx +76 -0
- package/src/widget/components/Earn.tsx +82 -593
- package/src/widget/components/ErrorAnimationIcon.tsx +130 -0
- package/src/widget/components/FeeBreakdown.tsx +155 -0
- package/src/widget/components/Fund.tsx +41 -108
- package/src/widget/components/FundMethods.tsx +82 -159
- package/src/widget/components/FundSwap.tsx +52 -0
- package/src/widget/components/FundingMethodSelectorButton.tsx +70 -0
- package/src/widget/components/Identicon.tsx +164 -95
- package/src/widget/components/MeshConnectExchanges.tsx +2 -15
- package/src/widget/components/Modal.tsx +0 -8
- package/src/widget/components/Pay.tsx +214 -237
- package/src/widget/components/PercentageMaxButtons.tsx +77 -0
- package/src/widget/components/PoolDeposit.tsx +569 -0
- package/src/widget/components/PoolWithdraw.tsx +884 -0
- package/src/widget/components/PriceImpactWarning.tsx +1 -1
- package/src/widget/components/QuoteDetails.tsx +43 -12
- package/src/widget/components/Receipt.tsx +16 -2
- package/src/widget/components/Receive.tsx +0 -2
- package/src/widget/components/RecipientSelectorButton.tsx +44 -0
- package/src/widget/components/Recipients.tsx +63 -157
- package/src/widget/components/RequiredPropsError.tsx +33 -0
- package/src/widget/components/ScreenHeader.tsx +62 -34
- package/src/widget/components/SlippageToleranceSettings.tsx +2 -1
- package/src/widget/components/Swap.tsx +4 -45
- package/src/widget/components/SwapSettings.tsx +2 -14
- package/src/widget/components/ThemeProvider.tsx +2 -1
- package/src/widget/components/TokenDisplayNonSelectable.tsx +40 -0
- package/src/widget/components/TokenImage.tsx +22 -5
- package/src/widget/components/TokenList.tsx +0 -1
- package/src/widget/components/TokenSelector.tsx +63 -53
- package/src/widget/components/TokenSelectorButton.tsx +98 -0
- package/src/widget/components/Tooltip.tsx +51 -0
- package/src/widget/components/TransferPendingVertical.tsx +1 -1
- package/src/widget/components/UserPreferences.tsx +6 -24
- package/src/widget/components/WaasFeeOptions.tsx +450 -0
- package/src/widget/components/WalletConfirmation.tsx +76 -14
- package/src/widget/components/WalletConnect.tsx +93 -29
- package/src/widget/components/WalletList.tsx +4 -2
- package/src/widget/hooks/useBack.tsx +2 -0
- package/src/widget/hooks/useCheckout.ts +36 -20
- package/src/widget/hooks/useCurrentScreen.tsx +1 -0
- package/src/widget/hooks/useDefaultTokenSelection.tsx +104 -28
- package/src/widget/hooks/usePayMessage.tsx +86 -11
- package/src/widget/hooks/useQuote.ts +413 -0
- package/src/widget/hooks/useSelectedFundMethod.tsx +41 -0
- package/src/widget/hooks/useSelectedRecipient.tsx +10 -0
- package/src/widget/hooks/useSendForm.ts +32 -6
- package/src/widget/index.css +27 -0
- package/src/widget/widget.tsx +326 -283
- package/dist/widget/components/FundSendForm.d.ts.map +0 -1
- package/dist/widget/components/PaySendForm.d.ts.map +0 -1
- package/dist/widget/components/SimpleSwap.d.ts.map +0 -1
- package/dist/widget/hooks/useSwapSettings.d.ts +0 -16
- package/dist/widget/hooks/useSwapSettings.d.ts.map +0 -1
- package/src/widget/components/FundSendForm.tsx +0 -903
- package/src/widget/components/PaySendForm.tsx +0 -869
- package/src/widget/components/SimpleSwap.tsx +0 -983
- package/src/widget/hooks/useSwapSettings.tsx +0 -100
|
@@ -1,81 +1,99 @@
|
|
|
1
1
|
import type React from "react"
|
|
2
|
+
import { useId } from "react"
|
|
3
|
+
|
|
4
|
+
const MOD = 1000
|
|
5
|
+
const SIZE = 64
|
|
6
|
+
const RADIUS = SIZE / 2
|
|
7
|
+
const prefix = "gradient-avatar-"
|
|
8
|
+
|
|
9
|
+
const scaledMod = (value: number, mod: number = MOD): number => {
|
|
10
|
+
return (value % mod) / (MOD / SIZE)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const cyrb53 = (str: string, seed: number = 0): number => {
|
|
14
|
+
let h1 = 0xdeadbeef ^ seed
|
|
15
|
+
let h2 = 0x41c6ce57 ^ seed
|
|
2
16
|
|
|
3
|
-
// MetaMask-style hash function
|
|
4
|
-
const hashCode = (str: string): number => {
|
|
5
|
-
let hash = 0
|
|
6
17
|
for (let i = 0; i < str.length; i++) {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
18
|
+
const ch = str.charCodeAt(i)
|
|
19
|
+
h1 = Math.imul(h1 ^ ch, 2654435761)
|
|
20
|
+
h2 = Math.imul(h2 ^ ch, 1597334677)
|
|
10
21
|
}
|
|
11
|
-
|
|
22
|
+
|
|
23
|
+
h1 =
|
|
24
|
+
Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^
|
|
25
|
+
Math.imul(h2 ^ (h2 >>> 13), 3266489909)
|
|
26
|
+
h2 =
|
|
27
|
+
Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^
|
|
28
|
+
Math.imul(h1 ^ (h1 >>> 13), 3266489909)
|
|
29
|
+
|
|
30
|
+
return 4294967296 * (2097151 & h2) + (h1 >>> 0)
|
|
12
31
|
}
|
|
13
32
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"#FECA57",
|
|
22
|
-
"#FF9FF3",
|
|
23
|
-
"#54A0FF",
|
|
24
|
-
"#5F27CD",
|
|
25
|
-
"#00D2D3",
|
|
26
|
-
"#FF9F43",
|
|
27
|
-
"#10AC84",
|
|
28
|
-
"#EE5A24",
|
|
29
|
-
"#0ABDE3",
|
|
30
|
-
"#C44569",
|
|
31
|
-
"#F8B500",
|
|
32
|
-
"#6C5CE7",
|
|
33
|
-
"#A3CB38",
|
|
34
|
-
"#FD79A8",
|
|
35
|
-
"#636E72",
|
|
36
|
-
"#00B894",
|
|
37
|
-
]
|
|
38
|
-
|
|
39
|
-
const bg = colors[seed % colors.length]
|
|
40
|
-
const spot = colors[(seed + 7) % colors.length]
|
|
41
|
-
|
|
42
|
-
return { backgroundColor: bg, spotColor: spot }
|
|
33
|
+
const createId = (name: string, id: string): string => `${prefix}${name}${id}`
|
|
34
|
+
|
|
35
|
+
const createHues = (a: number, _b: number, c: number) => {
|
|
36
|
+
const hueA = a % 360
|
|
37
|
+
const hueB = (a + 120) % 360
|
|
38
|
+
const hueC = c % 360
|
|
39
|
+
return { hueA, hueB, hueC }
|
|
43
40
|
}
|
|
44
41
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
// Determine if this cell should be filled
|
|
69
|
-
const shouldFill = (char + seed) % 3 === 0
|
|
70
|
-
row.push(shouldFill)
|
|
71
|
-
}
|
|
72
|
-
pattern.push(row)
|
|
42
|
+
interface Gradient {
|
|
43
|
+
id: string
|
|
44
|
+
stopColor0: string
|
|
45
|
+
stopColor1: string
|
|
46
|
+
cx: number
|
|
47
|
+
cy: number
|
|
48
|
+
r: number
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface Gradients {
|
|
52
|
+
background: Gradient
|
|
53
|
+
primary: Gradient
|
|
54
|
+
secondary: Gradient
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const createGradients = (id: string, address: string): Gradients => {
|
|
58
|
+
const hash = {
|
|
59
|
+
a: cyrb53(`${address}a`, 0),
|
|
60
|
+
b: cyrb53(`${address}b`, 1),
|
|
61
|
+
c: cyrb53(`${address}c`, 2),
|
|
62
|
+
x: cyrb53(`${address}d`, 3),
|
|
63
|
+
y: cyrb53(`${address}e`, 4),
|
|
64
|
+
r: cyrb53(`${address}f`, 5),
|
|
73
65
|
}
|
|
74
66
|
|
|
67
|
+
const { hueA, hueB, hueC } = createHues(hash.a, hash.b, hash.c)
|
|
68
|
+
const cx = scaledMod(hash.x)
|
|
69
|
+
const cy = scaledMod(hash.y)
|
|
70
|
+
const r = SIZE / 10 + scaledMod(hash.r, MOD * 1.5)
|
|
71
|
+
|
|
75
72
|
return {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
background: {
|
|
74
|
+
id: createId("background", id),
|
|
75
|
+
stopColor0: `hsl(${hueC}deg 100% 50% / 1)`,
|
|
76
|
+
stopColor1: `hsl(${hueA}deg 100% 50% / 1)`,
|
|
77
|
+
cx,
|
|
78
|
+
cy,
|
|
79
|
+
r,
|
|
80
|
+
},
|
|
81
|
+
primary: {
|
|
82
|
+
id: createId("primary", id),
|
|
83
|
+
stopColor0: `hsl(${hueA}deg 100% 50% / 1)`,
|
|
84
|
+
stopColor1: `hsl(${hueB}deg 100% 50% / 1)`,
|
|
85
|
+
cx,
|
|
86
|
+
cy,
|
|
87
|
+
r,
|
|
88
|
+
},
|
|
89
|
+
secondary: {
|
|
90
|
+
id: createId("secondary", id),
|
|
91
|
+
stopColor0: `hsl(${hueC}deg 100% 50% / 1)`,
|
|
92
|
+
stopColor1: `hsl(${hueB}deg 100% 50% / 1)`,
|
|
93
|
+
cx: cy,
|
|
94
|
+
cy: cx,
|
|
95
|
+
r: r / 2,
|
|
96
|
+
},
|
|
79
97
|
}
|
|
80
98
|
}
|
|
81
99
|
|
|
@@ -90,6 +108,8 @@ export const Identicon: React.FC<IdenticonProps> = ({
|
|
|
90
108
|
size = 64,
|
|
91
109
|
className = "",
|
|
92
110
|
}) => {
|
|
111
|
+
const id = useId()
|
|
112
|
+
|
|
93
113
|
if (!value || typeof value !== "string") {
|
|
94
114
|
return (
|
|
95
115
|
<div
|
|
@@ -104,10 +124,8 @@ export const Identicon: React.FC<IdenticonProps> = ({
|
|
|
104
124
|
)
|
|
105
125
|
}
|
|
106
126
|
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
const gridSize = 8
|
|
110
|
-
const cellSize = size / gridSize
|
|
127
|
+
const gradients = createGradients(id, value.toLowerCase())
|
|
128
|
+
const getId = (name: string) => createId(name, id)
|
|
111
129
|
|
|
112
130
|
return (
|
|
113
131
|
<div
|
|
@@ -117,39 +135,90 @@ export const Identicon: React.FC<IdenticonProps> = ({
|
|
|
117
135
|
height: size,
|
|
118
136
|
borderRadius: "50%",
|
|
119
137
|
overflow: "hidden",
|
|
120
|
-
|
|
138
|
+
flexShrink: 0,
|
|
121
139
|
}}
|
|
122
140
|
>
|
|
123
141
|
<svg
|
|
124
142
|
width={size}
|
|
125
143
|
height={size}
|
|
144
|
+
viewBox={`0 0 ${SIZE} ${SIZE}`}
|
|
126
145
|
style={{ display: "block" }}
|
|
146
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
127
147
|
aria-label={`Identicon for ${value}`}
|
|
128
148
|
>
|
|
129
149
|
<title>Identicon for {value}</title>
|
|
130
|
-
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
|
|
151
|
+
<defs>
|
|
152
|
+
<clipPath id={getId("circle-clip")}>
|
|
153
|
+
<circle cx={RADIUS} cy={RADIUS} r={RADIUS} />
|
|
154
|
+
</clipPath>
|
|
155
|
+
|
|
156
|
+
<filter
|
|
157
|
+
id={getId("blur-xs")}
|
|
158
|
+
x="-10%"
|
|
159
|
+
y="-10%"
|
|
160
|
+
width="120%"
|
|
161
|
+
height="120%"
|
|
162
|
+
filterUnits="userSpaceOnUse"
|
|
163
|
+
colorInterpolationFilters="sRGB"
|
|
164
|
+
>
|
|
165
|
+
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
|
166
|
+
<feBlend
|
|
167
|
+
mode="normal"
|
|
168
|
+
in="SourceGraphic"
|
|
169
|
+
in2="BackgroundImageFix"
|
|
170
|
+
result="shape"
|
|
171
|
+
/>
|
|
172
|
+
<feGaussianBlur
|
|
173
|
+
stdDeviation={SIZE / 10}
|
|
174
|
+
result="effect1_foregroundBlur"
|
|
175
|
+
/>
|
|
176
|
+
</filter>
|
|
177
|
+
|
|
178
|
+
<linearGradient
|
|
179
|
+
id={gradients.background.id}
|
|
180
|
+
x1="0"
|
|
181
|
+
y1="0"
|
|
182
|
+
x2="1"
|
|
183
|
+
y2="1"
|
|
184
|
+
>
|
|
185
|
+
<stop offset="0" stopColor={gradients.background.stopColor0} />
|
|
186
|
+
<stop offset="1" stopColor={gradients.background.stopColor1} />
|
|
187
|
+
</linearGradient>
|
|
188
|
+
|
|
189
|
+
<radialGradient id={gradients.primary.id}>
|
|
190
|
+
<stop offset="0" stopColor={gradients.primary.stopColor0} />
|
|
191
|
+
<stop offset="1" stopColor={gradients.primary.stopColor1} />
|
|
192
|
+
</radialGradient>
|
|
193
|
+
|
|
194
|
+
<radialGradient id={gradients.secondary.id}>
|
|
195
|
+
<stop offset="0" stopColor={gradients.secondary.stopColor0} />
|
|
196
|
+
<stop offset="1" stopColor={gradients.secondary.stopColor1} />
|
|
197
|
+
</radialGradient>
|
|
198
|
+
</defs>
|
|
199
|
+
|
|
200
|
+
<g clipPath={`url(#${getId("circle-clip")})`}>
|
|
201
|
+
<rect
|
|
202
|
+
width="100%"
|
|
203
|
+
height="100%"
|
|
204
|
+
fill={`url(#${gradients.background.id})`}
|
|
205
|
+
/>
|
|
206
|
+
|
|
207
|
+
<g filter={`url(#${getId("blur-xs")})`}>
|
|
208
|
+
<circle
|
|
209
|
+
fill={`url(#${gradients.primary.id})`}
|
|
210
|
+
cx={gradients.primary.cx}
|
|
211
|
+
cy={gradients.primary.cy}
|
|
212
|
+
r={gradients.primary.r}
|
|
213
|
+
/>
|
|
214
|
+
<circle
|
|
215
|
+
fill={`url(#${gradients.secondary.id})`}
|
|
216
|
+
cx={gradients.secondary.cx}
|
|
217
|
+
cy={gradients.secondary.cy}
|
|
218
|
+
r={gradients.secondary.r}
|
|
219
|
+
/>
|
|
220
|
+
</g>
|
|
221
|
+
</g>
|
|
153
222
|
</svg>
|
|
154
223
|
</div>
|
|
155
224
|
)
|
|
@@ -12,24 +12,18 @@ import CoinbaseLogo from "../assets/Coinbase_Icon_Logo.svg"
|
|
|
12
12
|
import { ScreenHeader } from "./ScreenHeader.js"
|
|
13
13
|
import { logger } from "../../logger.js"
|
|
14
14
|
import { useSelectedMeshExchange } from "../hooks/useSelectedMeshExchange.js"
|
|
15
|
-
import { useMode } from "../hooks/useMode.js"
|
|
16
15
|
import { useCurrentScreen } from "../hooks/useCurrentScreen.js"
|
|
17
|
-
import type { Mode } from "../../mode.js"
|
|
18
|
-
import type { Screen } from "../hooks/useCurrentScreen.js"
|
|
19
16
|
|
|
20
17
|
export interface MeshConnectExchangesProps {
|
|
21
18
|
onBack?: () => void
|
|
22
19
|
onSelectExchange?: (integrationId: string, exchangeName: string) => void
|
|
23
|
-
getInitialScreenForMode?: (mode: Mode) => Screen
|
|
24
20
|
}
|
|
25
21
|
|
|
26
22
|
export const MeshConnectExchanges: React.FC<MeshConnectExchangesProps> = ({
|
|
27
23
|
onBack,
|
|
28
24
|
onSelectExchange,
|
|
29
|
-
getInitialScreenForMode,
|
|
30
25
|
}) => {
|
|
31
26
|
const { setSelectedExchange } = useSelectedMeshExchange()
|
|
32
|
-
const { mode } = useMode()
|
|
33
27
|
const { setCurrentScreen } = useCurrentScreen()
|
|
34
28
|
const [coinbaseId, setCoinbaseId] = useState<string | null>(null)
|
|
35
29
|
const [binanceId, setBinanceId] = useState<string | null>(null)
|
|
@@ -94,15 +88,8 @@ export const MeshConnectExchanges: React.FC<MeshConnectExchangesProps> = ({
|
|
|
94
88
|
// Store the selected exchange
|
|
95
89
|
setSelectedExchange({ integrationId, exchangeName })
|
|
96
90
|
|
|
97
|
-
// Navigate to
|
|
98
|
-
|
|
99
|
-
const currentMode = (mode || "pay") as Mode
|
|
100
|
-
const initialScreen = getInitialScreenForMode(currentMode)
|
|
101
|
-
logger.console.log(
|
|
102
|
-
`[trails-sdk] Navigating to initial screen for mode ${currentMode}: ${initialScreen}`,
|
|
103
|
-
)
|
|
104
|
-
setCurrentScreen(initialScreen)
|
|
105
|
-
}
|
|
91
|
+
// Navigate to home screen
|
|
92
|
+
setCurrentScreen("home")
|
|
106
93
|
}
|
|
107
94
|
|
|
108
95
|
if (loading) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { X } from "lucide-react"
|
|
2
1
|
import { AnimatePresence, motion } from "motion/react"
|
|
3
2
|
import type React from "react"
|
|
4
3
|
import { useEffect, useRef } from "react"
|
|
@@ -70,13 +69,6 @@ const Modal: React.FC<ModalProps> = ({ isOpen, onClose, children }) => {
|
|
|
70
69
|
layoutId="modal-content"
|
|
71
70
|
layout="preserve-aspect"
|
|
72
71
|
>
|
|
73
|
-
<button
|
|
74
|
-
type="button"
|
|
75
|
-
onClick={onClose}
|
|
76
|
-
className="absolute right-2 top-2 p-1 rounded-full transition-colors cursor-pointer z-10 hover:bg-gray-100 text-gray-600 dark:hover:bg-gray-800 dark:text-gray-400 z-20"
|
|
77
|
-
>
|
|
78
|
-
<X className="h-4 w-4" />
|
|
79
|
-
</button>
|
|
80
72
|
{children}
|
|
81
73
|
</motion.div>
|
|
82
74
|
</div>
|