refactor: use web3Provider.listAccounts()

This commit is contained in:
Ben Kremer
2022-02-18 10:51:35 +01:00
parent 75354cf87d
commit 154e05afa7
3 changed files with 27 additions and 20 deletions
+2
View File
@@ -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 {