Skip to content

Commit 35d2700

Browse files
committed
chore: add amountsToApproveEvm query string
1 parent 3f68a5f commit 35d2700

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

advanced/wallets/react-wallet-v2/src/views/SessionProposalModal.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import useSmartAccounts from '@/hooks/useSmartAccounts'
3737
import { EIP5792_METHODS } from '@/data/EIP5792Data'
3838
import { getWalletCapabilities } from '@/utils/EIP5792WalletUtil'
3939
import { EIP7715_METHOD } from '@/data/EIP7715Data'
40+
import { useRouter } from 'next/router'
4041

4142
const StyledText = styled(Text, {
4243
fontWeight: 400
@@ -55,6 +56,10 @@ export default function SessionProposalModal() {
5556
const [isLoadingReject, setIsLoadingReject] = useState(false)
5657
const { getAvailableSmartAccountsOnNamespaceChains } = useSmartAccounts()
5758

59+
const { query } = useRouter()
60+
61+
const amountsToApproveEvm = Number(query.amountsToApproveEvm) || null
62+
5863
const supportedNamespaces = useMemo(() => {
5964
// eip155
6065
const eip155Chains = Object.keys(EIP155_CHAINS)
@@ -106,7 +111,11 @@ export default function SessionProposalModal() {
106111
methods: eip155Methods.concat(eip5792Methods).concat(eip7715Methods),
107112
events: ['accountsChanged', 'chainChanged'],
108113
accounts: eip155Chains
109-
.map(chain => eip155Addresses.map(account => `${chain}:${account}`))
114+
.map(chain =>
115+
eip155Addresses
116+
.map(account => `${chain}:${account}`)
117+
.slice(0, amountsToApproveEvm ?? eip155Addresses.length)
118+
)
110119
.flat()
111120
},
112121
cosmos: {

0 commit comments

Comments
 (0)