@xyo-network/xl1-react-client-sdk 2.0.0 → 2.0.2
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/client/components/connected/DataLakeAddToChainPanel.d.ts +53 -0
- package/dist/browser/client/components/connected/DataLakeAddToChainPanel.d.ts.map +1 -0
- package/dist/browser/client/components/connected/index.d.ts +1 -0
- package/dist/browser/client/components/connected/index.d.ts.map +1 -1
- package/dist/browser/client/index.mjs +778 -447
- package/dist/browser/client/index.mjs.map +4 -4
- package/dist/browser/index.mjs +814 -483
- package/dist/browser/index.mjs.map +4 -4
- package/package.json +4 -4
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { StackProps } from '@mui/material';
|
|
2
|
+
import type { Schema } from '@xyo-network/sdk-js';
|
|
3
|
+
import type { GatewayName } from '@xyo-network/xl1-sdk';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
export interface DataLakeAddToChainPanelProps extends StackProps {
|
|
6
|
+
/**
|
|
7
|
+
* Base URL of the XL1 explorer. Defaults to the production deploy at
|
|
8
|
+
* {@link DEFAULT_EXPLORER_URL}. The panel builds the per-transaction
|
|
9
|
+
* link via `ExplorerLinks(explorerUrl, gatewayName).transaction(txHash)`.
|
|
10
|
+
*/
|
|
11
|
+
explorerUrl?: string;
|
|
12
|
+
/** Gateway to use for chain writes. Defaults to `SequenceNetwork.id`. */
|
|
13
|
+
gatewayName?: GatewayName;
|
|
14
|
+
/** Initial textarea content. Defaults to a stamped JSON envelope keyed by `payloadSchema`. */
|
|
15
|
+
initialPayloadJson?: string;
|
|
16
|
+
/** Schema for the test payload. Defaults to `network.xyo.observation.v2`. */
|
|
17
|
+
payloadSchema?: Schema;
|
|
18
|
+
/** Wallet-detection timeout, forwarded to the wallet hooks. */
|
|
19
|
+
timeout?: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* End-to-end "data lake → chain" flow for manual Storybook testing. The
|
|
23
|
+
* panel walks the user through:
|
|
24
|
+
*
|
|
25
|
+
* 1. **Request permissions** — embedded {@link RequestPermissionsButton}
|
|
26
|
+
* covering signer + accounts (so `gateway.addPayloadsToChain` can
|
|
27
|
+
* pull the signer address) plus data-lake read + write (so the
|
|
28
|
+
* insert step can run), all collected in one consent popup.
|
|
29
|
+
* 2. **Edit the test payload** — a JSON textarea seeded with a stamped
|
|
30
|
+
* `{ schema, value, timestamp }` envelope; the timestamp guarantees
|
|
31
|
+
* a fresh content-address on each mount.
|
|
32
|
+
* 3. **Pick a runner-capable lake** — reuses {@link ApprovedLakeSelector}
|
|
33
|
+
* with `capability="runner"` so the dropdown is narrowed to lakes the
|
|
34
|
+
* user has granted write access to.
|
|
35
|
+
* 4. **Insert into the lake** — calls `client.dataLakes.insert(lakeId, [payload])`,
|
|
36
|
+
* stashes the echoed-back stored payload (with `_hash`) in state.
|
|
37
|
+
* 5. **Add to chain** — builds a `HashPayload` referencing the stored
|
|
38
|
+
* payload's hash and calls
|
|
39
|
+
* `gateway.addPayloadsToChain([hashPayload], [storedPayload])`.
|
|
40
|
+
* `onChain` is the hash reference; `offChain` is the stored payload
|
|
41
|
+
* itself (the gateway re-inserts it into its own data lake under the
|
|
42
|
+
* hood, so the content ends up in two places — see the story docs).
|
|
43
|
+
* 6. **Link to the explorer** — once `addPayloadsToChain` resolves with
|
|
44
|
+
* a `txHash`, surfaces `ExplorerLinks(explorerUrl, gatewayName).transaction(txHash)`
|
|
45
|
+
* as a "View on explorer" link. No client-side confirmation polling —
|
|
46
|
+
* the explorer is the source of truth for inclusion state.
|
|
47
|
+
*
|
|
48
|
+
* Errors at any step short-circuit the rest of the flow and render
|
|
49
|
+
* inline. The user can retry by clicking the same step's button again,
|
|
50
|
+
* or by editing the upstream step (e.g. re-edit the payload, re-insert).
|
|
51
|
+
*/
|
|
52
|
+
export declare const DataLakeAddToChainPanel: React.FC<DataLakeAddToChainPanelProps>;
|
|
53
|
+
//# sourceMappingURL=DataLakeAddToChainPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataLakeAddToChainPanel.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/DataLakeAddToChainPanel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAS/C,OAAO,KAAK,EAAW,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAI1D,OAAO,KAAK,EACI,WAAW,EAE1B,MAAM,sBAAsB,CAAA;AAK7B,OAAO,KAA4B,MAAM,OAAO,CAAA;AAoQhD,MAAM,WAAW,4BAA6B,SAAQ,UAAU;IAC9D;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,yEAAyE;IACzE,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,8FAA8F;IAC9F,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CA8J1E,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './account/index.ts';
|
|
2
2
|
export * from './ApprovedLakeSelector.tsx';
|
|
3
3
|
export * from './ConnectAccountsStack.tsx';
|
|
4
|
+
export * from './DataLakeAddToChainPanel.tsx';
|
|
4
5
|
export * from './DataLakeGetButton.tsx';
|
|
5
6
|
export * from './DataLakeGetPanel.tsx';
|
|
6
7
|
export * from './DataLakeInsertButton.tsx';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mCAAmC,CAAA;AACjD,cAAc,kCAAkC,CAAA;AAChD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mCAAmC,CAAA;AACjD,cAAc,kCAAkC,CAAA;AAChD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA"}
|