@le-space/ui 0.1.54 → 0.1.56
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/package.json +9 -1
- package/react/index.d.ts +17 -0
- package/react/index.js +983 -124
- package/shared/index.d.ts +27 -1
- package/shared/index.js +398 -21
- package/le-space-ui-0.1.54.tgz +0 -0
package/shared/index.d.ts
CHANGED
|
@@ -172,6 +172,19 @@ interface RootfsResolution {
|
|
|
172
172
|
gatewayError?: string | null;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
+
type DeploymentProgressStage = "idle" | "validating" | "loading-manifest" | "verifying-rootfs" | "loading-pricing" | "loading-balance" | "selecting-crn" | "building-message" | "signing-message" | "broadcasting" | "notifying-crn" | "waiting-for-aleph" | "deployment-confirmed" | "deployment-rejected" | "building-delete-message" | "signing-delete-message" | "broadcasting-delete" | "delete-completed" | "refreshing-instances" | "completed" | "error";
|
|
176
|
+
interface DeploymentProgressEvent {
|
|
177
|
+
stage: DeploymentProgressStage;
|
|
178
|
+
label: string;
|
|
179
|
+
progress: number;
|
|
180
|
+
status: "info" | "success" | "warning" | "error";
|
|
181
|
+
itemHash?: string | null;
|
|
182
|
+
detail?: string | null;
|
|
183
|
+
error?: string | null;
|
|
184
|
+
timestamp: number;
|
|
185
|
+
}
|
|
186
|
+
type DeploymentProgressListener = (event: DeploymentProgressEvent) => void;
|
|
187
|
+
|
|
175
188
|
type SponsorRelayHealthTone = 'ok' | 'caution' | 'error' | 'idle';
|
|
176
189
|
interface SponsorRelayProps {
|
|
177
190
|
libp2p?: unknown;
|
|
@@ -268,6 +281,7 @@ interface SponsorRelayState {
|
|
|
268
281
|
instances: CompactInstanceRecord[];
|
|
269
282
|
relayPing: RelayPingState;
|
|
270
283
|
lastDeploymentHash: string | null;
|
|
284
|
+
deploymentProgress: DeploymentProgressEvent;
|
|
271
285
|
}
|
|
272
286
|
type SponsorRelaySubscriber = (state: SponsorRelayState) => void;
|
|
273
287
|
|
|
@@ -276,6 +290,7 @@ declare const DEFAULT_MANIFEST_URL = "./rootfs-manifest.json";
|
|
|
276
290
|
declare const DEFAULT_TIER_ID = "tier-1";
|
|
277
291
|
declare const ROOTFS_MISSING_STATE: SponsorRelayRootfsHealth;
|
|
278
292
|
declare const RELAY_PING_IDLE_STATE: RelayPingState;
|
|
293
|
+
declare const IDLE_DEPLOYMENT_PROGRESS: DeploymentProgressEvent;
|
|
279
294
|
declare const REFRESH_INTERVAL_MS = 30000;
|
|
280
295
|
declare const RELAY_PING_INTERVAL_MS = 20000;
|
|
281
296
|
|
|
@@ -299,6 +314,7 @@ interface EthereumProviderLike {
|
|
|
299
314
|
removeListener?(event: string, listener: (...args: unknown[]) => void): void;
|
|
300
315
|
}
|
|
301
316
|
declare function getEthereumProvider(): EthereumProviderLike | null;
|
|
317
|
+
declare function toChecksumAddress(address: string): string;
|
|
302
318
|
declare function connectWallet(provider?: EthereumProviderLike | null): Promise<SponsorRelayWalletState>;
|
|
303
319
|
declare function personalSign(address: string, message: string, provider?: EthereumProviderLike | null): Promise<string>;
|
|
304
320
|
declare function watchWallet(onChange: () => void, provider?: EthereumProviderLike | null): () => void;
|
|
@@ -311,11 +327,14 @@ declare class SponsorRelayController {
|
|
|
311
327
|
private pingTimer;
|
|
312
328
|
private stopWalletWatch;
|
|
313
329
|
private props;
|
|
330
|
+
private progressEmitter;
|
|
314
331
|
constructor(props?: SponsorRelayProps);
|
|
332
|
+
subscribeToDeploymentProgress(listener: DeploymentProgressListener): () => void;
|
|
315
333
|
subscribe(subscriber: SponsorRelaySubscriber): () => void;
|
|
316
334
|
getState(): SponsorRelayState;
|
|
317
335
|
private emit;
|
|
318
336
|
private patch;
|
|
337
|
+
private emitProgress;
|
|
319
338
|
init(): Promise<void>;
|
|
320
339
|
destroy(): void;
|
|
321
340
|
setOpen(open: boolean): void;
|
|
@@ -336,4 +355,11 @@ declare class SponsorRelayController {
|
|
|
336
355
|
}
|
|
337
356
|
declare function createSponsorRelayController(props?: SponsorRelayProps): SponsorRelayController;
|
|
338
357
|
|
|
339
|
-
|
|
358
|
+
interface DeploymentProgressEmitter {
|
|
359
|
+
emit(event: DeploymentProgressEvent): void;
|
|
360
|
+
subscribe(listener: DeploymentProgressListener): () => void;
|
|
361
|
+
clear(): void;
|
|
362
|
+
}
|
|
363
|
+
declare function createDeploymentProgressEmitter(): DeploymentProgressEmitter;
|
|
364
|
+
|
|
365
|
+
export { type CompactInstanceDetails, type CompactInstanceRecord, DEFAULT_INSTANCE_NAME, DEFAULT_MANIFEST_URL, DEFAULT_TIER_ID, type DeploymentProgressEmitter, type EthereumProviderLike, IDLE_DEPLOYMENT_PROGRESS, REFRESH_INTERVAL_MS, RELAY_PING_IDLE_STATE, RELAY_PING_INTERVAL_MS, ROOTFS_MISSING_STATE, type RelayPingState, SponsorRelayController, type SponsorRelayHealthTone, type SponsorRelayPricingSummary, type SponsorRelayProps, type SponsorRelayRootfsHealth, type SponsorRelayState, type SponsorRelaySubscriber, type SponsorRelayWalletState, buildSshCommand, connectWallet, createDeploymentProgressEmitter, createSponsorRelayController, formatDateTime, formatNumber, getEthereumProvider, joinMappedPorts, personalSign, resolveManifestSource, shortHash, toChecksumAddress, watchWallet };
|