@xyo-network/os-runtime 3.0.0 → 3.0.2

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.
Files changed (60) hide show
  1. package/dist/neutral/index.d.ts +2 -2
  2. package/dist/neutral/index.mjs +264 -102
  3. package/dist/neutral/index.mjs.map +1 -1
  4. package/package.json +28 -28
  5. package/src/Caller.ts +5 -2
  6. package/src/DefaultsQueries.ts +6 -2
  7. package/src/XyOs.ts +20 -9
  8. package/src/XyOsBase.ts +10 -3
  9. package/src/XyOsDapp.ts +9 -3
  10. package/src/access-interfaces/ValidDappAccessInterfaces.ts +4 -4
  11. package/src/access-interfaces/registered-names/helpers/AccessNodeQueries.ts +6 -2
  12. package/src/access-interfaces/registered-names/helpers/resource/RegistrationsResource.ts +8 -8
  13. package/src/adapter/Base.ts +11 -3
  14. package/src/adapters/OsPubSubBridgeNetwork.ts +3 -1
  15. package/src/classes/cache/RunningDappCache.ts +16 -4
  16. package/src/classes/dapp/DefaultsResource.ts +9 -3
  17. package/src/classes/dapp/access/Caller.ts +5 -4
  18. package/src/classes/dapp/access/Queries.ts +6 -2
  19. package/src/classes/dapp/access/Resource.ts +9 -3
  20. package/src/classes/lib/DappCreatorParams.ts +3 -1
  21. package/src/classes/lib/Insertable.ts +5 -7
  22. package/src/classes/menu/Caller.ts +5 -2
  23. package/src/classes/menu/Queries.ts +5 -2
  24. package/src/classes/menu/Resource.ts +12 -4
  25. package/src/classes/node/Creator.ts +19 -7
  26. package/src/classes/node/DefaultPayloads/DappAccessPayloads.ts +3 -1
  27. package/src/classes/node/DefaultPayloads/DefaultPayloads.ts +3 -1
  28. package/src/classes/node/DefaultPayloads/NodeInfoPayload.ts +3 -1
  29. package/src/classes/node/DefaultPayloads/SigningKeyPayloads.ts +9 -10
  30. package/src/classes/node/ExternalModulePermissions/ExternalModulePermissions.ts +6 -2
  31. package/src/classes/node/createDappContext.ts +16 -4
  32. package/src/classes/registration/DappRegistrationService.ts +25 -7
  33. package/src/classes/registration/DappRegistry.ts +16 -8
  34. package/src/classes/registration/ValidateDappAccessDiviner/Config.ts +10 -3
  35. package/src/classes/registration/ValidateDappAccessDiviner/Diviner.ts +14 -8
  36. package/src/classes/settings/Caller.ts +3 -1
  37. package/src/classes/settings/Resource.ts +9 -3
  38. package/src/classes/settings/SettingsQueries.ts +6 -2
  39. package/src/classes/settings/badge/Resource.ts +5 -7
  40. package/src/classes/system/ManageSystemDapps.ts +7 -2
  41. package/src/classes/system/Queries.ts +2 -1
  42. package/src/event/bus/Connection.ts +3 -1
  43. package/src/event/bus/EventBus.ts +13 -4
  44. package/src/helpers/monitor/XyOsMonitor.ts +9 -7
  45. package/src/helpers/monitor/types.ts +4 -1
  46. package/src/intent/Caller.ts +6 -2
  47. package/src/intent/Resource.ts +6 -2
  48. package/src/lib/ModuleAccountPaths.ts +6 -10
  49. package/src/lib/PayloadStore.ts +9 -3
  50. package/src/lib/isPayload.ts +3 -1
  51. package/src/manifest/ManifestReplaceableTokens.ts +4 -3
  52. package/src/profileModuleEvents.ts +6 -2
  53. package/src/stack/Base.ts +18 -6
  54. package/src/stack/Manager.ts +8 -8
  55. package/src/stack/Map.ts +3 -1
  56. package/src/stack/OsPubSubNetworkStack.ts +12 -4
  57. package/src/stack/OsSettingsStack.ts +6 -2
  58. package/src/stack/XyoPublicNetworkStack.ts +6 -2
  59. package/src/utils/buildWalletSeedPhrasePayload.ts +22 -6
  60. package/src/wallet/DappSeedPhraseRepository.ts +6 -2
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.3",
20
- "@xyo-network/archivist": "^3.0.3",
21
- "@xyo-network/archivist-indexeddb": "^3.0.3",
22
- "@xyo-network/archivist-model": "^3.0.3",
23
- "@xyo-network/bridge-model": "^3.0.3",
24
- "@xyo-network/diviner-abstract": "^3.0.3",
25
- "@xyo-network/diviner-model": "^3.0.3",
26
- "@xyo-network/diviner-payload-generic": "^3.0.3",
27
- "@xyo-network/diviner-payload-indexeddb": "^3.0.3",
28
- "@xyo-network/diviner-payload-model": "^3.0.3",
29
- "@xyo-network/diviner-temporal-indexing-model": "^3.0.3",
30
- "@xyo-network/kernel": "^3.0.0",
31
- "@xyo-network/kernel-model": "^3.0.0",
32
- "@xyo-network/manifest": "^3.0.3",
33
- "@xyo-network/manifest-wrapper": "^3.0.3",
34
- "@xyo-network/module-abstract": "^3.0.3",
35
- "@xyo-network/module-events": "^3.0.3",
36
- "@xyo-network/module-factory-locator": "^3.0.3",
37
- "@xyo-network/module-model": "^3.0.3",
38
- "@xyo-network/module-resolver": "^3.0.3",
39
- "@xyo-network/node-model": "^3.0.3",
40
- "@xyo-network/os-model": "^3.0.0",
41
- "@xyo-network/payload-builder": "^3.0.3",
42
- "@xyo-network/payload-model": "^3.0.3",
43
- "@xyo-network/wallet-model": "^3.0.3",
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.2",
31
+ "@xyo-network/kernel-model": "^3.0.2",
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.2",
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.20",
53
- "@xylabs/tsconfig": "^4.0.0-rc.20",
52
+ "@xylabs/ts-scripts-yarn3": "^4.0.0-rc.28",
53
+ "@xylabs/tsconfig": "^4.0.0-rc.28",
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.0",
76
+ "version": "3.0.2",
77
77
  "type": "module"
78
78
  }
package/src/Caller.ts CHANGED
@@ -12,7 +12,8 @@ import type {
12
12
  RegisteredDappAccess,
13
13
  SigningKey,
14
14
  SigningKeyFields,
15
- XyOsContext } from '@xyo-network/os-model'
15
+ XyOsContext,
16
+ } from '@xyo-network/os-model'
16
17
  import {
17
18
  DappAccessRequestSchema,
18
19
  DappInjectableParamsSchema,
@@ -22,7 +23,9 @@ import {
22
23
  SigningKeySchema,
23
24
  } from '@xyo-network/os-model'
24
25
  import { PayloadBuilder } from '@xyo-network/payload-builder'
25
- import type { Payload, WithMeta } from '@xyo-network/payload-model'
26
+ import type {
27
+ Payload, WithMeta,
28
+ } from '@xyo-network/payload-model'
26
29
 
27
30
  import { DappCallerBase } from './DappCallerBase.ts'
28
31
  import { DappDefaultsResourceQueries } from './DefaultsQueries.ts'
@@ -1,7 +1,11 @@
1
1
  import type { DivinerInstance } from '@xyo-network/diviner-model'
2
2
  import { PayloadDivinerQuerySchema } from '@xyo-network/diviner-payload-model'
3
- import type { DappInjectableParams, NodeOsInfo } from '@xyo-network/os-model'
4
- import { DappInjectableParamsSchema, NodeOsInfoSchema } from '@xyo-network/os-model'
3
+ import type {
4
+ DappInjectableParams, NodeOsInfo,
5
+ } from '@xyo-network/os-model'
6
+ import {
7
+ DappInjectableParamsSchema, NodeOsInfoSchema,
8
+ } from '@xyo-network/os-model'
5
9
  import type { WithMeta } from '@xyo-network/payload-model'
6
10
 
7
11
  export const DappDefaultsResourceQueries = {
package/src/XyOs.ts CHANGED
@@ -17,17 +17,20 @@ 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 type { MonitorEventConfig, XyOsMonitor } from './helpers/index.ts'
20
+ import { EventBus } from './event/index.ts'
21
+ import type {
22
+ MonitorEventConfig, XyOsMonitor,
23
+ } from './helpers/index.ts'
21
24
  import { NameTransforms } from './lib/index.ts'
22
25
  import { loadOsNode } from './loadOsNode.ts'
23
26
  import type { OsPubSubNetworkStack } from './stack/index.ts'
24
- import { OsStackMap, StackManager } from './stack/index.ts'
27
+ import {
28
+ OsStackMap, StackManager,
29
+ } from './stack/index.ts'
25
30
  import type { XyOsContextParams } from './XyOsBase.ts'
26
31
  import { XyOsContextBase } from './XyOsBase.ts'
27
32
 
28
- export interface XyOsParams<TManifest extends PackageManifest = PackageManifest> extends XyOsContextParams<TManifest> {
29
- kernel: XyOsContext['kernel']
30
- }
33
+ export interface XyOsParams<TManifest extends PackageManifest = PackageManifest> extends XyOsContextParams<TManifest> { kernel: XyOsContext['kernel'] }
31
34
 
32
35
  export class XyOs extends XyOsContextBase<XyOsParams> implements XyOsContext {
33
36
  protected _exposedNode: NodeInstance | undefined
@@ -36,8 +39,12 @@ export class XyOs extends XyOsContextBase<XyOsParams> implements XyOsContext {
36
39
  protected dappRegistrationService: DappRegistrationService
37
40
  private stackManager: StackManager
38
41
 
39
- constructor(params: XyOsParams, dappsConfiguration?: DappRegistrationServiceParams, developmentMode?: boolean) {
40
- super(params)
42
+ constructor({
43
+ eventBus = new EventBus(), ...params
44
+ }: XyOsParams, dappsConfiguration?: DappRegistrationServiceParams, developmentMode?: boolean) {
45
+ super({
46
+ eventBus, ...params,
47
+ })
41
48
  this._locator = params.locator ?? new ModuleFactoryLocator()
42
49
  this.stackManager = new StackManager(OsStackMap)
43
50
  this.dappRegistrationService = new DappRegistrationService(this, dappsConfiguration, this.locator, developmentMode)
@@ -72,11 +79,15 @@ export class XyOs extends XyOsContextBase<XyOsParams> implements XyOsContext {
72
79
  }
73
80
 
74
81
  static async monitor<T>(fn: () => Promise<T>, eventConfig: MonitorEventConfig): Promise<T> {
75
- const { name, additionalProperties } = eventConfig
82
+ const {
83
+ name, additionalProperties,
84
+ } = eventConfig
76
85
  const monitor = this.monitoring
77
86
  monitor?.startTimer(name)
78
87
  const result = await fn()
79
- monitor?.stopTimer({ additionalProperties, name })
88
+ monitor?.stopTimer({
89
+ additionalProperties, name,
90
+ })
80
91
 
81
92
  return result
82
93
  }
package/src/XyOsBase.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { assertEx } from '@xylabs/assert'
2
- import type { BaseParams, JsonObject } from '@xylabs/object'
2
+ import type {
3
+ BaseParams, JsonObject,
4
+ } from '@xylabs/object'
3
5
  import type { Promisable } from '@xylabs/promise'
4
6
  import type { WalletInstance } from '@xyo-network/account'
5
7
  import type { KernelExternal } from '@xyo-network/kernel-model'
@@ -7,7 +9,9 @@ import type { PackageManifest } from '@xyo-network/manifest'
7
9
  import { BaseEmitter } from '@xyo-network/module-abstract'
8
10
  import { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
9
11
  import type { NodeInstance } from '@xyo-network/node-model'
10
- import type { DappId, DappPackageManifestPayload, DappParams, EventBusInterface, StackInitializer, XyOsContext, XyOsDappContext } from '@xyo-network/os-model'
12
+ import type {
13
+ DappId, DappPackageManifestPayload, DappParams, EventBusInterface, StackInitializer, XyOsContext, XyOsDappContext,
14
+ } from '@xyo-network/os-model'
11
15
  import { Mutex } from 'async-mutex'
12
16
 
13
17
  export interface XyOsContextParams<TManifest extends PackageManifest = PackageManifest> extends BaseParams {
@@ -97,7 +101,10 @@ export class XyOsContextBase<TParams extends XyOsContextParams | void = void> ex
97
101
  throw new Error('Method not implemented. [installDapp]')
98
102
  }
99
103
 
100
- monitor<T>(_fn: () => Promise<T>, _eventConfig: { additionalProperties?: JsonObject; name: string }): Promise<T> {
104
+ monitor<T>(_fn: () => Promise<T>, _eventConfig: {
105
+ additionalProperties?: JsonObject
106
+ name: string
107
+ }): Promise<T> {
101
108
  throw new Error('Method not implemented. [monitor]')
102
109
  }
103
110
 
package/src/XyOsDapp.ts CHANGED
@@ -2,7 +2,9 @@ import { assertEx } from '@xylabs/assert'
2
2
  import type { WalletInstance } from '@xyo-network/account'
3
3
  import { ManifestWrapper } from '@xyo-network/manifest-wrapper'
4
4
  import { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
5
- import type { DappPackageManifestPayload, XyOsContext, XyOsDappContext, XyOsDappDetails } from '@xyo-network/os-model'
5
+ import type {
6
+ DappPackageManifestPayload, XyOsContext, XyOsDappContext, XyOsDappDetails,
7
+ } from '@xyo-network/os-model'
6
8
  import { DappPackageManifestPayloadSchema } from '@xyo-network/os-model'
7
9
 
8
10
  import { DappWindowManifest } from './manifests/index.ts'
@@ -60,7 +62,9 @@ export class XyOsDapp extends XyOsContextBase<XyOsDappContextParams> implements
60
62
 
61
63
  console.log('XyOsDapp:boot:finalLocator', finalLocator)
62
64
 
63
- const dappNodesWrapper = new ManifestWrapper({ ...this.manifest, schema: DappPackageManifestPayloadSchema }, wallet, finalLocator)
65
+ const dappNodesWrapper = new ManifestWrapper({
66
+ ...this.manifest, schema: DappPackageManifestPayloadSchema,
67
+ }, wallet, finalLocator)
64
68
  const dappNodes = await dappNodesWrapper.loadNodes()
65
69
 
66
70
  // Derive a specific wallet for the dappManifestWrapper.
@@ -68,7 +72,9 @@ export class XyOsDapp extends XyOsContextBase<XyOsDappContextParams> implements
68
72
  const dappManifestWallet = await wallet.derivePath('99999')
69
73
  DappWindowManifest.nodes[0].config.name = this.dapp.name + 'Root'
70
74
  const wrapper = new ManifestWrapper<DappPackageManifestPayload>(
71
- { ...DappWindowManifest, schema: DappPackageManifestPayloadSchema },
75
+ {
76
+ ...DappWindowManifest, schema: DappPackageManifestPayloadSchema,
77
+ },
72
78
  dappManifestWallet,
73
79
  finalLocator,
74
80
  )
@@ -1,8 +1,8 @@
1
1
  import type { DappAccessInterface } from '@xyo-network/os-model'
2
- import { RegisteredNames, RegisteredNamesInterface } from '@xyo-network/os-model'
2
+ import {
3
+ RegisteredNames, RegisteredNamesInterface,
4
+ } from '@xyo-network/os-model'
3
5
 
4
6
  export type ValidDappAccessInterfaces = typeof RegisteredNames
5
7
 
6
- export const ValidDappAccessInterfaces: Record<string, DappAccessInterface> = {
7
- [RegisteredNames]: RegisteredNamesInterface,
8
- }
8
+ export const ValidDappAccessInterfaces: Record<string, DappAccessInterface> = { [RegisteredNames]: RegisteredNamesInterface }
@@ -1,7 +1,11 @@
1
1
  import { assertEx } from '@xylabs/assert'
2
2
  import { asArchivistInstance } from '@xyo-network/archivist-model'
3
- import type { DappAccessRequest, RegisteredDappAccess, TemporalIndexRegistrationResults, XyOsContext } from '@xyo-network/os-model'
4
- import type { WithMeta, WithSources } from '@xyo-network/payload-model'
3
+ import type {
4
+ DappAccessRequest, RegisteredDappAccess, TemporalIndexRegistrationResults, XyOsContext,
5
+ } from '@xyo-network/os-model'
6
+ import type {
7
+ WithMeta, WithSources,
8
+ } from '@xyo-network/payload-model'
5
9
 
6
10
  import { RunningDappAccessCache } from '../../../classes/cache/index.ts'
7
11
 
@@ -1,7 +1,11 @@
1
1
  import { assertEx } from '@xylabs/assert'
2
2
  import { isTemporalIndexingDivinerResultIndex } from '@xyo-network/diviner-temporal-indexing-model'
3
- import type { TemporalIndexRegistrationResults, XyOsContext } from '@xyo-network/os-model'
4
- import type { WithMeta, WithSources } from '@xyo-network/payload-model'
3
+ import type {
4
+ TemporalIndexRegistrationResults, XyOsContext,
5
+ } from '@xyo-network/os-model'
6
+ import type {
7
+ WithMeta, WithSources,
8
+ } from '@xyo-network/payload-model'
5
9
  import type { Listener } from 'ethers'
6
10
 
7
11
  import type { ResourceStore } from '../../../../lib/index.ts'
@@ -26,15 +30,11 @@ export class XnsRegistrationsResource extends AbstractXnsCaller implements Resou
26
30
  }
27
31
 
28
32
  get subscriptions() {
29
- return {
30
- allRegistrations: (cb: Listener) => this.allRegistrations.subscribe(cb),
31
- }
33
+ return { allRegistrations: (cb: Listener) => this.allRegistrations.subscribe(cb) }
32
34
  }
33
35
 
34
36
  get views() {
35
- return {
36
- allRegistrations: () => this.allRegistrations.getSnapshot(),
37
- }
37
+ return { allRegistrations: () => this.allRegistrations.getSnapshot() }
38
38
  }
39
39
 
40
40
  cleanupListeners() {
@@ -6,11 +6,19 @@ 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 { NodeAdapter, NodeAdapterBaseEvents } from '@xyo-network/os-model'
10
- import type { Payload, WithMeta } from '@xyo-network/payload-model'
9
+ import type {
10
+ NodeAdapter, NodeAdapterBaseEvents,
11
+ } from '@xyo-network/os-model'
12
+ import type {
13
+ Payload, WithMeta,
14
+ } from '@xyo-network/payload-model'
11
15
  import { v4 as uuid } from 'uuid'
12
16
 
13
- type ModuleEventPayload = { event: string; name: string | undefined; schema: 'network.xyo.kernel.module.event' }
17
+ type ModuleEventPayload = {
18
+ event: string
19
+ name: string | undefined
20
+ schema: 'network.xyo.kernel.module.event'
21
+ }
14
22
 
15
23
  export class NodeAdapterBase extends BaseEmitter<BaseParams, NodeAdapterBaseEvents> implements NodeAdapter {
16
24
  initialized = false
@@ -1,6 +1,8 @@
1
1
  import type { KernelExternal } from '@xyo-network/kernel-model'
2
2
  import type { AdapterSetCreator } from '@xyo-network/os-model'
3
- import { ExposedNodeOuterNodeName, PubSubBridgeNodeNodeName } from '@xyo-network/os-model'
3
+ import {
4
+ ExposedNodeOuterNodeName, PubSubBridgeNodeNodeName,
5
+ } from '@xyo-network/os-model'
4
6
 
5
7
  import { NetworkAdapter } from '../adapter/index.ts'
6
8
 
@@ -1,9 +1,13 @@
1
1
  import { assertEx } from '@xylabs/assert'
2
- import type { DappId, RegisteredDapp, WindowDappNodeSet, XyOsContext } from '@xyo-network/os-model'
2
+ import type {
3
+ DappId, RegisteredDapp, WindowDappNodeSet, XyOsContext,
4
+ } from '@xyo-network/os-model'
3
5
  import { Mutex } from 'async-mutex'
4
6
 
5
7
  import { XyOs } from '../../XyOs.ts'
6
- import { createDappContext, DappContextCreator } from '../node/index.ts'
8
+ import {
9
+ createDappContext, DappContextCreator,
10
+ } from '../node/index.ts'
7
11
 
8
12
  const findOrCreateMutex = new Mutex()
9
13
 
@@ -13,7 +17,13 @@ const findOrCreateMutex = new Mutex()
13
17
  export class RunningDappCache {
14
18
  private static _cache: { [key: DappId]: WindowDappNodeSet } = {}
15
19
 
16
- static async findOrCreate(dapp: RegisteredDapp, xyOs: XyOsContext, allowedNames: string[], xnsNodeUrl: string | undefined, xnsNetwork: string | undefined): Promise<WindowDappNodeSet> {
20
+ static async findOrCreate(
21
+ dapp: RegisteredDapp,
22
+ xyOs: XyOsContext,
23
+ allowedNames: string[],
24
+ xnsNodeUrl: string | undefined,
25
+ xnsNetwork: string | undefined,
26
+ ): Promise<WindowDappNodeSet> {
17
27
  const dappId = dapp.config.name
18
28
 
19
29
  return await XyOs.monitor<WindowDappNodeSet>(
@@ -32,7 +42,9 @@ export class RunningDappCache {
32
42
 
33
43
  return windowDappSet
34
44
  }),
35
- { additionalProperties: { dappId }, name: 'Loading dApp' },
45
+ {
46
+ additionalProperties: { dappId }, name: 'Loading dApp',
47
+ },
36
48
  )
37
49
  }
38
50
 
@@ -1,10 +1,16 @@
1
1
  import { assertEx } from '@xylabs/assert'
2
- import type { DappInjectableParams, NodeOsInfo, XyOsContext } from '@xyo-network/os-model'
3
- import { isDappInjectableParams, isNodeOsInfo } from '@xyo-network/os-model'
2
+ import type {
3
+ DappInjectableParams, NodeOsInfo, XyOsContext,
4
+ } from '@xyo-network/os-model'
5
+ import {
6
+ isDappInjectableParams, isNodeOsInfo,
7
+ } from '@xyo-network/os-model'
4
8
 
5
9
  import { DappCallerBase } from '../../DappCallerBase.ts'
6
10
  import { DappDefaultsResourceQueries } from '../../DefaultsQueries.ts'
7
- import type { Listener, ResourceStore } from '../../lib/index.ts'
11
+ import type {
12
+ Listener, ResourceStore,
13
+ } from '../../lib/index.ts'
8
14
  import { PayloadStore } from '../../lib/index.ts'
9
15
 
10
16
  export type DappDefaultsResourceViews = 'nodeOsInfo' | 'dappInjectableParamsFromRoute'
@@ -6,14 +6,15 @@ import type {
6
6
  RegisteredDappAccess,
7
7
  RegisteredDappSet,
8
8
  RegisteredDappSetResult,
9
- XyOsContext } from '@xyo-network/os-model'
10
- import {
11
- isRegisteredDappAccessDappSet,
9
+ XyOsContext,
12
10
  } from '@xyo-network/os-model'
11
+ import { isRegisteredDappAccessDappSet } from '@xyo-network/os-model'
13
12
  import { PayloadBuilder } from '@xyo-network/payload-builder'
14
13
 
15
14
  import { OsCallerBase } from '../../../OsCallerBase.ts'
16
- import { RunningDappAccessCache, RunningDappCache } from '../../cache/index.ts'
15
+ import {
16
+ RunningDappAccessCache, RunningDappCache,
17
+ } from '../../cache/index.ts'
17
18
 
18
19
  /**
19
20
  * Caller for managing Dapp Access Nodes
@@ -1,7 +1,11 @@
1
1
  import type { DivinerInstance } from '@xyo-network/diviner-model'
2
2
  import { PayloadDivinerQuerySchema } from '@xyo-network/diviner-payload-model'
3
- import type { DappAccessRequest, RegisteredDappAccess } from '@xyo-network/os-model'
4
- import { DappAccessRequestSchema, RegisteredDappAccessSchema } from '@xyo-network/os-model'
3
+ import type {
4
+ DappAccessRequest, RegisteredDappAccess,
5
+ } from '@xyo-network/os-model'
6
+ import {
7
+ DappAccessRequestSchema, RegisteredDappAccessSchema,
8
+ } from '@xyo-network/os-model'
5
9
  import type { WithMeta } from '@xyo-network/payload-model'
6
10
 
7
11
  const noResults: unknown[] = []
@@ -1,9 +1,15 @@
1
1
  import { assertEx } from '@xylabs/assert'
2
- import type { DappAccessRequest, RegisteredDappAccess, XyOsContext } from '@xyo-network/os-model'
3
- import { isDappAccessRequestWithMeta, isRegisteredDappAccess } from '@xyo-network/os-model'
2
+ import type {
3
+ DappAccessRequest, RegisteredDappAccess, XyOsContext,
4
+ } from '@xyo-network/os-model'
5
+ import {
6
+ isDappAccessRequestWithMeta, isRegisteredDappAccess,
7
+ } from '@xyo-network/os-model'
4
8
 
5
9
  import { DappCallerBase } from '../../../DappCallerBase.ts'
6
- import type { Listener, ResourceStore } from '../../../lib/index.ts'
10
+ import type {
11
+ Listener, ResourceStore,
12
+ } from '../../../lib/index.ts'
7
13
  import { PayloadStore } from '../../../lib/index.ts'
8
14
  import { DappAccessRequestQueries } from './Queries.ts'
9
15
 
@@ -1,6 +1,8 @@
1
1
  import type { ModuleManifest } from '@xyo-network/manifest'
2
2
  import type { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
3
- import type { DappName, DappPackageManifestPayload, XyOsContext } from '@xyo-network/os-model'
3
+ import type {
4
+ DappName, DappPackageManifestPayload, XyOsContext,
5
+ } from '@xyo-network/os-model'
4
6
  import type { WalletInstance } from '@xyo-network/wallet-model'
5
7
 
6
8
  export type DappNodesCreatorParams = {
@@ -1,14 +1,12 @@
1
- import type { DappName, XyOsContext } from '@xyo-network/os-model'
1
+ import type {
2
+ DappName, XyOsContext,
3
+ } from '@xyo-network/os-model'
2
4
  import type { Payload } from '@xyo-network/payload-model'
3
5
 
4
- export interface InsertableConstructor {
5
- new (_xyOs: XyOsContext, dappName: DappName): DefaultPayloadsInsertable
6
- }
6
+ export interface InsertableConstructor { new (_xyOs: XyOsContext, dappName: DappName): DefaultPayloadsInsertable }
7
7
 
8
8
  type InsertableConstructorParams = ConstructorParameters<InsertableConstructor>
9
9
 
10
- export interface DefaultPayloadsInsertable {
11
- payloads(): Promise<Payload[]>
12
- }
10
+ export interface DefaultPayloadsInsertable { payloads(): Promise<Payload[]> }
13
11
 
14
12
  export const createInsertable = (insertable: InsertableConstructor, ...params: InsertableConstructorParams) => new insertable(...params)
@@ -2,13 +2,16 @@ import { PayloadDivinerQuerySchema } from '@xyo-network/diviner-payload-model'
2
2
  import type {
3
3
  DappInjectableParams,
4
4
  DappNavItemSelection,
5
- XyOsContext } from '@xyo-network/os-model'
5
+ XyOsContext,
6
+ } from '@xyo-network/os-model'
6
7
  import {
7
8
  DappInjectableParamsSchema,
8
9
  DappNavItemSelectionSchema,
9
10
  } from '@xyo-network/os-model'
10
11
  import { PayloadBuilder } from '@xyo-network/payload-builder'
11
- import type { Payload, WithMeta } from '@xyo-network/payload-model'
12
+ import type {
13
+ Payload, WithMeta,
14
+ } from '@xyo-network/payload-model'
12
15
 
13
16
  import { DappCaller } from '../../Caller.ts'
14
17
 
@@ -4,13 +4,16 @@ import { PayloadDivinerQuerySchema } from '@xyo-network/diviner-payload-model'
4
4
  import type {
5
5
  DappNavItem,
6
6
  DappNavItemSelection,
7
- DappNavMenuConfig } from '@xyo-network/os-model'
7
+ DappNavMenuConfig,
8
+ } from '@xyo-network/os-model'
8
9
  import {
9
10
  DappNavItemSchema,
10
11
  DappNavItemSelectionSchema,
11
12
  DappNavMenuConfigSchema,
12
13
  } from '@xyo-network/os-model'
13
- import type { WithMeta, WithSources } from '@xyo-network/payload-model'
14
+ import type {
15
+ WithMeta, WithSources,
16
+ } from '@xyo-network/payload-model'
14
17
 
15
18
  const NO_ITEMS: unknown[] = []
16
19
 
@@ -1,10 +1,18 @@
1
1
  import { assertEx } from '@xylabs/assert'
2
- import type { DappNavItem, DappNavItemSelection, DappNavMenuConfig, XyOsContext } from '@xyo-network/os-model'
3
- import { isDappNavItemSelection, isDappNavMenuConfig } from '@xyo-network/os-model'
4
- import type { Payload, WithMeta, WithSources } from '@xyo-network/payload-model'
2
+ import type {
3
+ DappNavItem, DappNavItemSelection, DappNavMenuConfig, XyOsContext,
4
+ } from '@xyo-network/os-model'
5
+ import {
6
+ isDappNavItemSelection, isDappNavMenuConfig,
7
+ } from '@xyo-network/os-model'
8
+ import type {
9
+ Payload, WithMeta, WithSources,
10
+ } from '@xyo-network/payload-model'
5
11
 
6
12
  import { DappCaller } from '../../Caller.ts'
7
- import type { Listener, ResourceStore } from '../../lib/index.ts'
13
+ import type {
14
+ Listener, ResourceStore,
15
+ } from '../../lib/index.ts'
8
16
  import { PayloadStore } from '../../lib/index.ts'
9
17
  import { DappMenuQueries } from './Queries.ts'
10
18
 
@@ -5,7 +5,9 @@ import { PackageManifestPayloadSchema } from '@xyo-network/manifest'
5
5
  import type { ManifestWrapper } from '@xyo-network/manifest-wrapper'
6
6
  import type { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
7
7
  import type { NodeInstance } from '@xyo-network/node-model'
8
- import type { DappId, DappPackageManifestPayload, ExternalModule, XyOsContext } from '@xyo-network/os-model'
8
+ import type {
9
+ DappId, DappPackageManifestPayload, ExternalModule, XyOsContext,
10
+ } from '@xyo-network/os-model'
9
11
  import type { WalletInstance } from '@xyo-network/wallet-model'
10
12
 
11
13
  import { DappCallerBase } from '../../DappCallerBase.ts'
@@ -30,10 +32,16 @@ export class DappContextCreator {
30
32
  ) {}
31
33
 
32
34
  static async create(params: DappNodesCreatorParams, xnsNodeUrl: string | undefined, xnsNetwork: string | undefined) {
33
- const { config, locator, context, wallet } = params
34
- const { payload, dappName, publicChildren, privateChildren } = config
35
-
36
- const { external, manifestPayload } = this.parseDappPackageManifestPayload(payload, xnsNodeUrl, xnsNetwork)
35
+ const {
36
+ config, locator, context, wallet,
37
+ } = params
38
+ const {
39
+ payload, dappName, publicChildren, privateChildren,
40
+ } = config
41
+
42
+ const {
43
+ external, manifestPayload,
44
+ } = this.parseDappPackageManifestPayload(payload, xnsNodeUrl, xnsNetwork)
37
45
  console.debug('[DEBUG] dApp manifest', manifestPayload)
38
46
 
39
47
  // derive a wallet for the dapp to use from the root wallet
@@ -63,13 +71,17 @@ export class DappContextCreator {
63
71
 
64
72
  private static parseDappPackageManifestPayload(payload: DappPackageManifestPayload, xnsNodeUrl: string | undefined, xnsNetwork: string | undefined) {
65
73
  // extract external permissions from package manifest payload
66
- const { external, ...manifestWithoutExternals } = payload
74
+ const {
75
+ external, ...manifestWithoutExternals
76
+ } = payload
67
77
  const manifestPayloadRaw: PackageManifestPayload = {
68
78
  ...manifestWithoutExternals,
69
79
  schema: PackageManifestPayloadSchema,
70
80
  }
71
81
  const manifestPayload = ReplaceManifestTokens(manifestPayloadRaw, xnsNodeUrl, xnsNetwork)
72
- return { external, manifestPayload }
82
+ return {
83
+ external, manifestPayload,
84
+ }
73
85
  }
74
86
 
75
87
  async loadDappContext(context: XyOsContext): Promise<XyOsContext> {
@@ -1,4 +1,6 @@
1
- import type { DappName, XyOsContext } from '@xyo-network/os-model'
1
+ import type {
2
+ DappName, XyOsContext,
3
+ } from '@xyo-network/os-model'
2
4
 
3
5
  import { OsCallerBase } from '../../../OsCallerBase.ts'
4
6
  import type { DefaultPayloadsInsertable } from '../../lib/index.ts'
@@ -1,5 +1,7 @@
1
1
  import type { ArchivistInstance } from '@xyo-network/archivist-model'
2
- import type { DappName, XyOsContext } from '@xyo-network/os-model'
2
+ import type {
3
+ DappName, XyOsContext,
4
+ } from '@xyo-network/os-model'
3
5
  import { PayloadBuilder } from '@xyo-network/payload-builder'
4
6
  import type { Payload } from '@xyo-network/payload-model'
5
7
 
@@ -1,4 +1,6 @@
1
- import type { DappName, NodeOsInfo, XyOsContext } from '@xyo-network/os-model'
1
+ import type {
2
+ DappName, NodeOsInfo, XyOsContext,
3
+ } from '@xyo-network/os-model'
2
4
  import { NodeOsInfoSchema } from '@xyo-network/os-model'
3
5
 
4
6
  import type { DefaultPayloadsInsertable } from '../../lib/index.ts'