Skip to content

Commit bd58a1e

Browse files
committed
refactor: use ByteVector instead of buffer
use ByteVector instead of buffer
1 parent be32b82 commit bd58a1e

File tree

3 files changed

+1459
-200
lines changed

3 files changed

+1459
-200
lines changed

packages/sdk/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@
151151
"abitype": "^1.0.6",
152152
"bigint-conversion": "^2.4.3",
153153
"buffer": "^6.0.3",
154-
"ms": "^2.1.3"
154+
"ms": "^2.1.3",
155+
"zksync-sso-circuits": "workspace:*"
155156
}
156157
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { type Account, type Address, type Chain, type Client, encodeAbiParameters, encodeFunctionData, type Hash, type Hex, type Prettify, type TransactionReceipt, type Transport } from "viem";
22
import { waitForTransactionReceipt } from "viem/actions";
33
import { getGeneralPaymasterInput, sendTransaction } from "viem/zksync";
4+
import { ByteVector } from "zksync-sso-circuits";
45

56
import { GuardianRecoveryModuleAbi } from "../../../abi/GuardianRecoveryModule.js";
67
import { OidcRecoveryModuleAbi } from "../../../abi/OidcRecoveryModule.js";
@@ -233,8 +234,7 @@ export type ParsedOidcData = {
233234
};
234235

235236
export const parseOidcData = (oidcData: OidcData): ParsedOidcData => {
236-
const hexToAscii = (hex: Hex): string =>
237-
Buffer.from(hex.slice(2), "hex").toString("ascii");
237+
const hexToAscii = (hex: Hex): string => ByteVector.fromHex(hex).toAsciiStr();
238238

239239
return {
240240
oidcDigest: oidcData.oidcDigest.toString(), // Do not convert. oidcDigest is just a hash

0 commit comments

Comments
 (0)