@xyo-network/data 5.3.20 → 5.3.24

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/data",
3
- "version": "5.3.20",
3
+ "version": "5.3.24",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -30,20 +30,29 @@
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "files": [
32
32
  "dist",
33
- "src",
34
33
  "!**/*.bench.*",
35
34
  "!**/*.spec.*",
36
- "!**/*.test.*"
35
+ "!**/*.test.*",
36
+ "README.md"
37
37
  ],
38
38
  "dependencies": {
39
39
  "@scure/base": "~2.0.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@xylabs/sdk-js": "^5.0.90",
43
- "@xylabs/tsconfig": "~7.5.6",
44
- "@xylabs/vitest-extended": "~5.0.90",
42
+ "@opentelemetry/api": "^1.9.1",
43
+ "@scure/base": "~2.0.0",
44
+ "@types/node": "^25.5.0",
45
+ "@xylabs/sdk-js": "^5.0.93",
46
+ "@xylabs/ts-scripts-common": "~7.6.16",
47
+ "@xylabs/ts-scripts-pnpm": "~7.6.16",
48
+ "@xylabs/tsconfig": "~7.6.16",
49
+ "@xylabs/vitest-extended": "~5.0.93",
50
+ "acorn": "^8.16.0",
51
+ "axios": "^1.14.0",
52
+ "esbuild": "^0.28.0",
45
53
  "ethers": "^6.16.0",
46
54
  "typescript": "~5.9.3",
55
+ "vite": "^8.0.3",
47
56
  "vitest": "~4.1.2",
48
57
  "zod": "^4.3.6"
49
58
  },
@@ -59,4 +68,4 @@
59
68
  "publishConfig": {
60
69
  "access": "public"
61
70
  }
62
- }
71
+ }
@@ -1,26 +0,0 @@
1
- import type { Hex } from '@xylabs/sdk-js'
2
-
3
- export interface DataInstance {
4
- base58: string
5
- bytes: ArrayBufferLike
6
- hex: Hex
7
- keccak256: ArrayBufferLike
8
- }
9
-
10
- export abstract class AbstractData implements DataInstance {
11
- get length() {
12
- return this.bytes.byteLength
13
- }
14
-
15
- abstract get base58(): string
16
-
17
- abstract get bytes(): ArrayBufferLike
18
-
19
- abstract get hex(): Hex
20
-
21
- abstract get keccak256(): ArrayBufferLike
22
-
23
- static is(value: unknown): value is AbstractData {
24
- return value instanceof AbstractData
25
- }
26
- }
package/src/Data.ts DELETED
@@ -1,46 +0,0 @@
1
- import { base16, base58 } from '@scure/base'
2
- import type { Hex } from '@xylabs/sdk-js'
3
- import {
4
- assertEx, toArrayBuffer, toUint8Array,
5
- } from '@xylabs/sdk-js'
6
- import { keccak256 } from 'ethers'
7
-
8
- import { AbstractData } from './AbstractData.ts'
9
-
10
- export class Data extends AbstractData {
11
- private _bytes?: ArrayBufferLike
12
- private _length: number
13
-
14
- constructor(length: number, bytes?: ArrayBufferLike, base?: number) {
15
- super()
16
- this._bytes = toUint8Array(bytes, length, base)?.buffer
17
- this._length = length
18
- }
19
-
20
- get base58() {
21
- this.checkLength()
22
- return base58.encode(new Uint8Array(this.bytes))
23
- }
24
-
25
- get bytes() {
26
- return assertEx(this._bytes, () => 'Data uninitialized')
27
- }
28
-
29
- get hex() {
30
- this.checkLength()
31
- return base16.encode(new Uint8Array(this.bytes)).toLowerCase() as Hex
32
- }
33
-
34
- get keccak256() {
35
- this.checkLength()
36
- return toArrayBuffer(keccak256(new Uint8Array(this.bytes)))
37
- }
38
-
39
- static from(data: ArrayBuffer | undefined) {
40
- return data ? new Data(data.byteLength, data) : undefined
41
- }
42
-
43
- private checkLength() {
44
- assertEx(this.bytes.byteLength === this._length, () => `Length Mismatch: ${this.bytes.byteLength} !== ${this._length} => ${this.bytes}`)
45
- }
46
- }
package/src/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './AbstractData.ts'
2
- export * from './Data.ts'