hotfix for wallet3inbox connection (#469)

This commit is contained in:
Andrius Bačianskas 2024-02-09 19:06:40 +01:00 committed by GitHub
parent 43d41d40b4
commit e362091b17
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 34 additions and 31 deletions

View File

@ -39,8 +39,6 @@ export class SmartAccountLib {
throw new Error('A Pimlico API Key is required')
}
console.log('investigate 2', chain, privateKey, sponsored)
this.chain = chain
this.sponsored = sponsored
this.#signerPrivateKey = privateKey

View File

@ -179,7 +179,7 @@ export function styledToast(message: string, type: string) {
style: {
borderRadius: '10px',
background: '#333',
color: '#fff'
color: '#fff',
}
})
}

View File

@ -62,7 +62,6 @@ export const USDC_FAUCET_URL = 'https://faucet.circle.com/'
export const VITALIK_ADDRESS = '0xd8da6bf26964af9d7eed9e03e53415d37aa96045' as Hex
export const publicRPCUrl = ({ chain }: UrlConfig) => {
console.log("investigate", chain)
return RPC_URLS[chain?.name]
}

View File

@ -242,6 +242,8 @@ export default function SessionProposalModal() {
const onApprove = useCallback(async () => {
if (proposal) {
setIsLoadingApprove(true)
try {
// get keys of namespaces
const namespaceKeys = Object.keys(namespaces)
const [nameSpaceKey] = namespaceKeys
@ -257,7 +259,10 @@ export default function SessionProposalModal() {
console.log('allowedChainIds', allowedChainIds)
if (allowedChainIds.length) {
const chainIdParsed = allowedChainIds[0].replace(`${nameSpaceKey}:`, '')
if (namespaces[nameSpaceKey].accounts) {
const signerAddress = namespaces[nameSpaceKey].accounts[0].split(':')[2]
const wallet = eip155Wallets[signerAddress]
const chain = allowedChains.find(chain => chain.id.toString() === chainIdParsed)!
@ -275,8 +280,9 @@ export default function SessionProposalModal() {
console.log('approving namespaces:', namespaces.eip155.accounts)
}
}
}
try {
await web3wallet.approveSession({
id: proposal.id,
namespaces