refactor: use web3Provider.listAccounts()
This commit is contained in:
@@ -219,6 +219,8 @@ export default function App() {
|
||||
);
|
||||
};
|
||||
|
||||
console.log(accounts);
|
||||
|
||||
return (
|
||||
<SLayout>
|
||||
<Column maxWidth={1000} spanHeight>
|
||||
|
||||
@@ -170,14 +170,22 @@ export function JsonRpcContextProvider({ children }: { children: ReactNode | Rea
|
||||
};
|
||||
}
|
||||
|
||||
const result: string = await client!.request({
|
||||
topic: session!.topic,
|
||||
chainId,
|
||||
request: {
|
||||
method: "eth_sendTransaction",
|
||||
params: [tx],
|
||||
},
|
||||
});
|
||||
let result = "";
|
||||
|
||||
try {
|
||||
result = await client!.request({
|
||||
topic: session!.topic,
|
||||
chainId,
|
||||
request: {
|
||||
method: "eth_sendTransaction",
|
||||
params: [tx],
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
console.log(result);
|
||||
|
||||
// format displayed result
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user