@opendatalabs/vana-sdk 3.1.0 → 3.2.0
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 +2 -1
- package/dist/account/personal-server-lite-owner-binding.cjs +81 -0
- package/dist/account/personal-server-lite-owner-binding.cjs.map +1 -0
- package/dist/account/personal-server-lite-owner-binding.d.ts +30 -0
- package/dist/account/personal-server-lite-owner-binding.js +59 -0
- package/dist/account/personal-server-lite-owner-binding.js.map +1 -0
- package/dist/account/personal-server-lite-owner-binding.test.d.ts +1 -0
- package/dist/account/personal-server-registration.cjs +263 -0
- package/dist/account/personal-server-registration.cjs.map +1 -0
- package/dist/account/personal-server-registration.d.ts +66 -0
- package/dist/account/personal-server-registration.js +240 -0
- package/dist/account/personal-server-registration.js.map +1 -0
- package/dist/account/personal-server-registration.test.d.ts +1 -0
- package/dist/auth/errors.js +1 -1
- package/dist/auth/oauth-client.js +2 -2
- package/dist/auth/web3-signed-builder.js +1 -1
- package/dist/auth/web3-signed.js +3 -3
- package/dist/browser.js +1 -1
- package/dist/chains/definitions.js +1 -1
- package/dist/chains/index.js +1 -1
- package/dist/chains.browser.js +1 -1
- package/dist/chains.js +1 -1
- package/dist/chains.node.js +1 -1
- package/dist/contracts/contractController.js +4 -4
- package/dist/core/client.js +1 -1
- package/dist/crypto/ecies/base.js +3 -3
- package/dist/crypto/ecies/browser.js +1 -1
- package/dist/crypto/ecies/index.js +1 -1
- package/dist/crypto/ecies/interface.js +1 -1
- package/dist/crypto/ecies/node.js +1 -1
- package/dist/crypto/services/WalletKeyEncryptionService.js +1 -1
- package/dist/generated/abi/index.js +26 -26
- package/dist/index.browser.d.ts +4 -0
- package/dist/index.browser.js +447 -3
- package/dist/index.browser.js.map +4 -4
- package/dist/index.node.cjs +464 -5
- package/dist/index.node.cjs.map +4 -4
- package/dist/index.node.d.ts +4 -0
- package/dist/index.node.js +447 -3
- package/dist/index.node.js.map +4 -4
- package/dist/node.js +1 -1
- package/dist/platform/browser-only.js +1 -1
- package/dist/platform/browser-safe.js +1 -1
- package/dist/platform/browser.js +6 -6
- package/dist/platform/index.js +4 -4
- package/dist/platform/node.js +8 -8
- package/dist/platform/utils.js +2 -2
- package/dist/platform.browser.js +3 -3
- package/dist/platform.js +4 -4
- package/dist/platform.node.js +4 -4
- package/dist/protocol/eip712.cjs.map +1 -1
- package/dist/protocol/eip712.d.ts +1 -1
- package/dist/protocol/eip712.js.map +1 -1
- package/dist/protocol/grants.js +1 -1
- 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/protocol/personal-server-registration.cjs +122 -0
- package/dist/protocol/personal-server-registration.cjs.map +1 -0
- package/dist/protocol/personal-server-registration.d.ts +62 -0
- package/dist/protocol/personal-server-registration.js +97 -0
- package/dist/protocol/personal-server-registration.js.map +1 -0
- package/dist/protocol/personal-server-registration.test.d.ts +1 -0
- package/dist/storage/default.js +1 -1
- package/dist/storage/index.js +10 -10
- package/dist/storage/manager.js +1 -1
- package/dist/storage/providers/callback-storage.js +1 -1
- package/dist/storage/providers/dropbox.js +1 -1
- package/dist/storage/providers/google-drive.js +1 -1
- package/dist/storage/providers/ipfs.js +2 -2
- package/dist/storage/providers/pinata.js +1 -1
- package/dist/storage/providers/r2.js +1 -1
- package/dist/storage/providers/vana-storage.js +2 -2
- package/dist/types/index.js +2 -2
- package/dist/types.js +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { isAddress } from "viem";
|
|
2
|
+
import {
|
|
3
|
+
buildPersonalServerRegistrationTypedData,
|
|
4
|
+
personalServerRegistrationDomain
|
|
5
|
+
} from "../protocol/personal-server-registration.js";
|
|
6
|
+
import { SERVER_REGISTRATION_TYPES } from "../protocol/eip712.js";
|
|
7
|
+
const ACCOUNT_PERSONAL_SERVER_REGISTRATION_INTENT = "personal_server.server_registration.v1";
|
|
8
|
+
class AccountPersonalServerRegistrationError extends Error {
|
|
9
|
+
status;
|
|
10
|
+
code;
|
|
11
|
+
details;
|
|
12
|
+
constructor(input) {
|
|
13
|
+
super(input.message);
|
|
14
|
+
this.name = "AccountPersonalServerRegistrationError";
|
|
15
|
+
this.status = input.status;
|
|
16
|
+
this.code = input.code;
|
|
17
|
+
this.details = input.details;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const DEFAULT_ACCOUNT_PS_REGISTRATION_PATH = "/api/v1/intents/personal-server-registration/sign";
|
|
21
|
+
function trimTrailingSlash(value) {
|
|
22
|
+
return value.replace(/\/+$/, "");
|
|
23
|
+
}
|
|
24
|
+
function assertAddress(value, name) {
|
|
25
|
+
if (!isAddress(value)) {
|
|
26
|
+
throw new Error(`${name} must be a valid EVM address`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
async function parseAccountResponse(response) {
|
|
30
|
+
const body = await response.json().catch(() => void 0);
|
|
31
|
+
if (!response.ok) {
|
|
32
|
+
throw new AccountPersonalServerRegistrationError({
|
|
33
|
+
status: response.status,
|
|
34
|
+
code: accountErrorCode(body),
|
|
35
|
+
message: accountErrorMessage(response.status, body),
|
|
36
|
+
details: body
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return body;
|
|
40
|
+
}
|
|
41
|
+
function accountErrorMessage(status, body) {
|
|
42
|
+
const nestedMessage = nestedAccountErrorField(body, "message");
|
|
43
|
+
if (nestedMessage) {
|
|
44
|
+
return nestedMessage;
|
|
45
|
+
}
|
|
46
|
+
if (isRecord(body) && typeof body.message === "string") {
|
|
47
|
+
return body.message;
|
|
48
|
+
}
|
|
49
|
+
const code = accountErrorCode(body);
|
|
50
|
+
if (code) {
|
|
51
|
+
return `Account PS registration signing failed: ${code}`;
|
|
52
|
+
}
|
|
53
|
+
return `Account PS registration signing failed: ${status}`;
|
|
54
|
+
}
|
|
55
|
+
function accountErrorCode(body) {
|
|
56
|
+
const nestedCode = nestedAccountErrorField(body, "code");
|
|
57
|
+
if (nestedCode) {
|
|
58
|
+
return nestedCode;
|
|
59
|
+
}
|
|
60
|
+
if (isRecord(body)) {
|
|
61
|
+
if (typeof body.code === "string") {
|
|
62
|
+
return body.code;
|
|
63
|
+
}
|
|
64
|
+
if (typeof body.error === "string") {
|
|
65
|
+
return body.error;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return void 0;
|
|
69
|
+
}
|
|
70
|
+
function nestedAccountErrorField(body, field) {
|
|
71
|
+
if (!isRecord(body) || !isRecord(body.error)) {
|
|
72
|
+
return void 0;
|
|
73
|
+
}
|
|
74
|
+
const value = body.error[field];
|
|
75
|
+
return typeof value === "string" ? value : void 0;
|
|
76
|
+
}
|
|
77
|
+
function isRecord(value) {
|
|
78
|
+
return typeof value === "object" && value !== null;
|
|
79
|
+
}
|
|
80
|
+
function normalizeAccountResponse(response) {
|
|
81
|
+
return {
|
|
82
|
+
...response,
|
|
83
|
+
status: response.status === "fallback_required" ? "confirmation_required" : response.status,
|
|
84
|
+
signerAddress: response.signerAddress ?? response.signer?.address,
|
|
85
|
+
typedData: response.typedData ?? response.typed_data
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function buildSignedResult(response, request) {
|
|
89
|
+
assertAddress(response.signerAddress, "signerAddress");
|
|
90
|
+
if (response.typedData) {
|
|
91
|
+
assertTypedDataMatchesRequest(
|
|
92
|
+
response.typedData,
|
|
93
|
+
request,
|
|
94
|
+
response.signerAddress
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
signature: response.signature,
|
|
99
|
+
signerAddress: response.signerAddress,
|
|
100
|
+
typedData: response.typedData ?? buildPersonalServerRegistrationTypedData({
|
|
101
|
+
ownerAddress: response.signerAddress,
|
|
102
|
+
...request
|
|
103
|
+
}),
|
|
104
|
+
intent: ACCOUNT_PERSONAL_SERVER_REGISTRATION_INTENT
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function assertTypedDataMatchesRequest(typedData, request, expectedSignerAddress) {
|
|
108
|
+
assertAddress(
|
|
109
|
+
typedData.message.ownerAddress,
|
|
110
|
+
"typedData.message.ownerAddress"
|
|
111
|
+
);
|
|
112
|
+
assertAddress(
|
|
113
|
+
typedData.message.serverAddress,
|
|
114
|
+
"typedData.message.serverAddress"
|
|
115
|
+
);
|
|
116
|
+
if (expectedSignerAddress && !sameAddress(typedData.message.ownerAddress, expectedSignerAddress)) {
|
|
117
|
+
throw new Error(
|
|
118
|
+
"Account typedData ownerAddress must match the expected signer address"
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
if (!sameAddress(typedData.message.serverAddress, request.serverAddress)) {
|
|
122
|
+
throw new Error(
|
|
123
|
+
"Account typedData serverAddress must match the requested serverAddress"
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
if (typedData.message.publicKey !== request.serverPublicKey) {
|
|
127
|
+
throw new Error(
|
|
128
|
+
"Account typedData publicKey must match the requested serverPublicKey"
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
if (typedData.message.serverUrl !== request.serverUrl) {
|
|
132
|
+
throw new Error(
|
|
133
|
+
"Account typedData serverUrl must match the requested serverUrl"
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
if (typedData.primaryType !== "ServerRegistration") {
|
|
137
|
+
throw new Error("Account typedData primaryType must be ServerRegistration");
|
|
138
|
+
}
|
|
139
|
+
if (JSON.stringify(typedData.types) !== JSON.stringify(SERVER_REGISTRATION_TYPES)) {
|
|
140
|
+
throw new Error("Account typedData types must be ServerRegistration types");
|
|
141
|
+
}
|
|
142
|
+
const expectedDomain = personalServerRegistrationDomain({
|
|
143
|
+
config: request.config,
|
|
144
|
+
chainId: request.chainId,
|
|
145
|
+
verifyingContract: request.verifyingContract
|
|
146
|
+
});
|
|
147
|
+
if (!domainsEqual(typedData.domain, expectedDomain)) {
|
|
148
|
+
throw new Error("Account typedData domain must match the requested domain");
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function sameAddress(a, b) {
|
|
152
|
+
return a.toLowerCase() === b.toLowerCase();
|
|
153
|
+
}
|
|
154
|
+
function domainsEqual(a, b) {
|
|
155
|
+
if (!a || !b) {
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
return a.name === b.name && a.version === b.version && Number(a.chainId) === Number(b.chainId) && String(a.verifyingContract ?? "").toLowerCase() === String(b.verifyingContract ?? "").toLowerCase() && a.salt === b.salt;
|
|
159
|
+
}
|
|
160
|
+
async function signPersonalServerRegistrationWithAccount(config, request) {
|
|
161
|
+
assertAddress(request.serverAddress, "serverAddress");
|
|
162
|
+
const fetchImpl = config.fetchImpl ?? globalThis.fetch.bind(globalThis);
|
|
163
|
+
const endpoint = new URL(
|
|
164
|
+
config.endpointPath ?? DEFAULT_ACCOUNT_PS_REGISTRATION_PATH,
|
|
165
|
+
`${trimTrailingSlash(config.accountOrigin)}/`
|
|
166
|
+
);
|
|
167
|
+
const response = await fetchImpl(endpoint, {
|
|
168
|
+
method: "POST",
|
|
169
|
+
headers: { "content-type": "application/json" },
|
|
170
|
+
credentials: "include",
|
|
171
|
+
body: JSON.stringify({
|
|
172
|
+
intent: ACCOUNT_PERSONAL_SERVER_REGISTRATION_INTENT,
|
|
173
|
+
serverAddress: request.serverAddress,
|
|
174
|
+
serverPublicKey: request.serverPublicKey,
|
|
175
|
+
serverUrl: request.serverUrl,
|
|
176
|
+
config: request.config,
|
|
177
|
+
chainId: request.chainId,
|
|
178
|
+
verifyingContract: request.verifyingContract
|
|
179
|
+
})
|
|
180
|
+
});
|
|
181
|
+
const body = normalizeAccountResponse(await parseAccountResponse(response));
|
|
182
|
+
if (body.status === "signed") {
|
|
183
|
+
if (!body.signature || !body.signerAddress) {
|
|
184
|
+
throw new Error(
|
|
185
|
+
"Account signed response must include signature and signerAddress"
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
return {
|
|
189
|
+
status: "signed",
|
|
190
|
+
result: buildSignedResult(
|
|
191
|
+
{
|
|
192
|
+
signature: body.signature,
|
|
193
|
+
signerAddress: body.signerAddress,
|
|
194
|
+
typedData: body.typedData
|
|
195
|
+
},
|
|
196
|
+
request
|
|
197
|
+
)
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
if (body.status === "confirmation_required") {
|
|
201
|
+
if (!body.typedData) {
|
|
202
|
+
throw new Error(
|
|
203
|
+
"Account confirmation_required response must include typedData"
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
assertTypedDataMatchesRequest(body.typedData, request, body.signerAddress);
|
|
207
|
+
if (!config.fallbackSigner) {
|
|
208
|
+
return {
|
|
209
|
+
status: "confirmation_required",
|
|
210
|
+
typedData: body.typedData,
|
|
211
|
+
signerAddress: body.signerAddress
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
assertTypedDataMatchesRequest(
|
|
215
|
+
body.typedData,
|
|
216
|
+
request,
|
|
217
|
+
config.fallbackSigner.address
|
|
218
|
+
);
|
|
219
|
+
const signature = await config.fallbackSigner.signTypedData(body.typedData);
|
|
220
|
+
return {
|
|
221
|
+
status: "fallback_signed",
|
|
222
|
+
accountStatus: "confirmation_required",
|
|
223
|
+
result: {
|
|
224
|
+
signature,
|
|
225
|
+
signerAddress: config.fallbackSigner.address,
|
|
226
|
+
typedData: body.typedData,
|
|
227
|
+
intent: ACCOUNT_PERSONAL_SERVER_REGISTRATION_INTENT
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
throw new Error(
|
|
232
|
+
`Unsupported Account PS registration signing status: ${String(body.status)}`
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
export {
|
|
236
|
+
ACCOUNT_PERSONAL_SERVER_REGISTRATION_INTENT,
|
|
237
|
+
AccountPersonalServerRegistrationError,
|
|
238
|
+
signPersonalServerRegistrationWithAccount
|
|
239
|
+
};
|
|
240
|
+
//# sourceMappingURL=personal-server-registration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/account/personal-server-registration.ts"],"sourcesContent":["/**\n * Optional first-party Account integration for Personal Server registration.\n *\n * The protocol helper lives in `protocol/personal-server-registration`.\n * This module is only for callers that want to use an Account deployment's\n * constrained silent-sign endpoint.\n *\n * @category Account\n */\n\nimport { isAddress, type Address, type Hex } from \"viem\";\nimport {\n buildPersonalServerRegistrationTypedData,\n type BuildPersonalServerRegistrationTypedDataInput,\n type PersonalServerRegistrationSignature,\n type PersonalServerRegistrationSigner,\n type PersonalServerRegistrationTypedData,\n personalServerRegistrationDomain,\n} from \"../protocol/personal-server-registration\";\nimport { SERVER_REGISTRATION_TYPES } from \"../protocol/eip712\";\n\nexport const ACCOUNT_PERSONAL_SERVER_REGISTRATION_INTENT =\n \"personal_server.server_registration.v1\" as const;\n\nexport type AccountPersonalServerRegistrationIntent =\n typeof ACCOUNT_PERSONAL_SERVER_REGISTRATION_INTENT;\n\nexport type AccountPersonalServerRegistrationStatus =\n | \"signed\"\n | \"confirmation_required\"\n | \"fallback_required\";\n\nexport interface AccountPersonalServerRegistrationRequest extends Omit<\n BuildPersonalServerRegistrationTypedDataInput,\n \"ownerAddress\"\n> {}\n\nexport interface AccountPersonalServerRegistrationConfig {\n /**\n * Origin for the Account deployment to call, e.g. an app-dev Account origin.\n * No production origin is assumed by the SDK.\n */\n accountOrigin: string;\n /**\n * Path for Account's constrained PS registration silent-sign endpoint.\n */\n endpointPath?: string;\n /**\n * Optional fetch implementation for tests and non-default runtimes.\n */\n fetchImpl?: typeof fetch;\n /**\n * Optional signer used when Account says user confirmation is required and\n * returns typed data for the caller to sign interactively.\n */\n fallbackSigner?: PersonalServerRegistrationSigner;\n}\n\nexport type AccountPersonalServerRegistrationSignature =\n PersonalServerRegistrationSignature & {\n intent: AccountPersonalServerRegistrationIntent;\n };\n\nexport interface AccountSignedPersonalServerRegistration {\n status: \"signed\";\n result: AccountPersonalServerRegistrationSignature;\n}\n\nexport interface AccountConfirmationRequiredPersonalServerRegistration {\n status: \"confirmation_required\";\n typedData: PersonalServerRegistrationTypedData;\n signerAddress?: Address;\n}\n\nexport interface AccountFallbackSignedPersonalServerRegistration {\n status: \"fallback_signed\";\n accountStatus: \"confirmation_required\";\n result: AccountPersonalServerRegistrationSignature;\n}\n\nexport type AccountPersonalServerRegistrationResult =\n | AccountSignedPersonalServerRegistration\n | AccountConfirmationRequiredPersonalServerRegistration\n | AccountFallbackSignedPersonalServerRegistration;\n\nexport class AccountPersonalServerRegistrationError extends Error {\n status: number;\n code?: string;\n details?: unknown;\n\n constructor(input: {\n status: number;\n message: string;\n code?: string;\n details?: unknown;\n }) {\n super(input.message);\n this.name = \"AccountPersonalServerRegistrationError\";\n this.status = input.status;\n this.code = input.code;\n this.details = input.details;\n }\n}\n\ninterface AccountSilentSignResponse {\n status: AccountPersonalServerRegistrationStatus;\n signature?: Hex;\n signerAddress?: Address;\n signer?: { address?: Address };\n typedData?: PersonalServerRegistrationTypedData;\n typed_data?: PersonalServerRegistrationTypedData;\n error?: unknown;\n}\n\n// Account-owned route policy. Protocol signing primitives deliberately do not\n// define Account intent names or API paths.\nconst DEFAULT_ACCOUNT_PS_REGISTRATION_PATH =\n \"/api/v1/intents/personal-server-registration/sign\";\n\nfunction trimTrailingSlash(value: string): string {\n return value.replace(/\\/+$/, \"\");\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\nasync function parseAccountResponse(\n response: Response,\n): Promise<AccountSilentSignResponse> {\n const body = (await response.json().catch(() => undefined)) as unknown;\n\n if (!response.ok) {\n throw new AccountPersonalServerRegistrationError({\n status: response.status,\n code: accountErrorCode(body),\n message: accountErrorMessage(response.status, body),\n details: body,\n });\n }\n\n return body as AccountSilentSignResponse;\n}\n\nfunction accountErrorMessage(status: number, body: unknown): string {\n const nestedMessage = nestedAccountErrorField(body, \"message\");\n if (nestedMessage) {\n return nestedMessage;\n }\n\n if (isRecord(body) && typeof body.message === \"string\") {\n return body.message;\n }\n\n const code = accountErrorCode(body);\n if (code) {\n return `Account PS registration signing failed: ${code}`;\n }\n\n return `Account PS registration signing failed: ${status}`;\n}\n\nfunction accountErrorCode(body: unknown): string | undefined {\n const nestedCode = nestedAccountErrorField(body, \"code\");\n if (nestedCode) {\n return nestedCode;\n }\n\n if (isRecord(body)) {\n if (typeof body.code === \"string\") {\n return body.code;\n }\n if (typeof body.error === \"string\") {\n return body.error;\n }\n }\n\n return undefined;\n}\n\nfunction nestedAccountErrorField(\n body: unknown,\n field: \"code\" | \"message\",\n): string | undefined {\n if (!isRecord(body) || !isRecord(body.error)) {\n return undefined;\n }\n\n const value = body.error[field];\n return typeof value === \"string\" ? value : undefined;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null;\n}\n\nfunction normalizeAccountResponse(\n response: AccountSilentSignResponse,\n): AccountSilentSignResponse {\n return {\n ...response,\n status:\n response.status === \"fallback_required\"\n ? \"confirmation_required\"\n : response.status,\n signerAddress: response.signerAddress ?? response.signer?.address,\n typedData: response.typedData ?? response.typed_data,\n };\n}\n\nfunction buildSignedResult(\n response: Required<\n Pick<AccountSilentSignResponse, \"signature\" | \"signerAddress\">\n > &\n Pick<AccountSilentSignResponse, \"typedData\">,\n request: AccountPersonalServerRegistrationRequest,\n): AccountPersonalServerRegistrationSignature {\n assertAddress(response.signerAddress, \"signerAddress\");\n if (response.typedData) {\n assertTypedDataMatchesRequest(\n response.typedData,\n request,\n response.signerAddress,\n );\n }\n\n return {\n signature: response.signature,\n signerAddress: response.signerAddress,\n typedData:\n response.typedData ??\n buildPersonalServerRegistrationTypedData({\n ownerAddress: response.signerAddress,\n ...request,\n }),\n intent: ACCOUNT_PERSONAL_SERVER_REGISTRATION_INTENT,\n };\n}\n\nfunction assertTypedDataMatchesRequest(\n typedData: PersonalServerRegistrationTypedData,\n request: AccountPersonalServerRegistrationRequest,\n expectedSignerAddress?: Address,\n): void {\n assertAddress(\n typedData.message.ownerAddress,\n \"typedData.message.ownerAddress\",\n );\n assertAddress(\n typedData.message.serverAddress,\n \"typedData.message.serverAddress\",\n );\n\n if (\n expectedSignerAddress &&\n !sameAddress(typedData.message.ownerAddress, expectedSignerAddress)\n ) {\n throw new Error(\n \"Account typedData ownerAddress must match the expected signer address\",\n );\n }\n\n if (!sameAddress(typedData.message.serverAddress, request.serverAddress)) {\n throw new Error(\n \"Account typedData serverAddress must match the requested serverAddress\",\n );\n }\n\n if (typedData.message.publicKey !== request.serverPublicKey) {\n throw new Error(\n \"Account typedData publicKey must match the requested serverPublicKey\",\n );\n }\n\n if (typedData.message.serverUrl !== request.serverUrl) {\n throw new Error(\n \"Account typedData serverUrl must match the requested serverUrl\",\n );\n }\n\n if (typedData.primaryType !== \"ServerRegistration\") {\n throw new Error(\"Account typedData primaryType must be ServerRegistration\");\n }\n\n if (\n JSON.stringify(typedData.types) !==\n JSON.stringify(SERVER_REGISTRATION_TYPES)\n ) {\n throw new Error(\"Account typedData types must be ServerRegistration types\");\n }\n\n const expectedDomain = personalServerRegistrationDomain({\n config: request.config,\n chainId: request.chainId,\n verifyingContract: request.verifyingContract,\n });\n if (!domainsEqual(typedData.domain, expectedDomain)) {\n throw new Error(\"Account typedData domain must match the requested domain\");\n }\n}\n\nfunction sameAddress(a: Address, b: Address): boolean {\n return a.toLowerCase() === b.toLowerCase();\n}\n\nfunction domainsEqual(\n a: PersonalServerRegistrationTypedData[\"domain\"],\n b: PersonalServerRegistrationTypedData[\"domain\"],\n): boolean {\n if (!a || !b) {\n return false;\n }\n\n return (\n a.name === b.name &&\n a.version === b.version &&\n Number(a.chainId) === Number(b.chainId) &&\n String(a.verifyingContract ?? \"\").toLowerCase() ===\n String(b.verifyingContract ?? \"\").toLowerCase() &&\n a.salt === b.salt\n );\n}\n\nexport async function signPersonalServerRegistrationWithAccount(\n config: AccountPersonalServerRegistrationConfig,\n request: AccountPersonalServerRegistrationRequest,\n): Promise<AccountPersonalServerRegistrationResult> {\n assertAddress(request.serverAddress, \"serverAddress\");\n\n const fetchImpl = config.fetchImpl ?? globalThis.fetch.bind(globalThis);\n const endpoint = new URL(\n config.endpointPath ?? DEFAULT_ACCOUNT_PS_REGISTRATION_PATH,\n `${trimTrailingSlash(config.accountOrigin)}/`,\n );\n\n const response = await fetchImpl(endpoint, {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\" },\n credentials: \"include\",\n body: JSON.stringify({\n intent: ACCOUNT_PERSONAL_SERVER_REGISTRATION_INTENT,\n serverAddress: request.serverAddress,\n serverPublicKey: request.serverPublicKey,\n serverUrl: request.serverUrl,\n config: request.config,\n chainId: request.chainId,\n verifyingContract: request.verifyingContract,\n }),\n });\n const body = normalizeAccountResponse(await parseAccountResponse(response));\n\n if (body.status === \"signed\") {\n if (!body.signature || !body.signerAddress) {\n throw new Error(\n \"Account signed response must include signature and signerAddress\",\n );\n }\n\n return {\n status: \"signed\",\n result: buildSignedResult(\n {\n signature: body.signature,\n signerAddress: body.signerAddress,\n typedData: body.typedData,\n },\n request,\n ),\n };\n }\n\n if (body.status === \"confirmation_required\") {\n if (!body.typedData) {\n throw new Error(\n \"Account confirmation_required response must include typedData\",\n );\n }\n assertTypedDataMatchesRequest(body.typedData, request, body.signerAddress);\n\n if (!config.fallbackSigner) {\n return {\n status: \"confirmation_required\",\n typedData: body.typedData,\n signerAddress: body.signerAddress,\n };\n }\n\n assertTypedDataMatchesRequest(\n body.typedData,\n request,\n config.fallbackSigner.address,\n );\n const signature = await config.fallbackSigner.signTypedData(body.typedData);\n\n return {\n status: \"fallback_signed\",\n accountStatus: \"confirmation_required\",\n result: {\n signature,\n signerAddress: config.fallbackSigner.address,\n typedData: body.typedData,\n intent: ACCOUNT_PERSONAL_SERVER_REGISTRATION_INTENT,\n },\n };\n }\n\n throw new Error(\n `Unsupported Account PS registration signing status: ${String(body.status)}`,\n );\n}\n"],"mappings":"AAUA,SAAS,iBAAyC;AAClD;AAAA,EACE;AAAA,EAKA;AAAA,OACK;AACP,SAAS,iCAAiC;AAEnC,MAAM,8CACX;AA+DK,MAAM,+CAA+C,MAAM;AAAA,EAChE;AAAA,EACA;AAAA,EACA;AAAA,EAEA,YAAY,OAKT;AACD,UAAM,MAAM,OAAO;AACnB,SAAK,OAAO;AACZ,SAAK,SAAS,MAAM;AACpB,SAAK,OAAO,MAAM;AAClB,SAAK,UAAU,MAAM;AAAA,EACvB;AACF;AAcA,MAAM,uCACJ;AAEF,SAAS,kBAAkB,OAAuB;AAChD,SAAO,MAAM,QAAQ,QAAQ,EAAE;AACjC;AAEA,SAAS,cAAc,OAAgB,MAAoB;AACzD,MAAI,CAAC,UAAU,KAAK,GAAG;AACrB,UAAM,IAAI,MAAM,GAAG,IAAI,8BAA8B;AAAA,EACvD;AACF;AAEA,eAAe,qBACb,UACoC;AACpC,QAAM,OAAQ,MAAM,SAAS,KAAK,EAAE,MAAM,MAAM,MAAS;AAEzD,MAAI,CAAC,SAAS,IAAI;AAChB,UAAM,IAAI,uCAAuC;AAAA,MAC/C,QAAQ,SAAS;AAAA,MACjB,MAAM,iBAAiB,IAAI;AAAA,MAC3B,SAAS,oBAAoB,SAAS,QAAQ,IAAI;AAAA,MAClD,SAAS;AAAA,IACX,CAAC;AAAA,EACH;AAEA,SAAO;AACT;AAEA,SAAS,oBAAoB,QAAgB,MAAuB;AAClE,QAAM,gBAAgB,wBAAwB,MAAM,SAAS;AAC7D,MAAI,eAAe;AACjB,WAAO;AAAA,EACT;AAEA,MAAI,SAAS,IAAI,KAAK,OAAO,KAAK,YAAY,UAAU;AACtD,WAAO,KAAK;AAAA,EACd;AAEA,QAAM,OAAO,iBAAiB,IAAI;AAClC,MAAI,MAAM;AACR,WAAO,2CAA2C,IAAI;AAAA,EACxD;AAEA,SAAO,2C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A,QAChB,eAAe,KAAK;AAAA,MACtB;AAAA,IACF;AAEA;AAAA,MACE,KAAK;AAAA,MACL;AAAA,MACA,OAAO,eAAe;AAAA,IACxB;AACA,UAAM,YAAY,MAAM,OAAO,eAAe,cAAc,KAAK,SAAS;AAE1E,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,eAAe;AAAA,MACf,QAAQ;AAAA,QACN;AAAA,QACA,eAAe,OAAO,eAAe;AAAA,QACrC,WAAW,KAAK;AAAA,QAChB,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,EACF;AAEA,QAAM,IAAI;AAAA,IACR,uDAAuD,OAAO,KAAK,MAAM,CAAC;AAAA,EAC5E;AACF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/auth/errors.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { computePkceChallenge, generatePkceVerifier } from "./pkce";
|
|
1
|
+
import { computePkceChallenge, generatePkceVerifier } from "./pkce.js";
|
|
2
2
|
import {
|
|
3
3
|
InMemoryTokenStore
|
|
4
|
-
} from "./token-store";
|
|
4
|
+
} from "./token-store.js";
|
|
5
5
|
const VERIFIER_TTL_SECONDS = 600;
|
|
6
6
|
const RESERVED_AUTHORIZE_PARAMS = /* @__PURE__ */ new Set([
|
|
7
7
|
"response_type",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { sha256 } from "@noble/hashes/sha2";
|
|
2
2
|
import { bytesToHex } from "viem";
|
|
3
|
-
import { toBase64 } from "../utils/encoding";
|
|
3
|
+
import { toBase64 } from "../utils/encoding.js";
|
|
4
4
|
const EMPTY_BODY_HASH = "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
|
|
5
5
|
const DEFAULT_TTL_SECONDS = 300;
|
|
6
6
|
function base64urlEncode(input) {
|
package/dist/auth/web3-signed.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { recoverMessageAddress } from "viem";
|
|
2
|
-
import { fromBase64 } from "../utils/encoding";
|
|
2
|
+
import { fromBase64 } from "../utils/encoding.js";
|
|
3
3
|
import {
|
|
4
4
|
MissingAuthError,
|
|
5
5
|
InvalidSignatureError,
|
|
6
6
|
ExpiredTokenError
|
|
7
|
-
} from "./errors";
|
|
8
|
-
import { computeBodyHash } from "./web3-signed-builder";
|
|
7
|
+
} from "./errors.js";
|
|
8
|
+
import { computeBodyHash } from "./web3-signed-builder.js";
|
|
9
9
|
const WEB3_SIGNED_PREFIX = "Web3Signed ";
|
|
10
10
|
const CLOCK_SKEW_SECONDS = 60;
|
|
11
11
|
function base64urlDecode(input) {
|
package/dist/browser.js
CHANGED
package/dist/chains/index.js
CHANGED
package/dist/chains.browser.js
CHANGED
package/dist/chains.js
CHANGED
package/dist/chains.node.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getContract
|
|
3
3
|
} from "viem";
|
|
4
|
-
import { getAbi } from "../generated/abi";
|
|
5
|
-
import { getContractAddress, CONTRACT_ADDRESSES } from "../generated/addresses";
|
|
6
|
-
import { createClient } from "../core/client";
|
|
7
|
-
import { vanaMainnet } from "../config/chains";
|
|
4
|
+
import { getAbi } from "../generated/abi/index.js";
|
|
5
|
+
import { getContractAddress, CONTRACT_ADDRESSES } from "../generated/addresses.js";
|
|
6
|
+
import { createClient } from "../core/client.js";
|
|
7
|
+
import { vanaMainnet } from "../config/chains.js";
|
|
8
8
|
const contractCache = /* @__PURE__ */ new Map();
|
|
9
9
|
const contractCacheForTesting = contractCache;
|
|
10
10
|
function createCacheKey(contract, chainId) {
|
package/dist/core/client.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
http,
|
|
4
4
|
createWalletClient as viemCreateWalletClient
|
|
5
5
|
} from "viem";
|
|
6
|
-
import { chains, mokshaTestnet } from "../config/chains";
|
|
6
|
+
import { chains, mokshaTestnet } from "../config/chains.js";
|
|
7
7
|
const defaultFromBlocks = {
|
|
8
8
|
14800: 732312n,
|
|
9
9
|
// Moksha Testnet - earliest contract deployment
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ECIESError, isECIESEncrypted } from "./interface";
|
|
2
|
-
import { CURVE, CIPHER, KDF } from "./constants";
|
|
3
|
-
import { constantTimeEqual } from "./utils";
|
|
1
|
+
import { ECIESError, isECIESEncrypted } from "./interface.js";
|
|
2
|
+
import { CURVE, CIPHER, KDF } from "./constants.js";
|
|
3
|
+
import { constantTimeEqual } from "./utils.js";
|
|
4
4
|
import { concat } from "viem";
|
|
5
5
|
class BaseECIESUint8 {
|
|
6
6
|
// Cache for validated public keys to avoid repeated validation
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as secp256k1 from "@noble/secp256k1";
|
|
2
|
-
import { BaseECIESUint8 } from "./base";
|
|
2
|
+
import { BaseECIESUint8 } from "./base.js";
|
|
3
3
|
import { toHex } from "viem";
|
|
4
4
|
import { hmac } from "@noble/hashes/hmac";
|
|
5
5
|
import { sha256, sha512 as nobleSha512 } from "@noble/hashes/sha2";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
createDecipheriv
|
|
7
7
|
} from "crypto";
|
|
8
8
|
import secp256k1Import from "secp256k1";
|
|
9
|
-
import { BaseECIESUint8 } from "./base";
|
|
9
|
+
import { BaseECIESUint8 } from "./base.js";
|
|
10
10
|
import { toHex } from "viem";
|
|
11
11
|
const secp256k1 = secp256k1Import;
|
|
12
12
|
class NodeECIESUint8Provider extends BaseECIESUint8 {
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
processWalletPublicKey,
|
|
3
3
|
processWalletPrivateKey,
|
|
4
4
|
parseEncryptedDataBuffer
|
|
5
|
-
} from "../../utils/crypto-utils";
|
|
5
|
+
} from "../../utils/crypto-utils.js";
|
|
6
6
|
import { stringToBytes, bytesToString, toHex, fromHex, concat } from "viem";
|
|
7
7
|
class WalletKeyEncryptionService {
|
|
8
8
|
eciesProvider;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { ComputeEngineABI } from "./ComputeEngineImplementation";
|
|
2
|
-
import { DataRegistryABI } from "./DataRegistryImplementation";
|
|
3
|
-
import { TeePoolPhalaABI } from "./TeePoolPhalaImplementation";
|
|
4
|
-
import { DataPortabilityPermissionsABI } from "./DataPortabilityPermissionsImplementation";
|
|
5
|
-
import { DataPortabilityServersABI } from "./DataPortabilityServersImplementation";
|
|
6
|
-
import { DataPortabilityGranteesABI } from "./DataPortabilityGranteesImplementation";
|
|
7
|
-
import { DataRefinerRegistryABI } from "./DataRefinerRegistryImplementation";
|
|
8
|
-
import { QueryEngineABI } from "./QueryEngineImplementation";
|
|
9
|
-
import { ComputeInstructionRegistryABI } from "./ComputeInstructionRegistryImplementation";
|
|
10
|
-
import { TeePoolEphemeralStandardABI } from "./TeePoolEphemeralStandardImplementation";
|
|
11
|
-
import { TeePoolPersistentStandardABI } from "./TeePoolPersistentStandardImplementation";
|
|
12
|
-
import { TeePoolPersistentGpuABI } from "./TeePoolPersistentGpuImplementation";
|
|
13
|
-
import { TeePoolDedicatedStandardABI } from "./TeePoolDedicatedStandardImplementation";
|
|
14
|
-
import { TeePoolDedicatedGpuABI } from "./TeePoolDedicatedGpuImplementation";
|
|
15
|
-
import { VanaEpochABI } from "./VanaEpochImplementation";
|
|
16
|
-
import { DLPRegistryABI } from "./DLPRegistryImplementation";
|
|
17
|
-
import { DLPRegistryTreasuryABI } from "./DLPTreasuryImplementation";
|
|
18
|
-
import { VanaTreasuryABI } from "./VanaTreasuryImplementation";
|
|
19
|
-
import { DLPRegistryTreasuryABI as DLPRegistryTreasuryImplementationABI } from "./DLPRegistryTreasuryImplementation";
|
|
20
|
-
import { VanaPoolStakingABI } from "./VanaPoolStakingImplementation";
|
|
21
|
-
import { VanaPoolEntityABI } from "./VanaPoolEntityImplementation";
|
|
22
|
-
import { VanaPoolTreasuryABI } from "./VanaPoolTreasuryImplementation";
|
|
23
|
-
import { DATABI } from "./DATImplementation";
|
|
24
|
-
import { DATFactoryABI } from "./DATFactoryImplementation";
|
|
25
|
-
import { DATPausableABI } from "./DATPausableImplementation";
|
|
26
|
-
import { DATVotesABI } from "./DATVotesImplementation";
|
|
1
|
+
import { ComputeEngineABI } from "./ComputeEngineImplementation.js";
|
|
2
|
+
import { DataRegistryABI } from "./DataRegistryImplementation.js";
|
|
3
|
+
import { TeePoolPhalaABI } from "./TeePoolPhalaImplementation.js";
|
|
4
|
+
import { DataPortabilityPermissionsABI } from "./DataPortabilityPermissionsImplementation.js";
|
|
5
|
+
import { DataPortabilityServersABI } from "./DataPortabilityServersImplementation.js";
|
|
6
|
+
import { DataPortabilityGranteesABI } from "./DataPortabilityGranteesImplementation.js";
|
|
7
|
+
import { DataRefinerRegistryABI } from "./DataRefinerRegistryImplementation.js";
|
|
8
|
+
import { QueryEngineABI } from "./QueryEngineImplementation.js";
|
|
9
|
+
import { ComputeInstructionRegistryABI } from "./ComputeInstructionRegistryImplementation.js";
|
|
10
|
+
import { TeePoolEphemeralStandardABI } from "./TeePoolEphemeralStandardImplementation.js";
|
|
11
|
+
import { TeePoolPersistentStandardABI } from "./TeePoolPersistentStandardImplementation.js";
|
|
12
|
+
import { TeePoolPersistentGpuABI } from "./TeePoolPersistentGpuImplementation.js";
|
|
13
|
+
import { TeePoolDedicatedStandardABI } from "./TeePoolDedicatedStandardImplementation.js";
|
|
14
|
+
import { TeePoolDedicatedGpuABI } from "./TeePoolDedicatedGpuImplementation.js";
|
|
15
|
+
import { VanaEpochABI } from "./VanaEpochImplementation.js";
|
|
16
|
+
import { DLPRegistryABI } from "./DLPRegistryImplementation.js";
|
|
17
|
+
import { DLPRegistryTreasuryABI } from "./DLPTreasuryImplementation.js";
|
|
18
|
+
import { VanaTreasuryABI } from "./VanaTreasuryImplementation.js";
|
|
19
|
+
import { DLPRegistryTreasuryABI as DLPRegistryTreasuryImplementationABI } from "./DLPRegistryTreasuryImplementation.js";
|
|
20
|
+
import { VanaPoolStakingABI } from "./VanaPoolStakingImplementation.js";
|
|
21
|
+
import { VanaPoolEntityABI } from "./VanaPoolEntityImplementation.js";
|
|
22
|
+
import { VanaPoolTreasuryABI } from "./VanaPoolTreasuryImplementation.js";
|
|
23
|
+
import { DATABI } from "./DATImplementation.js";
|
|
24
|
+
import { DATFactoryABI } from "./DATFactoryImplementation.js";
|
|
25
|
+
import { DATPausableABI } from "./DATPausableImplementation.js";
|
|
26
|
+
import { DATVotesABI } from "./DATVotesImplementation.js";
|
|
27
27
|
const contractAbis = {
|
|
28
28
|
DataPortabilityPermissions: DataPortabilityPermissionsABI,
|
|
29
29
|
DataPortabilityServers: DataPortabilityServersABI,
|
package/dist/index.browser.d.ts
CHANGED
|
@@ -36,6 +36,10 @@ export { parseWeb3SignedHeader, verifyWeb3Signed, type Web3SignedPayload, type V
|
|
|
36
36
|
export { buildWeb3SignedHeader, computeBodyHash, type Web3SignedSignFn, } from "./auth/web3-signed-builder";
|
|
37
37
|
export { MissingAuthError, InvalidSignatureError, ExpiredTokenError, } from "./auth/errors";
|
|
38
38
|
export { fileRegistrationDomain, grantRegistrationDomain, grantRevocationDomain, serverRegistrationDomain, builderRegistrationDomain, FILE_REGISTRATION_TYPES, GRANT_REGISTRATION_TYPES, GRANT_REVOCATION_TYPES, SERVER_REGISTRATION_TYPES, BUILDER_REGISTRATION_TYPES, type DataPortabilityContracts, type DataPortabilityGatewayConfig, type FileRegistrationMessage, type GrantRegistrationMessage, type GrantRevocationMessage, type ServerRegistrationMessage, type BuilderRegistrationMessage, } from "./protocol/eip712";
|
|
39
|
+
export { PERSONAL_SERVER_REGISTRATION_DEFAULT_CHAIN_ID, PERSONAL_SERVER_REGISTRATION_DEFAULT_VERIFYING_CONTRACT, personalServerRegistrationDomain, createViemPersonalServerRegistrationSigner, buildPersonalServerRegistrationTypedData, buildPersonalServerRegistrationSignature, registerPersonalServerSignature, type PersonalServerRegistrationTypedData, type PersonalServerRegistrationSigner, type PersonalServerRegistrationDomainInput, type ViemPersonalServerRegistrationWalletClient, type ViemPersonalServerRegistrationSignerSource, type BuildPersonalServerRegistrationTypedDataInput, type BuildPersonalServerRegistrationSignatureInput, type PersonalServerRegistrationSignature, } from "./protocol/personal-server-registration";
|
|
40
|
+
export { PERSONAL_SERVER_LITE_OWNER_BINDING_VERSION, PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE, PERSONAL_SERVER_LITE_OWNER_BINDING_PREFIX, buildPersonalServerLiteOwnerBindingMessage, createViemPersonalServerLiteOwnerBindingSigner, buildPersonalServerLiteOwnerBindingSignature, signPersonalServerLiteOwnerBinding, type PersonalServerLiteOwnerBindingPurpose, type PersonalServerLiteOwnerBindingMessage, type PersonalServerLiteOwnerBindingSigner, type ViemPersonalServerLiteOwnerBindingWalletClient, type ViemPersonalServerLiteOwnerBindingSignerSource, type BuildPersonalServerLiteOwnerBindingSignatureInput, type PersonalServerLiteOwnerBindingSignature, } from "./protocol/personal-server-lite-owner-binding";
|
|
41
|
+
export { ACCOUNT_PERSONAL_SERVER_REGISTRATION_INTENT, AccountPersonalServerRegistrationError, signPersonalServerRegistrationWithAccount, type AccountPersonalServerRegistrationIntent, type AccountPersonalServerRegistrationSignature, type AccountPersonalServerRegistrationStatus, type AccountPersonalServerRegistrationRequest, type AccountPersonalServerRegistrationConfig, type AccountSignedPersonalServerRegistration, type AccountConfirmationRequiredPersonalServerRegistration, type AccountFallbackSignedPersonalServerRegistration, type AccountPersonalServerRegistrationResult, } from "./account/personal-server-registration";
|
|
42
|
+
export { AccountPersonalServerLiteOwnerBindingError, signPersonalServerLiteOwnerBindingWithAccountClient, type AccountPersonalServerLiteOwnerBindingClient, type SignPersonalServerLiteOwnerBindingWithAccountClientConfig, } from "./account/personal-server-lite-owner-binding";
|
|
39
43
|
export { isDataPortabilityGatewayConfig, parseGrantRegistrationPayload, verifyGrantRegistration, type DataPortabilityGrantPayload, type VerifyGrantRegistrationInput, type VerifyGrantRegistrationResult, } from "./protocol/grants";
|
|
40
44
|
export { ScopeSchema, parseScope, scopeToPathSegments, scopeMatchesPattern, scopeCoveredByGrant, type Scope, type ParsedScope, } from "./protocol/scopes";
|
|
41
45
|
export { DataFileEnvelopeSchema, createDataFileEnvelope, IngestResponseSchema, type DataFileEnvelope, type IngestResponse, } from "./protocol/data-file";
|