@xyo-network/os-runtime 7.2.0 → 7.2.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/Caller.d.ts +18 -20
- package/dist/neutral/Caller.d.ts.map +1 -1
- package/dist/neutral/DappCallerBase.d.ts.map +1 -1
- package/dist/neutral/PubSubBridgeCaller.d.ts +1 -1
- package/dist/neutral/PubSubBridgeCaller.d.ts.map +1 -1
- package/dist/neutral/XyOs.d.ts +1 -1
- package/dist/neutral/XyOs.d.ts.map +1 -1
- package/dist/neutral/XyOsBase.d.ts +2 -4
- package/dist/neutral/XyOsBase.d.ts.map +1 -1
- package/dist/neutral/XyOsDapp.d.ts.map +1 -1
- package/dist/neutral/access/Caller.d.ts +1 -1
- package/dist/neutral/access/Caller.d.ts.map +1 -1
- package/dist/neutral/adapter/Base.d.ts +2 -2
- package/dist/neutral/adapter/Base.d.ts.map +1 -1
- package/dist/neutral/classes/menu/Caller.d.ts +1 -2
- package/dist/neutral/classes/menu/Caller.d.ts.map +1 -1
- package/dist/neutral/classes/settings/Caller.d.ts +2 -2
- package/dist/neutral/classes/settings/badge/Caller.d.ts +2 -2
- package/dist/neutral/classes/settings/badge/Resource.d.ts +1 -1
- package/dist/neutral/classes/settings/badge/Resource.d.ts.map +1 -1
- package/dist/neutral/event/bus/Connection.d.ts +3 -4
- package/dist/neutral/event/bus/Connection.d.ts.map +1 -1
- package/dist/neutral/event/bus/EventBus.d.ts.map +1 -1
- package/dist/neutral/event/bus/PubSubConnection.d.ts +1 -1
- package/dist/neutral/helpers/monitor/types.d.ts +1 -1
- package/dist/neutral/index.mjs +1000 -658
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/intent/Caller.d.ts +5 -5
- package/dist/neutral/lib/PayloadStore.d.ts +1 -2
- package/dist/neutral/lib/PayloadStore.d.ts.map +1 -1
- package/dist/neutral/lib/isPayload.d.ts +1 -1
- package/dist/neutral/profileModuleEvents.d.ts +1 -1
- package/dist/neutral/profileModuleEvents.d.ts.map +1 -1
- package/dist/neutral/registration/DappRegistrationService.d.ts.map +1 -1
- package/dist/neutral/registration/DappRegistry.d.ts +4 -6
- package/dist/neutral/registration/DappRegistry.d.ts.map +1 -1
- package/dist/neutral/registration/ValidateDappAccessDiviner/Config.d.ts +6 -2
- package/dist/neutral/registration/ValidateDappAccessDiviner/Config.d.ts.map +1 -1
- package/dist/neutral/registration/ValidateDappAccessDiviner/Diviner.d.ts +3 -1
- package/dist/neutral/registration/ValidateDappAccessDiviner/Diviner.d.ts.map +1 -1
- package/dist/neutral/stack/Base.d.ts +2 -2
- package/dist/neutral/stack/Base.d.ts.map +1 -1
- package/dist/neutral/system/ManageSystemDapps.d.ts +1 -1
- package/dist/neutral/utils/buildWalletSeedPhrasePayload.d.ts +1 -1
- package/dist/neutral/utils/buildWalletSeedPhrasePayload.d.ts.map +1 -1
- package/dist/neutral/wallet/SeedPhraseRepository.d.ts +3 -4
- package/dist/neutral/wallet/SeedPhraseRepository.d.ts.map +1 -1
- package/dist/node/Caller.d.ts +18 -20
- package/dist/node/Caller.d.ts.map +1 -1
- package/dist/node/DappCallerBase.d.ts.map +1 -1
- package/dist/node/PubSubBridgeCaller.d.ts +1 -1
- package/dist/node/PubSubBridgeCaller.d.ts.map +1 -1
- package/dist/node/XyOs.d.ts +1 -1
- package/dist/node/XyOs.d.ts.map +1 -1
- package/dist/node/XyOsBase.d.ts +2 -4
- package/dist/node/XyOsBase.d.ts.map +1 -1
- package/dist/node/XyOsDapp.d.ts.map +1 -1
- package/dist/node/access/Caller.d.ts +1 -1
- package/dist/node/access/Caller.d.ts.map +1 -1
- package/dist/node/adapter/Base.d.ts +2 -2
- package/dist/node/adapter/Base.d.ts.map +1 -1
- package/dist/node/classes/menu/Caller.d.ts +1 -2
- package/dist/node/classes/menu/Caller.d.ts.map +1 -1
- package/dist/node/classes/settings/Caller.d.ts +2 -2
- package/dist/node/classes/settings/badge/Caller.d.ts +2 -2
- package/dist/node/classes/settings/badge/Resource.d.ts +1 -1
- package/dist/node/classes/settings/badge/Resource.d.ts.map +1 -1
- package/dist/node/event/bus/Connection.d.ts +3 -4
- package/dist/node/event/bus/Connection.d.ts.map +1 -1
- package/dist/node/event/bus/EventBus.d.ts.map +1 -1
- package/dist/node/event/bus/PubSubConnection.d.ts +1 -1
- package/dist/node/helpers/monitor/types.d.ts +1 -1
- package/dist/node/index.mjs +1000 -658
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/intent/Caller.d.ts +5 -5
- package/dist/node/lib/PayloadStore.d.ts +1 -2
- package/dist/node/lib/PayloadStore.d.ts.map +1 -1
- package/dist/node/lib/isPayload.d.ts +1 -1
- package/dist/node/profileModuleEvents.d.ts +1 -1
- package/dist/node/profileModuleEvents.d.ts.map +1 -1
- package/dist/node/registration/DappRegistrationService.d.ts.map +1 -1
- package/dist/node/registration/DappRegistry.d.ts +4 -6
- package/dist/node/registration/DappRegistry.d.ts.map +1 -1
- package/dist/node/registration/ValidateDappAccessDiviner/Config.d.ts +6 -2
- package/dist/node/registration/ValidateDappAccessDiviner/Config.d.ts.map +1 -1
- package/dist/node/registration/ValidateDappAccessDiviner/Diviner.d.ts +3 -1
- package/dist/node/registration/ValidateDappAccessDiviner/Diviner.d.ts.map +1 -1
- package/dist/node/scripts/xyos/index.mjs +493 -360
- package/dist/node/scripts/xyos/index.mjs.map +1 -1
- package/dist/node/stack/Base.d.ts +2 -2
- package/dist/node/stack/Base.d.ts.map +1 -1
- package/dist/node/system/ManageSystemDapps.d.ts +1 -1
- package/dist/node/utils/buildWalletSeedPhrasePayload.d.ts +1 -1
- package/dist/node/utils/buildWalletSeedPhrasePayload.d.ts.map +1 -1
- package/dist/node/wallet/SeedPhraseRepository.d.ts +3 -4
- package/dist/node/wallet/SeedPhraseRepository.d.ts.map +1 -1
- package/package.json +38 -45
- package/src/Caller.ts +19 -21
- package/src/DappCallerBase.ts +1 -2
- package/src/OsCallerBase.ts +1 -1
- package/src/PubSubBridgeCaller.ts +2 -2
- package/src/RunningDappCache.ts +1 -1
- package/src/XyOs.ts +2 -2
- package/src/XyOsBase.ts +4 -5
- package/src/XyOsDapp.ts +6 -3
- package/src/access/Caller.ts +2 -2
- package/src/access/Resource.ts +1 -1
- package/src/access/interfaces/registered-names/helpers/AccessNodeQueries.ts +1 -1
- package/src/access/interfaces/registered-names/helpers/resource/AbstractXnsCaller.ts +1 -1
- package/src/access/interfaces/registered-names/helpers/resource/RegistrationsResource.ts +1 -1
- package/src/adapter/Base.ts +11 -9
- package/src/classes/dapp/DefaultsResource.ts +1 -1
- package/src/classes/menu/Caller.ts +1 -2
- package/src/classes/menu/Resource.ts +1 -1
- package/src/classes/settings/Caller.ts +3 -3
- package/src/classes/settings/CallerBase.ts +1 -1
- package/src/classes/settings/Resource.ts +1 -1
- package/src/classes/settings/badge/Caller.ts +2 -2
- package/src/classes/settings/badge/Resource.ts +2 -2
- package/src/dapp/context/creator/Creator.ts +1 -1
- package/src/dapp/context/creator/DefaultPayloads/NodeInfoPayload.ts +1 -1
- package/src/event/bus/Connection.ts +3 -5
- package/src/event/bus/EventBus.ts +5 -4
- package/src/event/bus/PubSubConnection.ts +1 -1
- package/src/helpers/monitor/types.ts +1 -1
- package/src/initializer/DappInitializer.ts +1 -1
- package/src/intent/Caller.ts +5 -5
- package/src/intent/Resource.ts +1 -1
- package/src/lib/PayloadStore.ts +1 -2
- package/src/lib/isEqual.ts +1 -1
- package/src/lib/isPayload.ts +1 -1
- package/src/lib/tokenPlacesSplit.ts +1 -1
- package/src/loadOsNode.ts +1 -1
- package/src/profileModuleEvents.ts +1 -1
- package/src/registration/DappRegistrationService.ts +4 -3
- package/src/registration/DappRegistry.ts +4 -6
- package/src/registration/ValidateDappAccessDiviner/Config.ts +3 -3
- package/src/registration/ValidateDappAccessDiviner/Diviner.ts +1 -1
- package/src/scripts/xyos/index.ts +0 -1
- package/src/signer/Signers.ts +1 -1
- package/src/stack/Base.ts +5 -6
- package/src/stack/OsPubSubNetworkStack.ts +1 -1
- package/src/system/ManageSystemDapps.ts +1 -1
- package/src/utils/buildWalletSeedPhrasePayload.ts +1 -1
- package/src/wallet/SeedPhraseRepository.ts +3 -4
package/src/intent/Caller.ts
CHANGED
|
@@ -15,11 +15,11 @@ export class DappIntentCaller extends DappCallerBase {
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Build a new intent
|
|
18
|
-
* @param
|
|
19
|
-
* @param
|
|
20
|
-
* @param
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
18
|
+
* @param sourceDappId
|
|
19
|
+
* @param intent
|
|
20
|
+
* @param targetDappId
|
|
21
|
+
* @param targetMode
|
|
22
|
+
* @param params?
|
|
23
23
|
* @returns DappIntent
|
|
24
24
|
*/
|
|
25
25
|
static buildIntent(
|
package/src/intent/Resource.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { assertEx } from '@xylabs/
|
|
1
|
+
import { assertEx } from '@xylabs/sdk-js'
|
|
2
2
|
import type { DappIntent, XyOsContext } from '@xyo-network/os-model'
|
|
3
3
|
import { isDappIntent } from '@xyo-network/os-model'
|
|
4
4
|
import type { WithSources, WithStorageMeta } from '@xyo-network/payload-model'
|
package/src/lib/PayloadStore.ts
CHANGED
|
@@ -80,8 +80,7 @@ export class PayloadStore<T extends Payload = Payload> implements ExternalStore
|
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
82
|
* Add a call back function that is invoked when new Payloads are inserted
|
|
83
|
-
*
|
|
84
|
-
* @param {PayloadListener} onStoreChange
|
|
83
|
+
* @param onStoreChange
|
|
85
84
|
*/
|
|
86
85
|
subscribe(onStoreChange: Listener) {
|
|
87
86
|
this.listeners.push(onStoreChange)
|
package/src/lib/isEqual.ts
CHANGED
package/src/lib/isPayload.ts
CHANGED
package/src/loadOsNode.ts
CHANGED
|
@@ -29,7 +29,7 @@ export const loadOsNode = async (
|
|
|
29
29
|
|
|
30
30
|
// Create the OS node manifest
|
|
31
31
|
const osNodeLocator: ModuleFactoryLocatorInstance = locator ?? getDefaultOsNodeLocator()
|
|
32
|
-
const manifestWrapper = new ManifestWrapper(osNodeManifest as PackageManifestPayload, osNodeWallet, osNodeLocator)
|
|
32
|
+
const manifestWrapper = new ManifestWrapper(osNodeManifest as unknown as PackageManifestPayload, osNodeWallet, osNodeLocator)
|
|
33
33
|
|
|
34
34
|
// Create the OS & kernel nodes
|
|
35
35
|
const osNode = (await manifestWrapper.loadNodes())[0]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/
|
|
1
|
+
import type { Address } from '@xylabs/sdk-js'
|
|
2
2
|
import type { QuerySendStartedEventArgs } from '@xyo-network/bridge-model'
|
|
3
3
|
import type { ModuleInstance } from '@xyo-network/module-model'
|
|
4
4
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import type { Promisable } from '@xylabs/sdk-js'
|
|
2
|
+
import {
|
|
3
|
+
forget, fulfilled, rejected,
|
|
4
|
+
} from '@xylabs/sdk-js'
|
|
4
5
|
import { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
|
|
5
6
|
import type { ModuleFactoryLocatorInstance } from '@xyo-network/module-model'
|
|
6
7
|
import type {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Hash } from '@xylabs/
|
|
1
|
+
import type { Hash } from '@xylabs/sdk-js'
|
|
2
2
|
import type {
|
|
3
3
|
DappPackageManifestPayload,
|
|
4
4
|
DappParams,
|
|
@@ -37,10 +37,9 @@ export class DappRegistry {
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* Register a Dapp with window manager and if successful, return its id
|
|
40
|
-
*
|
|
41
|
-
* @
|
|
42
|
-
|
|
43
|
-
**/
|
|
40
|
+
* @param dapp Manifest and UI of the Dapp to register
|
|
41
|
+
* @returns dapp with registration fields
|
|
42
|
+
*/
|
|
44
43
|
async registerDapp(dapp?: UnregisteredDapp): Promise<RegisteredDapp | null> {
|
|
45
44
|
if (dapp) {
|
|
46
45
|
const {
|
|
@@ -92,7 +91,6 @@ export class DappRegistry {
|
|
|
92
91
|
|
|
93
92
|
/**
|
|
94
93
|
* Unregister a dapp so it can no longer be launched
|
|
95
|
-
*
|
|
96
94
|
* @param dappId
|
|
97
95
|
*/
|
|
98
96
|
unregisterDapp(dappId: Hash) {
|
|
@@ -4,9 +4,9 @@ import type {
|
|
|
4
4
|
DappPackageManifestPayload, DappParams, RegisteredDappAccess, UnregisteredDappAccess,
|
|
5
5
|
} from '@xyo-network/os-model'
|
|
6
6
|
import type { Payload } from '@xyo-network/payload-model'
|
|
7
|
-
import { isPayloadOfSchemaType } from '@xyo-network/payload-model'
|
|
7
|
+
import { asSchema, isPayloadOfSchemaType } from '@xyo-network/payload-model'
|
|
8
8
|
|
|
9
|
-
export const FailedAccessorSchema = 'network.xyo.os.failed.accessor.registration'
|
|
9
|
+
export const FailedAccessorSchema = asSchema('network.xyo.os.failed.accessor.registration', true)
|
|
10
10
|
export type FailedAccessorSchema = typeof FailedAccessorSchema
|
|
11
11
|
|
|
12
12
|
export type FailedAccessor = Payload<{
|
|
@@ -20,5 +20,5 @@ export type ValidateDappAccessDivinerParams = DivinerParams & { dappParams: Dapp
|
|
|
20
20
|
export type ValidateDappAccessDivinerIn = DappPackageManifestPayload | PackageManifestPayload | UnregisteredDappAccess
|
|
21
21
|
export type ValidateDappAccessDivinerOut = RegisteredDappAccess | FailedAccessor
|
|
22
22
|
|
|
23
|
-
export const ValidateDappAccessDivinerConfigSchema = 'network.xyo.os.dapp.access.registration.validate'
|
|
23
|
+
export const ValidateDappAccessDivinerConfigSchema = asSchema('network.xyo.os.dapp.access.registration.validate', true)
|
|
24
24
|
export type ValidateDappAccessDivinerConfigSchema = typeof ValidateDappAccessDivinerConfigSchema
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/
|
|
1
|
+
import type { Address } from '@xylabs/sdk-js'
|
|
2
2
|
import { AbstractDiviner } from '@xyo-network/diviner-abstract'
|
|
3
3
|
import type { NodeManifestPayload, PackageManifestPayload } from '@xyo-network/manifest'
|
|
4
4
|
import { ManifestWrapper, PackageManifestPayloadSchema } from '@xyo-network/manifest'
|
package/src/signer/Signers.ts
CHANGED
package/src/stack/Base.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import type { Promisable } from '@xylabs/promise'
|
|
1
|
+
import type { BaseParams, Promisable } from '@xylabs/sdk-js'
|
|
2
|
+
import {
|
|
3
|
+
assertEx, BaseEmitter, forget,
|
|
4
|
+
} from '@xylabs/sdk-js'
|
|
6
5
|
import type { ModuleIdentifier } from '@xyo-network/module-model'
|
|
7
6
|
import { isModuleInstance } from '@xyo-network/module-model'
|
|
8
7
|
import type { AttachableNodeInstance } from '@xyo-network/node-model'
|
|
@@ -46,7 +45,7 @@ export class StackBase extends BaseEmitter<BaseParams, StackBaseEvents> implemen
|
|
|
46
45
|
constructor(context: XyOsContext, adapterSet: AdapterSetCreator, stackNodeModuleId: ModuleIdentifier) {
|
|
47
46
|
super({})
|
|
48
47
|
this._context = context
|
|
49
|
-
this._adapterSet = adapterSet(assertEx(this.context.kernel, 'Kernel access required'))
|
|
48
|
+
this._adapterSet = adapterSet(assertEx(this.context.kernel, () => 'Kernel access required'))
|
|
50
49
|
this._stackNodeModuleId = stackNodeModuleId
|
|
51
50
|
}
|
|
52
51
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { assertEx } from '@xylabs/
|
|
1
|
+
import { assertEx } from '@xylabs/sdk-js'
|
|
2
2
|
import type { NodeInstance } from '@xyo-network/node-model'
|
|
3
3
|
import { asAttachableNodeInstance, asNodeInstance } from '@xyo-network/node-model'
|
|
4
4
|
import type { AdapterSetCreator, XyOsContext } from '@xyo-network/os-model'
|
|
@@ -47,7 +47,7 @@ export class ManageSystemDapps extends OsCallerBase {
|
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* Add a callback to listen for errors throwing during system dapp registration
|
|
50
|
-
* @param
|
|
50
|
+
* @param errorListener
|
|
51
51
|
*/
|
|
52
52
|
addErrorListener(errorListener: ErrorListener) {
|
|
53
53
|
this.onErrorCallbacks.push(errorListener)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Hash } from '@xylabs/
|
|
1
|
+
import type { Hash } from '@xylabs/sdk-js'
|
|
2
2
|
import type { WalletSeedPhrase } from '@xyo-network/os-model'
|
|
3
3
|
import { WalletSeedPhraseSchema } from '@xyo-network/os-model'
|
|
4
4
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
@@ -10,22 +10,21 @@ export type SeedPhrase = string
|
|
|
10
10
|
export interface SeedPhraseRepository {
|
|
11
11
|
/**
|
|
12
12
|
* Add a seed phrase for a given SeedPhraseId
|
|
13
|
-
* @param
|
|
13
|
+
* @param id
|
|
14
14
|
* @returns Promise
|
|
15
15
|
*/
|
|
16
16
|
add(id: SeedPhraseId): Promise<string>
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* For a given DappId, find its wallet or create a new wallet and return its walletId
|
|
20
|
-
* @param
|
|
20
|
+
* @param dappName
|
|
21
21
|
* @returns Promise
|
|
22
22
|
*/
|
|
23
23
|
findOrCreate(dappName: SeedPhraseId): Promise<WalletId>
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Request a seed phrase by supplying a walletId. Note: In the future, the OS might require verification along side the walletId
|
|
27
|
-
*
|
|
28
|
-
* @param {WalletId} walletId
|
|
27
|
+
* @param walletId
|
|
29
28
|
* @returns DappWalletSeedPhrase
|
|
30
29
|
*/
|
|
31
30
|
request(walletId: WalletId): Promise<SeedPhrase | undefined>
|