@xyo-network/react-chain-blockchain 1.16.9 → 1.16.11
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/components/account/BalanceHistoryFlexbox.d.ts +11 -0
- package/dist/browser/components/account/BalanceHistoryFlexbox.d.ts.map +1 -0
- package/dist/browser/components/account/BalanceHistoryFlexbox.stories.d.ts +6 -0
- package/dist/browser/components/account/BalanceHistoryFlexbox.stories.d.ts.map +1 -0
- package/dist/browser/components/account/index.d.ts +3 -0
- package/dist/browser/components/account/index.d.ts.map +1 -0
- package/dist/browser/components/account/table/AddressTableCell.d.ts +8 -0
- package/dist/browser/components/account/table/AddressTableCell.d.ts.map +1 -0
- package/dist/browser/components/account/table/BalanceHistoryTable.d.ts +9 -0
- package/dist/browser/components/account/table/BalanceHistoryTable.d.ts.map +1 -0
- package/dist/browser/components/account/table/BalanceHistoryTable.stories.d.ts +7 -0
- package/dist/browser/components/account/table/BalanceHistoryTable.stories.d.ts.map +1 -0
- package/dist/browser/components/account/table/BalanceHistoryTableRow.d.ts +8 -0
- package/dist/browser/components/account/table/BalanceHistoryTableRow.d.ts.map +1 -0
- package/dist/browser/components/account/table/RawAmountTableCell.d.ts +9 -0
- package/dist/browser/components/account/table/RawAmountTableCell.d.ts.map +1 -0
- package/dist/browser/components/account/table/index.d.ts +5 -0
- package/dist/browser/components/account/table/index.d.ts.map +1 -0
- package/dist/browser/components/account/table/types/index.d.ts +9 -0
- package/dist/browser/components/account/table/types/index.d.ts.map +1 -0
- package/dist/browser/components/block/helpers/blockProducer.d.ts +1 -3
- package/dist/browser/components/block/helpers/blockProducer.d.ts.map +1 -1
- package/dist/browser/components/block/hooks/useBlockProducer.d.ts +1 -3
- package/dist/browser/components/block/hooks/useBlockProducer.d.ts.map +1 -1
- package/dist/browser/components/block/table/cell/BlockNumber.d.ts +1 -0
- package/dist/browser/components/block/table/cell/BlockNumber.d.ts.map +1 -1
- package/dist/browser/components/block/table/cell/JsonView.d.ts.map +1 -1
- package/dist/browser/components/block/table/cell/PayloadCounts.d.ts +1 -1
- package/dist/browser/components/block/table/cell/PayloadCounts.d.ts.map +1 -1
- package/dist/browser/components/block/table/cell/TransactionCount.d.ts +1 -1
- package/dist/browser/components/block/table/cell/TransactionCount.d.ts.map +1 -1
- package/dist/browser/components/index.d.ts +1 -0
- package/dist/browser/components/index.d.ts.map +1 -1
- package/dist/browser/components/payload/builder/transfer/Transfer.d.ts +1 -1
- package/dist/browser/components/payload/builder/transfer/Transfer.d.ts.map +1 -1
- package/dist/browser/components/payload/builder/transfer/builder/SingleFlexbox.d.ts.map +1 -1
- package/dist/browser/components/payload/fields/XyoAddressTextField.d.ts +1 -1
- package/dist/browser/components/payload/fields/XyoAddressTextField.d.ts.map +1 -1
- package/dist/browser/components/transactions/TransactionCountChip.d.ts +1 -1
- package/dist/browser/components/transactions/TransactionCountChip.d.ts.map +1 -1
- package/dist/browser/components/transactions/TransactionsQuickTipButton.d.ts.map +1 -1
- package/dist/browser/components/transactions/submit/SubmitChain.d.ts.map +1 -1
- package/dist/browser/hooks/chain-iterator/useChainIteratorParams.d.ts +6 -12
- package/dist/browser/hooks/chain-iterator/useChainIteratorParams.d.ts.map +1 -1
- package/dist/browser/index.mjs +475 -293
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/lib/getChainId.d.ts +1 -2
- package/dist/browser/lib/getChainId.d.ts.map +1 -1
- package/dist/browser/stories/ChainInfoContextDecorator.d.ts.map +1 -1
- package/dist/browser/types/BlockComponentProps.d.ts +1 -1
- package/dist/browser/types/BlockComponentProps.d.ts.map +1 -1
- package/dist/browser/types/render/BlockChainRenderProps.d.ts +1 -2
- package/dist/browser/types/render/BlockChainRenderProps.d.ts.map +1 -1
- package/package.json +31 -32
- package/src/components/account/BalanceHistoryFlexbox.stories.tsx +25 -0
- package/src/components/account/BalanceHistoryFlexbox.tsx +65 -0
- package/src/components/account/index.ts +2 -0
- package/src/components/account/table/AddressTableCell.tsx +25 -0
- package/src/components/account/table/BalanceHistoryTable.stories.tsx +75 -0
- package/src/components/account/table/BalanceHistoryTable.tsx +36 -0
- package/src/components/account/table/BalanceHistoryTableRow.tsx +41 -0
- package/src/components/account/table/RawAmountTableCell.tsx +52 -0
- package/src/components/account/table/index.ts +4 -0
- package/src/components/account/table/types/index.ts +17 -0
- package/src/components/block/BlockHeadingFlexbox.tsx +1 -1
- package/src/components/block/ProducerChip.tsx +3 -3
- package/src/components/block/hooks/useStaticBlockComponents.ts +1 -1
- package/src/components/block/table/Ex.stories.tsx +1 -1
- package/src/components/block/table/cell/BlockNumber.tsx +8 -3
- package/src/components/block/table/cell/Epoch.tsx +1 -1
- package/src/components/block/table/cell/Hash.tsx +1 -1
- package/src/components/block/table/cell/JsonView.tsx +1 -2
- package/src/components/block/table/cell/PayloadCounts.tsx +1 -1
- package/src/components/block/table/cell/TransactionCount.tsx +1 -1
- package/src/components/chain/render/static/flexbox/Flexbox.stories.tsx +1 -1
- package/src/components/chain/render/static/flexbox/variants/WithAnalysis.tsx +1 -1
- package/src/components/chain/render/static/hooks/useStaticBlockRenderComponents.ts +2 -2
- package/src/components/chain/render/static/table/Ex.stories.tsx +1 -1
- package/src/components/index.ts +1 -0
- package/src/components/payload/builder/producer-intent/Form.tsx +1 -1
- package/src/components/payload/builder/transfer/Form.tsx +2 -2
- package/src/components/payload/builder/transfer/Transfer.ts +1 -1
- package/src/components/payload/builder/transfer/builder/SingleFlexbox.tsx +2 -2
- package/src/components/payload/fields/XyoAddressTextField.tsx +2 -2
- package/src/components/transactions/TransactionCountChip.tsx +1 -1
- package/src/components/transactions/TransactionsQuickTipButton.tsx +1 -1
- package/src/components/transactions/submit/Builder.tsx +1 -1
- package/src/components/transactions/submit/SubmitChain.tsx +6 -2
- package/src/context/analyzer/Provider.tsx +1 -1
- package/src/hooks/chain-iterator/ChainIteratorStore.ts +1 -1
- package/src/hooks/chain-iterator/useChainIteratorParams.ts +2 -3
- package/src/hooks/chain-iterator/useChainIteratorUpdatingHead.ts +1 -1
- package/src/hooks/useIterateChain.ts +1 -1
- package/src/lib/getChainArchivist.ts +1 -1
- package/src/lib/getChainId.ts +2 -2
- package/src/stories/ChainArchivistDelayedInsertDecorator.tsx +1 -1
- package/src/stories/ChainInfoContextDecorator.tsx +1 -2
- package/src/types/BlockComponentProps.ts +1 -1
- package/src/types/render/BlockChainRenderProps.ts +1 -2
package/dist/browser/index.mjs
CHANGED
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
|
|
4
|
+
// src/components/account/BalanceHistoryFlexbox.tsx
|
|
5
|
+
import { Typography as Typography6 } from "@mui/material";
|
|
6
|
+
import { FlexCol as FlexCol3 } from "@xylabs/react-flexbox";
|
|
7
|
+
import { isDefined as isDefined6 } from "@xylabs/sdk-js";
|
|
8
|
+
import { useAccountBalanceHistory } from "@xyo-network/react-chain-provider";
|
|
9
|
+
import { ErrorRender as ErrorRender3 } from "@xyo-network/react-error";
|
|
10
|
+
import { AttoXL1, XL1Amount as XL1Amount2 } from "@xyo-network/xl1-protocol";
|
|
11
|
+
import React28 from "react";
|
|
12
|
+
|
|
13
|
+
// src/components/account/table/AddressTableCell.tsx
|
|
14
|
+
import { TableCell as TableCell10, Tooltip as Tooltip8 } from "@mui/material";
|
|
15
|
+
import { useEvent as useEvent4 } from "@xyo-network/react-event";
|
|
16
|
+
|
|
4
17
|
// src/components/block/BlockHeadingFlexbox.tsx
|
|
5
18
|
import { FlexCol as FlexCol2, FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
|
|
6
19
|
import { BWVerification, HashHeadingPaper } from "@xyo-network/react-boundwitness-plugin";
|
|
7
20
|
import { usePayloadHash } from "@xyo-network/react-shared";
|
|
8
|
-
import
|
|
21
|
+
import React14 from "react";
|
|
9
22
|
|
|
10
23
|
// src/context/analyzer/context.ts
|
|
11
24
|
import { createContextEx } from "@xylabs/react-shared";
|
|
12
25
|
var ChainAnalyzersContext = createContextEx();
|
|
13
26
|
|
|
14
27
|
// src/context/analyzer/Provider.tsx
|
|
15
|
-
import { isUndefined } from "@xylabs/
|
|
16
|
-
import
|
|
28
|
+
import { isUndefined } from "@xylabs/sdk-js";
|
|
29
|
+
import React2, { useCallback, useMemo, useState } from "react";
|
|
17
30
|
var ChainAnalyzersProvider = /* @__PURE__ */ __name(({ analyzers: analyzersProp, children }) => {
|
|
18
31
|
const [analyzersState, setAnalyzersState] = useState(analyzersProp ?? {});
|
|
19
32
|
const [statsUpdated, setStatsUpdated] = useState(Date.now());
|
|
@@ -51,7 +64,7 @@ var ChainAnalyzersProvider = /* @__PURE__ */ __name(({ analyzers: analyzersProp,
|
|
|
51
64
|
onBlock,
|
|
52
65
|
statsUpdated
|
|
53
66
|
]);
|
|
54
|
-
return /* @__PURE__ */
|
|
67
|
+
return /* @__PURE__ */ React2.createElement(ChainAnalyzersContext, {
|
|
55
68
|
value
|
|
56
69
|
}, children);
|
|
57
70
|
}, "ChainAnalyzersProvider");
|
|
@@ -65,7 +78,7 @@ import { createContextEx as createContextEx2 } from "@xylabs/react-shared";
|
|
|
65
78
|
var ChainInfoContext = createContextEx2();
|
|
66
79
|
|
|
67
80
|
// src/context/chain/Provider.tsx
|
|
68
|
-
import
|
|
81
|
+
import React3, { useMemo as useMemo2, useState as useState2 } from "react";
|
|
69
82
|
var ChainInfoProvider = /* @__PURE__ */ __name(({ children, chainArchivist: chainArchivistProp, chainId: chainIdProp, chainIterator: chainIteratorProp }) => {
|
|
70
83
|
const [chainArchivist, setChainArchivist] = useState2(chainArchivistProp);
|
|
71
84
|
const [chainId, setChainId] = useState2(chainIdProp);
|
|
@@ -110,7 +123,7 @@ var ChainInfoProvider = /* @__PURE__ */ __name(({ children, chainArchivist: chai
|
|
|
110
123
|
updateChainId,
|
|
111
124
|
updateChainIterator
|
|
112
125
|
]);
|
|
113
|
-
return /* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ React3.createElement(ChainInfoContext, {
|
|
114
127
|
value: chainState
|
|
115
128
|
}, children);
|
|
116
129
|
}, "ChainInfoProvider");
|
|
@@ -125,10 +138,10 @@ var useChainPollingContext = /* @__PURE__ */ __name((required = false) => useCon
|
|
|
125
138
|
|
|
126
139
|
// src/components/transactions/submit/Builder.tsx
|
|
127
140
|
import { Button, FormControl, TextField } from "@mui/material";
|
|
128
|
-
import { toHex } from "@xylabs/hex";
|
|
129
141
|
import { FlexCol } from "@xylabs/react-flexbox";
|
|
142
|
+
import { toHex } from "@xylabs/sdk-js";
|
|
130
143
|
import { defaultTransactionFees } from "@xyo-network/xl1-protocol";
|
|
131
|
-
import
|
|
144
|
+
import React4 from "react";
|
|
132
145
|
var ChainTransactionBuilder = /* @__PURE__ */ __name(({ onSubmitTx }) => {
|
|
133
146
|
const handleSubmit = /* @__PURE__ */ __name(async (event) => {
|
|
134
147
|
event.preventDefault();
|
|
@@ -146,38 +159,38 @@ var ChainTransactionBuilder = /* @__PURE__ */ __name(({ onSubmitTx }) => {
|
|
|
146
159
|
};
|
|
147
160
|
await onSubmitTx?.(chainTx);
|
|
148
161
|
}, "handleSubmit");
|
|
149
|
-
return /* @__PURE__ */
|
|
162
|
+
return /* @__PURE__ */ React4.createElement("form", {
|
|
150
163
|
onSubmit: /* @__PURE__ */ __name((event) => void handleSubmit(event), "onSubmit"),
|
|
151
164
|
style: {
|
|
152
165
|
width: "100%"
|
|
153
166
|
}
|
|
154
|
-
}, /* @__PURE__ */
|
|
167
|
+
}, /* @__PURE__ */ React4.createElement(FlexCol, {
|
|
155
168
|
gap: 2
|
|
156
|
-
}, /* @__PURE__ */
|
|
169
|
+
}, /* @__PURE__ */ React4.createElement(FormControl, {
|
|
157
170
|
fullWidth: true
|
|
158
|
-
}, /* @__PURE__ */
|
|
171
|
+
}, /* @__PURE__ */ React4.createElement(TextField, {
|
|
159
172
|
label: "Chain Address",
|
|
160
173
|
name: "chain",
|
|
161
174
|
required: true
|
|
162
|
-
})), /* @__PURE__ */
|
|
175
|
+
})), /* @__PURE__ */ React4.createElement(FormControl, {
|
|
163
176
|
fullWidth: true
|
|
164
|
-
}, /* @__PURE__ */
|
|
177
|
+
}, /* @__PURE__ */ React4.createElement(TextField, {
|
|
165
178
|
label: "Gas",
|
|
166
179
|
name: "gas",
|
|
167
180
|
required: true
|
|
168
|
-
})), /* @__PURE__ */
|
|
181
|
+
})), /* @__PURE__ */ React4.createElement(FormControl, {
|
|
169
182
|
fullWidth: true
|
|
170
|
-
}, /* @__PURE__ */
|
|
183
|
+
}, /* @__PURE__ */ React4.createElement(TextField, {
|
|
171
184
|
label: "Not Before Block",
|
|
172
185
|
name: "nbf",
|
|
173
186
|
required: true
|
|
174
|
-
})), /* @__PURE__ */
|
|
187
|
+
})), /* @__PURE__ */ React4.createElement(FormControl, {
|
|
175
188
|
fullWidth: true
|
|
176
|
-
}, /* @__PURE__ */
|
|
189
|
+
}, /* @__PURE__ */ React4.createElement(TextField, {
|
|
177
190
|
label: "Not After Block",
|
|
178
191
|
name: "exp",
|
|
179
192
|
required: true
|
|
180
|
-
})), /* @__PURE__ */
|
|
193
|
+
})), /* @__PURE__ */ React4.createElement(Button, {
|
|
181
194
|
type: "submit",
|
|
182
195
|
variant: "contained"
|
|
183
196
|
}, "Submit")));
|
|
@@ -185,7 +198,7 @@ var ChainTransactionBuilder = /* @__PURE__ */ __name(({ onSubmitTx }) => {
|
|
|
185
198
|
|
|
186
199
|
// src/components/transactions/submit/Network.tsx
|
|
187
200
|
import { FormControl as FormControl2, FormHelperText, TextField as TextField2 } from "@mui/material";
|
|
188
|
-
import
|
|
201
|
+
import React5, { useState as useState3 } from "react";
|
|
189
202
|
var ChainTransactionNetwork = /* @__PURE__ */ __name(({ network, onNetworkChange, ...props }) => {
|
|
190
203
|
const [error, setError] = useState3();
|
|
191
204
|
const handleChange = /* @__PURE__ */ __name((event) => {
|
|
@@ -198,16 +211,16 @@ var ChainTransactionNetwork = /* @__PURE__ */ __name(({ network, onNetworkChange
|
|
|
198
211
|
setError(error2);
|
|
199
212
|
}
|
|
200
213
|
}, "handleChange");
|
|
201
|
-
return /* @__PURE__ */
|
|
214
|
+
return /* @__PURE__ */ React5.createElement(FormControl2, {
|
|
202
215
|
fullWidth: true
|
|
203
|
-
}, /* @__PURE__ */
|
|
216
|
+
}, /* @__PURE__ */ React5.createElement(TextField2, {
|
|
204
217
|
label: "Network",
|
|
205
218
|
name: "network",
|
|
206
219
|
onChange: handleChange,
|
|
207
220
|
required: true,
|
|
208
221
|
value: network,
|
|
209
222
|
...props
|
|
210
|
-
}), /* @__PURE__ */
|
|
223
|
+
}), /* @__PURE__ */ React5.createElement(FormHelperText, {
|
|
211
224
|
sx: {
|
|
212
225
|
color: error ? "red" : void 0
|
|
213
226
|
}
|
|
@@ -216,7 +229,7 @@ var ChainTransactionNetwork = /* @__PURE__ */ __name(({ network, onNetworkChange
|
|
|
216
229
|
|
|
217
230
|
// src/components/transactions/submit/SubmitChain.tsx
|
|
218
231
|
import { Alert, Grid, Typography } from "@mui/material";
|
|
219
|
-
import {
|
|
232
|
+
import { AxiosJson } from "@xylabs/axios";
|
|
220
233
|
import { ErrorRender } from "@xylabs/react-error";
|
|
221
234
|
import { FlexGrowCol } from "@xylabs/react-flexbox";
|
|
222
235
|
import { Account } from "@xyo-network/account";
|
|
@@ -224,7 +237,8 @@ import { ArchivistInsertQuerySchema } from "@xyo-network/archivist-model";
|
|
|
224
237
|
import { QueryBoundWitnessBuilder } from "@xyo-network/boundwitness-builder";
|
|
225
238
|
import { PayloadBuilder } from "@xyo-network/payload-builder";
|
|
226
239
|
import { buildTransaction } from "@xyo-network/xl1-protocol-sdk";
|
|
227
|
-
import
|
|
240
|
+
import { Axios } from "axios";
|
|
241
|
+
import React6, { useState as useState4 } from "react";
|
|
228
242
|
var BETA_PENDING_TRANSACTIONS_ARCHIVIST = "https://beta.api.chain.xyo.network/8050fee682a2762f504d5449d8269a6f17f0b693";
|
|
229
243
|
var defaultNetwork = new URL(BETA_PENDING_TRANSACTIONS_ARCHIVIST);
|
|
230
244
|
var SubmitChainTransaction = /* @__PURE__ */ __name(() => {
|
|
@@ -241,7 +255,7 @@ var SubmitChainTransaction = /* @__PURE__ */ __name(() => {
|
|
|
241
255
|
const [queryBoundWitness] = await new QueryBoundWitnessBuilder().payloads([
|
|
242
256
|
transactionBoundWitness
|
|
243
257
|
]).query(insertQuery).signer(randomAccount).build();
|
|
244
|
-
const response = await
|
|
258
|
+
const response = await new Axios(AxiosJson.axiosConfig()).post(network.href, [
|
|
245
259
|
queryBoundWitness,
|
|
246
260
|
[
|
|
247
261
|
insertQuery,
|
|
@@ -259,37 +273,37 @@ var SubmitChainTransaction = /* @__PURE__ */ __name(() => {
|
|
|
259
273
|
const onNetworkChange = /* @__PURE__ */ __name((url) => {
|
|
260
274
|
setNetwork(url);
|
|
261
275
|
}, "onNetworkChange");
|
|
262
|
-
return /* @__PURE__ */
|
|
276
|
+
return /* @__PURE__ */ React6.createElement(Grid, {
|
|
263
277
|
container: true
|
|
264
|
-
}, /* @__PURE__ */
|
|
278
|
+
}, /* @__PURE__ */ React6.createElement(Grid, {
|
|
265
279
|
size: {
|
|
266
280
|
xs: 12,
|
|
267
281
|
sm: 6,
|
|
268
282
|
md: 4
|
|
269
283
|
}
|
|
270
|
-
}, /* @__PURE__ */
|
|
284
|
+
}, /* @__PURE__ */ React6.createElement(FlexGrowCol, {
|
|
271
285
|
alignItems: "start",
|
|
272
286
|
gap: 2
|
|
273
|
-
}, /* @__PURE__ */
|
|
287
|
+
}, /* @__PURE__ */ React6.createElement(ChainTransactionNetwork, {
|
|
274
288
|
network,
|
|
275
289
|
onNetworkChange
|
|
276
|
-
}), network ? /* @__PURE__ */
|
|
290
|
+
}), network ? /* @__PURE__ */ React6.createElement(ChainTransactionBuilder, {
|
|
277
291
|
onSubmitTx
|
|
278
|
-
}) : null, result?.[2].length === 0 ? /* @__PURE__ */
|
|
292
|
+
}) : null, result?.[2].length === 0 ? /* @__PURE__ */ React6.createElement(Alert, {
|
|
279
293
|
severity: "success"
|
|
280
|
-
}, "Success") : null, error ? /* @__PURE__ */
|
|
294
|
+
}, "Success") : null, error ? /* @__PURE__ */ React6.createElement(ErrorRender, {
|
|
281
295
|
error
|
|
282
|
-
}) : null, result?.[2] && result?.[2].length > 0 ? /* @__PURE__ */
|
|
296
|
+
}) : null, result?.[2] && result?.[2].length > 0 ? /* @__PURE__ */ React6.createElement(ErrorRender, {
|
|
283
297
|
error: new Error("Failed insert...see result below")
|
|
284
|
-
}) : null, result ? /* @__PURE__ */
|
|
298
|
+
}) : null, result ? /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(Typography, {
|
|
285
299
|
variant: "h6"
|
|
286
|
-
}, "Result:"), /* @__PURE__ */
|
|
300
|
+
}, "Result:"), /* @__PURE__ */ React6.createElement("pre", null, JSON.stringify(result, null, 2))) : null)));
|
|
287
301
|
}, "SubmitChainTransaction");
|
|
288
302
|
|
|
289
303
|
// src/components/transactions/TransactionCountChip.tsx
|
|
290
304
|
import CompareArrowsIcon from "@mui/icons-material/CompareArrows";
|
|
291
305
|
import { Chip, Icon } from "@mui/material";
|
|
292
|
-
import
|
|
306
|
+
import React7, { useMemo as useMemo3 } from "react";
|
|
293
307
|
var TransactionCountChip = /* @__PURE__ */ __name(({ transactions, sx, ...props }) => {
|
|
294
308
|
const label = useMemo3(() => {
|
|
295
309
|
if (!transactions) return "0";
|
|
@@ -297,8 +311,8 @@ var TransactionCountChip = /* @__PURE__ */ __name(({ transactions, sx, ...props
|
|
|
297
311
|
}, [
|
|
298
312
|
transactions
|
|
299
313
|
]);
|
|
300
|
-
return /* @__PURE__ */
|
|
301
|
-
avatar: /* @__PURE__ */
|
|
314
|
+
return /* @__PURE__ */ React7.createElement(Chip, {
|
|
315
|
+
avatar: /* @__PURE__ */ React7.createElement(Icon, null, /* @__PURE__ */ React7.createElement(CompareArrowsIcon, null)),
|
|
302
316
|
label,
|
|
303
317
|
title: transactions ? `Block contains ${transactions.length} transactions` : void 0,
|
|
304
318
|
sx: {
|
|
@@ -317,10 +331,10 @@ import { Alert as Alert2, AlertTitle, Collapse, Snackbar, Typography as Typograp
|
|
|
317
331
|
import { ErrorRender as ErrorRender2 } from "@xylabs/react-error";
|
|
318
332
|
import { FlexGrowCol as FlexGrowCol2, FlexGrowRow, FlexRow } from "@xylabs/react-flexbox";
|
|
319
333
|
import { QuickTipButton } from "@xylabs/react-quick-tip-button";
|
|
320
|
-
import
|
|
334
|
+
import React8, { Fragment, useMemo as useMemo4, useState as useState6 } from "react";
|
|
321
335
|
|
|
322
336
|
// src/hooks/chain-iterator/ChainIteratorStore.ts
|
|
323
|
-
import { assertEx } from "@xylabs/
|
|
337
|
+
import { assertEx } from "@xylabs/sdk-js";
|
|
324
338
|
import { ChainBlockNumberIterationService } from "@xyo-network/chain-services";
|
|
325
339
|
import { PayloadBuilder as PayloadBuilder2 } from "@xyo-network/payload-builder";
|
|
326
340
|
import { hydrateBlock } from "@xyo-network/xl1-protocol-sdk";
|
|
@@ -388,10 +402,9 @@ var ChainIteratorStore = class _ChainIteratorStore {
|
|
|
388
402
|
};
|
|
389
403
|
|
|
390
404
|
// src/hooks/chain-iterator/useChainIteratorParams.ts
|
|
391
|
-
import { assertEx as assertEx2 } from "@xylabs/assert";
|
|
392
|
-
import { isHash } from "@xylabs/hex";
|
|
393
405
|
import { usePromise } from "@xylabs/react-promise";
|
|
394
|
-
import {
|
|
406
|
+
import { isHash } from "@xylabs/sdk-js";
|
|
407
|
+
import { assertEx as assertEx2, isDefined } from "@xylabs/sdk-js";
|
|
395
408
|
import { BoundWitnessBuilder } from "@xyo-network/boundwitness-builder";
|
|
396
409
|
import { isBlockBoundWitness } from "@xyo-network/xl1-protocol";
|
|
397
410
|
import { getDefaultConfig } from "@xyo-network/xl1-protocol-sdk";
|
|
@@ -430,7 +443,7 @@ var useChainIteratorParams = /* @__PURE__ */ __name(({ chainMap, chainId, head,
|
|
|
430
443
|
}, "useChainIteratorParams");
|
|
431
444
|
|
|
432
445
|
// src/hooks/chain-iterator/useChainIteratorUpdatingHead.ts
|
|
433
|
-
import { toHex as toHex2 } from "@xylabs/
|
|
446
|
+
import { toHex as toHex2 } from "@xylabs/sdk-js";
|
|
434
447
|
import { findMostRecentBlock } from "@xyo-network/chain-protocol";
|
|
435
448
|
import { useEffect, useState as useState5 } from "react";
|
|
436
449
|
var useChainIteratorUpdatingHead = /* @__PURE__ */ __name(({ chainIterator, interval = 500, maxBlocks, chainArchivist }) => {
|
|
@@ -471,8 +484,8 @@ var useChainIteratorUpdatingHead = /* @__PURE__ */ __name(({ chainIterator, inte
|
|
|
471
484
|
}, "useChainIteratorUpdatingHead");
|
|
472
485
|
|
|
473
486
|
// src/hooks/useIterateChain.ts
|
|
474
|
-
import { assertEx as assertEx3 } from "@xylabs/assert";
|
|
475
487
|
import { usePromise as usePromise2 } from "@xylabs/react-promise";
|
|
488
|
+
import { assertEx as assertEx3 } from "@xylabs/sdk-js";
|
|
476
489
|
import { ChainBlockNumberIterationService as ChainBlockNumberIterationService2 } from "@xyo-network/chain-services";
|
|
477
490
|
import { PayloadBuilder as PayloadBuilder3 } from "@xyo-network/payload-builder";
|
|
478
491
|
import { isBlockBoundWitness as isBlockBoundWitness2 } from "@xyo-network/xl1-protocol";
|
|
@@ -555,7 +568,7 @@ var TransactionsQuickTipButton = /* @__PURE__ */ __name(({ block, ...props }) =>
|
|
|
555
568
|
setCopied(false);
|
|
556
569
|
}, 5e3);
|
|
557
570
|
}, "onCopy");
|
|
558
|
-
return /* @__PURE__ */
|
|
571
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(QuickTipButton, {
|
|
559
572
|
Icon: Paid,
|
|
560
573
|
disabled: transactions?.length === 0,
|
|
561
574
|
hoverText: `Transaction Count: ${transactions?.length ?? 0}`,
|
|
@@ -565,32 +578,32 @@ var TransactionsQuickTipButton = /* @__PURE__ */ __name(({ block, ...props }) =>
|
|
|
565
578
|
maxWidth: "md"
|
|
566
579
|
},
|
|
567
580
|
...props
|
|
568
|
-
}, transactions?.length === 0 ? null : /* @__PURE__ */
|
|
581
|
+
}, transactions?.length === 0 ? null : /* @__PURE__ */ React8.createElement(FlexGrowCol2, {
|
|
569
582
|
gap: 1,
|
|
570
583
|
alignItems: "stretch"
|
|
571
|
-
}, transactions?.map(([transaction, hash]) => /* @__PURE__ */
|
|
584
|
+
}, transactions?.map(([transaction, hash]) => /* @__PURE__ */ React8.createElement(Fragment, {
|
|
572
585
|
key: hash
|
|
573
|
-
}, /* @__PURE__ */
|
|
586
|
+
}, /* @__PURE__ */ React8.createElement(FlexGrowRow, {
|
|
574
587
|
gap: 2,
|
|
575
588
|
justifyContent: "start"
|
|
576
|
-
}, /* @__PURE__ */
|
|
589
|
+
}, /* @__PURE__ */ React8.createElement(ContentCopyIcon, {
|
|
577
590
|
sx: {
|
|
578
591
|
cursor: "pointer"
|
|
579
592
|
},
|
|
580
593
|
onClick: /* @__PURE__ */ __name(() => void onCopy(hash), "onClick")
|
|
581
|
-
}), /* @__PURE__ */
|
|
594
|
+
}), /* @__PURE__ */ React8.createElement(Typography2, {
|
|
582
595
|
sx: {
|
|
583
596
|
overflow: "hidden",
|
|
584
597
|
textOverflow: "ellipsis",
|
|
585
598
|
whiteSpace: "nowrap"
|
|
586
599
|
}
|
|
587
|
-
}, hash)), /* @__PURE__ */
|
|
600
|
+
}, hash)), /* @__PURE__ */ React8.createElement(FlexRow, null, /* @__PURE__ */ React8.createElement(Collapse, {
|
|
588
601
|
in: copied,
|
|
589
602
|
unmountOnExit: true
|
|
590
|
-
}, /* @__PURE__ */
|
|
603
|
+
}, /* @__PURE__ */ React8.createElement(Alert2, null, /* @__PURE__ */ React8.createElement(AlertTitle, null, "Previous hash copied to clipboard")))))))), /* @__PURE__ */ React8.createElement(Snackbar, {
|
|
591
604
|
open: showError,
|
|
592
605
|
onClose: /* @__PURE__ */ __name(() => setShowError(false), "onClose")
|
|
593
|
-
}, /* @__PURE__ */
|
|
606
|
+
}, /* @__PURE__ */ React8.createElement(ErrorRender2, {
|
|
594
607
|
error: transactionsError,
|
|
595
608
|
scope: "TransactionsQuickTipButton"
|
|
596
609
|
})));
|
|
@@ -645,13 +658,13 @@ var blockProducer = /* @__PURE__ */ __name((block) => {
|
|
|
645
658
|
}, "blockProducer");
|
|
646
659
|
|
|
647
660
|
// src/components/block/helpers/buildBlockChainRenderComponent.tsx
|
|
648
|
-
import
|
|
661
|
+
import React9 from "react";
|
|
649
662
|
var buildBlockChainRenderComponent = /* @__PURE__ */ __name(async (BlockComponent, blockComponentProps) => {
|
|
650
663
|
const { block, ...remainingProps } = blockComponentProps;
|
|
651
664
|
const blockTxs = await txsFromBlock(block);
|
|
652
665
|
const txHashes = blockTxs.map(([_, hash]) => hash);
|
|
653
666
|
const item = {
|
|
654
|
-
child: /* @__PURE__ */
|
|
667
|
+
child: /* @__PURE__ */ React9.createElement(BlockComponent, {
|
|
655
668
|
block,
|
|
656
669
|
transactions: txHashes,
|
|
657
670
|
...remainingProps
|
|
@@ -728,7 +741,7 @@ var usePayloadCountsFromBlock = /* @__PURE__ */ __name((block) => {
|
|
|
728
741
|
|
|
729
742
|
// src/components/block/hooks/useStaticBlockComponents.ts
|
|
730
743
|
import { usePromise as usePromise4 } from "@xylabs/react-promise";
|
|
731
|
-
import { isDefined as isDefined2 } from "@xylabs/
|
|
744
|
+
import { isDefined as isDefined2 } from "@xylabs/sdk-js";
|
|
732
745
|
var useStaticBlockComponents = /* @__PURE__ */ __name((BlockComponent, params, blocks) => {
|
|
733
746
|
const { onBlock } = useChainAnalyzersContext();
|
|
734
747
|
const [blockComponents, blockComponentsError] = usePromise4(async () => {
|
|
@@ -757,9 +770,9 @@ var useStaticBlockComponents = /* @__PURE__ */ __name((BlockComponent, params, b
|
|
|
757
770
|
|
|
758
771
|
// src/components/block/LinkedDivider.tsx
|
|
759
772
|
import { Divider, Stack } from "@mui/material";
|
|
760
|
-
import
|
|
773
|
+
import React10 from "react";
|
|
761
774
|
var LinkedDivider = /* @__PURE__ */ __name(() => {
|
|
762
|
-
return /* @__PURE__ */
|
|
775
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(Stack, {
|
|
763
776
|
className: "divider-spacer",
|
|
764
777
|
justifyContent: "end",
|
|
765
778
|
sx: {
|
|
@@ -767,7 +780,7 @@ var LinkedDivider = /* @__PURE__ */ __name(() => {
|
|
|
767
780
|
height: 24,
|
|
768
781
|
justifyContent: "end"
|
|
769
782
|
}
|
|
770
|
-
}, /* @__PURE__ */
|
|
783
|
+
}, /* @__PURE__ */ React10.createElement(Divider, {
|
|
771
784
|
className: "divider",
|
|
772
785
|
orientation: "vertical",
|
|
773
786
|
flexItem: true,
|
|
@@ -783,16 +796,16 @@ var LinkedDivider = /* @__PURE__ */ __name(() => {
|
|
|
783
796
|
import { MoreVert } from "@mui/icons-material";
|
|
784
797
|
import { IconButton, Menu } from "@mui/material";
|
|
785
798
|
import { BWJsonMenuItem, BWPreviousHashMenuItem } from "@xyo-network/react-boundwitness-plugin";
|
|
786
|
-
import
|
|
799
|
+
import React11 from "react";
|
|
787
800
|
var BlockMenuExpanded = /* @__PURE__ */ __name(({ block }) => {
|
|
788
801
|
const { anchorEl, anchorRef, open, handleClick, handleClose } = useAnchorElement();
|
|
789
|
-
return /* @__PURE__ */
|
|
802
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(IconButton, {
|
|
790
803
|
ref: anchorRef,
|
|
791
804
|
size: "small",
|
|
792
805
|
onClick: handleClick
|
|
793
|
-
}, /* @__PURE__ */
|
|
806
|
+
}, /* @__PURE__ */ React11.createElement(MoreVert, {
|
|
794
807
|
fontSize: "inherit"
|
|
795
|
-
})), /* @__PURE__ */
|
|
808
|
+
})), /* @__PURE__ */ React11.createElement(Menu, {
|
|
796
809
|
open,
|
|
797
810
|
anchorEl,
|
|
798
811
|
anchorOrigin: {
|
|
@@ -800,11 +813,11 @@ var BlockMenuExpanded = /* @__PURE__ */ __name(({ block }) => {
|
|
|
800
813
|
vertical: "bottom"
|
|
801
814
|
},
|
|
802
815
|
onClose: handleClose
|
|
803
|
-
}, /* @__PURE__ */
|
|
816
|
+
}, /* @__PURE__ */ React11.createElement(BWPreviousHashMenuItem, {
|
|
804
817
|
boundwitness: block?.[0],
|
|
805
818
|
dense: true,
|
|
806
819
|
onDialogClose: handleClose
|
|
807
|
-
}), /* @__PURE__ */
|
|
820
|
+
}), /* @__PURE__ */ React11.createElement(BWJsonMenuItem, {
|
|
808
821
|
boundwitness: block?.[0],
|
|
809
822
|
dense: true,
|
|
810
823
|
onDialogClose: handleClose
|
|
@@ -813,17 +826,15 @@ var BlockMenuExpanded = /* @__PURE__ */ __name(({ block }) => {
|
|
|
813
826
|
|
|
814
827
|
// src/components/block/ProducerChip.tsx
|
|
815
828
|
import { Chip as Chip2 } from "@mui/material";
|
|
816
|
-
import { EthAddressWrapper } from "@xylabs/
|
|
817
|
-
import { toAddress } from "@xylabs/hex";
|
|
818
|
-
import { isString, isUndefined as isUndefined2 } from "@xylabs/typeof";
|
|
829
|
+
import { EthAddressWrapper, isString, isUndefined as isUndefined2, toAddress } from "@xylabs/sdk-js";
|
|
819
830
|
import { BlockiesAvatar } from "@xyo-network/react-chain-blockies";
|
|
820
|
-
import
|
|
831
|
+
import React13, { useMemo as useMemo7 } from "react";
|
|
821
832
|
|
|
822
833
|
// src/components/block/ChipSkeleton.tsx
|
|
823
834
|
import { Skeleton } from "@mui/material";
|
|
824
|
-
import
|
|
835
|
+
import React12 from "react";
|
|
825
836
|
var ChipSkeleton = /* @__PURE__ */ __name((props) => {
|
|
826
|
-
return /* @__PURE__ */
|
|
837
|
+
return /* @__PURE__ */ React12.createElement(Skeleton, {
|
|
827
838
|
width: 100,
|
|
828
839
|
...props
|
|
829
840
|
});
|
|
@@ -837,7 +848,7 @@ var formatProducerAddress = /* @__PURE__ */ __name((address) => {
|
|
|
837
848
|
}, "formatProducerAddress");
|
|
838
849
|
var BlockProducerChip = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
839
850
|
const blockProducer2 = block?.[0].addresses[0];
|
|
840
|
-
return /* @__PURE__ */
|
|
851
|
+
return /* @__PURE__ */ React13.createElement(BlockAddressChip, {
|
|
841
852
|
address: blockProducer2,
|
|
842
853
|
toolTipTitle: `Block producer: ${blockProducer2}`,
|
|
843
854
|
...props
|
|
@@ -845,16 +856,16 @@ var BlockProducerChip = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
|
845
856
|
}, "BlockProducerChip");
|
|
846
857
|
var BlockAddressChip = /* @__PURE__ */ __name(({ address, sx, toolTipTitle, ...props }) => {
|
|
847
858
|
const shortedBlockProducer = address === void 0 ? null : formatProducerAddress(address);
|
|
848
|
-
const avatar = useMemo7(() => address === "" ? void 0 : /* @__PURE__ */
|
|
859
|
+
const avatar = useMemo7(() => address === "" ? void 0 : /* @__PURE__ */ React13.createElement(BlockiesAvatar, {
|
|
849
860
|
blockiesOptions: {
|
|
850
861
|
seed: address
|
|
851
862
|
}
|
|
852
863
|
}), [
|
|
853
864
|
address
|
|
854
865
|
]);
|
|
855
|
-
return /* @__PURE__ */
|
|
866
|
+
return /* @__PURE__ */ React13.createElement(Chip2, {
|
|
856
867
|
avatar,
|
|
857
|
-
label: shortedBlockProducer ?? /* @__PURE__ */
|
|
868
|
+
label: shortedBlockProducer ?? /* @__PURE__ */ React13.createElement(ChipSkeleton, {
|
|
858
869
|
width: 115
|
|
859
870
|
}),
|
|
860
871
|
title: toolTipTitle,
|
|
@@ -877,12 +888,12 @@ var BlockHeadingFlexbox = /* @__PURE__ */ __name(({ block, defaultExpanded, tran
|
|
|
877
888
|
event.stopPropagation();
|
|
878
889
|
blockHeadingListener("transaction-count", "click", JSON.stringify(transactions2));
|
|
879
890
|
}, "handleTransactionCountClick");
|
|
880
|
-
return /* @__PURE__ */
|
|
891
|
+
return /* @__PURE__ */ React14.createElement(FlexCol2, {
|
|
881
892
|
className: "block-heading-flexbox",
|
|
882
893
|
alignItems: "stretch",
|
|
883
894
|
ref: blockHeadingRef,
|
|
884
895
|
onClick: /* @__PURE__ */ __name(() => blockHeadingListener("block-hash", "click", hash), "onClick")
|
|
885
|
-
}, /* @__PURE__ */
|
|
896
|
+
}, /* @__PURE__ */ React14.createElement(LinkedDivider, null), /* @__PURE__ */ React14.createElement(HashHeadingPaper, {
|
|
886
897
|
hash,
|
|
887
898
|
heading: block?.[0].block === void 0 ? "" : block?.[0].block.toString(),
|
|
888
899
|
paperProps: {
|
|
@@ -891,24 +902,24 @@ var BlockHeadingFlexbox = /* @__PURE__ */ __name(({ block, defaultExpanded, tran
|
|
|
891
902
|
width: "100%"
|
|
892
903
|
}
|
|
893
904
|
},
|
|
894
|
-
AdornmentEnd: /* @__PURE__ */
|
|
905
|
+
AdornmentEnd: /* @__PURE__ */ React14.createElement(FlexRow2, {
|
|
895
906
|
gap: 1
|
|
896
|
-
}, /* @__PURE__ */
|
|
907
|
+
}, /* @__PURE__ */ React14.createElement(BlockProducerChip, {
|
|
897
908
|
block
|
|
898
|
-
}), /* @__PURE__ */
|
|
909
|
+
}), /* @__PURE__ */ React14.createElement(TransactionCountChip, {
|
|
899
910
|
onClick: /* @__PURE__ */ __name((e) => handleTransactionCountClick(e, transactions ?? []), "onClick"),
|
|
900
911
|
transactions
|
|
901
|
-
}), /* @__PURE__ */
|
|
912
|
+
}), /* @__PURE__ */ React14.createElement(BWVerification, {
|
|
902
913
|
iconColors: true,
|
|
903
914
|
boundwitness: block?.[0]
|
|
904
|
-
}), /* @__PURE__ */
|
|
915
|
+
}), /* @__PURE__ */ React14.createElement("span", {
|
|
905
916
|
style: {
|
|
906
917
|
// maxWidth is required for css animation to work and 28px is the width of the icon button
|
|
907
918
|
display: "flex",
|
|
908
919
|
transition: "max-width .5s",
|
|
909
920
|
maxWidth: expanded ? "28px" : 0
|
|
910
921
|
}
|
|
911
|
-
}, /* @__PURE__ */
|
|
922
|
+
}, /* @__PURE__ */ React14.createElement(BlockMenuExpanded, {
|
|
912
923
|
block
|
|
913
924
|
}))),
|
|
914
925
|
identiconProps: {
|
|
@@ -919,29 +930,40 @@ var BlockHeadingFlexbox = /* @__PURE__ */ __name(({ block, defaultExpanded, tran
|
|
|
919
930
|
}, "BlockHeadingFlexbox");
|
|
920
931
|
|
|
921
932
|
// src/components/block/table/cell/BlockNumber.tsx
|
|
922
|
-
import { TableCell, Tooltip, Typography as Typography3 } from "@mui/material";
|
|
923
|
-
import
|
|
933
|
+
import { Link, TableCell, Tooltip, Typography as Typography3 } from "@mui/material";
|
|
934
|
+
import { useEvent as useEvent2 } from "@xyo-network/react-event";
|
|
935
|
+
import React15 from "react";
|
|
924
936
|
var BlockNumberTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
925
937
|
const blockNumber = block?.[0].block;
|
|
926
|
-
return /* @__PURE__ */
|
|
938
|
+
return /* @__PURE__ */ React15.createElement(BlockNumberTableCellInner, {
|
|
927
939
|
blockNumber,
|
|
928
940
|
linked,
|
|
929
941
|
...props
|
|
930
942
|
});
|
|
931
943
|
}, "BlockNumberTableCell");
|
|
932
944
|
var BlockNumberTableCellInner = /* @__PURE__ */ __name(({ blockNumber, linked, ...props }) => {
|
|
933
|
-
|
|
945
|
+
const [ref, dispatch] = useEvent2();
|
|
946
|
+
const handleClick = /* @__PURE__ */ __name(() => dispatch("block-number", "click", blockNumber?.toString() ?? ""), "handleClick");
|
|
947
|
+
return /* @__PURE__ */ React15.createElement(TableCell, {
|
|
948
|
+
ref,
|
|
949
|
+
...props
|
|
950
|
+
}, /* @__PURE__ */ React15.createElement(Tooltip, {
|
|
934
951
|
title: `Block Number: ${blockNumber}`
|
|
935
|
-
}, /* @__PURE__ */
|
|
952
|
+
}, /* @__PURE__ */ React15.createElement(Typography3, {
|
|
936
953
|
component: "span",
|
|
937
954
|
variant: "body1"
|
|
938
|
-
},
|
|
955
|
+
}, linked ? /* @__PURE__ */ React15.createElement(Link, {
|
|
956
|
+
onClick: handleClick,
|
|
957
|
+
sx: {
|
|
958
|
+
cursor: "pointer"
|
|
959
|
+
}
|
|
960
|
+
}, blockNumber) : blockNumber)));
|
|
939
961
|
}, "BlockNumberTableCellInner");
|
|
940
962
|
|
|
941
963
|
// src/components/block/table/cell/Epoch.tsx
|
|
942
964
|
import { Skeleton as Skeleton2, TableCell as TableCell2, Tooltip as Tooltip2, Typography as Typography4 } from "@mui/material";
|
|
943
|
-
import { isDefined as isDefined3 } from "@xylabs/
|
|
944
|
-
import
|
|
965
|
+
import { isDefined as isDefined3 } from "@xylabs/sdk-js";
|
|
966
|
+
import React16 from "react";
|
|
945
967
|
|
|
946
968
|
// src/components/block/table/cell/lib/timeFunctions.ts
|
|
947
969
|
var dateFormat = Intl.DateTimeFormat(globalThis.navigator.language ?? "en-US", {
|
|
@@ -1007,45 +1029,45 @@ var BlockEpochTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) =
|
|
|
1007
1029
|
const epoch = block?.[0]?.$epoch;
|
|
1008
1030
|
const dateTime = dateFormat.format(epoch);
|
|
1009
1031
|
const age = isDefined3(epoch) ? timeAgo(epoch) : void 0;
|
|
1010
|
-
return /* @__PURE__ */
|
|
1032
|
+
return /* @__PURE__ */ React16.createElement(TableCell2, props, /* @__PURE__ */ React16.createElement(Tooltip2, {
|
|
1011
1033
|
title: `Block Epoch: ${dateTime}`
|
|
1012
|
-
}, /* @__PURE__ */
|
|
1034
|
+
}, /* @__PURE__ */ React16.createElement(Typography4, {
|
|
1013
1035
|
component: "span",
|
|
1014
1036
|
variant: "body1"
|
|
1015
|
-
}, age ?? /* @__PURE__ */
|
|
1037
|
+
}, age ?? /* @__PURE__ */ React16.createElement(Skeleton2, {
|
|
1016
1038
|
width: 115
|
|
1017
1039
|
}))));
|
|
1018
1040
|
}, "BlockEpochTableCell");
|
|
1019
1041
|
var BlockEpochTableCellInner = /* @__PURE__ */ __name(({ epoch, linked, ...props }) => {
|
|
1020
1042
|
const dateTime = dateFormat.format(epoch);
|
|
1021
1043
|
const age = isDefined3(epoch) ? timeAgo(epoch) : void 0;
|
|
1022
|
-
return /* @__PURE__ */
|
|
1044
|
+
return /* @__PURE__ */ React16.createElement(TableCell2, props, /* @__PURE__ */ React16.createElement(Tooltip2, {
|
|
1023
1045
|
title: `Block Epoch: ${dateTime}`
|
|
1024
|
-
}, /* @__PURE__ */
|
|
1046
|
+
}, /* @__PURE__ */ React16.createElement(Typography4, {
|
|
1025
1047
|
component: "span",
|
|
1026
1048
|
variant: "body1"
|
|
1027
|
-
}, age ?? /* @__PURE__ */
|
|
1049
|
+
}, age ?? /* @__PURE__ */ React16.createElement(Skeleton2, {
|
|
1028
1050
|
width: 115
|
|
1029
1051
|
}))));
|
|
1030
1052
|
}, "BlockEpochTableCellInner");
|
|
1031
1053
|
|
|
1032
1054
|
// src/components/block/table/cell/Hash.tsx
|
|
1033
|
-
import { Link, TableCell as TableCell3, Tooltip as Tooltip3 } from "@mui/material";
|
|
1034
|
-
import { isHash as isHash2 } from "@xylabs/
|
|
1055
|
+
import { Link as Link2, TableCell as TableCell3, Tooltip as Tooltip3 } from "@mui/material";
|
|
1056
|
+
import { isHash as isHash2 } from "@xylabs/sdk-js";
|
|
1035
1057
|
import { usePayloadRootHash } from "@xyo-network/react-shared";
|
|
1036
|
-
import
|
|
1058
|
+
import React18, { useState as useState9 } from "react";
|
|
1037
1059
|
|
|
1038
1060
|
// src/components/FeatureNotAvailable.tsx
|
|
1039
1061
|
import { Button as Button2, Dialog, DialogActions, DialogContent, DialogTitle } from "@mui/material";
|
|
1040
|
-
import
|
|
1041
|
-
var FeatureNotAvailable = /* @__PURE__ */ __name(({ featureName = "Feature", ...props }) => /* @__PURE__ */
|
|
1062
|
+
import React17 from "react";
|
|
1063
|
+
var FeatureNotAvailable = /* @__PURE__ */ __name(({ featureName = "Feature", ...props }) => /* @__PURE__ */ React17.createElement(Dialog, props, /* @__PURE__ */ React17.createElement(DialogTitle, null, `${featureName} Not Available`), /* @__PURE__ */ React17.createElement(DialogContent, null, "This feature is not currently available. Either you do not have access to it or it is currently undergoing maintenance."), /* @__PURE__ */ React17.createElement(DialogActions, null, /* @__PURE__ */ React17.createElement(Button2, {
|
|
1042
1064
|
onClick: /* @__PURE__ */ __name((e) => props.onClose?.(e, "backdropClick"), "onClick")
|
|
1043
1065
|
}, "Close"))), "FeatureNotAvailable");
|
|
1044
1066
|
|
|
1045
1067
|
// src/components/block/table/cell/hooks/useLinkedBlockItem.tsx
|
|
1046
|
-
import { useEvent as
|
|
1068
|
+
import { useEvent as useEvent3 } from "@xyo-network/react-event";
|
|
1047
1069
|
var useLinkedBlockItem = /* @__PURE__ */ __name((noun, data) => {
|
|
1048
|
-
const [ref, dispatch] =
|
|
1070
|
+
const [ref, dispatch] = useEvent3();
|
|
1049
1071
|
const handleClick = /* @__PURE__ */ __name((event) => {
|
|
1050
1072
|
event.preventDefault();
|
|
1051
1073
|
event.stopPropagation();
|
|
@@ -1071,17 +1093,17 @@ var BlockHashTableCell = /* @__PURE__ */ __name(({ block, notAvailableDialog, li
|
|
|
1071
1093
|
const [ref, handleClick] = useLinkedBlockItem("block-hash", hash);
|
|
1072
1094
|
const [notAvailable, setNotAvailable] = useState9(false);
|
|
1073
1095
|
const shortenedHash = isHash2(hash) ? `${hash.slice(0, 4)}...${hash.slice(-5, -1)}` : void 0;
|
|
1074
|
-
return /* @__PURE__ */
|
|
1096
|
+
return /* @__PURE__ */ React18.createElement(TableCell3, {
|
|
1075
1097
|
ref,
|
|
1076
1098
|
...props
|
|
1077
|
-
}, /* @__PURE__ */
|
|
1099
|
+
}, /* @__PURE__ */ React18.createElement(Tooltip3, {
|
|
1078
1100
|
title: `Block Hash: ${hash}`
|
|
1079
|
-
}, linked ? /* @__PURE__ */
|
|
1101
|
+
}, linked ? /* @__PURE__ */ React18.createElement(Link2, {
|
|
1080
1102
|
sx: {
|
|
1081
1103
|
cursor: "pointer"
|
|
1082
1104
|
},
|
|
1083
1105
|
onClick: linked ? handleClick : () => setNotAvailable(true)
|
|
1084
|
-
}, shortenedHash ?? /* @__PURE__ */
|
|
1106
|
+
}, shortenedHash ?? /* @__PURE__ */ React18.createElement(ChipSkeleton, null)) : /* @__PURE__ */ React18.createElement("span", null, shortenedHash ?? /* @__PURE__ */ React18.createElement(ChipSkeleton, null))), notAvailableDialog && notAvailable ? /* @__PURE__ */ React18.createElement(FeatureNotAvailable, {
|
|
1085
1107
|
featureName: "Block Details",
|
|
1086
1108
|
open: notAvailable,
|
|
1087
1109
|
onClick: /* @__PURE__ */ __name(() => setNotAvailable(false), "onClick")
|
|
@@ -1091,36 +1113,35 @@ var BlockHashTableCell = /* @__PURE__ */ __name(({ block, notAvailableDialog, li
|
|
|
1091
1113
|
// src/components/block/table/cell/JsonView.tsx
|
|
1092
1114
|
import { DataObject } from "@mui/icons-material";
|
|
1093
1115
|
import { Button as Button3, Dialog as Dialog2, DialogActions as DialogActions2, DialogContent as DialogContent2, DialogTitle as DialogTitle2, IconButton as IconButton2, TableCell as TableCell4 } from "@mui/material";
|
|
1094
|
-
import { ellipsize } from "@xylabs/eth-address";
|
|
1095
|
-
import { isHash as isHash3 } from "@xylabs/hex";
|
|
1096
1116
|
import { FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
|
|
1117
|
+
import { ellipsize, isHash as isHash3 } from "@xylabs/sdk-js";
|
|
1097
1118
|
import { JsonViewerEx } from "@xyo-network/react-payload-raw-info";
|
|
1098
1119
|
import { usePayloadRootHash as usePayloadRootHash2 } from "@xyo-network/react-shared";
|
|
1099
|
-
import
|
|
1120
|
+
import React19, { useState as useState10 } from "react";
|
|
1100
1121
|
var BlockJsonViewTableCell = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
1101
1122
|
const [open, setOpen] = useState10(false);
|
|
1102
1123
|
const onClose = /* @__PURE__ */ __name(() => setOpen(false), "onClose");
|
|
1103
1124
|
const hash = usePayloadRootHash2(block?.[0]);
|
|
1104
1125
|
const title = isHash3(hash) ? `JSON for ${ellipsize(hash, 5)}` : "JSON";
|
|
1105
|
-
return /* @__PURE__ */
|
|
1126
|
+
return /* @__PURE__ */ React19.createElement(TableCell4, props, /* @__PURE__ */ React19.createElement(FlexRow3, {
|
|
1106
1127
|
onClick: /* @__PURE__ */ __name((e) => e.stopPropagation(), "onClick"),
|
|
1107
1128
|
sx: {
|
|
1108
1129
|
width: "100%"
|
|
1109
1130
|
}
|
|
1110
|
-
}, /* @__PURE__ */
|
|
1131
|
+
}, /* @__PURE__ */ React19.createElement(IconButton2, {
|
|
1111
1132
|
onClick: /* @__PURE__ */ __name(() => setOpen(true), "onClick")
|
|
1112
|
-
}, /* @__PURE__ */
|
|
1133
|
+
}, /* @__PURE__ */ React19.createElement(DataObject, null)), /* @__PURE__ */ React19.createElement(Dialog2, {
|
|
1113
1134
|
open,
|
|
1114
1135
|
onClose
|
|
1115
|
-
}, /* @__PURE__ */
|
|
1136
|
+
}, /* @__PURE__ */ React19.createElement(DialogTitle2, null, title), /* @__PURE__ */ React19.createElement(DialogContent2, null, /* @__PURE__ */ React19.createElement(JsonViewerEx, {
|
|
1116
1137
|
value: block
|
|
1117
|
-
})), /* @__PURE__ */
|
|
1138
|
+
})), /* @__PURE__ */ React19.createElement(DialogActions2, {
|
|
1118
1139
|
sx: {
|
|
1119
1140
|
display: "flex",
|
|
1120
1141
|
flexDirection: "row",
|
|
1121
1142
|
justifyContent: "end"
|
|
1122
1143
|
}
|
|
1123
|
-
}, /* @__PURE__ */
|
|
1144
|
+
}, /* @__PURE__ */ React19.createElement(Button3, {
|
|
1124
1145
|
variant: "contained",
|
|
1125
1146
|
onClick: onClose
|
|
1126
1147
|
}, "Close")))));
|
|
@@ -1128,8 +1149,8 @@ var BlockJsonViewTableCell = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
|
1128
1149
|
|
|
1129
1150
|
// src/components/block/table/cell/PayloadCounts.tsx
|
|
1130
1151
|
import { Error as Error2 } from "@mui/icons-material";
|
|
1131
|
-
import { Link as
|
|
1132
|
-
import
|
|
1152
|
+
import { Link as Link3, TableCell as TableCell5, Tooltip as Tooltip4 } from "@mui/material";
|
|
1153
|
+
import React20 from "react";
|
|
1133
1154
|
var BlockPayloadCountsTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
1134
1155
|
const [publicPayloads, privatePayloads, error] = usePayloadCountsFromBlock(block);
|
|
1135
1156
|
const data = block && privatePayloads !== void 0 && publicPayloads !== void 0 ? {
|
|
@@ -1139,32 +1160,32 @@ var BlockPayloadCountsTableCell = /* @__PURE__ */ __name(({ block, linked, ...pr
|
|
|
1139
1160
|
} : void 0;
|
|
1140
1161
|
const payloadCount = (publicPayloads ?? 0) + (privatePayloads ?? 0);
|
|
1141
1162
|
const [ref, handleClick] = useLinkedBlockItem("payload-counts", data);
|
|
1142
|
-
return /* @__PURE__ */
|
|
1163
|
+
return /* @__PURE__ */ React20.createElement(TableCell5, {
|
|
1143
1164
|
ref,
|
|
1144
1165
|
...props
|
|
1145
|
-
}, /* @__PURE__ */
|
|
1166
|
+
}, /* @__PURE__ */ React20.createElement("span", null, error ? /* @__PURE__ */ React20.createElement(Tooltip4, {
|
|
1146
1167
|
title: error.message
|
|
1147
|
-
}, /* @__PURE__ */
|
|
1168
|
+
}, /* @__PURE__ */ React20.createElement(Error2, {
|
|
1148
1169
|
color: "error"
|
|
1149
|
-
})) : null, linked ? /* @__PURE__ */
|
|
1170
|
+
})) : null, linked ? /* @__PURE__ */ React20.createElement(Tooltip4, {
|
|
1150
1171
|
title: `Public Payloads: ${publicPayloads ?? "--"} Private Payloads: ${privatePayloads ?? "--"}`
|
|
1151
|
-
}, /* @__PURE__ */
|
|
1172
|
+
}, /* @__PURE__ */ React20.createElement(Link3, {
|
|
1152
1173
|
onClick: handleClick,
|
|
1153
1174
|
sx: {
|
|
1154
1175
|
cursor: "pointer"
|
|
1155
1176
|
}
|
|
1156
|
-
}, payloadCount)) : /* @__PURE__ */
|
|
1177
|
+
}, payloadCount)) : /* @__PURE__ */ React20.createElement(Tooltip4, {
|
|
1157
1178
|
title: `Public Payloads: ${publicPayloads ?? "--"} Private Payloads: ${privatePayloads ?? "--"}`
|
|
1158
|
-
}, /* @__PURE__ */
|
|
1179
|
+
}, /* @__PURE__ */ React20.createElement("span", null, payloadCount))));
|
|
1159
1180
|
}, "BlockPayloadCountsTableCell");
|
|
1160
1181
|
|
|
1161
1182
|
// src/components/block/table/cell/Producer.tsx
|
|
1162
1183
|
import { TableCell as TableCell6, Tooltip as Tooltip5 } from "@mui/material";
|
|
1163
|
-
import
|
|
1184
|
+
import React21, { useState as useState11 } from "react";
|
|
1164
1185
|
var BlockProducerTableCell = /* @__PURE__ */ __name(({ block, linked, notAvailableDialog, producerChipProps, ...props }) => {
|
|
1165
1186
|
const [ref, handleClick] = useLinkedBlockItem("block-producer", JSON.stringify(block));
|
|
1166
1187
|
const producer = useBlockProducer(block);
|
|
1167
|
-
return /* @__PURE__ */
|
|
1188
|
+
return /* @__PURE__ */ React21.createElement(BlockProducerTableCellInner, {
|
|
1168
1189
|
address: producer,
|
|
1169
1190
|
handleClick,
|
|
1170
1191
|
linked,
|
|
@@ -1176,9 +1197,9 @@ var BlockProducerTableCell = /* @__PURE__ */ __name(({ block, linked, notAvailab
|
|
|
1176
1197
|
}, "BlockProducerTableCell");
|
|
1177
1198
|
var BlockProducerTableCellInner = /* @__PURE__ */ __name(({ address, handleClick, linked, notAvailableDialog, producerChipProps, ...props }) => {
|
|
1178
1199
|
const [notAvailable, setNotAvailable] = useState11(false);
|
|
1179
|
-
return /* @__PURE__ */
|
|
1200
|
+
return /* @__PURE__ */ React21.createElement(TableCell6, props, /* @__PURE__ */ React21.createElement(Tooltip5, {
|
|
1180
1201
|
title: `Block Producer: ${address}`
|
|
1181
|
-
}, /* @__PURE__ */
|
|
1202
|
+
}, /* @__PURE__ */ React21.createElement(BlockAddressChip, {
|
|
1182
1203
|
sx: {
|
|
1183
1204
|
cursor: "pointer"
|
|
1184
1205
|
},
|
|
@@ -1186,7 +1207,7 @@ var BlockProducerTableCellInner = /* @__PURE__ */ __name(({ address, handleClick
|
|
|
1186
1207
|
address,
|
|
1187
1208
|
toolTipTitle: `Block Producer: ${address}`,
|
|
1188
1209
|
...producerChipProps
|
|
1189
|
-
})), notAvailableDialog && notAvailable ? /* @__PURE__ */
|
|
1210
|
+
})), notAvailableDialog && notAvailable ? /* @__PURE__ */ React21.createElement(FeatureNotAvailable, {
|
|
1190
1211
|
featureName: "Producer Details",
|
|
1191
1212
|
open: notAvailable,
|
|
1192
1213
|
onClick: /* @__PURE__ */ __name(() => setNotAvailable(false), "onClick")
|
|
@@ -1195,8 +1216,8 @@ var BlockProducerTableCellInner = /* @__PURE__ */ __name(({ address, handleClick
|
|
|
1195
1216
|
|
|
1196
1217
|
// src/components/block/table/cell/TransactionCount.tsx
|
|
1197
1218
|
import { Error as Error3 } from "@mui/icons-material";
|
|
1198
|
-
import { Link as
|
|
1199
|
-
import
|
|
1219
|
+
import { Link as Link4, TableCell as TableCell7, Tooltip as Tooltip6 } from "@mui/material";
|
|
1220
|
+
import React22, { useMemo as useMemo8 } from "react";
|
|
1200
1221
|
var BlockTransactionCountTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
1201
1222
|
const [transactions, error] = useTxsFromBlock(block);
|
|
1202
1223
|
const txHashes = useMemo8(() => transactions?.map(([, hash]) => hash), [
|
|
@@ -1207,14 +1228,14 @@ var BlockTransactionCountTableCell = /* @__PURE__ */ __name(({ block, linked, ..
|
|
|
1207
1228
|
block: block[0]._hash
|
|
1208
1229
|
} : void 0;
|
|
1209
1230
|
const [ref, handleClick] = useLinkedBlockItem("transaction-count", data);
|
|
1210
|
-
return /* @__PURE__ */
|
|
1231
|
+
return /* @__PURE__ */ React22.createElement(TableCell7, {
|
|
1211
1232
|
ref,
|
|
1212
1233
|
...props
|
|
1213
|
-
}, /* @__PURE__ */
|
|
1234
|
+
}, /* @__PURE__ */ React22.createElement("span", null, error ? /* @__PURE__ */ React22.createElement(Tooltip6, {
|
|
1214
1235
|
title: error.message
|
|
1215
|
-
}, /* @__PURE__ */
|
|
1236
|
+
}, /* @__PURE__ */ React22.createElement(Error3, {
|
|
1216
1237
|
color: "error"
|
|
1217
|
-
})) : null, linked ? /* @__PURE__ */
|
|
1238
|
+
})) : null, linked ? /* @__PURE__ */ React22.createElement(Link4, {
|
|
1218
1239
|
onClick: handleClick,
|
|
1219
1240
|
sx: {
|
|
1220
1241
|
cursor: "pointer"
|
|
@@ -1227,17 +1248,17 @@ import { CheckCircleOutlineRounded } from "@mui/icons-material";
|
|
|
1227
1248
|
import { TableCell as TableCell8 } from "@mui/material";
|
|
1228
1249
|
import { FlexRow as FlexRow4 } from "@xylabs/react-flexbox";
|
|
1229
1250
|
import { BWVerification as BWVerification2 } from "@xyo-network/react-boundwitness-plugin";
|
|
1230
|
-
import
|
|
1251
|
+
import React23 from "react";
|
|
1231
1252
|
var BlockVerificationTableCell = /* @__PURE__ */ __name(({ block, linked, deepValidation, ...props }) => {
|
|
1232
|
-
return /* @__PURE__ */
|
|
1253
|
+
return /* @__PURE__ */ React23.createElement(TableCell8, props, /* @__PURE__ */ React23.createElement(FlexRow4, {
|
|
1233
1254
|
onClick: /* @__PURE__ */ __name((e) => e.stopPropagation(), "onClick"),
|
|
1234
1255
|
sx: {
|
|
1235
1256
|
width: "100%"
|
|
1236
1257
|
}
|
|
1237
|
-
}, deepValidation ? /* @__PURE__ */
|
|
1258
|
+
}, deepValidation ? /* @__PURE__ */ React23.createElement(BWVerification2, {
|
|
1238
1259
|
iconColors: true,
|
|
1239
1260
|
boundwitness: block?.[0]
|
|
1240
|
-
}) : /* @__PURE__ */
|
|
1261
|
+
}) : /* @__PURE__ */ React23.createElement(CheckCircleOutlineRounded, {
|
|
1241
1262
|
color: "success"
|
|
1242
1263
|
})));
|
|
1243
1264
|
}, "BlockVerificationTableCell");
|
|
@@ -1245,57 +1266,57 @@ var BlockVerificationTableCell = /* @__PURE__ */ __name(({ block, linked, deepVa
|
|
|
1245
1266
|
// src/components/block/table/Ex.tsx
|
|
1246
1267
|
import { TableBody } from "@mui/material";
|
|
1247
1268
|
import { TableEx } from "@xyo-network/react-table";
|
|
1248
|
-
import
|
|
1269
|
+
import React25 from "react";
|
|
1249
1270
|
|
|
1250
1271
|
// src/components/block/table/head/TableHead.tsx
|
|
1251
1272
|
import { InfoOutline } from "@mui/icons-material";
|
|
1252
1273
|
import { TableCell as TableCell9, TableHead, TableRow, Tooltip as Tooltip7, Typography as Typography5 } from "@mui/material";
|
|
1253
1274
|
import { FlexRow as FlexRow5 } from "@xylabs/react-flexbox";
|
|
1254
|
-
import
|
|
1275
|
+
import React24 from "react";
|
|
1255
1276
|
var ToolTipTableCell = /* @__PURE__ */ __name(({ children, align, title, ...props }) => {
|
|
1256
|
-
return /* @__PURE__ */
|
|
1277
|
+
return /* @__PURE__ */ React24.createElement(TableCell9, {
|
|
1257
1278
|
title,
|
|
1258
1279
|
...props
|
|
1259
|
-
}, /* @__PURE__ */
|
|
1280
|
+
}, /* @__PURE__ */ React24.createElement(FlexRow5, {
|
|
1260
1281
|
justifyContent: align
|
|
1261
|
-
}, /* @__PURE__ */
|
|
1282
|
+
}, /* @__PURE__ */ React24.createElement(Typography5, {
|
|
1262
1283
|
variant: "body2"
|
|
1263
|
-
}, children), "\xA0", /* @__PURE__ */
|
|
1284
|
+
}, children), "\xA0", /* @__PURE__ */ React24.createElement(Tooltip7, {
|
|
1264
1285
|
title
|
|
1265
|
-
}, /* @__PURE__ */
|
|
1286
|
+
}, /* @__PURE__ */ React24.createElement(InfoOutline, {
|
|
1266
1287
|
fontSize: "small"
|
|
1267
1288
|
}))));
|
|
1268
1289
|
}, "ToolTipTableCell");
|
|
1269
1290
|
var BlockchainTableHead = /* @__PURE__ */ __name(() => {
|
|
1270
|
-
return /* @__PURE__ */
|
|
1291
|
+
return /* @__PURE__ */ React24.createElement(TableHead, null, /* @__PURE__ */ React24.createElement(TableRow, null, /* @__PURE__ */ React24.createElement(ToolTipTableCell, {
|
|
1271
1292
|
align: "left",
|
|
1272
1293
|
title: "The block number that is included in the block"
|
|
1273
|
-
}, "Block"), /* @__PURE__ */
|
|
1294
|
+
}, "Block"), /* @__PURE__ */ React24.createElement(ToolTipTableCell, {
|
|
1274
1295
|
title: "The hash of the block",
|
|
1275
1296
|
sx: {
|
|
1276
1297
|
width: "20%"
|
|
1277
1298
|
}
|
|
1278
|
-
}, "Hash"), /* @__PURE__ */
|
|
1299
|
+
}, "Hash"), /* @__PURE__ */ React24.createElement(ToolTipTableCell, {
|
|
1279
1300
|
title: "The epoch of the block",
|
|
1280
1301
|
sx: {
|
|
1281
1302
|
width: "20%"
|
|
1282
1303
|
}
|
|
1283
|
-
}, "Epoch"), /* @__PURE__ */
|
|
1304
|
+
}, "Epoch"), /* @__PURE__ */ React24.createElement(ToolTipTableCell, {
|
|
1284
1305
|
align: "left",
|
|
1285
1306
|
title: "The address of the block producer that produced the block",
|
|
1286
1307
|
sx: {
|
|
1287
1308
|
width: "20%"
|
|
1288
1309
|
}
|
|
1289
|
-
}, "Block Producer"), /* @__PURE__ */
|
|
1310
|
+
}, "Block Producer"), /* @__PURE__ */ React24.createElement(ToolTipTableCell, {
|
|
1290
1311
|
align: "left",
|
|
1291
1312
|
title: "Count of transactions that are included in the block"
|
|
1292
|
-
}, "Transactions"), /* @__PURE__ */
|
|
1313
|
+
}, "Transactions"), /* @__PURE__ */ React24.createElement(ToolTipTableCell, {
|
|
1293
1314
|
align: "left",
|
|
1294
1315
|
title: "Count of public and private payload counts for the block"
|
|
1295
|
-
}, "Payloads"), /* @__PURE__ */
|
|
1316
|
+
}, "Payloads"), /* @__PURE__ */ React24.createElement(ToolTipTableCell, {
|
|
1296
1317
|
align: "center",
|
|
1297
1318
|
title: "The result of the local validation check for the block"
|
|
1298
|
-
}, "Valid"), /* @__PURE__ */
|
|
1319
|
+
}, "Valid"), /* @__PURE__ */ React24.createElement(ToolTipTableCell, {
|
|
1299
1320
|
align: "center",
|
|
1300
1321
|
title: "Link to display the raw JSON of the block"
|
|
1301
1322
|
}, "JSON")));
|
|
@@ -1303,10 +1324,10 @@ var BlockchainTableHead = /* @__PURE__ */ __name(() => {
|
|
|
1303
1324
|
|
|
1304
1325
|
// src/components/block/table/Ex.tsx
|
|
1305
1326
|
var BlockchainTableEx = /* @__PURE__ */ __name(({ ref, children, ...props }) => {
|
|
1306
|
-
return /* @__PURE__ */
|
|
1327
|
+
return /* @__PURE__ */ React25.createElement(TableEx, {
|
|
1307
1328
|
ref,
|
|
1308
1329
|
...props
|
|
1309
|
-
}, /* @__PURE__ */
|
|
1330
|
+
}, /* @__PURE__ */ React25.createElement(BlockchainTableHead, null), /* @__PURE__ */ React25.createElement(TableBody, null, children));
|
|
1310
1331
|
}, "BlockchainTableEx");
|
|
1311
1332
|
BlockchainTableEx.displayName = "BlockchainTableEx";
|
|
1312
1333
|
|
|
@@ -1314,7 +1335,7 @@ BlockchainTableEx.displayName = "BlockchainTableEx";
|
|
|
1314
1335
|
import { TableRow as TableRow2, useTheme } from "@mui/material";
|
|
1315
1336
|
import { alphaCss } from "@xylabs/react-theme";
|
|
1316
1337
|
import { usePayloadRootHash as usePayloadRootHash3 } from "@xyo-network/react-shared";
|
|
1317
|
-
import
|
|
1338
|
+
import React26, { useMemo as useMemo9 } from "react";
|
|
1318
1339
|
var BlockChainTableRow = /* @__PURE__ */ __name(({ block, deepValidation, defaultExpanded, linked, sx, ...props }) => {
|
|
1319
1340
|
const linkedTableCellProps = useMemo9(() => ({
|
|
1320
1341
|
block,
|
|
@@ -1331,7 +1352,7 @@ var BlockChainTableRow = /* @__PURE__ */ __name(({ block, deepValidation, defaul
|
|
|
1331
1352
|
const hash = usePayloadRootHash3(block?.[0]);
|
|
1332
1353
|
const [ref, handleClick] = useLinkedBlockItem("block-hash", hash);
|
|
1333
1354
|
const theme = useTheme();
|
|
1334
|
-
return /* @__PURE__ */
|
|
1355
|
+
return /* @__PURE__ */ React26.createElement(TableRow2, {
|
|
1335
1356
|
onClick: linked ? handleClick : void 0,
|
|
1336
1357
|
ref,
|
|
1337
1358
|
sx: {
|
|
@@ -1343,57 +1364,214 @@ var BlockChainTableRow = /* @__PURE__ */ __name(({ block, deepValidation, defaul
|
|
|
1343
1364
|
...sx
|
|
1344
1365
|
},
|
|
1345
1366
|
...props
|
|
1346
|
-
}, /* @__PURE__ */
|
|
1367
|
+
}, /* @__PURE__ */ React26.createElement(BlockNumberTableCell, {
|
|
1347
1368
|
align: "left",
|
|
1348
1369
|
...linkedTableCellProps
|
|
1349
|
-
}), /* @__PURE__ */
|
|
1370
|
+
}), /* @__PURE__ */ React26.createElement(BlockHashTableCell, {
|
|
1350
1371
|
align: "left",
|
|
1351
1372
|
...linkedTableCellProps
|
|
1352
|
-
}), /* @__PURE__ */
|
|
1373
|
+
}), /* @__PURE__ */ React26.createElement(BlockEpochTableCell, {
|
|
1353
1374
|
align: "left",
|
|
1354
1375
|
...linkedTableCellProps
|
|
1355
|
-
}), /* @__PURE__ */
|
|
1376
|
+
}), /* @__PURE__ */ React26.createElement(BlockProducerTableCell, {
|
|
1356
1377
|
align: "left",
|
|
1357
1378
|
...linkedTableCellProps
|
|
1358
|
-
}), /* @__PURE__ */
|
|
1379
|
+
}), /* @__PURE__ */ React26.createElement(BlockTransactionCountTableCell, {
|
|
1359
1380
|
align: "left",
|
|
1360
1381
|
...linkedTableCellProps
|
|
1361
|
-
}), /* @__PURE__ */
|
|
1382
|
+
}), /* @__PURE__ */ React26.createElement(BlockPayloadCountsTableCell, {
|
|
1362
1383
|
align: "left",
|
|
1363
1384
|
...linkedTableCellProps
|
|
1364
|
-
}), /* @__PURE__ */
|
|
1385
|
+
}), /* @__PURE__ */ React26.createElement(BlockVerificationTableCell, {
|
|
1365
1386
|
deepValidation,
|
|
1366
1387
|
...defaultTableCellProps
|
|
1367
|
-
}), /* @__PURE__ */
|
|
1388
|
+
}), /* @__PURE__ */ React26.createElement(BlockJsonViewTableCell, defaultTableCellProps));
|
|
1368
1389
|
}, "BlockChainTableRow");
|
|
1369
1390
|
|
|
1391
|
+
// src/components/account/table/AddressTableCell.tsx
|
|
1392
|
+
var AddressTableCell = /* @__PURE__ */ __name(({ address, linked, toolTipTitle, sx, ...props }) => {
|
|
1393
|
+
const [ref, dispatch] = useEvent4();
|
|
1394
|
+
const handleClick = /* @__PURE__ */ __name(() => dispatch("address", "click", address), "handleClick");
|
|
1395
|
+
return /* @__PURE__ */ React.createElement(TableCell10, {
|
|
1396
|
+
ref,
|
|
1397
|
+
sx: {
|
|
1398
|
+
cursor: linked ? "pointer" : "default",
|
|
1399
|
+
...sx
|
|
1400
|
+
},
|
|
1401
|
+
...props
|
|
1402
|
+
}, /* @__PURE__ */ React.createElement(Tooltip8, {
|
|
1403
|
+
title: toolTipTitle
|
|
1404
|
+
}, /* @__PURE__ */ React.createElement(BlockAddressChip, {
|
|
1405
|
+
address,
|
|
1406
|
+
onClick: handleClick
|
|
1407
|
+
})));
|
|
1408
|
+
}, "AddressTableCell");
|
|
1409
|
+
|
|
1410
|
+
// src/components/account/table/BalanceHistoryTable.tsx
|
|
1411
|
+
import { Table, TableBody as TableBody2, TableCell as TableCell13, TableHead as TableHead2, TableRow as TableRow4 } from "@mui/material";
|
|
1412
|
+
import { isDefined as isDefined5 } from "@xylabs/sdk-js";
|
|
1413
|
+
import React27 from "react";
|
|
1414
|
+
|
|
1415
|
+
// src/components/account/table/BalanceHistoryTableRow.tsx
|
|
1416
|
+
import { TableCell as TableCell12, TableRow as TableRow3 } from "@mui/material";
|
|
1417
|
+
import { RawInfoIconButton } from "@xyo-network/react-payload-raw-info";
|
|
1418
|
+
import { useMemo as useMemo10 } from "react";
|
|
1419
|
+
|
|
1420
|
+
// src/components/account/table/RawAmountTableCell.tsx
|
|
1421
|
+
import { Link as Link5, TableCell as TableCell11, Tooltip as Tooltip9 } from "@mui/material";
|
|
1422
|
+
import { isDefined as isDefined4, toHex as toHex3 } from "@xylabs/sdk-js";
|
|
1423
|
+
import { useEvent as useEvent5 } from "@xyo-network/react-event";
|
|
1424
|
+
import { XL1Amount } from "@xyo-network/xl1-protocol";
|
|
1425
|
+
var RawAmountTableCell = /* @__PURE__ */ __name(({ amount, linked, sx, type, ...props }) => {
|
|
1426
|
+
const [ref, dispatch] = useEvent5();
|
|
1427
|
+
const handleClick = /* @__PURE__ */ __name(() => dispatch("amount", "click", isDefined4(amount) ? toHex3(amount) : ""), "handleClick");
|
|
1428
|
+
const formatAmount = /* @__PURE__ */ __name((amount2) => {
|
|
1429
|
+
if (!isDefined4(amount2)) {
|
|
1430
|
+
return "N/A";
|
|
1431
|
+
}
|
|
1432
|
+
const xl1Amount = new XL1Amount(amount2);
|
|
1433
|
+
return xl1Amount.toString(void 0, {
|
|
1434
|
+
places: 18,
|
|
1435
|
+
maxDecimal: 12,
|
|
1436
|
+
maxCharacters: 12,
|
|
1437
|
+
minDecimals: 1,
|
|
1438
|
+
locale: navigator.language
|
|
1439
|
+
});
|
|
1440
|
+
}, "formatAmount");
|
|
1441
|
+
return /* @__PURE__ */ React.createElement(TableCell11, {
|
|
1442
|
+
ref,
|
|
1443
|
+
...props
|
|
1444
|
+
}, /* @__PURE__ */ React.createElement(Tooltip9, {
|
|
1445
|
+
title: `Raw Amount: ${amount}`
|
|
1446
|
+
}, linked ? /* @__PURE__ */ React.createElement(Link5, {
|
|
1447
|
+
onClick: handleClick,
|
|
1448
|
+
sx: {
|
|
1449
|
+
cursor: "pointer"
|
|
1450
|
+
}
|
|
1451
|
+
}, type === "send" ? "-" : "", formatAmount(amount)) : /* @__PURE__ */ React.createElement("span", null, type === "send" ? "-" : "", formatAmount(amount))));
|
|
1452
|
+
}, "RawAmountTableCell");
|
|
1453
|
+
|
|
1454
|
+
// src/components/account/table/BalanceHistoryTableRow.tsx
|
|
1455
|
+
var BalanceHistoryTableRow = /* @__PURE__ */ __name(({ linked, row, ...props }) => {
|
|
1456
|
+
const { amount, blockNumber, debug, from, key, timestamp, to, type, txHash } = row ?? {};
|
|
1457
|
+
const linkedTableCallProps = useMemo10(() => ({
|
|
1458
|
+
linked
|
|
1459
|
+
}), [
|
|
1460
|
+
linked
|
|
1461
|
+
]);
|
|
1462
|
+
return /* @__PURE__ */ React.createElement(TableRow3, {
|
|
1463
|
+
key,
|
|
1464
|
+
...props
|
|
1465
|
+
}, /* @__PURE__ */ React.createElement(TableCell12, null, txHash || "N/A"), /* @__PURE__ */ React.createElement(BlockNumberTableCellInner, {
|
|
1466
|
+
blockNumber,
|
|
1467
|
+
...linkedTableCallProps
|
|
1468
|
+
}), /* @__PURE__ */ React.createElement(BlockEpochTableCellInner, {
|
|
1469
|
+
epoch: timestamp,
|
|
1470
|
+
...linkedTableCallProps
|
|
1471
|
+
}), /* @__PURE__ */ React.createElement(AddressTableCell, {
|
|
1472
|
+
address: from,
|
|
1473
|
+
toolTipTitle: `From Address: ${from}`,
|
|
1474
|
+
...linkedTableCallProps
|
|
1475
|
+
}), /* @__PURE__ */ React.createElement(AddressTableCell, {
|
|
1476
|
+
address: to,
|
|
1477
|
+
toolTipTitle: `To Address: ${to}`,
|
|
1478
|
+
...linkedTableCallProps
|
|
1479
|
+
}), /* @__PURE__ */ React.createElement(RawAmountTableCell, {
|
|
1480
|
+
amount,
|
|
1481
|
+
type
|
|
1482
|
+
}), /* @__PURE__ */ React.createElement(TableCell12, null, /* @__PURE__ */ React.createElement(RawInfoIconButton, {
|
|
1483
|
+
rawValue: debug
|
|
1484
|
+
})));
|
|
1485
|
+
}, "BalanceHistoryTableRow");
|
|
1486
|
+
|
|
1487
|
+
// src/components/account/table/types/index.ts
|
|
1488
|
+
var TableHeadingLabels = [
|
|
1489
|
+
"Tx Hash",
|
|
1490
|
+
"BlockNumber",
|
|
1491
|
+
"Timestamp",
|
|
1492
|
+
"From",
|
|
1493
|
+
"To",
|
|
1494
|
+
"Amount",
|
|
1495
|
+
"Debug"
|
|
1496
|
+
];
|
|
1497
|
+
|
|
1498
|
+
// src/components/account/table/BalanceHistoryTable.tsx
|
|
1499
|
+
var AccountBalanceHistoryTable = /* @__PURE__ */ __name(({ history, linked, ...props }) => {
|
|
1500
|
+
return isDefined5(history) ? /* @__PURE__ */ React27.createElement(Table, props, /* @__PURE__ */ React27.createElement(TableHead2, null, /* @__PURE__ */ React27.createElement(TableRow4, null, TableHeadingLabels.map((heading) => /* @__PURE__ */ React27.createElement(TableCell13, {
|
|
1501
|
+
key: heading
|
|
1502
|
+
}, heading)))), /* @__PURE__ */ React27.createElement(TableBody2, null, history?.map((row) => /* @__PURE__ */ React27.createElement(BalanceHistoryTableRow, {
|
|
1503
|
+
key: row.key,
|
|
1504
|
+
linked,
|
|
1505
|
+
row
|
|
1506
|
+
})))) : null;
|
|
1507
|
+
}, "AccountBalanceHistoryTable");
|
|
1508
|
+
|
|
1509
|
+
// src/components/account/BalanceHistoryFlexbox.tsx
|
|
1510
|
+
var AccountBalanceHistoryFlexBox = /* @__PURE__ */ __name(({ address, refresh, viewer, ...props }) => {
|
|
1511
|
+
const [results, error] = useAccountBalanceHistory(address, viewer, refresh);
|
|
1512
|
+
const { history, balance, truncated } = results || {
|
|
1513
|
+
balance: [
|
|
1514
|
+
AttoXL1(0n),
|
|
1515
|
+
AttoXL1(0n)
|
|
1516
|
+
],
|
|
1517
|
+
history: void 0
|
|
1518
|
+
};
|
|
1519
|
+
const formatBalance = /* @__PURE__ */ __name((balance2) => {
|
|
1520
|
+
const xl1Amount = new XL1Amount2(balance2);
|
|
1521
|
+
return xl1Amount.toString(void 0, {
|
|
1522
|
+
places: 18,
|
|
1523
|
+
maxDecimal: 12,
|
|
1524
|
+
maxCharacters: 12,
|
|
1525
|
+
minDecimals: 1,
|
|
1526
|
+
locale: navigator.language
|
|
1527
|
+
});
|
|
1528
|
+
}, "formatBalance");
|
|
1529
|
+
const formatBalanceMagnitude = /* @__PURE__ */ __name((set) => {
|
|
1530
|
+
const [received, sent] = set;
|
|
1531
|
+
const netBalance = received - sent;
|
|
1532
|
+
return netBalance < 0n ? `-${formatBalance(sent - received)}` : formatBalance(netBalance);
|
|
1533
|
+
}, "formatBalanceMagnitude");
|
|
1534
|
+
return isDefined6(history) && isDefined6(address) ? /* @__PURE__ */ React28.createElement(FlexCol3, props, /* @__PURE__ */ React28.createElement(ErrorRender3, {
|
|
1535
|
+
error,
|
|
1536
|
+
scope: "AccountBalanceHistoryTable"
|
|
1537
|
+
}), /* @__PURE__ */ React28.createElement(Typography6, {
|
|
1538
|
+
variant: "h6",
|
|
1539
|
+
gutterBottom: true
|
|
1540
|
+
}, formatBalanceMagnitude(balance)), truncated ? /* @__PURE__ */ React28.createElement(Typography6, {
|
|
1541
|
+
variant: "caption",
|
|
1542
|
+
gutterBottom: true
|
|
1543
|
+
}, "Ranged Balance from", " ", history.at(-1).blockNumber, " ", "-", " ", history[0].blockNumber) : null, /* @__PURE__ */ React28.createElement(AccountBalanceHistoryTable, {
|
|
1544
|
+
history
|
|
1545
|
+
})) : null;
|
|
1546
|
+
}, "AccountBalanceHistoryFlexBox");
|
|
1547
|
+
|
|
1370
1548
|
// src/components/chain/controls/PollingControlsFlexbox.tsx
|
|
1371
1549
|
import { Autorenew, Pause } from "@mui/icons-material";
|
|
1372
|
-
import { Alert as Alert3, AlertTitle as AlertTitle2, Grow, Icon as Icon2, IconButton as IconButton4, Tooltip as
|
|
1550
|
+
import { Alert as Alert3, AlertTitle as AlertTitle2, Grow, Icon as Icon2, IconButton as IconButton4, Tooltip as Tooltip10 } from "@mui/material";
|
|
1373
1551
|
import { FlexRow as FlexRow6 } from "@xylabs/react-flexbox";
|
|
1374
|
-
import
|
|
1552
|
+
import React33, { memo } from "react";
|
|
1375
1553
|
|
|
1376
1554
|
// src/components/chain/stats/Dialog.tsx
|
|
1377
1555
|
import { QueryStats } from "@mui/icons-material";
|
|
1378
1556
|
import { Dialog as Dialog3, DialogContent as DialogContent3, DialogTitle as DialogTitle3, IconButton as IconButton3 } from "@mui/material";
|
|
1379
|
-
import
|
|
1557
|
+
import React31, { useState as useState12 } from "react";
|
|
1380
1558
|
|
|
1381
1559
|
// src/components/chain/stats/producer/ProducerFlexbox.tsx
|
|
1382
|
-
import { ListItem, styled, Typography as
|
|
1383
|
-
import { ErrorRender as
|
|
1384
|
-
import { FlexCol as
|
|
1560
|
+
import { ListItem, styled, Typography as Typography7 } from "@mui/material";
|
|
1561
|
+
import { ErrorRender as ErrorRender4 } from "@xylabs/react-error";
|
|
1562
|
+
import { FlexCol as FlexCol4 } from "@xylabs/react-flexbox";
|
|
1385
1563
|
import { isChainSummaryProducers } from "@xyo-network/chain-analyze";
|
|
1386
|
-
import
|
|
1564
|
+
import React30, { useMemo as useMemo11 } from "react";
|
|
1387
1565
|
|
|
1388
1566
|
// src/components/chain/stats/producer/Table.tsx
|
|
1389
|
-
import { Table, TableBody as
|
|
1567
|
+
import { Table as Table2, TableBody as TableBody3, TableCell as TableCell14, TableHead as TableHead3, TableRow as TableRow5, useTheme as useTheme2 } from "@mui/material";
|
|
1390
1568
|
import { BlockiesAvatar as BlockiesAvatar2 } from "@xyo-network/react-chain-blockies";
|
|
1391
|
-
import
|
|
1569
|
+
import React29 from "react";
|
|
1392
1570
|
var ChainProducerStatsTable = /* @__PURE__ */ __name(({ producers, ...props }) => {
|
|
1393
1571
|
const theme = useTheme2();
|
|
1394
|
-
return /* @__PURE__ */
|
|
1572
|
+
return /* @__PURE__ */ React29.createElement(Table2, props, /* @__PURE__ */ React29.createElement(TableHead3, null, /* @__PURE__ */ React29.createElement(TableRow5, null, /* @__PURE__ */ React29.createElement(TableCell14, null, "Address"), /* @__PURE__ */ React29.createElement(TableCell14, null, "Blocks Produced"), /* @__PURE__ */ React29.createElement(TableCell14, null, "Rewards Earned Produced"))), /* @__PURE__ */ React29.createElement(TableBody3, null, producers?.map((producer) => /* @__PURE__ */ React29.createElement(TableRow5, {
|
|
1395
1573
|
key: producer.address
|
|
1396
|
-
}, /* @__PURE__ */
|
|
1574
|
+
}, /* @__PURE__ */ React29.createElement(TableCell14, null, /* @__PURE__ */ React29.createElement(BlockiesAvatar2, {
|
|
1397
1575
|
blockiesOptions: {
|
|
1398
1576
|
seed: producer.address
|
|
1399
1577
|
},
|
|
@@ -1401,12 +1579,12 @@ var ChainProducerStatsTable = /* @__PURE__ */ __name(({ producers, ...props }) =
|
|
|
1401
1579
|
height: theme.spacing(2.75),
|
|
1402
1580
|
width: theme.spacing(2.75)
|
|
1403
1581
|
}
|
|
1404
|
-
})), /* @__PURE__ */
|
|
1582
|
+
})), /* @__PURE__ */ React29.createElement(TableCell14, null, producer.blocksProduced.toString()), /* @__PURE__ */ React29.createElement(TableCell14, null, producer.rewardsEarned.toString())))));
|
|
1405
1583
|
}, "ChainProducerStatsTable");
|
|
1406
1584
|
|
|
1407
1585
|
// src/components/chain/stats/producer/ProducerFlexbox.tsx
|
|
1408
1586
|
var BlockProducerStatsFlexbox = /* @__PURE__ */ __name(({ payload, ...props }) => {
|
|
1409
|
-
const [producer, producerError] =
|
|
1587
|
+
const [producer, producerError] = useMemo11(() => {
|
|
1410
1588
|
if (payload) {
|
|
1411
1589
|
return isChainSummaryProducers(payload) ? [
|
|
1412
1590
|
payload
|
|
@@ -1420,19 +1598,19 @@ var BlockProducerStatsFlexbox = /* @__PURE__ */ __name(({ payload, ...props }) =
|
|
|
1420
1598
|
}, [
|
|
1421
1599
|
payload
|
|
1422
1600
|
]);
|
|
1423
|
-
const producersArray =
|
|
1601
|
+
const producersArray = useMemo11(() => Object.values(producer?.producers ?? {}), [
|
|
1424
1602
|
producer
|
|
1425
1603
|
]);
|
|
1426
|
-
return /* @__PURE__ */
|
|
1604
|
+
return /* @__PURE__ */ React30.createElement(FlexCol4, {
|
|
1427
1605
|
alignItems: "start",
|
|
1428
1606
|
gap: 1,
|
|
1429
1607
|
...props
|
|
1430
|
-
}, /* @__PURE__ */
|
|
1608
|
+
}, /* @__PURE__ */ React30.createElement(ErrorRender4, {
|
|
1431
1609
|
error: producerError,
|
|
1432
1610
|
scope: "BlockProducerStatsFlexbox"
|
|
1433
|
-
}), /* @__PURE__ */
|
|
1611
|
+
}), /* @__PURE__ */ React30.createElement(Typography7, {
|
|
1434
1612
|
fontSize: "1rem"
|
|
1435
|
-
}, "Block Producers"), /* @__PURE__ */
|
|
1613
|
+
}, "Block Producers"), /* @__PURE__ */ React30.createElement(ChainProducerStatsTable, {
|
|
1436
1614
|
producers: producersArray
|
|
1437
1615
|
}));
|
|
1438
1616
|
}, "BlockProducerStatsFlexbox");
|
|
@@ -1444,18 +1622,18 @@ var StyledListItem = styled(ListItem)(() => ({
|
|
|
1444
1622
|
// src/components/chain/stats/Dialog.tsx
|
|
1445
1623
|
var ChainAnalyzerStatsDialog = /* @__PURE__ */ __name((props) => {
|
|
1446
1624
|
const { analyzers, statsUpdated } = useChainAnalyzersContext();
|
|
1447
|
-
return /* @__PURE__ */
|
|
1625
|
+
return /* @__PURE__ */ React31.createElement(Dialog3, props, /* @__PURE__ */ React31.createElement(DialogTitle3, null, "Chain Analysis"), /* @__PURE__ */ React31.createElement(DialogContent3, null, statsUpdated > 0 ? Object.entries(analyzers).map(([id2, analyzer]) => /* @__PURE__ */ React31.createElement("div", {
|
|
1448
1626
|
key: id2
|
|
1449
|
-
}, id2 === "producers" ? /* @__PURE__ */
|
|
1627
|
+
}, id2 === "producers" ? /* @__PURE__ */ React31.createElement(BlockProducerStatsFlexbox, {
|
|
1450
1628
|
payload: analyzer.result()
|
|
1451
1629
|
}) : null)) : null));
|
|
1452
1630
|
}, "ChainAnalyzerStatsDialog");
|
|
1453
1631
|
var ChainAnalyzerStatsDialogFromContext = /* @__PURE__ */ __name((props) => {
|
|
1454
1632
|
const [open, setOpen] = useState12(false);
|
|
1455
1633
|
const handleClose = /* @__PURE__ */ __name(() => setOpen(false), "handleClose");
|
|
1456
|
-
return /* @__PURE__ */
|
|
1634
|
+
return /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(IconButton3, {
|
|
1457
1635
|
onClick: /* @__PURE__ */ __name(() => setOpen(true), "onClick")
|
|
1458
|
-
}, /* @__PURE__ */
|
|
1636
|
+
}, /* @__PURE__ */ React31.createElement(QueryStats, null)), /* @__PURE__ */ React31.createElement(ChainAnalyzerStatsDialog, {
|
|
1459
1637
|
onClose: handleClose,
|
|
1460
1638
|
open,
|
|
1461
1639
|
...props
|
|
@@ -1464,19 +1642,19 @@ var ChainAnalyzerStatsDialogFromContext = /* @__PURE__ */ __name((props) => {
|
|
|
1464
1642
|
|
|
1465
1643
|
// src/components/chain/controls/PulseSvgIcon.tsx
|
|
1466
1644
|
import { createSvgIcon, keyframes, styled as styled2 } from "@mui/material";
|
|
1467
|
-
import
|
|
1468
|
-
var PulseSvgIcon = createSvgIcon(/* @__PURE__ */
|
|
1645
|
+
import React32 from "react";
|
|
1646
|
+
var PulseSvgIcon = createSvgIcon(/* @__PURE__ */ React32.createElement("svg", {
|
|
1469
1647
|
viewBox: "0 0 80 80",
|
|
1470
1648
|
version: "1.1",
|
|
1471
1649
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1472
|
-
}, /* @__PURE__ */
|
|
1650
|
+
}, /* @__PURE__ */ React32.createElement("g", {
|
|
1473
1651
|
transform: "translate(34,34)"
|
|
1474
|
-
}, /* @__PURE__ */
|
|
1652
|
+
}, /* @__PURE__ */ React32.createElement("circle", {
|
|
1475
1653
|
className: "core",
|
|
1476
1654
|
cx: "0",
|
|
1477
1655
|
cy: "0",
|
|
1478
1656
|
r: "6"
|
|
1479
|
-
}), /* @__PURE__ */
|
|
1657
|
+
}), /* @__PURE__ */ React32.createElement("circle", {
|
|
1480
1658
|
className: "radar",
|
|
1481
1659
|
cx: "0",
|
|
1482
1660
|
cy: "0",
|
|
@@ -1540,24 +1718,24 @@ var StyledPulseSvgIcon = styled2(PulseSvgIcon)(({ theme }) => {
|
|
|
1540
1718
|
var PollingControlsFlexbox = /* @__PURE__ */ __name(({ blocksBehind, pollingState, setPollingState }) => {
|
|
1541
1719
|
const paused = pollingState === "paused";
|
|
1542
1720
|
const running = pollingState === "running";
|
|
1543
|
-
return /* @__PURE__ */
|
|
1721
|
+
return /* @__PURE__ */ React33.createElement(FlexRow6, {
|
|
1544
1722
|
justifyContent: "space-between",
|
|
1545
1723
|
width: "100%"
|
|
1546
|
-
}, /* @__PURE__ */
|
|
1724
|
+
}, /* @__PURE__ */ React33.createElement(FlexRow6, {
|
|
1547
1725
|
gap: 2
|
|
1548
|
-
}, running ? /* @__PURE__ */
|
|
1726
|
+
}, running ? /* @__PURE__ */ React33.createElement(IconButton4, {
|
|
1549
1727
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("paused"), "onClick"),
|
|
1550
1728
|
title: "Pause Block Stream"
|
|
1551
|
-
}, /* @__PURE__ */
|
|
1729
|
+
}, /* @__PURE__ */ React33.createElement(Pause, null)) : null, paused ? /* @__PURE__ */ React33.createElement(IconButton4, {
|
|
1552
1730
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("running"), "onClick"),
|
|
1553
1731
|
title: "Re-Sync Block Stream"
|
|
1554
|
-
}, /* @__PURE__ */
|
|
1732
|
+
}, /* @__PURE__ */ React33.createElement(Autorenew, null)) : null, /* @__PURE__ */ React33.createElement(ChainAnalyzerStatsDialogFromContext, null)), /* @__PURE__ */ React33.createElement(FlexRow6, {
|
|
1555
1733
|
gap: 2
|
|
1556
|
-
}, /* @__PURE__ */
|
|
1734
|
+
}, /* @__PURE__ */ React33.createElement(Grow, {
|
|
1557
1735
|
in: (blocksBehind ?? 0) > 0
|
|
1558
|
-
}, /* @__PURE__ */
|
|
1736
|
+
}, /* @__PURE__ */ React33.createElement(Tooltip10, {
|
|
1559
1737
|
title: "Click to Re-Sync"
|
|
1560
|
-
}, /* @__PURE__ */
|
|
1738
|
+
}, /* @__PURE__ */ React33.createElement(Alert3, {
|
|
1561
1739
|
sx: {
|
|
1562
1740
|
py: 0,
|
|
1563
1741
|
px: 1,
|
|
@@ -1565,11 +1743,11 @@ var PollingControlsFlexbox = /* @__PURE__ */ __name(({ blocksBehind, pollingStat
|
|
|
1565
1743
|
},
|
|
1566
1744
|
severity: "warning",
|
|
1567
1745
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("running"), "onClick")
|
|
1568
|
-
}, /* @__PURE__ */
|
|
1746
|
+
}, /* @__PURE__ */ React33.createElement(AlertTitle2, {
|
|
1569
1747
|
sx: {
|
|
1570
1748
|
mb: 0
|
|
1571
1749
|
}
|
|
1572
|
-
}, "Behind:", " ", blocksBehind)))), /* @__PURE__ */
|
|
1750
|
+
}, "Behind:", " ", blocksBehind)))), /* @__PURE__ */ React33.createElement(Icon2, null, /* @__PURE__ */ React33.createElement(StyledPulseSvgIcon, {
|
|
1573
1751
|
className: running ? "" : "paused"
|
|
1574
1752
|
}))));
|
|
1575
1753
|
}, "PollingControlsFlexbox");
|
|
@@ -1577,12 +1755,12 @@ var MemoizedPollingControlsFlexbox = /* @__PURE__ */ memo(PollingControlsFlexbox
|
|
|
1577
1755
|
|
|
1578
1756
|
// src/components/chain/dialog/Dialog.tsx
|
|
1579
1757
|
import { Button as Button4, Dialog as Dialog4, DialogActions as DialogActions3, DialogContent as DialogContent4 } from "@mui/material";
|
|
1580
|
-
import
|
|
1758
|
+
import React34 from "react";
|
|
1581
1759
|
var TransactionsDialog = /* @__PURE__ */ __name(({ onClose, ...props }) => {
|
|
1582
|
-
return /* @__PURE__ */
|
|
1760
|
+
return /* @__PURE__ */ React34.createElement(Dialog4, {
|
|
1583
1761
|
onClose,
|
|
1584
1762
|
...props
|
|
1585
|
-
}, /* @__PURE__ */
|
|
1763
|
+
}, /* @__PURE__ */ React34.createElement(DialogContent4, null, "Transactions Dialog"), /* @__PURE__ */ React34.createElement(DialogActions3, null, /* @__PURE__ */ React34.createElement(Button4, {
|
|
1586
1764
|
variant: "outlined",
|
|
1587
1765
|
onClick: /* @__PURE__ */ __name((e) => onClose?.(e, "escapeKeyDown"), "onClick")
|
|
1588
1766
|
}, "Close")));
|
|
@@ -1622,9 +1800,9 @@ var useOnBlock = /* @__PURE__ */ __name((initialHeadNumber, onAddBlock, liveHead
|
|
|
1622
1800
|
|
|
1623
1801
|
// src/components/chain/pagination/BlockChainPagination.tsx
|
|
1624
1802
|
import { TablePaginationActions } from "@xyo-network/react-payload-table";
|
|
1625
|
-
import
|
|
1803
|
+
import React35 from "react";
|
|
1626
1804
|
var BlockChainPagination = /* @__PURE__ */ __name(({ count = 0, onPageChange, page, rowsPerPage = 10 }) => {
|
|
1627
|
-
return /* @__PURE__ */
|
|
1805
|
+
return /* @__PURE__ */ React35.createElement(TablePaginationActions, {
|
|
1628
1806
|
count,
|
|
1629
1807
|
onPageChange,
|
|
1630
1808
|
page,
|
|
@@ -1633,10 +1811,10 @@ var BlockChainPagination = /* @__PURE__ */ __name(({ count = 0, onPageChange, pa
|
|
|
1633
1811
|
}, "BlockChainPagination");
|
|
1634
1812
|
|
|
1635
1813
|
// src/components/chain/pagination/hooks/usePagination.tsx
|
|
1636
|
-
import { useMemo as
|
|
1814
|
+
import { useMemo as useMemo12, useState as useState13 } from "react";
|
|
1637
1815
|
var useChainPagination = /* @__PURE__ */ __name((pageSize, blockComponents) => {
|
|
1638
1816
|
const [page, setPage] = useState13(0);
|
|
1639
|
-
const paginatedBlockComponents =
|
|
1817
|
+
const paginatedBlockComponents = useMemo12(() => {
|
|
1640
1818
|
const startIndex = page * pageSize;
|
|
1641
1819
|
const endIndex = startIndex + pageSize;
|
|
1642
1820
|
return blockComponents?.slice(startIndex, endIndex);
|
|
@@ -1656,18 +1834,18 @@ var useChainPagination = /* @__PURE__ */ __name((pageSize, blockComponents) => {
|
|
|
1656
1834
|
}, "useChainPagination");
|
|
1657
1835
|
|
|
1658
1836
|
// src/components/chain/render/static/flexbox/variants/Base.tsx
|
|
1659
|
-
import { ErrorRender as
|
|
1660
|
-
import { FlexCol as
|
|
1661
|
-
import
|
|
1837
|
+
import { ErrorRender as ErrorRender5 } from "@xylabs/react-error";
|
|
1838
|
+
import { FlexCol as FlexCol6, FlexGrowRow as FlexGrowRow2 } from "@xylabs/react-flexbox";
|
|
1839
|
+
import React37 from "react";
|
|
1662
1840
|
|
|
1663
1841
|
// src/components/chain/list/Animated.tsx
|
|
1664
1842
|
import { AnimatedList } from "@xylabs/react-animation";
|
|
1665
|
-
import
|
|
1843
|
+
import React36 from "react";
|
|
1666
1844
|
|
|
1667
1845
|
// src/components/chain/styled/BlockListWrapperFlexbox.tsx
|
|
1668
1846
|
import { styled as styled3 } from "@mui/material";
|
|
1669
|
-
import { FlexCol as
|
|
1670
|
-
var BlockListWrapperFlexBox = styled3(
|
|
1847
|
+
import { FlexCol as FlexCol5 } from "@xylabs/react-flexbox";
|
|
1848
|
+
var BlockListWrapperFlexBox = styled3(FlexCol5, {
|
|
1671
1849
|
name: "BlockListWrapperFlexbox"
|
|
1672
1850
|
})(() => ({
|
|
1673
1851
|
"& > div:nth-of-type(2) .block-heading-flexbox .divider-spacer": {
|
|
@@ -1683,23 +1861,23 @@ var BlockListWrapperFlexBox = styled3(FlexCol4, {
|
|
|
1683
1861
|
|
|
1684
1862
|
// src/components/chain/list/Animated.tsx
|
|
1685
1863
|
var BlockListAnimated = /* @__PURE__ */ __name(({ blockChainRenderComponents }) => {
|
|
1686
|
-
return /* @__PURE__ */
|
|
1864
|
+
return /* @__PURE__ */ React36.createElement(BlockListWrapperFlexBox, {
|
|
1687
1865
|
alignItems: "stretch",
|
|
1688
1866
|
width: "100%"
|
|
1689
|
-
}, /* @__PURE__ */
|
|
1867
|
+
}, /* @__PURE__ */ React36.createElement(AnimatedList, {
|
|
1690
1868
|
fullWidth: true,
|
|
1691
1869
|
items: blockChainRenderComponents
|
|
1692
1870
|
}));
|
|
1693
1871
|
}, "BlockListAnimated");
|
|
1694
1872
|
|
|
1695
1873
|
// src/components/chain/render/static/hooks/useStaticBlockRenderComponents.ts
|
|
1696
|
-
import { exists } from "@xylabs/
|
|
1697
|
-
import { useMemo as
|
|
1874
|
+
import { exists } from "@xylabs/sdk-js";
|
|
1875
|
+
import { useMemo as useMemo13 } from "react";
|
|
1698
1876
|
var DEFAULT_PAGE_SIZE = 25;
|
|
1699
1877
|
var useStaticBlockRenderComponents = /* @__PURE__ */ __name((BlockComponent, blockChainRenderProps) => {
|
|
1700
1878
|
const { maxBlocks } = blockChainRenderProps ?? {};
|
|
1701
1879
|
const pageSize = blockChainRenderProps?.pageSize ?? DEFAULT_PAGE_SIZE;
|
|
1702
|
-
const chainIteratorParams =
|
|
1880
|
+
const chainIteratorParams = useMemo13(() => blockChainRenderProps ?? {
|
|
1703
1881
|
name: "unknown"
|
|
1704
1882
|
}, [
|
|
1705
1883
|
blockChainRenderProps
|
|
@@ -1725,35 +1903,35 @@ var useStaticBlockRenderComponents = /* @__PURE__ */ __name((BlockComponent, blo
|
|
|
1725
1903
|
// src/components/chain/render/static/flexbox/variants/Base.tsx
|
|
1726
1904
|
var StaticListBase = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }) => {
|
|
1727
1905
|
const { blockComponents, errors, paginatedBlockComponents, onPageChange, page, pageSize } = useStaticBlockRenderComponents(BlockHeadingFlexbox, blockChainRenderProps);
|
|
1728
|
-
return /* @__PURE__ */
|
|
1906
|
+
return /* @__PURE__ */ React37.createElement(FlexCol6, {
|
|
1729
1907
|
alignItems: "start",
|
|
1730
1908
|
gap: 2,
|
|
1731
1909
|
width: "100%",
|
|
1732
1910
|
...props
|
|
1733
|
-
}, errors?.map((error) => /* @__PURE__ */
|
|
1911
|
+
}, errors?.map((error) => /* @__PURE__ */ React37.createElement(ErrorRender5, {
|
|
1734
1912
|
error,
|
|
1735
1913
|
key: error.name,
|
|
1736
1914
|
scope: "StaticBlockchainFlexboxInner"
|
|
1737
|
-
})), (paginatedBlockComponents?.length ?? 0) > 0 ? /* @__PURE__ */
|
|
1915
|
+
})), (paginatedBlockComponents?.length ?? 0) > 0 ? /* @__PURE__ */ React37.createElement(FlexGrowRow2, {
|
|
1738
1916
|
justifyContent: "space-between",
|
|
1739
1917
|
width: "100%"
|
|
1740
|
-
}, /* @__PURE__ */
|
|
1918
|
+
}, /* @__PURE__ */ React37.createElement(ChainAnalyzerStatsDialogFromContext, null), /* @__PURE__ */ React37.createElement(BlockChainPagination, {
|
|
1741
1919
|
count: blockComponents?.length ?? 0,
|
|
1742
1920
|
onPageChange,
|
|
1743
1921
|
page,
|
|
1744
1922
|
rowsPerPage: pageSize
|
|
1745
|
-
})) : null, /* @__PURE__ */
|
|
1923
|
+
})) : null, /* @__PURE__ */ React37.createElement(BlockListAnimated, {
|
|
1746
1924
|
blockChainRenderComponents: paginatedBlockComponents
|
|
1747
1925
|
}));
|
|
1748
1926
|
}, "StaticListBase");
|
|
1749
1927
|
|
|
1750
1928
|
// src/components/chain/render/static/flexbox/variants/WithAnalysis.tsx
|
|
1751
|
-
import { isAddress } from "@xylabs/
|
|
1929
|
+
import { isAddress } from "@xylabs/sdk-js";
|
|
1752
1930
|
import { ChainProducersAnalyzer } from "@xyo-network/chain-analyze";
|
|
1753
|
-
import
|
|
1931
|
+
import React38, { useMemo as useMemo14 } from "react";
|
|
1754
1932
|
var WithAnalysis = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }) => {
|
|
1755
1933
|
const { chainId } = blockChainRenderProps ?? {};
|
|
1756
|
-
const analyzers =
|
|
1934
|
+
const analyzers = useMemo14(() => {
|
|
1757
1935
|
if (isAddress(chainId)) {
|
|
1758
1936
|
return {
|
|
1759
1937
|
producers: new ChainProducersAnalyzer()
|
|
@@ -1762,9 +1940,9 @@ var WithAnalysis = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props })
|
|
|
1762
1940
|
}, [
|
|
1763
1941
|
chainId
|
|
1764
1942
|
]);
|
|
1765
|
-
return /* @__PURE__ */
|
|
1943
|
+
return /* @__PURE__ */ React38.createElement(ChainAnalyzersProvider, {
|
|
1766
1944
|
analyzers
|
|
1767
|
-
}, /* @__PURE__ */
|
|
1945
|
+
}, /* @__PURE__ */ React38.createElement(StaticListBase, {
|
|
1768
1946
|
blockChainRenderProps,
|
|
1769
1947
|
...props
|
|
1770
1948
|
}));
|
|
@@ -1777,21 +1955,21 @@ var StaticBlockchainRenderFlexBox = {
|
|
|
1777
1955
|
};
|
|
1778
1956
|
|
|
1779
1957
|
// src/components/payload/builder/Flexbox.tsx
|
|
1780
|
-
import { FlexCol as
|
|
1958
|
+
import { FlexCol as FlexCol7 } from "@xylabs/react-flexbox";
|
|
1781
1959
|
import { JsonViewerEx as JsonViewerEx2 } from "@xyo-network/react-payload-raw-info";
|
|
1782
|
-
import
|
|
1960
|
+
import React39, { useState as useState14 } from "react";
|
|
1783
1961
|
var PayloadBuilderFlexbox = /* @__PURE__ */ __name(({ BuilderComponent, onBuild, ...props }) => {
|
|
1784
1962
|
const [payload, setPayload] = useState14();
|
|
1785
1963
|
const onBuildLocal = /* @__PURE__ */ __name((payload2) => {
|
|
1786
1964
|
onBuild?.(payload2);
|
|
1787
1965
|
setPayload(payload2);
|
|
1788
1966
|
}, "onBuildLocal");
|
|
1789
|
-
return /* @__PURE__ */
|
|
1967
|
+
return /* @__PURE__ */ React39.createElement(FlexCol7, {
|
|
1790
1968
|
gap: 2,
|
|
1791
1969
|
...props
|
|
1792
|
-
}, /* @__PURE__ */
|
|
1970
|
+
}, /* @__PURE__ */ React39.createElement(BuilderComponent, {
|
|
1793
1971
|
onBuild: onBuildLocal
|
|
1794
|
-
}), payload ? /* @__PURE__ */
|
|
1972
|
+
}), payload ? /* @__PURE__ */ React39.createElement(JsonViewerEx2, {
|
|
1795
1973
|
value: payload
|
|
1796
1974
|
}) : null);
|
|
1797
1975
|
}, "PayloadBuilderFlexbox");
|
|
@@ -1799,11 +1977,11 @@ var PayloadBuilderFlexbox = /* @__PURE__ */ __name(({ BuilderComponent, onBuild,
|
|
|
1799
1977
|
// src/components/payload/builder/producer-intent/Form.tsx
|
|
1800
1978
|
import { Button as Button5, FormControl as FormControl5 } from "@mui/material";
|
|
1801
1979
|
import { createProducerChainStakeIntent } from "@xyo-network/chain-protocol";
|
|
1802
|
-
import
|
|
1980
|
+
import React42, { useMemo as useMemo16, useState as useState17 } from "react";
|
|
1803
1981
|
|
|
1804
1982
|
// src/components/payload/fields/BlockNumberTextField.tsx
|
|
1805
1983
|
import { FormControl as FormControl3, FormHelperText as FormHelperText2, TextField as TextField3 } from "@mui/material";
|
|
1806
|
-
import
|
|
1984
|
+
import React40, { useState as useState15 } from "react";
|
|
1807
1985
|
var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumberChanged, onChange, ...props }) => {
|
|
1808
1986
|
const [blockNumber, setBlockNumber] = useState15();
|
|
1809
1987
|
const handleChange = /* @__PURE__ */ __name((e) => {
|
|
@@ -1813,15 +1991,15 @@ var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumber
|
|
|
1813
1991
|
onChange?.(e);
|
|
1814
1992
|
}, "handleChange");
|
|
1815
1993
|
const errored = errorMessage !== void 0;
|
|
1816
|
-
return /* @__PURE__ */
|
|
1994
|
+
return /* @__PURE__ */ React40.createElement(FormControl3, {
|
|
1817
1995
|
fullWidth: true
|
|
1818
|
-
}, /* @__PURE__ */
|
|
1996
|
+
}, /* @__PURE__ */ React40.createElement(TextField3, {
|
|
1819
1997
|
error: errored,
|
|
1820
1998
|
onChange: handleChange,
|
|
1821
1999
|
type: "number",
|
|
1822
2000
|
value: blockNumber ?? "",
|
|
1823
2001
|
...props
|
|
1824
|
-
}), errored ? /* @__PURE__ */
|
|
2002
|
+
}), errored ? /* @__PURE__ */ React40.createElement(FormHelperText2, {
|
|
1825
2003
|
sx: {
|
|
1826
2004
|
color: "error.main"
|
|
1827
2005
|
}
|
|
@@ -1830,12 +2008,12 @@ var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumber
|
|
|
1830
2008
|
|
|
1831
2009
|
// src/components/payload/fields/XyoAddressTextField.tsx
|
|
1832
2010
|
import { FormControl as FormControl4, FormHelperText as FormHelperText3, TextField as TextField4 } from "@mui/material";
|
|
1833
|
-
import { asAddress, isAddress as isAddress2 } from "@xylabs/
|
|
1834
|
-
import
|
|
2011
|
+
import { asAddress, isAddress as isAddress2 } from "@xylabs/sdk-js";
|
|
2012
|
+
import React41, { useMemo as useMemo15, useState as useState16 } from "react";
|
|
1835
2013
|
var XyoAddressTextField = /* @__PURE__ */ __name(({ onAddressChanged, onChange, resetValue, ...props }) => {
|
|
1836
2014
|
const [address, setAddress] = useState16("");
|
|
1837
2015
|
const [addressError, setAddressError] = useState16();
|
|
1838
|
-
|
|
2016
|
+
useMemo15(() => setAddress(""), [
|
|
1839
2017
|
resetValue
|
|
1840
2018
|
]);
|
|
1841
2019
|
const handleChange = /* @__PURE__ */ __name((event) => {
|
|
@@ -1855,15 +2033,15 @@ var XyoAddressTextField = /* @__PURE__ */ __name(({ onAddressChanged, onChange,
|
|
|
1855
2033
|
onAddressChanged?.();
|
|
1856
2034
|
}
|
|
1857
2035
|
}, "handleBlur");
|
|
1858
|
-
return /* @__PURE__ */
|
|
2036
|
+
return /* @__PURE__ */ React41.createElement(FormControl4, {
|
|
1859
2037
|
fullWidth: true
|
|
1860
|
-
}, /* @__PURE__ */
|
|
2038
|
+
}, /* @__PURE__ */ React41.createElement(TextField4, {
|
|
1861
2039
|
error: !!addressError,
|
|
1862
2040
|
onBlur: handleBlur,
|
|
1863
2041
|
onChange: handleChange,
|
|
1864
2042
|
value: address,
|
|
1865
2043
|
...props
|
|
1866
|
-
}), addressError ? /* @__PURE__ */
|
|
2044
|
+
}), addressError ? /* @__PURE__ */ React41.createElement(FormHelperText3, {
|
|
1867
2045
|
sx: {
|
|
1868
2046
|
color: "error.main"
|
|
1869
2047
|
}
|
|
@@ -1876,7 +2054,7 @@ var ProducerIntentBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
1876
2054
|
const [exp, setExp] = useState17();
|
|
1877
2055
|
const [nbf, setNbf] = useState17();
|
|
1878
2056
|
const [blockRangeError, setBlockRangeError] = useState17();
|
|
1879
|
-
const intentPayload =
|
|
2057
|
+
const intentPayload = useMemo16(() => {
|
|
1880
2058
|
if (exp !== void 0 && nbf !== void 0) {
|
|
1881
2059
|
if (exp <= nbf) {
|
|
1882
2060
|
setBlockRangeError(new Error("Expires must be greater than Not Before"));
|
|
@@ -1896,33 +2074,33 @@ var ProducerIntentBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
1896
2074
|
const onBuildLocal = /* @__PURE__ */ __name(() => {
|
|
1897
2075
|
if (onBuild && intentPayload) onBuild?.(intentPayload);
|
|
1898
2076
|
}, "onBuildLocal");
|
|
1899
|
-
return /* @__PURE__ */
|
|
2077
|
+
return /* @__PURE__ */ React42.createElement(React42.Fragment, null, /* @__PURE__ */ React42.createElement(FormControl5, {
|
|
1900
2078
|
fullWidth: true
|
|
1901
|
-
}, /* @__PURE__ */
|
|
2079
|
+
}, /* @__PURE__ */ React42.createElement(XyoAddressTextField, {
|
|
1902
2080
|
label: "Delegate",
|
|
1903
2081
|
name: "delegate",
|
|
1904
2082
|
onAddressChanged: setDelegate,
|
|
1905
2083
|
required: true,
|
|
1906
2084
|
size: "small"
|
|
1907
|
-
})), /* @__PURE__ */
|
|
2085
|
+
})), /* @__PURE__ */ React42.createElement(FormControl5, {
|
|
1908
2086
|
fullWidth: true
|
|
1909
|
-
}, /* @__PURE__ */
|
|
2087
|
+
}, /* @__PURE__ */ React42.createElement(BlockNumberTextField, {
|
|
1910
2088
|
errorMessage: blockRangeError?.message,
|
|
1911
2089
|
label: "Expires",
|
|
1912
2090
|
name: "exp",
|
|
1913
2091
|
onBlockNumberChanged: setExp,
|
|
1914
2092
|
required: true,
|
|
1915
2093
|
size: "small"
|
|
1916
|
-
})), /* @__PURE__ */
|
|
2094
|
+
})), /* @__PURE__ */ React42.createElement(FormControl5, {
|
|
1917
2095
|
fullWidth: true
|
|
1918
|
-
}, /* @__PURE__ */
|
|
2096
|
+
}, /* @__PURE__ */ React42.createElement(BlockNumberTextField, {
|
|
1919
2097
|
errorMessage: blockRangeError?.message,
|
|
1920
2098
|
label: "Not Before",
|
|
1921
2099
|
name: "nbf",
|
|
1922
2100
|
onBlockNumberChanged: setNbf,
|
|
1923
2101
|
required: true,
|
|
1924
2102
|
size: "small"
|
|
1925
|
-
})), /* @__PURE__ */
|
|
2103
|
+
})), /* @__PURE__ */ React42.createElement(Button5, {
|
|
1926
2104
|
disabled: !intentPayload,
|
|
1927
2105
|
variant: "contained",
|
|
1928
2106
|
onClick: onBuildLocal
|
|
@@ -1930,29 +2108,29 @@ var ProducerIntentBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
1930
2108
|
}, "ProducerIntentBuilderForm");
|
|
1931
2109
|
|
|
1932
2110
|
// src/components/payload/builder/transfer/Flexbox.tsx
|
|
1933
|
-
import
|
|
2111
|
+
import React45 from "react";
|
|
1934
2112
|
|
|
1935
2113
|
// src/components/payload/builder/transfer/Form.tsx
|
|
1936
2114
|
import { Button as Button6, FormControl as FormControl7 } from "@mui/material";
|
|
1937
|
-
import { isAddress as isAddress4 } from "@xylabs/
|
|
2115
|
+
import { isAddress as isAddress4 } from "@xylabs/sdk-js";
|
|
1938
2116
|
import { TransferSchema } from "@xyo-network/xl1-protocol";
|
|
1939
|
-
import
|
|
2117
|
+
import React44, { useMemo as useMemo18, useState as useState19 } from "react";
|
|
1940
2118
|
|
|
1941
2119
|
// src/components/payload/builder/transfer/builder/SingleFlexbox.tsx
|
|
1942
2120
|
import { RemoveCircle } from "@mui/icons-material";
|
|
1943
2121
|
import { FormControl as FormControl6, Icon as Icon3, IconButton as IconButton5 } from "@mui/material";
|
|
1944
|
-
import { isAddress as isAddress3, toHex as toHex3 } from "@xylabs/hex";
|
|
1945
2122
|
import { FlexRow as FlexRow7 } from "@xylabs/react-flexbox";
|
|
2123
|
+
import { isAddress as isAddress3, toHex as toHex4 } from "@xylabs/sdk-js";
|
|
1946
2124
|
import { BigIntInput } from "@xyo-network/react-shared";
|
|
1947
|
-
import
|
|
2125
|
+
import React43, { useEffect as useEffect3, useMemo as useMemo17, useState as useState18 } from "react";
|
|
1948
2126
|
var SingleTransferBuilderFlexbox = /* @__PURE__ */ __name(({ onTransferUpdated, onRemoveTransfer, singleTransfer, ...props }) => {
|
|
1949
2127
|
const [toAddress3, setToAddress] = useState18();
|
|
1950
2128
|
const [amount, setAmount] = useState18();
|
|
1951
|
-
const transferAmount =
|
|
2129
|
+
const transferAmount = useMemo17(() => {
|
|
1952
2130
|
if (isAddress3(toAddress3) && amount !== void 0) {
|
|
1953
2131
|
return {
|
|
1954
2132
|
...singleTransfer,
|
|
1955
|
-
amount:
|
|
2133
|
+
amount: toHex4(amount),
|
|
1956
2134
|
to: toAddress3
|
|
1957
2135
|
};
|
|
1958
2136
|
}
|
|
@@ -1965,36 +2143,36 @@ var SingleTransferBuilderFlexbox = /* @__PURE__ */ __name(({ onTransferUpdated,
|
|
|
1965
2143
|
}, [
|
|
1966
2144
|
transferAmount
|
|
1967
2145
|
]);
|
|
1968
|
-
return /* @__PURE__ */
|
|
2146
|
+
return /* @__PURE__ */ React43.createElement(FlexRow7, {
|
|
1969
2147
|
alignItems: "start",
|
|
1970
2148
|
gap: 1,
|
|
1971
2149
|
...props
|
|
1972
|
-
}, /* @__PURE__ */
|
|
2150
|
+
}, /* @__PURE__ */ React43.createElement(FormControl6, {
|
|
1973
2151
|
fullWidth: true
|
|
1974
|
-
}, /* @__PURE__ */
|
|
2152
|
+
}, /* @__PURE__ */ React43.createElement(XyoAddressTextField, {
|
|
1975
2153
|
label: "To",
|
|
1976
2154
|
name: "to",
|
|
1977
2155
|
onAddressChanged: setToAddress,
|
|
1978
2156
|
required: true,
|
|
1979
2157
|
size: "small"
|
|
1980
|
-
})), /* @__PURE__ */
|
|
2158
|
+
})), /* @__PURE__ */ React43.createElement(FormControl6, {
|
|
1981
2159
|
fullWidth: true
|
|
1982
|
-
}, /* @__PURE__ */
|
|
2160
|
+
}, /* @__PURE__ */ React43.createElement(BigIntInput.TextField, {
|
|
1983
2161
|
label: "Amount",
|
|
1984
2162
|
name: "amount",
|
|
1985
2163
|
onChangeFixedPoint: setAmount,
|
|
1986
2164
|
required: true,
|
|
1987
2165
|
size: "small"
|
|
1988
|
-
})), /* @__PURE__ */
|
|
2166
|
+
})), /* @__PURE__ */ React43.createElement(IconButton5, {
|
|
1989
2167
|
onClick: /* @__PURE__ */ __name(() => onRemoveTransfer?.(singleTransfer.transferId), "onClick")
|
|
1990
|
-
}, /* @__PURE__ */
|
|
2168
|
+
}, /* @__PURE__ */ React43.createElement(Icon3, null, /* @__PURE__ */ React43.createElement(RemoveCircle, null))));
|
|
1991
2169
|
}, "SingleTransferBuilderFlexbox");
|
|
1992
2170
|
|
|
1993
2171
|
// src/components/payload/builder/transfer/Form.tsx
|
|
1994
2172
|
var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
1995
2173
|
const [fromAddress, setFromAddress] = useState19();
|
|
1996
2174
|
const [transfers, setTransfers] = useState19([]);
|
|
1997
|
-
const transferPayload =
|
|
2175
|
+
const transferPayload = useMemo18(() => {
|
|
1998
2176
|
if (isAddress4(fromAddress) && transfers.length > 0) {
|
|
1999
2177
|
const transfersRecord = {};
|
|
2000
2178
|
for (const transfer of transfers) {
|
|
@@ -2036,19 +2214,19 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2036
2214
|
return transfer;
|
|
2037
2215
|
}));
|
|
2038
2216
|
}, "onTransferUpdated");
|
|
2039
|
-
return /* @__PURE__ */
|
|
2217
|
+
return /* @__PURE__ */ React44.createElement(React44.Fragment, null, /* @__PURE__ */ React44.createElement(FormControl7, {
|
|
2040
2218
|
fullWidth: true
|
|
2041
|
-
}, /* @__PURE__ */
|
|
2219
|
+
}, /* @__PURE__ */ React44.createElement(XyoAddressTextField, {
|
|
2042
2220
|
label: "From",
|
|
2043
2221
|
name: "from",
|
|
2044
2222
|
onAddressChanged: setFromAddress,
|
|
2045
2223
|
required: true,
|
|
2046
2224
|
size: "small"
|
|
2047
|
-
})), /* @__PURE__ */
|
|
2225
|
+
})), /* @__PURE__ */ React44.createElement(Button6, {
|
|
2048
2226
|
onClick: onTransferAdded,
|
|
2049
2227
|
size: "small",
|
|
2050
2228
|
variant: "contained"
|
|
2051
|
-
}, "Add Transfer"), transfers.map((transfer) => /* @__PURE__ */
|
|
2229
|
+
}, "Add Transfer"), transfers.map((transfer) => /* @__PURE__ */ React44.createElement(SingleTransferBuilderFlexbox, {
|
|
2052
2230
|
key: transfer.transferId,
|
|
2053
2231
|
onTransferUpdated,
|
|
2054
2232
|
onRemoveTransfer: onTransferRemoved,
|
|
@@ -2056,7 +2234,7 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2056
2234
|
sx: {
|
|
2057
2235
|
width: "100%"
|
|
2058
2236
|
}
|
|
2059
|
-
})), /* @__PURE__ */
|
|
2237
|
+
})), /* @__PURE__ */ React44.createElement(Button6, {
|
|
2060
2238
|
disabled: !transferPayload,
|
|
2061
2239
|
variant: "contained",
|
|
2062
2240
|
onClick: onBuildLocal
|
|
@@ -2064,7 +2242,7 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2064
2242
|
}, "TransferBuilderForm");
|
|
2065
2243
|
|
|
2066
2244
|
// src/components/payload/builder/transfer/Flexbox.tsx
|
|
2067
|
-
var TransferBuilderFlexbox = /* @__PURE__ */ __name(({ onBuild, ...props }) => /* @__PURE__ */
|
|
2245
|
+
var TransferBuilderFlexbox = /* @__PURE__ */ __name(({ onBuild, ...props }) => /* @__PURE__ */ React45.createElement(PayloadBuilderFlexbox, {
|
|
2068
2246
|
gap: 4,
|
|
2069
2247
|
alignItems: "start",
|
|
2070
2248
|
BuilderComponent: TransferBuilderForm,
|
|
@@ -2079,10 +2257,10 @@ import { MemoryArchivist } from "@xyo-network/archivist-memory";
|
|
|
2079
2257
|
import { ArchivistConfigSchema } from "@xyo-network/archivist-model";
|
|
2080
2258
|
import { buildRandomBlockChain } from "@xyo-network/react-chain-shared";
|
|
2081
2259
|
import { flattenHydratedBlocks } from "@xyo-network/xl1-protocol-sdk";
|
|
2082
|
-
import
|
|
2260
|
+
import React46, { useEffect as useEffect4 } from "react";
|
|
2083
2261
|
|
|
2084
2262
|
// src/lib/getChainArchivist.ts
|
|
2085
|
-
import { assertEx as assertEx4 } from "@xylabs/
|
|
2263
|
+
import { assertEx as assertEx4 } from "@xylabs/sdk-js";
|
|
2086
2264
|
import { asArchivistInstance } from "@xyo-network/archivist-model";
|
|
2087
2265
|
import { HttpBridge, HttpBridgeConfigSchema } from "@xyo-network/bridge-http";
|
|
2088
2266
|
var getChainArchivistFromBridge = /* @__PURE__ */ __name(async (params) => {
|
|
@@ -2102,7 +2280,7 @@ var getChainArchivistFromBridge = /* @__PURE__ */ __name(async (params) => {
|
|
|
2102
2280
|
}, "getChainArchivistFromBridge");
|
|
2103
2281
|
|
|
2104
2282
|
// src/lib/getChainId.ts
|
|
2105
|
-
import { toAddress as toAddress2 } from "@xylabs/
|
|
2283
|
+
import { toAddress as toAddress2 } from "@xylabs/sdk-js";
|
|
2106
2284
|
var id = toAddress2("ce080bf3043a40c6c8838c7e813c00ab53df1684");
|
|
2107
2285
|
var getChainId = /* @__PURE__ */ __name(() => {
|
|
2108
2286
|
return id;
|
|
@@ -2148,18 +2326,18 @@ var ChainArchivistDecorator = /* @__PURE__ */ __name((Story, { args, ...context
|
|
|
2148
2326
|
}
|
|
2149
2327
|
}
|
|
2150
2328
|
};
|
|
2151
|
-
return blockChainRenderProps?.chainArchivist ? /* @__PURE__ */
|
|
2329
|
+
return blockChainRenderProps?.chainArchivist ? /* @__PURE__ */ React46.createElement(Story, props) : /* @__PURE__ */ React46.createElement(CircularProgress, null);
|
|
2152
2330
|
}, "ChainArchivistDecorator");
|
|
2153
2331
|
|
|
2154
2332
|
// src/stories/ChainArchivistDelayedInsertDecorator.tsx
|
|
2155
2333
|
import { CircularProgress as CircularProgress2 } from "@mui/material";
|
|
2156
|
-
import { delay } from "@xylabs/delay";
|
|
2157
2334
|
import { usePromise as usePromise6 } from "@xylabs/react-promise";
|
|
2335
|
+
import { delay } from "@xylabs/sdk-js";
|
|
2158
2336
|
import { MemoryArchivist as MemoryArchivist2 } from "@xyo-network/archivist-memory";
|
|
2159
2337
|
import { ArchivistConfigSchema as ArchivistConfigSchema2 } from "@xyo-network/archivist-model";
|
|
2160
2338
|
import { buildRandomBlockChain as buildRandomBlockChain2 } from "@xyo-network/react-chain-shared";
|
|
2161
2339
|
import { flattenHydratedBlock } from "@xyo-network/xl1-protocol-sdk";
|
|
2162
|
-
import
|
|
2340
|
+
import React47, { useEffect as useEffect5, useState as useState20 } from "react";
|
|
2163
2341
|
var chainArchivistRef;
|
|
2164
2342
|
var ChainArchivistDelayedInsertDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
2165
2343
|
const [firstBlock, setFirstBlock] = useState20();
|
|
@@ -2217,18 +2395,17 @@ var ChainArchivistDelayedInsertDecorator = /* @__PURE__ */ __name((Story, contex
|
|
|
2217
2395
|
}
|
|
2218
2396
|
}
|
|
2219
2397
|
};
|
|
2220
|
-
return firstBlock ? /* @__PURE__ */
|
|
2398
|
+
return firstBlock ? /* @__PURE__ */ React47.createElement(Story, props) : /* @__PURE__ */ React47.createElement(CircularProgress2, null);
|
|
2221
2399
|
}, "ChainArchivistDelayedInsertDecorator");
|
|
2222
2400
|
|
|
2223
2401
|
// src/stories/ChainInfoContextDecorator.tsx
|
|
2224
|
-
import { assertEx as assertEx5 } from "@xylabs/assert";
|
|
2225
2402
|
import { usePromise as usePromise7 } from "@xylabs/react-promise";
|
|
2226
|
-
import { isDefined as
|
|
2403
|
+
import { assertEx as assertEx5, isDefined as isDefined7 } from "@xylabs/sdk-js";
|
|
2227
2404
|
import { ChainBlockNumberIterationService as ChainBlockNumberIterationService3 } from "@xyo-network/chain-services";
|
|
2228
2405
|
import { findFirstMatching } from "@xyo-network/chain-utils";
|
|
2229
2406
|
import { isBlockBoundWitness as isBlockBoundWitness3 } from "@xyo-network/xl1-protocol";
|
|
2230
2407
|
import { readPayloadMapFromStore } from "@xyo-network/xl1-protocol-sdk";
|
|
2231
|
-
import
|
|
2408
|
+
import React48 from "react";
|
|
2232
2409
|
var archivistConfig = {
|
|
2233
2410
|
url: "http://localhost:8080",
|
|
2234
2411
|
chainArchivistModuleId: "XYOPublic:XYOChain:Chain"
|
|
@@ -2242,7 +2419,7 @@ var ChainInfoContextDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
|
2242
2419
|
return await getChainArchivistFromBridge(archivistConfig);
|
|
2243
2420
|
}, []);
|
|
2244
2421
|
const [chainIterator] = usePromise7(async () => {
|
|
2245
|
-
if (
|
|
2422
|
+
if (isDefined7(chainArchivist) && isDefined7(chainId)) {
|
|
2246
2423
|
const firstMatch = assertEx5(await findFirstMatching(chainArchivist), () => `No head found in archivist: ${chainArchivist.id} `);
|
|
2247
2424
|
const head = assertEx5(isBlockBoundWitness3(firstMatch) ? firstMatch : void 0, () => `Expected a block bound witness: ${JSON.stringify(firstMatch)}`);
|
|
2248
2425
|
const chainMap = readPayloadMapFromStore(chainArchivist);
|
|
@@ -2255,13 +2432,17 @@ var ChainInfoContextDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
|
2255
2432
|
chainArchivist,
|
|
2256
2433
|
chainId
|
|
2257
2434
|
]);
|
|
2258
|
-
return /* @__PURE__ */
|
|
2435
|
+
return /* @__PURE__ */ React48.createElement(ChainInfoProvider, {
|
|
2259
2436
|
chainArchivist,
|
|
2260
2437
|
chainId,
|
|
2261
2438
|
chainIterator
|
|
2262
|
-
}, /* @__PURE__ */
|
|
2439
|
+
}, /* @__PURE__ */ React48.createElement(Story, context));
|
|
2263
2440
|
}, "ChainInfoContextDecorator");
|
|
2264
2441
|
export {
|
|
2442
|
+
AccountBalanceHistoryFlexBox,
|
|
2443
|
+
AccountBalanceHistoryTable,
|
|
2444
|
+
AddressTableCell,
|
|
2445
|
+
BalanceHistoryTableRow,
|
|
2265
2446
|
BlockAddressChip,
|
|
2266
2447
|
BlockChainPagination,
|
|
2267
2448
|
BlockChainTableRow,
|
|
@@ -2300,6 +2481,7 @@ export {
|
|
|
2300
2481
|
StaticBlockchainRenderFlexBox,
|
|
2301
2482
|
StyledPulseSvgIcon,
|
|
2302
2483
|
SubmitChainTransaction,
|
|
2484
|
+
TableHeadingLabels,
|
|
2303
2485
|
TransactionCountChip,
|
|
2304
2486
|
TransactionsDialog,
|
|
2305
2487
|
TransactionsQuickTipButton,
|