@vlayer/sdk 0.1.0-nightly-20241107-c06494b → 0.1.0-nightly-20241108-356ce8d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/api/email/dnsResolver.test.js +1 -1
  2. package/dist/api/email/parseEmail.test.js +1 -1
  3. package/dist/api/email/preverify.js +2 -2
  4. package/dist/api/email/preverify.test.js +2 -2
  5. package/dist/api/helpers.d.ts +1 -1
  6. package/dist/api/lib/client.d.ts +2 -2
  7. package/dist/api/lib/client.js +3 -3
  8. package/dist/api/lib/client.test.js +2 -2
  9. package/dist/api/lib/types/ethereum.d.ts +1 -1
  10. package/dist/api/lib/types/index.d.ts +3 -3
  11. package/dist/api/lib/types/index.js +3 -3
  12. package/dist/api/lib/types/webProofProvider.d.ts +2 -2
  13. package/dist/api/prover.d.ts +1 -1
  14. package/dist/api/prover.js +1 -1
  15. package/dist/api/v_call.d.ts +1 -1
  16. package/dist/api/webProof/createWebProof.d.ts +1 -1
  17. package/dist/api/webProof/index.d.ts +3 -3
  18. package/dist/api/webProof/index.js +3 -3
  19. package/dist/api/webProof/providers/extension.d.ts +1 -1
  20. package/dist/api/webProof/providers/extension.js +1 -1
  21. package/dist/api/webProof/providers/index.d.ts +1 -1
  22. package/dist/api/webProof/providers/index.js +1 -1
  23. package/dist/api/webProof/steps/expectUrl.d.ts +1 -1
  24. package/dist/api/webProof/steps/expectUrl.js +1 -1
  25. package/dist/api/webProof/steps/index.d.ts +6 -6
  26. package/dist/api/webProof/steps/index.js +3 -3
  27. package/dist/api/webProof/steps/notarize.d.ts +1 -1
  28. package/dist/api/webProof/steps/notarize.js +1 -1
  29. package/dist/api/webProof/steps/startPage.d.ts +1 -1
  30. package/dist/api/webProof/steps/startPage.js +1 -1
  31. package/dist/index.d.ts +6 -6
  32. package/dist/index.js +6 -6
  33. package/dist/web-proof-commons/index.d.ts +3 -3
  34. package/dist/web-proof-commons/index.js +3 -3
  35. package/dist/web-proof-commons/types/message.d.ts +2 -2
  36. package/package.json +5 -4
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, test } from "vitest";
2
- import { resolveDkimDns } from "./dnsResolver";
2
+ import { resolveDkimDns } from "./dnsResolver.js";
3
3
  describe("resolveDkimDns Integration", () => {
4
4
  test("resolves VLayer DNS", async () => {
5
5
  const resolved = await resolveDkimDns("vlayer-xyz.20230601.gappssmtp.com", "20230601");
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, test } from "vitest";
2
- import { getDkimSigners, parseEmail, parseParams } from "./parseEmail";
2
+ import { getDkimSigners, parseEmail, parseParams } from "./parseEmail.js";
3
3
  const emailHeaders = `From: "John Doe" <john@d.oe>
4
4
  To: "Jane Doe" <jane@d.oe>
5
5
  Subject: Hello World
@@ -1,5 +1,5 @@
1
- import { parseEmail, getDkimSigners } from "./parseEmail";
2
- import { resolveDkimDns } from "./dnsResolver";
1
+ import { parseEmail, getDkimSigners } from "./parseEmail.js";
2
+ import { resolveDkimDns } from "./dnsResolver.js";
3
3
  export async function preverifyEmail(mimeEmail) {
4
4
  const parsedEmail = await parseEmail(mimeEmail);
5
5
  const signers = getDkimSigners(parsedEmail);
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, test } from "vitest";
2
- import { preverifyEmail } from "./preverify";
3
- import { readFile } from "../../testHelpers/readFile";
2
+ import { preverifyEmail } from "./preverify.js";
3
+ import { readFile } from "../../testHelpers/readFile.js";
4
4
  describe("Preverify email: integration", () => {
5
5
  test("adds dns record to email mime", async () => {
6
6
  const rawEmail = readFile("./src/api/email/testdata/test_email.txt");
@@ -1,5 +1,5 @@
1
1
  import { type Abi, type Address, type Chain, type ContractFunctionArgs, type ContractFunctionName, type Hex, PublicClient, walletActions } from "viem";
2
- import type { ContractSpec, ContractArg } from "types/ethereum";
2
+ import type { ContractSpec, ContractArg } from "./lib/types/ethereum.js";
3
3
  export declare const chainIds: 31337[];
4
4
  export declare function createAnvilClient(chainId?: number): ReturnType<typeof walletActions> & PublicClient;
5
5
  export declare function deployContract(contractSpec: ContractSpec, args?: ContractArg[], chainId?: number): Promise<Address>;
@@ -1,5 +1,5 @@
1
- import { VlayerClient } from "types/vlayer";
2
- import { WebProofProvider } from "types/webProofProvider";
1
+ import { VlayerClient } from "./types/vlayer.js";
2
+ import { WebProofProvider } from "./types/webProofProvider.js";
3
3
  export declare const createVlayerClient: ({ url, webProofProvider, }?: {
4
4
  url?: string;
5
5
  webProofProvider?: WebProofProvider;
@@ -1,7 +1,7 @@
1
- import { prove } from "../prover";
2
- import { createExtensionWebProofProvider } from "../webProof";
1
+ import { prove } from "../prover.js";
2
+ import { createExtensionWebProofProvider } from "../webProof/index.js";
3
3
  import { decodeFunctionResult } from "viem";
4
- import { ZkProvingStatus } from "../../web-proof-commons";
4
+ import { ZkProvingStatus } from "../../web-proof-commons/index.js";
5
5
  function dropEmptyProofFromArgs(args) {
6
6
  if (Array.isArray(args)) {
7
7
  return args.slice(1);
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, it, vi, beforeEach } from "vitest";
2
- import { createExtensionWebProofProvider } from "../webProof";
3
- import { createVlayerClient } from "./client";
2
+ import { createExtensionWebProofProvider } from "../webProof/index.js";
3
+ import { createVlayerClient } from "./client.js";
4
4
  import { ZkProvingStatus } from "src/web-proof-commons";
5
5
  import createFetchMock from "vitest-fetch-mock";
6
6
  const fetchMocker = createFetchMock(vi);
@@ -1,5 +1,5 @@
1
1
  import { Abi, Address, Hex } from "viem";
2
- import { Branded } from "../../../web-proof-commons";
2
+ import { Branded } from "../../../web-proof-commons/index.js";
3
3
  export type Bytecode = {
4
4
  object: Hex;
5
5
  };
@@ -1,3 +1,3 @@
1
- export * from "./ethereum";
2
- export * from "./vlayer";
3
- export * from "./webProofProvider";
1
+ export * from "./ethereum.js";
2
+ export * from "./vlayer.js";
3
+ export * from "./webProofProvider.js";
@@ -1,3 +1,3 @@
1
- export * from "./ethereum";
2
- export * from "./vlayer";
3
- export * from "./webProofProvider";
1
+ export * from "./ethereum.js";
2
+ export * from "./vlayer.js";
3
+ export * from "./webProofProvider.js";
@@ -1,6 +1,6 @@
1
1
  import { Hex, Abi, ContractFunctionName } from "viem";
2
- import type { ContractFunctionArgsWithout } from "./viem";
3
- import { Branded, WebProof, WebProofStep, ZkProvingStatus } from "../../../web-proof-commons";
2
+ import type { ContractFunctionArgsWithout } from "./viem.js";
3
+ import { Branded, WebProof, WebProofStep, ZkProvingStatus } from "../../../web-proof-commons/index.js";
4
4
  export type WebProofSetupInput = {
5
5
  logoUrl: string;
6
6
  steps: WebProofStep[];
@@ -1,2 +1,2 @@
1
1
  import { type Abi, AbiStateMutability, type Address, ContractFunctionArgs, ContractFunctionName } from "viem";
2
- export declare function prove<T extends Abi, F extends ContractFunctionName<T>>(prover: Address, abi: T, functionName: F, args: ContractFunctionArgs<T, AbiStateMutability, F>, chainId?: number, url?: string): Promise<import("types/vlayer").VCallResponse>;
2
+ export declare function prove<T extends Abi, F extends ContractFunctionName<T>>(prover: Address, abi: T, functionName: F, args: ContractFunctionArgs<T, AbiStateMutability, F>, chainId?: number, url?: string): Promise<import("./lib/types/vlayer.js").VCallResponse>;
@@ -1,5 +1,5 @@
1
1
  import { encodeFunctionData, } from "viem";
2
- import { v_call } from "./v_call";
2
+ import { v_call } from "./v_call.js";
3
3
  import { foundry } from "viem/chains";
4
4
  export async function prove(prover, abi, functionName, args, chainId = foundry.id, url = "http://127.0.0.1:3000") {
5
5
  const calldata = encodeFunctionData({
@@ -1,2 +1,2 @@
1
- import { CallContext, CallParams, VCallResponse } from "types/vlayer";
1
+ import { CallContext, CallParams, VCallResponse } from "./lib/types/vlayer.js";
2
2
  export declare function v_call(call: CallParams, context: CallContext, url?: string): Promise<VCallResponse>;
@@ -1,2 +1,2 @@
1
- import { WebProofSetup, WebProofSetupInput } from "types/webProofProvider";
1
+ import { WebProofSetup, WebProofSetupInput } from "../lib/types/webProofProvider.js";
2
2
  export declare const createWebProof: ({ logoUrl, steps }: WebProofSetupInput) => WebProofSetup;
@@ -1,3 +1,3 @@
1
- export * from "./createWebProof";
2
- export * from "./steps";
3
- export * from "./providers";
1
+ export * from "./createWebProof.js";
2
+ export * from "./steps/index.js";
3
+ export * from "./providers/index.js";
@@ -1,3 +1,3 @@
1
- export * from "./createWebProof";
2
- export * from "./steps";
3
- export * from "./providers";
1
+ export * from "./createWebProof.js";
2
+ export * from "./steps/index.js";
3
+ export * from "./providers/index.js";
@@ -1,2 +1,2 @@
1
- import { type WebProofProvider, type WebProofProviderSetup } from "../../lib/types/webProofProvider";
1
+ import { type WebProofProvider, type WebProofProviderSetup } from "../../lib/types/webProofProvider.js";
2
2
  export declare const createExtensionWebProofProvider: ({ notaryUrl, wsProxyUrl, }?: WebProofProviderSetup) => WebProofProvider;
@@ -1,4 +1,4 @@
1
- import { ExtensionMessageType, } from "../../../web-proof-commons";
1
+ import { ExtensionMessageType, } from "../../../web-proof-commons/index.js";
2
2
  // this id is fixed in the extension by the key in manifest.json
3
3
  const EXTENSION_ID = "jbchhcgphfokabmfacnkafoeeeppjmpl";
4
4
  class ExtensionWebProofProvider {
@@ -1 +1 @@
1
- export * from "./extension";
1
+ export * from "./extension.js";
@@ -1 +1 @@
1
- export * from "./extension";
1
+ export * from "./extension.js";
@@ -1,2 +1,2 @@
1
- import { WebProofStepExpectUrl } from "../../../web-proof-commons";
1
+ import { WebProofStepExpectUrl } from "../../../web-proof-commons/index.js";
2
2
  export declare const expectUrl: (url: string, label: string) => WebProofStepExpectUrl;
@@ -1,4 +1,4 @@
1
- import { EXTENSION_STEP, } from "../../../web-proof-commons";
1
+ import { EXTENSION_STEP, } from "../../../web-proof-commons/index.js";
2
2
  export const expectUrl = (url, label) => {
3
3
  return {
4
4
  url,
@@ -1,9 +1,9 @@
1
- import { expectUrl } from "./expectUrl";
2
- import { startPage } from "./startPage";
3
- import { notarize } from "./notarize";
1
+ import { expectUrl } from "./expectUrl.js";
2
+ import { startPage } from "./startPage.js";
3
+ import { notarize } from "./notarize.js";
4
4
  declare const steps: {
5
- expectUrl: (url: string, label: string) => import("../../../web-proof-commons").WebProofStepExpectUrl;
6
- startPage: (url: string, label: string) => import("../../../web-proof-commons").WebProofStepStartPage;
7
- notarize: (url: string, method: string | undefined, label: string) => import("../../../web-proof-commons").WebProofStepNotarize;
5
+ expectUrl: (url: string, label: string) => import("../../../web-proof-commons/index.js").WebProofStepExpectUrl;
6
+ startPage: (url: string, label: string) => import("../../../web-proof-commons/index.js").WebProofStepStartPage;
7
+ notarize: (url: string, method: string | undefined, label: string) => import("../../../web-proof-commons/index.js").WebProofStepNotarize;
8
8
  };
9
9
  export { expectUrl, startPage, notarize, steps };
@@ -1,6 +1,6 @@
1
- import { expectUrl } from "./expectUrl";
2
- import { startPage } from "./startPage";
3
- import { notarize } from "./notarize";
1
+ import { expectUrl } from "./expectUrl.js";
2
+ import { startPage } from "./startPage.js";
3
+ import { notarize } from "./notarize.js";
4
4
  const steps = {
5
5
  expectUrl,
6
6
  startPage,
@@ -1,2 +1,2 @@
1
- import { WebProofStepNotarize } from "../../../web-proof-commons";
1
+ import { WebProofStepNotarize } from "../../../web-proof-commons/index.js";
2
2
  export declare const notarize: (url: string, method: string | undefined, label: string) => WebProofStepNotarize;
@@ -1,4 +1,4 @@
1
- import { EXTENSION_STEP, } from "../../../web-proof-commons";
1
+ import { EXTENSION_STEP, } from "../../../web-proof-commons/index.js";
2
2
  export const notarize = (url, method = "GET", label) => {
3
3
  return {
4
4
  url,
@@ -1,2 +1,2 @@
1
- import { WebProofStepStartPage } from "../../../web-proof-commons";
1
+ import { WebProofStepStartPage } from "../../../web-proof-commons/index.js";
2
2
  export declare const startPage: (url: string, label: string) => WebProofStepStartPage;
@@ -1,4 +1,4 @@
1
- import { EXTENSION_STEP, } from "../../../web-proof-commons";
1
+ import { EXTENSION_STEP, } from "../../../web-proof-commons/index.js";
2
2
  export const startPage = (url, label) => {
3
3
  return {
4
4
  url,
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export * as testHelpers from "./api/helpers";
2
- export { preverifyEmail } from "./api/email/preverify";
3
- export { createVlayerClient } from "./api/lib/client";
4
- export * from "./api/lib/types";
5
- export * from "./web-proof-commons/types/webProof";
6
- export * from "./web-proof-commons/utils";
1
+ export * as testHelpers from "./api/helpers.js";
2
+ export { preverifyEmail } from "./api/email/preverify.js";
3
+ export { createVlayerClient } from "./api/lib/client.js";
4
+ export * from "./api/lib/types/index.js";
5
+ export * from "./web-proof-commons/types/webProof.js";
6
+ export * from "./web-proof-commons/utils.js";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export * as testHelpers from "./api/helpers";
2
- export { preverifyEmail } from "./api/email/preverify";
3
- export { createVlayerClient } from "./api/lib/client";
4
- export * from "./api/lib/types";
5
- export * from "./web-proof-commons/types/webProof";
6
- export * from "./web-proof-commons/utils";
1
+ export * as testHelpers from "./api/helpers.js";
2
+ export { preverifyEmail } from "./api/email/preverify.js";
3
+ export { createVlayerClient } from "./api/lib/client.js";
4
+ export * from "./api/lib/types/index.js";
5
+ export * from "./web-proof-commons/types/webProof.js";
6
+ export * from "./web-proof-commons/utils.js";
@@ -1,3 +1,3 @@
1
- export * from "./types/message";
2
- export * from "./types/webProof";
3
- export * from "./utils";
1
+ export * from "./types/message.js";
2
+ export * from "./types/webProof.js";
3
+ export * from "./utils.js";
@@ -1,3 +1,3 @@
1
- export * from "./types/message";
2
- export * from "./types/webProof";
3
- export * from "./utils";
1
+ export * from "./types/message.js";
2
+ export * from "./types/webProof.js";
3
+ export * from "./utils.js";
@@ -1,5 +1,5 @@
1
- import type { Branded } from "../utils";
2
- import type { WebProof } from "./webProof";
1
+ import type { Branded } from "../utils.js";
2
+ import type { WebProof } from "./webProof.js";
3
3
  export declare const EXTENSION_STEP: {
4
4
  readonly expectUrl: "expectUrl";
5
5
  readonly startPage: "startPage";
package/package.json CHANGED
@@ -11,9 +11,9 @@
11
11
  "types": "./dist/api/webProof/index.d.ts"
12
12
  }
13
13
  },
14
- "version": "0.1.0-nightly-20241107-c06494b",
14
+ "version": "0.1.0-nightly-20241108-356ce8d",
15
15
  "scripts": {
16
- "build": "bun tsc",
16
+ "build": "bun tsc && bun tsc-alias",
17
17
  "test:unit": "vitest --run",
18
18
  "gen:types": "sh ../../bash/build_ts_types.sh",
19
19
  "replaceCommonsSymlink": "mv ./src/web-proof-commons ./src/web-proof-commons.bak && cp -r $(readlink -f ./src/web-proof-commons.bak) src/web-proof-commons && rm ./src/web-proof-commons.bak"
@@ -29,11 +29,12 @@
29
29
  "typescript": "^5.6.3"
30
30
  },
31
31
  "dependencies": {
32
+ "@vitejs/plugin-react": "^4.3.2",
32
33
  "dns-over-http-resolver": "^3.0.3",
33
34
  "postal-mime": "^2.3.2",
35
+ "tsc-alias": "^1.8.10",
34
36
  "viem": "2.21.0",
35
- "vite-tsconfig-paths": "^5.0.1",
36
- "@vitejs/plugin-react": "^4.3.2"
37
+ "vite-tsconfig-paths": "^5.0.1"
37
38
  },
38
39
  "files": [
39
40
  "dist/",