@unicitylabs/sphere-sdk 0.2.1 → 0.2.3

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/l1/index.cjs CHANGED
@@ -944,6 +944,24 @@ var VestingClassifier = class {
944
944
  tx.objectStore(this.storeName).clear();
945
945
  }
946
946
  }
947
+ /**
948
+ * Destroy caches and delete the IndexedDB database entirely.
949
+ */
950
+ async destroy() {
951
+ this.memoryCache.clear();
952
+ if (this.db) {
953
+ this.db.close();
954
+ this.db = null;
955
+ }
956
+ if (typeof indexedDB !== "undefined") {
957
+ await new Promise((resolve) => {
958
+ const req = indexedDB.deleteDatabase(this.dbName);
959
+ req.onsuccess = () => resolve();
960
+ req.onerror = () => resolve();
961
+ req.onblocked = () => resolve();
962
+ });
963
+ }
964
+ }
947
965
  };
948
966
  var vestingClassifier = new VestingClassifier();
949
967