@xyo-network/react-standard-node 2.64.9 → 2.65.0
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/browser/lib/Builders/MemoryNodeBuilder.d.cts +17 -23
- package/dist/browser/lib/Builders/MemoryNodeBuilder.d.cts.map +1 -1
- package/dist/browser/lib/Builders/MemoryNodeBuilder.d.mts +17 -23
- package/dist/browser/lib/Builders/MemoryNodeBuilder.d.mts.map +1 -1
- package/dist/browser/lib/Builders/MemoryNodeBuilder.d.ts +17 -23
- package/dist/browser/lib/Builders/MemoryNodeBuilder.d.ts.map +1 -1
- package/dist/browser/lib/Builders/SentinelBuilder.d.cts +28 -40
- package/dist/browser/lib/Builders/SentinelBuilder.d.cts.map +1 -1
- package/dist/browser/lib/Builders/SentinelBuilder.d.mts +28 -40
- package/dist/browser/lib/Builders/SentinelBuilder.d.mts.map +1 -1
- package/dist/browser/lib/Builders/SentinelBuilder.d.ts +28 -40
- package/dist/browser/lib/Builders/SentinelBuilder.d.ts.map +1 -1
- package/dist/browser/lib/Builders/StorageArchivistBuilder.d.cts +12 -12
- package/dist/browser/lib/Builders/StorageArchivistBuilder.d.mts +12 -12
- package/dist/browser/lib/Builders/StorageArchivistBuilder.d.ts +12 -12
- package/dist/node/lib/Builders/MemoryNodeBuilder.d.cts +17 -23
- package/dist/node/lib/Builders/MemoryNodeBuilder.d.cts.map +1 -1
- package/dist/node/lib/Builders/MemoryNodeBuilder.d.mts +17 -23
- package/dist/node/lib/Builders/MemoryNodeBuilder.d.mts.map +1 -1
- package/dist/node/lib/Builders/MemoryNodeBuilder.d.ts +17 -23
- package/dist/node/lib/Builders/MemoryNodeBuilder.d.ts.map +1 -1
- package/dist/node/lib/Builders/SentinelBuilder.d.cts +28 -40
- package/dist/node/lib/Builders/SentinelBuilder.d.cts.map +1 -1
- package/dist/node/lib/Builders/SentinelBuilder.d.mts +28 -40
- package/dist/node/lib/Builders/SentinelBuilder.d.mts.map +1 -1
- package/dist/node/lib/Builders/SentinelBuilder.d.ts +28 -40
- package/dist/node/lib/Builders/SentinelBuilder.d.ts.map +1 -1
- package/dist/node/lib/Builders/StorageArchivistBuilder.d.cts +12 -12
- package/dist/node/lib/Builders/StorageArchivistBuilder.d.mts +12 -12
- package/dist/node/lib/Builders/StorageArchivistBuilder.d.ts +12 -12
- package/package.json +20 -20
- package/dist/browser/components/ActiveStandardNode.cjs +0 -85
- package/dist/browser/components/ActiveStandardNode.cjs.map +0 -1
- package/dist/browser/components/ActiveStandardNode.js +0 -64
- package/dist/browser/components/ActiveStandardNode.js.map +0 -1
- package/dist/browser/components/index.cjs +0 -87
- package/dist/browser/components/index.cjs.map +0 -1
- package/dist/browser/components/index.js +0 -64
- package/dist/browser/components/index.js.map +0 -1
- package/dist/browser/contexts/StandardRemoteNodes/Context.cjs +0 -28
- package/dist/browser/contexts/StandardRemoteNodes/Context.cjs.map +0 -1
- package/dist/browser/contexts/StandardRemoteNodes/Context.js +0 -7
- package/dist/browser/contexts/StandardRemoteNodes/Context.js.map +0 -1
- package/dist/browser/contexts/StandardRemoteNodes/Providers.cjs +0 -308
- package/dist/browser/contexts/StandardRemoteNodes/Providers.cjs.map +0 -1
- package/dist/browser/contexts/StandardRemoteNodes/Providers.js +0 -287
- package/dist/browser/contexts/StandardRemoteNodes/Providers.js.map +0 -1
- package/dist/browser/contexts/StandardRemoteNodes/State.cjs +0 -19
- package/dist/browser/contexts/StandardRemoteNodes/State.cjs.map +0 -1
- package/dist/browser/contexts/StandardRemoteNodes/State.js +0 -1
- package/dist/browser/contexts/StandardRemoteNodes/State.js.map +0 -1
- package/dist/browser/contexts/StandardRemoteNodes/index.cjs +0 -316
- package/dist/browser/contexts/StandardRemoteNodes/index.cjs.map +0 -1
- package/dist/browser/contexts/StandardRemoteNodes/index.js +0 -293
- package/dist/browser/contexts/StandardRemoteNodes/index.js.map +0 -1
- package/dist/browser/contexts/StandardRemoteNodes/use.cjs +0 -34
- package/dist/browser/contexts/StandardRemoteNodes/use.cjs.map +0 -1
- package/dist/browser/contexts/StandardRemoteNodes/use.js +0 -13
- package/dist/browser/contexts/StandardRemoteNodes/use.js.map +0 -1
- package/dist/browser/contexts/index.cjs +0 -316
- package/dist/browser/contexts/index.cjs.map +0 -1
- package/dist/browser/contexts/index.js +0 -293
- package/dist/browser/contexts/index.js.map +0 -1
- package/dist/browser/hooks/index.cjs +0 -50
- package/dist/browser/hooks/index.cjs.map +0 -1
- package/dist/browser/hooks/index.js +0 -27
- package/dist/browser/hooks/index.js.map +0 -1
- package/dist/browser/hooks/useActiveNodeAddress.cjs +0 -48
- package/dist/browser/hooks/useActiveNodeAddress.cjs.map +0 -1
- package/dist/browser/hooks/useActiveNodeAddress.js +0 -27
- package/dist/browser/hooks/useActiveNodeAddress.js.map +0 -1
- package/dist/browser/lib/Builders/MemoryNodeBuilder.cjs +0 -194
- package/dist/browser/lib/Builders/MemoryNodeBuilder.cjs.map +0 -1
- package/dist/browser/lib/Builders/MemoryNodeBuilder.js +0 -173
- package/dist/browser/lib/Builders/MemoryNodeBuilder.js.map +0 -1
- package/dist/browser/lib/Builders/SentinelBuilder.cjs +0 -54
- package/dist/browser/lib/Builders/SentinelBuilder.cjs.map +0 -1
- package/dist/browser/lib/Builders/SentinelBuilder.js +0 -33
- package/dist/browser/lib/Builders/SentinelBuilder.js.map +0 -1
- package/dist/browser/lib/Builders/StorageArchivistBuilder.cjs +0 -76
- package/dist/browser/lib/Builders/StorageArchivistBuilder.cjs.map +0 -1
- package/dist/browser/lib/Builders/StorageArchivistBuilder.js +0 -55
- package/dist/browser/lib/Builders/StorageArchivistBuilder.js.map +0 -1
- package/dist/browser/lib/Builders/index.cjs +0 -198
- package/dist/browser/lib/Builders/index.cjs.map +0 -1
- package/dist/browser/lib/Builders/index.js +0 -175
- package/dist/browser/lib/Builders/index.js.map +0 -1
- package/dist/browser/lib/ModuleAccountPaths.cjs +0 -53
- package/dist/browser/lib/ModuleAccountPaths.cjs.map +0 -1
- package/dist/browser/lib/ModuleAccountPaths.js +0 -30
- package/dist/browser/lib/ModuleAccountPaths.js.map +0 -1
- package/dist/browser/lib/ModuleNames.cjs +0 -29
- package/dist/browser/lib/ModuleNames.cjs.map +0 -1
- package/dist/browser/lib/ModuleNames.js +0 -8
- package/dist/browser/lib/ModuleNames.js.map +0 -1
- package/dist/browser/lib/buildNodes.cjs +0 -257
- package/dist/browser/lib/buildNodes.cjs.map +0 -1
- package/dist/browser/lib/buildNodes.js +0 -236
- package/dist/browser/lib/buildNodes.js.map +0 -1
- package/dist/browser/lib/index.cjs +0 -269
- package/dist/browser/lib/index.cjs.map +0 -1
- package/dist/browser/lib/index.js +0 -246
- package/dist/browser/lib/index.js.map +0 -1
- package/dist/docs.json +0 -6100
- package/dist/node/components/ActiveStandardNode.cjs +0 -90
- package/dist/node/components/ActiveStandardNode.cjs.map +0 -1
- package/dist/node/components/ActiveStandardNode.js +0 -65
- package/dist/node/components/ActiveStandardNode.js.map +0 -1
- package/dist/node/components/index.cjs +0 -92
- package/dist/node/components/index.cjs.map +0 -1
- package/dist/node/components/index.js +0 -65
- package/dist/node/components/index.js.map +0 -1
- package/dist/node/contexts/StandardRemoteNodes/Context.cjs +0 -32
- package/dist/node/contexts/StandardRemoteNodes/Context.cjs.map +0 -1
- package/dist/node/contexts/StandardRemoteNodes/Context.js +0 -7
- package/dist/node/contexts/StandardRemoteNodes/Context.js.map +0 -1
- package/dist/node/contexts/StandardRemoteNodes/Providers.cjs +0 -319
- package/dist/node/contexts/StandardRemoteNodes/Providers.cjs.map +0 -1
- package/dist/node/contexts/StandardRemoteNodes/Providers.js +0 -293
- package/dist/node/contexts/StandardRemoteNodes/Providers.js.map +0 -1
- package/dist/node/contexts/StandardRemoteNodes/State.cjs +0 -19
- package/dist/node/contexts/StandardRemoteNodes/State.cjs.map +0 -1
- package/dist/node/contexts/StandardRemoteNodes/State.js +0 -1
- package/dist/node/contexts/StandardRemoteNodes/State.js.map +0 -1
- package/dist/node/contexts/StandardRemoteNodes/index.cjs +0 -329
- package/dist/node/contexts/StandardRemoteNodes/index.cjs.map +0 -1
- package/dist/node/contexts/StandardRemoteNodes/index.js +0 -299
- package/dist/node/contexts/StandardRemoteNodes/index.js.map +0 -1
- package/dist/node/contexts/StandardRemoteNodes/use.cjs +0 -38
- package/dist/node/contexts/StandardRemoteNodes/use.cjs.map +0 -1
- package/dist/node/contexts/StandardRemoteNodes/use.js +0 -13
- package/dist/node/contexts/StandardRemoteNodes/use.js.map +0 -1
- package/dist/node/contexts/index.cjs +0 -329
- package/dist/node/contexts/index.cjs.map +0 -1
- package/dist/node/contexts/index.js +0 -299
- package/dist/node/contexts/index.js.map +0 -1
- package/dist/node/hooks/index.cjs +0 -54
- package/dist/node/hooks/index.cjs.map +0 -1
- package/dist/node/hooks/index.js +0 -27
- package/dist/node/hooks/index.js.map +0 -1
- package/dist/node/hooks/useActiveNodeAddress.cjs +0 -52
- package/dist/node/hooks/useActiveNodeAddress.cjs.map +0 -1
- package/dist/node/hooks/useActiveNodeAddress.js +0 -27
- package/dist/node/hooks/useActiveNodeAddress.js.map +0 -1
- package/dist/node/lib/Builders/MemoryNodeBuilder.cjs +0 -201
- package/dist/node/lib/Builders/MemoryNodeBuilder.cjs.map +0 -1
- package/dist/node/lib/Builders/MemoryNodeBuilder.js +0 -176
- package/dist/node/lib/Builders/MemoryNodeBuilder.js.map +0 -1
- package/dist/node/lib/Builders/SentinelBuilder.cjs +0 -58
- package/dist/node/lib/Builders/SentinelBuilder.cjs.map +0 -1
- package/dist/node/lib/Builders/SentinelBuilder.js +0 -33
- package/dist/node/lib/Builders/SentinelBuilder.js.map +0 -1
- package/dist/node/lib/Builders/StorageArchivistBuilder.cjs +0 -82
- package/dist/node/lib/Builders/StorageArchivistBuilder.cjs.map +0 -1
- package/dist/node/lib/Builders/StorageArchivistBuilder.js +0 -57
- package/dist/node/lib/Builders/StorageArchivistBuilder.js.map +0 -1
- package/dist/node/lib/Builders/index.cjs +0 -207
- package/dist/node/lib/Builders/index.cjs.map +0 -1
- package/dist/node/lib/Builders/index.js +0 -178
- package/dist/node/lib/Builders/index.js.map +0 -1
- package/dist/node/lib/ModuleAccountPaths.cjs +0 -59
- package/dist/node/lib/ModuleAccountPaths.cjs.map +0 -1
- package/dist/node/lib/ModuleAccountPaths.js +0 -30
- package/dist/node/lib/ModuleAccountPaths.js.map +0 -1
- package/dist/node/lib/ModuleNames.cjs +0 -34
- package/dist/node/lib/ModuleNames.cjs.map +0 -1
- package/dist/node/lib/ModuleNames.js +0 -8
- package/dist/node/lib/ModuleNames.js.map +0 -1
- package/dist/node/lib/buildNodes.cjs +0 -266
- package/dist/node/lib/buildNodes.cjs.map +0 -1
- package/dist/node/lib/buildNodes.js +0 -241
- package/dist/node/lib/buildNodes.js.map +0 -1
- package/dist/node/lib/index.cjs +0 -286
- package/dist/node/lib/index.cjs.map +0 -1
- package/dist/node/lib/index.js +0 -251
- package/dist/node/lib/index.js.map +0 -1
|
@@ -13,7 +13,7 @@ export declare class StorageArchivistBuilder {
|
|
|
13
13
|
private remoteArchivist;
|
|
14
14
|
protected constructor(config: ArchivistBuilderConfig, account: AccountInstance, node?: MemoryNode<import("@xyo-network/core").BaseParamsFields & {
|
|
15
15
|
account?: AccountInstance | "random" | undefined;
|
|
16
|
-
config: import("@xyo-network/payload-model").SchemaFields &
|
|
16
|
+
config: import("@xyo-network/payload-model").SchemaFields & Omit<{
|
|
17
17
|
accountDerivationPath?: string | undefined;
|
|
18
18
|
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
19
19
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
@@ -29,7 +29,7 @@ export declare class StorageArchivistBuilder {
|
|
|
29
29
|
readonly sign?: boolean | undefined;
|
|
30
30
|
readonly storeQueries?: boolean | undefined;
|
|
31
31
|
readonly timestamp?: boolean | undefined;
|
|
32
|
-
} &
|
|
32
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & Omit<import("@xyo-network/payload-model").SchemaFields & {
|
|
33
33
|
accountDerivationPath?: string | undefined;
|
|
34
34
|
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
35
35
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
@@ -45,7 +45,7 @@ export declare class StorageArchivistBuilder {
|
|
|
45
45
|
readonly sign?: boolean | undefined;
|
|
46
46
|
readonly storeQueries?: boolean | undefined;
|
|
47
47
|
readonly timestamp?: boolean | undefined;
|
|
48
|
-
} & {
|
|
48
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
49
49
|
archivist?: string | undefined;
|
|
50
50
|
} & {
|
|
51
51
|
schema: "network.xyo.node.config";
|
|
@@ -59,7 +59,7 @@ export declare class StorageArchivistBuilder {
|
|
|
59
59
|
}, import("@xyo-network/node-model").NodeModuleEventData> | undefined);
|
|
60
60
|
get archivist(): StorageArchivist<import("@xyo-network/core").BaseParamsFields & {
|
|
61
61
|
account?: AccountInstance | "random" | undefined;
|
|
62
|
-
config: import("@xyo-network/payload-model").SchemaFields &
|
|
62
|
+
config: import("@xyo-network/payload-model").SchemaFields & Omit<{
|
|
63
63
|
accountDerivationPath?: string | undefined;
|
|
64
64
|
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
65
65
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
@@ -75,7 +75,7 @@ export declare class StorageArchivistBuilder {
|
|
|
75
75
|
readonly sign?: boolean | undefined;
|
|
76
76
|
readonly storeQueries?: boolean | undefined;
|
|
77
77
|
readonly timestamp?: boolean | undefined;
|
|
78
|
-
} &
|
|
78
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & Omit<import("@xyo-network/payload-model").SchemaFields & Omit<{
|
|
79
79
|
accountDerivationPath?: string | undefined;
|
|
80
80
|
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
81
81
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
@@ -91,7 +91,7 @@ export declare class StorageArchivistBuilder {
|
|
|
91
91
|
readonly sign?: boolean | undefined;
|
|
92
92
|
readonly storeQueries?: boolean | undefined;
|
|
93
93
|
readonly timestamp?: boolean | undefined;
|
|
94
|
-
} & {
|
|
94
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
95
95
|
maxEntries?: number | undefined;
|
|
96
96
|
maxEntrySize?: number | undefined;
|
|
97
97
|
namespace?: string | undefined;
|
|
@@ -115,7 +115,7 @@ export declare class StorageArchivistBuilder {
|
|
|
115
115
|
static create(config: ArchivistBuilderConfig, account: AccountInstance, node: MemoryNode): Promise<StorageArchivistBuilder>;
|
|
116
116
|
buildArchivist(): Promise<StorageArchivist<import("@xyo-network/core").BaseParamsFields & {
|
|
117
117
|
account?: AccountInstance | "random" | undefined;
|
|
118
|
-
config: import("@xyo-network/payload-model").SchemaFields &
|
|
118
|
+
config: import("@xyo-network/payload-model").SchemaFields & Omit<{
|
|
119
119
|
accountDerivationPath?: string | undefined;
|
|
120
120
|
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
121
121
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
@@ -131,7 +131,7 @@ export declare class StorageArchivistBuilder {
|
|
|
131
131
|
readonly sign?: boolean | undefined;
|
|
132
132
|
readonly storeQueries?: boolean | undefined;
|
|
133
133
|
readonly timestamp?: boolean | undefined;
|
|
134
|
-
} &
|
|
134
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & Omit<import("@xyo-network/payload-model").SchemaFields & Omit<{
|
|
135
135
|
accountDerivationPath?: string | undefined;
|
|
136
136
|
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
137
137
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
@@ -147,7 +147,7 @@ export declare class StorageArchivistBuilder {
|
|
|
147
147
|
readonly sign?: boolean | undefined;
|
|
148
148
|
readonly storeQueries?: boolean | undefined;
|
|
149
149
|
readonly timestamp?: boolean | undefined;
|
|
150
|
-
} & {
|
|
150
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
151
151
|
maxEntries?: number | undefined;
|
|
152
152
|
maxEntrySize?: number | undefined;
|
|
153
153
|
namespace?: string | undefined;
|
|
@@ -171,7 +171,7 @@ export declare class StorageArchivistBuilder {
|
|
|
171
171
|
buildConfig(): StorageArchivistConfig;
|
|
172
172
|
findParentArchivist(): Promise<import("@xyo-network/archivist").ArchivistInstance<import("@xyo-network/core").BaseParamsFields & {
|
|
173
173
|
account?: AccountInstance | "random" | undefined;
|
|
174
|
-
config: import("@xyo-network/payload-model").SchemaFields &
|
|
174
|
+
config: import("@xyo-network/payload-model").SchemaFields & Omit<{
|
|
175
175
|
accountDerivationPath?: string | undefined;
|
|
176
176
|
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
177
177
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
@@ -187,7 +187,7 @@ export declare class StorageArchivistBuilder {
|
|
|
187
187
|
readonly sign?: boolean | undefined;
|
|
188
188
|
readonly storeQueries?: boolean | undefined;
|
|
189
189
|
readonly timestamp?: boolean | undefined;
|
|
190
|
-
} &
|
|
190
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & Omit<import("@xyo-network/payload-model").SchemaFields & {
|
|
191
191
|
accountDerivationPath?: string | undefined;
|
|
192
192
|
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
193
193
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
@@ -203,7 +203,7 @@ export declare class StorageArchivistBuilder {
|
|
|
203
203
|
readonly sign?: boolean | undefined;
|
|
204
204
|
readonly storeQueries?: boolean | undefined;
|
|
205
205
|
readonly timestamp?: boolean | undefined;
|
|
206
|
-
} & {
|
|
206
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
207
207
|
parents?: import("@xyo-network/archivist").ArchivistParents | undefined;
|
|
208
208
|
requireAllParents?: boolean | undefined;
|
|
209
209
|
storeParentReads?: boolean | undefined;
|
package/package.json
CHANGED
|
@@ -10,28 +10,28 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xylabs/react-async-effect": "^3.0.
|
|
14
|
-
"@xylabs/react-promise": "^3.0.
|
|
15
|
-
"@xylabs/react-shared": "^3.0.
|
|
16
|
-
"@xyo-network/account-model": "^2.
|
|
17
|
-
"@xyo-network/archivist": "^2.
|
|
18
|
-
"@xyo-network/http-bridge": "^2.
|
|
19
|
-
"@xyo-network/module": "^2.
|
|
20
|
-
"@xyo-network/node-memory": "^2.
|
|
21
|
-
"@xyo-network/node-model": "^2.
|
|
22
|
-
"@xyo-network/payloadset-plugin": "^2.
|
|
23
|
-
"@xyo-network/react-network": "~2.
|
|
24
|
-
"@xyo-network/react-node": "~2.
|
|
25
|
-
"@xyo-network/react-shared": "~2.
|
|
26
|
-
"@xyo-network/react-wallet": "~2.
|
|
27
|
-
"@xyo-network/sentinel": "^2.
|
|
28
|
-
"@xyo-network/wallet-model": "^2.
|
|
29
|
-
"@xyo-network/witness": "^2.
|
|
13
|
+
"@xylabs/react-async-effect": "^3.0.18",
|
|
14
|
+
"@xylabs/react-promise": "^3.0.18",
|
|
15
|
+
"@xylabs/react-shared": "^3.0.18",
|
|
16
|
+
"@xyo-network/account-model": "^2.76.0",
|
|
17
|
+
"@xyo-network/archivist": "^2.76.0",
|
|
18
|
+
"@xyo-network/http-bridge": "^2.76.0",
|
|
19
|
+
"@xyo-network/module": "^2.76.0",
|
|
20
|
+
"@xyo-network/node-memory": "^2.76.0",
|
|
21
|
+
"@xyo-network/node-model": "^2.76.0",
|
|
22
|
+
"@xyo-network/payloadset-plugin": "^2.76.0",
|
|
23
|
+
"@xyo-network/react-network": "~2.65.0",
|
|
24
|
+
"@xyo-network/react-node": "~2.65.0",
|
|
25
|
+
"@xyo-network/react-shared": "~2.65.0",
|
|
26
|
+
"@xyo-network/react-wallet": "~2.65.0",
|
|
27
|
+
"@xyo-network/sentinel": "^2.76.0",
|
|
28
|
+
"@xyo-network/wallet-model": "^2.76.0",
|
|
29
|
+
"@xyo-network/witness": "^2.76.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@storybook/react": "^7.4.6",
|
|
33
|
-
"@xylabs/ts-scripts-yarn3": "^3.
|
|
34
|
-
"@xylabs/tsconfig-react": "^3.
|
|
33
|
+
"@xylabs/ts-scripts-yarn3": "^3.1.9",
|
|
34
|
+
"@xylabs/tsconfig-react": "^3.1.9",
|
|
35
35
|
"typescript": "^5.2.2"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
@@ -93,6 +93,6 @@
|
|
|
93
93
|
},
|
|
94
94
|
"sideEffects": false,
|
|
95
95
|
"types": "dist/browser/index.d.ts",
|
|
96
|
-
"version": "2.
|
|
96
|
+
"version": "2.65.0",
|
|
97
97
|
"type": "module"
|
|
98
98
|
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/components/ActiveStandardNode.tsx
|
|
21
|
-
var ActiveStandardNode_exports = {};
|
|
22
|
-
__export(ActiveStandardNode_exports, {
|
|
23
|
-
ActiveStandardNode: () => ActiveStandardNode
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(ActiveStandardNode_exports);
|
|
26
|
-
var import_react_async_effect = require("@xylabs/react-async-effect");
|
|
27
|
-
var import_react_network = require("@xyo-network/react-network");
|
|
28
|
-
var import_react_node2 = require("@xyo-network/react-node");
|
|
29
|
-
var import_react2 = require("react");
|
|
30
|
-
|
|
31
|
-
// src/contexts/StandardRemoteNodes/Context.ts
|
|
32
|
-
var import_react_shared = require("@xyo-network/react-shared");
|
|
33
|
-
var StandardNodesContext = (0, import_react_shared.createContextEx)();
|
|
34
|
-
|
|
35
|
-
// src/contexts/StandardRemoteNodes/use.tsx
|
|
36
|
-
var import_react_shared2 = require("@xyo-network/react-shared");
|
|
37
|
-
var useStandardNodes = (required = false) => (0, import_react_shared2.useContextEx)(StandardNodesContext, "StandardNodes", required);
|
|
38
|
-
|
|
39
|
-
// src/hooks/useActiveNodeAddress.ts
|
|
40
|
-
var import_react_node = require("@xyo-network/react-node");
|
|
41
|
-
var import_react = require("react");
|
|
42
|
-
var useActiveNodeAddress = (networkName) => {
|
|
43
|
-
const [node] = (0, import_react_node.useProvidedNode)();
|
|
44
|
-
const { nodes, findAddressByName } = useStandardNodes();
|
|
45
|
-
const activeNodeAddress = (0, import_react.useMemo)(() => {
|
|
46
|
-
if (node && nodes && findAddressByName && networkName) {
|
|
47
|
-
return findAddressByName(networkName);
|
|
48
|
-
}
|
|
49
|
-
}, [findAddressByName, networkName, node, nodes]);
|
|
50
|
-
return activeNodeAddress;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
// src/components/ActiveStandardNode.tsx
|
|
54
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
55
|
-
var ActiveStandardNode = ({ children, nodeNameOrAddress }) => {
|
|
56
|
-
const { network } = (0, import_react_network.useNetwork)();
|
|
57
|
-
const [node] = (0, import_react_node2.useNodeFromNode)(nodeNameOrAddress);
|
|
58
|
-
const [activeRemoteNodeAddress, setActiveRemoteNodeAddress] = (0, import_react2.useState)();
|
|
59
|
-
const { nodes } = useStandardNodes();
|
|
60
|
-
const selectedNodeAddress = useActiveNodeAddress(network?.name);
|
|
61
|
-
(0, import_react_async_effect.useAsyncEffect)(
|
|
62
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
63
|
-
async (mounted) => {
|
|
64
|
-
if (node && selectedNodeAddress) {
|
|
65
|
-
try {
|
|
66
|
-
if ((await node?.attached())?.includes(selectedNodeAddress)) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
await node?.attach(selectedNodeAddress, true);
|
|
70
|
-
if (mounted()) {
|
|
71
|
-
if (activeRemoteNodeAddress) {
|
|
72
|
-
await node?.detach(activeRemoteNodeAddress);
|
|
73
|
-
}
|
|
74
|
-
setActiveRemoteNodeAddress(selectedNodeAddress);
|
|
75
|
-
}
|
|
76
|
-
} catch (e) {
|
|
77
|
-
console.error("Error Attaching Selected Node Address", e);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
[activeRemoteNodeAddress, node, selectedNodeAddress, nodes]
|
|
82
|
-
);
|
|
83
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
|
|
84
|
-
};
|
|
85
|
-
//# sourceMappingURL=ActiveStandardNode.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ActiveStandardNode.tsx","../../../src/contexts/StandardRemoteNodes/Context.ts","../../../src/contexts/StandardRemoteNodes/use.tsx","../../../src/hooks/useActiveNodeAddress.ts"],"sourcesContent":["import { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { useNetwork } from '@xyo-network/react-network'\nimport { useNodeFromNode } from '@xyo-network/react-node'\nimport { useState } from 'react'\n\nimport { useStandardNodes } from '../contexts'\nimport { useActiveNodeAddress } from '../hooks'\n\nexport interface ActiveStandardNodeProps extends WithChildren {\n nodeNameOrAddress?: string\n}\n\nexport const ActiveStandardNode: React.FC<ActiveStandardNodeProps> = ({ children, nodeNameOrAddress }) => {\n const { network } = useNetwork()\n const [node] = useNodeFromNode(nodeNameOrAddress)\n const [activeRemoteNodeAddress, setActiveRemoteNodeAddress] = useState<string>()\n const { nodes } = useStandardNodes()\n\n const selectedNodeAddress = useActiveNodeAddress(network?.name)\n\n // Probably needs to rely on node events rather than provider values to ensure its registered\n useAsyncEffect(\n // eslint-disable-next-line react-hooks/exhaustive-deps\n async (mounted) => {\n if (node && selectedNodeAddress) {\n try {\n if ((await node?.attached())?.includes(selectedNodeAddress)) {\n return\n }\n await node?.attach(selectedNodeAddress, true)\n\n if (mounted()) {\n // cleanup\n if (activeRemoteNodeAddress) {\n await node?.detach(activeRemoteNodeAddress)\n }\n setActiveRemoteNodeAddress(selectedNodeAddress)\n }\n } catch (e) {\n console.error('Error Attaching Selected Node Address', e)\n }\n }\n },\n [activeRemoteNodeAddress, node, selectedNodeAddress, nodes],\n )\n\n return <>{children}</>\n}\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { StandardNodesState } from './State'\n\nexport const StandardNodesContext = createContextEx<StandardNodesState>()\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { StandardNodesContext } from './Context'\n\nexport const useStandardNodes = (required = false) => useContextEx(StandardNodesContext, 'StandardNodes', required)\n","import { useProvidedNode } from '@xyo-network/react-node'\nimport { useMemo } from 'react'\n\nimport { useStandardNodes } from '../contexts'\n\nexport const useActiveNodeAddress = (networkName?: string) => {\n const [node] = useProvidedNode()\n const { nodes, findAddressByName } = useStandardNodes()\n\n const activeNodeAddress = useMemo(() => {\n if (node && nodes && findAddressByName && networkName) {\n return findAddressByName(networkName)\n }\n }, [findAddressByName, networkName, node, nodes])\n\n return activeNodeAddress\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gCAA+B;AAE/B,2BAA2B;AAC3B,IAAAA,qBAAgC;AAChC,IAAAC,gBAAyB;;;ACJzB,0BAAgC;AAIzB,IAAM,2BAAuB,qCAAoC;;;ACJxE,IAAAC,uBAA6B;AAItB,IAAM,mBAAmB,CAAC,WAAW,cAAU,mCAAa,sBAAsB,iBAAiB,QAAQ;;;ACJlH,wBAAgC;AAChC,mBAAwB;AAIjB,IAAM,uBAAuB,CAAC,gBAAyB;AAC5D,QAAM,CAAC,IAAI,QAAI,mCAAgB;AAC/B,QAAM,EAAE,OAAO,kBAAkB,IAAI,iBAAiB;AAEtD,QAAM,wBAAoB,sBAAQ,MAAM;AACtC,QAAI,QAAQ,SAAS,qBAAqB,aAAa;AACrD,aAAO,kBAAkB,WAAW;AAAA,IACtC;AAAA,EACF,GAAG,CAAC,mBAAmB,aAAa,MAAM,KAAK,CAAC;AAEhD,SAAO;AACT;;;AH+BS;AAlCF,IAAM,qBAAwD,CAAC,EAAE,UAAU,kBAAkB,MAAM;AACxG,QAAM,EAAE,QAAQ,QAAI,iCAAW;AAC/B,QAAM,CAAC,IAAI,QAAI,oCAAgB,iBAAiB;AAChD,QAAM,CAAC,yBAAyB,0BAA0B,QAAI,wBAAiB;AAC/E,QAAM,EAAE,MAAM,IAAI,iBAAiB;AAEnC,QAAM,sBAAsB,qBAAqB,SAAS,IAAI;AAG9D;AAAA;AAAA,IAEE,OAAO,YAAY;AACjB,UAAI,QAAQ,qBAAqB;AAC/B,YAAI;AACF,eAAK,MAAM,MAAM,SAAS,IAAI,SAAS,mBAAmB,GAAG;AAC3D;AAAA,UACF;AACA,gBAAM,MAAM,OAAO,qBAAqB,IAAI;AAE5C,cAAI,QAAQ,GAAG;AAEb,gBAAI,yBAAyB;AAC3B,oBAAM,MAAM,OAAO,uBAAuB;AAAA,YAC5C;AACA,uCAA2B,mBAAmB;AAAA,UAChD;AAAA,QACF,SAAS,GAAG;AACV,kBAAQ,MAAM,yCAAyC,CAAC;AAAA,QAC1D;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,yBAAyB,MAAM,qBAAqB,KAAK;AAAA,EAC5D;AAEA,SAAO,2EAAG,UAAS;AACrB;","names":["import_react_node","import_react","import_react_shared"]}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
// src/components/ActiveStandardNode.tsx
|
|
2
|
-
import { useAsyncEffect } from "@xylabs/react-async-effect";
|
|
3
|
-
import { useNetwork } from "@xyo-network/react-network";
|
|
4
|
-
import { useNodeFromNode } from "@xyo-network/react-node";
|
|
5
|
-
import { useState } from "react";
|
|
6
|
-
|
|
7
|
-
// src/contexts/StandardRemoteNodes/Context.ts
|
|
8
|
-
import { createContextEx } from "@xyo-network/react-shared";
|
|
9
|
-
var StandardNodesContext = createContextEx();
|
|
10
|
-
|
|
11
|
-
// src/contexts/StandardRemoteNodes/use.tsx
|
|
12
|
-
import { useContextEx } from "@xyo-network/react-shared";
|
|
13
|
-
var useStandardNodes = (required = false) => useContextEx(StandardNodesContext, "StandardNodes", required);
|
|
14
|
-
|
|
15
|
-
// src/hooks/useActiveNodeAddress.ts
|
|
16
|
-
import { useProvidedNode } from "@xyo-network/react-node";
|
|
17
|
-
import { useMemo } from "react";
|
|
18
|
-
var useActiveNodeAddress = (networkName) => {
|
|
19
|
-
const [node] = useProvidedNode();
|
|
20
|
-
const { nodes, findAddressByName } = useStandardNodes();
|
|
21
|
-
const activeNodeAddress = useMemo(() => {
|
|
22
|
-
if (node && nodes && findAddressByName && networkName) {
|
|
23
|
-
return findAddressByName(networkName);
|
|
24
|
-
}
|
|
25
|
-
}, [findAddressByName, networkName, node, nodes]);
|
|
26
|
-
return activeNodeAddress;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
// src/components/ActiveStandardNode.tsx
|
|
30
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
31
|
-
var ActiveStandardNode = ({ children, nodeNameOrAddress }) => {
|
|
32
|
-
const { network } = useNetwork();
|
|
33
|
-
const [node] = useNodeFromNode(nodeNameOrAddress);
|
|
34
|
-
const [activeRemoteNodeAddress, setActiveRemoteNodeAddress] = useState();
|
|
35
|
-
const { nodes } = useStandardNodes();
|
|
36
|
-
const selectedNodeAddress = useActiveNodeAddress(network?.name);
|
|
37
|
-
useAsyncEffect(
|
|
38
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39
|
-
async (mounted) => {
|
|
40
|
-
if (node && selectedNodeAddress) {
|
|
41
|
-
try {
|
|
42
|
-
if ((await node?.attached())?.includes(selectedNodeAddress)) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
await node?.attach(selectedNodeAddress, true);
|
|
46
|
-
if (mounted()) {
|
|
47
|
-
if (activeRemoteNodeAddress) {
|
|
48
|
-
await node?.detach(activeRemoteNodeAddress);
|
|
49
|
-
}
|
|
50
|
-
setActiveRemoteNodeAddress(selectedNodeAddress);
|
|
51
|
-
}
|
|
52
|
-
} catch (e) {
|
|
53
|
-
console.error("Error Attaching Selected Node Address", e);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
[activeRemoteNodeAddress, node, selectedNodeAddress, nodes]
|
|
58
|
-
);
|
|
59
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
60
|
-
};
|
|
61
|
-
export {
|
|
62
|
-
ActiveStandardNode
|
|
63
|
-
};
|
|
64
|
-
//# sourceMappingURL=ActiveStandardNode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ActiveStandardNode.tsx","../../../src/contexts/StandardRemoteNodes/Context.ts","../../../src/contexts/StandardRemoteNodes/use.tsx","../../../src/hooks/useActiveNodeAddress.ts"],"sourcesContent":["import { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { useNetwork } from '@xyo-network/react-network'\nimport { useNodeFromNode } from '@xyo-network/react-node'\nimport { useState } from 'react'\n\nimport { useStandardNodes } from '../contexts'\nimport { useActiveNodeAddress } from '../hooks'\n\nexport interface ActiveStandardNodeProps extends WithChildren {\n nodeNameOrAddress?: string\n}\n\nexport const ActiveStandardNode: React.FC<ActiveStandardNodeProps> = ({ children, nodeNameOrAddress }) => {\n const { network } = useNetwork()\n const [node] = useNodeFromNode(nodeNameOrAddress)\n const [activeRemoteNodeAddress, setActiveRemoteNodeAddress] = useState<string>()\n const { nodes } = useStandardNodes()\n\n const selectedNodeAddress = useActiveNodeAddress(network?.name)\n\n // Probably needs to rely on node events rather than provider values to ensure its registered\n useAsyncEffect(\n // eslint-disable-next-line react-hooks/exhaustive-deps\n async (mounted) => {\n if (node && selectedNodeAddress) {\n try {\n if ((await node?.attached())?.includes(selectedNodeAddress)) {\n return\n }\n await node?.attach(selectedNodeAddress, true)\n\n if (mounted()) {\n // cleanup\n if (activeRemoteNodeAddress) {\n await node?.detach(activeRemoteNodeAddress)\n }\n setActiveRemoteNodeAddress(selectedNodeAddress)\n }\n } catch (e) {\n console.error('Error Attaching Selected Node Address', e)\n }\n }\n },\n [activeRemoteNodeAddress, node, selectedNodeAddress, nodes],\n )\n\n return <>{children}</>\n}\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { StandardNodesState } from './State'\n\nexport const StandardNodesContext = createContextEx<StandardNodesState>()\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { StandardNodesContext } from './Context'\n\nexport const useStandardNodes = (required = false) => useContextEx(StandardNodesContext, 'StandardNodes', required)\n","import { useProvidedNode } from '@xyo-network/react-node'\nimport { useMemo } from 'react'\n\nimport { useStandardNodes } from '../contexts'\n\nexport const useActiveNodeAddress = (networkName?: string) => {\n const [node] = useProvidedNode()\n const { nodes, findAddressByName } = useStandardNodes()\n\n const activeNodeAddress = useMemo(() => {\n if (node && nodes && findAddressByName && networkName) {\n return findAddressByName(networkName)\n }\n }, [findAddressByName, networkName, node, nodes])\n\n return activeNodeAddress\n}\n"],"mappings":";AAAA,SAAS,sBAAsB;AAE/B,SAAS,kBAAkB;AAC3B,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;;;ACJzB,SAAS,uBAAuB;AAIzB,IAAM,uBAAuB,gBAAoC;;;ACJxE,SAAS,oBAAoB;AAItB,IAAM,mBAAmB,CAAC,WAAW,UAAU,aAAa,sBAAsB,iBAAiB,QAAQ;;;ACJlH,SAAS,uBAAuB;AAChC,SAAS,eAAe;AAIjB,IAAM,uBAAuB,CAAC,gBAAyB;AAC5D,QAAM,CAAC,IAAI,IAAI,gBAAgB;AAC/B,QAAM,EAAE,OAAO,kBAAkB,IAAI,iBAAiB;AAEtD,QAAM,oBAAoB,QAAQ,MAAM;AACtC,QAAI,QAAQ,SAAS,qBAAqB,aAAa;AACrD,aAAO,kBAAkB,WAAW;AAAA,IACtC;AAAA,EACF,GAAG,CAAC,mBAAmB,aAAa,MAAM,KAAK,CAAC;AAEhD,SAAO;AACT;;;AH+BS;AAlCF,IAAM,qBAAwD,CAAC,EAAE,UAAU,kBAAkB,MAAM;AACxG,QAAM,EAAE,QAAQ,IAAI,WAAW;AAC/B,QAAM,CAAC,IAAI,IAAI,gBAAgB,iBAAiB;AAChD,QAAM,CAAC,yBAAyB,0BAA0B,IAAI,SAAiB;AAC/E,QAAM,EAAE,MAAM,IAAI,iBAAiB;AAEnC,QAAM,sBAAsB,qBAAqB,SAAS,IAAI;AAG9D;AAAA;AAAA,IAEE,OAAO,YAAY;AACjB,UAAI,QAAQ,qBAAqB;AAC/B,YAAI;AACF,eAAK,MAAM,MAAM,SAAS,IAAI,SAAS,mBAAmB,GAAG;AAC3D;AAAA,UACF;AACA,gBAAM,MAAM,OAAO,qBAAqB,IAAI;AAE5C,cAAI,QAAQ,GAAG;AAEb,gBAAI,yBAAyB;AAC3B,oBAAM,MAAM,OAAO,uBAAuB;AAAA,YAC5C;AACA,uCAA2B,mBAAmB;AAAA,UAChD;AAAA,QACF,SAAS,GAAG;AACV,kBAAQ,MAAM,yCAAyC,CAAC;AAAA,QAC1D;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,yBAAyB,MAAM,qBAAqB,KAAK;AAAA,EAC5D;AAEA,SAAO,gCAAG,UAAS;AACrB;","names":[]}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/components/index.ts
|
|
21
|
-
var components_exports = {};
|
|
22
|
-
__export(components_exports, {
|
|
23
|
-
ActiveStandardNode: () => ActiveStandardNode
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(components_exports);
|
|
26
|
-
|
|
27
|
-
// src/components/ActiveStandardNode.tsx
|
|
28
|
-
var import_react_async_effect = require("@xylabs/react-async-effect");
|
|
29
|
-
var import_react_network = require("@xyo-network/react-network");
|
|
30
|
-
var import_react_node2 = require("@xyo-network/react-node");
|
|
31
|
-
var import_react2 = require("react");
|
|
32
|
-
|
|
33
|
-
// src/contexts/StandardRemoteNodes/Context.ts
|
|
34
|
-
var import_react_shared = require("@xyo-network/react-shared");
|
|
35
|
-
var StandardNodesContext = (0, import_react_shared.createContextEx)();
|
|
36
|
-
|
|
37
|
-
// src/contexts/StandardRemoteNodes/use.tsx
|
|
38
|
-
var import_react_shared2 = require("@xyo-network/react-shared");
|
|
39
|
-
var useStandardNodes = (required = false) => (0, import_react_shared2.useContextEx)(StandardNodesContext, "StandardNodes", required);
|
|
40
|
-
|
|
41
|
-
// src/hooks/useActiveNodeAddress.ts
|
|
42
|
-
var import_react_node = require("@xyo-network/react-node");
|
|
43
|
-
var import_react = require("react");
|
|
44
|
-
var useActiveNodeAddress = (networkName) => {
|
|
45
|
-
const [node] = (0, import_react_node.useProvidedNode)();
|
|
46
|
-
const { nodes, findAddressByName } = useStandardNodes();
|
|
47
|
-
const activeNodeAddress = (0, import_react.useMemo)(() => {
|
|
48
|
-
if (node && nodes && findAddressByName && networkName) {
|
|
49
|
-
return findAddressByName(networkName);
|
|
50
|
-
}
|
|
51
|
-
}, [findAddressByName, networkName, node, nodes]);
|
|
52
|
-
return activeNodeAddress;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// src/components/ActiveStandardNode.tsx
|
|
56
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
57
|
-
var ActiveStandardNode = ({ children, nodeNameOrAddress }) => {
|
|
58
|
-
const { network } = (0, import_react_network.useNetwork)();
|
|
59
|
-
const [node] = (0, import_react_node2.useNodeFromNode)(nodeNameOrAddress);
|
|
60
|
-
const [activeRemoteNodeAddress, setActiveRemoteNodeAddress] = (0, import_react2.useState)();
|
|
61
|
-
const { nodes } = useStandardNodes();
|
|
62
|
-
const selectedNodeAddress = useActiveNodeAddress(network?.name);
|
|
63
|
-
(0, import_react_async_effect.useAsyncEffect)(
|
|
64
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
|
-
async (mounted) => {
|
|
66
|
-
if (node && selectedNodeAddress) {
|
|
67
|
-
try {
|
|
68
|
-
if ((await node?.attached())?.includes(selectedNodeAddress)) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
await node?.attach(selectedNodeAddress, true);
|
|
72
|
-
if (mounted()) {
|
|
73
|
-
if (activeRemoteNodeAddress) {
|
|
74
|
-
await node?.detach(activeRemoteNodeAddress);
|
|
75
|
-
}
|
|
76
|
-
setActiveRemoteNodeAddress(selectedNodeAddress);
|
|
77
|
-
}
|
|
78
|
-
} catch (e) {
|
|
79
|
-
console.error("Error Attaching Selected Node Address", e);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
[activeRemoteNodeAddress, node, selectedNodeAddress, nodes]
|
|
84
|
-
);
|
|
85
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
|
|
86
|
-
};
|
|
87
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/index.ts","../../../src/components/ActiveStandardNode.tsx","../../../src/contexts/StandardRemoteNodes/Context.ts","../../../src/contexts/StandardRemoteNodes/use.tsx","../../../src/hooks/useActiveNodeAddress.ts"],"sourcesContent":["export * from './ActiveStandardNode'\n","import { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { useNetwork } from '@xyo-network/react-network'\nimport { useNodeFromNode } from '@xyo-network/react-node'\nimport { useState } from 'react'\n\nimport { useStandardNodes } from '../contexts'\nimport { useActiveNodeAddress } from '../hooks'\n\nexport interface ActiveStandardNodeProps extends WithChildren {\n nodeNameOrAddress?: string\n}\n\nexport const ActiveStandardNode: React.FC<ActiveStandardNodeProps> = ({ children, nodeNameOrAddress }) => {\n const { network } = useNetwork()\n const [node] = useNodeFromNode(nodeNameOrAddress)\n const [activeRemoteNodeAddress, setActiveRemoteNodeAddress] = useState<string>()\n const { nodes } = useStandardNodes()\n\n const selectedNodeAddress = useActiveNodeAddress(network?.name)\n\n // Probably needs to rely on node events rather than provider values to ensure its registered\n useAsyncEffect(\n // eslint-disable-next-line react-hooks/exhaustive-deps\n async (mounted) => {\n if (node && selectedNodeAddress) {\n try {\n if ((await node?.attached())?.includes(selectedNodeAddress)) {\n return\n }\n await node?.attach(selectedNodeAddress, true)\n\n if (mounted()) {\n // cleanup\n if (activeRemoteNodeAddress) {\n await node?.detach(activeRemoteNodeAddress)\n }\n setActiveRemoteNodeAddress(selectedNodeAddress)\n }\n } catch (e) {\n console.error('Error Attaching Selected Node Address', e)\n }\n }\n },\n [activeRemoteNodeAddress, node, selectedNodeAddress, nodes],\n )\n\n return <>{children}</>\n}\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { StandardNodesState } from './State'\n\nexport const StandardNodesContext = createContextEx<StandardNodesState>()\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { StandardNodesContext } from './Context'\n\nexport const useStandardNodes = (required = false) => useContextEx(StandardNodesContext, 'StandardNodes', required)\n","import { useProvidedNode } from '@xyo-network/react-node'\nimport { useMemo } from 'react'\n\nimport { useStandardNodes } from '../contexts'\n\nexport const useActiveNodeAddress = (networkName?: string) => {\n const [node] = useProvidedNode()\n const { nodes, findAddressByName } = useStandardNodes()\n\n const activeNodeAddress = useMemo(() => {\n if (node && nodes && findAddressByName && networkName) {\n return findAddressByName(networkName)\n }\n }, [findAddressByName, networkName, node, nodes])\n\n return activeNodeAddress\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,gCAA+B;AAE/B,2BAA2B;AAC3B,IAAAA,qBAAgC;AAChC,IAAAC,gBAAyB;;;ACJzB,0BAAgC;AAIzB,IAAM,2BAAuB,qCAAoC;;;ACJxE,IAAAC,uBAA6B;AAItB,IAAM,mBAAmB,CAAC,WAAW,cAAU,mCAAa,sBAAsB,iBAAiB,QAAQ;;;ACJlH,wBAAgC;AAChC,mBAAwB;AAIjB,IAAM,uBAAuB,CAAC,gBAAyB;AAC5D,QAAM,CAAC,IAAI,QAAI,mCAAgB;AAC/B,QAAM,EAAE,OAAO,kBAAkB,IAAI,iBAAiB;AAEtD,QAAM,wBAAoB,sBAAQ,MAAM;AACtC,QAAI,QAAQ,SAAS,qBAAqB,aAAa;AACrD,aAAO,kBAAkB,WAAW;AAAA,IACtC;AAAA,EACF,GAAG,CAAC,mBAAmB,aAAa,MAAM,KAAK,CAAC;AAEhD,SAAO;AACT;;;AH+BS;AAlCF,IAAM,qBAAwD,CAAC,EAAE,UAAU,kBAAkB,MAAM;AACxG,QAAM,EAAE,QAAQ,QAAI,iCAAW;AAC/B,QAAM,CAAC,IAAI,QAAI,oCAAgB,iBAAiB;AAChD,QAAM,CAAC,yBAAyB,0BAA0B,QAAI,wBAAiB;AAC/E,QAAM,EAAE,MAAM,IAAI,iBAAiB;AAEnC,QAAM,sBAAsB,qBAAqB,SAAS,IAAI;AAG9D;AAAA;AAAA,IAEE,OAAO,YAAY;AACjB,UAAI,QAAQ,qBAAqB;AAC/B,YAAI;AACF,eAAK,MAAM,MAAM,SAAS,IAAI,SAAS,mBAAmB,GAAG;AAC3D;AAAA,UACF;AACA,gBAAM,MAAM,OAAO,qBAAqB,IAAI;AAE5C,cAAI,QAAQ,GAAG;AAEb,gBAAI,yBAAyB;AAC3B,oBAAM,MAAM,OAAO,uBAAuB;AAAA,YAC5C;AACA,uCAA2B,mBAAmB;AAAA,UAChD;AAAA,QACF,SAAS,GAAG;AACV,kBAAQ,MAAM,yCAAyC,CAAC;AAAA,QAC1D;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,yBAAyB,MAAM,qBAAqB,KAAK;AAAA,EAC5D;AAEA,SAAO,2EAAG,UAAS;AACrB;","names":["import_react_node","import_react","import_react_shared"]}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
// src/components/ActiveStandardNode.tsx
|
|
2
|
-
import { useAsyncEffect } from "@xylabs/react-async-effect";
|
|
3
|
-
import { useNetwork } from "@xyo-network/react-network";
|
|
4
|
-
import { useNodeFromNode } from "@xyo-network/react-node";
|
|
5
|
-
import { useState } from "react";
|
|
6
|
-
|
|
7
|
-
// src/contexts/StandardRemoteNodes/Context.ts
|
|
8
|
-
import { createContextEx } from "@xyo-network/react-shared";
|
|
9
|
-
var StandardNodesContext = createContextEx();
|
|
10
|
-
|
|
11
|
-
// src/contexts/StandardRemoteNodes/use.tsx
|
|
12
|
-
import { useContextEx } from "@xyo-network/react-shared";
|
|
13
|
-
var useStandardNodes = (required = false) => useContextEx(StandardNodesContext, "StandardNodes", required);
|
|
14
|
-
|
|
15
|
-
// src/hooks/useActiveNodeAddress.ts
|
|
16
|
-
import { useProvidedNode } from "@xyo-network/react-node";
|
|
17
|
-
import { useMemo } from "react";
|
|
18
|
-
var useActiveNodeAddress = (networkName) => {
|
|
19
|
-
const [node] = useProvidedNode();
|
|
20
|
-
const { nodes, findAddressByName } = useStandardNodes();
|
|
21
|
-
const activeNodeAddress = useMemo(() => {
|
|
22
|
-
if (node && nodes && findAddressByName && networkName) {
|
|
23
|
-
return findAddressByName(networkName);
|
|
24
|
-
}
|
|
25
|
-
}, [findAddressByName, networkName, node, nodes]);
|
|
26
|
-
return activeNodeAddress;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
// src/components/ActiveStandardNode.tsx
|
|
30
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
31
|
-
var ActiveStandardNode = ({ children, nodeNameOrAddress }) => {
|
|
32
|
-
const { network } = useNetwork();
|
|
33
|
-
const [node] = useNodeFromNode(nodeNameOrAddress);
|
|
34
|
-
const [activeRemoteNodeAddress, setActiveRemoteNodeAddress] = useState();
|
|
35
|
-
const { nodes } = useStandardNodes();
|
|
36
|
-
const selectedNodeAddress = useActiveNodeAddress(network?.name);
|
|
37
|
-
useAsyncEffect(
|
|
38
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39
|
-
async (mounted) => {
|
|
40
|
-
if (node && selectedNodeAddress) {
|
|
41
|
-
try {
|
|
42
|
-
if ((await node?.attached())?.includes(selectedNodeAddress)) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
await node?.attach(selectedNodeAddress, true);
|
|
46
|
-
if (mounted()) {
|
|
47
|
-
if (activeRemoteNodeAddress) {
|
|
48
|
-
await node?.detach(activeRemoteNodeAddress);
|
|
49
|
-
}
|
|
50
|
-
setActiveRemoteNodeAddress(selectedNodeAddress);
|
|
51
|
-
}
|
|
52
|
-
} catch (e) {
|
|
53
|
-
console.error("Error Attaching Selected Node Address", e);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
[activeRemoteNodeAddress, node, selectedNodeAddress, nodes]
|
|
58
|
-
);
|
|
59
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
60
|
-
};
|
|
61
|
-
export {
|
|
62
|
-
ActiveStandardNode
|
|
63
|
-
};
|
|
64
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ActiveStandardNode.tsx","../../../src/contexts/StandardRemoteNodes/Context.ts","../../../src/contexts/StandardRemoteNodes/use.tsx","../../../src/hooks/useActiveNodeAddress.ts"],"sourcesContent":["import { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { useNetwork } from '@xyo-network/react-network'\nimport { useNodeFromNode } from '@xyo-network/react-node'\nimport { useState } from 'react'\n\nimport { useStandardNodes } from '../contexts'\nimport { useActiveNodeAddress } from '../hooks'\n\nexport interface ActiveStandardNodeProps extends WithChildren {\n nodeNameOrAddress?: string\n}\n\nexport const ActiveStandardNode: React.FC<ActiveStandardNodeProps> = ({ children, nodeNameOrAddress }) => {\n const { network } = useNetwork()\n const [node] = useNodeFromNode(nodeNameOrAddress)\n const [activeRemoteNodeAddress, setActiveRemoteNodeAddress] = useState<string>()\n const { nodes } = useStandardNodes()\n\n const selectedNodeAddress = useActiveNodeAddress(network?.name)\n\n // Probably needs to rely on node events rather than provider values to ensure its registered\n useAsyncEffect(\n // eslint-disable-next-line react-hooks/exhaustive-deps\n async (mounted) => {\n if (node && selectedNodeAddress) {\n try {\n if ((await node?.attached())?.includes(selectedNodeAddress)) {\n return\n }\n await node?.attach(selectedNodeAddress, true)\n\n if (mounted()) {\n // cleanup\n if (activeRemoteNodeAddress) {\n await node?.detach(activeRemoteNodeAddress)\n }\n setActiveRemoteNodeAddress(selectedNodeAddress)\n }\n } catch (e) {\n console.error('Error Attaching Selected Node Address', e)\n }\n }\n },\n [activeRemoteNodeAddress, node, selectedNodeAddress, nodes],\n )\n\n return <>{children}</>\n}\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { StandardNodesState } from './State'\n\nexport const StandardNodesContext = createContextEx<StandardNodesState>()\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { StandardNodesContext } from './Context'\n\nexport const useStandardNodes = (required = false) => useContextEx(StandardNodesContext, 'StandardNodes', required)\n","import { useProvidedNode } from '@xyo-network/react-node'\nimport { useMemo } from 'react'\n\nimport { useStandardNodes } from '../contexts'\n\nexport const useActiveNodeAddress = (networkName?: string) => {\n const [node] = useProvidedNode()\n const { nodes, findAddressByName } = useStandardNodes()\n\n const activeNodeAddress = useMemo(() => {\n if (node && nodes && findAddressByName && networkName) {\n return findAddressByName(networkName)\n }\n }, [findAddressByName, networkName, node, nodes])\n\n return activeNodeAddress\n}\n"],"mappings":";AAAA,SAAS,sBAAsB;AAE/B,SAAS,kBAAkB;AAC3B,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;;;ACJzB,SAAS,uBAAuB;AAIzB,IAAM,uBAAuB,gBAAoC;;;ACJxE,SAAS,oBAAoB;AAItB,IAAM,mBAAmB,CAAC,WAAW,UAAU,aAAa,sBAAsB,iBAAiB,QAAQ;;;ACJlH,SAAS,uBAAuB;AAChC,SAAS,eAAe;AAIjB,IAAM,uBAAuB,CAAC,gBAAyB;AAC5D,QAAM,CAAC,IAAI,IAAI,gBAAgB;AAC/B,QAAM,EAAE,OAAO,kBAAkB,IAAI,iBAAiB;AAEtD,QAAM,oBAAoB,QAAQ,MAAM;AACtC,QAAI,QAAQ,SAAS,qBAAqB,aAAa;AACrD,aAAO,kBAAkB,WAAW;AAAA,IACtC;AAAA,EACF,GAAG,CAAC,mBAAmB,aAAa,MAAM,KAAK,CAAC;AAEhD,SAAO;AACT;;;AH+BS;AAlCF,IAAM,qBAAwD,CAAC,EAAE,UAAU,kBAAkB,MAAM;AACxG,QAAM,EAAE,QAAQ,IAAI,WAAW;AAC/B,QAAM,CAAC,IAAI,IAAI,gBAAgB,iBAAiB;AAChD,QAAM,CAAC,yBAAyB,0BAA0B,IAAI,SAAiB;AAC/E,QAAM,EAAE,MAAM,IAAI,iBAAiB;AAEnC,QAAM,sBAAsB,qBAAqB,SAAS,IAAI;AAG9D;AAAA;AAAA,IAEE,OAAO,YAAY;AACjB,UAAI,QAAQ,qBAAqB;AAC/B,YAAI;AACF,eAAK,MAAM,MAAM,SAAS,IAAI,SAAS,mBAAmB,GAAG;AAC3D;AAAA,UACF;AACA,gBAAM,MAAM,OAAO,qBAAqB,IAAI;AAE5C,cAAI,QAAQ,GAAG;AAEb,gBAAI,yBAAyB;AAC3B,oBAAM,MAAM,OAAO,uBAAuB;AAAA,YAC5C;AACA,uCAA2B,mBAAmB;AAAA,UAChD;AAAA,QACF,SAAS,GAAG;AACV,kBAAQ,MAAM,yCAAyC,CAAC;AAAA,QAC1D;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,yBAAyB,MAAM,qBAAqB,KAAK;AAAA,EAC5D;AAEA,SAAO,gCAAG,UAAS;AACrB;","names":[]}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/contexts/StandardRemoteNodes/Context.ts
|
|
21
|
-
var Context_exports = {};
|
|
22
|
-
__export(Context_exports, {
|
|
23
|
-
StandardNodesContext: () => StandardNodesContext
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(Context_exports);
|
|
26
|
-
var import_react_shared = require("@xyo-network/react-shared");
|
|
27
|
-
var StandardNodesContext = (0, import_react_shared.createContextEx)();
|
|
28
|
-
//# sourceMappingURL=Context.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/contexts/StandardRemoteNodes/Context.ts"],"sourcesContent":["import { createContextEx } from '@xyo-network/react-shared'\n\nimport { StandardNodesState } from './State'\n\nexport const StandardNodesContext = createContextEx<StandardNodesState>()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAgC;AAIzB,IAAM,2BAAuB,qCAAoC;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/contexts/StandardRemoteNodes/Context.ts"],"sourcesContent":["import { createContextEx } from '@xyo-network/react-shared'\n\nimport { StandardNodesState } from './State'\n\nexport const StandardNodesContext = createContextEx<StandardNodesState>()\n"],"mappings":";AAAA,SAAS,uBAAuB;AAIzB,IAAM,uBAAuB,gBAAoC;","names":[]}
|