@xyo-network/os-runtime 7.2.1 → 7.3.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.map +1 -1
- package/dist/neutral/DappCallerBase.d.ts +2 -2
- package/dist/neutral/OsCallerBase.d.ts +2 -2
- package/dist/neutral/RunningDappCache.d.ts.map +1 -1
- package/dist/neutral/XyOs.d.ts +4 -5
- package/dist/neutral/XyOs.d.ts.map +1 -1
- package/dist/neutral/XyOsBase.d.ts +122 -3
- package/dist/neutral/XyOsBase.d.ts.map +1 -1
- package/dist/neutral/XyOsDapp.d.ts +3 -3
- 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/access/RunningAccessDappCache.d.ts.map +1 -1
- package/dist/neutral/access/interfaces/registered-names/helpers/resource/AbstractXnsCaller.d.ts +1 -1
- package/dist/neutral/adapter/Base.d.ts.map +1 -1
- package/dist/neutral/classes/lib/DappCreatorParams.d.ts +3 -3
- package/dist/neutral/classes/lib/DappCreatorParams.d.ts.map +1 -1
- package/dist/neutral/classes/lib/Insertable.d.ts +1 -3
- package/dist/neutral/classes/lib/Insertable.d.ts.map +1 -1
- package/dist/neutral/classes/settings/CallerBase.d.ts +1 -1
- package/dist/neutral/classes/settings/SettingsQueries.d.ts.map +1 -1
- package/dist/neutral/dapp/context/creator/Creator.d.ts +1 -1
- package/dist/neutral/dapp/context/creator/Creator.d.ts.map +1 -1
- package/dist/neutral/dapp/context/creator/createDappContext.d.ts.map +1 -1
- package/dist/neutral/event/bus/EventBus.d.ts +1 -1
- package/dist/neutral/event/bus/EventBus.d.ts.map +1 -1
- package/dist/neutral/helpers/monitor/XyOsMonitor.d.ts +2 -2
- package/dist/neutral/helpers/monitor/XyOsMonitor.d.ts.map +1 -1
- package/dist/neutral/helpers/monitor/types.d.ts +2 -2
- package/dist/neutral/helpers/monitor/types.d.ts.map +1 -1
- package/dist/neutral/index.mjs +42 -36
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/lib/Listener.d.ts +1 -1
- package/dist/neutral/lib/Listener.d.ts.map +1 -1
- package/dist/neutral/loadOsNode.d.ts.map +1 -1
- package/dist/neutral/profileModuleEvents.d.ts +1 -3
- package/dist/neutral/profileModuleEvents.d.ts.map +1 -1
- package/dist/neutral/registration/DappRegistrationService.d.ts +3 -3
- package/dist/neutral/registration/DappRegistrationService.d.ts.map +1 -1
- package/dist/neutral/registration/DappRegistry.d.ts.map +1 -1
- package/dist/neutral/registration/ValidateDappAccessDiviner/Config.d.ts +1 -1
- package/dist/neutral/registration/ValidateDappAccessDiviner/Config.d.ts.map +1 -1
- package/dist/neutral/scripts/xyos/lib/headless.d.ts.map +1 -1
- package/dist/neutral/signer/Signers.d.ts.map +1 -1
- package/dist/neutral/stack/Manager.d.ts +2 -6
- package/dist/neutral/stack/Manager.d.ts.map +1 -1
- package/dist/neutral/system/ManageSystemDapps.d.ts +2 -2
- package/dist/neutral/system/ManageSystemDapps.d.ts.map +1 -1
- package/dist/node/Caller.d.ts.map +1 -1
- package/dist/node/DappCallerBase.d.ts +2 -2
- package/dist/node/OsCallerBase.d.ts +2 -2
- package/dist/node/RunningDappCache.d.ts.map +1 -1
- package/dist/node/XyOs.d.ts +4 -5
- package/dist/node/XyOs.d.ts.map +1 -1
- package/dist/node/XyOsBase.d.ts +122 -3
- package/dist/node/XyOsBase.d.ts.map +1 -1
- package/dist/node/XyOsDapp.d.ts +3 -3
- 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/access/RunningAccessDappCache.d.ts.map +1 -1
- package/dist/node/access/interfaces/registered-names/helpers/resource/AbstractXnsCaller.d.ts +1 -1
- package/dist/node/adapter/Base.d.ts.map +1 -1
- package/dist/node/classes/lib/DappCreatorParams.d.ts +3 -3
- package/dist/node/classes/lib/DappCreatorParams.d.ts.map +1 -1
- package/dist/node/classes/lib/Insertable.d.ts +1 -3
- package/dist/node/classes/lib/Insertable.d.ts.map +1 -1
- package/dist/node/classes/settings/CallerBase.d.ts +1 -1
- package/dist/node/classes/settings/SettingsQueries.d.ts.map +1 -1
- package/dist/node/dapp/context/creator/Creator.d.ts +1 -1
- package/dist/node/dapp/context/creator/Creator.d.ts.map +1 -1
- package/dist/node/dapp/context/creator/createDappContext.d.ts.map +1 -1
- package/dist/node/event/bus/EventBus.d.ts +1 -1
- package/dist/node/event/bus/EventBus.d.ts.map +1 -1
- package/dist/node/helpers/monitor/XyOsMonitor.d.ts +2 -2
- package/dist/node/helpers/monitor/XyOsMonitor.d.ts.map +1 -1
- package/dist/node/helpers/monitor/types.d.ts +2 -2
- package/dist/node/helpers/monitor/types.d.ts.map +1 -1
- package/dist/node/index.mjs +42 -36
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/lib/Listener.d.ts +1 -1
- package/dist/node/lib/Listener.d.ts.map +1 -1
- package/dist/node/loadOsNode.d.ts.map +1 -1
- package/dist/node/profileModuleEvents.d.ts +1 -3
- package/dist/node/profileModuleEvents.d.ts.map +1 -1
- package/dist/node/registration/DappRegistrationService.d.ts +3 -3
- package/dist/node/registration/DappRegistrationService.d.ts.map +1 -1
- package/dist/node/registration/DappRegistry.d.ts.map +1 -1
- package/dist/node/registration/ValidateDappAccessDiviner/Config.d.ts +1 -1
- package/dist/node/registration/ValidateDappAccessDiviner/Config.d.ts.map +1 -1
- package/dist/node/scripts/xyos/index.mjs +27 -24
- package/dist/node/scripts/xyos/index.mjs.map +1 -1
- package/dist/node/scripts/xyos/lib/headless.d.ts.map +1 -1
- package/dist/node/signer/Signers.d.ts.map +1 -1
- package/dist/node/stack/Manager.d.ts +2 -6
- package/dist/node/stack/Manager.d.ts.map +1 -1
- package/dist/node/system/ManageSystemDapps.d.ts +2 -2
- package/dist/node/system/ManageSystemDapps.d.ts.map +1 -1
- package/package.json +134 -49
- package/dist/neutral/signer/Signer.spec.d.ts +0 -2
- package/dist/neutral/signer/Signer.spec.d.ts.map +0 -1
- package/dist/neutral/spec/boot.spec.d.ts +0 -2
- package/dist/neutral/spec/boot.spec.d.ts.map +0 -1
- package/dist/node/signer/Signer.spec.d.ts +0 -2
- package/dist/node/signer/Signer.spec.d.ts.map +0 -1
- package/dist/node/spec/boot.spec.d.ts +0 -2
- package/dist/node/spec/boot.spec.d.ts.map +0 -1
- package/src/Caller.ts +0 -200
- package/src/DappCallerBase.ts +0 -55
- package/src/DefaultsQueries.ts +0 -27
- package/src/OsCallerBase.ts +0 -59
- package/src/PubSubBridgeCaller.ts +0 -33
- package/src/RunningDappCache.ts +0 -58
- package/src/XyOs.ts +0 -166
- package/src/XyOsBase.ts +0 -135
- package/src/XyOsDapp.ts +0 -106
- package/src/access/Caller.ts +0 -85
- package/src/access/Queries.ts +0 -38
- package/src/access/Resource.ts +0 -65
- package/src/access/RunningAccessDappCache.ts +0 -21
- package/src/access/index.ts +0 -4
- package/src/access/interfaces/index.ts +0 -1
- package/src/access/interfaces/registered-names/helpers/AccessNodeQueries.ts +0 -68
- package/src/access/interfaces/registered-names/helpers/index.ts +0 -2
- package/src/access/interfaces/registered-names/helpers/resource/AbstractXnsCaller.ts +0 -42
- package/src/access/interfaces/registered-names/helpers/resource/RegistrationsResource.ts +0 -52
- package/src/access/interfaces/registered-names/helpers/resource/RegistrationsResourceQueries.ts +0 -23
- package/src/access/interfaces/registered-names/helpers/resource/index.ts +0 -3
- package/src/access/interfaces/registered-names/index.ts +0 -1
- package/src/adapter/Base.ts +0 -106
- package/src/adapter/Network.ts +0 -31
- package/src/adapter/Settings.ts +0 -30
- package/src/adapter/index.ts +0 -2
- package/src/adapters/OsPubSubBridgeNetwork.ts +0 -10
- package/src/adapters/OsSettings.ts +0 -7
- package/src/adapters/OsXyoPublicNetwork.ts +0 -9
- package/src/adapters/index.ts +0 -3
- package/src/classes/dapp/DefaultsResource.ts +0 -67
- package/src/classes/dapp/index.ts +0 -1
- package/src/classes/index.ts +0 -4
- package/src/classes/lib/DappCreatorParams.ts +0 -18
- package/src/classes/lib/Insertable.ts +0 -10
- package/src/classes/lib/index.ts +0 -2
- package/src/classes/menu/Caller.ts +0 -76
- package/src/classes/menu/Queries.ts +0 -60
- package/src/classes/menu/Resource.ts +0 -105
- package/src/classes/menu/index.ts +0 -2
- package/src/classes/settings/Caller.ts +0 -78
- package/src/classes/settings/CallerBase.ts +0 -27
- package/src/classes/settings/Resource.ts +0 -81
- package/src/classes/settings/SettingsQueries.ts +0 -56
- package/src/classes/settings/badge/Caller.ts +0 -30
- package/src/classes/settings/badge/Queries.ts +0 -19
- package/src/classes/settings/badge/Resource.ts +0 -50
- package/src/classes/settings/badge/index.ts +0 -2
- package/src/classes/settings/index.ts +0 -5
- package/src/dapp/context/creator/Creator.ts +0 -122
- package/src/dapp/context/creator/DefaultPayloads/DappAccessPayloads.ts +0 -20
- package/src/dapp/context/creator/DefaultPayloads/DefaultPayloads.ts +0 -40
- package/src/dapp/context/creator/DefaultPayloads/NodeInfoPayload.ts +0 -33
- package/src/dapp/context/creator/DefaultPayloads/index.ts +0 -1
- package/src/dapp/context/creator/ExternalModulePermissions/ExternalModulePermissions.ts +0 -59
- package/src/dapp/context/creator/ExternalModulePermissions/index.ts +0 -1
- package/src/dapp/context/creator/createDappContext.ts +0 -61
- package/src/dapp/context/creator/index.ts +0 -3
- package/src/dapp/context/index.ts +0 -1
- package/src/dapp/index.ts +0 -1
- package/src/event/bus/Connection.ts +0 -31
- package/src/event/bus/EventBus.ts +0 -160
- package/src/event/bus/PubSubConnection.ts +0 -28
- package/src/event/bus/index.ts +0 -3
- package/src/event/connections/DappAccessRequest.ts +0 -11
- package/src/event/connections/DappsReady.ts +0 -9
- package/src/event/connections/ExposeDappRequest.ts +0 -11
- package/src/event/connections/OsPubSubNetworkReady.ts +0 -12
- package/src/event/connections/OsSettingsReady.ts +0 -12
- package/src/event/connections/OsXyoPublicReady.ts +0 -12
- package/src/event/connections/index.ts +0 -6
- package/src/event/index.ts +0 -2
- package/src/helpers/index.ts +0 -1
- package/src/helpers/monitor/XyOsMonitor.ts +0 -52
- package/src/helpers/monitor/index.ts +0 -2
- package/src/helpers/monitor/types.ts +0 -8
- package/src/index.ts +0 -29
- package/src/initializer/DappInitializer.ts +0 -57
- package/src/initializer/index.ts +0 -1
- package/src/intent/Caller.ts +0 -74
- package/src/intent/Resource.ts +0 -66
- package/src/intent/index.ts +0 -2
- package/src/lib/ExternalStore.ts +0 -7
- package/src/lib/Listener.ts +0 -1
- package/src/lib/ModuleAccountPaths.ts +0 -23
- package/src/lib/ModuleNames.ts +0 -3
- package/src/lib/NameTransforms.ts +0 -34
- package/src/lib/PayloadStore.ts +0 -105
- package/src/lib/ResourceStores.ts +0 -7
- package/src/lib/index.ts +0 -11
- package/src/lib/initializeXns.ts +0 -16
- package/src/lib/isEqual.ts +0 -42
- package/src/lib/isPayload.ts +0 -24
- package/src/lib/tokenPlacesSplit.ts +0 -17
- package/src/loadOsNode.ts +0 -44
- package/src/manifest/index.ts +0 -2
- package/src/manifest/manifestReplacementTokens.ts +0 -6
- package/src/manifest/os-node.manifest.json +0 -132
- package/src/manifests/dapp-window.manifest.json +0 -36
- package/src/manifests/index.ts +0 -1
- package/src/models/access/ValidDappAccessInterfaces.ts +0 -6
- package/src/models/access/index.ts +0 -1
- package/src/models/index.ts +0 -1
- package/src/profileModuleEvents.ts +0 -43
- package/src/registration/DappRegistrationService.ts +0 -180
- package/src/registration/DappRegistry.ts +0 -129
- package/src/registration/ValidateDappAccessDiviner/Config.ts +0 -24
- package/src/registration/ValidateDappAccessDiviner/Diviner.ts +0 -133
- package/src/registration/ValidateDappAccessDiviner/index.ts +0 -2
- package/src/registration/index.ts +0 -2
- package/src/scripts/xyos/command/config.ts +0 -19
- package/src/scripts/xyos/command/create.ts +0 -22
- package/src/scripts/xyos/command/index.ts +0 -7
- package/src/scripts/xyos/command/manifest.ts +0 -19
- package/src/scripts/xyos/command/start.ts +0 -35
- package/src/scripts/xyos/index.ts +0 -31
- package/src/scripts/xyos/lib/createFromTemplate.ts +0 -11
- package/src/scripts/xyos/lib/headless.ts +0 -68
- package/src/scripts/xyos/lib/index.ts +0 -2
- package/src/signer/Signer.spec.ts +0 -65
- package/src/signer/Signers.ts +0 -74
- package/src/signer/index.ts +0 -1
- package/src/spec/boot.spec.ts +0 -89
- package/src/stack/Base.ts +0 -165
- package/src/stack/Manager.ts +0 -51
- package/src/stack/Map.ts +0 -22
- package/src/stack/OsPubSubNetworkStack.ts +0 -70
- package/src/stack/OsSettingsStack.ts +0 -24
- package/src/stack/XyoPublicNetworkStack.ts +0 -32
- package/src/stack/index.ts +0 -6
- package/src/system/ManageSystemDapps.ts +0 -148
- package/src/system/Queries.ts +0 -69
- package/src/system/index.ts +0 -1
- package/src/types/global.d.ts +0 -9
- package/src/types/images.d.ts +0 -5
- package/src/utils/buildWalletSeedPhrasePayload.ts +0 -51
- package/src/utils/getApiDomain.ts +0 -14
- package/src/utils/index.ts +0 -3
- package/src/utils/renameObjKey.ts +0 -22
- package/src/wallet/DappSeedPhraseRepository.ts +0 -99
- package/src/wallet/SeedPhraseRepository.ts +0 -31
- package/src/wallet/index.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headless.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/xyos/lib/headless.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"headless.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/xyos/lib/headless.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAwBpE,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,aAAa,CAAC,EAAE,mBAAmB,EAAE,CAAA;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,eAAO,MAAM,QAAQ,GAAU,uCAE5B,cAAmB,kBA8BrB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Signers.d.ts","sourceRoot":"","sources":["../../../src/signer/Signers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EACV,cAAc,EAAE,eAAe,EAAE,qBAAqB,EACvD,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"Signers.d.ts","sourceRoot":"","sources":["../../../src/signer/Signers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EACV,cAAc,EAAE,eAAe,EAAE,qBAAqB,EACvD,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EACV,UAAU,EACV,qBAAqB,EACtB,MAAM,4BAA4B,CAAA;AAEnC,qBAAa,OAAQ,YAAW,eAAe;IAC7C,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,eAAe,CAAiC;IACxD,OAAO,CAAC,YAAY,CAAuB;gBAE/B,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,qBAAqB;IAM5E,OAAO,KAAK,KAAK,GAEhB;IAED,OAAO,KAAK,cAAc,GAEzB;IAED,OAAO,KAAK,WAAW,GAEtB;IAED,SAAS,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAI9E,mBAAmB,CAAC,UAAU,EAAE,UAAU,GAAG,cAAc,GAAG,SAAS;IAIjE,UAAU;YAQF,iBAAiB;CAuBhC"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import type { AdapterSetCreator, XyOsContext } from '@xyo-network/os-model';
|
|
2
2
|
import type { StackBase } from './Base.ts';
|
|
3
|
-
export
|
|
4
|
-
new (context: XyOsContext, adapters: AdapterSetCreator): StackBase;
|
|
5
|
-
}
|
|
3
|
+
export type StackConstructor = new (context: XyOsContext, adapters: AdapterSetCreator) => StackBase;
|
|
6
4
|
export interface UninitializedStackSet {
|
|
7
5
|
adapters: AdapterSetCreator;
|
|
8
6
|
stack: StackConstructor;
|
|
9
7
|
}
|
|
10
|
-
export
|
|
11
|
-
[key: string]: UninitializedStackSet;
|
|
12
|
-
}
|
|
8
|
+
export type UninitializedStackMap = Record<string, UninitializedStackSet>;
|
|
13
9
|
export declare class StackManager {
|
|
14
10
|
private initializedStacksMap;
|
|
15
11
|
private stackMap;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Manager.d.ts","sourceRoot":"","sources":["../../../src/stack/Manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EAAoB,WAAW,EACjD,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAE1C,MAAM,
|
|
1
|
+
{"version":3,"file":"Manager.d.ts","sourceRoot":"","sources":["../../../src/stack/Manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EAAoB,WAAW,EACjD,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAE1C,MAAM,MAAM,gBAAgB,GAAG,KAAK,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,iBAAiB,KAAK,SAAS,CAAA;AAEnG,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,KAAK,EAAE,gBAAgB,CAAA;CACxB;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAA;AAEzE,qBAAa,YAAY;IACvB,OAAO,CAAC,oBAAoB,CAAsC;IAClE,OAAO,CAAC,QAAQ,CAAuB;gBAE3B,QAAQ,EAAE,qBAAqB;IAI3C,IAAI,MAAM,aAET;IAED,OAAO,KAAK,iBAAiB,GAE5B;IAED,QAAQ,CAAC,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,GACO,MAAM,GAAG,SAAS;IAGjE,UAAU,CAAC,OAAO,EAAE,WAAW;IAU/B,IAAI;CAKL"}
|
|
@@ -2,10 +2,10 @@ import type { ModuleFactoryLocatorInstance } from '@xyo-network/module-model';
|
|
|
2
2
|
import type { DappConfig, DappIcon, DappParams, DappSet, PayloadWithVersion, XyOsContext } from '@xyo-network/os-model';
|
|
3
3
|
import { OsCallerBase } from '../OsCallerBase.ts';
|
|
4
4
|
export type ErrorListener = (failedPayloads: DappConfig[]) => void;
|
|
5
|
-
export
|
|
5
|
+
export interface DappSetsAndPayloads {
|
|
6
6
|
dappPayloads: (DappConfig | DappIcon)[];
|
|
7
7
|
dappSets: DappSet[];
|
|
8
|
-
}
|
|
8
|
+
}
|
|
9
9
|
/**
|
|
10
10
|
* Manage the installation of system dapps from payloads and return the built sets
|
|
11
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManageSystemDapps.d.ts","sourceRoot":"","sources":["../../../src/system/ManageSystemDapps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ManageSystemDapps.d.ts","sourceRoot":"","sources":["../../../src/system/ManageSystemDapps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAA;AAC7E,OAAO,KAAK,EACV,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAC3E,MAAM,uBAAuB,CAAA;AAM9B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGjD,MAAM,MAAM,aAAa,GAAG,CAAC,cAAc,EAAE,UAAU,EAAE,KAAK,IAAI,CAAA;AAClE,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,CAAC,UAAU,GAAG,QAAQ,CAAC,EAAE,CAAA;IACvC,QAAQ,EAAE,OAAO,EAAE,CAAA;CACpB;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,YAAY;IACjD,OAAO,CAAC,uBAAuB,CAA4B;IAC3D,OAAO,CAAC,kBAAkB,CAAsB;IAChD,OAAO,CAAC,kBAAkB,CAAU;IACpC,OAAO,CAAC,eAAe,CAAC,CAAS;IACjC,OAAO,CAAC,OAAO,CAAC,CAA8B;IAE9C,OAAO,CAAC,gBAAgB,CAAsB;gBAG5C,OAAO,EAAE,WAAW,EACpB,kBAAkB,EAAE,MAAM,EAAE,EAC5B,kBAAkB,EAAE,kBAAkB,EAAE,EACxC,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EACnD,OAAO,CAAC,EAAE,4BAA4B,EACtC,eAAe,CAAC,EAAE,OAAO;IAU3B;;;OAGG;IACH,gBAAgB,CAAC,aAAa,EAAE,aAAa;IAI7C;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YAKrB,YAAY;YAIZ,cAAc;YA6Bd,UAAU;CAmDzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/os-runtime",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.1",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -30,69 +30,154 @@
|
|
|
30
30
|
},
|
|
31
31
|
"./package.json": "./package.json"
|
|
32
32
|
},
|
|
33
|
-
"module": "./dist/neutral/index.mjs",
|
|
34
|
-
"types": "dist/neutral/index.d.ts",
|
|
35
33
|
"bin": {
|
|
36
34
|
"xyos": "./scripts/xyos.mjs"
|
|
37
35
|
},
|
|
38
36
|
"files": [
|
|
39
37
|
"dist",
|
|
40
|
-
"
|
|
38
|
+
"README.md",
|
|
39
|
+
"scripts"
|
|
41
40
|
],
|
|
42
41
|
"dependencies": {
|
|
43
|
-
"@xylabs/sdk-js": "
|
|
44
|
-
"@xyo-network/account-model": "~5.3
|
|
45
|
-
"@xyo-network/archivist": "
|
|
46
|
-
"@xyo-network/archivist-indexeddb": "~5.
|
|
47
|
-
"@xyo-network/archivist-
|
|
48
|
-
"@xyo-network/
|
|
49
|
-
"@xyo-network/
|
|
50
|
-
"@xyo-network/
|
|
51
|
-
"@xyo-network/diviner-
|
|
52
|
-
"@xyo-network/diviner-
|
|
53
|
-
"@xyo-network/diviner-payload-
|
|
54
|
-
"@xyo-network/diviner-
|
|
55
|
-
"@xyo-network/
|
|
56
|
-
"@xyo-network/
|
|
57
|
-
"@xyo-network/
|
|
58
|
-
"@xyo-network/
|
|
59
|
-
"@xyo-network/
|
|
60
|
-
"@xyo-network/
|
|
61
|
-
"@xyo-network/
|
|
62
|
-
"@xyo-network/
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"terminal-kit": "~3.1.2",
|
|
78
|
-
"uuid": "~13.0.0",
|
|
79
|
-
"yargs": "~18.0.0"
|
|
42
|
+
"@xylabs/sdk-js": "^5.1.2",
|
|
43
|
+
"@xyo-network/account-model": "~5.6.3",
|
|
44
|
+
"@xyo-network/archivist": "5.6.4",
|
|
45
|
+
"@xyo-network/archivist-indexeddb": "~5.6.4",
|
|
46
|
+
"@xyo-network/archivist-model": "^5.6.4",
|
|
47
|
+
"@xyo-network/bridge-model": "^5.6.4",
|
|
48
|
+
"@xyo-network/diviner-abstract": "~5.6.4",
|
|
49
|
+
"@xyo-network/diviner-model": "^5.6.4",
|
|
50
|
+
"@xyo-network/diviner-payload-generic": "~5.6.4",
|
|
51
|
+
"@xyo-network/diviner-payload-indexeddb": "~5.6.4",
|
|
52
|
+
"@xyo-network/diviner-payload-model": "~5.6.4",
|
|
53
|
+
"@xyo-network/diviner-temporal-indexing-model": "~5.6.4",
|
|
54
|
+
"@xyo-network/module": "5.6.4",
|
|
55
|
+
"@xyo-network/module-model": "^5.6.4",
|
|
56
|
+
"@xyo-network/module-resolver": "5.6.4",
|
|
57
|
+
"@xyo-network/node-model": "^5.6.4",
|
|
58
|
+
"@xyo-network/payload-builder": "^5.6.2",
|
|
59
|
+
"@xyo-network/payload-model": "~5.6.3",
|
|
60
|
+
"@xyo-network/sdk-js": "~5.6.4",
|
|
61
|
+
"@xyo-network/wallet-model": "^5.6.3",
|
|
62
|
+
"async-mutex": ">=0.5.0 <1",
|
|
63
|
+
"chalk": ">=5.6.2 <6",
|
|
64
|
+
"cosmiconfig": ">=9.0.1 <10",
|
|
65
|
+
"cosmiconfig-typescript-loader": ">=6.3.0 <7",
|
|
66
|
+
"ethers": ">=6.16.0 <7",
|
|
67
|
+
"semver": ">=7.7.4 <8",
|
|
68
|
+
"terminal-kit": ">=3.1.2 <4",
|
|
69
|
+
"uuid": ">=14.0.0 <15",
|
|
70
|
+
"yargs": ">=18.0.0 <19",
|
|
71
|
+
"@xyo-network/bios": "~7.3.1",
|
|
72
|
+
"@xyo-network/kernel-model": "~7.3.1",
|
|
73
|
+
"@xyo-network/os-model": "~7.3.1",
|
|
74
|
+
"@xyo-network/kernel": "~7.3.1",
|
|
75
|
+
"@xyo-network/storage-model": "~7.3.1"
|
|
80
76
|
},
|
|
81
77
|
"devDependencies": {
|
|
82
|
-
"@
|
|
78
|
+
"@bitauth/libauth": "~3.0.0",
|
|
79
|
+
"@metamask/providers": "^22.1.1",
|
|
80
|
+
"@opentelemetry/api": "^1.9.1",
|
|
81
|
+
"@opentelemetry/sdk-trace-base": "^2.7.1",
|
|
82
|
+
"@scure/base": "~2.2.0",
|
|
83
|
+
"@scure/bip39": "~2.2.0",
|
|
84
|
+
"@types/node": "~25.6.1",
|
|
83
85
|
"@types/semver": "~7.7.1",
|
|
84
86
|
"@types/terminal-kit": "~2.5.7",
|
|
85
87
|
"@types/uuid": "~11.0.0",
|
|
86
88
|
"@types/yargs": "~17.0.35",
|
|
87
|
-
"@xylabs/
|
|
88
|
-
"@xylabs/
|
|
89
|
-
"@
|
|
90
|
-
"@
|
|
91
|
-
"@
|
|
89
|
+
"@xylabs/geo": "^5.1.2",
|
|
90
|
+
"@xylabs/indexed-db": "^5.1.2",
|
|
91
|
+
"@xylabs/threads": "^5.1.2",
|
|
92
|
+
"@xylabs/toolchain": "~7.13.17",
|
|
93
|
+
"@xylabs/tsconfig": "^7.13.17",
|
|
94
|
+
"@xyo-network/account": "~5.6.2",
|
|
95
|
+
"@xyo-network/api": "~5.6.2",
|
|
96
|
+
"@xyo-network/api-models": "~5.6.3",
|
|
97
|
+
"@xyo-network/archivist-view": "~5.6.4",
|
|
98
|
+
"@xyo-network/boundwitness-builder": "^5.6.2",
|
|
99
|
+
"@xyo-network/boundwitness-model": "~5.6.3",
|
|
100
|
+
"@xyo-network/boundwitness-wrapper": "~5.6.2",
|
|
101
|
+
"@xyo-network/bridge-http": "~5.6.4",
|
|
102
|
+
"@xyo-network/bridge-pub-sub": "~5.6.4",
|
|
103
|
+
"@xyo-network/config-payload-plugin": "~5.6.3",
|
|
104
|
+
"@xyo-network/huri": "~5.6.2",
|
|
105
|
+
"@xyo-network/manifest-model": "~5.6.3",
|
|
106
|
+
"@xyo-network/node-memory": "~5.6.4",
|
|
107
|
+
"@xyo-network/payload-plugin": "^5.6.3",
|
|
108
|
+
"@xyo-network/payload-wrapper": "~5.6.2",
|
|
109
|
+
"@xyo-network/query-payload-plugin": "~5.6.3",
|
|
110
|
+
"@xyo-network/sdk-protocol-js": "~5.6.3",
|
|
111
|
+
"@xyo-network/wallet": "~5.6.2",
|
|
112
|
+
"ajv": "^8.20.0",
|
|
113
|
+
"bn.js": "^5.2.3",
|
|
114
|
+
"buffer": "^6.0.3",
|
|
115
|
+
"debug": "~4.4.3",
|
|
116
|
+
"eslint": "~10.3.0",
|
|
117
|
+
"hash-wasm": "~4.12.0",
|
|
118
|
+
"idb": "^8.0.3",
|
|
119
|
+
"lru-cache": "^11.3.6",
|
|
120
|
+
"mapbox-gl": "^3.23.1",
|
|
121
|
+
"observable-fns": "~0.6.1",
|
|
122
|
+
"pako": "^2.1.0",
|
|
123
|
+
"store2": "~2.14.4",
|
|
92
124
|
"typescript": "~5.9.3",
|
|
93
|
-
"
|
|
125
|
+
"vite": "~8.0.11",
|
|
126
|
+
"vitest": "~4.1.5",
|
|
127
|
+
"wasm-feature-detect": "~1.8.0",
|
|
128
|
+
"webextension-polyfill": "^0.12.0",
|
|
129
|
+
"zod": "^4.4.3",
|
|
130
|
+
"@xyo-network/bios-nodejs": "~7.3.1",
|
|
131
|
+
"@xyo-network/bios-model": "~7.3.1"
|
|
132
|
+
},
|
|
133
|
+
"peerDependencies": {
|
|
134
|
+
"@bitauth/libauth": "~3.0",
|
|
135
|
+
"@metamask/providers": "^22.1",
|
|
136
|
+
"@opentelemetry/api": "^1.9",
|
|
137
|
+
"@opentelemetry/sdk-trace-base": "^2.7",
|
|
138
|
+
"@scure/base": "~2.2",
|
|
139
|
+
"@scure/bip39": "~2.2",
|
|
140
|
+
"@types/node": "~25.6",
|
|
141
|
+
"@xylabs/geo": "^5.0",
|
|
142
|
+
"@xylabs/indexed-db": "^5.0",
|
|
143
|
+
"@xylabs/threads": "^5.0",
|
|
144
|
+
"@xyo-network/account": "~5.6",
|
|
145
|
+
"@xyo-network/api": "~5.6",
|
|
146
|
+
"@xyo-network/api-models": "~5.6",
|
|
147
|
+
"@xyo-network/archivist-view": "~5.6",
|
|
148
|
+
"@xyo-network/boundwitness-builder": "^5.5",
|
|
149
|
+
"@xyo-network/boundwitness-model": "~5.6",
|
|
150
|
+
"@xyo-network/boundwitness-wrapper": "~5.6",
|
|
151
|
+
"@xyo-network/bridge-http": "~5.6",
|
|
152
|
+
"@xyo-network/bridge-pub-sub": "~5.6",
|
|
153
|
+
"@xyo-network/config-payload-plugin": "~5.6",
|
|
154
|
+
"@xyo-network/huri": "~5.6",
|
|
155
|
+
"@xyo-network/manifest-model": "~5.6",
|
|
156
|
+
"@xyo-network/node-memory": "~5.6",
|
|
157
|
+
"@xyo-network/payload-plugin": "^5.5",
|
|
158
|
+
"@xyo-network/payload-wrapper": "~5.6",
|
|
159
|
+
"@xyo-network/query-payload-plugin": "~5.6",
|
|
160
|
+
"@xyo-network/sdk-protocol-js": "~5.6",
|
|
161
|
+
"@xyo-network/wallet": "~5.6",
|
|
162
|
+
"ajv": "^8.18",
|
|
163
|
+
"bn.js": "^5.2",
|
|
164
|
+
"buffer": "^6.0",
|
|
165
|
+
"debug": "~4.4",
|
|
166
|
+
"hash-wasm": "~4.12",
|
|
167
|
+
"idb": "^8.0",
|
|
168
|
+
"lru-cache": "^11.3",
|
|
169
|
+
"mapbox-gl": "^3.22",
|
|
170
|
+
"observable-fns": "~0.6",
|
|
171
|
+
"pako": "^2.1",
|
|
172
|
+
"store2": "~2.14",
|
|
173
|
+
"typescript": "~5.9",
|
|
174
|
+
"wasm-feature-detect": "~1.8",
|
|
175
|
+
"zod": "^4.3"
|
|
176
|
+
},
|
|
177
|
+
"engines": {
|
|
178
|
+
"node": ">=22"
|
|
94
179
|
},
|
|
95
180
|
"publishConfig": {
|
|
96
181
|
"access": "public"
|
|
97
182
|
}
|
|
98
|
-
}
|
|
183
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Signer.spec.d.ts","sourceRoot":"","sources":["../../../src/signer/Signer.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"boot.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/boot.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Signer.spec.d.ts","sourceRoot":"","sources":["../../../src/signer/Signer.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"boot.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/boot.spec.ts"],"names":[],"mappings":""}
|
package/src/Caller.ts
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import type { Hash, Promisable } from '@xylabs/sdk-js'
|
|
2
|
-
import { assertEx } from '@xylabs/sdk-js'
|
|
3
|
-
import type { AccountInstance } from '@xyo-network/account-model'
|
|
4
|
-
import type { PayloadDivinerQueryPayload } from '@xyo-network/diviner-payload-model'
|
|
5
|
-
import { PayloadDivinerQuerySchema } from '@xyo-network/diviner-payload-model'
|
|
6
|
-
import type {
|
|
7
|
-
DappAccessRequest,
|
|
8
|
-
DappId,
|
|
9
|
-
DappInjectableParams,
|
|
10
|
-
DappIntent,
|
|
11
|
-
RegisteredDappAccess,
|
|
12
|
-
XyOsContext,
|
|
13
|
-
} from '@xyo-network/os-model'
|
|
14
|
-
import {
|
|
15
|
-
DappAccessRequestSchema,
|
|
16
|
-
DappInjectableParamsSchema,
|
|
17
|
-
DappIntentTypes,
|
|
18
|
-
DappMode,
|
|
19
|
-
RegisteredDappAccessSchema,
|
|
20
|
-
} from '@xyo-network/os-model'
|
|
21
|
-
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
22
|
-
import type { Payload } from '@xyo-network/payload-model'
|
|
23
|
-
|
|
24
|
-
import { DappCallerBase } from './DappCallerBase.ts'
|
|
25
|
-
import { DappDefaultsResourceQueries } from './DefaultsQueries.ts'
|
|
26
|
-
import { DappIntentCaller } from './intent/index.ts'
|
|
27
|
-
|
|
28
|
-
export class DappCaller extends DappCallerBase {
|
|
29
|
-
constructor(context: XyOsContext) {
|
|
30
|
-
super(context)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Add payloads to the dapp archivist
|
|
35
|
-
* @param payloads
|
|
36
|
-
* @param force
|
|
37
|
-
*/
|
|
38
|
-
async addPayloadsToDappArchivist(payloads: Payload[] = [], force: boolean = false) {
|
|
39
|
-
const dappArchivist = await this.getDappArchivist()
|
|
40
|
-
if (force) {
|
|
41
|
-
await dappArchivist.insert(payloads)
|
|
42
|
-
} else {
|
|
43
|
-
for (const payload of payloads) {
|
|
44
|
-
const hash = await PayloadBuilder.dataHash(payload)
|
|
45
|
-
const [existing] = await dappArchivist.get([hash])
|
|
46
|
-
if (existing) continue
|
|
47
|
-
await dappArchivist.insert([payload])
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Build Access Request
|
|
54
|
-
* @param mode
|
|
55
|
-
* @param registeredDappAccessHash
|
|
56
|
-
* @param requestingDappId
|
|
57
|
-
* @param destinationArchivist
|
|
58
|
-
*/
|
|
59
|
-
buildAccessRequest(mode: DappAccessRequest['mode'], registeredDappAccessHash: Hash, requestingDappId: string, destinationArchivist?: string) {
|
|
60
|
-
const accessRequest: DappAccessRequest = {
|
|
61
|
-
destinationArchivist,
|
|
62
|
-
mode,
|
|
63
|
-
registeredDappAccessHash,
|
|
64
|
-
requestingDappId,
|
|
65
|
-
schema: DappAccessRequestSchema,
|
|
66
|
-
timestamp: Date.now(),
|
|
67
|
-
}
|
|
68
|
-
return accessRequest
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Get all available dapp access requests
|
|
73
|
-
*/
|
|
74
|
-
async getDappAccessPayloads() {
|
|
75
|
-
const diviner = await this.getDappArchivistPayloadDiviner()
|
|
76
|
-
const query: PayloadDivinerQueryPayload = {
|
|
77
|
-
order: 'desc',
|
|
78
|
-
schema: PayloadDivinerQuerySchema,
|
|
79
|
-
schemas: [RegisteredDappAccessSchema],
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return diviner.divine([query])
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Get the most recent dapp injectable params
|
|
87
|
-
* @returns Promise
|
|
88
|
-
*/
|
|
89
|
-
async getDappInjectableParams(): Promise<DappInjectableParams[] | undefined> {
|
|
90
|
-
const diviner = await this.getDappArchivistPayloadDiviner()
|
|
91
|
-
|
|
92
|
-
return await DappDefaultsResourceQueries.getDappInjectableParamsFromRoute(diviner)
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Get the most recent dapp intent
|
|
97
|
-
* @param name
|
|
98
|
-
*/
|
|
99
|
-
async getRegisteredDappAccessByName(name: string) {
|
|
100
|
-
const diviner = await this.getDappArchivistPayloadDiviner()
|
|
101
|
-
const query = {
|
|
102
|
-
limit: 1,
|
|
103
|
-
name,
|
|
104
|
-
schema: PayloadDivinerQuerySchema,
|
|
105
|
-
schemas: [RegisteredDappAccessSchema],
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
const [payload] = assertEx(await diviner.divine([query]), () => 'Unable to find registered dapp access') as RegisteredDappAccess[]
|
|
109
|
-
return payload
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Get the user wallet
|
|
114
|
-
*/
|
|
115
|
-
getUserAccount(dappName: string): Promisable<AccountInstance> {
|
|
116
|
-
// new implementation
|
|
117
|
-
const account = this.context.user.signers?.get(dappName)
|
|
118
|
-
|
|
119
|
-
if (account) {
|
|
120
|
-
return account
|
|
121
|
-
} else {
|
|
122
|
-
throw new Error('Unable to find user wallet')
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Get all wallets for the user
|
|
128
|
-
*/
|
|
129
|
-
getUserAccountsAll(): Promisable<AccountInstance[]> {
|
|
130
|
-
return [...this.context.user.signers?.values() ?? []]
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Make Dapp Access Request
|
|
135
|
-
* @param requestingDappId
|
|
136
|
-
* @param registeredDappAccessHash
|
|
137
|
-
* @param mode
|
|
138
|
-
* @param destinationArchivist
|
|
139
|
-
*/
|
|
140
|
-
async makeDappAccessRequest(
|
|
141
|
-
requestingDappId: DappAccessRequest['requestingDappId'],
|
|
142
|
-
registeredDappAccessHash: DappAccessRequest['registeredDappAccessHash'],
|
|
143
|
-
mode?: DappAccessRequest['mode'],
|
|
144
|
-
destinationArchivist?: DappAccessRequest['destinationArchivist'],
|
|
145
|
-
) {
|
|
146
|
-
const archivist = await this.getDappArchivist()
|
|
147
|
-
const registeredDappAccessPayload = await archivist.get([registeredDappAccessHash])
|
|
148
|
-
if (!registeredDappAccessPayload) {
|
|
149
|
-
throw new Error('No registered dapp access found')
|
|
150
|
-
}
|
|
151
|
-
const accessRequest = this.buildAccessRequest(mode, registeredDappAccessHash, requestingDappId, destinationArchivist)
|
|
152
|
-
await archivist.insert([accessRequest])
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Make Dapp Intent Request
|
|
157
|
-
* @param sourceDappId
|
|
158
|
-
* @param targetDappId
|
|
159
|
-
* @param intent
|
|
160
|
-
* @param mode
|
|
161
|
-
*/
|
|
162
|
-
async makeDappIntentRequest(
|
|
163
|
-
sourceDappId: DappId,
|
|
164
|
-
targetDappId: DappId,
|
|
165
|
-
intent: DappIntentTypes = DappIntentTypes.Launch,
|
|
166
|
-
mode: DappMode = DappMode.Window,
|
|
167
|
-
params?: DappIntent['params'],
|
|
168
|
-
) {
|
|
169
|
-
if (!sourceDappId) {
|
|
170
|
-
throw new Error('No source dapp id provided, dApps must declare a sourceDappId')
|
|
171
|
-
}
|
|
172
|
-
const archivist = await this.getDappArchivist()
|
|
173
|
-
const dappIntent: DappIntent = DappIntentCaller.buildIntent(sourceDappId, intent, targetDappId, mode, params)
|
|
174
|
-
return await archivist.insert([dappIntent])
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Set the dapp injectable params
|
|
179
|
-
* @param searchParams
|
|
180
|
-
* @param pathname
|
|
181
|
-
*/
|
|
182
|
-
async setDappInjectableRouteParams(searchParams: URLSearchParams = new URLSearchParams(), pathname: string): Promise<void> {
|
|
183
|
-
const dappArchivist = await this.getDappArchivist()
|
|
184
|
-
|
|
185
|
-
const params: DappInjectableParams['params'] = {}
|
|
186
|
-
for (const [key, value] of searchParams.entries()) {
|
|
187
|
-
params[key] = value
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
const payload: DappInjectableParams = {
|
|
191
|
-
params,
|
|
192
|
-
path: pathname,
|
|
193
|
-
schema: DappInjectableParamsSchema,
|
|
194
|
-
source: 'route',
|
|
195
|
-
timestamp: Date.now(),
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
await dappArchivist.insert([payload])
|
|
199
|
-
}
|
|
200
|
-
}
|
package/src/DappCallerBase.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { assertEx, toSafeJsonString } from '@xylabs/sdk-js'
|
|
2
|
-
import { asArchivistInstance } from '@xyo-network/archivist-model'
|
|
3
|
-
import { asDivinerInstance } from '@xyo-network/diviner-model'
|
|
4
|
-
import type { XyOsContext } from '@xyo-network/os-model'
|
|
5
|
-
|
|
6
|
-
export const DappArchivistModuleName = 'DappArchivist'
|
|
7
|
-
export const IntentArchivistModuleName = 'IntentArchivist'
|
|
8
|
-
export const IntentArchivistPayloadDivinerModuleName = 'IntentArchivistPayloadDiviner'
|
|
9
|
-
export const DappArchivistPayloadDivinerModuleName = 'DappArchivistPayloadDiviner'
|
|
10
|
-
|
|
11
|
-
export class DappCallerBase {
|
|
12
|
-
protected context: XyOsContext
|
|
13
|
-
constructor(context: XyOsContext) {
|
|
14
|
-
this.context = context
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Get the DappArchivist
|
|
19
|
-
*/
|
|
20
|
-
async getDappArchivist() {
|
|
21
|
-
const mod = assertEx(
|
|
22
|
-
await this.context.root.resolve(DappArchivistModuleName),
|
|
23
|
-
() => `${DappArchivistModuleName} not found [${toSafeJsonString(this.context.root.publicChildren())}]`,
|
|
24
|
-
)
|
|
25
|
-
return asArchivistInstance(mod, () => `${DappArchivistModuleName} is not an archivist`, { required: true })
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Get the DappArchivistPayloadDiviner
|
|
30
|
-
*/
|
|
31
|
-
async getDappArchivistPayloadDiviner() {
|
|
32
|
-
const mod = assertEx(
|
|
33
|
-
await this.context.root.resolve(DappArchivistPayloadDivinerModuleName),
|
|
34
|
-
() => `${DappArchivistPayloadDivinerModuleName} not found`,
|
|
35
|
-
)
|
|
36
|
-
return asDivinerInstance(mod, () => `${DappArchivistPayloadDivinerModuleName} is not a diviner`, { required: true })
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Get the IntentArchivist
|
|
41
|
-
*/
|
|
42
|
-
async getDappIntentArchivist() {
|
|
43
|
-
const mod = assertEx(await this.context.root.resolve(IntentArchivistModuleName), () => `${IntentArchivistModuleName} not found`)
|
|
44
|
-
return asArchivistInstance(mod, () => `${IntentArchivistModuleName} is not an archivist`, { required: true })
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Get the IntentArchivistPayloadDiviner
|
|
48
|
-
async getDappIntentArchivistPayloadDiviner() {
|
|
49
|
-
const mod = assertEx(
|
|
50
|
-
await this.context.root.resolve(IntentArchivistPayloadDivinerModuleName),
|
|
51
|
-
() => `${IntentArchivistPayloadDivinerModuleName} not found`,
|
|
52
|
-
)
|
|
53
|
-
return asDivinerInstance(mod, () => `${IntentArchivistPayloadDivinerModuleName} is not a diviner`, { required: true })
|
|
54
|
-
}
|
|
55
|
-
}
|
package/src/DefaultsQueries.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { DivinerInstance } from '@xyo-network/diviner-model'
|
|
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'
|
|
5
|
-
import type { WithSources } from '@xyo-network/payload-model'
|
|
6
|
-
|
|
7
|
-
export const DappDefaultsResourceQueries = {
|
|
8
|
-
async getDappInjectableParamsFromRoute(diviner: DivinerInstance) {
|
|
9
|
-
const query = {
|
|
10
|
-
limit: 1,
|
|
11
|
-
order: 'desc',
|
|
12
|
-
schema: PayloadDivinerQuerySchema,
|
|
13
|
-
schemas: [DappInjectableParamsSchema],
|
|
14
|
-
source: 'route',
|
|
15
|
-
}
|
|
16
|
-
return (await diviner.divine([query])) as WithSources<DappInjectableParams>[]
|
|
17
|
-
},
|
|
18
|
-
async getNodeOsInfo(diviner: DivinerInstance) {
|
|
19
|
-
const query = {
|
|
20
|
-
limit: 1,
|
|
21
|
-
order: 'desc',
|
|
22
|
-
schema: PayloadDivinerQuerySchema,
|
|
23
|
-
schemas: [NodeOsInfoSchema],
|
|
24
|
-
}
|
|
25
|
-
return (await diviner.divine([query])) as WithSources<NodeOsInfo>[]
|
|
26
|
-
},
|
|
27
|
-
}
|
package/src/OsCallerBase.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { assertEx } from '@xylabs/sdk-js'
|
|
2
|
-
import { asArchivistInstance } from '@xyo-network/archivist-model'
|
|
3
|
-
import { asDivinerInstance } from '@xyo-network/diviner-model'
|
|
4
|
-
import type { XyOsContext } from '@xyo-network/os-model'
|
|
5
|
-
|
|
6
|
-
export const DappsArchivistModuleName = 'DappsArchivist'
|
|
7
|
-
export const DappsArchivistDevelopmentModuleName = `${DappsArchivistModuleName}Development`
|
|
8
|
-
export const DappsArchivistPayloadDivinerModuleName = 'DappsArchivistPayloadDiviner'
|
|
9
|
-
export const DappsArchivistPayloadDevelopmentDivinerModuleName = `${DappsArchivistPayloadDivinerModuleName}Development`
|
|
10
|
-
export const RegisteredDappInterfacesArchivistModuleName = 'RegisteredDappInterfacesArchivist'
|
|
11
|
-
|
|
12
|
-
export class OsCallerBase {
|
|
13
|
-
protected context: XyOsContext
|
|
14
|
-
constructor(context: XyOsContext) {
|
|
15
|
-
this.context = context
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Get the dapps archivist
|
|
19
|
-
async getDappsArchivist() {
|
|
20
|
-
const mod = assertEx(await this.context.root.resolve(DappsArchivistModuleName), () => `${DappsArchivistModuleName} not found`)
|
|
21
|
-
return asArchivistInstance(mod, () => `${DappsArchivistModuleName} is not an archivist`, { required: true })
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Get the dapps archivist development
|
|
25
|
-
async getDappsArchivistDevelopment() {
|
|
26
|
-
const mod = assertEx(
|
|
27
|
-
await this.context.root.resolve(DappsArchivistDevelopmentModuleName),
|
|
28
|
-
() => `${DappsArchivistDevelopmentModuleName} not found`,
|
|
29
|
-
)
|
|
30
|
-
return asArchivistInstance(mod, () => `${DappsArchivistDevelopmentModuleName} is not an archivist`, { required: true })
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// Get the dapps archivist payload diviner
|
|
34
|
-
async getDappsArchivistPayloadDiviner() {
|
|
35
|
-
const mod = assertEx(
|
|
36
|
-
await this.context.root.resolve(DappsArchivistPayloadDivinerModuleName),
|
|
37
|
-
() => `${DappsArchivistPayloadDivinerModuleName} not found`,
|
|
38
|
-
)
|
|
39
|
-
return asDivinerInstance(mod, () => `${DappsArchivistPayloadDivinerModuleName} is not a diviner`, { required: true })
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// Get the dapps archivist payload diviner development
|
|
43
|
-
async getDappsArchivistPayloadDivinerDevelopment() {
|
|
44
|
-
const mod = assertEx(
|
|
45
|
-
await this.context.root.resolve(DappsArchivistPayloadDevelopmentDivinerModuleName),
|
|
46
|
-
() => `${DappsArchivistPayloadDevelopmentDivinerModuleName} not found`,
|
|
47
|
-
)
|
|
48
|
-
return asDivinerInstance(mod, () => `${DappsArchivistPayloadDevelopmentDivinerModuleName} is not a diviner`, { required: true })
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Get the registered dapp interfaces archivist
|
|
52
|
-
async getRegisteredDappInterfacesArchivist() {
|
|
53
|
-
const mod = assertEx(
|
|
54
|
-
await this.context.root.resolve(RegisteredDappInterfacesArchivistModuleName),
|
|
55
|
-
() => `${RegisteredDappInterfacesArchivistModuleName} not found`,
|
|
56
|
-
)
|
|
57
|
-
return asArchivistInstance(mod, () => `${RegisteredDappInterfacesArchivistModuleName} is not an archivist`, { required: true })
|
|
58
|
-
}
|
|
59
|
-
}
|