@opendatalabs/vana-sdk 3.5.1 → 3.6.1
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.
- package/README.md +116 -0
- package/dist/direct/access-request-client.cjs +149 -0
- package/dist/direct/access-request-client.cjs.map +1 -0
- package/dist/direct/access-request-client.d.ts +66 -0
- package/dist/direct/access-request-client.js +123 -0
- package/dist/direct/access-request-client.js.map +1 -0
- package/dist/direct/access-request-client.test.d.ts +1 -0
- package/dist/direct/connect-flow.cjs +152 -0
- package/dist/direct/connect-flow.cjs.map +1 -0
- package/dist/direct/connect-flow.d.ts +85 -0
- package/dist/direct/connect-flow.js +128 -0
- package/dist/direct/connect-flow.js.map +1 -0
- package/dist/direct/connect-flow.test.d.ts +1 -0
- package/dist/direct/controller.cjs +131 -0
- package/dist/direct/controller.cjs.map +1 -0
- package/dist/direct/controller.d.ts +152 -0
- package/dist/direct/controller.js +111 -0
- package/dist/direct/controller.js.map +1 -0
- package/dist/direct/controller.test.d.ts +1 -0
- package/dist/direct/endpoints.cjs +45 -0
- package/dist/direct/endpoints.cjs.map +1 -0
- package/dist/direct/endpoints.d.ts +22 -0
- package/dist/direct/endpoints.js +19 -0
- package/dist/direct/endpoints.js.map +1 -0
- package/dist/direct/errors.cjs +65 -0
- package/dist/direct/errors.cjs.map +1 -0
- package/dist/direct/errors.d.ts +44 -0
- package/dist/direct/errors.js +38 -0
- package/dist/direct/errors.js.map +1 -0
- package/dist/direct/escrow-payment.cjs +96 -0
- package/dist/direct/escrow-payment.cjs.map +1 -0
- package/dist/direct/escrow-payment.d.ts +81 -0
- package/dist/direct/escrow-payment.js +72 -0
- package/dist/direct/escrow-payment.js.map +1 -0
- package/dist/direct/escrow-payment.test.d.ts +1 -0
- package/dist/direct/personal-server-read.cjs +149 -0
- package/dist/direct/personal-server-read.cjs.map +1 -0
- package/dist/direct/personal-server-read.d.ts +103 -0
- package/dist/direct/personal-server-read.js +124 -0
- package/dist/direct/personal-server-read.js.map +1 -0
- package/dist/direct/personal-server-read.test.d.ts +1 -0
- package/dist/direct/types.cjs +35 -0
- package/dist/direct/types.cjs.map +1 -0
- package/dist/direct/types.d.ts +205 -0
- package/dist/direct/types.js +11 -0
- package/dist/direct/types.js.map +1 -0
- package/dist/direct/use-direct-vana-connect.cjs +68 -0
- package/dist/direct/use-direct-vana-connect.cjs.map +1 -0
- package/dist/direct/use-direct-vana-connect.d.ts +45 -0
- package/dist/direct/use-direct-vana-connect.js +46 -0
- package/dist/direct/use-direct-vana-connect.js.map +1 -0
- package/dist/index.browser.d.ts +7 -3
- package/dist/index.browser.js +438 -157
- package/dist/index.browser.js.map +4 -4
- package/dist/index.node.cjs +461 -162
- package/dist/index.node.cjs.map +4 -4
- package/dist/index.node.d.ts +7 -3
- package/dist/index.node.js +438 -157
- package/dist/index.node.js.map +4 -4
- package/dist/protocol/data-point-status.cjs +80 -0
- package/dist/protocol/data-point-status.cjs.map +1 -0
- package/dist/protocol/data-point-status.d.ts +34 -0
- package/dist/protocol/data-point-status.js +51 -0
- package/dist/protocol/data-point-status.js.map +1 -0
- package/dist/protocol/data-point-status.test.d.ts +1 -0
- package/dist/protocol/eip712.cjs +53 -31
- package/dist/protocol/eip712.cjs.map +1 -1
- package/dist/protocol/eip712.d.ts +98 -43
- package/dist/protocol/eip712.js +47 -27
- package/dist/protocol/eip712.js.map +1 -1
- package/dist/protocol/escrow-deposit.cjs +89 -0
- package/dist/protocol/escrow-deposit.cjs.map +1 -0
- package/dist/protocol/escrow-deposit.d.ts +47 -0
- package/dist/protocol/escrow-deposit.js +60 -0
- package/dist/protocol/escrow-deposit.js.map +1 -0
- package/dist/protocol/escrow-deposit.test.d.ts +1 -0
- package/dist/protocol/escrow-flow.test.d.ts +21 -0
- package/dist/protocol/fee-registry.cjs +116 -0
- package/dist/protocol/fee-registry.cjs.map +1 -0
- package/dist/protocol/fee-registry.d.ts +151 -0
- package/dist/protocol/fee-registry.js +89 -0
- package/dist/protocol/fee-registry.js.map +1 -0
- package/dist/protocol/fee-registry.test.d.ts +1 -0
- package/dist/protocol/gateway.cjs +107 -37
- package/dist/protocol/gateway.cjs.map +1 -1
- package/dist/protocol/gateway.d.ts +223 -57
- package/dist/protocol/gateway.js +107 -37
- package/dist/protocol/gateway.js.map +1 -1
- package/dist/protocol/grants.cjs +27 -64
- package/dist/protocol/grants.cjs.map +1 -1
- package/dist/protocol/grants.d.ts +6 -13
- package/dist/protocol/grants.js +27 -63
- package/dist/protocol/grants.js.map +1 -1
- package/dist/protocol/personal-server-data.cjs +71 -0
- package/dist/protocol/personal-server-data.cjs.map +1 -0
- package/dist/protocol/personal-server-data.d.ts +16 -0
- package/dist/protocol/personal-server-data.js +47 -0
- package/dist/protocol/personal-server-data.js.map +1 -0
- package/dist/protocol/personal-server-data.test.d.ts +1 -0
- package/dist/protocol/personal-server-lite-owner-binding.cjs +93 -0
- package/dist/protocol/personal-server-lite-owner-binding.cjs.map +1 -0
- package/dist/protocol/personal-server-lite-owner-binding.d.ts +44 -0
- package/dist/protocol/personal-server-lite-owner-binding.js +65 -0
- package/dist/protocol/personal-server-lite-owner-binding.js.map +1 -0
- package/dist/protocol/personal-server-lite-owner-binding.test.d.ts +1 -0
- package/dist/react.cjs +32 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.ts +33 -0
- package/dist/react.js +11 -0
- package/dist/react.js.map +1 -0
- package/dist/server.cjs +73 -0
- package/dist/server.cjs.map +1 -0
- package/dist/server.d.ts +32 -0
- package/dist/server.js +55 -0
- package/dist/server.js.map +1 -0
- package/package.json +20 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/protocol/personal-server-data.ts"],"sourcesContent":["import {\n buildWeb3SignedHeader,\n type Web3SignedSignFn,\n} from \"../auth/web3-signed-builder\";\nimport { DataFileEnvelopeSchema, type DataFileEnvelope } from \"./data-file\";\n\nexport interface BuildPersonalServerDataReadRequestParams {\n personalServerUrl: string;\n scope: string;\n grantId: string;\n signMessage: Web3SignedSignFn;\n audience?: string;\n headers?: HeadersInit;\n}\n\nexport interface ReadPersonalServerDataParams extends BuildPersonalServerDataReadRequestParams {\n fetch?: typeof fetch;\n}\n\nexport function personalServerDataReadPath(scope: string): string {\n return `/v1/data/${encodeURIComponent(scope)}`;\n}\n\nexport async function buildPersonalServerDataReadRequest(\n params: BuildPersonalServerDataReadRequestParams,\n): Promise<Request> {\n const path = personalServerDataReadPath(params.scope);\n const baseUrl = params.personalServerUrl.replace(/\\/+$/, \"\");\n const audience = params.audience ?? baseUrl;\n const headers = new Headers(params.headers);\n\n headers.set(\n \"Authorization\",\n await buildWeb3SignedHeader({\n aud: audience,\n grantId: params.grantId,\n method: \"GET\",\n signMessage: params.signMessage,\n uri: path,\n }),\n );\n\n return new Request(`${baseUrl}${path}`, {\n headers,\n method: \"GET\",\n });\n}\n\nexport async function readPersonalServerData(\n params: ReadPersonalServerDataParams,\n): Promise<DataFileEnvelope> {\n const fetchFn = params.fetch ?? globalThis.fetch;\n if (fetchFn === undefined) {\n throw new Error(\"No fetch implementation available\");\n }\n\n const request = await buildPersonalServerDataReadRequest(params);\n const response = await fetchFn(request);\n\n if (!response.ok) {\n throw new Error(\n `Personal Server data read failed: ${response.status} ${response.statusText}`,\n );\n }\n\n return DataFileEnvelopeSchema.parse(await response.json());\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAGO;AACP,uBAA8D;AAevD,SAAS,2BAA2B,OAAuB;AAChE,SAAO,YAAY,mBAAmB,KAAK,CAAC;AAC9C;AAEA,eAAsB,mCACpB,QACkB;AAClB,QAAM,OAAO,2BAA2B,OAAO,KAAK;AACpD,QAAM,UAAU,OAAO,kBAAkB,QAAQ,QAAQ,EAAE;AAC3D,QAAM,WAAW,OAAO,YAAY;AACpC,QAAM,UAAU,IAAI,QAAQ,OAAO,OAAO;AAE1C,UAAQ;AAAA,IACN;AAAA,IACA,UAAM,kDAAsB;AAAA,MAC1B,KAAK;AAAA,MACL,SAAS,OAAO;AAAA,MAChB,QAAQ;AAAA,MACR,aAAa,OAAO;AAAA,MACpB,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,SAAO,IAAI,QAAQ,GAAG,OAAO,GAAG,IAAI,IAAI;AAAA,IACtC;AAAA,IACA,QAAQ;AAAA,EACV,CAAC;AACH;AAEA,eAAsB,uBACpB,QAC2B;AAC3B,QAAM,UAAU,OAAO,SAAS,WAAW;AAC3C,MAAI,YAAY,QAAW;AACzB,UAAM,IAAI,MAAM,mCAAmC;AAAA,EACrD;AAEA,QAAM,UAAU,MAAM,mCAAmC,MAAM;AAC/D,QAAM,WAAW,MAAM,QAAQ,OAAO;AAEtC,MAAI,CAAC,SAAS,IAAI;AAChB,UAAM,IAAI;AAAA,MACR,qCAAqC,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,IAC7E;AAAA,EACF;AAEA,SAAO,wCAAuB,MAAM,MAAM,SAAS,KAAK,CAAC;AAC3D;","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Web3SignedSignFn } from "../auth/web3-signed-builder";
|
|
2
|
+
import { type DataFileEnvelope } from "./data-file";
|
|
3
|
+
export interface BuildPersonalServerDataReadRequestParams {
|
|
4
|
+
personalServerUrl: string;
|
|
5
|
+
scope: string;
|
|
6
|
+
grantId: string;
|
|
7
|
+
signMessage: Web3SignedSignFn;
|
|
8
|
+
audience?: string;
|
|
9
|
+
headers?: HeadersInit;
|
|
10
|
+
}
|
|
11
|
+
export interface ReadPersonalServerDataParams extends BuildPersonalServerDataReadRequestParams {
|
|
12
|
+
fetch?: typeof fetch;
|
|
13
|
+
}
|
|
14
|
+
export declare function personalServerDataReadPath(scope: string): string;
|
|
15
|
+
export declare function buildPersonalServerDataReadRequest(params: BuildPersonalServerDataReadRequestParams): Promise<Request>;
|
|
16
|
+
export declare function readPersonalServerData(params: ReadPersonalServerDataParams): Promise<DataFileEnvelope>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildWeb3SignedHeader
|
|
3
|
+
} from "../auth/web3-signed-builder.js";
|
|
4
|
+
import { DataFileEnvelopeSchema } from "./data-file.js";
|
|
5
|
+
function personalServerDataReadPath(scope) {
|
|
6
|
+
return `/v1/data/${encodeURIComponent(scope)}`;
|
|
7
|
+
}
|
|
8
|
+
async function buildPersonalServerDataReadRequest(params) {
|
|
9
|
+
const path = personalServerDataReadPath(params.scope);
|
|
10
|
+
const baseUrl = params.personalServerUrl.replace(/\/+$/, "");
|
|
11
|
+
const audience = params.audience ?? baseUrl;
|
|
12
|
+
const headers = new Headers(params.headers);
|
|
13
|
+
headers.set(
|
|
14
|
+
"Authorization",
|
|
15
|
+
await buildWeb3SignedHeader({
|
|
16
|
+
aud: audience,
|
|
17
|
+
grantId: params.grantId,
|
|
18
|
+
method: "GET",
|
|
19
|
+
signMessage: params.signMessage,
|
|
20
|
+
uri: path
|
|
21
|
+
})
|
|
22
|
+
);
|
|
23
|
+
return new Request(`${baseUrl}${path}`, {
|
|
24
|
+
headers,
|
|
25
|
+
method: "GET"
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
async function readPersonalServerData(params) {
|
|
29
|
+
const fetchFn = params.fetch ?? globalThis.fetch;
|
|
30
|
+
if (fetchFn === void 0) {
|
|
31
|
+
throw new Error("No fetch implementation available");
|
|
32
|
+
}
|
|
33
|
+
const request = await buildPersonalServerDataReadRequest(params);
|
|
34
|
+
const response = await fetchFn(request);
|
|
35
|
+
if (!response.ok) {
|
|
36
|
+
throw new Error(
|
|
37
|
+
`Personal Server data read failed: ${response.status} ${response.statusText}`
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
return DataFileEnvelopeSchema.parse(await response.json());
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
buildPersonalServerDataReadRequest,
|
|
44
|
+
personalServerDataReadPath,
|
|
45
|
+
readPersonalServerData
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=personal-server-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/protocol/personal-server-data.ts"],"sourcesContent":["import {\n buildWeb3SignedHeader,\n type Web3SignedSignFn,\n} from \"../auth/web3-signed-builder\";\nimport { DataFileEnvelopeSchema, type DataFileEnvelope } from \"./data-file\";\n\nexport interface BuildPersonalServerDataReadRequestParams {\n personalServerUrl: string;\n scope: string;\n grantId: string;\n signMessage: Web3SignedSignFn;\n audience?: string;\n headers?: HeadersInit;\n}\n\nexport interface ReadPersonalServerDataParams extends BuildPersonalServerDataReadRequestParams {\n fetch?: typeof fetch;\n}\n\nexport function personalServerDataReadPath(scope: string): string {\n return `/v1/data/${encodeURIComponent(scope)}`;\n}\n\nexport async function buildPersonalServerDataReadRequest(\n params: BuildPersonalServerDataReadRequestParams,\n): Promise<Request> {\n const path = personalServerDataReadPath(params.scope);\n const baseUrl = params.personalServerUrl.replace(/\\/+$/, \"\");\n const audience = params.audience ?? baseUrl;\n const headers = new Headers(params.headers);\n\n headers.set(\n \"Authorization\",\n await buildWeb3SignedHeader({\n aud: audience,\n grantId: params.grantId,\n method: \"GET\",\n signMessage: params.signMessage,\n uri: path,\n }),\n );\n\n return new Request(`${baseUrl}${path}`, {\n headers,\n method: \"GET\",\n });\n}\n\nexport async function readPersonalServerData(\n params: ReadPersonalServerDataParams,\n): Promise<DataFileEnvelope> {\n const fetchFn = params.fetch ?? globalThis.fetch;\n if (fetchFn === undefined) {\n throw new Error(\"No fetch implementation available\");\n }\n\n const request = await buildPersonalServerDataReadRequest(params);\n const response = await fetchFn(request);\n\n if (!response.ok) {\n throw new Error(\n `Personal Server data read failed: ${response.status} ${response.statusText}`,\n );\n }\n\n return DataFileEnvelopeSchema.parse(await response.json());\n}\n"],"mappings":"AAAA;AAAA,EACE;AAAA,OAEK;AACP,SAAS,8BAAqD;AAevD,SAAS,2BAA2B,OAAuB;AAChE,SAAO,YAAY,mBAAmB,KAAK,CAAC;AAC9C;AAEA,eAAsB,mCACpB,QACkB;AAClB,QAAM,OAAO,2BAA2B,OAAO,KAAK;AACpD,QAAM,UAAU,OAAO,kBAAkB,QAAQ,QAAQ,EAAE;AAC3D,QAAM,WAAW,OAAO,YAAY;AACpC,QAAM,UAAU,IAAI,QAAQ,OAAO,OAAO;AAE1C,UAAQ;AAAA,IACN;AAAA,IACA,MAAM,sBAAsB;AAAA,MAC1B,KAAK;AAAA,MACL,SAAS,OAAO;AAAA,MAChB,QAAQ;AAAA,MACR,aAAa,OAAO;AAAA,MACpB,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,SAAO,IAAI,QAAQ,GAAG,OAAO,GAAG,IAAI,IAAI;AAAA,IACtC;AAAA,IACA,QAAQ;AAAA,EACV,CAAC;AACH;AAEA,eAAsB,uBACpB,QAC2B;AAC3B,QAAM,UAAU,OAAO,SAAS,WAAW;AAC3C,MAAI,YAAY,QAAW;AACzB,UAAM,IAAI,MAAM,mCAAmC;AAAA,EACrD;AAEA,QAAM,UAAU,MAAM,mCAAmC,MAAM;AAC/D,QAAM,WAAW,MAAM,QAAQ,OAAO;AAEtC,MAAI,CAAC,SAAS,IAAI;AAChB,UAAM,IAAI;AAAA,MACR,qCAAqC,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,IAC7E;AAAA,EACF;AAEA,SAAO,uBAAuB,MAAM,MAAM,SAAS,KAAK,CAAC;AAC3D;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var personal_server_lite_owner_binding_exports = {};
|
|
20
|
+
__export(personal_server_lite_owner_binding_exports, {
|
|
21
|
+
PERSONAL_SERVER_LITE_OWNER_BINDING_PREFIX: () => PERSONAL_SERVER_LITE_OWNER_BINDING_PREFIX,
|
|
22
|
+
PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE: () => PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE,
|
|
23
|
+
PERSONAL_SERVER_LITE_OWNER_BINDING_VERSION: () => PERSONAL_SERVER_LITE_OWNER_BINDING_VERSION,
|
|
24
|
+
buildPersonalServerLiteOwnerBindingMessage: () => buildPersonalServerLiteOwnerBindingMessage,
|
|
25
|
+
buildPersonalServerLiteOwnerBindingSignature: () => buildPersonalServerLiteOwnerBindingSignature,
|
|
26
|
+
createViemPersonalServerLiteOwnerBindingSigner: () => createViemPersonalServerLiteOwnerBindingSigner,
|
|
27
|
+
signPersonalServerLiteOwnerBinding: () => signPersonalServerLiteOwnerBinding
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(personal_server_lite_owner_binding_exports);
|
|
30
|
+
var import_viem = require("viem");
|
|
31
|
+
const PERSONAL_SERVER_LITE_OWNER_BINDING_VERSION = "vana.account.v1";
|
|
32
|
+
const PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE = "ps-lite-owner";
|
|
33
|
+
const PERSONAL_SERVER_LITE_OWNER_BINDING_PREFIX = `${PERSONAL_SERVER_LITE_OWNER_BINDING_VERSION}:${PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE}:`;
|
|
34
|
+
function assertAddress(value, name) {
|
|
35
|
+
if (!(0, import_viem.isAddress)(value)) {
|
|
36
|
+
throw new Error(`${name} must be a valid EVM address`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function getAccountAddress(account) {
|
|
40
|
+
if (!account) {
|
|
41
|
+
return void 0;
|
|
42
|
+
}
|
|
43
|
+
return typeof account === "string" ? account : account.address;
|
|
44
|
+
}
|
|
45
|
+
function isPersonalServerLiteOwnerBindingSigner(source) {
|
|
46
|
+
return "address" in source && typeof source.signMessage === "function";
|
|
47
|
+
}
|
|
48
|
+
function buildPersonalServerLiteOwnerBindingMessage(ownerAddress) {
|
|
49
|
+
assertAddress(ownerAddress, "ownerAddress");
|
|
50
|
+
return `${PERSONAL_SERVER_LITE_OWNER_BINDING_PREFIX}${ownerAddress.toLowerCase()}`;
|
|
51
|
+
}
|
|
52
|
+
function createViemPersonalServerLiteOwnerBindingSigner(source, options = {}) {
|
|
53
|
+
if (isPersonalServerLiteOwnerBindingSigner(source)) {
|
|
54
|
+
return source;
|
|
55
|
+
}
|
|
56
|
+
const accountAddress = getAccountAddress(options.account) ?? getAccountAddress(source.account);
|
|
57
|
+
if (accountAddress) {
|
|
58
|
+
return {
|
|
59
|
+
address: accountAddress,
|
|
60
|
+
signMessage: ({ message }) => source.signMessage({
|
|
61
|
+
account: options.account ?? source.account ?? accountAddress,
|
|
62
|
+
message
|
|
63
|
+
})
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
throw new Error(
|
|
67
|
+
"Viem wallet client requires an account option or account property"
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
async function buildPersonalServerLiteOwnerBindingSignature(input) {
|
|
71
|
+
const message = buildPersonalServerLiteOwnerBindingMessage(
|
|
72
|
+
input.signer.address
|
|
73
|
+
);
|
|
74
|
+
const signature = await input.signer.signMessage({ message });
|
|
75
|
+
return {
|
|
76
|
+
signature,
|
|
77
|
+
signerAddress: input.signer.address,
|
|
78
|
+
message,
|
|
79
|
+
purpose: PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const signPersonalServerLiteOwnerBinding = buildPersonalServerLiteOwnerBindingSignature;
|
|
83
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
84
|
+
0 && (module.exports = {
|
|
85
|
+
PERSONAL_SERVER_LITE_OWNER_BINDING_PREFIX,
|
|
86
|
+
PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE,
|
|
87
|
+
PERSONAL_SERVER_LITE_OWNER_BINDING_VERSION,
|
|
88
|
+
buildPersonalServerLiteOwnerBindingMessage,
|
|
89
|
+
buildPersonalServerLiteOwnerBindingSignature,
|
|
90
|
+
createViemPersonalServerLiteOwnerBindingSigner,
|
|
91
|
+
signPersonalServerLiteOwnerBinding
|
|
92
|
+
});
|
|
93
|
+
//# sourceMappingURL=personal-server-lite-owner-binding.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/protocol/personal-server-lite-owner-binding.ts"],"sourcesContent":["/**\n * PS Lite owner-binding message and signing helpers.\n *\n * PS Lite uses this replayable personal-sign message as a wallet-owned input\n * for opening the user's local encrypted runtime. This is intentionally\n * separate from Personal Server registration, which is EIP-712 typed data.\n *\n * @category Protocol\n */\n\nimport {\n isAddress,\n type Account,\n type Address,\n type Hex,\n type SignableMessage,\n} from \"viem\";\n\nexport const PERSONAL_SERVER_LITE_OWNER_BINDING_VERSION = \"vana.account.v1\";\nexport const PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE = \"ps-lite-owner\";\nexport const PERSONAL_SERVER_LITE_OWNER_BINDING_PREFIX =\n `${PERSONAL_SERVER_LITE_OWNER_BINDING_VERSION}:${PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE}:` as const;\n\nexport type PersonalServerLiteOwnerBindingPurpose =\n typeof PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE;\n\nexport type PersonalServerLiteOwnerBindingMessage =\n `${typeof PERSONAL_SERVER_LITE_OWNER_BINDING_PREFIX}${Lowercase<Address>}`;\n\nexport interface PersonalServerLiteOwnerBindingSigner {\n address: Address;\n signMessage(input: {\n message: PersonalServerLiteOwnerBindingMessage;\n }): Promise<Hex> | Hex;\n}\n\nexport interface ViemPersonalServerLiteOwnerBindingWalletClient {\n account?: Account | Address | null;\n signMessage(input: {\n account?: Account | Address;\n message: SignableMessage;\n }): Promise<Hex>;\n}\n\nexport type ViemPersonalServerLiteOwnerBindingSignerSource =\n | PersonalServerLiteOwnerBindingSigner\n | ViemPersonalServerLiteOwnerBindingWalletClient;\n\nexport interface BuildPersonalServerLiteOwnerBindingSignatureInput {\n signer: PersonalServerLiteOwnerBindingSigner;\n}\n\nexport interface PersonalServerLiteOwnerBindingSignature {\n signature: Hex;\n signerAddress: Address;\n message: PersonalServerLiteOwnerBindingMessage;\n purpose: PersonalServerLiteOwnerBindingPurpose;\n}\n\nfunction assertAddress(value: Address, name: string): void {\n if (!isAddress(value)) {\n throw new Error(`${name} must be a valid EVM address`);\n }\n}\n\nfunction getAccountAddress(\n account: Account | Address | null | undefined,\n): Address | undefined {\n if (!account) {\n return undefined;\n }\n\n return typeof account === \"string\" ? account : account.address;\n}\n\nfunction isPersonalServerLiteOwnerBindingSigner(\n source: ViemPersonalServerLiteOwnerBindingSignerSource,\n): source is PersonalServerLiteOwnerBindingSigner {\n return \"address\" in source && typeof source.signMessage === \"function\";\n}\n\nexport function buildPersonalServerLiteOwnerBindingMessage(\n ownerAddress: Address,\n): PersonalServerLiteOwnerBindingMessage {\n assertAddress(ownerAddress, \"ownerAddress\");\n return `${PERSONAL_SERVER_LITE_OWNER_BINDING_PREFIX}${ownerAddress.toLowerCase()}` as PersonalServerLiteOwnerBindingMessage;\n}\n\nexport function createViemPersonalServerLiteOwnerBindingSigner(\n source: ViemPersonalServerLiteOwnerBindingSignerSource,\n options: { account?: Account | Address } = {},\n): PersonalServerLiteOwnerBindingSigner {\n if (isPersonalServerLiteOwnerBindingSigner(source)) {\n return source;\n }\n\n const accountAddress =\n getAccountAddress(options.account) ?? getAccountAddress(source.account);\n\n if (accountAddress) {\n return {\n address: accountAddress,\n signMessage: ({ message }) =>\n source.signMessage({\n account: options.account ?? source.account ?? accountAddress,\n message,\n }),\n };\n }\n\n throw new Error(\n \"Viem wallet client requires an account option or account property\",\n );\n}\n\nexport async function buildPersonalServerLiteOwnerBindingSignature(\n input: BuildPersonalServerLiteOwnerBindingSignatureInput,\n): Promise<PersonalServerLiteOwnerBindingSignature> {\n const message = buildPersonalServerLiteOwnerBindingMessage(\n input.signer.address,\n );\n const signature = await input.signer.signMessage({ message });\n\n return {\n signature,\n signerAddress: input.signer.address,\n message,\n purpose: PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE,\n };\n}\n\nexport const signPersonalServerLiteOwnerBinding =\n buildPersonalServerLiteOwnerBindingSignature;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,kBAMO;AAEA,MAAM,6CAA6C;AACnD,MAAM,6CAA6C;AACnD,MAAM,4CACX,GAAG,0CAA0C,IAAI,0CAA0C;AAsC7F,SAAS,cAAc,OAAgB,MAAoB;AACzD,MAAI,KAAC,uBAAU,KAAK,GAAG;AACrB,UAAM,IAAI,MAAM,GAAG,IAAI,8BAA8B;AAAA,EACvD;AACF;AAEA,SAAS,kBACP,SACqB;AACrB,MAAI,CAAC,SAAS;AACZ,WAAO;AAAA,EACT;AAEA,SAAO,OAAO,YAAY,WAAW,UAAU,QAAQ;AACzD;AAEA,SAAS,uCACP,QACgD;AAChD,SAAO,aAAa,UAAU,OAAO,OAAO,gBAAgB;AAC9D;AAEO,SAAS,2CACd,cACuC;AACvC,gBAAc,cAAc,cAAc;AAC1C,SAAO,GAAG,yCAAyC,GAAG,aAAa,YAAY,CAAC;AAClF;AAEO,SAAS,+CACd,QACA,UAA2C,CAAC,GACN;AACtC,MAAI,uCAAuC,MAAM,GAAG;AAClD,WAAO;AAAA,EACT;AAEA,QAAM,iBACJ,kBAAkB,QAAQ,OAAO,KAAK,kBAAkB,OAAO,OAAO;AAExE,MAAI,gBAAgB;AAClB,WAAO;AAAA,MACL,SAAS;AAAA,MACT,aAAa,CAAC,EAAE,QAAQ,MACtB,OAAO,YAAY;AAAA,QACjB,SAAS,QAAQ,WAAW,OAAO,WAAW;AAAA,QAC9C;AAAA,MACF,CAAC;AAAA,IACL;AAAA,EACF;AAEA,QAAM,IAAI;AAAA,IACR;AAAA,EACF;AACF;AAEA,eAAsB,6CACpB,OACkD;AAClD,QAAM,UAAU;AAAA,IACd,MAAM,OAAO;AAAA,EACf;AACA,QAAM,YAAY,MAAM,MAAM,OAAO,YAAY,EAAE,QAAQ,CAAC;AAE5D,SAAO;AAAA,IACL;AAAA,IACA,eAAe,MAAM,OAAO;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,EACX;AACF;AAEO,MAAM,qCACX;","names":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PS Lite owner-binding message and signing helpers.
|
|
3
|
+
*
|
|
4
|
+
* PS Lite uses this replayable personal-sign message as a wallet-owned input
|
|
5
|
+
* for opening the user's local encrypted runtime. This is intentionally
|
|
6
|
+
* separate from Personal Server registration, which is EIP-712 typed data.
|
|
7
|
+
*
|
|
8
|
+
* @category Protocol
|
|
9
|
+
*/
|
|
10
|
+
import { type Account, type Address, type Hex, type SignableMessage } from "viem";
|
|
11
|
+
export declare const PERSONAL_SERVER_LITE_OWNER_BINDING_VERSION = "vana.account.v1";
|
|
12
|
+
export declare const PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE = "ps-lite-owner";
|
|
13
|
+
export declare const PERSONAL_SERVER_LITE_OWNER_BINDING_PREFIX: "vana.account.v1:ps-lite-owner:";
|
|
14
|
+
export type PersonalServerLiteOwnerBindingPurpose = typeof PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE;
|
|
15
|
+
export type PersonalServerLiteOwnerBindingMessage = `${typeof PERSONAL_SERVER_LITE_OWNER_BINDING_PREFIX}${Lowercase<Address>}`;
|
|
16
|
+
export interface PersonalServerLiteOwnerBindingSigner {
|
|
17
|
+
address: Address;
|
|
18
|
+
signMessage(input: {
|
|
19
|
+
message: PersonalServerLiteOwnerBindingMessage;
|
|
20
|
+
}): Promise<Hex> | Hex;
|
|
21
|
+
}
|
|
22
|
+
export interface ViemPersonalServerLiteOwnerBindingWalletClient {
|
|
23
|
+
account?: Account | Address | null;
|
|
24
|
+
signMessage(input: {
|
|
25
|
+
account?: Account | Address;
|
|
26
|
+
message: SignableMessage;
|
|
27
|
+
}): Promise<Hex>;
|
|
28
|
+
}
|
|
29
|
+
export type ViemPersonalServerLiteOwnerBindingSignerSource = PersonalServerLiteOwnerBindingSigner | ViemPersonalServerLiteOwnerBindingWalletClient;
|
|
30
|
+
export interface BuildPersonalServerLiteOwnerBindingSignatureInput {
|
|
31
|
+
signer: PersonalServerLiteOwnerBindingSigner;
|
|
32
|
+
}
|
|
33
|
+
export interface PersonalServerLiteOwnerBindingSignature {
|
|
34
|
+
signature: Hex;
|
|
35
|
+
signerAddress: Address;
|
|
36
|
+
message: PersonalServerLiteOwnerBindingMessage;
|
|
37
|
+
purpose: PersonalServerLiteOwnerBindingPurpose;
|
|
38
|
+
}
|
|
39
|
+
export declare function buildPersonalServerLiteOwnerBindingMessage(ownerAddress: Address): PersonalServerLiteOwnerBindingMessage;
|
|
40
|
+
export declare function createViemPersonalServerLiteOwnerBindingSigner(source: ViemPersonalServerLiteOwnerBindingSignerSource, options?: {
|
|
41
|
+
account?: Account | Address;
|
|
42
|
+
}): PersonalServerLiteOwnerBindingSigner;
|
|
43
|
+
export declare function buildPersonalServerLiteOwnerBindingSignature(input: BuildPersonalServerLiteOwnerBindingSignatureInput): Promise<PersonalServerLiteOwnerBindingSignature>;
|
|
44
|
+
export declare const signPersonalServerLiteOwnerBinding: typeof buildPersonalServerLiteOwnerBindingSignature;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isAddress
|
|
3
|
+
} from "viem";
|
|
4
|
+
const PERSONAL_SERVER_LITE_OWNER_BINDING_VERSION = "vana.account.v1";
|
|
5
|
+
const PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE = "ps-lite-owner";
|
|
6
|
+
const PERSONAL_SERVER_LITE_OWNER_BINDING_PREFIX = `${PERSONAL_SERVER_LITE_OWNER_BINDING_VERSION}:${PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE}:`;
|
|
7
|
+
function assertAddress(value, name) {
|
|
8
|
+
if (!isAddress(value)) {
|
|
9
|
+
throw new Error(`${name} must be a valid EVM address`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function getAccountAddress(account) {
|
|
13
|
+
if (!account) {
|
|
14
|
+
return void 0;
|
|
15
|
+
}
|
|
16
|
+
return typeof account === "string" ? account : account.address;
|
|
17
|
+
}
|
|
18
|
+
function isPersonalServerLiteOwnerBindingSigner(source) {
|
|
19
|
+
return "address" in source && typeof source.signMessage === "function";
|
|
20
|
+
}
|
|
21
|
+
function buildPersonalServerLiteOwnerBindingMessage(ownerAddress) {
|
|
22
|
+
assertAddress(ownerAddress, "ownerAddress");
|
|
23
|
+
return `${PERSONAL_SERVER_LITE_OWNER_BINDING_PREFIX}${ownerAddress.toLowerCase()}`;
|
|
24
|
+
}
|
|
25
|
+
function createViemPersonalServerLiteOwnerBindingSigner(source, options = {}) {
|
|
26
|
+
if (isPersonalServerLiteOwnerBindingSigner(source)) {
|
|
27
|
+
return source;
|
|
28
|
+
}
|
|
29
|
+
const accountAddress = getAccountAddress(options.account) ?? getAccountAddress(source.account);
|
|
30
|
+
if (accountAddress) {
|
|
31
|
+
return {
|
|
32
|
+
address: accountAddress,
|
|
33
|
+
signMessage: ({ message }) => source.signMessage({
|
|
34
|
+
account: options.account ?? source.account ?? accountAddress,
|
|
35
|
+
message
|
|
36
|
+
})
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
throw new Error(
|
|
40
|
+
"Viem wallet client requires an account option or account property"
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
async function buildPersonalServerLiteOwnerBindingSignature(input) {
|
|
44
|
+
const message = buildPersonalServerLiteOwnerBindingMessage(
|
|
45
|
+
input.signer.address
|
|
46
|
+
);
|
|
47
|
+
const signature = await input.signer.signMessage({ message });
|
|
48
|
+
return {
|
|
49
|
+
signature,
|
|
50
|
+
signerAddress: input.signer.address,
|
|
51
|
+
message,
|
|
52
|
+
purpose: PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const signPersonalServerLiteOwnerBinding = buildPersonalServerLiteOwnerBindingSignature;
|
|
56
|
+
export {
|
|
57
|
+
PERSONAL_SERVER_LITE_OWNER_BINDING_PREFIX,
|
|
58
|
+
PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE,
|
|
59
|
+
PERSONAL_SERVER_LITE_OWNER_BINDING_VERSION,
|
|
60
|
+
buildPersonalServerLiteOwnerBindingMessage,
|
|
61
|
+
buildPersonalServerLiteOwnerBindingSignature,
|
|
62
|
+
createViemPersonalServerLiteOwnerBindingSigner,
|
|
63
|
+
signPersonalServerLiteOwnerBinding
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=personal-server-lite-owner-binding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/protocol/personal-server-lite-owner-binding.ts"],"sourcesContent":["/**\n * PS Lite owner-binding message and signing helpers.\n *\n * PS Lite uses this replayable personal-sign message as a wallet-owned input\n * for opening the user's local encrypted runtime. This is intentionally\n * separate from Personal Server registration, which is EIP-712 typed data.\n *\n * @category Protocol\n */\n\nimport {\n isAddress,\n type Account,\n type Address,\n type Hex,\n type SignableMessage,\n} from \"viem\";\n\nexport const PERSONAL_SERVER_LITE_OWNER_BINDING_VERSION = \"vana.account.v1\";\nexport const PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE = \"ps-lite-owner\";\nexport const PERSONAL_SERVER_LITE_OWNER_BINDING_PREFIX =\n `${PERSONAL_SERVER_LITE_OWNER_BINDING_VERSION}:${PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE}:` as const;\n\nexport type PersonalServerLiteOwnerBindingPurpose =\n typeof PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE;\n\nexport type PersonalServerLiteOwnerBindingMessage =\n `${typeof PERSONAL_SERVER_LITE_OWNER_BINDING_PREFIX}${Lowercase<Address>}`;\n\nexport interface PersonalServerLiteOwnerBindingSigner {\n address: Address;\n signMessage(input: {\n message: PersonalServerLiteOwnerBindingMessage;\n }): Promise<Hex> | Hex;\n}\n\nexport interface ViemPersonalServerLiteOwnerBindingWalletClient {\n account?: Account | Address | null;\n signMessage(input: {\n account?: Account | Address;\n message: SignableMessage;\n }): Promise<Hex>;\n}\n\nexport type ViemPersonalServerLiteOwnerBindingSignerSource =\n | PersonalServerLiteOwnerBindingSigner\n | ViemPersonalServerLiteOwnerBindingWalletClient;\n\nexport interface BuildPersonalServerLiteOwnerBindingSignatureInput {\n signer: PersonalServerLiteOwnerBindingSigner;\n}\n\nexport interface PersonalServerLiteOwnerBindingSignature {\n signature: Hex;\n signerAddress: Address;\n message: PersonalServerLiteOwnerBindingMessage;\n purpose: PersonalServerLiteOwnerBindingPurpose;\n}\n\nfunction assertAddress(value: Address, name: string): void {\n if (!isAddress(value)) {\n throw new Error(`${name} must be a valid EVM address`);\n }\n}\n\nfunction getAccountAddress(\n account: Account | Address | null | undefined,\n): Address | undefined {\n if (!account) {\n return undefined;\n }\n\n return typeof account === \"string\" ? account : account.address;\n}\n\nfunction isPersonalServerLiteOwnerBindingSigner(\n source: ViemPersonalServerLiteOwnerBindingSignerSource,\n): source is PersonalServerLiteOwnerBindingSigner {\n return \"address\" in source && typeof source.signMessage === \"function\";\n}\n\nexport function buildPersonalServerLiteOwnerBindingMessage(\n ownerAddress: Address,\n): PersonalServerLiteOwnerBindingMessage {\n assertAddress(ownerAddress, \"ownerAddress\");\n return `${PERSONAL_SERVER_LITE_OWNER_BINDING_PREFIX}${ownerAddress.toLowerCase()}` as PersonalServerLiteOwnerBindingMessage;\n}\n\nexport function createViemPersonalServerLiteOwnerBindingSigner(\n source: ViemPersonalServerLiteOwnerBindingSignerSource,\n options: { account?: Account | Address } = {},\n): PersonalServerLiteOwnerBindingSigner {\n if (isPersonalServerLiteOwnerBindingSigner(source)) {\n return source;\n }\n\n const accountAddress =\n getAccountAddress(options.account) ?? getAccountAddress(source.account);\n\n if (accountAddress) {\n return {\n address: accountAddress,\n signMessage: ({ message }) =>\n source.signMessage({\n account: options.account ?? source.account ?? accountAddress,\n message,\n }),\n };\n }\n\n throw new Error(\n \"Viem wallet client requires an account option or account property\",\n );\n}\n\nexport async function buildPersonalServerLiteOwnerBindingSignature(\n input: BuildPersonalServerLiteOwnerBindingSignatureInput,\n): Promise<PersonalServerLiteOwnerBindingSignature> {\n const message = buildPersonalServerLiteOwnerBindingMessage(\n input.signer.address,\n );\n const signature = await input.signer.signMessage({ message });\n\n return {\n signature,\n signerAddress: input.signer.address,\n message,\n purpose: PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE,\n };\n}\n\nexport const signPersonalServerLiteOwnerBinding =\n buildPersonalServerLiteOwnerBindingSignature;\n"],"mappings":"AAUA;AAAA,EACE;AAAA,OAKK;AAEA,MAAM,6CAA6C;AACnD,MAAM,6CAA6C;AACnD,MAAM,4CACX,GAAG,0CAA0C,IAAI,0CAA0C;AAsC7F,SAAS,cAAc,OAAgB,MAAoB;AACzD,MAAI,CAAC,UAAU,KAAK,GAAG;AACrB,UAAM,IAAI,MAAM,GAAG,IAAI,8BAA8B;AAAA,EACvD;AACF;AAEA,SAAS,kBACP,SACqB;AACrB,MAAI,CAAC,SAAS;AACZ,WAAO;AAAA,EACT;AAEA,SAAO,OAAO,YAAY,WAAW,UAAU,QAAQ;AACzD;AAEA,SAAS,uCACP,QACgD;AAChD,SAAO,aAAa,UAAU,OAAO,OAAO,gBAAgB;AAC9D;AAEO,SAAS,2CACd,cACuC;AACvC,gBAAc,cAAc,cAAc;AAC1C,SAAO,GAAG,yCAAyC,GAAG,aAAa,YAAY,CAAC;AAClF;AAEO,SAAS,+CACd,QACA,UAA2C,CAAC,GACN;AACtC,MAAI,uCAAuC,MAAM,GAAG;AAClD,WAAO;AAAA,EACT;AAEA,QAAM,iBACJ,kBAAkB,QAAQ,OAAO,KAAK,kBAAkB,OAAO,OAAO;AAExE,MAAI,gBAAgB;AAClB,WAAO;AAAA,MACL,SAAS;AAAA,MACT,aAAa,CAAC,EAAE,QAAQ,MACtB,OAAO,YAAY;AAAA,QACjB,SAAS,QAAQ,WAAW,OAAO,WAAW;AAAA,QAC9C;AAAA,MACF,CAAC;AAAA,IACL;AAAA,EACF;AAEA,QAAM,IAAI;AAAA,IACR;AAAA,EACF;AACF;AAEA,eAAsB,6CACpB,OACkD;AAClD,QAAM,UAAU;AAAA,IACd,MAAM,OAAO;AAAA,EACf;AACA,QAAM,YAAY,MAAM,MAAM,OAAO,YAAY,EAAE,QAAQ,CAAC;AAE5D,SAAO;AAAA,IACL;AAAA,IACA,eAAe,MAAM,OAAO;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,EACX;AACF;AAEO,MAAM,qCACX;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/react.cjs
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var react_exports = {};
|
|
20
|
+
__export(react_exports, {
|
|
21
|
+
createDirectConnectFlow: () => import_connect_flow.createDirectConnectFlow,
|
|
22
|
+
useDirectVanaConnect: () => import_use_direct_vana_connect.useDirectVanaConnect
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(react_exports);
|
|
25
|
+
var import_use_direct_vana_connect = require("./direct/use-direct-vana-connect");
|
|
26
|
+
var import_connect_flow = require("./direct/connect-flow");
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
createDirectConnectFlow,
|
|
30
|
+
useDirectVanaConnect
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=react.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react.ts"],"sourcesContent":["/**\n * React entry point for the Vana SDK direct Data Portability flow.\n *\n * @remarks\n * Exposes {@link useDirectVanaConnect} (and the underlying framework-agnostic\n * connect-flow store) for browser apps. This entry point is browser-safe and\n * imports nothing Node-only. `react` is a peer dependency.\n *\n * @example\n * ```tsx\n * \"use client\";\n * import { useDirectVanaConnect } from \"@opendatalabs/vana-sdk/react\";\n *\n * export function ConnectNotesButton() {\n * const connect = useDirectVanaConnect({\n * createRequest: () => fetch(\"/api/vana/request\", { method: \"POST\" }).then((r) => r.json()),\n * getStatus: (id) => fetch(`/api/vana/status?requestId=${id}`).then((r) => r.json()),\n * readResult: (id) => fetch(`/api/vana/data?requestId=${id}`).then((r) => r.json()),\n * });\n * return (\n * <button disabled={connect.state.type !== \"idle\"} onClick={connect.start} type=\"button\">\n * {connect.state.type === \"idle\" ? \"Connect Apple Notes\" : \"Connecting...\"}\n * </button>\n * );\n * }\n * ```\n *\n * @category Direct\n * @module react\n */\n\nexport {\n useDirectVanaConnect,\n type UseDirectVanaConnectOptions,\n type UseDirectVanaConnectResult,\n} from \"./direct/use-direct-vana-connect\";\n\n// Framework-agnostic store (usable without React).\nexport {\n createDirectConnectFlow,\n type DirectConnectFlow,\n type DirectConnectState,\n type DirectConnectOptions,\n type DirectConnectTransports,\n} from \"./direct/connect-flow\";\n\n// Shared types useful when typing the transports.\nexport type {\n AccessRequest,\n AccessRequestStatus,\n AccessRequestStatusValue,\n ApprovedDataResult,\n} from \"./direct/types\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+BA,qCAIO;AAGP,0BAMO;","names":[]}
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React entry point for the Vana SDK direct Data Portability flow.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Exposes {@link useDirectVanaConnect} (and the underlying framework-agnostic
|
|
6
|
+
* connect-flow store) for browser apps. This entry point is browser-safe and
|
|
7
|
+
* imports nothing Node-only. `react` is a peer dependency.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* "use client";
|
|
12
|
+
* import { useDirectVanaConnect } from "@opendatalabs/vana-sdk/react";
|
|
13
|
+
*
|
|
14
|
+
* export function ConnectNotesButton() {
|
|
15
|
+
* const connect = useDirectVanaConnect({
|
|
16
|
+
* createRequest: () => fetch("/api/vana/request", { method: "POST" }).then((r) => r.json()),
|
|
17
|
+
* getStatus: (id) => fetch(`/api/vana/status?requestId=${id}`).then((r) => r.json()),
|
|
18
|
+
* readResult: (id) => fetch(`/api/vana/data?requestId=${id}`).then((r) => r.json()),
|
|
19
|
+
* });
|
|
20
|
+
* return (
|
|
21
|
+
* <button disabled={connect.state.type !== "idle"} onClick={connect.start} type="button">
|
|
22
|
+
* {connect.state.type === "idle" ? "Connect Apple Notes" : "Connecting..."}
|
|
23
|
+
* </button>
|
|
24
|
+
* );
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @category Direct
|
|
29
|
+
* @module react
|
|
30
|
+
*/
|
|
31
|
+
export { useDirectVanaConnect, type UseDirectVanaConnectOptions, type UseDirectVanaConnectResult, } from "./direct/use-direct-vana-connect";
|
|
32
|
+
export { createDirectConnectFlow, type DirectConnectFlow, type DirectConnectState, type DirectConnectOptions, type DirectConnectTransports, } from "./direct/connect-flow";
|
|
33
|
+
export type { AccessRequest, AccessRequestStatus, AccessRequestStatusValue, ApprovedDataResult, } from "./direct/types";
|
package/dist/react.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react.ts"],"sourcesContent":["/**\n * React entry point for the Vana SDK direct Data Portability flow.\n *\n * @remarks\n * Exposes {@link useDirectVanaConnect} (and the underlying framework-agnostic\n * connect-flow store) for browser apps. This entry point is browser-safe and\n * imports nothing Node-only. `react` is a peer dependency.\n *\n * @example\n * ```tsx\n * \"use client\";\n * import { useDirectVanaConnect } from \"@opendatalabs/vana-sdk/react\";\n *\n * export function ConnectNotesButton() {\n * const connect = useDirectVanaConnect({\n * createRequest: () => fetch(\"/api/vana/request\", { method: \"POST\" }).then((r) => r.json()),\n * getStatus: (id) => fetch(`/api/vana/status?requestId=${id}`).then((r) => r.json()),\n * readResult: (id) => fetch(`/api/vana/data?requestId=${id}`).then((r) => r.json()),\n * });\n * return (\n * <button disabled={connect.state.type !== \"idle\"} onClick={connect.start} type=\"button\">\n * {connect.state.type === \"idle\" ? \"Connect Apple Notes\" : \"Connecting...\"}\n * </button>\n * );\n * }\n * ```\n *\n * @category Direct\n * @module react\n */\n\nexport {\n useDirectVanaConnect,\n type UseDirectVanaConnectOptions,\n type UseDirectVanaConnectResult,\n} from \"./direct/use-direct-vana-connect\";\n\n// Framework-agnostic store (usable without React).\nexport {\n createDirectConnectFlow,\n type DirectConnectFlow,\n type DirectConnectState,\n type DirectConnectOptions,\n type DirectConnectTransports,\n} from \"./direct/connect-flow\";\n\n// Shared types useful when typing the transports.\nexport type {\n AccessRequest,\n AccessRequestStatus,\n AccessRequestStatusValue,\n ApprovedDataResult,\n} from \"./direct/types\";\n"],"mappings":"AA+BA;AAAA,EACE;AAAA,OAGK;AAGP;AAAA,EACE;AAAA,OAKK;","names":[]}
|
package/dist/server.cjs
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var server_exports = {};
|
|
20
|
+
__export(server_exports, {
|
|
21
|
+
AccessNotApprovedError: () => import_errors.AccessNotApprovedError,
|
|
22
|
+
DEV_ENDPOINTS: () => import_endpoints.DEV_ENDPOINTS,
|
|
23
|
+
DirectConfigError: () => import_errors.DirectConfigError,
|
|
24
|
+
DirectOpType: () => import_types.DirectOpType,
|
|
25
|
+
GRANT_OP_TYPE: () => import_escrow_payment.GRANT_OP_TYPE,
|
|
26
|
+
PRODUCTION_ENDPOINTS: () => import_endpoints.PRODUCTION_ENDPOINTS,
|
|
27
|
+
PaymentRequiredError: () => import_errors.PaymentRequiredError,
|
|
28
|
+
PersonalServerReadError: () => import_errors.PersonalServerReadError,
|
|
29
|
+
authorizeGrantPayment: () => import_escrow_payment.authorizeGrantPayment,
|
|
30
|
+
buildApprovalUrl: () => import_access_request_client.buildApprovalUrl,
|
|
31
|
+
buildPersonalServerDataReadRequest: () => import_personal_server_read.buildPersonalServerDataReadRequest,
|
|
32
|
+
createDefaultAccessRequestClient: () => import_access_request_client.createDefaultAccessRequestClient,
|
|
33
|
+
createDefaultNonceSource: () => import_escrow_payment.createDefaultNonceSource,
|
|
34
|
+
createDirectDataController: () => import_controller.createDirectDataController,
|
|
35
|
+
dataPathForScope: () => import_personal_server_read.dataPathForScope,
|
|
36
|
+
getDirectEndpoints: () => import_endpoints.getDirectEndpoints,
|
|
37
|
+
parsePersonalServerPaymentRequired: () => import_personal_server_read.parsePersonalServerPaymentRequired,
|
|
38
|
+
readPersonalServerData: () => import_personal_server_read.readPersonalServerData,
|
|
39
|
+
toDirectFeeBreakdown: () => import_escrow_payment.toDirectFeeBreakdown,
|
|
40
|
+
toDirectPaymentReceipt: () => import_escrow_payment.toDirectPaymentReceipt
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(server_exports);
|
|
43
|
+
var import_controller = require("./direct/controller");
|
|
44
|
+
var import_access_request_client = require("./direct/access-request-client");
|
|
45
|
+
var import_personal_server_read = require("./direct/personal-server-read");
|
|
46
|
+
var import_escrow_payment = require("./direct/escrow-payment");
|
|
47
|
+
var import_endpoints = require("./direct/endpoints");
|
|
48
|
+
var import_errors = require("./direct/errors");
|
|
49
|
+
var import_types = require("./direct/types");
|
|
50
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
51
|
+
0 && (module.exports = {
|
|
52
|
+
AccessNotApprovedError,
|
|
53
|
+
DEV_ENDPOINTS,
|
|
54
|
+
DirectConfigError,
|
|
55
|
+
DirectOpType,
|
|
56
|
+
GRANT_OP_TYPE,
|
|
57
|
+
PRODUCTION_ENDPOINTS,
|
|
58
|
+
PaymentRequiredError,
|
|
59
|
+
PersonalServerReadError,
|
|
60
|
+
authorizeGrantPayment,
|
|
61
|
+
buildApprovalUrl,
|
|
62
|
+
buildPersonalServerDataReadRequest,
|
|
63
|
+
createDefaultAccessRequestClient,
|
|
64
|
+
createDefaultNonceSource,
|
|
65
|
+
createDirectDataController,
|
|
66
|
+
dataPathForScope,
|
|
67
|
+
getDirectEndpoints,
|
|
68
|
+
parsePersonalServerPaymentRequired,
|
|
69
|
+
readPersonalServerData,
|
|
70
|
+
toDirectFeeBreakdown,
|
|
71
|
+
toDirectPaymentReceipt
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=server.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["/**\n * Server entry point for the Vana SDK direct Data Portability flow.\n *\n * @remarks\n * Exposes {@link createDirectDataController} and its supporting types/errors.\n * This is a Node/server entry point — it owns the app private key and must never\n * be imported into browser code.\n *\n * @example\n * ```typescript\n * import { createDirectDataController } from \"@opendatalabs/vana-sdk/server\";\n *\n * export const vana = createDirectDataController({\n * env: process.env.VANA_ENV === \"dev\" ? \"dev\" : \"production\",\n * appPrivateKey: process.env.VANA_APP_PRIVATE_KEY!,\n * app: { id: \"notes-lens\", name: \"Notes Lens\", homepageUrl: process.env.VANA_APP_URL! },\n * source: \"icloud_notes\",\n * scopes: [\"icloud_notes.notes\"],\n * });\n * ```\n *\n * @category Direct\n * @module server\n */\n\nexport {\n createDirectDataController,\n type DirectDataController,\n type DirectDataControllerConfig,\n type DirectEscrowConfig,\n} from \"./direct/controller\";\n\n// Lower-level building blocks (advanced use / custom transports).\nexport {\n createDefaultAccessRequestClient,\n buildApprovalUrl,\n type DefaultAccessRequestClientOptions,\n type FetchLike,\n} from \"./direct/access-request-client\";\nexport {\n buildPersonalServerDataReadRequest,\n readPersonalServerData,\n parsePersonalServerPaymentRequired,\n dataPathForScope,\n type PersonalServerDataReadRequest,\n type PersonalServerReadResult,\n type PersonalServerFetch,\n type FetchResponseLike,\n} from \"./direct/personal-server-read\";\n// Escrow-backed payment (built on protocol/escrow).\nexport {\n authorizeGrantPayment,\n toDirectPaymentReceipt,\n toDirectFeeBreakdown,\n createDefaultNonceSource,\n GRANT_OP_TYPE,\n type EscrowPaymentConfig,\n type SignTypedDataFn,\n type PaymentNonceSource,\n} from \"./direct/escrow-payment\";\nexport {\n getDirectEndpoints,\n PRODUCTION_ENDPOINTS,\n DEV_ENDPOINTS,\n} from \"./direct/endpoints\";\n\n// Errors\nexport {\n DirectConfigError,\n AccessNotApprovedError,\n PersonalServerReadError,\n PaymentRequiredError,\n} from \"./direct/errors\";\n\n// Shared types\nexport type {\n DirectEnv,\n DirectAppConfig,\n AppIdentity,\n DirectServiceEndpoints,\n AccessRequest,\n AccessRequestStatus,\n AccessRequestStatusValue,\n ApprovedDataResult,\n AccessRequestClient,\n DirectOpTypeValue,\n PersonalServerPaymentRequired,\n DirectPaymentReceipt,\n DirectFeeBreakdown,\n} from \"./direct/types\";\n\n// Op-type vocabulary constant.\nexport { DirectOpType } from \"./direct/types\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBA,wBAKO;AAGP,mCAKO;AACP,kCASO;AAEP,4BASO;AACP,uBAIO;AAGP,oBAKO;AAoBP,mBAA6B;","names":[]}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server entry point for the Vana SDK direct Data Portability flow.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Exposes {@link createDirectDataController} and its supporting types/errors.
|
|
6
|
+
* This is a Node/server entry point — it owns the app private key and must never
|
|
7
|
+
* be imported into browser code.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { createDirectDataController } from "@opendatalabs/vana-sdk/server";
|
|
12
|
+
*
|
|
13
|
+
* export const vana = createDirectDataController({
|
|
14
|
+
* env: process.env.VANA_ENV === "dev" ? "dev" : "production",
|
|
15
|
+
* appPrivateKey: process.env.VANA_APP_PRIVATE_KEY!,
|
|
16
|
+
* app: { id: "notes-lens", name: "Notes Lens", homepageUrl: process.env.VANA_APP_URL! },
|
|
17
|
+
* source: "icloud_notes",
|
|
18
|
+
* scopes: ["icloud_notes.notes"],
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @category Direct
|
|
23
|
+
* @module server
|
|
24
|
+
*/
|
|
25
|
+
export { createDirectDataController, type DirectDataController, type DirectDataControllerConfig, type DirectEscrowConfig, } from "./direct/controller";
|
|
26
|
+
export { createDefaultAccessRequestClient, buildApprovalUrl, type DefaultAccessRequestClientOptions, type FetchLike, } from "./direct/access-request-client";
|
|
27
|
+
export { buildPersonalServerDataReadRequest, readPersonalServerData, parsePersonalServerPaymentRequired, dataPathForScope, type PersonalServerDataReadRequest, type PersonalServerReadResult, type PersonalServerFetch, type FetchResponseLike, } from "./direct/personal-server-read";
|
|
28
|
+
export { authorizeGrantPayment, toDirectPaymentReceipt, toDirectFeeBreakdown, createDefaultNonceSource, GRANT_OP_TYPE, type EscrowPaymentConfig, type SignTypedDataFn, type PaymentNonceSource, } from "./direct/escrow-payment";
|
|
29
|
+
export { getDirectEndpoints, PRODUCTION_ENDPOINTS, DEV_ENDPOINTS, } from "./direct/endpoints";
|
|
30
|
+
export { DirectConfigError, AccessNotApprovedError, PersonalServerReadError, PaymentRequiredError, } from "./direct/errors";
|
|
31
|
+
export type { DirectEnv, DirectAppConfig, AppIdentity, DirectServiceEndpoints, AccessRequest, AccessRequestStatus, AccessRequestStatusValue, ApprovedDataResult, AccessRequestClient, DirectOpTypeValue, PersonalServerPaymentRequired, DirectPaymentReceipt, DirectFeeBreakdown, } from "./direct/types";
|
|
32
|
+
export { DirectOpType } from "./direct/types";
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createDirectDataController
|
|
3
|
+
} from "./direct/controller.js";
|
|
4
|
+
import {
|
|
5
|
+
createDefaultAccessRequestClient,
|
|
6
|
+
buildApprovalUrl
|
|
7
|
+
} from "./direct/access-request-client.js";
|
|
8
|
+
import {
|
|
9
|
+
buildPersonalServerDataReadRequest,
|
|
10
|
+
readPersonalServerData,
|
|
11
|
+
parsePersonalServerPaymentRequired,
|
|
12
|
+
dataPathForScope
|
|
13
|
+
} from "./direct/personal-server-read.js";
|
|
14
|
+
import {
|
|
15
|
+
authorizeGrantPayment,
|
|
16
|
+
toDirectPaymentReceipt,
|
|
17
|
+
toDirectFeeBreakdown,
|
|
18
|
+
createDefaultNonceSource,
|
|
19
|
+
GRANT_OP_TYPE
|
|
20
|
+
} from "./direct/escrow-payment.js";
|
|
21
|
+
import {
|
|
22
|
+
getDirectEndpoints,
|
|
23
|
+
PRODUCTION_ENDPOINTS,
|
|
24
|
+
DEV_ENDPOINTS
|
|
25
|
+
} from "./direct/endpoints.js";
|
|
26
|
+
import {
|
|
27
|
+
DirectConfigError,
|
|
28
|
+
AccessNotApprovedError,
|
|
29
|
+
PersonalServerReadError,
|
|
30
|
+
PaymentRequiredError
|
|
31
|
+
} from "./direct/errors.js";
|
|
32
|
+
import { DirectOpType } from "./direct/types.js";
|
|
33
|
+
export {
|
|
34
|
+
AccessNotApprovedError,
|
|
35
|
+
DEV_ENDPOINTS,
|
|
36
|
+
DirectConfigError,
|
|
37
|
+
DirectOpType,
|
|
38
|
+
GRANT_OP_TYPE,
|
|
39
|
+
PRODUCTION_ENDPOINTS,
|
|
40
|
+
PaymentRequiredError,
|
|
41
|
+
PersonalServerReadError,
|
|
42
|
+
authorizeGrantPayment,
|
|
43
|
+
buildApprovalUrl,
|
|
44
|
+
buildPersonalServerDataReadRequest,
|
|
45
|
+
createDefaultAccessRequestClient,
|
|
46
|
+
createDefaultNonceSource,
|
|
47
|
+
createDirectDataController,
|
|
48
|
+
dataPathForScope,
|
|
49
|
+
getDirectEndpoints,
|
|
50
|
+
parsePersonalServerPaymentRequired,
|
|
51
|
+
readPersonalServerData,
|
|
52
|
+
toDirectFeeBreakdown,
|
|
53
|
+
toDirectPaymentReceipt
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["/**\n * Server entry point for the Vana SDK direct Data Portability flow.\n *\n * @remarks\n * Exposes {@link createDirectDataController} and its supporting types/errors.\n * This is a Node/server entry point — it owns the app private key and must never\n * be imported into browser code.\n *\n * @example\n * ```typescript\n * import { createDirectDataController } from \"@opendatalabs/vana-sdk/server\";\n *\n * export const vana = createDirectDataController({\n * env: process.env.VANA_ENV === \"dev\" ? \"dev\" : \"production\",\n * appPrivateKey: process.env.VANA_APP_PRIVATE_KEY!,\n * app: { id: \"notes-lens\", name: \"Notes Lens\", homepageUrl: process.env.VANA_APP_URL! },\n * source: \"icloud_notes\",\n * scopes: [\"icloud_notes.notes\"],\n * });\n * ```\n *\n * @category Direct\n * @module server\n */\n\nexport {\n createDirectDataController,\n type DirectDataController,\n type DirectDataControllerConfig,\n type DirectEscrowConfig,\n} from \"./direct/controller\";\n\n// Lower-level building blocks (advanced use / custom transports).\nexport {\n createDefaultAccessRequestClient,\n buildApprovalUrl,\n type DefaultAccessRequestClientOptions,\n type FetchLike,\n} from \"./direct/access-request-client\";\nexport {\n buildPersonalServerDataReadRequest,\n readPersonalServerData,\n parsePersonalServerPaymentRequired,\n dataPathForScope,\n type PersonalServerDataReadRequest,\n type PersonalServerReadResult,\n type PersonalServerFetch,\n type FetchResponseLike,\n} from \"./direct/personal-server-read\";\n// Escrow-backed payment (built on protocol/escrow).\nexport {\n authorizeGrantPayment,\n toDirectPaymentReceipt,\n toDirectFeeBreakdown,\n createDefaultNonceSource,\n GRANT_OP_TYPE,\n type EscrowPaymentConfig,\n type SignTypedDataFn,\n type PaymentNonceSource,\n} from \"./direct/escrow-payment\";\nexport {\n getDirectEndpoints,\n PRODUCTION_ENDPOINTS,\n DEV_ENDPOINTS,\n} from \"./direct/endpoints\";\n\n// Errors\nexport {\n DirectConfigError,\n AccessNotApprovedError,\n PersonalServerReadError,\n PaymentRequiredError,\n} from \"./direct/errors\";\n\n// Shared types\nexport type {\n DirectEnv,\n DirectAppConfig,\n AppIdentity,\n DirectServiceEndpoints,\n AccessRequest,\n AccessRequestStatus,\n AccessRequestStatusValue,\n ApprovedDataResult,\n AccessRequestClient,\n DirectOpTypeValue,\n PersonalServerPaymentRequired,\n DirectPaymentReceipt,\n DirectFeeBreakdown,\n} from \"./direct/types\";\n\n// Op-type vocabulary constant.\nexport { DirectOpType } from \"./direct/types\";\n"],"mappings":"AAyBA;AAAA,EACE;AAAA,OAIK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAoBP,SAAS,oBAAoB;","names":[]}
|