@vlayer/sdk
Advanced tools
Comparing version 0.1.0-nightly-20241016-82138b7 to 0.1.0-nightly-20241017-3ad4fbf
@@ -5,3 +5,3 @@ { | ||
"exports": "./src/index.ts", | ||
"version": "0.1.0-nightly-20241016-82138b7", | ||
"version": "0.1.0-nightly-20241017-3ad4fbf", | ||
"types": "src/index.ts", | ||
@@ -8,0 +8,0 @@ "scripts": { |
@@ -33,3 +33,3 @@ import { describe, expect, test } from "vitest"; | ||
); | ||
const dkim = email.headers.filter((h) => h.key === "dkim-signature")!; | ||
const dkim = email.headers.filter((h) => h.key === "dkim-signature"); | ||
@@ -36,0 +36,0 @@ expect(dkim).toHaveLength(2); |
@@ -8,3 +8,3 @@ import { VCallResponse, VlayerClient } from "types/vlayer"; | ||
function dropProofFromArgs(args: unknown) { | ||
function dropEmptyProofFromArgs(args: unknown) { | ||
if (Array.isArray(args)) { | ||
@@ -36,3 +36,2 @@ return args.slice(1); | ||
): VlayerClient => { | ||
// TODO : implement high level api | ||
console.log("createVlayerClient with", url, webProofProvider); | ||
@@ -67,13 +66,13 @@ const resultHashMap = new Map< | ||
const result = dropProofFromArgs( | ||
const result = dropEmptyProofFromArgs( | ||
decodeFunctionResult({ | ||
abi: savedProvingData[1] as Abi, | ||
abi: savedProvingData[1], | ||
data: evm_call_result, | ||
functionName: savedProvingData[2] as string, | ||
functionName: savedProvingData[2], | ||
}), | ||
); | ||
return { proof, result }; | ||
return [proof, ...result]; | ||
}, | ||
}; | ||
}; |
@@ -24,22 +24,10 @@ import { | ||
export interface Proof { | ||
export type Proof = { | ||
length: bigint; | ||
seal: { | ||
verifierSelector: Hex; | ||
seal: [Hex, Hex, Hex, Hex, Hex, Hex, Hex, Hex]; | ||
seal: readonly [Hex, Hex, Hex, Hex, Hex, Hex, Hex, Hex]; | ||
mode: number; | ||
}; | ||
dynamicParamsOffsets: [ | ||
bigint, | ||
bigint, | ||
bigint, | ||
bigint, | ||
bigint, | ||
bigint, | ||
bigint, | ||
bigint, | ||
bigint, | ||
bigint, | ||
]; | ||
assumptions: { | ||
callAssumptions: { | ||
proverContractAddress: Address; | ||
@@ -50,3 +38,3 @@ functionSelector: Hex; | ||
}; | ||
} | ||
}; | ||
@@ -64,3 +52,2 @@ export interface VCallResult { | ||
// Add more methods here | ||
export type VlayerClient = { | ||
@@ -77,3 +64,3 @@ prove: < | ||
hash: string; | ||
}) => Promise<{ proof: Proof; result: unknown[] }>; | ||
}) => Promise<[Proof, ...unknown[]]>; | ||
}; | ||
@@ -80,0 +67,0 @@ |
import { AbiFunction, Hex, Abi, ContractFunctionName } from "viem"; | ||
import type { ContractFunctionArgsWithout } from "./viem"; | ||
import { | ||
Branded, | ||
WebProof, | ||
WebProofStepExpectUrl, | ||
WebProofStepStartPage, | ||
} from "../../../web-proof-commons"; | ||
import { Branded, WebProof, WebProofStep } from "../../../web-proof-commons"; | ||
export type WebProofSetupInput = { | ||
logoUrl: string; | ||
steps: [WebProofStepExpectUrl, WebProofStepStartPage, WebProofStepStartPage]; | ||
steps: WebProofStep[]; | ||
}; | ||
@@ -14,0 +9,0 @@ |
@@ -66,3 +66,3 @@ import { | ||
if (message.type === ExtensionMessageType.ProofError) { | ||
reject(message.error); | ||
reject(new Error(message.error)); | ||
} | ||
@@ -69,0 +69,0 @@ }); |
@@ -7,1 +7,4 @@ export * as testHelpers from "./api/helpers"; | ||
export * from "./api/lib/types"; | ||
export * from "./web-proof-commons/types/webProof.ts"; | ||
export * from "./web-proof-commons/utils.ts"; |
34751
1042