@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.
@@ -1187,6 +1187,7 @@ __export(index_node_exports, {
1187
1187
  DropboxStorage: () => DropboxStorage,
1188
1188
  ECIESError: () => ECIESError,
1189
1189
  ExpiredTokenError: () => ExpiredTokenError,
1190
+ FILE_DELETION_TYPES: () => FILE_DELETION_TYPES,
1190
1191
  FILE_REGISTRATION_TYPES: () => FILE_REGISTRATION_TYPES,
1191
1192
  GRANT_REGISTRATION_TYPES: () => GRANT_REGISTRATION_TYPES,
1192
1193
  GRANT_REVOCATION_TYPES: () => GRANT_REVOCATION_TYPES,
@@ -1256,6 +1257,7 @@ __export(index_node_exports, {
1256
1257
  deserializeECIES: () => deserializeECIES,
1257
1258
  detectPlatform: () => detectPlatform,
1258
1259
  encryptWithPassword: () => encryptWithPassword,
1260
+ fileDeletionDomain: () => fileDeletionDomain,
1259
1261
  fileRegistrationDomain: () => fileRegistrationDomain,
1260
1262
  generatePkceVerifier: () => generatePkceVerifier,
1261
1263
  getAbi: () => getAbi,
@@ -32661,6 +32663,12 @@ function fileRegistrationDomain(config) {
32661
32663
  config.contracts.dataRegistry
32662
32664
  );
32663
32665
  }
32666
+ function fileDeletionDomain(config) {
32667
+ return buildDomain(
32668
+ config.chainId,
32669
+ config.contracts.dataRegistry
32670
+ );
32671
+ }
32664
32672
  function grantRegistrationDomain(config) {
32665
32673
  return buildDomain(
32666
32674
  config.chainId,
@@ -32692,6 +32700,12 @@ var FILE_REGISTRATION_TYPES = {
32692
32700
  { name: "schemaId", type: "bytes32" }
32693
32701
  ]
32694
32702
  };
32703
+ var FILE_DELETION_TYPES = {
32704
+ FileDeletion: [
32705
+ { name: "ownerAddress", type: "address" },
32706
+ { name: "fileId", type: "bytes32" }
32707
+ ]
32708
+ };
32695
32709
  var GRANT_REGISTRATION_TYPES = {
32696
32710
  GrantRegistration: [
32697
32711
  { name: "grantorAddress", type: "address" },
@@ -33525,6 +33539,22 @@ function createGatewayClient(baseUrl) {
33525
33539
  if (!res.ok) {
33526
33540
  throw new Error(`Gateway error: ${res.status} ${res.statusText}`);
33527
33541
  }
33542
+ },
33543
+ async deleteFile(params) {
33544
+ const res = await fetch(`${base}/v1/files/${params.fileId}`, {
33545
+ method: "DELETE",
33546
+ headers: {
33547
+ "Content-Type": "application/json",
33548
+ Authorization: `Web3Signed ${params.signature}`
33549
+ },
33550
+ body: JSON.stringify({
33551
+ ownerAddress: params.ownerAddress
33552
+ })
33553
+ });
33554
+ if (res.status === 409) return;
33555
+ if (!res.ok) {
33556
+ throw new Error(`Gateway error: ${res.status} ${res.statusText}`);
33557
+ }
33528
33558
  }
33529
33559
  };
33530
33560
  }
@@ -33607,6 +33637,7 @@ async function parsePSError(response) {
33607
33637
  DropboxStorage,
33608
33638
  ECIESError,
33609
33639
  ExpiredTokenError,
33640
+ FILE_DELETION_TYPES,
33610
33641
  FILE_REGISTRATION_TYPES,
33611
33642
  GRANT_REGISTRATION_TYPES,
33612
33643
  GRANT_REVOCATION_TYPES,
@@ -33676,6 +33707,7 @@ async function parsePSError(response) {
33676
33707
  deserializeECIES,
33677
33708
  detectPlatform,
33678
33709
  encryptWithPassword,
33710
+ fileDeletionDomain,
33679
33711
  fileRegistrationDomain,
33680
33712
  generatePkceVerifier,
33681
33713
  getAbi,