@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.
@@ -35,7 +35,7 @@ export { encryptWithPassword, decryptWithPassword, } from "./crypto/envelope/ope
35
35
  export { parseWeb3SignedHeader, verifyWeb3Signed, type Web3SignedPayload, type VerifiedAuth, } from "./auth/web3-signed";
36
36
  export { buildWeb3SignedHeader, computeBodyHash, type Web3SignedSignFn, } from "./auth/web3-signed-builder";
37
37
  export { MissingAuthError, InvalidSignatureError, ExpiredTokenError, } from "./auth/errors";
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";
@@ -31896,6 +31896,12 @@ function fileRegistrationDomain(config) {
31896
31896
  config.contracts.dataRegistry
31897
31897
  );
31898
31898
  }
31899
+ function fileDeletionDomain(config) {
31900
+ return buildDomain(
31901
+ config.chainId,
31902
+ config.contracts.dataRegistry
31903
+ );
31904
+ }
31899
31905
  function grantRegistrationDomain(config) {
31900
31906
  return buildDomain(
31901
31907
  config.chainId,
@@ -31927,6 +31933,12 @@ var FILE_REGISTRATION_TYPES = {
31927
31933
  { name: "schemaId", type: "bytes32" }
31928
31934
  ]
31929
31935
  };
31936
+ var FILE_DELETION_TYPES = {
31937
+ FileDeletion: [
31938
+ { name: "ownerAddress", type: "address" },
31939
+ { name: "fileId", type: "bytes32" }
31940
+ ]
31941
+ };
31930
31942
  var GRANT_REGISTRATION_TYPES = {
31931
31943
  GrantRegistration: [
31932
31944
  { name: "grantorAddress", type: "address" },
@@ -32764,6 +32776,22 @@ function createGatewayClient(baseUrl) {
32764
32776
  if (!res.ok) {
32765
32777
  throw new Error(`Gateway error: ${res.status} ${res.statusText}`);
32766
32778
  }
32779
+ },
32780
+ async deleteFile(params) {
32781
+ const res = await fetch(`${base}/v1/files/${params.fileId}`, {
32782
+ method: "DELETE",
32783
+ headers: {
32784
+ "Content-Type": "application/json",
32785
+ Authorization: `Web3Signed ${params.signature}`
32786
+ },
32787
+ body: JSON.stringify({
32788
+ ownerAddress: params.ownerAddress
32789
+ })
32790
+ });
32791
+ if (res.status === 409) return;
32792
+ if (!res.ok) {
32793
+ throw new Error(`Gateway error: ${res.status} ${res.statusText}`);
32794
+ }
32767
32795
  }
32768
32796
  };
32769
32797
  }
@@ -32846,6 +32874,7 @@ export {
32846
32874
  DropboxStorage,
32847
32875
  ECIESError,
32848
32876
  ExpiredTokenError,
32877
+ FILE_DELETION_TYPES,
32849
32878
  FILE_REGISTRATION_TYPES,
32850
32879
  GRANT_REGISTRATION_TYPES,
32851
32880
  GRANT_REVOCATION_TYPES,
@@ -32910,6 +32939,7 @@ export {
32910
32939
  deserializeECIES,
32911
32940
  detectPlatform,
32912
32941
  encryptWithPassword,
32942
+ fileDeletionDomain,
32913
32943
  fileRegistrationDomain,
32914
32944
  generatePkceVerifier,
32915
32945
  getAbi,