Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
6e1b853
wallet integrated ui
andrewlee348 Mar 13, 2025
90d61e9
complete rework of the token and collectible views
andrewlee348 Mar 14, 2025
4173ce4
deleted duplicate files from renaming packages
andrewlee348 Mar 14, 2025
facb6ae
added collections filter
andrewlee348 Mar 17, 2025
b88c1f9
added local login-method logos
andrewlee348 Mar 17, 2025
a5c4348
added networks, currency to settings, added addFunds
andrewlee348 Mar 18, 2025
9f29e5b
home screen new designs
andrewlee348 Mar 20, 2025
6fe89e7
added new components per design
andrewlee348 Mar 21, 2025
4620cb2
added peer-dep for checkout in wallet
andrewlee348 Mar 24, 2025
66e5826
bug fixes and WalletConnect WIP - deprioritized
andrewlee348 Mar 26, 2025
8362ec9
finished new components and updated home page
andrewlee348 Mar 27, 2025
2cfef83
fixed rebase artifacts
andrewlee348 Mar 27, 2025
76740d8
added new selectors and updated wallet settings
andrewlee348 Mar 27, 2025
f79c671
fixed z index and wallet modal swapping
andrewlee348 Mar 30, 2025
fa3a0c7
added send, swap foundation
andrewlee348 Mar 31, 2025
aabd063
removed deprecated views and components
andrewlee348 Mar 31, 2025
6874f4a
updated useWallets, CoinRow, token types in tokens.ts
andrewlee348 Mar 31, 2025
cc7a65b
finished send-general flow
andrewlee348 Mar 31, 2025
94b19c5
added check to useSettings for config network changes
andrewlee348 Apr 1, 2025
b21e608
added transaction searching and filtering
andrewlee348 Apr 1, 2025
a3a27f4
updated styling for all views to new designs
andrewlee348 Apr 2, 2025
bc5b3ef
added provider for FiatWalletsMap to fix reloading bug
andrewlee348 Apr 2, 2025
c262c81
fiat wallets partial selection bug fix
andrewlee348 Apr 2, 2025
fcb0f36
added receive view network swapping
andrewlee348 Apr 2, 2025
8017d8a
changed instances of totalFiatValue to use .toFixed(2)
andrewlee348 Apr 2, 2025
2733d4d
fixed incorrect decimal when formatting fiat values
andrewlee348 Apr 2, 2025
b879efe
improved transaction history date search
andrewlee348 Apr 2, 2025
738d85b
WIP Swap Screen
andrewlee348 Apr 3, 2025
89f3ff1
added email display to waas, WIP: Swap
andrewlee348 Apr 7, 2025
afdbebb
added ui/ux feedback
andrewlee348 Apr 9, 2025
5d08a7a
updated design-system and added send confirmation toasts
andrewlee348 Apr 9, 2025
c4aad93
added select wallet in send, copy wallet address button
andrewlee348 Apr 9, 2025
16c8b60
moved connector logos from utils to components
andrewlee348 Apr 9, 2025
38c822b
changed filter button sizing
andrewlee348 Apr 9, 2025
c525284
decoupled filters and changed header styling
andrewlee348 Apr 9, 2025
332e0a7
added padding to views with FilterButton for Guard component
andrewlee348 Apr 10, 2025
e867304
added network icon to collectibles tile, fixed collections filter logic
andrewlee348 Apr 10, 2025
36c0b57
set new sizing for collectible tile network icon
andrewlee348 Apr 10, 2025
b47b795
fixed CollectionsFilter when only 1 collection is available,
andrewlee348 Apr 10, 2025
e50fcac
increased MediaIconWrapper square borderRadius
andrewlee348 Apr 10, 2025
92fb162
simplified home view folder structure
andrewlee348 Apr 10, 2025
4a94af9
deleted unnecessary components
andrewlee348 Apr 10, 2025
d31f3e9
refactor: cleaned up swap by using react context as store,
andrewlee348 Apr 10, 2025
bcafe10
feat: hide WalletSelect if only 1 account is connected
andrewlee348 Apr 11, 2025
875270c
feat: reset swap states on swap view dismount
andrewlee348 Apr 11, 2025
b6a1213
feat: custom token/network image icon,
andrewlee348 Apr 11, 2025
33d9910
feat: reworked swap functionality to improve reliability
andrewlee348 Apr 11, 2025
5233cc6
docs: changed comment for future request implementation
andrewlee348 Apr 11, 2025
686a283
fix: MediaIconWrapper background set to 100% opacity
andrewlee348 Apr 14, 2025
16abeec
fix: fixed resetting swap states,
andrewlee348 Apr 15, 2025
66de435
fix: updated pnpm-lock.yaml
andrewlee348 Apr 15, 2025
775e4a8
fix: removed unnecessary comments and updated sizing constants
andrewlee348 Apr 15, 2025
5ed9db6
Fix fee options alert padding
tolgahan-arikan Apr 16, 2025
bebb9f3
Check if wallet already active before calling connectAsync
tolgahan-arikan Apr 16, 2025
de90b49
Fix title for wallet picker
tolgahan-arikan Apr 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion examples/react/src/components/Connected.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,11 @@ export const Connected = () => {
<Text className="mt-6" variant="small" color="muted" fontWeight="medium">
Demos
</Text>
<CardButton title="Inventory" description="View all tokens in your wallet" onClick={() => setOpenWalletModal(true)} />
<CardButton
title="Wallet widget"
description="View your integrated wallet"
onClick={() => setOpenWalletModal(true)}
/>
{(sponsoredContractAddresses[chainId] || networkForCurrentChainId.testnet) && isWaasConnectionActive && (
<CardButton
title="Send sponsored transaction"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ export const SequenceCheckoutProvider = ({ children, config }: SequenceCheckoutP
>
<SwapModalContextProvider
value={{
isSwapModalOpen: isOpenSwapModal,
openSwapModal,
closeSwapModal,
swapModalSettings
Expand All @@ -230,6 +231,7 @@ export const SequenceCheckoutProvider = ({ children, config }: SequenceCheckoutP
>
<AddFundsContextProvider
value={{
isAddFundsModalOpen: openAddFundsModal,
triggerAddFunds,
closeAddFunds,
addFundsSettings
Expand Down
1 change: 1 addition & 0 deletions packages/checkout/src/contexts/AddFundsModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface AddFundsSettings {
}

type AddFundsModalContext = {
isAddFundsModalOpen: boolean
triggerAddFunds: (settings: AddFundsSettings) => void
closeAddFunds: () => void
addFundsSettings?: AddFundsSettings
Expand Down
1 change: 1 addition & 0 deletions packages/checkout/src/contexts/SwapModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface SwapModalSettings {
}

type SwapModalContext = {
isSwapModalOpen: boolean
openSwapModal: (settings: SwapModalSettings) => void
closeSwapModal: () => void
swapModalSettings?: SwapModalSettings
Expand Down
5 changes: 3 additions & 2 deletions packages/checkout/src/hooks/useAddFundsModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { AddFundsSettings, useAddFundsModalContext } from '../contexts/AddFundsM
* @property Current settings for the On-ramp modal `addFundsSettings`
*/
type UseAddFundsModalReturnType = {
isAddFundsModalOpen: boolean
triggerAddFunds: (settings: AddFundsSettings) => void
closeAddFunds: () => void
addFundsSettings: AddFundsSettings | undefined
Expand Down Expand Up @@ -52,7 +53,7 @@ type UseAddFundsModalReturnType = {
* ```
*/
export const useAddFundsModal = (): UseAddFundsModalReturnType => {
const { triggerAddFunds, closeAddFunds, addFundsSettings } = useAddFundsModalContext()
const { isAddFundsModalOpen, triggerAddFunds, closeAddFunds, addFundsSettings } = useAddFundsModalContext()

return { triggerAddFunds, closeAddFunds, addFundsSettings }
return { isAddFundsModalOpen, triggerAddFunds, closeAddFunds, addFundsSettings }
}
5 changes: 3 additions & 2 deletions packages/checkout/src/hooks/useSwapModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { SwapModalSettings, useSwapModalContext } from '../contexts/SwapModal'
* @property {SwapModalSettings|undefined} swapModalSettings - Current settings for the Swap modal
*/
type UseSwapModalReturnType = {
isSwapModalOpen: boolean
openSwapModal: (settings: SwapModalSettings) => void
closeSwapModal: () => void
swapModalSettings: SwapModalSettings | undefined
Expand Down Expand Up @@ -73,7 +74,7 @@ type UseSwapModalReturnType = {
* ```
*/
export const useSwapModal = (): UseSwapModalReturnType => {
const { openSwapModal, closeSwapModal, swapModalSettings } = useSwapModalContext()
const { isSwapModalOpen, openSwapModal, closeSwapModal, swapModalSettings } = useSwapModalContext()

return { openSwapModal, closeSwapModal, swapModalSettings }
return { isSwapModalOpen, openSwapModal, closeSwapModal, swapModalSettings }
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ export const SequenceConnectPreviewProvider = (props: SequenceConnectProviderPro
}}
>
<GoogleOAuthProvider clientId={googleClientId}>
<ConnectModalContextProvider value={{ setOpenConnectModal, openConnectModalState: openConnectModal }}>
<ConnectModalContextProvider
value={{ isConnectModalOpen: openConnectModal, setOpenConnectModal, openConnectModalState: openConnectModal }}
>
<WalletConfigContextProvider value={{ setDisplayedAssets, displayedAssets, readOnlyNetworks }}>
<AnalyticsContextProvider value={{ setAnalytics, analytics }}>
<div id="kit-provider">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ export const SequenceConnectProvider = (props: SequenceConnectProviderProps) =>
}}
>
<GoogleOAuthProvider clientId={googleClientId}>
<ConnectModalContextProvider value={{ setOpenConnectModal, openConnectModalState: openConnectModal }}>
<ConnectModalContextProvider
value={{ isConnectModalOpen: openConnectModal, setOpenConnectModal, openConnectModalState: openConnectModal }}
>
<WalletConfigContextProvider value={{ setDisplayedAssets, displayedAssets, readOnlyNetworks }}>
<AnalyticsContextProvider value={{ setAnalytics, analytics }}>
<ShadowRoot theme={theme}>
Expand Down
1 change: 1 addition & 0 deletions packages/connect/src/contexts/ConnectModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React from 'react'
import { createGenericContext } from './genericContext'

type ConnectModalContext = {
isConnectModalOpen: boolean
setOpenConnectModal: React.Dispatch<React.SetStateAction<boolean>>
openConnectModalState: boolean
}
Expand Down
5 changes: 3 additions & 2 deletions packages/connect/src/hooks/useOpenConnectModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useConnectModalContext } from '../contexts/ConnectModal'
* @property Current open state of the Connect modal `openConnectModalState`
*/
type UseOpenConnectModalReturnType = {
isConnectModalOpen: boolean
setOpenConnectModal: (isOpen: boolean) => void
openConnectModalState: boolean
}
Expand Down Expand Up @@ -47,7 +48,7 @@ type UseOpenConnectModalReturnType = {
* ```
*/
export const useOpenConnectModal = (): UseOpenConnectModalReturnType => {
const { setOpenConnectModal, openConnectModalState } = useConnectModalContext()
const { isConnectModalOpen, setOpenConnectModal, openConnectModalState } = useConnectModalContext()

return { setOpenConnectModal, openConnectModalState }
return { isConnectModalOpen, setOpenConnectModal, openConnectModalState }
}
19 changes: 16 additions & 3 deletions packages/connect/src/hooks/useWallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export interface ConnectedWallet {
address: string
isActive: boolean
isEmbedded: boolean
signInMethod: string
}

/**
Expand Down Expand Up @@ -222,6 +223,7 @@ export interface UseWalletsReturnType {
* }
* ```
*/

export const useWallets = (): UseWalletsReturnType => {
const { address } = useAccount()
const connections = useConnections()
Expand Down Expand Up @@ -261,12 +263,21 @@ export const useWallets = (): UseWalletsReturnType => {
name: getConnectorName(connection.connector),
address: connection.accounts[0],
isActive: connection.accounts[0] === address,
isEmbedded: connection.connector.id.includes('waas')
isEmbedded: connection.connector.id.includes('waas'),
signInMethod: (connection.connector._wallet as any)?.id
}))

const setActiveWallet = async (walletAddress: string) => {
const connection = connections.find((c: UseConnectionsReturnType[number]) => c.accounts[0] === walletAddress)
const connection = connections.find(
(c: UseConnectionsReturnType[number]) => c.accounts[0].toLowerCase() === walletAddress.toLowerCase()
)
if (!connection) {
console.error('No connection found for wallet address:', walletAddress)
return
}

// Do not try to change if it's already active
if (wallets.find(w => w.address.toLowerCase() === walletAddress.toLowerCase())?.isActive) {
return
}

Expand All @@ -278,7 +289,9 @@ export const useWallets = (): UseWalletsReturnType => {
}

const disconnectWallet = async (walletAddress: string) => {
const connection = connections.find((c: UseConnectionsReturnType[number]) => c.accounts[0] === walletAddress)
const connection = connections.find(
(c: UseConnectionsReturnType[number]) => c.accounts[0].toLowerCase() === walletAddress.toLowerCase()
)
if (!connection) {
return
}
Expand Down
Loading
Loading