@xyo-network/previous-hash-store-storage 5.3.22 → 5.3.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/previous-hash-store-storage",
3
- "version": "5.3.22",
3
+ "version": "5.3.25",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -30,35 +30,33 @@
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "files": [
32
32
  "dist",
33
- "src",
34
33
  "!**/*.bench.*",
35
34
  "!**/*.spec.*",
36
35
  "!**/*.test.*",
37
36
  "README.md"
38
37
  ],
39
38
  "dependencies": {
40
- "@xyo-network/previous-hash-store-model": "~5.3.22",
41
- "store2": "~2.14.4"
39
+ "store2": "~2.14.4",
40
+ "@xyo-network/previous-hash-store-model": "~5.3.25"
42
41
  },
43
42
  "devDependencies": {
44
43
  "@opentelemetry/api": "^1.9.1",
45
44
  "@types/node": "^25.5.0",
46
45
  "@types/uuid": "~11.0.0",
47
- "@xylabs/sdk-js": "^5.0.91",
48
- "@xylabs/ts-scripts-common": "~7.6.8",
49
- "@xylabs/ts-scripts-yarn3": "~7.6.8",
50
- "@xylabs/tsconfig": "~7.6.8",
46
+ "@xylabs/sdk-js": "^5.0.93",
47
+ "@xylabs/ts-scripts-common": "~7.6.16",
48
+ "@xylabs/ts-scripts-pnpm": "~7.6.16",
49
+ "@xylabs/tsconfig": "~7.6.16",
51
50
  "acorn": "^8.16.0",
52
51
  "axios": "^1.14.0",
53
- "cosmiconfig": "^9.0.1",
54
- "esbuild": "^0.27.4",
55
- "eslint": "^10.1.0",
56
- "rollup": "^4.60.1",
52
+ "esbuild": "^0.28.0",
53
+ "store2": "~2.14.4",
57
54
  "typescript": "~5.9.3",
58
55
  "uuid": "~13.0.0",
59
56
  "vite": "^8.0.3",
60
57
  "vitest": "~4.1.2",
61
- "zod": "^4.3.6"
58
+ "zod": "^4.3.6",
59
+ "@xyo-network/previous-hash-store-model": "~5.3.25"
62
60
  },
63
61
  "peerDependencies": {
64
62
  "@xylabs/sdk-js": "^5",
@@ -67,4 +65,4 @@
67
65
  "publishConfig": {
68
66
  "access": "public"
69
67
  }
70
- }
68
+ }
@@ -1,53 +0,0 @@
1
- import type { Address, Hash } from '@xylabs/sdk-js'
2
- import type { PreviousHashStore } from '@xyo-network/previous-hash-store-model'
3
- import type { StoreBase } from 'store2'
4
- import store from 'store2'
5
-
6
- export type Storage = 'local' | 'session' | 'page'
7
-
8
- export type StoragePreviousHashOpts = {
9
- namespace?: string
10
- type?: Storage
11
- }
12
-
13
- export class StoragePreviousHashStore implements PreviousHashStore {
14
- static readonly DefaultNamespace = 'xyo-previous-hash-store'
15
- static readonly DefaultStorageType: Storage = 'local'
16
- private _namespace = StoragePreviousHashStore.DefaultNamespace
17
- private _storage: StoreBase | undefined
18
- private _type: Storage = StoragePreviousHashStore.DefaultStorageType
19
-
20
- constructor(opts?: StoragePreviousHashOpts) {
21
- if (opts?.namespace) this._namespace = opts.namespace
22
- if (opts?.type) this._type = opts.type
23
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
- this._storage = (store as any)[this.type].namespace(this.namespace)
25
- }
26
-
27
- get namespace() {
28
- return this._namespace
29
- }
30
-
31
- get type(): Storage {
32
- return this._type
33
- }
34
-
35
- private get storage(): StoreBase {
36
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
37
- if (!this?._storage) this._storage = (store as any)[this.type].namespace(this.namespace) as StoreBase
38
- return this._storage
39
- }
40
-
41
- async getItem(address: Address): Promise<Hash | null> {
42
- const value = await this.storage.get(address)
43
- return value ?? null
44
- }
45
-
46
- async removeItem(address: Address): Promise<void> {
47
- await this.storage.remove(address)
48
- }
49
-
50
- async setItem(address: Address, previousHash: Hash): Promise<void> {
51
- await this.storage.set(address, previousHash)
52
- }
53
- }
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './StoragePreviousHashStore.ts'