@xyo-network/node-wrapper 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/node-wrapper",
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,45 +30,41 @@
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/account-model": "~5.3.22",
41
- "@xyo-network/manifest-model": "~5.3.22",
42
- "@xyo-network/module-model": "~5.3.22",
43
- "@xyo-network/module-wrapper": "~5.3.22",
44
- "@xyo-network/node-model": "~5.3.22",
45
- "@xyo-network/payload-model": "~5.3.22",
46
- "async-mutex": "~0.5.0"
39
+ "async-mutex": "~0.5.0",
40
+ "@xyo-network/account-model": "~5.3.25",
41
+ "@xyo-network/manifest-model": "~5.3.25",
42
+ "@xyo-network/module-wrapper": "~5.3.25",
43
+ "@xyo-network/module-model": "~5.3.25",
44
+ "@xyo-network/node-model": "~5.3.25",
45
+ "@xyo-network/payload-model": "~5.3.25"
47
46
  },
48
47
  "devDependencies": {
49
48
  "@opentelemetry/api": "^1.9.1",
50
49
  "@types/node": "^25.5.0",
51
- "@xylabs/sdk-js": "^5.0.91",
52
- "@xylabs/ts-scripts-common": "~7.6.8",
53
- "@xylabs/ts-scripts-yarn3": "~7.6.8",
54
- "@xylabs/tsconfig": "~7.6.8",
55
- "@xyo-network/account-model": "~5.3.22",
56
- "@xyo-network/manifest-model": "~5.3.22",
57
- "@xyo-network/module-model": "~5.3.22",
58
- "@xyo-network/module-wrapper": "~5.3.22",
59
- "@xyo-network/node-model": "~5.3.22",
60
- "@xyo-network/payload-model": "~5.3.22",
50
+ "@xylabs/sdk-js": "^5.0.93",
51
+ "@xylabs/ts-scripts-common": "~7.6.16",
52
+ "@xylabs/ts-scripts-pnpm": "~7.6.16",
53
+ "@xylabs/tsconfig": "~7.6.16",
61
54
  "acorn": "^8.16.0",
62
55
  "async-mutex": "~0.5.0",
63
56
  "axios": "^1.14.0",
64
- "cosmiconfig": "^9.0.1",
65
- "esbuild": "^0.27.4",
66
- "eslint": "^10.1.0",
57
+ "esbuild": "^0.28.0",
67
58
  "ethers": "^6.16.0",
68
- "rollup": "^4.60.1",
69
59
  "tslib": "^2.8.1",
70
60
  "typescript": "~5.9.3",
71
- "zod": "^4.3.6"
61
+ "zod": "^4.3.6",
62
+ "@xyo-network/account-model": "~5.3.25",
63
+ "@xyo-network/manifest-model": "~5.3.25",
64
+ "@xyo-network/module-model": "~5.3.25",
65
+ "@xyo-network/node-model": "~5.3.25",
66
+ "@xyo-network/payload-model": "~5.3.25",
67
+ "@xyo-network/module-wrapper": "~5.3.25"
72
68
  },
73
69
  "peerDependencies": {
74
70
  "@xylabs/sdk-js": "^5",
@@ -78,4 +74,4 @@
78
74
  "publishConfig": {
79
75
  "access": "public"
80
76
  }
81
- }
77
+ }
@@ -1,121 +0,0 @@
1
- import type { Address } from '@xylabs/sdk-js'
2
- import type { AccountInstance } from '@xyo-network/account-model'
3
- import type { NodeManifestPayload } from '@xyo-network/manifest-model'
4
- import { NodeManifestPayloadSchema } from '@xyo-network/manifest-model'
5
- import type {
6
- AddressPayload,
7
- InstanceTypeCheck,
8
- ModuleIdentifier,
9
- ModuleManifestQuery,
10
- ModuleQueryResult,
11
- } from '@xyo-network/module-model'
12
- import {
13
- AddressSchema,
14
- ModuleManifestQuerySchema,
15
- } from '@xyo-network/module-model'
16
- import { constructableModuleWrapper, ModuleWrapper } from '@xyo-network/module-wrapper'
17
- import type {
18
- ChildCertification,
19
- ChildCertificationFields,
20
- NodeAttachedQuery,
21
- NodeAttachQuery,
22
- NodeCertifyQuery,
23
- NodeDetachQuery,
24
- NodeInstance,
25
- NodeModule,
26
- NodeRegisteredQuery,
27
- } from '@xyo-network/node-model'
28
- import {
29
- ChildCertificationSchema,
30
- isNodeInstance,
31
- isNodeModule,
32
- NodeAttachedQuerySchema,
33
- NodeAttachQuerySchema,
34
- NodeCertifyQuerySchema,
35
- NodeDetachQuerySchema,
36
- NodeRegisteredQuerySchema,
37
- } from '@xyo-network/node-model'
38
- import { isPayloadOfSchemaType } from '@xyo-network/payload-model'
39
- import { Mutex } from 'async-mutex'
40
-
41
- constructableModuleWrapper()
42
- export class NodeWrapper<TWrappedModule extends NodeModule = NodeModule>
43
- extends ModuleWrapper<TWrappedModule>
44
- implements NodeInstance<TWrappedModule['params']> {
45
- static override readonly instanceIdentityCheck: InstanceTypeCheck<NodeInstance> = isNodeInstance
46
- static override readonly moduleIdentityCheck = isNodeModule
47
- static override readonly requiredQueries = [NodeAttachQuerySchema, ...ModuleWrapper.requiredQueries]
48
-
49
- protected _attached?: Address[]
50
- protected _attachedMutex = new Mutex()
51
-
52
- async attach(id: ModuleIdentifier, external?: boolean): Promise<Address | undefined> {
53
- const queryPayload: NodeAttachQuery = {
54
- external, id, schema: NodeAttachQuerySchema,
55
- }
56
- const payloads = (await this.sendQuery(queryPayload)).filter(isPayloadOfSchemaType<AddressPayload>(AddressSchema))
57
- return payloads.pop()?.address
58
- }
59
-
60
- async attachQuery(id: ModuleIdentifier, external?: boolean, account?: AccountInstance): Promise<ModuleQueryResult<AddressPayload>> {
61
- const queryPayload: NodeAttachQuery = {
62
- external, id, schema: NodeAttachQuerySchema,
63
- }
64
- return await this.sendQueryRaw(queryPayload, [], account)
65
- }
66
-
67
- async attached(): Promise<Address[]> {
68
- return await this._attachedMutex.runExclusive(async () => {
69
- if (this._attached === undefined) {
70
- const queryPayload: NodeAttachedQuery = { schema: NodeAttachedQuerySchema }
71
- const payloads = (await this.sendQuery(queryPayload)).filter(isPayloadOfSchemaType<AddressPayload>(AddressSchema))
72
- this._attached = payloads.map(p => p.address)
73
- }
74
- return this._attached
75
- })
76
- }
77
-
78
- async attachedQuery(account?: AccountInstance): Promise<ModuleQueryResult<AddressPayload>> {
79
- const queryPayload: NodeAttachedQuery = { schema: NodeAttachedQuerySchema }
80
- return await this.sendQueryRaw(queryPayload, [], account)
81
- }
82
-
83
- async certify(id: ModuleIdentifier): Promise<ChildCertificationFields | undefined> {
84
- const queryPayload: NodeCertifyQuery = { id, schema: NodeCertifyQuerySchema }
85
- const payloads = (await this.sendQuery(queryPayload)).filter(isPayloadOfSchemaType<ChildCertification>(ChildCertificationSchema))
86
- return payloads.pop()
87
- }
88
-
89
- async certifyQuery(id: ModuleIdentifier, account?: AccountInstance): Promise<ModuleQueryResult<ChildCertification>> {
90
- const queryPayload: NodeCertifyQuery = { id, schema: NodeCertifyQuerySchema }
91
- return await this.sendQueryRaw(queryPayload, [], account)
92
- }
93
-
94
- async detach(id: ModuleIdentifier): Promise<Address | undefined> {
95
- const queryPayload: NodeDetachQuery = { id, schema: NodeDetachQuerySchema }
96
- const payloads = (await this.sendQuery(queryPayload)).filter(isPayloadOfSchemaType<AddressPayload>(AddressSchema))
97
- return payloads.pop()?.address
98
- }
99
-
100
- async detachQuery(id: ModuleIdentifier, account?: AccountInstance): Promise<ModuleQueryResult<AddressPayload>> {
101
- const queryPayload: NodeDetachQuery = { id, schema: NodeDetachQuerySchema }
102
- return await this.sendQueryRaw(queryPayload, [], account)
103
- }
104
-
105
- override async manifest(maxDepth?: number): Promise<NodeManifestPayload> {
106
- const queryPayload: ModuleManifestQuery = { schema: ModuleManifestQuerySchema, ...(maxDepth ? { maxDepth } : {}) }
107
- const payloads = (await this.sendQuery(queryPayload)).filter(isPayloadOfSchemaType<NodeManifestPayload>(NodeManifestPayloadSchema))
108
- return payloads.pop() as NodeManifestPayload
109
- }
110
-
111
- async registered(): Promise<Address[]> {
112
- const queryPayload: NodeRegisteredQuery = { schema: NodeRegisteredQuerySchema }
113
- const payloads = (await this.sendQuery(queryPayload)).filter(isPayloadOfSchemaType<AddressPayload>(AddressSchema))
114
- return payloads.map(p => p.address)
115
- }
116
-
117
- async registeredQuery(account?: AccountInstance): Promise<ModuleQueryResult<AddressPayload>> {
118
- const queryPayload: NodeRegisteredQuery = { schema: NodeRegisteredQuerySchema }
119
- return await this.sendQueryRaw(queryPayload, [], account)
120
- }
121
- }
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './NodeWrapper.ts'