Skip to content

Commit

Permalink
Update dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
shahbaz17 committed Aug 5, 2024
1 parent f33ddbb commit eea8e09
Show file tree
Hide file tree
Showing 9 changed files with 1,417 additions and 1,746 deletions.
1,222 changes: 445 additions & 777 deletions demos/wagmi-modal/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions demos/wagmi-modal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"@types/node": "^16.18.11",
"@types/react": "^18.2.12",
"@types/react-dom": "^18.2.5",
"@web3auth/base": "^8.0.0",
"@web3auth/modal": "^8.0.0",
"@web3auth/ethereum-provider": "^8.0.0",
"@web3auth/base": "^8.12.0",
"@web3auth/modal": "^8.12.1",
"@web3auth/ethereum-provider": "^8.12.0",
"@web3auth/web3auth-wagmi-connector": "file:../../",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
45 changes: 39 additions & 6 deletions demos/wagmi-modal/src/balance.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,50 @@
import { useAccount, useBalance } from "wagmi";
import { useAccount, useBalance, useSignTypedData } from "wagmi";

export function Balance() {
const { address } = useAccount()
const { address } = useAccount();
const { signTypedData } = useSignTypedData();

const { data: default_ } = useBalance({ address })
const { data: account_ } = useBalance({ address })
const { data: default_ } = useBalance({ address });
const { data: account_ } = useBalance({ address });

return (
<div>
<h2>Balance</h2>

<div>Balance (Default Chain): {default_?.formatted}</div>
<div>Balance (Account Chain): {account_?.formatted}</div>
<button
onClick={() => {
const data = signTypedData({
types: {
Person: [
{ name: "name", type: "string" },
{ name: "wallet", type: "address" },
],
Mail: [
{ name: "from", type: "Person" },
{ name: "to", type: "Person" },
{ name: "contents", type: "string" },
],
},
primaryType: "Mail",
message: {
from: {
name: "Cow",
wallet: "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826",
},
to: {
name: "Bob",
wallet: "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB",
},
contents: "Hello, Bob!",
},
});
console.log(data);
}}
>
Sign message
</button>
</div>
)
}
);
}
Loading

0 comments on commit eea8e09

Please sign in to comment.