Skip to content

Commit a790b47

Browse files
authored
feat: update readme with new publish steps (#129)
* feat: update readme with new publish steps Adding the automatic formatting post-publish reduces git diff noise The name change is because the old file was manually named and imported * fix: update pnpm lockfile * fix: update filename The import was renamed, but the filename was missed! * chore: add run command to build pnpm I think has the npm compat built in where the special scripts can run without the run command. It's probably better to not rely on that!
1 parent c9791f6 commit a790b47

File tree

10 files changed

+109
-259
lines changed

10 files changed

+109
-259
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ This monorepo is comprised of the following packages, products, and examples:
141141

142142
```bash
143143
# Compile and deploy contracts
144-
cd packages/contracts
145-
pnpm build
144+
pnpm --dir packages/contracts run build
146145
pnpm --dir packages/contracts run publish ../sdk/src/abi
146+
pnpm run format-abi
147147
pnpm --dir packages/contracts run deploy --file ../auth-server/stores/local-node.json
148148
```
149149

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"fmt": "pnpm prettier --write .",
1818
"lint": "pnpm run lint:eslint && pnpm run lint:markdown && pnpm run lint:spelling && pnpm run lint:prettier",
1919
"lint:fix": "pnpm eslint --fix --ignore-pattern 'packages/*' --ignore-pattern 'examples/*' . && pnpm nx affected -t lint --fix && pnpm prettier --write . | grep -v 'unchanged' | xargs",
20+
"format-abi": "pnpm eslint --fix packages/sdk/src/abi && pnpm nx affected -t lint --fix && pnpm prettier --write packages/sdk/src/abi | grep -v 'unchanged' | xargs",
2021
"lint:eslint": "pnpm nx run-many -t lint --all && pnpm eslint --ignore-pattern 'packages/*' --ignore-pattern 'examples/*' .",
2122
"lint:markdown": "markdownlint-cli2 '**/*.md'",
2223
"lint:spelling": "cspell .",

packages/auth-server/composables/useRecoveryGuardian.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Account, Address, Chain, Client, Hex, Transport } from "viem";
22
import { encodeFunctionData, keccak256, pad, toHex } from "viem";
33
import { waitForTransactionReceipt } from "viem/actions";
44
import { getGeneralPaymasterInput, sendTransaction } from "viem/zksync";
5-
import { GuardianRecoveryModuleAbi } from "zksync-sso/abi";
5+
import { GuardianRecoveryValidatorAbi } from "zksync-sso/abi";
66
import { confirmGuardian as sdkConfirmGuardian } from "zksync-sso/client";
77
import { 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",

packages/auth-server/stores/local-node.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"beacon": "0x5df1462218fe444FA4CD486f4d7A837A82b3B026",
23
"session": "0xcc8bD0d99CF35e5F07d5FbbFd8f7B628010E52C2",
34
"passkey": "0xDdB1e5ECd29aAC588E0fb0a7eAB1b589fE7D7dcD",
45
"accountFactory": "0x940adFE6B30536D22eD78870aA79c9DC0835556C",

packages/sdk/src/abi/GuardianRecoveryModule.ts renamed to packages/sdk/src/abi/GuardianRecoveryValidator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const GuardianRecoveryModuleAbi = [
1+
export const GuardianRecoveryValidatorAbi = [
22
{
33
inputs: [],
44
stateMutability: "nonpayable",

packages/sdk/src/abi/SsoAccount.ts

Lines changed: 1 addition & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const SsoAccountAbi = [
102102
},
103103
{
104104
inputs: [],
105-
name: "InvalidShortString",
105+
name: "INVALID_ACCOUNT_KEYS",
106106
type: "error",
107107
},
108108
{
@@ -154,17 +154,6 @@ export const SsoAccountAbi = [
154154
name: "OWNER_NOT_FOUND",
155155
type: "error",
156156
},
157-
{
158-
inputs: [
159-
{
160-
internalType: "string",
161-
name: "str",
162-
type: "string",
163-
},
164-
],
165-
name: "StringTooLong",
166-
type: "error",
167-
},
168157
{
169158
inputs: [
170159
{
@@ -217,12 +206,6 @@ export const SsoAccountAbi = [
217206
name: "BatchCallFailure",
218207
type: "event",
219208
},
220-
{
221-
anonymous: false,
222-
inputs: [],
223-
name: "EIP712DomainChanged",
224-
type: "event",
225-
},
226209
{
227210
anonymous: false,
228211
inputs: [
@@ -403,49 +386,6 @@ export const SsoAccountAbi = [
403386
stateMutability: "payable",
404387
type: "function",
405388
},
406-
{
407-
inputs: [],
408-
name: "eip712Domain",
409-
outputs: [
410-
{
411-
internalType: "bytes1",
412-
name: "fields",
413-
type: "bytes1",
414-
},
415-
{
416-
internalType: "string",
417-
name: "name",
418-
type: "string",
419-
},
420-
{
421-
internalType: "string",
422-
name: "version",
423-
type: "string",
424-
},
425-
{
426-
internalType: "uint256",
427-
name: "chainId",
428-
type: "uint256",
429-
},
430-
{
431-
internalType: "address",
432-
name: "verifyingContract",
433-
type: "address",
434-
},
435-
{
436-
internalType: "bytes32",
437-
name: "salt",
438-
type: "bytes32",
439-
},
440-
{
441-
internalType: "uint256[]",
442-
name: "extensions",
443-
type: "uint256[]",
444-
},
445-
],
446-
stateMutability: "view",
447-
type: "function",
448-
},
449389
{
450390
inputs: [
451391
{
@@ -646,32 +586,6 @@ export const SsoAccountAbi = [
646586
stateMutability: "payable",
647587
type: "function",
648588
},
649-
{
650-
inputs: [
651-
{
652-
components: [
653-
{
654-
internalType: "bytes32",
655-
name: "signedHash",
656-
type: "bytes32",
657-
},
658-
],
659-
internalType: "struct ERC1271Handler.SsoMessage",
660-
name: "ssoMessage",
661-
type: "tuple",
662-
},
663-
],
664-
name: "getEip712Hash",
665-
outputs: [
666-
{
667-
internalType: "bytes32",
668-
name: "",
669-
type: "bytes32",
670-
},
671-
],
672-
stateMutability: "view",
673-
type: "function",
674-
},
675589
{
676590
inputs: [
677591
{
@@ -1192,19 +1106,6 @@ export const SsoAccountAbi = [
11921106
stateMutability: "nonpayable",
11931107
type: "function",
11941108
},
1195-
{
1196-
inputs: [],
1197-
name: "ssoMessageTypeHash",
1198-
outputs: [
1199-
{
1200-
internalType: "bytes32",
1201-
name: "",
1202-
type: "bytes32",
1203-
},
1204-
],
1205-
stateMutability: "pure",
1206-
type: "function",
1207-
},
12081109
{
12091110
inputs: [
12101111
{

packages/sdk/src/abi/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export { AAFactoryAbi } from "./AAFactory.js";
2-
export { GuardianRecoveryModuleAbi } from "./GuardianRecoveryModule.js";
2+
export { GuardianRecoveryValidatorAbi } from "./GuardianRecoveryValidator.js";
33
export { SessionKeyValidatorAbi } from "./SessionKeyValidator.js";
44
export { SsoAccountAbi } from "./SsoAccount.js";
55
export { WebAuthValidatorAbi } from "./WebAuthValidator.js";

packages/sdk/src/client/recovery/actions/recovery.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { type Account, type Address, type Chain, type Client, encodeFunctionData
22
import { waitForTransactionReceipt } from "viem/actions";
33
import { getGeneralPaymasterInput, sendTransaction } from "viem/zksync";
44

5-
import { GuardianRecoveryModuleAbi } from "../../../abi/GuardianRecoveryModule.js";
5+
import { GuardianRecoveryValidatorAbi } from "../../../abi/GuardianRecoveryValidator.js";
66
import { noThrow } from "../../../utils/helpers.js";
77

88
export type ProposeGuardianArgs = {
@@ -35,7 +35,7 @@ export const proposeGuardian = async <
3535
}
3636

3737
const callData = encodeFunctionData({
38-
abi: GuardianRecoveryModuleAbi,
38+
abi: GuardianRecoveryValidatorAbi,
3939
functionName: "proposeGuardian",
4040
args: [keccak256(toHex(origin)), args.newGuardian],
4141
});
@@ -91,7 +91,7 @@ export const confirmGuardian = async <
9191
}
9292
}
9393
const callData = encodeFunctionData({
94-
abi: GuardianRecoveryModuleAbi,
94+
abi: GuardianRecoveryValidatorAbi,
9595
functionName: "addGuardian",
9696
args: [keccak256(toHex(origin)), args.accountToGuard],
9797
});
@@ -147,7 +147,7 @@ export const removeGuardian = async <
147147
}
148148
}
149149
const callData = encodeFunctionData({
150-
abi: GuardianRecoveryModuleAbi,
150+
abi: GuardianRecoveryValidatorAbi,
151151
functionName: "removeGuardian",
152152
args: [keccak256(toHex(origin)), args.guardian],
153153
});

0 commit comments

Comments
 (0)