@xyo-network/os-runtime 3.0.8 → 3.0.10
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 +88 -70
- package/dist/neutral/index.mjs +99 -152
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +53 -52
- package/src/Caller.ts +1 -3
- package/src/DefaultsQueries.ts +2 -6
- package/src/XyOs.ts +18 -15
- package/src/XyOsBase.ts +1 -3
- package/src/XyOsDapp.ts +6 -6
- package/src/access-interfaces/ValidDappAccessInterfaces.ts +1 -3
- package/src/access-interfaces/registered-names/helpers/AccessNodeQueries.ts +1 -3
- package/src/access-interfaces/registered-names/helpers/resource/RegistrationsResource.ts +2 -6
- package/src/adapter/Base.ts +2 -6
- package/src/adapters/OsPubSubBridgeNetwork.ts +1 -3
- package/src/classes/cache/RunningDappCache.ts +2 -6
- package/src/classes/dapp/DefaultsResource.ts +2 -6
- package/src/classes/dapp/access/Caller.ts +1 -3
- package/src/classes/dapp/access/Queries.ts +2 -6
- package/src/classes/dapp/access/Resource.ts +2 -6
- package/src/classes/index.ts +1 -0
- package/src/classes/lib/Insertable.ts +1 -3
- package/src/classes/menu/Caller.ts +1 -3
- package/src/classes/menu/Queries.ts +1 -3
- package/src/classes/menu/Resource.ts +2 -6
- package/src/classes/node/Creator.ts +4 -10
- package/src/classes/node/DefaultPayloads/DappAccessPayloads.ts +1 -3
- package/src/classes/node/DefaultPayloads/DefaultPayloads.ts +1 -3
- package/src/classes/node/DefaultPayloads/SigningKeyPayloads.ts +2 -6
- package/src/classes/node/ExternalModulePermissions/ExternalModulePermissions.ts +1 -3
- package/src/classes/node/createDappContext.ts +2 -6
- package/src/classes/registration/DappRegistrationService.ts +4 -12
- package/src/classes/registration/ValidateDappAccessDiviner/Config.ts +1 -3
- package/src/classes/registration/ValidateDappAccessDiviner/Diviner.ts +2 -6
- package/src/classes/settings/Resource.ts +2 -6
- package/src/classes/settings/SettingsQueries.ts +2 -6
- package/src/classes/settings/badge/Resource.ts +1 -3
- package/src/classes/signer/Signers.ts +69 -0
- package/src/classes/signer/index.ts +1 -0
- package/src/event/bus/EventBus.ts +2 -8
- package/src/helpers/monitor/XyOsMonitor.ts +1 -3
- package/src/intent/Caller.ts +1 -3
- package/src/intent/Resource.ts +2 -6
- package/src/lib/ModuleAccountPaths.ts +1 -3
- package/src/lib/PayloadStore.ts +1 -3
- package/src/lib/isPayload.ts +1 -3
- package/src/profileModuleEvents.ts +2 -6
- package/src/stack/Manager.ts +9 -6
- package/src/stack/OsPubSubNetworkStack.ts +4 -12
- package/src/stack/OsSettingsStack.ts +2 -6
- package/src/stack/XyoPublicNetworkStack.ts +2 -6
- package/src/utils/buildWalletSeedPhrasePayload.ts +2 -6
- package/src/wallet/DappSeedPhraseRepository.ts +1 -3
package/dist/neutral/index.mjs
CHANGED
|
@@ -28,10 +28,7 @@ import { ModuleFactoryLocator as ModuleFactoryLocator5 } from "@xyo-network/modu
|
|
|
28
28
|
|
|
29
29
|
// src/classes/registration/DappRegistrationService.ts
|
|
30
30
|
import { forget as forget2 } from "@xylabs/forget";
|
|
31
|
-
import {
|
|
32
|
-
fulfilled,
|
|
33
|
-
rejected
|
|
34
|
-
} from "@xylabs/promise";
|
|
31
|
+
import { fulfilled, rejected } from "@xylabs/promise";
|
|
35
32
|
import { ModuleFactoryLocator as ModuleFactoryLocator3 } from "@xyo-network/module-factory-locator";
|
|
36
33
|
import {
|
|
37
34
|
DappIntentTypes,
|
|
@@ -116,12 +113,7 @@ var EventBus = class {
|
|
|
116
113
|
console.warn("EventBus already started");
|
|
117
114
|
return this;
|
|
118
115
|
}
|
|
119
|
-
this._archivist = await MemoryArchivist.create({
|
|
120
|
-
config: {
|
|
121
|
-
name: storeName,
|
|
122
|
-
schema: MemoryArchivistConfigSchema
|
|
123
|
-
}
|
|
124
|
-
});
|
|
116
|
+
this._archivist = await MemoryArchivist.create({ config: { name: storeName, schema: MemoryArchivistConfigSchema } });
|
|
125
117
|
this.archivist.on("inserted", ({ payloads }) => {
|
|
126
118
|
const eventBusEvent = payloads.find(isEventBusEvent);
|
|
127
119
|
if (!eventBusEvent) return;
|
|
@@ -144,10 +136,7 @@ var EventBus = class {
|
|
|
144
136
|
handlePublisherAdd(connection) {
|
|
145
137
|
for (const eventName of connection.publishableEvents ?? []) {
|
|
146
138
|
const connectionPublisherCallback = async ({ payloads }) => {
|
|
147
|
-
const event = {
|
|
148
|
-
name: eventName,
|
|
149
|
-
schema: "network.xyo.event.bus.event"
|
|
150
|
-
};
|
|
139
|
+
const event = { name: eventName, schema: "network.xyo.event.bus.event" };
|
|
151
140
|
const eventPayloads = payloads ?? [];
|
|
152
141
|
event.sources = await PayloadBuilder.dataHashes(eventPayloads);
|
|
153
142
|
try {
|
|
@@ -233,10 +222,7 @@ var osXyoPublicNetworkReadyConnection = () => new EventBusPubSubConnection(osXyo
|
|
|
233
222
|
|
|
234
223
|
// src/intent/Caller.ts
|
|
235
224
|
import { PayloadDivinerQuerySchema } from "@xyo-network/diviner-payload-model";
|
|
236
|
-
import {
|
|
237
|
-
DappIntentSchema,
|
|
238
|
-
DappMode
|
|
239
|
-
} from "@xyo-network/os-model";
|
|
225
|
+
import { DappIntentSchema, DappMode } from "@xyo-network/os-model";
|
|
240
226
|
|
|
241
227
|
// src/DappCallerBase.ts
|
|
242
228
|
import { assertEx as assertEx3 } from "@xylabs/assert";
|
|
@@ -864,24 +850,21 @@ var XyOsDapp = class extends XyOsContextBase {
|
|
|
864
850
|
get parent() {
|
|
865
851
|
return this.params.parent;
|
|
866
852
|
}
|
|
853
|
+
get stacks() {
|
|
854
|
+
return [];
|
|
855
|
+
}
|
|
867
856
|
async boot(wallet, locator) {
|
|
868
857
|
return await this._bootMutex.runExclusive(async () => {
|
|
869
858
|
console.log("XyOsDapp:boot:start", wallet.address, this.dapp.id);
|
|
870
859
|
assertEx8(this._root === void 0, () => "Dapp already booted");
|
|
871
860
|
const finalLocator = locator ? (this.params.locator ?? new ModuleFactoryLocator2()).merge(locator) : this.params.locator ?? new ModuleFactoryLocator2();
|
|
872
861
|
console.log("XyOsDapp:boot:finalLocator", finalLocator);
|
|
873
|
-
const dappNodesWrapper = new ManifestWrapper({
|
|
874
|
-
...this.manifest,
|
|
875
|
-
schema: DappPackageManifestPayloadSchema
|
|
876
|
-
}, wallet, finalLocator);
|
|
862
|
+
const dappNodesWrapper = new ManifestWrapper({ ...this.manifest, schema: DappPackageManifestPayloadSchema }, wallet, finalLocator);
|
|
877
863
|
const dappNodes = await dappNodesWrapper.loadNodes();
|
|
878
864
|
const dappManifestWallet = await wallet.derivePath("99999");
|
|
879
865
|
dapp_window_manifest_default.nodes[0].config.name = this.dapp.name + "Root";
|
|
880
866
|
const wrapper = new ManifestWrapper(
|
|
881
|
-
{
|
|
882
|
-
...dapp_window_manifest_default,
|
|
883
|
-
schema: DappPackageManifestPayloadSchema
|
|
884
|
-
},
|
|
867
|
+
{ ...dapp_window_manifest_default, schema: DappPackageManifestPayloadSchema },
|
|
885
868
|
dappManifestWallet,
|
|
886
869
|
finalLocator
|
|
887
870
|
);
|
|
@@ -1079,10 +1062,7 @@ var ValidateDappAccessDivinerConfigSchema = "network.xyo.os.dapp.access.registra
|
|
|
1079
1062
|
// src/classes/registration/ValidateDappAccessDiviner/Diviner.ts
|
|
1080
1063
|
import { HDWallet as HDWallet2 } from "@xyo-network/account";
|
|
1081
1064
|
import { AbstractDiviner } from "@xyo-network/diviner-abstract";
|
|
1082
|
-
import {
|
|
1083
|
-
ManifestWrapper as ManifestWrapper2,
|
|
1084
|
-
PackageManifestPayloadSchema
|
|
1085
|
-
} from "@xyo-network/manifest";
|
|
1065
|
+
import { ManifestWrapper as ManifestWrapper2, PackageManifestPayloadSchema } from "@xyo-network/manifest";
|
|
1086
1066
|
import {
|
|
1087
1067
|
isDappPackageManifestPayload,
|
|
1088
1068
|
isUnregisteredDappAccess,
|
|
@@ -1316,10 +1296,7 @@ var DappRegistrationService = class {
|
|
|
1316
1296
|
exposeDappRequestConnection = exposeDappRequestConnection();
|
|
1317
1297
|
buildDapp(manifest, dappId = NameTransforms.slug(manifest.nodes[0]?.config.name), name = NameTransforms.moduleName(manifest.nodes[0]?.config.name)) {
|
|
1318
1298
|
const dapp = new XyOsDapp({
|
|
1319
|
-
dapp: {
|
|
1320
|
-
id: dappId,
|
|
1321
|
-
name
|
|
1322
|
-
},
|
|
1299
|
+
dapp: { id: dappId, name },
|
|
1323
1300
|
locator: this.locator,
|
|
1324
1301
|
manifest,
|
|
1325
1302
|
parent: this.context
|
|
@@ -1337,10 +1314,7 @@ var DappRegistrationService = class {
|
|
|
1337
1314
|
activeDapps.map(async (dappSet) => {
|
|
1338
1315
|
const { dapp } = dappSet;
|
|
1339
1316
|
const registeredDapp = await this.dappRegistry.registerDapp(dapp);
|
|
1340
|
-
const result = {
|
|
1341
|
-
dapp: registeredDapp,
|
|
1342
|
-
dappIcon: dapp.icon
|
|
1343
|
-
};
|
|
1317
|
+
const result = { dapp: registeredDapp, dappIcon: dapp.icon };
|
|
1344
1318
|
const forgetHandlers = async () => {
|
|
1345
1319
|
try {
|
|
1346
1320
|
await this.postRegistrationHandlers(result);
|
|
@@ -1355,10 +1329,7 @@ var DappRegistrationService = class {
|
|
|
1355
1329
|
const failed = results.filter(rejected).map((result) => result.reason);
|
|
1356
1330
|
const succeeded = results.filter(fulfilled).map((result) => result.value);
|
|
1357
1331
|
for (const registeredDapp of succeeded) this.registeredDappSets.add(registeredDapp);
|
|
1358
|
-
return {
|
|
1359
|
-
failed,
|
|
1360
|
-
succeeded
|
|
1361
|
-
};
|
|
1332
|
+
return { failed, succeeded };
|
|
1362
1333
|
}
|
|
1363
1334
|
addConnectionRequests() {
|
|
1364
1335
|
this.context.eventBus.addConnection(this.dappAccessRequestConnection);
|
|
@@ -1683,6 +1654,9 @@ var StackManager = class {
|
|
|
1683
1654
|
this.stackMap = stackMap;
|
|
1684
1655
|
}
|
|
1685
1656
|
get stacks() {
|
|
1657
|
+
return Object.keys(this.initializedStacksMap);
|
|
1658
|
+
}
|
|
1659
|
+
get initializedStacks() {
|
|
1686
1660
|
return this.initializedStacksMap;
|
|
1687
1661
|
}
|
|
1688
1662
|
getStack(key) {
|
|
@@ -1690,27 +1664,22 @@ var StackManager = class {
|
|
|
1690
1664
|
}
|
|
1691
1665
|
initialize(context) {
|
|
1692
1666
|
for (const [key, stackSet] of Object.entries(this.stackMap)) {
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
adapters: stackNodeModuleId
|
|
1696
|
-
} = stackSet;
|
|
1667
|
+
console.log("stack-initialize", key);
|
|
1668
|
+
const { stack: Stack, adapters: stackNodeModuleId } = stackSet;
|
|
1697
1669
|
const initializedStack = new Stack(context, stackNodeModuleId);
|
|
1698
1670
|
initializedStack.initialize();
|
|
1699
|
-
this.
|
|
1671
|
+
this.initializedStacks.set(key, initializedStack);
|
|
1700
1672
|
}
|
|
1701
1673
|
}
|
|
1702
1674
|
stop() {
|
|
1703
|
-
for (const stack of this.
|
|
1675
|
+
for (const stack of this.initializedStacks.values()) {
|
|
1704
1676
|
stack.stop();
|
|
1705
1677
|
}
|
|
1706
1678
|
}
|
|
1707
1679
|
};
|
|
1708
1680
|
|
|
1709
1681
|
// src/adapters/OsPubSubBridgeNetwork.ts
|
|
1710
|
-
import {
|
|
1711
|
-
ExposedNodeOuterNodeName,
|
|
1712
|
-
PubSubBridgeNodeNodeName
|
|
1713
|
-
} from "@xyo-network/os-model";
|
|
1682
|
+
import { ExposedNodeOuterNodeName, PubSubBridgeNodeNodeName } from "@xyo-network/os-model";
|
|
1714
1683
|
|
|
1715
1684
|
// src/adapter/Base.ts
|
|
1716
1685
|
import { assertEx as assertEx10 } from "@xylabs/assert";
|
|
@@ -1832,14 +1801,8 @@ var OsXyoPublicNetworkAdapters = (kernel) => [
|
|
|
1832
1801
|
|
|
1833
1802
|
// src/stack/OsPubSubNetworkStack.ts
|
|
1834
1803
|
import { assertEx as assertEx11 } from "@xylabs/assert";
|
|
1835
|
-
import {
|
|
1836
|
-
|
|
1837
|
-
asNodeInstance
|
|
1838
|
-
} from "@xyo-network/node-model";
|
|
1839
|
-
import {
|
|
1840
|
-
ExposedNodeOuterNodeName as ExposedNodeOuterNodeName2,
|
|
1841
|
-
PubSubBridgeNodeNodeName as PubSubBridgeNodeNodeName2
|
|
1842
|
-
} from "@xyo-network/os-model";
|
|
1804
|
+
import { asAttachableNodeInstance as asAttachableNodeInstance3, asNodeInstance } from "@xyo-network/node-model";
|
|
1805
|
+
import { ExposedNodeOuterNodeName as ExposedNodeOuterNodeName2, PubSubBridgeNodeNodeName as PubSubBridgeNodeNodeName2 } from "@xyo-network/os-model";
|
|
1843
1806
|
var OsPubSubNetworkStack = class extends StackBase {
|
|
1844
1807
|
_exposedNode;
|
|
1845
1808
|
_exposedNodeOuter;
|
|
@@ -1957,6 +1920,7 @@ var XyOs = class _XyOs extends XyOsContextBase {
|
|
|
1957
1920
|
locator = new ModuleFactoryLocator5(),
|
|
1958
1921
|
dappsConfiguration,
|
|
1959
1922
|
developmentMode,
|
|
1923
|
+
stackMap = OsStackMap,
|
|
1960
1924
|
...params
|
|
1961
1925
|
} = {}) {
|
|
1962
1926
|
super({
|
|
@@ -1967,7 +1931,7 @@ var XyOs = class _XyOs extends XyOsContextBase {
|
|
|
1967
1931
|
});
|
|
1968
1932
|
this._locator = locator;
|
|
1969
1933
|
this._kernel = kernel;
|
|
1970
|
-
this.stackManager = new StackManager(
|
|
1934
|
+
this.stackManager = new StackManager(stackMap);
|
|
1971
1935
|
this.dappRegistrationService = new DappRegistrationService(this, dappsConfiguration, this.locator, developmentMode);
|
|
1972
1936
|
}
|
|
1973
1937
|
static get monitoring() {
|
|
@@ -1991,18 +1955,15 @@ var XyOs = class _XyOs extends XyOsContextBase {
|
|
|
1991
1955
|
get locator() {
|
|
1992
1956
|
return this._locator;
|
|
1993
1957
|
}
|
|
1958
|
+
get stacks() {
|
|
1959
|
+
return this.stackManager.stacks;
|
|
1960
|
+
}
|
|
1994
1961
|
static async monitor(fn, eventConfig) {
|
|
1995
|
-
const {
|
|
1996
|
-
name,
|
|
1997
|
-
additionalProperties
|
|
1998
|
-
} = eventConfig;
|
|
1962
|
+
const { name, additionalProperties } = eventConfig;
|
|
1999
1963
|
const monitor = this.monitoring;
|
|
2000
1964
|
monitor?.startTimer(name);
|
|
2001
1965
|
const result = await fn();
|
|
2002
|
-
monitor?.stopTimer({
|
|
2003
|
-
additionalProperties,
|
|
2004
|
-
name
|
|
2005
|
-
});
|
|
1966
|
+
monitor?.stopTimer({ additionalProperties, name });
|
|
2006
1967
|
return result;
|
|
2007
1968
|
}
|
|
2008
1969
|
async boot(wallet, locator = new ModuleFactoryLocator5()) {
|
|
@@ -2098,10 +2059,7 @@ var NodeInfoPayload = class {
|
|
|
2098
2059
|
import { assertEx as assertEx17 } from "@xylabs/assert";
|
|
2099
2060
|
import { hexFrom } from "@xylabs/hex";
|
|
2100
2061
|
import { HDWallet as HDWallet4 } from "@xyo-network/account";
|
|
2101
|
-
import {
|
|
2102
|
-
mnemonicArrayToString,
|
|
2103
|
-
SigningKeySchema
|
|
2104
|
-
} from "@xyo-network/os-model";
|
|
2062
|
+
import { mnemonicArrayToString, SigningKeySchema } from "@xyo-network/os-model";
|
|
2105
2063
|
import { isAnyPayload as isAnyPayload2 } from "@xyo-network/payload-model";
|
|
2106
2064
|
|
|
2107
2065
|
// src/classes/settings/badge/Caller.ts
|
|
@@ -2223,10 +2181,7 @@ var buildWalletSeedPhrasePayload = async (mnemonic, label) => {
|
|
|
2223
2181
|
standard
|
|
2224
2182
|
}
|
|
2225
2183
|
};
|
|
2226
|
-
const meta = {
|
|
2227
|
-
label,
|
|
2228
|
-
timestamp: Date.now()
|
|
2229
|
-
};
|
|
2184
|
+
const meta = { label, timestamp: Date.now() };
|
|
2230
2185
|
const builder = new PayloadBuilder5({
|
|
2231
2186
|
fields,
|
|
2232
2187
|
meta,
|
|
@@ -2234,10 +2189,7 @@ var buildWalletSeedPhrasePayload = async (mnemonic, label) => {
|
|
|
2234
2189
|
});
|
|
2235
2190
|
const payload = await builder.build();
|
|
2236
2191
|
const rootHash = await PayloadBuilder5.hash(payload);
|
|
2237
|
-
return {
|
|
2238
|
-
payload,
|
|
2239
|
-
rootHash
|
|
2240
|
-
};
|
|
2192
|
+
return { payload, rootHash };
|
|
2241
2193
|
};
|
|
2242
2194
|
var buildUserWalletSeedPhrasePayload = (mnemonic) => {
|
|
2243
2195
|
return buildWalletSeedPhrasePayload(mnemonic, userWalletLabel);
|
|
@@ -2276,10 +2228,7 @@ var renameObjKey = (oldObj, oldKey, newKey) => {
|
|
|
2276
2228
|
|
|
2277
2229
|
// src/classes/settings/SettingsQueries.ts
|
|
2278
2230
|
import { PayloadDivinerQuerySchema as PayloadDivinerQuerySchema5 } from "@xyo-network/diviner-payload-model";
|
|
2279
|
-
import {
|
|
2280
|
-
NodeBackgroundSchema,
|
|
2281
|
-
WalletSeedPhraseSchema as WalletSeedPhraseSchema2
|
|
2282
|
-
} from "@xyo-network/os-model";
|
|
2231
|
+
import { NodeBackgroundSchema, WalletSeedPhraseSchema as WalletSeedPhraseSchema2 } from "@xyo-network/os-model";
|
|
2283
2232
|
var NO_RESULTS2 = [];
|
|
2284
2233
|
var OsSettingsQueries = {
|
|
2285
2234
|
async getLatestUserWallet(diviner) {
|
|
@@ -2362,10 +2311,7 @@ var OsSettingsCaller = class extends OsSettingsCallerBase {
|
|
|
2362
2311
|
|
|
2363
2312
|
// src/classes/settings/Resource.ts
|
|
2364
2313
|
import { assertEx as assertEx16 } from "@xylabs/assert";
|
|
2365
|
-
import {
|
|
2366
|
-
isNodeBackground,
|
|
2367
|
-
isWalletSeedPhrase
|
|
2368
|
-
} from "@xyo-network/os-model";
|
|
2314
|
+
import { isNodeBackground, isWalletSeedPhrase } from "@xyo-network/os-model";
|
|
2369
2315
|
var OsSettingsResource = class extends OsSettingsCallerBase {
|
|
2370
2316
|
_latestUserWalletListener;
|
|
2371
2317
|
_nodeBackgroundListener;
|
|
@@ -2552,10 +2498,7 @@ var DappContextCreator = class _DappContextCreator {
|
|
|
2552
2498
|
publicChildren,
|
|
2553
2499
|
privateChildren
|
|
2554
2500
|
} = config;
|
|
2555
|
-
const {
|
|
2556
|
-
external,
|
|
2557
|
-
manifestPayload
|
|
2558
|
-
} = this.parseDappPackageManifestPayload(payload, xnsNodeUrl, xnsNetwork);
|
|
2501
|
+
const { external, manifestPayload } = this.parseDappPackageManifestPayload(payload, xnsNodeUrl, xnsNetwork);
|
|
2559
2502
|
console.debug("[DEBUG] dApp manifest", manifestPayload);
|
|
2560
2503
|
const dappWallet = await wallet.derivePath(_DappContextCreator.DAPP_WINDOW_WALLET_PATH);
|
|
2561
2504
|
const targetDappManifestParams = [manifestPayload, dappWallet, locator, publicChildren, privateChildren];
|
|
@@ -2572,23 +2515,17 @@ var DappContextCreator = class _DappContextCreator {
|
|
|
2572
2515
|
// Reset the dapp archivist to remove all payloads
|
|
2573
2516
|
static async resetDappArchivist(context) {
|
|
2574
2517
|
const dappModule = await context.root.resolve("DappArchivist");
|
|
2575
|
-
const dappArchivist = assertEx18(asArchivistInstance6(dappModule), () => "DappArchivist not found");
|
|
2518
|
+
const dappArchivist = assertEx18(asArchivistInstance6(dappModule), () => "resetDappArchivist: DappArchivist not found");
|
|
2576
2519
|
await dappArchivist.clear();
|
|
2577
2520
|
}
|
|
2578
2521
|
static parseDappPackageManifestPayload(payload, xnsNodeUrl, xnsNetwork) {
|
|
2579
|
-
const {
|
|
2580
|
-
external,
|
|
2581
|
-
...manifestWithoutExternals
|
|
2582
|
-
} = payload;
|
|
2522
|
+
const { external, ...manifestWithoutExternals } = payload;
|
|
2583
2523
|
const manifestPayloadRaw = {
|
|
2584
2524
|
...manifestWithoutExternals,
|
|
2585
2525
|
schema: PackageManifestPayloadSchema2
|
|
2586
2526
|
};
|
|
2587
2527
|
const manifestPayload = ReplaceManifestTokens(manifestPayloadRaw, xnsNodeUrl, xnsNetwork);
|
|
2588
|
-
return {
|
|
2589
|
-
external,
|
|
2590
|
-
manifestPayload
|
|
2591
|
-
};
|
|
2528
|
+
return { external, manifestPayload };
|
|
2592
2529
|
}
|
|
2593
2530
|
async loadDappContext(context) {
|
|
2594
2531
|
console.log("DappNodesCreator:loadDappContext", this.dappId);
|
|
@@ -2625,16 +2562,10 @@ var createDappContext = async (dapp, context, allowedNames, xnsNodeUrl, xnsNetwo
|
|
|
2625
2562
|
}
|
|
2626
2563
|
const wallet = await HDWallet5.fromPhrase(seedPhrase);
|
|
2627
2564
|
const dappName = dapp.config.name;
|
|
2628
|
-
const {
|
|
2629
|
-
config: dappConfig,
|
|
2630
|
-
params: dappParams
|
|
2631
|
-
} = dapp;
|
|
2565
|
+
const { config: dappConfig, params: dappParams } = dapp;
|
|
2632
2566
|
const locator = resolveLocator((dappParams.locator ?? new ModuleFactoryLocator6()).merge(context.platformLocator));
|
|
2633
2567
|
const params = {
|
|
2634
|
-
config: {
|
|
2635
|
-
dappName,
|
|
2636
|
-
payload: dappConfig.manifest
|
|
2637
|
-
},
|
|
2568
|
+
config: { dappName, payload: dappConfig.manifest },
|
|
2638
2569
|
context,
|
|
2639
2570
|
locator,
|
|
2640
2571
|
wallet
|
|
@@ -2673,10 +2604,7 @@ var RunningDappCache = class _RunningDappCache {
|
|
|
2673
2604
|
_RunningDappCache.set(dappId, windowDappSet);
|
|
2674
2605
|
return windowDappSet;
|
|
2675
2606
|
}),
|
|
2676
|
-
{
|
|
2677
|
-
additionalProperties: { dappId },
|
|
2678
|
-
name: "Loading dApp"
|
|
2679
|
-
}
|
|
2607
|
+
{ additionalProperties: { dappId }, name: "Loading dApp" }
|
|
2680
2608
|
);
|
|
2681
2609
|
}
|
|
2682
2610
|
static get(key) {
|
|
@@ -2825,10 +2753,7 @@ var XnsRegistrationsResource = class extends AbstractXnsCaller {
|
|
|
2825
2753
|
};
|
|
2826
2754
|
|
|
2827
2755
|
// src/access-interfaces/ValidDappAccessInterfaces.ts
|
|
2828
|
-
import {
|
|
2829
|
-
RegisteredNames,
|
|
2830
|
-
RegisteredNamesInterface
|
|
2831
|
-
} from "@xyo-network/os-model";
|
|
2756
|
+
import { RegisteredNames, RegisteredNamesInterface } from "@xyo-network/os-model";
|
|
2832
2757
|
var ValidDappAccessInterfaces = { [RegisteredNames]: RegisteredNamesInterface };
|
|
2833
2758
|
|
|
2834
2759
|
// src/Caller.ts
|
|
@@ -2847,10 +2772,7 @@ import { PayloadBuilder as PayloadBuilder7 } from "@xyo-network/payload-builder"
|
|
|
2847
2772
|
|
|
2848
2773
|
// src/DefaultsQueries.ts
|
|
2849
2774
|
import { PayloadDivinerQuerySchema as PayloadDivinerQuerySchema7 } from "@xyo-network/diviner-payload-model";
|
|
2850
|
-
import {
|
|
2851
|
-
DappInjectableParamsSchema,
|
|
2852
|
-
NodeOsInfoSchema as NodeOsInfoSchema2
|
|
2853
|
-
} from "@xyo-network/os-model";
|
|
2775
|
+
import { DappInjectableParamsSchema, NodeOsInfoSchema as NodeOsInfoSchema2 } from "@xyo-network/os-model";
|
|
2854
2776
|
var DappDefaultsResourceQueries = {
|
|
2855
2777
|
async getDappInjectableParamsFromRoute(diviner) {
|
|
2856
2778
|
const query = {
|
|
@@ -3087,10 +3009,7 @@ var DappAccessCaller = class extends OsCallerBase {
|
|
|
3087
3009
|
|
|
3088
3010
|
// src/classes/dapp/access/Queries.ts
|
|
3089
3011
|
import { PayloadDivinerQuerySchema as PayloadDivinerQuerySchema9 } from "@xyo-network/diviner-payload-model";
|
|
3090
|
-
import {
|
|
3091
|
-
DappAccessRequestSchema as DappAccessRequestSchema2,
|
|
3092
|
-
RegisteredDappAccessSchema as RegisteredDappAccessSchema3
|
|
3093
|
-
} from "@xyo-network/os-model";
|
|
3012
|
+
import { DappAccessRequestSchema as DappAccessRequestSchema2, RegisteredDappAccessSchema as RegisteredDappAccessSchema3 } from "@xyo-network/os-model";
|
|
3094
3013
|
var noResults = [];
|
|
3095
3014
|
var DappAccessRequestQueries = {
|
|
3096
3015
|
async getAccessRequests(diviner) {
|
|
@@ -3121,10 +3040,7 @@ var DappAccessRequestQueries = {
|
|
|
3121
3040
|
|
|
3122
3041
|
// src/classes/dapp/access/Resource.ts
|
|
3123
3042
|
import { assertEx as assertEx25 } from "@xylabs/assert";
|
|
3124
|
-
import {
|
|
3125
|
-
isDappAccessRequestWithMeta,
|
|
3126
|
-
isRegisteredDappAccess as isRegisteredDappAccess2
|
|
3127
|
-
} from "@xyo-network/os-model";
|
|
3043
|
+
import { isDappAccessRequestWithMeta, isRegisteredDappAccess as isRegisteredDappAccess2 } from "@xyo-network/os-model";
|
|
3128
3044
|
var DappAccessRequestResource = class extends DappCallerBase {
|
|
3129
3045
|
_accessRequestListener;
|
|
3130
3046
|
_registeredInterfacesListener;
|
|
@@ -3171,10 +3087,7 @@ var DappAccessRequestResource = class extends DappCallerBase {
|
|
|
3171
3087
|
|
|
3172
3088
|
// src/classes/dapp/DefaultsResource.ts
|
|
3173
3089
|
import { assertEx as assertEx26 } from "@xylabs/assert";
|
|
3174
|
-
import {
|
|
3175
|
-
isDappInjectableParams,
|
|
3176
|
-
isNodeOsInfo
|
|
3177
|
-
} from "@xyo-network/os-model";
|
|
3090
|
+
import { isDappInjectableParams, isNodeOsInfo } from "@xyo-network/os-model";
|
|
3178
3091
|
var DappDefaultsResource = class extends DappCallerBase {
|
|
3179
3092
|
_dappInjectableParamsFromRouteListener;
|
|
3180
3093
|
_nodeOsInfoListener;
|
|
@@ -3284,10 +3197,7 @@ var DappMenuCaller = class extends DappCaller {
|
|
|
3284
3197
|
|
|
3285
3198
|
// src/classes/menu/Resource.ts
|
|
3286
3199
|
import { assertEx as assertEx27 } from "@xylabs/assert";
|
|
3287
|
-
import {
|
|
3288
|
-
isDappNavItemSelection,
|
|
3289
|
-
isDappNavMenuConfig
|
|
3290
|
-
} from "@xyo-network/os-model";
|
|
3200
|
+
import { isDappNavItemSelection, isDappNavMenuConfig } from "@xyo-network/os-model";
|
|
3291
3201
|
|
|
3292
3202
|
// src/classes/menu/Queries.ts
|
|
3293
3203
|
import { PayloadDivinerQuerySchema as PayloadDivinerQuerySchema11 } from "@xyo-network/diviner-payload-model";
|
|
@@ -3415,6 +3325,51 @@ var DappMenuResource = class extends DappCaller {
|
|
|
3415
3325
|
}
|
|
3416
3326
|
};
|
|
3417
3327
|
|
|
3328
|
+
// src/classes/signer/Signers.ts
|
|
3329
|
+
import { assertEx as assertEx28 } from "@xylabs/assert";
|
|
3330
|
+
import { HDWallet as HDWallet6 } from "@xyo-network/account";
|
|
3331
|
+
var Signers = class {
|
|
3332
|
+
_paths;
|
|
3333
|
+
_signerAccounts;
|
|
3334
|
+
_walletStore;
|
|
3335
|
+
constructor(paths, walletStore) {
|
|
3336
|
+
this._paths = paths;
|
|
3337
|
+
this._walletStore = walletStore;
|
|
3338
|
+
this._signerAccounts = /* @__PURE__ */ new Map();
|
|
3339
|
+
}
|
|
3340
|
+
get paths() {
|
|
3341
|
+
return assertEx28(this._paths, () => "Paths not initialized");
|
|
3342
|
+
}
|
|
3343
|
+
get signerAccounts() {
|
|
3344
|
+
return assertEx28(this._signerAccounts, () => "Signer accounts not initialized");
|
|
3345
|
+
}
|
|
3346
|
+
get walletStore() {
|
|
3347
|
+
return assertEx28(this._walletStore, () => "Wallet store not initialized");
|
|
3348
|
+
}
|
|
3349
|
+
getSigner(walletKind, signer) {
|
|
3350
|
+
return this.signerAccounts.get(walletKind)?.get(signer);
|
|
3351
|
+
}
|
|
3352
|
+
async initialize() {
|
|
3353
|
+
for (const [walletKindName, signerPaths] of this.paths) {
|
|
3354
|
+
for (const [signerName, walletPath] of signerPaths.entries()) {
|
|
3355
|
+
await this.initializeSigners(walletKindName, signerName, walletPath);
|
|
3356
|
+
}
|
|
3357
|
+
}
|
|
3358
|
+
}
|
|
3359
|
+
async initializeSigners(walletKindName, signerName, path) {
|
|
3360
|
+
assertEx28(signerName, () => "Name not found in signer paths");
|
|
3361
|
+
assertEx28(path, () => "Path not found in signer paths");
|
|
3362
|
+
const phrase = assertEx28(await this.walletStore.get(walletKindName), () => `Wallet not found: ${walletKindName}`);
|
|
3363
|
+
if (path) {
|
|
3364
|
+
const signerMap = this.signerAccounts.get(walletKindName) ?? /* @__PURE__ */ new Map();
|
|
3365
|
+
const wallet = await HDWallet6.fromPhrase(phrase);
|
|
3366
|
+
const derivedWallet = await wallet.derivePath(path);
|
|
3367
|
+
signerMap.set(signerName, derivedWallet);
|
|
3368
|
+
this.signerAccounts.set(walletKindName, signerMap);
|
|
3369
|
+
}
|
|
3370
|
+
}
|
|
3371
|
+
};
|
|
3372
|
+
|
|
3418
3373
|
// src/helpers/monitor/XyOsMonitor.ts
|
|
3419
3374
|
var DEFAULT_MONITORING_EVENT_NAME = "System Task Duration";
|
|
3420
3375
|
globalThis.getXyOsGlobal = globalThis.getXyOsGlobal ?? (() => {
|
|
@@ -3428,10 +3383,7 @@ var XyOsMonitor = class _XyOsMonitor {
|
|
|
3428
3383
|
this.performanceTimers.set(name, performance.now());
|
|
3429
3384
|
}
|
|
3430
3385
|
stopTimer(eventConfig) {
|
|
3431
|
-
const {
|
|
3432
|
-
additionalProperties,
|
|
3433
|
-
name
|
|
3434
|
-
} = eventConfig;
|
|
3386
|
+
const { additionalProperties, name } = eventConfig;
|
|
3435
3387
|
const start = this.performanceTimers.get(name);
|
|
3436
3388
|
if (start) {
|
|
3437
3389
|
const end = performance.now();
|
|
@@ -3459,18 +3411,12 @@ var profileModuleEvents = (mod) => {
|
|
|
3459
3411
|
mod.onAny(async (eventName, args) => {
|
|
3460
3412
|
const mod2 = modRef.deref();
|
|
3461
3413
|
if (mod2) {
|
|
3462
|
-
const data = profileData[mod2.address] ?? {
|
|
3463
|
-
allEventCount: 0,
|
|
3464
|
-
eventCounts: {}
|
|
3465
|
-
};
|
|
3414
|
+
const data = profileData[mod2.address] ?? { allEventCount: 0, eventCounts: {} };
|
|
3466
3415
|
profileData[mod2.address] = data;
|
|
3467
3416
|
data.allEventCount += 1;
|
|
3468
3417
|
data.eventCounts[eventName] = (data.eventCounts[eventName] ?? 0) + 1;
|
|
3469
3418
|
if (eventName === "querySendStarted") {
|
|
3470
|
-
const {
|
|
3471
|
-
query,
|
|
3472
|
-
payloads = []
|
|
3473
|
-
} = args;
|
|
3419
|
+
const { query, payloads = [] } = args;
|
|
3474
3420
|
const pairs = await PayloadBuilder10.dataHashPairs(payloads);
|
|
3475
3421
|
const foundPair = pairs.find(([, hash]) => hash === query.query);
|
|
3476
3422
|
if (foundPair) {
|
|
@@ -3491,7 +3437,7 @@ var profileModuleEvents = (mod) => {
|
|
|
3491
3437
|
};
|
|
3492
3438
|
|
|
3493
3439
|
// src/PubSubBridgeCaller.ts
|
|
3494
|
-
import { assertEx as
|
|
3440
|
+
import { assertEx as assertEx29 } from "@xylabs/assert";
|
|
3495
3441
|
import { asBridgeInstance } from "@xyo-network/bridge-model";
|
|
3496
3442
|
import { BridgedPubSubModuleName } from "@xyo-network/os-model";
|
|
3497
3443
|
var PubSubBridgeCaller = class {
|
|
@@ -3512,7 +3458,7 @@ var PubSubBridgeCaller = class {
|
|
|
3512
3458
|
}
|
|
3513
3459
|
}
|
|
3514
3460
|
async getPubSubBridge() {
|
|
3515
|
-
const mod =
|
|
3461
|
+
const mod = assertEx29(await this.node.resolve(BridgedPubSubModuleName), () => `${BridgedPubSubModuleName} not found`);
|
|
3516
3462
|
return asBridgeInstance(mod, () => `${BridgedPubSubModuleName} is not a bridge`);
|
|
3517
3463
|
}
|
|
3518
3464
|
};
|
|
@@ -3579,6 +3525,7 @@ export {
|
|
|
3579
3525
|
RunningDappAccessCache,
|
|
3580
3526
|
RunningDappCache,
|
|
3581
3527
|
SettingsAdapter,
|
|
3528
|
+
Signers,
|
|
3582
3529
|
StackBase,
|
|
3583
3530
|
StackManager,
|
|
3584
3531
|
ValidDappAccessInterfaces,
|