Appearance
Requesting signatures and transactions
TIP
To request signatures and transactions from a wallet, you must first get an EIP1193 provider for the wallet.
Once you have the embedded wallet's EIP-1193 provider, you can use the provider's request
method to send JSON-RPC requests that request signatures and transactions from the wallet.
The request
method accepts an object with the fields:
method
(required): the name of the JSON-RPC method as a string (e.g.personal_sign
oreth_sendTransaction
)params
(optional): an array of arguments for the JSON-RPC method specified bymethod
ts
// Get address
const accounts = await wallet.provider.request({
method: 'eth_requestAccounts',
});
// Sign message
const message = 'I hereby vote for foobar';
const signature = await wallet.provider.request({
method: 'personal_sign',
params: [message, accounts[0]],
});