@vlayer/sdk 0.1.0-nightly-20241016-82138b7 → 0.1.0-nightly-20241016-4769145
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -30,7 +30,7 @@ describe("parseEmail", () => {
|
|
30
30
|
const email = await parseEmail(
|
31
31
|
`${emailHeaders}${dkimHeader}\n${dkimHeader2}\n\n${body}`,
|
32
32
|
);
|
33
|
-
const dkim = email.headers.filter((h) => h.key === "dkim-signature")
|
33
|
+
const dkim = email.headers.filter((h) => h.key === "dkim-signature");
|
34
34
|
|
35
35
|
expect(dkim).toHaveLength(2);
|
36
36
|
expect(parseParams(dkim[0].value).s).toBe("selector1");
|
package/src/api/lib/client.ts
CHANGED
@@ -5,7 +5,7 @@ import { prove } from "../prover";
|
|
5
5
|
import { createExtensionWebProofProvider } from "../webProof";
|
6
6
|
import { type Abi, decodeFunctionResult } from "viem";
|
7
7
|
|
8
|
-
function
|
8
|
+
function dropEmptyProofFromArgs(args: unknown) {
|
9
9
|
if (Array.isArray(args)) {
|
10
10
|
return args.slice(1);
|
11
11
|
}
|
@@ -32,7 +32,6 @@ export const createVlayerClient = (
|
|
32
32
|
webProofProvider: createExtensionWebProofProvider(),
|
33
33
|
},
|
34
34
|
): VlayerClient => {
|
35
|
-
// TODO : implement high level api
|
36
35
|
console.log("createVlayerClient with", url, webProofProvider);
|
37
36
|
const resultHashMap = new Map<
|
38
37
|
string,
|
@@ -62,15 +61,15 @@ export const createVlayerClient = (
|
|
62
61
|
result: { proof, evm_call_result },
|
63
62
|
} = await savedProvingData[0];
|
64
63
|
|
65
|
-
const result =
|
64
|
+
const result = dropEmptyProofFromArgs(
|
66
65
|
decodeFunctionResult({
|
67
|
-
abi: savedProvingData[1]
|
66
|
+
abi: savedProvingData[1],
|
68
67
|
data: evm_call_result,
|
69
|
-
functionName: savedProvingData[2]
|
68
|
+
functionName: savedProvingData[2],
|
70
69
|
}),
|
71
70
|
);
|
72
71
|
|
73
|
-
return
|
72
|
+
return [proof, ...result];
|
74
73
|
},
|
75
74
|
};
|
76
75
|
};
|
@@ -59,7 +59,6 @@ export interface VCallResponse {
|
|
59
59
|
id: number;
|
60
60
|
}
|
61
61
|
|
62
|
-
// Add more methods here
|
63
62
|
export type VlayerClient = {
|
64
63
|
prove: <
|
65
64
|
T extends readonly [AbiFunction, ...Abi[number][]],
|
@@ -71,7 +70,7 @@ export type VlayerClient = {
|
|
71
70
|
hash,
|
72
71
|
}: {
|
73
72
|
hash: string;
|
74
|
-
}) => Promise<
|
73
|
+
}) => Promise<[Proof, ...unknown[]]>;
|
75
74
|
};
|
76
75
|
|
77
76
|
export type VlayerClientProveArgs<
|