Skip to content

Commit

Permalink
Updated to latest viem changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mariopil committed Jan 29, 2024
1 parent 2149fbf commit 0227682
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/Profile.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useState } from 'react';
import { useAccount, useConnect, useDisconnect, useConnectorClient } from 'wagmi'
import { zkSyncTestnet } from "viem_zksync_chains"
import { eip712Actions } from 'viem_zksync_chains/zksync'
import { simulateContract } from '@wagmi/core';
import { simulateContract } from "viem_zksync/src/actions"
import { eip712WalletActions } from 'viem_zksync_chains/zksync'
import { readContract } from '@wagmi/core';
import {
stringify,
Expand Down Expand Up @@ -56,22 +56,22 @@ export function Profile({ config }: any) {
const sendEip712T = async() => {
const request = {
chainId: defChain.id,
chain: defChain,
account: address,
to: '0x36615Cf349d7F6344891B1e7CA7C72883F5dc049',
maxFeePerGas: 250000000n,
maxPriorityFeePerGas: 0n,
value: 100000,
...paymasterParams
}
const client = walletClient?.extend(eip712Actions);
const client = walletClient?.extend(eip712WalletActions());
const hash = await client.sendTransaction(request)
console.log(hash)
}

const writeEip712T = async() => {

const {request} = await simulateContract(config, {

const client = walletClient?.extend(eip712WalletActions());
const {request} = await simulateContract(client, {
...greeterContract,
functionName: "setGreeting",
args: [customGreet],
Expand All @@ -82,8 +82,7 @@ export function Profile({ config }: any) {
account: address,
})

const client = walletClient?.extend(eip712Actions);
const hash = await client.writeContract(request)//walletClient.writeContract(request);
const hash = await client.writeContract(request)
console.log("Hash: " + hash)
}

Expand Down

0 comments on commit 0227682

Please sign in to comment.