@xyo-network/os-runtime 3.0.7 → 3.0.9
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/index.mjs +36 -146
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +59 -58
- package/src/Caller.ts +1 -3
- package/src/DefaultsQueries.ts +2 -6
- package/src/XyOs.ts +4 -12
- package/src/XyOsBase.ts +1 -3
- package/src/XyOsDapp.ts +2 -6
- package/src/access-interfaces/ValidDappAccessInterfaces.ts +1 -3
- package/src/access-interfaces/registered-names/helpers/AccessNodeQueries.ts +1 -3
- package/src/access-interfaces/registered-names/helpers/resource/RegistrationsResource.ts +2 -6
- package/src/adapter/Base.ts +2 -6
- package/src/adapters/OsPubSubBridgeNetwork.ts +1 -3
- package/src/classes/cache/RunningDappCache.ts +2 -6
- package/src/classes/dapp/DefaultsResource.ts +2 -6
- package/src/classes/dapp/access/Caller.ts +1 -3
- package/src/classes/dapp/access/Queries.ts +2 -6
- package/src/classes/dapp/access/Resource.ts +2 -6
- package/src/classes/lib/Insertable.ts +1 -3
- package/src/classes/menu/Caller.ts +1 -3
- package/src/classes/menu/Queries.ts +1 -3
- package/src/classes/menu/Resource.ts +2 -6
- package/src/classes/node/Creator.ts +3 -9
- package/src/classes/node/DefaultPayloads/DappAccessPayloads.ts +1 -3
- package/src/classes/node/DefaultPayloads/DefaultPayloads.ts +1 -3
- package/src/classes/node/DefaultPayloads/SigningKeyPayloads.ts +2 -6
- package/src/classes/node/ExternalModulePermissions/ExternalModulePermissions.ts +1 -3
- package/src/classes/node/createDappContext.ts +2 -6
- package/src/classes/registration/DappRegistrationService.ts +4 -12
- package/src/classes/registration/ValidateDappAccessDiviner/Config.ts +1 -3
- package/src/classes/registration/ValidateDappAccessDiviner/Diviner.ts +2 -6
- package/src/classes/settings/Resource.ts +2 -6
- package/src/classes/settings/SettingsQueries.ts +2 -6
- package/src/classes/settings/badge/Resource.ts +1 -3
- package/src/event/bus/EventBus.ts +2 -8
- package/src/helpers/monitor/XyOsMonitor.ts +1 -3
- package/src/intent/Caller.ts +1 -3
- package/src/intent/Resource.ts +2 -6
- package/src/lib/ModuleAccountPaths.ts +1 -3
- package/src/lib/PayloadStore.ts +1 -3
- package/src/lib/isPayload.ts +1 -3
- package/src/profileModuleEvents.ts +2 -6
- package/src/stack/Manager.ts +1 -3
- package/src/stack/OsPubSubNetworkStack.ts +4 -12
- package/src/stack/OsSettingsStack.ts +2 -6
- package/src/stack/XyoPublicNetworkStack.ts +2 -6
- package/src/utils/buildWalletSeedPhrasePayload.ts +2 -6
- package/src/wallet/DappSeedPhraseRepository.ts +1 -3
package/package.json
CHANGED
|
@@ -1,46 +1,66 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/os-runtime",
|
|
3
|
+
"version": "3.0.9",
|
|
4
|
+
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
|
+
"homepage": "https://xyo.network",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "git+https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues",
|
|
8
|
+
"email": "support@xyo.network"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
13
|
+
},
|
|
14
|
+
"license": "LGPL-3.0-only",
|
|
3
15
|
"author": {
|
|
4
|
-
"email": "support@xyo.network",
|
|
5
16
|
"name": "XYO Development Team",
|
|
17
|
+
"email": "support@xyo.network",
|
|
6
18
|
"url": "https://xyo.network"
|
|
7
19
|
},
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"type": "module",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/neutral/index.d.ts",
|
|
25
|
+
"default": "./dist/neutral/index.mjs"
|
|
26
|
+
},
|
|
27
|
+
"./package.json": "./package.json"
|
|
11
28
|
},
|
|
29
|
+
"module": "dist/neutral/index.mjs",
|
|
30
|
+
"types": "dist/neutral/index.d.ts",
|
|
12
31
|
"dependencies": {
|
|
13
|
-
"@xylabs/assert": "^4.0.
|
|
14
|
-
"@xylabs/forget": "^4.0.
|
|
15
|
-
"@xylabs/hex": "^4.0.
|
|
16
|
-
"@xylabs/lodash": "^4.0.
|
|
17
|
-
"@xylabs/object": "^4.0.
|
|
18
|
-
"@xylabs/promise": "^4.0.
|
|
19
|
-
"@xyo-network/account": "^3.0.
|
|
20
|
-
"@xyo-network/archivist": "^3.0.
|
|
21
|
-
"@xyo-network/archivist-indexeddb": "^3.0.
|
|
22
|
-
"@xyo-network/archivist-model": "^3.0.
|
|
23
|
-
"@xyo-network/
|
|
24
|
-
"@xyo-network/
|
|
25
|
-
"@xyo-network/diviner-
|
|
26
|
-
"@xyo-network/diviner-
|
|
27
|
-
"@xyo-network/diviner-payload-
|
|
28
|
-
"@xyo-network/diviner-payload-
|
|
29
|
-
"@xyo-network/diviner-
|
|
30
|
-
"@xyo-network/
|
|
31
|
-
"@xyo-network/kernel
|
|
32
|
-
"@xyo-network/
|
|
33
|
-
"@xyo-network/manifest
|
|
34
|
-
"@xyo-network/
|
|
35
|
-
"@xyo-network/module-
|
|
36
|
-
"@xyo-network/module-
|
|
37
|
-
"@xyo-network/module-
|
|
38
|
-
"@xyo-network/module-
|
|
39
|
-
"@xyo-network/
|
|
40
|
-
"@xyo-network/
|
|
41
|
-
"@xyo-network/
|
|
42
|
-
"@xyo-network/payload-
|
|
43
|
-
"@xyo-network/
|
|
32
|
+
"@xylabs/assert": "^4.0.3",
|
|
33
|
+
"@xylabs/forget": "^4.0.3",
|
|
34
|
+
"@xylabs/hex": "^4.0.3",
|
|
35
|
+
"@xylabs/lodash": "^4.0.3",
|
|
36
|
+
"@xylabs/object": "^4.0.3",
|
|
37
|
+
"@xylabs/promise": "^4.0.3",
|
|
38
|
+
"@xyo-network/account": "^3.0.7",
|
|
39
|
+
"@xyo-network/archivist": "^3.0.7",
|
|
40
|
+
"@xyo-network/archivist-indexeddb": "^3.0.7",
|
|
41
|
+
"@xyo-network/archivist-model": "^3.0.7",
|
|
42
|
+
"@xyo-network/bios": "^3.0.9",
|
|
43
|
+
"@xyo-network/bridge-model": "^3.0.7",
|
|
44
|
+
"@xyo-network/diviner-abstract": "^3.0.7",
|
|
45
|
+
"@xyo-network/diviner-model": "^3.0.7",
|
|
46
|
+
"@xyo-network/diviner-payload-generic": "^3.0.7",
|
|
47
|
+
"@xyo-network/diviner-payload-indexeddb": "^3.0.7",
|
|
48
|
+
"@xyo-network/diviner-payload-model": "^3.0.7",
|
|
49
|
+
"@xyo-network/diviner-temporal-indexing-model": "^3.0.7",
|
|
50
|
+
"@xyo-network/kernel": "^3.0.9",
|
|
51
|
+
"@xyo-network/kernel-model": "^3.0.9",
|
|
52
|
+
"@xyo-network/manifest": "^3.0.7",
|
|
53
|
+
"@xyo-network/manifest-wrapper": "^3.0.7",
|
|
54
|
+
"@xyo-network/module-abstract": "^3.0.7",
|
|
55
|
+
"@xyo-network/module-events": "^3.0.7",
|
|
56
|
+
"@xyo-network/module-factory-locator": "^3.0.7",
|
|
57
|
+
"@xyo-network/module-model": "^3.0.7",
|
|
58
|
+
"@xyo-network/module-resolver": "^3.0.7",
|
|
59
|
+
"@xyo-network/node-model": "^3.0.7",
|
|
60
|
+
"@xyo-network/os-model": "^3.0.9",
|
|
61
|
+
"@xyo-network/payload-builder": "^3.0.7",
|
|
62
|
+
"@xyo-network/payload-model": "^3.0.7",
|
|
63
|
+
"@xyo-network/wallet-model": "^3.0.7",
|
|
44
64
|
"async-mutex": "^0.5.0",
|
|
45
65
|
"ethers": "^6.13.2",
|
|
46
66
|
"semver": "^7.6.3",
|
|
@@ -49,32 +69,13 @@
|
|
|
49
69
|
"devDependencies": {
|
|
50
70
|
"@types/semver": "^7.5.8",
|
|
51
71
|
"@types/uuid": "^10.0.0",
|
|
52
|
-
"@xylabs/ts-scripts-yarn3": "^4.0.0
|
|
53
|
-
"@xylabs/tsconfig": "^4.0.0
|
|
54
|
-
"@xyo-network/bios-nodejs": "^3.0.
|
|
72
|
+
"@xylabs/ts-scripts-yarn3": "^4.0.0",
|
|
73
|
+
"@xylabs/tsconfig": "^4.0.0",
|
|
74
|
+
"@xyo-network/bios-nodejs": "^3.0.9",
|
|
55
75
|
"typescript": "^5.5.4",
|
|
56
76
|
"vitest": "^2.0.5"
|
|
57
77
|
},
|
|
58
|
-
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
59
|
-
"exports": {
|
|
60
|
-
".": {
|
|
61
|
-
"types": "./dist/neutral/index.d.ts",
|
|
62
|
-
"default": "./dist/neutral/index.mjs"
|
|
63
|
-
},
|
|
64
|
-
"./package.json": "./package.json"
|
|
65
|
-
},
|
|
66
|
-
"module": "dist/neutral/index.mjs",
|
|
67
|
-
"types": "dist/neutral/index.d.ts",
|
|
68
|
-
"homepage": "https://xyo.network",
|
|
69
|
-
"license": "LGPL-3.0-only",
|
|
70
78
|
"publishConfig": {
|
|
71
79
|
"access": "public"
|
|
72
|
-
}
|
|
73
|
-
"repository": {
|
|
74
|
-
"type": "git",
|
|
75
|
-
"url": "git+https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
76
|
-
},
|
|
77
|
-
"sideEffects": false,
|
|
78
|
-
"version": "3.0.7",
|
|
79
|
-
"type": "module"
|
|
80
|
+
}
|
|
80
81
|
}
|
package/src/Caller.ts
CHANGED
|
@@ -23,9 +23,7 @@ import {
|
|
|
23
23
|
SigningKeySchema,
|
|
24
24
|
} from '@xyo-network/os-model'
|
|
25
25
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
26
|
-
import type {
|
|
27
|
-
Payload, WithMeta,
|
|
28
|
-
} from '@xyo-network/payload-model'
|
|
26
|
+
import type { Payload, WithMeta } from '@xyo-network/payload-model'
|
|
29
27
|
|
|
30
28
|
import { DappCallerBase } from './DappCallerBase.ts'
|
|
31
29
|
import { DappDefaultsResourceQueries } from './DefaultsQueries.ts'
|
package/src/DefaultsQueries.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import type { DivinerInstance } from '@xyo-network/diviner-model'
|
|
2
2
|
import { PayloadDivinerQuerySchema } from '@xyo-network/diviner-payload-model'
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
} from '@xyo-network/os-model'
|
|
6
|
-
import {
|
|
7
|
-
DappInjectableParamsSchema, NodeOsInfoSchema,
|
|
8
|
-
} from '@xyo-network/os-model'
|
|
3
|
+
import type { DappInjectableParams, NodeOsInfo } from '@xyo-network/os-model'
|
|
4
|
+
import { DappInjectableParamsSchema, NodeOsInfoSchema } from '@xyo-network/os-model'
|
|
9
5
|
import type { WithMeta } from '@xyo-network/payload-model'
|
|
10
6
|
|
|
11
7
|
export const DappDefaultsResourceQueries = {
|
package/src/XyOs.ts
CHANGED
|
@@ -20,15 +20,11 @@ import type { WalletInstance } from '@xyo-network/wallet-model'
|
|
|
20
20
|
import type { DappRegistrationServiceParams } from './classes/registration/index.ts'
|
|
21
21
|
import { DappRegistrationService } from './classes/registration/index.ts'
|
|
22
22
|
import { EventBus } from './event/index.ts'
|
|
23
|
-
import type {
|
|
24
|
-
MonitorEventConfig, XyOsMonitor,
|
|
25
|
-
} from './helpers/index.ts'
|
|
23
|
+
import type { MonitorEventConfig, XyOsMonitor } from './helpers/index.ts'
|
|
26
24
|
import { NameTransforms } from './lib/index.ts'
|
|
27
25
|
import { loadOsNode } from './loadOsNode.ts'
|
|
28
26
|
import type { OsPubSubNetworkStack } from './stack/index.ts'
|
|
29
|
-
import {
|
|
30
|
-
OsStackMap, StackManager,
|
|
31
|
-
} from './stack/index.ts'
|
|
27
|
+
import { OsStackMap, StackManager } from './stack/index.ts'
|
|
32
28
|
import type { XyOsContextParams } from './XyOsBase.ts'
|
|
33
29
|
import { XyOsContextBase } from './XyOsBase.ts'
|
|
34
30
|
|
|
@@ -87,15 +83,11 @@ export class XyOs extends XyOsContextBase<XyOsParams> implements XyOsContext {
|
|
|
87
83
|
}
|
|
88
84
|
|
|
89
85
|
static async monitor<T>(fn: () => Promise<T>, eventConfig: MonitorEventConfig): Promise<T> {
|
|
90
|
-
const {
|
|
91
|
-
name, additionalProperties,
|
|
92
|
-
} = eventConfig
|
|
86
|
+
const { name, additionalProperties } = eventConfig
|
|
93
87
|
const monitor = this.monitoring
|
|
94
88
|
monitor?.startTimer(name)
|
|
95
89
|
const result = await fn()
|
|
96
|
-
monitor?.stopTimer({
|
|
97
|
-
additionalProperties, name,
|
|
98
|
-
})
|
|
90
|
+
monitor?.stopTimer({ additionalProperties, name })
|
|
99
91
|
|
|
100
92
|
return result
|
|
101
93
|
}
|
package/src/XyOsBase.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { assertEx } from '@xylabs/assert'
|
|
2
|
-
import type {
|
|
3
|
-
BaseParams, JsonObject,
|
|
4
|
-
} from '@xylabs/object'
|
|
2
|
+
import type { BaseParams, JsonObject } from '@xylabs/object'
|
|
5
3
|
import type { Promisable } from '@xylabs/promise'
|
|
6
4
|
import type { WalletInstance } from '@xyo-network/account'
|
|
7
5
|
import type { KernelExternal } from '@xyo-network/kernel-model'
|
package/src/XyOsDapp.ts
CHANGED
|
@@ -62,9 +62,7 @@ export class XyOsDapp extends XyOsContextBase<XyOsDappContextParams> implements
|
|
|
62
62
|
|
|
63
63
|
console.log('XyOsDapp:boot:finalLocator', finalLocator)
|
|
64
64
|
|
|
65
|
-
const dappNodesWrapper = new ManifestWrapper({
|
|
66
|
-
...this.manifest, schema: DappPackageManifestPayloadSchema,
|
|
67
|
-
}, wallet, finalLocator)
|
|
65
|
+
const dappNodesWrapper = new ManifestWrapper({ ...this.manifest, schema: DappPackageManifestPayloadSchema }, wallet, finalLocator)
|
|
68
66
|
const dappNodes = await dappNodesWrapper.loadNodes()
|
|
69
67
|
|
|
70
68
|
// Derive a specific wallet for the dappManifestWrapper.
|
|
@@ -72,9 +70,7 @@ export class XyOsDapp extends XyOsContextBase<XyOsDappContextParams> implements
|
|
|
72
70
|
const dappManifestWallet = await wallet.derivePath('99999')
|
|
73
71
|
DappWindowManifest.nodes[0].config.name = this.dapp.name + 'Root'
|
|
74
72
|
const wrapper = new ManifestWrapper<DappPackageManifestPayload>(
|
|
75
|
-
{
|
|
76
|
-
...DappWindowManifest, schema: DappPackageManifestPayloadSchema,
|
|
77
|
-
},
|
|
73
|
+
{ ...DappWindowManifest, schema: DappPackageManifestPayloadSchema },
|
|
78
74
|
dappManifestWallet,
|
|
79
75
|
finalLocator,
|
|
80
76
|
)
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { DappAccessInterface } from '@xyo-network/os-model'
|
|
2
|
-
import {
|
|
3
|
-
RegisteredNames, RegisteredNamesInterface,
|
|
4
|
-
} from '@xyo-network/os-model'
|
|
2
|
+
import { RegisteredNames, RegisteredNamesInterface } from '@xyo-network/os-model'
|
|
5
3
|
|
|
6
4
|
export type ValidDappAccessInterfaces = typeof RegisteredNames
|
|
7
5
|
|
|
@@ -3,9 +3,7 @@ import { asArchivistInstance } from '@xyo-network/archivist-model'
|
|
|
3
3
|
import type {
|
|
4
4
|
DappAccessRequest, RegisteredDappAccess, TemporalIndexRegistrationResults, XyOsContext,
|
|
5
5
|
} from '@xyo-network/os-model'
|
|
6
|
-
import type {
|
|
7
|
-
WithMeta, WithSources,
|
|
8
|
-
} from '@xyo-network/payload-model'
|
|
6
|
+
import type { WithMeta, WithSources } from '@xyo-network/payload-model'
|
|
9
7
|
|
|
10
8
|
import { RunningDappAccessCache } from '../../../classes/cache/index.ts'
|
|
11
9
|
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { assertEx } from '@xylabs/assert'
|
|
2
2
|
import { isTemporalIndexingDivinerResultIndex } from '@xyo-network/diviner-temporal-indexing-model'
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
} from '@xyo-network/os-model'
|
|
6
|
-
import type {
|
|
7
|
-
WithMeta, WithSources,
|
|
8
|
-
} from '@xyo-network/payload-model'
|
|
3
|
+
import type { TemporalIndexRegistrationResults, XyOsContext } from '@xyo-network/os-model'
|
|
4
|
+
import type { WithMeta, WithSources } from '@xyo-network/payload-model'
|
|
9
5
|
import type { Listener } from 'ethers'
|
|
10
6
|
|
|
11
7
|
import type { ResourceStore } from '../../../../lib/index.ts'
|
package/src/adapter/Base.ts
CHANGED
|
@@ -6,12 +6,8 @@ import { asArchivistInstance } from '@xyo-network/archivist'
|
|
|
6
6
|
import type { KernelExternal } from '@xyo-network/kernel-model'
|
|
7
7
|
import { BaseEmitter } from '@xyo-network/module-abstract'
|
|
8
8
|
import { asAttachableNodeInstance } from '@xyo-network/node-model'
|
|
9
|
-
import type {
|
|
10
|
-
|
|
11
|
-
} from '@xyo-network/os-model'
|
|
12
|
-
import type {
|
|
13
|
-
Payload, WithMeta,
|
|
14
|
-
} from '@xyo-network/payload-model'
|
|
9
|
+
import type { NodeAdapter, NodeAdapterBaseEvents } from '@xyo-network/os-model'
|
|
10
|
+
import type { Payload, WithMeta } from '@xyo-network/payload-model'
|
|
15
11
|
import { v4 as uuid } from 'uuid'
|
|
16
12
|
|
|
17
13
|
type ModuleEventPayload = {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { KernelExternal } from '@xyo-network/kernel-model'
|
|
2
2
|
import type { AdapterSetCreator } from '@xyo-network/os-model'
|
|
3
|
-
import {
|
|
4
|
-
ExposedNodeOuterNodeName, PubSubBridgeNodeNodeName,
|
|
5
|
-
} from '@xyo-network/os-model'
|
|
3
|
+
import { ExposedNodeOuterNodeName, PubSubBridgeNodeNodeName } from '@xyo-network/os-model'
|
|
6
4
|
|
|
7
5
|
import { NetworkAdapter } from '../adapter/index.ts'
|
|
8
6
|
|
|
@@ -5,9 +5,7 @@ import type {
|
|
|
5
5
|
import { Mutex } from 'async-mutex'
|
|
6
6
|
|
|
7
7
|
import { XyOs } from '../../XyOs.ts'
|
|
8
|
-
import {
|
|
9
|
-
createDappContext, DappContextCreator,
|
|
10
|
-
} from '../node/index.ts'
|
|
8
|
+
import { createDappContext, DappContextCreator } from '../node/index.ts'
|
|
11
9
|
|
|
12
10
|
const findOrCreateMutex = new Mutex()
|
|
13
11
|
|
|
@@ -42,9 +40,7 @@ export class RunningDappCache {
|
|
|
42
40
|
|
|
43
41
|
return windowDappSet
|
|
44
42
|
}),
|
|
45
|
-
{
|
|
46
|
-
additionalProperties: { dappId }, name: 'Loading dApp',
|
|
47
|
-
},
|
|
43
|
+
{ additionalProperties: { dappId }, name: 'Loading dApp' },
|
|
48
44
|
)
|
|
49
45
|
}
|
|
50
46
|
|
|
@@ -2,15 +2,11 @@ import { assertEx } from '@xylabs/assert'
|
|
|
2
2
|
import type {
|
|
3
3
|
DappInjectableParams, NodeOsInfo, XyOsContext,
|
|
4
4
|
} from '@xyo-network/os-model'
|
|
5
|
-
import {
|
|
6
|
-
isDappInjectableParams, isNodeOsInfo,
|
|
7
|
-
} from '@xyo-network/os-model'
|
|
5
|
+
import { isDappInjectableParams, isNodeOsInfo } from '@xyo-network/os-model'
|
|
8
6
|
|
|
9
7
|
import { DappCallerBase } from '../../DappCallerBase.ts'
|
|
10
8
|
import { DappDefaultsResourceQueries } from '../../DefaultsQueries.ts'
|
|
11
|
-
import type {
|
|
12
|
-
Listener, ResourceStore,
|
|
13
|
-
} from '../../lib/index.ts'
|
|
9
|
+
import type { Listener, ResourceStore } from '../../lib/index.ts'
|
|
14
10
|
import { PayloadStore } from '../../lib/index.ts'
|
|
15
11
|
|
|
16
12
|
export type DappDefaultsResourceViews = 'nodeOsInfo' | 'dappInjectableParamsFromRoute'
|
|
@@ -12,9 +12,7 @@ import { isRegisteredDappAccessDappSet } from '@xyo-network/os-model'
|
|
|
12
12
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
13
13
|
|
|
14
14
|
import { OsCallerBase } from '../../../OsCallerBase.ts'
|
|
15
|
-
import {
|
|
16
|
-
RunningDappAccessCache, RunningDappCache,
|
|
17
|
-
} from '../../cache/index.ts'
|
|
15
|
+
import { RunningDappAccessCache, RunningDappCache } from '../../cache/index.ts'
|
|
18
16
|
|
|
19
17
|
/**
|
|
20
18
|
* Caller for managing Dapp Access Nodes
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import type { DivinerInstance } from '@xyo-network/diviner-model'
|
|
2
2
|
import { PayloadDivinerQuerySchema } from '@xyo-network/diviner-payload-model'
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
} from '@xyo-network/os-model'
|
|
6
|
-
import {
|
|
7
|
-
DappAccessRequestSchema, RegisteredDappAccessSchema,
|
|
8
|
-
} from '@xyo-network/os-model'
|
|
3
|
+
import type { DappAccessRequest, RegisteredDappAccess } from '@xyo-network/os-model'
|
|
4
|
+
import { DappAccessRequestSchema, RegisteredDappAccessSchema } from '@xyo-network/os-model'
|
|
9
5
|
import type { WithMeta } from '@xyo-network/payload-model'
|
|
10
6
|
|
|
11
7
|
const noResults: unknown[] = []
|
|
@@ -2,14 +2,10 @@ import { assertEx } from '@xylabs/assert'
|
|
|
2
2
|
import type {
|
|
3
3
|
DappAccessRequest, RegisteredDappAccess, XyOsContext,
|
|
4
4
|
} from '@xyo-network/os-model'
|
|
5
|
-
import {
|
|
6
|
-
isDappAccessRequestWithMeta, isRegisteredDappAccess,
|
|
7
|
-
} from '@xyo-network/os-model'
|
|
5
|
+
import { isDappAccessRequestWithMeta, isRegisteredDappAccess } from '@xyo-network/os-model'
|
|
8
6
|
|
|
9
7
|
import { DappCallerBase } from '../../../DappCallerBase.ts'
|
|
10
|
-
import type {
|
|
11
|
-
Listener, ResourceStore,
|
|
12
|
-
} from '../../../lib/index.ts'
|
|
8
|
+
import type { Listener, ResourceStore } from '../../../lib/index.ts'
|
|
13
9
|
import { PayloadStore } from '../../../lib/index.ts'
|
|
14
10
|
import { DappAccessRequestQueries } from './Queries.ts'
|
|
15
11
|
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
DappName, XyOsContext,
|
|
3
|
-
} from '@xyo-network/os-model'
|
|
1
|
+
import type { DappName, XyOsContext } from '@xyo-network/os-model'
|
|
4
2
|
import type { Payload } from '@xyo-network/payload-model'
|
|
5
3
|
|
|
6
4
|
export interface InsertableConstructor { new (_xyOs: XyOsContext, dappName: DappName): DefaultPayloadsInsertable }
|
|
@@ -9,9 +9,7 @@ import {
|
|
|
9
9
|
DappNavItemSelectionSchema,
|
|
10
10
|
} from '@xyo-network/os-model'
|
|
11
11
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
12
|
-
import type {
|
|
13
|
-
Payload, WithMeta,
|
|
14
|
-
} from '@xyo-network/payload-model'
|
|
12
|
+
import type { Payload, WithMeta } from '@xyo-network/payload-model'
|
|
15
13
|
|
|
16
14
|
import { DappCaller } from '../../Caller.ts'
|
|
17
15
|
|
|
@@ -11,9 +11,7 @@ import {
|
|
|
11
11
|
DappNavItemSelectionSchema,
|
|
12
12
|
DappNavMenuConfigSchema,
|
|
13
13
|
} from '@xyo-network/os-model'
|
|
14
|
-
import type {
|
|
15
|
-
WithMeta, WithSources,
|
|
16
|
-
} from '@xyo-network/payload-model'
|
|
14
|
+
import type { WithMeta, WithSources } from '@xyo-network/payload-model'
|
|
17
15
|
|
|
18
16
|
const NO_ITEMS: unknown[] = []
|
|
19
17
|
|
|
@@ -2,17 +2,13 @@ import { assertEx } from '@xylabs/assert'
|
|
|
2
2
|
import type {
|
|
3
3
|
DappNavItem, DappNavItemSelection, DappNavMenuConfig, XyOsContext,
|
|
4
4
|
} from '@xyo-network/os-model'
|
|
5
|
-
import {
|
|
6
|
-
isDappNavItemSelection, isDappNavMenuConfig,
|
|
7
|
-
} from '@xyo-network/os-model'
|
|
5
|
+
import { isDappNavItemSelection, isDappNavMenuConfig } from '@xyo-network/os-model'
|
|
8
6
|
import type {
|
|
9
7
|
Payload, WithMeta, WithSources,
|
|
10
8
|
} from '@xyo-network/payload-model'
|
|
11
9
|
|
|
12
10
|
import { DappCaller } from '../../Caller.ts'
|
|
13
|
-
import type {
|
|
14
|
-
Listener, ResourceStore,
|
|
15
|
-
} from '../../lib/index.ts'
|
|
11
|
+
import type { Listener, ResourceStore } from '../../lib/index.ts'
|
|
16
12
|
import { PayloadStore } from '../../lib/index.ts'
|
|
17
13
|
import { DappMenuQueries } from './Queries.ts'
|
|
18
14
|
|
|
@@ -39,9 +39,7 @@ export class DappContextCreator {
|
|
|
39
39
|
payload, dappName, publicChildren, privateChildren,
|
|
40
40
|
} = config
|
|
41
41
|
|
|
42
|
-
const {
|
|
43
|
-
external, manifestPayload,
|
|
44
|
-
} = this.parseDappPackageManifestPayload(payload, xnsNodeUrl, xnsNetwork)
|
|
42
|
+
const { external, manifestPayload } = this.parseDappPackageManifestPayload(payload, xnsNodeUrl, xnsNetwork)
|
|
45
43
|
console.debug('[DEBUG] dApp manifest', manifestPayload)
|
|
46
44
|
|
|
47
45
|
// derive a wallet for the dapp to use from the root wallet
|
|
@@ -71,17 +69,13 @@ export class DappContextCreator {
|
|
|
71
69
|
|
|
72
70
|
private static parseDappPackageManifestPayload(payload: DappPackageManifestPayload, xnsNodeUrl: string | undefined, xnsNetwork: string | undefined) {
|
|
73
71
|
// extract external permissions from package manifest payload
|
|
74
|
-
const {
|
|
75
|
-
external, ...manifestWithoutExternals
|
|
76
|
-
} = payload
|
|
72
|
+
const { external, ...manifestWithoutExternals } = payload
|
|
77
73
|
const manifestPayloadRaw: PackageManifestPayload = {
|
|
78
74
|
...manifestWithoutExternals,
|
|
79
75
|
schema: PackageManifestPayloadSchema,
|
|
80
76
|
}
|
|
81
77
|
const manifestPayload = ReplaceManifestTokens(manifestPayloadRaw, xnsNodeUrl, xnsNetwork)
|
|
82
|
-
return {
|
|
83
|
-
external, manifestPayload,
|
|
84
|
-
}
|
|
78
|
+
return { external, manifestPayload }
|
|
85
79
|
}
|
|
86
80
|
|
|
87
81
|
async loadDappContext(context: XyOsContext): Promise<XyOsContext> {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
DappName, XyOsContext,
|
|
3
|
-
} from '@xyo-network/os-model'
|
|
1
|
+
import type { DappName, XyOsContext } from '@xyo-network/os-model'
|
|
4
2
|
|
|
5
3
|
import { OsCallerBase } from '../../../OsCallerBase.ts'
|
|
6
4
|
import type { DefaultPayloadsInsertable } from '../../lib/index.ts'
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { ArchivistInstance } from '@xyo-network/archivist-model'
|
|
2
|
-
import type {
|
|
3
|
-
DappName, XyOsContext,
|
|
4
|
-
} from '@xyo-network/os-model'
|
|
2
|
+
import type { DappName, XyOsContext } from '@xyo-network/os-model'
|
|
5
3
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
6
4
|
import type { Payload } from '@xyo-network/payload-model'
|
|
7
5
|
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { assertEx } from '@xylabs/assert'
|
|
2
2
|
import { hexFrom } from '@xylabs/hex'
|
|
3
3
|
import { HDWallet } from '@xyo-network/account'
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
} from '@xyo-network/os-model'
|
|
7
|
-
import {
|
|
8
|
-
mnemonicArrayToString, SigningKeySchema,
|
|
9
|
-
} from '@xyo-network/os-model'
|
|
4
|
+
import type { DappName, XyOsContext } from '@xyo-network/os-model'
|
|
5
|
+
import { mnemonicArrayToString, SigningKeySchema } from '@xyo-network/os-model'
|
|
10
6
|
import type { Payload } from '@xyo-network/payload-model'
|
|
11
7
|
import { isAnyPayload } from '@xyo-network/payload-model'
|
|
12
8
|
import type { WalletInstance } from '@xyo-network/wallet-model'
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
AttachableModuleInstance, ModuleIdentifier,
|
|
3
|
-
} from '@xyo-network/module-model'
|
|
1
|
+
import type { AttachableModuleInstance, ModuleIdentifier } from '@xyo-network/module-model'
|
|
4
2
|
import type { NodeInstance } from '@xyo-network/node-model'
|
|
5
3
|
import type {
|
|
6
4
|
DappName, ExternalModule, XyOsContext,
|
|
@@ -33,16 +33,12 @@ export const createDappContext = async (
|
|
|
33
33
|
}
|
|
34
34
|
const wallet = await HDWallet.fromPhrase(seedPhrase)
|
|
35
35
|
const dappName = dapp.config.name
|
|
36
|
-
const {
|
|
37
|
-
config: dappConfig, params: dappParams,
|
|
38
|
-
} = dapp
|
|
36
|
+
const { config: dappConfig, params: dappParams } = dapp
|
|
39
37
|
|
|
40
38
|
const locator = resolveLocator((dappParams.locator ?? new ModuleFactoryLocator()).merge(context.platformLocator))
|
|
41
39
|
|
|
42
40
|
const params: DappNodesCreatorParams = {
|
|
43
|
-
config: {
|
|
44
|
-
dappName, payload: dappConfig.manifest,
|
|
45
|
-
},
|
|
41
|
+
config: { dappName, payload: dappConfig.manifest },
|
|
46
42
|
context,
|
|
47
43
|
locator,
|
|
48
44
|
wallet,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { forget } from '@xylabs/forget'
|
|
2
2
|
import type { Promisable } from '@xylabs/promise'
|
|
3
|
-
import {
|
|
4
|
-
fulfilled, rejected,
|
|
5
|
-
} from '@xylabs/promise'
|
|
3
|
+
import { fulfilled, rejected } from '@xylabs/promise'
|
|
6
4
|
import { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
|
|
7
5
|
import type {
|
|
8
6
|
DappPackageManifestPayload,
|
|
@@ -84,9 +82,7 @@ export class DappRegistrationService {
|
|
|
84
82
|
name = NameTransforms.moduleName(manifest.nodes[0]?.config.name),
|
|
85
83
|
): Promisable<XyOsDappContext> {
|
|
86
84
|
const dapp = new XyOsDapp({
|
|
87
|
-
dapp: {
|
|
88
|
-
id: dappId, name,
|
|
89
|
-
},
|
|
85
|
+
dapp: { id: dappId, name },
|
|
90
86
|
locator: this.locator,
|
|
91
87
|
manifest,
|
|
92
88
|
parent: this.context,
|
|
@@ -106,9 +102,7 @@ export class DappRegistrationService {
|
|
|
106
102
|
activeDapps.map(async (dappSet) => {
|
|
107
103
|
const { dapp } = dappSet
|
|
108
104
|
const registeredDapp = await this.dappRegistry.registerDapp(dapp)
|
|
109
|
-
const result: RegisteredDappSetResult = {
|
|
110
|
-
dapp: registeredDapp, dappIcon: dapp.icon,
|
|
111
|
-
}
|
|
105
|
+
const result: RegisteredDappSetResult = { dapp: registeredDapp, dappIcon: dapp.icon }
|
|
112
106
|
|
|
113
107
|
// Start post registration process in the background
|
|
114
108
|
const forgetHandlers = async () => {
|
|
@@ -128,9 +122,7 @@ export class DappRegistrationService {
|
|
|
128
122
|
|
|
129
123
|
for (const registeredDapp of succeeded) this.registeredDappSets.add(registeredDapp)
|
|
130
124
|
|
|
131
|
-
return {
|
|
132
|
-
failed, succeeded,
|
|
133
|
-
}
|
|
125
|
+
return { failed, succeeded }
|
|
134
126
|
}
|
|
135
127
|
|
|
136
128
|
private addConnectionRequests() {
|
|
@@ -3,9 +3,7 @@ import type { PackageManifestPayload } from '@xyo-network/manifest'
|
|
|
3
3
|
import type {
|
|
4
4
|
DappPackageManifestPayload, DappParams, RegisteredDappAccess, UnregisteredDappAccess,
|
|
5
5
|
} from '@xyo-network/os-model'
|
|
6
|
-
import type {
|
|
7
|
-
Payload, WithMeta,
|
|
8
|
-
} from '@xyo-network/payload-model'
|
|
6
|
+
import type { Payload, WithMeta } from '@xyo-network/payload-model'
|
|
9
7
|
import { isPayloadOfSchemaTypeWithMeta } from '@xyo-network/payload-model'
|
|
10
8
|
|
|
11
9
|
export const FailedAccessorSchema = 'network.xyo.os.failed.accessor.registration' as const
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import type { Address } from '@xylabs/hex'
|
|
2
2
|
import { HDWallet } from '@xyo-network/account'
|
|
3
3
|
import { AbstractDiviner } from '@xyo-network/diviner-abstract'
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
} from '@xyo-network/manifest'
|
|
7
|
-
import {
|
|
8
|
-
ManifestWrapper, PackageManifestPayloadSchema,
|
|
9
|
-
} from '@xyo-network/manifest'
|
|
4
|
+
import type { NodeManifestPayload, PackageManifestPayload } from '@xyo-network/manifest'
|
|
5
|
+
import { ManifestWrapper, PackageManifestPayloadSchema } from '@xyo-network/manifest'
|
|
10
6
|
import type { NodeInstance } from '@xyo-network/node-model'
|
|
11
7
|
import type {
|
|
12
8
|
DappPackageManifestPayload,
|
|
@@ -2,13 +2,9 @@ import { assertEx } from '@xylabs/assert'
|
|
|
2
2
|
import type {
|
|
3
3
|
NodeBackground, WalletSeedPhrase, XyOsContext,
|
|
4
4
|
} from '@xyo-network/os-model'
|
|
5
|
-
import {
|
|
6
|
-
isNodeBackground, isWalletSeedPhrase,
|
|
7
|
-
} from '@xyo-network/os-model'
|
|
5
|
+
import { isNodeBackground, isWalletSeedPhrase } from '@xyo-network/os-model'
|
|
8
6
|
|
|
9
|
-
import type {
|
|
10
|
-
Listener, ResourceStore,
|
|
11
|
-
} from '../../lib/index.ts'
|
|
7
|
+
import type { Listener, ResourceStore } from '../../lib/index.ts'
|
|
12
8
|
import { PayloadStore } from '../../lib/index.ts'
|
|
13
9
|
import { OsSettingsCallerBase } from './CallerBase.ts'
|
|
14
10
|
import { OsSettingsQueries } from './SettingsQueries.ts'
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import type { DivinerInstance } from '@xyo-network/diviner-model'
|
|
2
2
|
import { PayloadDivinerQuerySchema } from '@xyo-network/diviner-payload-model'
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
} from '@xyo-network/os-model'
|
|
6
|
-
import {
|
|
7
|
-
NodeBackgroundSchema, WalletSeedPhraseSchema,
|
|
8
|
-
} from '@xyo-network/os-model'
|
|
3
|
+
import type { NodeBackground, WalletSeedPhrase } from '@xyo-network/os-model'
|
|
4
|
+
import { NodeBackgroundSchema, WalletSeedPhraseSchema } from '@xyo-network/os-model'
|
|
9
5
|
import type { WithMeta } from '@xyo-network/payload-model'
|
|
10
6
|
|
|
11
7
|
const NO_RESULTS: WithMeta<WalletSeedPhrase>[] = []
|