@opendatalabs/vana-sdk 3.2.0 → 3.3.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/dist/index.browser.d.ts +2 -2
- package/dist/index.browser.js +30 -0
- package/dist/index.browser.js.map +2 -2
- package/dist/index.node.cjs +32 -0
- package/dist/index.node.cjs.map +2 -2
- package/dist/index.node.d.ts +2 -2
- package/dist/index.node.js +30 -0
- package/dist/index.node.js.map +2 -2
- package/dist/protocol/eip712.cjs +16 -0
- package/dist/protocol/eip712.cjs.map +1 -1
- package/dist/protocol/eip712.d.ts +19 -0
- package/dist/protocol/eip712.js +14 -0
- package/dist/protocol/eip712.js.map +1 -1
- package/dist/protocol/gateway.cjs +16 -0
- package/dist/protocol/gateway.cjs.map +1 -1
- package/dist/protocol/gateway.d.ts +13 -0
- package/dist/protocol/gateway.js +16 -0
- package/dist/protocol/gateway.js.map +1 -1
- package/package.json +1 -1
package/dist/index.node.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export { MissingAuthError, InvalidSignatureError, ExpiredTokenError, } from "./a
|
|
|
35
35
|
export { generatePkceVerifier, computePkceChallenge, verifyPkceChallenge, assertValidPkceVerifier, PKCE_VERIFIER_PATTERN, PKCE_CHALLENGE_PATTERN, } from "./auth/pkce";
|
|
36
36
|
export { InMemoryTokenStore, type TokenStore, type TokenRecord, } from "./auth/token-store";
|
|
37
37
|
export { OAuthClient, type OAuthClientConfig, type AuthorizationUrlResult, } from "./auth/oauth-client";
|
|
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";
|
|
38
|
+
export { fileRegistrationDomain, fileDeletionDomain, grantRegistrationDomain, grantRevocationDomain, serverRegistrationDomain, builderRegistrationDomain, FILE_REGISTRATION_TYPES, FILE_DELETION_TYPES, GRANT_REGISTRATION_TYPES, GRANT_REVOCATION_TYPES, SERVER_REGISTRATION_TYPES, BUILDER_REGISTRATION_TYPES, type DataPortabilityContracts, type DataPortabilityGatewayConfig, type FileRegistrationMessage, type FileDeletionMessage, type GrantRegistrationMessage, type GrantRevocationMessage, type ServerRegistrationMessage, type BuilderRegistrationMessage, } from "./protocol/eip712";
|
|
39
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
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
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";
|
|
@@ -43,5 +43,5 @@ export { AccountPersonalServerLiteOwnerBindingError, signPersonalServerLiteOwner
|
|
|
43
43
|
export { isDataPortabilityGatewayConfig, parseGrantRegistrationPayload, verifyGrantRegistration, type DataPortabilityGrantPayload, type VerifyGrantRegistrationInput, type VerifyGrantRegistrationResult, } from "./protocol/grants";
|
|
44
44
|
export { ScopeSchema, parseScope, scopeToPathSegments, scopeMatchesPattern, scopeCoveredByGrant, type Scope, type ParsedScope, } from "./protocol/scopes";
|
|
45
45
|
export { DataFileEnvelopeSchema, createDataFileEnvelope, IngestResponseSchema, type DataFileEnvelope, type IngestResponse, } from "./protocol/data-file";
|
|
46
|
-
export { createGatewayClient, type GatewayEnvelope, type GatewayProof, type Builder, type Schema, type ServerInfo, type GatewayGrantResponse, type GrantListItem, type FileRecord, type FileListResult, type RegisterServerParams, type RegisterServerResult, type RegisterFileParams, type CreateGrantParams, type RevokeGrantParams, type GatewayClient, } from "./protocol/gateway";
|
|
46
|
+
export { createGatewayClient, type GatewayEnvelope, type GatewayProof, type Builder, type Schema, type ServerInfo, type GatewayGrantResponse, type GrantListItem, type FileRecord, type FileListResult, type RegisterServerParams, type RegisterServerResult, type RegisterFileParams, type CreateGrantParams, type RevokeGrantParams, type DeleteFileParams, type GatewayClient, } from "./protocol/gateway";
|
|
47
47
|
export { PSError, parsePSError, type PSErrorCode } from "./types/ps-errors";
|
package/dist/index.node.js
CHANGED
|
@@ -32523,6 +32523,12 @@ function fileRegistrationDomain(config) {
|
|
|
32523
32523
|
config.contracts.dataRegistry
|
|
32524
32524
|
);
|
|
32525
32525
|
}
|
|
32526
|
+
function fileDeletionDomain(config) {
|
|
32527
|
+
return buildDomain(
|
|
32528
|
+
config.chainId,
|
|
32529
|
+
config.contracts.dataRegistry
|
|
32530
|
+
);
|
|
32531
|
+
}
|
|
32526
32532
|
function grantRegistrationDomain(config) {
|
|
32527
32533
|
return buildDomain(
|
|
32528
32534
|
config.chainId,
|
|
@@ -32554,6 +32560,12 @@ var FILE_REGISTRATION_TYPES = {
|
|
|
32554
32560
|
{ name: "schemaId", type: "bytes32" }
|
|
32555
32561
|
]
|
|
32556
32562
|
};
|
|
32563
|
+
var FILE_DELETION_TYPES = {
|
|
32564
|
+
FileDeletion: [
|
|
32565
|
+
{ name: "ownerAddress", type: "address" },
|
|
32566
|
+
{ name: "fileId", type: "bytes32" }
|
|
32567
|
+
]
|
|
32568
|
+
};
|
|
32557
32569
|
var GRANT_REGISTRATION_TYPES = {
|
|
32558
32570
|
GrantRegistration: [
|
|
32559
32571
|
{ name: "grantorAddress", type: "address" },
|
|
@@ -33391,6 +33403,22 @@ function createGatewayClient(baseUrl) {
|
|
|
33391
33403
|
if (!res.ok) {
|
|
33392
33404
|
throw new Error(`Gateway error: ${res.status} ${res.statusText}`);
|
|
33393
33405
|
}
|
|
33406
|
+
},
|
|
33407
|
+
async deleteFile(params) {
|
|
33408
|
+
const res = await fetch(`${base}/v1/files/${params.fileId}`, {
|
|
33409
|
+
method: "DELETE",
|
|
33410
|
+
headers: {
|
|
33411
|
+
"Content-Type": "application/json",
|
|
33412
|
+
Authorization: `Web3Signed ${params.signature}`
|
|
33413
|
+
},
|
|
33414
|
+
body: JSON.stringify({
|
|
33415
|
+
ownerAddress: params.ownerAddress
|
|
33416
|
+
})
|
|
33417
|
+
});
|
|
33418
|
+
if (res.status === 409) return;
|
|
33419
|
+
if (!res.ok) {
|
|
33420
|
+
throw new Error(`Gateway error: ${res.status} ${res.statusText}`);
|
|
33421
|
+
}
|
|
33394
33422
|
}
|
|
33395
33423
|
};
|
|
33396
33424
|
}
|
|
@@ -33472,6 +33500,7 @@ export {
|
|
|
33472
33500
|
DropboxStorage,
|
|
33473
33501
|
ECIESError,
|
|
33474
33502
|
ExpiredTokenError,
|
|
33503
|
+
FILE_DELETION_TYPES,
|
|
33475
33504
|
FILE_REGISTRATION_TYPES,
|
|
33476
33505
|
GRANT_REGISTRATION_TYPES,
|
|
33477
33506
|
GRANT_REVOCATION_TYPES,
|
|
@@ -33541,6 +33570,7 @@ export {
|
|
|
33541
33570
|
deserializeECIES,
|
|
33542
33571
|
detectPlatform,
|
|
33543
33572
|
encryptWithPassword,
|
|
33573
|
+
fileDeletionDomain,
|
|
33544
33574
|
fileRegistrationDomain,
|
|
33545
33575
|
generatePkceVerifier,
|
|
33546
33576
|
getAbi,
|