@xyo-network/os-runtime 3.0.1 → 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 +1 -1
  2. package/dist/neutral/index.mjs +263 -97
  3. package/dist/neutral/index.mjs.map +1 -1
  4. package/package.json +6 -6
  5. package/src/Caller.ts +5 -2
  6. package/src/DefaultsQueries.ts +6 -2
  7. package/src/XyOs.ts +19 -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 +9 -3
  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 +9 -3
  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 +13 -5
  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/src/stack/Map.ts CHANGED
@@ -1,4 +1,6 @@
1
- import { OsPubSubBridgeNetworkAdapters, OsSettingsAdapters, OsXyoPublicNetworkAdapters } from '../adapters/index.ts'
1
+ import {
2
+ OsPubSubBridgeNetworkAdapters, OsSettingsAdapters, OsXyoPublicNetworkAdapters,
3
+ } from '../adapters/index.ts'
2
4
  import type { UninitializedStackMap } from './Manager.ts'
3
5
  import { OsPubSubNetworkStack } from './OsPubSubNetworkStack.ts'
4
6
  import { OsSettingsStack } from './OsSettingsStack.ts'
@@ -1,11 +1,19 @@
1
1
  import { assertEx } from '@xylabs/assert'
2
2
  import type { NodeInstance } from '@xyo-network/node-model'
3
- import { asAttachableNodeInstance, asNodeInstance } from '@xyo-network/node-model'
4
- import type { AdapterSetCreator, XyOsContext } from '@xyo-network/os-model'
5
- import { ExposedNodeOuterNodeName, PubSubBridgeNodeNodeName } from '@xyo-network/os-model'
3
+ import {
4
+ asAttachableNodeInstance, asNodeInstance,
5
+ } from '@xyo-network/node-model'
6
+ import type {
7
+ AdapterSetCreator, XyOsContext,
8
+ } from '@xyo-network/os-model'
9
+ import {
10
+ ExposedNodeOuterNodeName, PubSubBridgeNodeNodeName,
11
+ } from '@xyo-network/os-model'
6
12
 
7
13
  import type { EventBusPubSubConnection } from '../event/index.ts'
8
- import { osPubSubNetworkReadyConnection, OsPubSubNetworkReadyEvent } from '../event/index.ts'
14
+ import {
15
+ osPubSubNetworkReadyConnection, OsPubSubNetworkReadyEvent,
16
+ } from '../event/index.ts'
9
17
  import { initializeXns } from '../lib/index.ts'
10
18
  import { StackBase } from './Base.ts'
11
19
 
@@ -1,7 +1,11 @@
1
- import type { AdapterSetCreator, XyOsContext } from '@xyo-network/os-model'
1
+ import type {
2
+ AdapterSetCreator, XyOsContext,
3
+ } from '@xyo-network/os-model'
2
4
 
3
5
  import type { EventBusPubSubConnection } from '../event/index.ts'
4
- import { osSettingsReadyConnection, OsSettingsReadyEvent } from '../event/index.ts'
6
+ import {
7
+ osSettingsReadyConnection, OsSettingsReadyEvent,
8
+ } from '../event/index.ts'
5
9
  import { StackBase } from './Base.ts'
6
10
 
7
11
  export class OsSettingsStack extends StackBase {
@@ -1,8 +1,12 @@
1
- import type { AdapterSetCreator, XyOsContext } from '@xyo-network/os-model'
1
+ import type {
2
+ AdapterSetCreator, XyOsContext,
3
+ } from '@xyo-network/os-model'
2
4
  import { XyoPublicNodeName } from '@xyo-network/os-model'
3
5
 
4
6
  import type { EventBusPubSubConnection } from '../event/index.ts'
5
- import { osXyoPublicNetworkReadyConnection, OsXyoPublicNetworkReadyEvent } from '../event/index.ts'
7
+ import {
8
+ osXyoPublicNetworkReadyConnection, OsXyoPublicNetworkReadyEvent,
9
+ } from '../event/index.ts'
6
10
  import { StackBase } from './Base.ts'
7
11
 
8
12
  export class XyoPublicNetworkStack extends StackBase {
@@ -22,13 +22,26 @@ export type WalletLabel = typeof userWalletLabel // TODO: More wallet types 'osW
22
22
  * @param label The wallet label
23
23
  * @returns A WalletSeedPhrase payload and its root hash
24
24
  */
25
- export const buildWalletSeedPhrasePayload = async (mnemonic: string, label: WalletLabel): Promise<{ payload: WalletSeedPhrase; rootHash: Hash }> => {
26
- const fields = { mnemonic: { language, mnemonic: mnemonic.split(' '), standard } }
27
- const meta = { label, timestamp: Date.now() }
28
- const builder = new PayloadBuilder<WalletSeedPhrase>({ fields, meta, schema: WalletSeedPhraseSchema })
25
+ export const buildWalletSeedPhrasePayload = async (mnemonic: string, label: WalletLabel): Promise<{
26
+ payload: WalletSeedPhrase
27
+ rootHash: Hash
28
+ }> => {
29
+ const fields = {
30
+ mnemonic: {
31
+ language, mnemonic: mnemonic.split(' '), standard,
32
+ },
33
+ }
34
+ const meta = {
35
+ label, timestamp: Date.now(),
36
+ }
37
+ const builder = new PayloadBuilder<WalletSeedPhrase>({
38
+ fields, meta, schema: WalletSeedPhraseSchema,
39
+ })
29
40
  const payload = await builder.build()
30
41
  const rootHash = await PayloadBuilder.hash(payload)
31
- return { payload, rootHash }
42
+ return {
43
+ payload, rootHash,
44
+ }
32
45
  }
33
46
 
34
47
  /**
@@ -36,6 +49,9 @@ export const buildWalletSeedPhrasePayload = async (mnemonic: string, label: Wall
36
49
  * @param mnemonic The mnemonic seed phrase
37
50
  * @returns A user WalletSeedPhrase payload and its root hash
38
51
  */
39
- export const buildUserWalletSeedPhrasePayload = (mnemonic: string): Promise<{ payload: WalletSeedPhrase; rootHash: Hash }> => {
52
+ export const buildUserWalletSeedPhrasePayload = (mnemonic: string): Promise<{
53
+ payload: WalletSeedPhrase
54
+ rootHash: Hash
55
+ }> => {
40
56
  return buildWalletSeedPhrasePayload(mnemonic, userWalletLabel)
41
57
  }
@@ -1,12 +1,16 @@
1
1
  import { HDWallet } from '@xyo-network/account'
2
2
  import { PayloadDivinerQuerySchema } from '@xyo-network/diviner-payload-model'
3
- import type { DappId, DappWalletSeedPhrase, WalletId, XyOsContext } from '@xyo-network/os-model'
3
+ import type {
4
+ DappId, DappWalletSeedPhrase, WalletId, XyOsContext,
5
+ } from '@xyo-network/os-model'
4
6
  import { DappWalletSeedPhraseSchema } from '@xyo-network/os-model'
5
7
  import type { WithMeta } from '@xyo-network/payload-model'
6
8
  import { v4 as uuid } from 'uuid'
7
9
 
8
10
  import { OsCallerBase } from '../OsCallerBase.ts'
9
- import type { SeedPhraseId, SeedPhraseRepository } from './SeedPhraseRepository.ts'
11
+ import type {
12
+ SeedPhraseId, SeedPhraseRepository,
13
+ } from './SeedPhraseRepository.ts'
10
14
 
11
15
  export class DappSeedPhraseRepository extends OsCallerBase implements SeedPhraseRepository {
12
16
  // record of all dapps that have requested a seed phrase with the OS