@xyo-network/archivist-model 3.6.0-rc.1 → 3.6.0-rc.11
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/neutral/IndexDescription.d.ts +1 -3
- package/dist/neutral/IndexDescription.d.ts.map +1 -1
- package/dist/neutral/NextOptions.d.ts +3 -3
- package/dist/neutral/NextOptions.d.ts.map +1 -1
- package/dist/neutral/QueryFunctions.d.ts +2 -2
- package/dist/neutral/QueryFunctions.d.ts.map +1 -1
- package/dist/neutral/StorageMeta.d.ts +18 -0
- package/dist/neutral/StorageMeta.d.ts.map +1 -0
- package/dist/neutral/attachable/asAttachableInstance.d.ts +168 -42
- package/dist/neutral/attachable/asAttachableInstance.d.ts.map +1 -1
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/typeChecks.d.ts +545 -125
- package/dist/neutral/typeChecks.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/IndexDescription.ts +1 -5
- package/src/NextOptions.ts +3 -3
- package/src/QueryFunctions.ts +3 -3
- package/src/StorageMeta.ts +37 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeChecks.d.ts","sourceRoot":"","sources":["../../src/typeChecks.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAGlD,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"typeChecks.d.ts","sourceRoot":"","sources":["../../src/typeChecks.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAGlD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAA6F,CAAA;AAC7H,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sDAA2E,CAAA;AAEzG,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yEANE,iBAAiB,iCAClB,gBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yEAEiB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAC9B,gBAAoB;CAED,CAAA;AAC1E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAPA,iBAAiB,iCAClB,gBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAEiB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAC9B,gBAAoB;CAGG,CAAA;AAC9E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EAAwC,CAAA;AACxE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAA0C,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/archivist-model",
|
|
3
|
-
"version": "3.6.0-rc.
|
|
3
|
+
"version": "3.6.0-rc.11",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -29,18 +29,18 @@
|
|
|
29
29
|
"module": "dist/neutral/index.mjs",
|
|
30
30
|
"types": "dist/neutral/index.d.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@xylabs/hex": "^4.4.
|
|
33
|
-
"@xylabs/object": "^4.4.
|
|
34
|
-
"@xylabs/promise": "^4.4.
|
|
35
|
-
"@xylabs/typeof": "^4.4.
|
|
36
|
-
"@xyo-network/account-model": "^3.6.0-rc.
|
|
37
|
-
"@xyo-network/module-events": "^3.6.0-rc.
|
|
38
|
-
"@xyo-network/module-model": "^3.6.0-rc.
|
|
39
|
-
"@xyo-network/payload-model": "^3.6.0-rc.
|
|
32
|
+
"@xylabs/hex": "^4.4.24",
|
|
33
|
+
"@xylabs/object": "^4.4.24",
|
|
34
|
+
"@xylabs/promise": "^4.4.24",
|
|
35
|
+
"@xylabs/typeof": "^4.4.24",
|
|
36
|
+
"@xyo-network/account-model": "^3.6.0-rc.11",
|
|
37
|
+
"@xyo-network/module-events": "^3.6.0-rc.11",
|
|
38
|
+
"@xyo-network/module-model": "^3.6.0-rc.11",
|
|
39
|
+
"@xyo-network/payload-model": "^3.6.0-rc.11"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@xylabs/ts-scripts-yarn3": "^4.2.
|
|
43
|
-
"@xylabs/tsconfig": "^4.2.
|
|
42
|
+
"@xylabs/ts-scripts-yarn3": "^4.2.6",
|
|
43
|
+
"@xylabs/tsconfig": "^4.2.6",
|
|
44
44
|
"typescript": "^5.7.2"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
package/src/IndexDescription.ts
CHANGED
package/src/NextOptions.ts
CHANGED
package/src/QueryFunctions.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/hex'
|
|
2
2
|
import type { Promisable, PromisableArray } from '@xylabs/promise'
|
|
3
3
|
import type { ModuleQueryFunctions } from '@xyo-network/module-model'
|
|
4
|
-
import type { Payload } from '@xyo-network/payload-model'
|
|
4
|
+
import type { Payload, WithStorageMeta } from '@xyo-network/payload-model'
|
|
5
5
|
|
|
6
6
|
import type { NextOptions } from './NextOptions.ts'
|
|
7
7
|
|
|
@@ -26,8 +26,8 @@ export interface Archivist<
|
|
|
26
26
|
TWriteResponse extends Payload = Payload,
|
|
27
27
|
TWrite extends Payload = TReadResponse & Payload,
|
|
28
28
|
TId = Hash,
|
|
29
|
-
> extends ReadArchivist<TReadResponse
|
|
30
|
-
WriteArchivist<TReadResponse
|
|
29
|
+
> extends ReadArchivist<WithStorageMeta<TReadResponse>, TId>,
|
|
30
|
+
WriteArchivist<WithStorageMeta<TReadResponse>, WithStorageMeta<TWriteResponse>, TWrite, TId>,
|
|
31
31
|
StashArchivist<TWriteResponse> {}
|
|
32
32
|
|
|
33
33
|
export interface ArchivistQueryFunctions<
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Hash, Hex } from '@xylabs/hex'
|
|
2
|
+
import type { Payload } from '@xyo-network/payload-model'
|
|
3
|
+
|
|
4
|
+
export interface StorageMeta {
|
|
5
|
+
_dataHash: Hash
|
|
6
|
+
_hash: Hash
|
|
7
|
+
// this sequence number must be a 0 padded string representation of a 18 byte sequence number
|
|
8
|
+
_sequence: Hex // zero padded epoch/index (when returned, has address as suffix) - to be used as a universal cursor
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type WithPartialStorageMeta<T extends Payload = Payload> = Partial<WithStorageMeta<T>>
|
|
12
|
+
|
|
13
|
+
export type WithStorageMeta<T extends Payload = Payload> = T & StorageMeta
|
|
14
|
+
|
|
15
|
+
const StorageMetaComponentConstants = {
|
|
16
|
+
epochBytes: 8,
|
|
17
|
+
nonceBytes: 8,
|
|
18
|
+
addressBytes: 20,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const StorageMetaLocalConstants = {
|
|
22
|
+
maxEpoch: Math.pow(256, StorageMetaComponentConstants.epochBytes) - 1,
|
|
23
|
+
localSequenceBytes: StorageMetaComponentConstants.epochBytes + StorageMetaComponentConstants.nonceBytes,
|
|
24
|
+
...StorageMetaComponentConstants,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const SequenceConstants = {
|
|
28
|
+
qualifiedSequenceBytes: StorageMetaLocalConstants.localSequenceBytes + StorageMetaComponentConstants.addressBytes,
|
|
29
|
+
...StorageMetaLocalConstants,
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// "00005a7f354762f3ac1bc5ddc6cfd08d14" is and example of a local sequence string
|
|
33
|
+
|
|
34
|
+
// "00005a7f354762f3ac1bc5ddc6cfd08d14a123456789abcdef0123" is and example of a local sequence string
|
|
35
|
+
// epoch = "00005a7f354762f3ac"
|
|
36
|
+
// nonce = "1bc5ddc6cfd08d14"
|
|
37
|
+
// address = "a123456789abcdef0123"
|