@xyo-network/os-runtime 3.0.1 → 3.0.3
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 +263 -97
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/Caller.ts +5 -2
- package/src/DefaultsQueries.ts +6 -2
- package/src/XyOs.ts +19 -9
- package/src/XyOsBase.ts +10 -3
- package/src/XyOsDapp.ts +9 -3
- package/src/access-interfaces/ValidDappAccessInterfaces.ts +4 -4
- package/src/access-interfaces/registered-names/helpers/AccessNodeQueries.ts +6 -2
- package/src/access-interfaces/registered-names/helpers/resource/RegistrationsResource.ts +8 -8
- package/src/adapter/Base.ts +11 -3
- package/src/adapters/OsPubSubBridgeNetwork.ts +3 -1
- package/src/classes/cache/RunningDappCache.ts +9 -3
- package/src/classes/dapp/DefaultsResource.ts +9 -3
- package/src/classes/dapp/access/Caller.ts +5 -4
- package/src/classes/dapp/access/Queries.ts +6 -2
- package/src/classes/dapp/access/Resource.ts +9 -3
- package/src/classes/lib/DappCreatorParams.ts +3 -1
- package/src/classes/lib/Insertable.ts +5 -7
- package/src/classes/menu/Caller.ts +5 -2
- package/src/classes/menu/Queries.ts +5 -2
- package/src/classes/menu/Resource.ts +12 -4
- package/src/classes/node/Creator.ts +19 -7
- package/src/classes/node/DefaultPayloads/DappAccessPayloads.ts +3 -1
- package/src/classes/node/DefaultPayloads/DefaultPayloads.ts +3 -1
- package/src/classes/node/DefaultPayloads/NodeInfoPayload.ts +3 -1
- package/src/classes/node/DefaultPayloads/SigningKeyPayloads.ts +9 -10
- package/src/classes/node/ExternalModulePermissions/ExternalModulePermissions.ts +6 -2
- package/src/classes/node/createDappContext.ts +9 -3
- package/src/classes/registration/DappRegistrationService.ts +25 -7
- package/src/classes/registration/DappRegistry.ts +16 -8
- package/src/classes/registration/ValidateDappAccessDiviner/Config.ts +10 -3
- package/src/classes/registration/ValidateDappAccessDiviner/Diviner.ts +13 -5
- package/src/classes/settings/Caller.ts +3 -1
- package/src/classes/settings/Resource.ts +9 -3
- package/src/classes/settings/SettingsQueries.ts +6 -2
- package/src/classes/settings/badge/Resource.ts +5 -7
- package/src/classes/system/ManageSystemDapps.ts +7 -2
- package/src/classes/system/Queries.ts +2 -1
- package/src/event/bus/Connection.ts +3 -1
- package/src/event/bus/EventBus.ts +13 -4
- package/src/helpers/monitor/XyOsMonitor.ts +9 -7
- package/src/helpers/monitor/types.ts +4 -1
- package/src/intent/Caller.ts +6 -2
- package/src/intent/Resource.ts +6 -2
- package/src/lib/ModuleAccountPaths.ts +6 -10
- package/src/lib/PayloadStore.ts +9 -3
- package/src/lib/isPayload.ts +3 -1
- package/src/manifest/ManifestReplaceableTokens.ts +4 -3
- package/src/profileModuleEvents.ts +6 -2
- package/src/stack/Base.ts +18 -6
- package/src/stack/Manager.ts +8 -8
- package/src/stack/Map.ts +3 -1
- package/src/stack/OsPubSubNetworkStack.ts +12 -4
- package/src/stack/OsSettingsStack.ts +6 -2
- package/src/stack/XyoPublicNetworkStack.ts +6 -2
- package/src/utils/buildWalletSeedPhrasePayload.ts +22 -6
- package/src/wallet/DappSeedPhraseRepository.ts +6 -2
package/src/stack/Map.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
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 {
|
|
4
|
-
|
|
5
|
-
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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<{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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 {
|
|
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<{
|
|
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 {
|
|
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 {
|
|
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
|