@@ -2,7 +2,7 @@ import type { Account, Address, Chain, Client, Hex, Transport } from "viem";
22import { encodeFunctionData , keccak256 , pad , toHex } from "viem" ;
33import { waitForTransactionReceipt } from "viem/actions" ;
44import { getGeneralPaymasterInput , sendTransaction } from "viem/zksync" ;
5- import { GuardianRecoveryModuleAbi } from "zksync-sso/abi" ;
5+ import { GuardianRecoveryValidatorAbi } from "zksync-sso/abi" ;
66import { confirmGuardian as sdkConfirmGuardian } from "zksync-sso/client" ;
77import { base64UrlToUint8Array , getPublicKeyBytesFromPasskeySignature } from "zksync-sso/utils" ;
88
@@ -25,7 +25,7 @@ export const useRecoveryGuardian = () => {
2525 const client = getPublicClient ( { chainId : defaultChain . id } ) ;
2626 return await client . readContract ( {
2727 address : contractsByChain [ defaultChain . id ] . recovery ,
28- abi : GuardianRecoveryModuleAbi ,
28+ abi : GuardianRecoveryValidatorAbi ,
2929 functionName : "guardianOf" ,
3030 args : [ keccak256 ( toHex ( window . location . origin ) ) , guardianAddress ] ,
3131 } ) ;
@@ -45,7 +45,7 @@ export const useRecoveryGuardian = () => {
4545 const client = getPublicClient ( { chainId : defaultChain . id } ) ;
4646 const data = await client . readContract ( {
4747 address : contractsByChain [ defaultChain . id ] . recovery ,
48- abi : GuardianRecoveryModuleAbi ,
48+ abi : GuardianRecoveryValidatorAbi ,
4949 functionName : "guardiansFor" ,
5050 args : [ keccak256 ( toHex ( window . location . origin ) ) , guardedAccount ] ,
5151 } ) ;
@@ -70,7 +70,7 @@ export const useRecoveryGuardian = () => {
7070 const client = getPublicClient ( { chainId : defaultChain . id } ) ;
7171 return await client . readContract ( {
7272 address : contractsByChain [ defaultChain . id ] . recovery ,
73- abi : GuardianRecoveryModuleAbi ,
73+ abi : GuardianRecoveryValidatorAbi ,
7474 functionName : "getPendingRecoveryData" ,
7575 args : [ keccak256 ( toHex ( window . location . origin ) ) , account ] ,
7676 } ) ;
@@ -125,7 +125,7 @@ export const useRecoveryGuardian = () => {
125125 const client = getClient ( { chainId : defaultChain . id } ) ;
126126 const tx = await client . writeContract ( {
127127 address : contractsByChain [ defaultChain . id ] . recovery ,
128- abi : GuardianRecoveryModuleAbi ,
128+ abi : GuardianRecoveryValidatorAbi ,
129129 functionName : "discardRecovery" ,
130130 args : [ keccak256 ( toHex ( window . location . origin ) ) ] ,
131131 } ) ;
@@ -144,7 +144,7 @@ export const useRecoveryGuardian = () => {
144144 ] as const ;
145145
146146 const calldata = encodeFunctionData ( {
147- abi : GuardianRecoveryModuleAbi ,
147+ abi : GuardianRecoveryValidatorAbi ,
148148 functionName : "initRecovery" ,
149149 args : [
150150 accountToRecover ,
@@ -173,13 +173,13 @@ export const useRecoveryGuardian = () => {
173173 const [ requestValidityTime , requestDelayTime ] = await Promise . all ( [
174174 client . readContract ( {
175175 address : contractsByChain [ defaultChain . id ] . recovery ,
176- abi : GuardianRecoveryModuleAbi ,
176+ abi : GuardianRecoveryValidatorAbi ,
177177 functionName : "REQUEST_VALIDITY_TIME" ,
178178 args : [ ] ,
179179 } ) ,
180180 client . readContract ( {
181181 address : contractsByChain [ defaultChain . id ] . recovery ,
182- abi : GuardianRecoveryModuleAbi ,
182+ abi : GuardianRecoveryValidatorAbi ,
183183 functionName : "REQUEST_DELAY_TIME" ,
184184 args : [ ] ,
185185 } ) ,
@@ -208,7 +208,7 @@ export const useRecoveryGuardian = () => {
208208
209209 const eventsFilter = {
210210 address : contractsByChain [ defaultChain . id ] . recovery ,
211- abi : GuardianRecoveryModuleAbi ,
211+ abi : GuardianRecoveryValidatorAbi ,
212212 args,
213213 fromBlock : validFromBlock ,
214214 toBlock : "latest" ,
0 commit comments