@opendatalabs/vana-sdk 3.4.1-canary.5ef490b → 3.4.1-canary.7afbfe0
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/dist/index.browser.d.ts +1 -0
- package/dist/index.browser.js +45 -0
- package/dist/index.browser.js.map +3 -3
- package/dist/index.node.cjs +48 -0
- package/dist/index.node.cjs.map +3 -3
- package/dist/index.node.d.ts +1 -0
- package/dist/index.node.js +45 -0
- package/dist/index.node.js.map +3 -3
- package/dist/protocol/grants.cjs +3 -0
- package/dist/protocol/grants.cjs.map +1 -1
- package/dist/protocol/grants.js +3 -0
- 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/package.json +1 -1
package/dist/index.browser.d.ts
CHANGED
|
@@ -46,5 +46,6 @@ export { DATA_REGISTRY_STATUS_ABI, DataPointStatus, dataRegistryContractAddress,
|
|
|
46
46
|
export { FEE_REGISTRY_ABI, REGISTRATION_KIND_FOR_OP, getFee, getOpFee, type FeeKind, type FeeEntry, type OpFee, type FeeRegistryOptions, } from "./protocol/fee-registry";
|
|
47
47
|
export { ScopeSchema, parseScope, scopeToPathSegments, scopeMatchesPattern, scopeCoveredByGrant, type Scope, type ParsedScope, } from "./protocol/scopes";
|
|
48
48
|
export { DataFileEnvelopeSchema, createDataFileEnvelope, IngestResponseSchema, type DataFileEnvelope, type IngestResponse, } from "./protocol/data-file";
|
|
49
|
+
export { personalServerDataReadPath, buildPersonalServerDataReadRequest, readPersonalServerData, type BuildPersonalServerDataReadRequestParams, type ReadPersonalServerDataParams, } from "./protocol/personal-server-data";
|
|
49
50
|
export { createGatewayClient, type GatewayEnvelope, type GatewayProof, type Builder, type Schema, type ServerInfo, type GatewayGrantResponse, type GatewayGrantStatus, type GatewayGrantFee, type GrantListItem, type DataPointRecord, type DataPointListResult, type ListDataPointsOptions, type RegisterServerParams, type RegisterServerResult, type RegisterBuilderParams, type RegisterBuilderResult, type RegisterDataPointParams, type RegisterDataPointResult, type CreateGrantParams, type RevokeGrantParams, type PayForOperationParams, type PayForOperationResult, type AccessRecord, type SettleOpType, type SettleItem, type SettlePromoteResult, type SettleReconcileItem, type SettleParams, type SettleResult, type SubmitDepositParams, type DepositState, type EscrowBalance, type EscrowBalanceEntry, type EscrowDepositSubmitted, type EscrowDepositFinalized, type EscrowDepositFailed, type GatewayClient, } from "./protocol/gateway";
|
|
50
51
|
export { PSError, parsePSError, type PSErrorCode } from "./types/ps-errors";
|
package/dist/index.browser.js
CHANGED
|
@@ -32432,6 +32432,9 @@ function isDataPortabilityGatewayConfig(value) {
|
|
|
32432
32432
|
}
|
|
32433
32433
|
function toUint256(value) {
|
|
32434
32434
|
try {
|
|
32435
|
+
if (typeof value === "number" && !Number.isSafeInteger(value)) {
|
|
32436
|
+
return null;
|
|
32437
|
+
}
|
|
32435
32438
|
const big = typeof value === "bigint" ? value : BigInt(value);
|
|
32436
32439
|
if (big < 0n) return null;
|
|
32437
32440
|
return big;
|
|
@@ -32741,6 +32744,45 @@ var IngestResponseSchema = z2.object({
|
|
|
32741
32744
|
status: z2.enum(["stored", "syncing"])
|
|
32742
32745
|
});
|
|
32743
32746
|
|
|
32747
|
+
// src/protocol/personal-server-data.ts
|
|
32748
|
+
function personalServerDataReadPath(scope) {
|
|
32749
|
+
return `/v1/data/${encodeURIComponent(scope)}`;
|
|
32750
|
+
}
|
|
32751
|
+
async function buildPersonalServerDataReadRequest(params) {
|
|
32752
|
+
const path = personalServerDataReadPath(params.scope);
|
|
32753
|
+
const baseUrl = params.personalServerUrl.replace(/\/+$/, "");
|
|
32754
|
+
const audience = params.audience ?? baseUrl;
|
|
32755
|
+
const headers = new Headers(params.headers);
|
|
32756
|
+
headers.set(
|
|
32757
|
+
"Authorization",
|
|
32758
|
+
await buildWeb3SignedHeader({
|
|
32759
|
+
aud: audience,
|
|
32760
|
+
grantId: params.grantId,
|
|
32761
|
+
method: "GET",
|
|
32762
|
+
signMessage: params.signMessage,
|
|
32763
|
+
uri: path
|
|
32764
|
+
})
|
|
32765
|
+
);
|
|
32766
|
+
return new Request(`${baseUrl}${path}`, {
|
|
32767
|
+
headers,
|
|
32768
|
+
method: "GET"
|
|
32769
|
+
});
|
|
32770
|
+
}
|
|
32771
|
+
async function readPersonalServerData(params) {
|
|
32772
|
+
const fetchFn = params.fetch ?? globalThis.fetch;
|
|
32773
|
+
if (fetchFn === void 0) {
|
|
32774
|
+
throw new Error("No fetch implementation available");
|
|
32775
|
+
}
|
|
32776
|
+
const request = await buildPersonalServerDataReadRequest(params);
|
|
32777
|
+
const response = await fetchFn(request);
|
|
32778
|
+
if (!response.ok) {
|
|
32779
|
+
throw new Error(
|
|
32780
|
+
`Personal Server data read failed: ${response.status} ${response.statusText}`
|
|
32781
|
+
);
|
|
32782
|
+
}
|
|
32783
|
+
return DataFileEnvelopeSchema.parse(await response.json());
|
|
32784
|
+
}
|
|
32785
|
+
|
|
32744
32786
|
// src/protocol/gateway.ts
|
|
32745
32787
|
function createGatewayClient(baseUrl) {
|
|
32746
32788
|
const base = baseUrl.replace(/\/+$/, "");
|
|
@@ -33162,6 +33204,7 @@ export {
|
|
|
33162
33204
|
buildDepositNativeRequest,
|
|
33163
33205
|
buildDepositTokenRequest,
|
|
33164
33206
|
buildMarkDataPointUnavailableRequest,
|
|
33207
|
+
buildPersonalServerDataReadRequest,
|
|
33165
33208
|
buildPersonalServerLiteOwnerBindingMessage,
|
|
33166
33209
|
buildPersonalServerLiteOwnerBindingSignature,
|
|
33167
33210
|
buildPersonalServerRegistrationSignature,
|
|
@@ -33217,7 +33260,9 @@ export {
|
|
|
33217
33260
|
parsePSError,
|
|
33218
33261
|
parseScope,
|
|
33219
33262
|
parseWeb3SignedHeader,
|
|
33263
|
+
personalServerDataReadPath,
|
|
33220
33264
|
personalServerRegistrationDomain,
|
|
33265
|
+
readPersonalServerData,
|
|
33221
33266
|
recoverServerOwner,
|
|
33222
33267
|
registerPersonalServerSignature,
|
|
33223
33268
|
scopeCoveredByGrant,
|