@opendatalabs/connect 0.5.0 → 0.6.0-canary.e07e97e
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 +180 -51
- package/dist/core/constants.d.ts +32 -2
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +24 -2
- package/dist/core/constants.js.map +1 -1
- package/dist/core/errors.d.ts +43 -2
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +39 -0
- package/dist/core/errors.js.map +1 -1
- package/dist/core/grants.d.ts +19 -0
- package/dist/core/grants.d.ts.map +1 -0
- package/dist/core/grants.js +31 -0
- package/dist/core/grants.js.map +1 -0
- package/dist/core/index.d.ts +3 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/types.d.ts +62 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/react/ConnectButton.d.ts +16 -1
- package/dist/react/ConnectButton.d.ts.map +1 -1
- package/dist/react/ConnectButton.js +12 -5
- package/dist/react/ConnectButton.js.map +1 -1
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +1 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/useVanaConnect.d.ts +35 -2
- package/dist/react/useVanaConnect.d.ts.map +1 -1
- package/dist/react/useVanaConnect.js +36 -8
- package/dist/react/useVanaConnect.js.map +1 -1
- package/dist/react/useVanaData.d.ts +69 -0
- package/dist/react/useVanaData.d.ts.map +1 -0
- package/dist/react/useVanaData.js +131 -0
- package/dist/react/useVanaData.js.map +1 -0
- package/dist/server/config.d.ts +36 -0
- package/dist/server/config.d.ts.map +1 -0
- package/dist/server/config.js +44 -0
- package/dist/server/config.js.map +1 -0
- package/dist/server/connect.d.ts +40 -1
- package/dist/server/connect.d.ts.map +1 -1
- package/dist/server/connect.js +64 -6
- package/dist/server/connect.js.map +1 -1
- package/dist/server/data-client.d.ts +17 -0
- package/dist/server/data-client.d.ts.map +1 -1
- package/dist/server/data-client.js +24 -7
- package/dist/server/data-client.js.map +1 -1
- package/dist/server/index.d.ts +3 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +3 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/manifest-signer.d.ts +22 -0
- package/dist/server/manifest-signer.d.ts.map +1 -1
- package/dist/server/manifest-signer.js +22 -0
- package/dist/server/manifest-signer.js.map +1 -1
- package/dist/server/request-signer.d.ts +18 -0
- package/dist/server/request-signer.d.ts.map +1 -1
- package/dist/server/request-signer.js +6 -0
- package/dist/server/request-signer.js.map +1 -1
- package/dist/server/session-relay.d.ts +30 -2
- package/dist/server/session-relay.d.ts.map +1 -1
- package/dist/server/session-relay.js +12 -4
- package/dist/server/session-relay.js.map +1 -1
- package/dist/server/webhook.d.ts +11 -0
- package/dist/server/webhook.d.ts.map +1 -0
- package/dist/server/webhook.js +18 -0
- package/dist/server/webhook.js.map +1 -0
- package/package.json +3 -4
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { VanaEnvironment } from "../core/constants.js";
|
|
2
|
+
export interface VanaConfig {
|
|
3
|
+
privateKey: `0x${string}`;
|
|
4
|
+
scopes: string[];
|
|
5
|
+
appUrl: string;
|
|
6
|
+
environment?: VanaEnvironment;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Creates a validated SDK configuration.
|
|
10
|
+
*
|
|
11
|
+
* All values must be passed explicitly — the SDK does not read
|
|
12
|
+
* environment variables. The calling application is responsible
|
|
13
|
+
* for sourcing config values (e.g. from `process.env`).
|
|
14
|
+
*
|
|
15
|
+
* @param config - Required configuration fields.
|
|
16
|
+
* @returns A validated {@link VanaConfig} object.
|
|
17
|
+
* @throws {@link ConnectError} with code `CONFIG_INVALID` if any required field is missing or invalid.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { createVanaConfig } from "@opendatalabs/connect/server";
|
|
22
|
+
*
|
|
23
|
+
* const config = createVanaConfig({
|
|
24
|
+
* privateKey: process.env.VANA_PRIVATE_KEY as `0x${string}`,
|
|
25
|
+
* scopes: ["chatgpt.conversations"],
|
|
26
|
+
* appUrl: process.env.APP_URL!,
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function createVanaConfig(config: {
|
|
31
|
+
privateKey: `0x${string}`;
|
|
32
|
+
scopes: string[];
|
|
33
|
+
appUrl: string;
|
|
34
|
+
environment?: VanaEnvironment;
|
|
35
|
+
}): VanaConfig;
|
|
36
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/server/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,KAAK,MAAM,EAAE,CAAC;IAC1B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACvC,UAAU,EAAE,KAAK,MAAM,EAAE,CAAC;IAC1B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B,GAAG,UAAU,CAmCb"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ConnectError, ConnectErrorCode } from "../core/errors.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a validated SDK configuration.
|
|
4
|
+
*
|
|
5
|
+
* All values must be passed explicitly — the SDK does not read
|
|
6
|
+
* environment variables. The calling application is responsible
|
|
7
|
+
* for sourcing config values (e.g. from `process.env`).
|
|
8
|
+
*
|
|
9
|
+
* @param config - Required configuration fields.
|
|
10
|
+
* @returns A validated {@link VanaConfig} object.
|
|
11
|
+
* @throws {@link ConnectError} with code `CONFIG_INVALID` if any required field is missing or invalid.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* import { createVanaConfig } from "@opendatalabs/connect/server";
|
|
16
|
+
*
|
|
17
|
+
* const config = createVanaConfig({
|
|
18
|
+
* privateKey: process.env.VANA_PRIVATE_KEY as `0x${string}`,
|
|
19
|
+
* scopes: ["chatgpt.conversations"],
|
|
20
|
+
* appUrl: process.env.APP_URL!,
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export function createVanaConfig(config) {
|
|
25
|
+
if (!config.privateKey) {
|
|
26
|
+
throw new ConnectError("Missing privateKey. Pass a 0x-prefixed private key.", ConnectErrorCode.CONFIG_INVALID);
|
|
27
|
+
}
|
|
28
|
+
if (!config.privateKey.startsWith("0x")) {
|
|
29
|
+
throw new ConnectError("privateKey must start with 0x.", ConnectErrorCode.CONFIG_INVALID);
|
|
30
|
+
}
|
|
31
|
+
if (!Array.isArray(config.scopes) || config.scopes.length === 0) {
|
|
32
|
+
throw new ConnectError("Missing scopes. Pass a non-empty array of scope strings.", ConnectErrorCode.CONFIG_INVALID);
|
|
33
|
+
}
|
|
34
|
+
if (!config.appUrl) {
|
|
35
|
+
throw new ConnectError("Missing appUrl. Pass the public URL of your deployed app.", ConnectErrorCode.CONFIG_INVALID);
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
privateKey: config.privateKey,
|
|
39
|
+
scopes: config.scopes,
|
|
40
|
+
appUrl: config.appUrl,
|
|
41
|
+
environment: config.environment,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/server/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAUnE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAKhC;IACC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QACvB,MAAM,IAAI,YAAY,CACpB,qDAAqD,EACrD,gBAAgB,CAAC,cAAc,CAChC,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,YAAY,CACpB,gCAAgC,EAChC,gBAAgB,CAAC,cAAc,CAChC,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChE,MAAM,IAAI,YAAY,CACpB,0DAA0D,EAC1D,gBAAgB,CAAC,cAAc,CAChC,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,IAAI,YAAY,CACpB,2DAA2D,EAC3D,gBAAgB,CAAC,cAAc,CAChC,CAAC;IACJ,CAAC;IAED,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,WAAW,EAAE,MAAM,CAAC,WAAW;KAChC,CAAC;AACJ,CAAC"}
|
package/dist/server/connect.d.ts
CHANGED
|
@@ -1,4 +1,43 @@
|
|
|
1
1
|
import type { ConnectConfig, GetDataConfig, SessionInitResult } from "../core/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a session on the Session Relay and returns the session ID, connect URL, and deep link URL.
|
|
4
|
+
*
|
|
5
|
+
* This is the entry point for the Vana Connect flow. The returned `connectUrl`
|
|
6
|
+
* should be presented to the user to sign in on account.vana.org and launch Data Connect.
|
|
7
|
+
*
|
|
8
|
+
* @param config - Connection configuration including private key and scopes.
|
|
9
|
+
* @returns Session ID, connect URL, and expiration timestamp.
|
|
10
|
+
* @throws {@link ConnectError} with code `SESSION_INIT_FAILED` if the relay rejects the request.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const session = await connect({
|
|
15
|
+
* privateKey: process.env.VANA_PRIVATE_KEY as `0x${string}`,
|
|
16
|
+
* scopes: ["chatgpt.conversations"],
|
|
17
|
+
* });
|
|
18
|
+
* // session.sessionId, session.connectUrl, session.expiresAt
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
2
21
|
export declare function connect(config: ConnectConfig): Promise<SessionInitResult>;
|
|
3
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Fetches user data from their Personal Server using a signed grant.
|
|
24
|
+
*
|
|
25
|
+
* Resolves the server URL via the Data Portability Gateway, then fetches
|
|
26
|
+
* data for each scope in the grant concurrently.
|
|
27
|
+
*
|
|
28
|
+
* @param config - Data fetch configuration including private key and grant.
|
|
29
|
+
* @returns A `Record` keyed by scope name with the fetched data as values.
|
|
30
|
+
* @throws {@link ConnectError} with code `SERVER_NOT_FOUND` if no server is registered.
|
|
31
|
+
* @throws {@link ConnectError} with code `DATA_FETCH_FAILED` if a scope fetch fails.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* const data = await getData({
|
|
36
|
+
* privateKey: process.env.VANA_PRIVATE_KEY as `0x${string}`,
|
|
37
|
+
* grant,
|
|
38
|
+
* });
|
|
39
|
+
* const conversations = data["chatgpt.conversations"];
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function getData(config: GetDataConfig): Promise<Record<string, unknown>>;
|
|
4
43
|
//# sourceMappingURL=connect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/server/connect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAK1B,wBAAsB,OAAO,CAC3B,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/server/connect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAK1B;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,OAAO,CAC3B,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,iBAAiB,CAAC,CAiC5B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,OAAO,CAC3B,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA8BlC"}
|
package/dist/server/connect.js
CHANGED
|
@@ -1,26 +1,84 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getEnvConfig } from "../core/constants.js";
|
|
2
2
|
import { createRequestSigner } from "./request-signer.js";
|
|
3
3
|
import { createSessionRelay } from "./session-relay.js";
|
|
4
4
|
import { createDataClient } from "./data-client.js";
|
|
5
|
+
/**
|
|
6
|
+
* Creates a session on the Session Relay and returns the session ID, connect URL, and deep link URL.
|
|
7
|
+
*
|
|
8
|
+
* This is the entry point for the Vana Connect flow. The returned `connectUrl`
|
|
9
|
+
* should be presented to the user to sign in on account.vana.org and launch Data Connect.
|
|
10
|
+
*
|
|
11
|
+
* @param config - Connection configuration including private key and scopes.
|
|
12
|
+
* @returns Session ID, connect URL, and expiration timestamp.
|
|
13
|
+
* @throws {@link ConnectError} with code `SESSION_INIT_FAILED` if the relay rejects the request.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const session = await connect({
|
|
18
|
+
* privateKey: process.env.VANA_PRIVATE_KEY as `0x${string}`,
|
|
19
|
+
* scopes: ["chatgpt.conversations"],
|
|
20
|
+
* });
|
|
21
|
+
* // session.sessionId, session.connectUrl, session.expiresAt
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
5
24
|
export async function connect(config) {
|
|
25
|
+
const { sessionRelayUrl, accountUrl } = getEnvConfig(config.environment);
|
|
6
26
|
const signer = createRequestSigner({ privateKey: config.privateKey });
|
|
7
27
|
const granteeAddress = signer.address;
|
|
8
28
|
const relay = createSessionRelay({
|
|
9
29
|
privateKey: config.privateKey,
|
|
10
30
|
granteeAddress,
|
|
11
|
-
sessionRelayUrl
|
|
31
|
+
sessionRelayUrl,
|
|
12
32
|
});
|
|
13
|
-
|
|
33
|
+
const relayResult = await relay.initSession({
|
|
14
34
|
scopes: config.scopes,
|
|
15
35
|
webhookUrl: config.webhookUrl,
|
|
16
36
|
appUserId: config.appUserId,
|
|
17
37
|
});
|
|
38
|
+
// Build the account.vana.org connect URL from the relay response
|
|
39
|
+
const connectUrl = new URL("/connect", accountUrl);
|
|
40
|
+
connectUrl.searchParams.set("sessionId", relayResult.sessionId);
|
|
41
|
+
try {
|
|
42
|
+
const deepLinkParams = new URL(relayResult.deepLinkUrl);
|
|
43
|
+
const secret = deepLinkParams.searchParams.get("secret");
|
|
44
|
+
if (secret)
|
|
45
|
+
connectUrl.searchParams.set("secret", secret);
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
// deepLinkUrl may not be a valid URL; proceed without secret
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
sessionId: relayResult.sessionId,
|
|
52
|
+
connectUrl: connectUrl.toString(),
|
|
53
|
+
expiresAt: relayResult.expiresAt,
|
|
54
|
+
};
|
|
18
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Fetches user data from their Personal Server using a signed grant.
|
|
58
|
+
*
|
|
59
|
+
* Resolves the server URL via the Data Portability Gateway, then fetches
|
|
60
|
+
* data for each scope in the grant concurrently.
|
|
61
|
+
*
|
|
62
|
+
* @param config - Data fetch configuration including private key and grant.
|
|
63
|
+
* @returns A `Record` keyed by scope name with the fetched data as values.
|
|
64
|
+
* @throws {@link ConnectError} with code `SERVER_NOT_FOUND` if no server is registered.
|
|
65
|
+
* @throws {@link ConnectError} with code `DATA_FETCH_FAILED` if a scope fetch fails.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const data = await getData({
|
|
70
|
+
* privateKey: process.env.VANA_PRIVATE_KEY as `0x${string}`,
|
|
71
|
+
* grant,
|
|
72
|
+
* });
|
|
73
|
+
* const conversations = data["chatgpt.conversations"];
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
19
76
|
export async function getData(config) {
|
|
77
|
+
const { gatewayUrl } = getEnvConfig(config.environment);
|
|
20
78
|
const { grant } = config;
|
|
21
79
|
const dataClient = createDataClient({
|
|
22
80
|
privateKey: config.privateKey,
|
|
23
|
-
gatewayUrl
|
|
81
|
+
gatewayUrl,
|
|
24
82
|
});
|
|
25
83
|
const serverUrl = await dataClient.resolveServerUrl(grant.serverAddress ?? grant.userAddress);
|
|
26
84
|
const results = await Promise.all(grant.scopes.map(async (scope) => {
|
|
@@ -31,9 +89,9 @@ export async function getData(config) {
|
|
|
31
89
|
});
|
|
32
90
|
return [scope, result];
|
|
33
91
|
}));
|
|
34
|
-
const data =
|
|
92
|
+
const data = {};
|
|
35
93
|
for (const [scope, result] of results) {
|
|
36
|
-
data
|
|
94
|
+
data[scope] = result;
|
|
37
95
|
}
|
|
38
96
|
return data;
|
|
39
97
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../../src/server/connect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../../src/server/connect.ts"],"names":[],"mappings":"A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
import type { DataClientConfig, DataFetchParams } from "../core/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Low-level client for the Data Portability Gateway and Personal Servers.
|
|
4
|
+
*
|
|
5
|
+
* @see {@link createDataClient} to create an instance.
|
|
6
|
+
*/
|
|
2
7
|
export interface DataClient {
|
|
8
|
+
/** Resolves a user's Personal Server URL via the gateway. */
|
|
3
9
|
resolveServerUrl(userAddress: string): Promise<string>;
|
|
10
|
+
/** Fetches data for a single scope from a Personal Server. */
|
|
4
11
|
fetchData(params: DataFetchParams): Promise<unknown>;
|
|
12
|
+
/** Lists available scopes on a Personal Server. */
|
|
5
13
|
listScopes(params: {
|
|
6
14
|
serverUrl: string;
|
|
7
15
|
}): Promise<unknown>;
|
|
16
|
+
/** Lists available versions for a scope on a Personal Server. */
|
|
8
17
|
listVersions(params: {
|
|
9
18
|
serverUrl: string;
|
|
10
19
|
scope: string;
|
|
11
20
|
}): Promise<unknown>;
|
|
12
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates a low-level Data Gateway / Personal Server client.
|
|
24
|
+
*
|
|
25
|
+
* Prefer the high-level {@link getData} function for most use cases.
|
|
26
|
+
*
|
|
27
|
+
* @param config - Data client configuration.
|
|
28
|
+
* @returns A {@link DataClient} instance.
|
|
29
|
+
*/
|
|
13
30
|
export declare function createDataClient(config: DataClientConfig): DataClient;
|
|
14
31
|
//# sourceMappingURL=data-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-client.d.ts","sourceRoot":"","sources":["../../src/server/data-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAG1E,MAAM,WAAW,UAAU;IACzB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACvD,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACrD,UAAU,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5D,YAAY,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC9E;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"data-client.d.ts","sourceRoot":"","sources":["../../src/server/data-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAG1E;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,6DAA6D;IAC7D,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACvD,8DAA8D;IAC9D,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACrD,mDAAmD;IACnD,UAAU,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5D,iEAAiE;IACjE,YAAY,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC9E;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,UAAU,CA0HrE"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import { ConnectError } from "../core/errors.js";
|
|
1
|
+
import { ConnectError, ConnectErrorCode } from "../core/errors.js";
|
|
2
2
|
import { createRequestSigner } from "./request-signer.js";
|
|
3
|
+
/**
|
|
4
|
+
* Creates a low-level Data Gateway / Personal Server client.
|
|
5
|
+
*
|
|
6
|
+
* Prefer the high-level {@link getData} function for most use cases.
|
|
7
|
+
*
|
|
8
|
+
* @param config - Data client configuration.
|
|
9
|
+
* @returns A {@link DataClient} instance.
|
|
10
|
+
*/
|
|
3
11
|
export function createDataClient(config) {
|
|
4
12
|
const gatewayBase = config.gatewayUrl.replace(/\/+$/, "");
|
|
5
13
|
const signer = createRequestSigner({ privateKey: config.privateKey });
|
|
@@ -7,10 +15,10 @@ export function createDataClient(config) {
|
|
|
7
15
|
async resolveServerUrl(userAddress) {
|
|
8
16
|
const res = await fetch(`${gatewayBase}/v1/servers/${userAddress}`);
|
|
9
17
|
if (res.status === 404) {
|
|
10
|
-
throw new ConnectError(`No server registered for ${userAddress}`,
|
|
18
|
+
throw new ConnectError(`No server registered for ${userAddress}`, ConnectErrorCode.SERVER_NOT_FOUND, 404);
|
|
11
19
|
}
|
|
12
20
|
if (!res.ok) {
|
|
13
|
-
throw new ConnectError(`Gateway error: ${res.status}`,
|
|
21
|
+
throw new ConnectError(`Gateway error: ${res.status}`, ConnectErrorCode.GATEWAY_ERROR, res.status);
|
|
14
22
|
}
|
|
15
23
|
const envelope = (await res.json());
|
|
16
24
|
return envelope.data.serverUrl;
|
|
@@ -30,11 +38,20 @@ export function createDataClient(config) {
|
|
|
30
38
|
uri,
|
|
31
39
|
grantId: params.grantId,
|
|
32
40
|
});
|
|
33
|
-
const
|
|
41
|
+
const url = `${base}${uri}`;
|
|
42
|
+
const res = await fetch(url, {
|
|
34
43
|
headers: { Authorization: authHeader },
|
|
35
44
|
});
|
|
36
45
|
if (!res.ok) {
|
|
37
|
-
|
|
46
|
+
const body = await res.text().catch(() => "(unreadable)");
|
|
47
|
+
console.error("[data-client] fetchData failed", {
|
|
48
|
+
status: res.status,
|
|
49
|
+
url,
|
|
50
|
+
scope: params.scope,
|
|
51
|
+
grantId: params.grantId,
|
|
52
|
+
body,
|
|
53
|
+
});
|
|
54
|
+
throw new ConnectError(`Data fetch failed: ${res.status}`, ConnectErrorCode.DATA_FETCH_FAILED, res.status);
|
|
38
55
|
}
|
|
39
56
|
return res.json();
|
|
40
57
|
},
|
|
@@ -50,7 +67,7 @@ export function createDataClient(config) {
|
|
|
50
67
|
headers: { Authorization: authHeader },
|
|
51
68
|
});
|
|
52
69
|
if (!res.ok) {
|
|
53
|
-
throw new ConnectError(`List scopes failed: ${res.status}`,
|
|
70
|
+
throw new ConnectError(`List scopes failed: ${res.status}`, ConnectErrorCode.LIST_SCOPES_FAILED, res.status);
|
|
54
71
|
}
|
|
55
72
|
return res.json();
|
|
56
73
|
},
|
|
@@ -66,7 +83,7 @@ export function createDataClient(config) {
|
|
|
66
83
|
headers: { Authorization: authHeader },
|
|
67
84
|
});
|
|
68
85
|
if (!res.ok) {
|
|
69
|
-
throw new ConnectError(`List versions failed: ${res.status}`,
|
|
86
|
+
throw new ConnectError(`List versions failed: ${res.status}`, ConnectErrorCode.LIST_VERSIONS_FAILED, res.status);
|
|
70
87
|
}
|
|
71
88
|
return res.json();
|
|
72
89
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-client.js","sourceRoot":"","sources":["../../src/server/data-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"data-client.js","sourceRoot":"","sources":["../../src/server/data-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAkB1D;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAwB;IACvD,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC1D,MAAM,MAAM,GAAG,mBAAmB,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;IAEtE,O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G,EAAE,EAAE;gBACvC,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE;aACvC,CAAC,CAAC;YAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;gBACZ,MAAM,IAAI,YAAY,CACpB,uBAAuB,GAAG,CAAC,MAAM,EAAE,EACnC,gBAAgB,CAAC,kBAAkB,EACnC,GAAG,CAAC,MAAM,CACX,CAAC;YACJ,CAAC;YAED,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;QACpB,CAAC;QAED,KAAK,CAAC,YAAY,CAAC,MAGlB;YACC,MAAM,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YAClD,MAAM,GAAG,GAAG,YAAY,MAAM,CAAC,KAAK,WAAW,CAAC;YAEhD,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC;gBAC1C,GAAG,EAAE,IAAI;gBACT,MAAM,EAAE,KAAK;gBACb,GAAG;aACJ,CAAC,CAAC;YAEH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,GAAG,GAAG,EAAE,EAAE;gBACvC,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE;aACvC,CAAC,CAAC;YAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;gBACZ,MAAM,IAAI,YAAY,CACpB,yBAAyB,GAAG,CAAC,MAAM,EAAE,EACrC,gBAAgB,CAAC,oBAAoB,EACrC,GAAG,CAAC,MAAM,CACX,CAAC;YACJ,CAAC;YAED,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;QACpB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { createRequestSigner, type RequestSigner } from "./request-signer.js";
|
|
2
|
-
export { createSessionRelay, type SessionRelay } from "./session-relay.js";
|
|
2
|
+
export { createSessionRelay, type SessionRelay, type RelaySessionInitResult, } from "./session-relay.js";
|
|
3
3
|
export { createDataClient, type DataClient } from "./data-client.js";
|
|
4
4
|
export { connect, getData } from "./connect.js";
|
|
5
5
|
export { signVanaManifest } from "./manifest-signer.js";
|
|
6
|
+
export { createVanaConfig, type VanaConfig } from "./config.js";
|
|
7
|
+
export { verifyWebhook } from "./webhook.js";
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACL,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,sBAAsB,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/server/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { createRequestSigner } from "./request-signer.js";
|
|
2
|
-
export { createSessionRelay } from "./session-relay.js";
|
|
2
|
+
export { createSessionRelay, } from "./session-relay.js";
|
|
3
3
|
export { createDataClient } from "./data-client.js";
|
|
4
4
|
export { connect, getData } from "./connect.js";
|
|
5
5
|
export { signVanaManifest } from "./manifest-signer.js";
|
|
6
|
+
export { createVanaConfig } from "./config.js";
|
|
7
|
+
export { verifyWebhook } from "./webhook.js";
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
package/dist/server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAsB,MAAM,qBAAqB,CAAC;AAC9E,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAsB,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACL,kBAAkB,GAGnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAmB,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1,3 +1,25 @@
|
|
|
1
1
|
import type { VanaManifestConfig, VanaManifestBlock } from "../core/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Signs a web app manifest block for Vana Desktop App identity verification.
|
|
4
|
+
*
|
|
5
|
+
* Include the returned block under the `vana` key in your web app manifest JSON,
|
|
6
|
+
* and make sure your HTML has `<link rel="manifest" href="/manifest.json">`.
|
|
7
|
+
*
|
|
8
|
+
* @param config - Manifest configuration including private key and app URLs.
|
|
9
|
+
* @returns A signed {@link VanaManifestBlock}.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const vanaBlock = await signVanaManifest({
|
|
14
|
+
* privateKey: process.env.VANA_PRIVATE_KEY as `0x${string}`,
|
|
15
|
+
* appUrl: "https://yourapp.com",
|
|
16
|
+
* privacyPolicyUrl: "https://yourapp.com/privacy",
|
|
17
|
+
* termsUrl: "https://yourapp.com/terms",
|
|
18
|
+
* supportUrl: "https://yourapp.com/support",
|
|
19
|
+
* webhookUrl: "https://yourapp.com/api/webhook",
|
|
20
|
+
* });
|
|
21
|
+
* const manifest = { name: "Your App", vana: vanaBlock };
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
2
24
|
export declare function signVanaManifest(config: VanaManifestConfig): Promise<VanaManifestBlock>;
|
|
3
25
|
//# sourceMappingURL=manifest-signer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-signer.d.ts","sourceRoot":"","sources":["../../src/server/manifest-signer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAa9E,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,iBAAiB,CAAC,CAgB5B"}
|
|
1
|
+
{"version":3,"file":"manifest-signer.d.ts","sourceRoot":"","sources":["../../src/server/manifest-signer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAa9E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,iBAAiB,CAAC,CAgB5B"}
|
|
@@ -12,6 +12,28 @@ function canonicalizeJson(obj) {
|
|
|
12
12
|
}
|
|
13
13
|
return sorted;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Signs a web app manifest block for Vana Desktop App identity verification.
|
|
17
|
+
*
|
|
18
|
+
* Include the returned block under the `vana` key in your web app manifest JSON,
|
|
19
|
+
* and make sure your HTML has `<link rel="manifest" href="/manifest.json">`.
|
|
20
|
+
*
|
|
21
|
+
* @param config - Manifest configuration including private key and app URLs.
|
|
22
|
+
* @returns A signed {@link VanaManifestBlock}.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* const vanaBlock = await signVanaManifest({
|
|
27
|
+
* privateKey: process.env.VANA_PRIVATE_KEY as `0x${string}`,
|
|
28
|
+
* appUrl: "https://yourapp.com",
|
|
29
|
+
* privacyPolicyUrl: "https://yourapp.com/privacy",
|
|
30
|
+
* termsUrl: "https://yourapp.com/terms",
|
|
31
|
+
* supportUrl: "https://yourapp.com/support",
|
|
32
|
+
* webhookUrl: "https://yourapp.com/api/webhook",
|
|
33
|
+
* });
|
|
34
|
+
* const manifest = { name: "Your App", vana: vanaBlock };
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
15
37
|
export async function signVanaManifest(config) {
|
|
16
38
|
const account = privateKeyToAccount(config.privateKey);
|
|
17
39
|
const block = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-signer.js","sourceRoot":"","sources":["../../src/server/manifest-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGpD,SAAS,gBAAgB,CAAC,GAAY;IACpC,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,GAAG,CAAC;IACxD,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACzD,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAA8B,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;QACrE,IAAI,GAAG,KAAK,WAAW;YAAE,SAAS;QAClC,MAAM,CAAC,GAAG,CAAC,GAAG,gBAAgB,CAAE,GAA+B,CAAC,GAAG,CAAC,CAAC,CAAC;IACxE,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C,GAAG,gBAAgB,CAAE,GAA+B,CAAC,GAAG,CAAC,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAA0B;IAE1B,MAAM,OAAO,GAAG,mBAAmB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAEvD,MAAM,KAAK,GAAG;QACZ,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;QACzC,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,UAAU,EAAE,MAAM,CAAC,UAAU;KAC9B,CAAC;IAEF,MAAM,SAAS,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC1C,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAC1C,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAEzD,OAAO,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import type { RequestSignerConfig } from "../core/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Generates `Web3Signed` authorization headers for protocol requests.
|
|
4
|
+
*
|
|
5
|
+
* @see {@link createRequestSigner} to create an instance.
|
|
6
|
+
*/
|
|
2
7
|
export interface RequestSigner {
|
|
8
|
+
/**
|
|
9
|
+
* Signs a request and returns the `Authorization` header value.
|
|
10
|
+
*
|
|
11
|
+
* @param params - Request metadata (audience, method, URI, optional body and grantId).
|
|
12
|
+
* @returns A `Web3Signed <payload>.<signature>` header string.
|
|
13
|
+
*/
|
|
3
14
|
signRequest(params: {
|
|
4
15
|
aud: string;
|
|
5
16
|
method: string;
|
|
@@ -7,7 +18,14 @@ export interface RequestSigner {
|
|
|
7
18
|
body?: string;
|
|
8
19
|
grantId?: string;
|
|
9
20
|
}): Promise<string>;
|
|
21
|
+
/** The wallet address derived from the private key. */
|
|
10
22
|
readonly address: `0x${string}`;
|
|
11
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Creates a request signer that generates `Web3Signed` authorization headers.
|
|
26
|
+
*
|
|
27
|
+
* @param config - Configuration containing the builder's private key.
|
|
28
|
+
* @returns A {@link RequestSigner} instance.
|
|
29
|
+
*/
|
|
12
30
|
export declare function createRequestSigner(config: RequestSignerConfig): RequestSigner;
|
|
13
31
|
//# sourceMappingURL=request-signer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-signer.d.ts","sourceRoot":"","sources":["../../src/server/request-signer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AA+B5D,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,MAAM,EAAE;QAClB,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;CACjC;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,mBAAmB,GAC1B,aAAa,CAsCf"}
|
|
1
|
+
{"version":3,"file":"request-signer.d.ts","sourceRoot":"","sources":["../../src/server/request-signer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AA+B5D;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,WAAW,CAAC,MAAM,EAAE;QAClB,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACpB,uDAAuD;IACvD,QAAQ,CAAC,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;CACjC;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,mBAAmB,GAC1B,aAAa,CAsCf"}
|
|
@@ -29,6 +29,12 @@ function computeBodyHash(body) {
|
|
|
29
29
|
const canonicalStr = JSON.stringify(canonical);
|
|
30
30
|
return createHash("sha256").update(canonicalStr).digest("hex");
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Creates a request signer that generates `Web3Signed` authorization headers.
|
|
34
|
+
*
|
|
35
|
+
* @param config - Configuration containing the builder's private key.
|
|
36
|
+
* @returns A {@link RequestSigner} instance.
|
|
37
|
+
*/
|
|
32
38
|
export function createRequestSigner(config) {
|
|
33
39
|
const account = privateKeyToAccount(config.privateKey);
|
|
34
40
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-signer.js","sourceRoot":"","sources":["../../src/server/request-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGpD,SAAS,eAAe,CAAC,KAAa;IACpC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC;SAC/B,QAAQ,CAAC,QAAQ,CAAC;SAClB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACxB,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAY;IACpC,IAAI,GAAG,KAAK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|
|
1
|
+
import type { SessionRelayConfig, SessionInitParams, SessionPollResult } from "../core/types.js";
|
|
2
|
+
/** Raw response from the Session Relay init endpoint. */
|
|
3
|
+
export interface RelaySessionInitResult {
|
|
4
|
+
sessionId: string;
|
|
5
|
+
deepLinkUrl: string;
|
|
6
|
+
expiresAt: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Low-level client for the Session Relay service.
|
|
10
|
+
*
|
|
11
|
+
* @see {@link createSessionRelay} to create an instance.
|
|
12
|
+
*/
|
|
2
13
|
export interface SessionRelay {
|
|
3
|
-
|
|
14
|
+
/** Creates a new session and returns the raw relay response (sessionId, deepLinkUrl, expiresAt). */
|
|
15
|
+
initSession(params: SessionInitParams): Promise<RelaySessionInitResult>;
|
|
16
|
+
/** Polls the session status once. */
|
|
4
17
|
pollSession(sessionId: string): Promise<SessionPollResult>;
|
|
18
|
+
/**
|
|
19
|
+
* Polls until the session reaches a terminal state (`approved`, `denied`, or `expired`).
|
|
20
|
+
*
|
|
21
|
+
* @param sessionId - The session to poll.
|
|
22
|
+
* @param opts - Optional polling interval (default 2 s) and timeout (default 15 min).
|
|
23
|
+
* @throws {@link ConnectError} with code `POLL_TIMEOUT` if the timeout is exceeded.
|
|
24
|
+
*/
|
|
5
25
|
pollUntilComplete(sessionId: string, opts?: {
|
|
6
26
|
interval?: number;
|
|
7
27
|
timeout?: number;
|
|
8
28
|
}): Promise<SessionPollResult>;
|
|
9
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Creates a low-level Session Relay client.
|
|
32
|
+
*
|
|
33
|
+
* Prefer the high-level {@link connect} function for most use cases.
|
|
34
|
+
*
|
|
35
|
+
* @param config - Session Relay configuration.
|
|
36
|
+
* @returns A {@link SessionRelay} instance.
|
|
37
|
+
*/
|
|
10
38
|
export declare function createSessionRelay(config: SessionRelayConfig): SessionRelay;
|
|
11
39
|
//# sourceMappingURL=session-relay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-relay.d.ts","sourceRoot":"","sources":["../../src/server/session-relay.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"session-relay.d.ts","sourceRoot":"","sources":["../../src/server/session-relay.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAG1B,yDAAyD;AACzD,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,oGAAoG;IACpG,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACxE,qCAAqC;IACrC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC3D;;;;;;OAMG;IACH,iBAAiB,CACf,SAAS,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAC7C,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC/B;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG,YAAY,CA8F3E"}
|