Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using walletconnectV2 to connect to the wallet, there is an 'n.send is not a function' error in the offline signature #530

Open
brownSocial opened this issue Sep 12, 2023 · 3 comments
Labels
question Further information is requested

Comments

@brownSocial
Copy link

const ethAdapter = new Web3Adapter({
web3: ethWeb,
signerAddress: owner,
});
const safeSdk = await Safe.create({
ethAdapter: ethAdapter,
safeAddress,
})
let senderSignature;
try {
senderSignature = await safeSdk?.signTransaction(safeTransaction);
} catch (error: any) {
}

dependencies:
"@safe-global/api-kit": "^1.3.1",
"@safe-global/protocol-kit": "^1.3.0",
"@safe-global/safe-core-sdk-types": "^2.3.0",
"@walletconnect/ethereum-provider": "^2.8.5",
"web3": "^1.8.1",

Using walletconnectV2 to connect to the wallet, there is an 'n.send is not a function' error in the offline signature。

@dasanra
Copy link
Collaborator

dasanra commented Sep 12, 2023

With the information provided is not possible to debug.

Could you please share how ethWeb and owner were defined?

Thank you!

@dasanra dasanra added the question Further information is requested label Sep 12, 2023
@brownSocial
Copy link
Author

brownSocial commented Sep 13, 2023

With the information provided is not possible to debug.

Could you please share how ethWeb and owner were defined?

Thank you!

ethWeb uses walletconnectV2 sdk @walletconnect/ethereum-provider

const provider = await EthereumProvider.init({
     projectId: DEFAULT_PROJECT_ID || '',
     chains: [chainId],
     optionalChains: ENV_ETH_CHAIN_IDS,
     showQrModal: true,
     methods: [
       'eth_sendTransaction',
       'eth_signTransaction',
       'eth_sign',
       'personal_sign',
       'eth_signTypedData',
       'wallet_addEthereumChain',
       'wallet_switchEthereumChain',
       'eth_signTypedData_v3',
     ],
     events: [
       'chainChanged',
       'accountsChanged',
       'display_uri',
       'connect',
       'session_update',
       'session_delete',
     ],
     rpcMap,
     metadata: {
       name: 'Vault',
       description: 'Vault',
       url: APP_URL,
       icons: [APP_URL + '/logo.png'],
     },
   });
const ethWeb : any = new Web3(provider);

Owner is the wallet address

@brownSocial
Copy link
Author

The provider of walletconnectV2 has no send method, send is an obsolete method according to eip1193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants