@xyo-network/os-runtime 3.0.0 → 3.0.1
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.d.ts +1 -1
- package/dist/neutral/index.mjs +3 -7
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +28 -28
- package/src/XyOs.ts +3 -2
- package/src/classes/cache/RunningDappCache.ts +7 -1
- package/src/classes/node/createDappContext.ts +7 -1
- package/src/classes/registration/ValidateDappAccessDiviner/Diviner.ts +1 -3
package/package.json
CHANGED
|
@@ -16,31 +16,31 @@
|
|
|
16
16
|
"@xylabs/lodash": "^4.0.2",
|
|
17
17
|
"@xylabs/object": "^4.0.2",
|
|
18
18
|
"@xylabs/promise": "^4.0.2",
|
|
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/bridge-model": "^3.0.
|
|
24
|
-
"@xyo-network/diviner-abstract": "^3.0.
|
|
25
|
-
"@xyo-network/diviner-model": "^3.0.
|
|
26
|
-
"@xyo-network/diviner-payload-generic": "^3.0.
|
|
27
|
-
"@xyo-network/diviner-payload-indexeddb": "^3.0.
|
|
28
|
-
"@xyo-network/diviner-payload-model": "^3.0.
|
|
29
|
-
"@xyo-network/diviner-temporal-indexing-model": "^3.0.
|
|
30
|
-
"@xyo-network/kernel": "^3.0.
|
|
31
|
-
"@xyo-network/kernel-model": "^3.0.
|
|
32
|
-
"@xyo-network/manifest": "^3.0.
|
|
33
|
-
"@xyo-network/manifest-wrapper": "^3.0.
|
|
34
|
-
"@xyo-network/module-abstract": "^3.0.
|
|
35
|
-
"@xyo-network/module-events": "^3.0.
|
|
36
|
-
"@xyo-network/module-factory-locator": "^3.0.
|
|
37
|
-
"@xyo-network/module-model": "^3.0.
|
|
38
|
-
"@xyo-network/module-resolver": "^3.0.
|
|
39
|
-
"@xyo-network/node-model": "^3.0.
|
|
40
|
-
"@xyo-network/os-model": "^3.0.
|
|
41
|
-
"@xyo-network/payload-builder": "^3.0.
|
|
42
|
-
"@xyo-network/payload-model": "^3.0.
|
|
43
|
-
"@xyo-network/wallet-model": "^3.0.
|
|
19
|
+
"@xyo-network/account": "^3.0.4",
|
|
20
|
+
"@xyo-network/archivist": "^3.0.4",
|
|
21
|
+
"@xyo-network/archivist-indexeddb": "^3.0.4",
|
|
22
|
+
"@xyo-network/archivist-model": "^3.0.4",
|
|
23
|
+
"@xyo-network/bridge-model": "^3.0.4",
|
|
24
|
+
"@xyo-network/diviner-abstract": "^3.0.4",
|
|
25
|
+
"@xyo-network/diviner-model": "^3.0.4",
|
|
26
|
+
"@xyo-network/diviner-payload-generic": "^3.0.4",
|
|
27
|
+
"@xyo-network/diviner-payload-indexeddb": "^3.0.4",
|
|
28
|
+
"@xyo-network/diviner-payload-model": "^3.0.4",
|
|
29
|
+
"@xyo-network/diviner-temporal-indexing-model": "^3.0.4",
|
|
30
|
+
"@xyo-network/kernel": "^3.0.1",
|
|
31
|
+
"@xyo-network/kernel-model": "^3.0.1",
|
|
32
|
+
"@xyo-network/manifest": "^3.0.4",
|
|
33
|
+
"@xyo-network/manifest-wrapper": "^3.0.4",
|
|
34
|
+
"@xyo-network/module-abstract": "^3.0.4",
|
|
35
|
+
"@xyo-network/module-events": "^3.0.4",
|
|
36
|
+
"@xyo-network/module-factory-locator": "^3.0.4",
|
|
37
|
+
"@xyo-network/module-model": "^3.0.4",
|
|
38
|
+
"@xyo-network/module-resolver": "^3.0.4",
|
|
39
|
+
"@xyo-network/node-model": "^3.0.4",
|
|
40
|
+
"@xyo-network/os-model": "^3.0.1",
|
|
41
|
+
"@xyo-network/payload-builder": "^3.0.4",
|
|
42
|
+
"@xyo-network/payload-model": "^3.0.4",
|
|
43
|
+
"@xyo-network/wallet-model": "^3.0.4",
|
|
44
44
|
"async-mutex": "^0.5.0",
|
|
45
45
|
"ethers": "^6.13.2",
|
|
46
46
|
"semver": "^7.6.3",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/semver": "^7.5.8",
|
|
51
51
|
"@types/uuid": "^10.0.0",
|
|
52
|
-
"@xylabs/ts-scripts-yarn3": "^4.0.0-rc.
|
|
53
|
-
"@xylabs/tsconfig": "^4.0.0-rc.
|
|
52
|
+
"@xylabs/ts-scripts-yarn3": "^4.0.0-rc.25",
|
|
53
|
+
"@xylabs/tsconfig": "^4.0.0-rc.25",
|
|
54
54
|
"typescript": "^5.5.4"
|
|
55
55
|
},
|
|
56
56
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
@@ -73,6 +73,6 @@
|
|
|
73
73
|
"url": "git+https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
74
74
|
},
|
|
75
75
|
"sideEffects": false,
|
|
76
|
-
"version": "3.0.
|
|
76
|
+
"version": "3.0.1",
|
|
77
77
|
"type": "module"
|
|
78
78
|
}
|
package/src/XyOs.ts
CHANGED
|
@@ -17,6 +17,7 @@ import type { WalletInstance } from '@xyo-network/wallet-model'
|
|
|
17
17
|
|
|
18
18
|
import type { DappRegistrationServiceParams } from './classes/registration/index.ts'
|
|
19
19
|
import { DappRegistrationService } from './classes/registration/index.ts'
|
|
20
|
+
import { EventBus } from './event/index.ts'
|
|
20
21
|
import type { MonitorEventConfig, XyOsMonitor } from './helpers/index.ts'
|
|
21
22
|
import { NameTransforms } from './lib/index.ts'
|
|
22
23
|
import { loadOsNode } from './loadOsNode.ts'
|
|
@@ -36,8 +37,8 @@ export class XyOs extends XyOsContextBase<XyOsParams> implements XyOsContext {
|
|
|
36
37
|
protected dappRegistrationService: DappRegistrationService
|
|
37
38
|
private stackManager: StackManager
|
|
38
39
|
|
|
39
|
-
constructor(params: XyOsParams, dappsConfiguration?: DappRegistrationServiceParams, developmentMode?: boolean) {
|
|
40
|
-
super(params)
|
|
40
|
+
constructor({ eventBus = new EventBus(), ...params }: XyOsParams, dappsConfiguration?: DappRegistrationServiceParams, developmentMode?: boolean) {
|
|
41
|
+
super({ eventBus, ...params })
|
|
41
42
|
this._locator = params.locator ?? new ModuleFactoryLocator()
|
|
42
43
|
this.stackManager = new StackManager(OsStackMap)
|
|
43
44
|
this.dappRegistrationService = new DappRegistrationService(this, dappsConfiguration, this.locator, developmentMode)
|
|
@@ -13,7 +13,13 @@ const findOrCreateMutex = new Mutex()
|
|
|
13
13
|
export class RunningDappCache {
|
|
14
14
|
private static _cache: { [key: DappId]: WindowDappNodeSet } = {}
|
|
15
15
|
|
|
16
|
-
static async findOrCreate(
|
|
16
|
+
static async findOrCreate(
|
|
17
|
+
dapp: RegisteredDapp,
|
|
18
|
+
xyOs: XyOsContext,
|
|
19
|
+
allowedNames: string[],
|
|
20
|
+
xnsNodeUrl: string | undefined,
|
|
21
|
+
xnsNetwork: string | undefined,
|
|
22
|
+
): Promise<WindowDappNodeSet> {
|
|
17
23
|
const dappId = dapp.config.name
|
|
18
24
|
|
|
19
25
|
return await XyOs.monitor<WindowDappNodeSet>(
|
|
@@ -15,7 +15,13 @@ const resolveLocator = (existingLocator?: ModuleFactoryLocator) => {
|
|
|
15
15
|
return locator
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
export const createDappContext = async (
|
|
18
|
+
export const createDappContext = async (
|
|
19
|
+
dapp: RegisteredDapp,
|
|
20
|
+
context: XyOsContext,
|
|
21
|
+
allowedNames: string[],
|
|
22
|
+
xnsNodeUrl: string | undefined,
|
|
23
|
+
xnsNetwork: string | undefined,
|
|
24
|
+
): Promise<WindowDappNodeSet> => {
|
|
19
25
|
console.log('createNodes')
|
|
20
26
|
try {
|
|
21
27
|
const dappSeedPhraseRepository = new DappSeedPhraseRepository(context, allowedNames)
|
|
@@ -95,9 +95,7 @@ export class ValidateDappAccessDiviner<TParams extends ValidateDappAccessDiviner
|
|
|
95
95
|
const compareChildren = (interfaceChildren: Record<Address, string | null>[], dappChildren: Record<Address, string | null>[]) => {
|
|
96
96
|
return interfaceChildren.every(interfaceChild =>
|
|
97
97
|
Object.values(interfaceChild).every(interfaceChildName =>
|
|
98
|
-
dappChildren.some(dappChild => Object.values(dappChild).includes(interfaceChildName))
|
|
99
|
-
),
|
|
100
|
-
)
|
|
98
|
+
dappChildren.some(dappChild => Object.values(dappChild).includes(interfaceChildName))))
|
|
101
99
|
}
|
|
102
100
|
|
|
103
101
|
const dappPackageManifestToPackageManifest = (dappPackageManifest: DappPackageManifestPayload): PackageManifestPayload => {
|