@xyo-network/react-chain-blockchain 1.18.0-rc.1 → 1.18.1
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 +1 -1
- package/dist/browser/components/account/BalanceHistoryFlexbox.d.ts.map +1 -1
- package/dist/browser/components/account/helpers/formatBalanceMagnitude.d.ts +1 -1
- package/dist/browser/components/account/helpers/formatBalanceMagnitude.d.ts.map +1 -1
- package/dist/browser/components/account/hooks/usePagedAccountBalanceHistory.d.ts +1 -1
- package/dist/browser/components/account/hooks/usePagedAccountBalanceHistory.d.ts.map +1 -1
- package/dist/browser/components/block/helpers/blockProducer.d.ts +6 -2
- package/dist/browser/components/block/helpers/blockProducer.d.ts.map +1 -1
- package/dist/browser/components/block/helpers/payloadCountsFromBlock.d.ts +1 -1
- package/dist/browser/components/block/helpers/payloadCountsFromBlock.d.ts.map +1 -1
- package/dist/browser/components/block/hooks/useBlockProducer.d.ts +6 -2
- package/dist/browser/components/block/hooks/useBlockProducer.d.ts.map +1 -1
- package/dist/browser/components/block/hooks/usePayloadCountsFromBlock.d.ts +1 -1
- package/dist/browser/components/block/hooks/usePayloadCountsFromBlock.d.ts.map +1 -1
- package/dist/browser/components/block/table/cell/lib/BlockTableCellProps.d.ts +1 -1
- package/dist/browser/components/block/table/cell/lib/BlockTableCellProps.d.ts.map +1 -1
- package/dist/browser/components/chain/hooks/useOnBlock.d.ts +21 -13
- package/dist/browser/components/chain/hooks/useOnBlock.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/Form.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.map +1 -1
- package/dist/browser/components/rate/SpanTypography.d.ts +8 -0
- package/dist/browser/components/rate/SpanTypography.d.ts.map +1 -0
- package/dist/browser/components/rate/SpeedTypography.d.ts +7 -0
- package/dist/browser/components/rate/SpeedTypography.d.ts.map +1 -0
- package/dist/browser/components/rate/TimeTypography.d.ts +7 -0
- package/dist/browser/components/rate/TimeTypography.d.ts.map +1 -0
- package/dist/browser/components/rate/flexbox/FlexBox.d.ts +7 -0
- package/dist/browser/components/rate/flexbox/FlexBox.d.ts.map +1 -0
- package/dist/browser/components/rate/flexbox/FlexBox.stories.d.ts +10 -0
- package/dist/browser/components/rate/flexbox/FlexBox.stories.d.ts.map +1 -0
- package/dist/browser/components/rate/flexbox/index.d.ts +2 -0
- package/dist/browser/components/rate/flexbox/index.d.ts.map +1 -0
- package/dist/browser/components/rate/gauge/Container.d.ts +15 -0
- package/dist/browser/components/rate/gauge/Container.d.ts.map +1 -0
- package/dist/browser/components/rate/gauge/Container.stories.d.ts +12 -0
- package/dist/browser/components/rate/gauge/Container.stories.d.ts.map +1 -0
- package/dist/browser/components/rate/gauge/Pointer.d.ts +6 -0
- package/dist/browser/components/rate/gauge/Pointer.d.ts.map +1 -0
- package/dist/browser/components/rate/gauge/Ticks.d.ts +38 -0
- package/dist/browser/components/rate/gauge/Ticks.d.ts.map +1 -0
- package/dist/browser/components/rate/gauge/WithLabel.d.ts +5 -0
- package/dist/browser/components/rate/gauge/WithLabel.d.ts.map +1 -0
- package/dist/browser/components/rate/gauge/WithLabel.stories.d.ts +11 -0
- package/dist/browser/components/rate/gauge/WithLabel.stories.d.ts.map +1 -0
- package/dist/browser/components/rate/gauge/helpers/blockRateConversions.d.ts +4 -0
- package/dist/browser/components/rate/gauge/helpers/blockRateConversions.d.ts.map +1 -0
- package/dist/browser/components/rate/gauge/helpers/index.d.ts +2 -0
- package/dist/browser/components/rate/gauge/helpers/index.d.ts.map +1 -0
- package/dist/browser/components/rate/gauge/index.d.ts +5 -0
- package/dist/browser/components/rate/gauge/index.d.ts.map +1 -0
- package/dist/browser/components/rate/index.d.ts +7 -0
- package/dist/browser/components/rate/index.d.ts.map +1 -0
- package/dist/browser/components/rate/support/MetricTypography.d.ts +11 -0
- package/dist/browser/components/rate/support/MetricTypography.d.ts.map +1 -0
- package/dist/browser/components/rate/support/index.d.ts +2 -0
- package/dist/browser/components/rate/support/index.d.ts.map +1 -0
- package/dist/browser/components/transactions/TransactionsQuickTipButton.d.ts.map +1 -1
- package/dist/browser/context/analyzer/state.d.ts +1 -1
- package/dist/browser/context/analyzer/state.d.ts.map +1 -1
- package/dist/browser/context/chain/Provider.d.ts.map +1 -1
- package/dist/browser/context/chain/State.d.ts +1 -2
- package/dist/browser/context/chain/State.d.ts.map +1 -1
- package/dist/browser/helpers/rate/index.d.ts +2 -0
- package/dist/browser/helpers/rate/index.d.ts.map +1 -0
- package/dist/browser/helpers/rate/rateUnitToLabel.d.ts +3 -0
- package/dist/browser/helpers/rate/rateUnitToLabel.d.ts.map +1 -0
- package/dist/browser/helpers/txsFromBlock.d.ts +4 -22
- package/dist/browser/helpers/txsFromBlock.d.ts.map +1 -1
- package/dist/browser/hooks/chain-iterator/useChainIteratorParams.d.ts +47 -143
- package/dist/browser/hooks/chain-iterator/useChainIteratorParams.d.ts.map +1 -1
- package/dist/browser/hooks/useTxsFromBlock.d.ts +2 -22
- package/dist/browser/hooks/useTxsFromBlock.d.ts.map +1 -1
- package/dist/browser/index.mjs +719 -326
- package/dist/browser/index.mjs.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/BlockComponents.d.ts +1 -1
- package/dist/browser/types/BlockComponents.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 +32 -33
- package/src/components/account/BalanceHistoryFlexbox.tsx +2 -2
- package/src/components/account/helpers/formatBalanceMagnitude.ts +1 -1
- package/src/components/account/hooks/usePagedAccountBalanceHistory.ts +9 -14
- package/src/components/block/helpers/blockProducer.ts +1 -1
- package/src/components/block/helpers/payloadCountsFromBlock.ts +1 -1
- package/src/components/block/hooks/useBlockProducer.ts +1 -1
- package/src/components/block/hooks/usePayloadCountsFromBlock.ts +1 -1
- package/src/components/block/table/cell/lib/BlockTableCellProps.ts +1 -1
- package/src/components/chain/hooks/useOnBlock.ts +3 -3
- package/src/components/index.ts +1 -0
- package/src/components/payload/builder/transfer/Form.tsx +5 -2
- package/src/components/payload/builder/transfer/builder/SingleFlexbox.tsx +12 -15
- package/src/components/payload/fields/XyoAddressTextField.tsx +10 -3
- package/src/components/rate/SpanTypography.tsx +20 -0
- package/src/components/rate/SpeedTypography.tsx +17 -0
- package/src/components/rate/TimeTypography.tsx +17 -0
- package/src/components/rate/flexbox/FlexBox.stories.tsx +44 -0
- package/src/components/rate/flexbox/FlexBox.tsx +31 -0
- package/src/components/rate/flexbox/index.ts +1 -0
- package/src/components/rate/gauge/Container.stories.tsx +77 -0
- package/src/components/rate/gauge/Container.tsx +75 -0
- package/src/components/rate/gauge/Pointer.tsx +67 -0
- package/src/components/rate/gauge/Ticks.tsx +122 -0
- package/src/components/rate/gauge/WithLabel.stories.tsx +70 -0
- package/src/components/rate/gauge/WithLabel.tsx +20 -0
- package/src/components/rate/gauge/helpers/blockRateConversions.ts +104 -0
- package/src/components/rate/gauge/helpers/index.ts +1 -0
- package/src/components/rate/gauge/index.ts +4 -0
- package/src/components/rate/index.ts +6 -0
- package/src/components/rate/support/MetricTypography.tsx +78 -0
- package/src/components/rate/support/index.ts +1 -0
- package/src/components/transactions/TransactionsQuickTipButton.tsx +14 -9
- package/src/context/analyzer/Provider.tsx +2 -2
- package/src/context/analyzer/state.ts +1 -1
- package/src/context/chain/Provider.tsx +28 -21
- package/src/context/chain/State.ts +1 -2
- package/src/helpers/rate/index.ts +1 -0
- package/src/helpers/rate/rateUnitToLabel.ts +27 -0
- package/src/helpers/txsFromBlock.ts +4 -2
- package/src/hooks/chain-iterator/useChainIteratorParams.ts +13 -4
- package/src/hooks/useTxsFromBlock.ts +1 -1
- package/src/types/BlockComponentProps.ts +1 -1
- package/src/types/BlockComponents.ts +1 -1
- package/src/types/render/BlockChainRenderProps.ts +1 -2
package/dist/browser/index.mjs
CHANGED
|
@@ -4,14 +4,14 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
4
4
|
// src/components/account/BalanceHistoryFlexbox.tsx
|
|
5
5
|
import { Typography as Typography7 } from "@mui/material";
|
|
6
6
|
import { FlexCol as FlexCol3 } from "@xylabs/react-flexbox";
|
|
7
|
-
import { isDefined as
|
|
7
|
+
import { isDefined as isDefined7 } from "@xylabs/sdk-js";
|
|
8
8
|
import { useAccountBalanceHistory } from "@xyo-network/react-chain-provider";
|
|
9
9
|
import { ErrorRender as ErrorRender3 } from "@xyo-network/react-error";
|
|
10
|
-
import { AttoXL1 } from "@xyo-network/xl1-
|
|
11
|
-
import
|
|
10
|
+
import { AttoXL1 } from "@xyo-network/xl1-sdk";
|
|
11
|
+
import React30 from "react";
|
|
12
12
|
|
|
13
13
|
// src/components/account/helpers/formatBalanceMagnitude.ts
|
|
14
|
-
import { XL1Amount } from "@xyo-network/xl1-
|
|
14
|
+
import { XL1Amount } from "@xyo-network/xl1-sdk";
|
|
15
15
|
var formatBalanceMagnitude = /* @__PURE__ */ __name((set) => {
|
|
16
16
|
const [received, sent] = set;
|
|
17
17
|
const netBalance = received - sent;
|
|
@@ -30,20 +30,20 @@ var formatBalance = /* @__PURE__ */ __name((balance) => {
|
|
|
30
30
|
|
|
31
31
|
// src/components/account/table/BalanceHistoryTableEx.tsx
|
|
32
32
|
import { TableBody as TableBody2, TableCell as TableCell14, TableHead as TableHead2, TableRow as TableRow4 } from "@mui/material";
|
|
33
|
-
import { isDefined as
|
|
33
|
+
import { isDefined as isDefined6 } from "@xylabs/sdk-js";
|
|
34
34
|
import { TableEx as TableEx2 } from "@xyo-network/react-table";
|
|
35
|
-
import
|
|
35
|
+
import React29 from "react";
|
|
36
36
|
|
|
37
37
|
// src/components/account/table/BalanceHistoryTableRow.tsx
|
|
38
38
|
import { TableCell as TableCell13, TableRow as TableRow3 } from "@mui/material";
|
|
39
39
|
import { RawInfoIconButton } from "@xyo-network/react-payload-raw-info";
|
|
40
|
-
import
|
|
40
|
+
import React28, { useMemo as useMemo7 } from "react";
|
|
41
41
|
|
|
42
42
|
// src/components/block/BlockHeadingFlexbox.tsx
|
|
43
43
|
import { FlexCol as FlexCol2, FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
|
|
44
44
|
import { BWVerification, HashHeadingPaper } from "@xyo-network/react-boundwitness-plugin";
|
|
45
45
|
import { usePayloadHash } from "@xyo-network/react-shared";
|
|
46
|
-
import
|
|
46
|
+
import React12 from "react";
|
|
47
47
|
|
|
48
48
|
// src/context/analyzer/context.ts
|
|
49
49
|
import { createContextEx } from "@xylabs/react-shared";
|
|
@@ -66,7 +66,7 @@ import { Button, FormControl, TextField } from "@mui/material";
|
|
|
66
66
|
import { FlexCol } from "@xylabs/react-flexbox";
|
|
67
67
|
import { toHex } from "@xylabs/sdk-js";
|
|
68
68
|
import { defaultTransactionFees, toXL1BlockNumber } from "@xyo-network/xl1-protocol";
|
|
69
|
-
import
|
|
69
|
+
import React2 from "react";
|
|
70
70
|
var ChainTransactionBuilder = /* @__PURE__ */ __name(({ onSubmitTx }) => {
|
|
71
71
|
const handleSubmit = /* @__PURE__ */ __name(async (event) => {
|
|
72
72
|
event.preventDefault();
|
|
@@ -84,38 +84,38 @@ var ChainTransactionBuilder = /* @__PURE__ */ __name(({ onSubmitTx }) => {
|
|
|
84
84
|
};
|
|
85
85
|
await onSubmitTx?.(chainTx);
|
|
86
86
|
}, "handleSubmit");
|
|
87
|
-
return /* @__PURE__ */
|
|
87
|
+
return /* @__PURE__ */ React2.createElement("form", {
|
|
88
88
|
onSubmit: /* @__PURE__ */ __name((event) => void handleSubmit(event), "onSubmit"),
|
|
89
89
|
style: {
|
|
90
90
|
width: "100%"
|
|
91
91
|
}
|
|
92
|
-
}, /* @__PURE__ */
|
|
92
|
+
}, /* @__PURE__ */ React2.createElement(FlexCol, {
|
|
93
93
|
gap: 2
|
|
94
|
-
}, /* @__PURE__ */
|
|
94
|
+
}, /* @__PURE__ */ React2.createElement(FormControl, {
|
|
95
95
|
fullWidth: true
|
|
96
|
-
}, /* @__PURE__ */
|
|
96
|
+
}, /* @__PURE__ */ React2.createElement(TextField, {
|
|
97
97
|
label: "Chain Address",
|
|
98
98
|
name: "chain",
|
|
99
99
|
required: true
|
|
100
|
-
})), /* @__PURE__ */
|
|
100
|
+
})), /* @__PURE__ */ React2.createElement(FormControl, {
|
|
101
101
|
fullWidth: true
|
|
102
|
-
}, /* @__PURE__ */
|
|
102
|
+
}, /* @__PURE__ */ React2.createElement(TextField, {
|
|
103
103
|
label: "Gas",
|
|
104
104
|
name: "gas",
|
|
105
105
|
required: true
|
|
106
|
-
})), /* @__PURE__ */
|
|
106
|
+
})), /* @__PURE__ */ React2.createElement(FormControl, {
|
|
107
107
|
fullWidth: true
|
|
108
|
-
}, /* @__PURE__ */
|
|
108
|
+
}, /* @__PURE__ */ React2.createElement(TextField, {
|
|
109
109
|
label: "Not Before Block",
|
|
110
110
|
name: "nbf",
|
|
111
111
|
required: true
|
|
112
|
-
})), /* @__PURE__ */
|
|
112
|
+
})), /* @__PURE__ */ React2.createElement(FormControl, {
|
|
113
113
|
fullWidth: true
|
|
114
|
-
}, /* @__PURE__ */
|
|
114
|
+
}, /* @__PURE__ */ React2.createElement(TextField, {
|
|
115
115
|
label: "Not After Block",
|
|
116
116
|
name: "exp",
|
|
117
117
|
required: true
|
|
118
|
-
})), /* @__PURE__ */
|
|
118
|
+
})), /* @__PURE__ */ React2.createElement(Button, {
|
|
119
119
|
type: "submit",
|
|
120
120
|
variant: "contained"
|
|
121
121
|
}, "Submit")));
|
|
@@ -123,7 +123,7 @@ var ChainTransactionBuilder = /* @__PURE__ */ __name(({ onSubmitTx }) => {
|
|
|
123
123
|
|
|
124
124
|
// src/components/transactions/submit/Network.tsx
|
|
125
125
|
import { FormControl as FormControl2, FormHelperText, TextField as TextField2 } from "@mui/material";
|
|
126
|
-
import
|
|
126
|
+
import React3, { useState } from "react";
|
|
127
127
|
var ChainTransactionNetwork = /* @__PURE__ */ __name(({ network, onNetworkChange, ...props }) => {
|
|
128
128
|
const [error, setError] = useState();
|
|
129
129
|
const handleChange = /* @__PURE__ */ __name((event) => {
|
|
@@ -136,16 +136,16 @@ var ChainTransactionNetwork = /* @__PURE__ */ __name(({ network, onNetworkChange
|
|
|
136
136
|
setError(error2);
|
|
137
137
|
}
|
|
138
138
|
}, "handleChange");
|
|
139
|
-
return /* @__PURE__ */
|
|
139
|
+
return /* @__PURE__ */ React3.createElement(FormControl2, {
|
|
140
140
|
fullWidth: true
|
|
141
|
-
}, /* @__PURE__ */
|
|
141
|
+
}, /* @__PURE__ */ React3.createElement(TextField2, {
|
|
142
142
|
label: "Network",
|
|
143
143
|
name: "network",
|
|
144
144
|
onChange: handleChange,
|
|
145
145
|
required: true,
|
|
146
146
|
value: network,
|
|
147
147
|
...props
|
|
148
|
-
}), /* @__PURE__ */
|
|
148
|
+
}), /* @__PURE__ */ React3.createElement(FormHelperText, {
|
|
149
149
|
sx: {
|
|
150
150
|
color: error ? "red" : void 0
|
|
151
151
|
}
|
|
@@ -163,7 +163,7 @@ import { QueryBoundWitnessBuilder } from "@xyo-network/boundwitness-builder";
|
|
|
163
163
|
import { PayloadBuilder } from "@xyo-network/payload-builder";
|
|
164
164
|
import { buildTransaction } from "@xyo-network/xl1-protocol-sdk";
|
|
165
165
|
import { Axios } from "axios";
|
|
166
|
-
import
|
|
166
|
+
import React4, { useState as useState2 } from "react";
|
|
167
167
|
var BETA_PENDING_TRANSACTIONS_ARCHIVIST = "https://beta.api.chain.xyo.network/8050fee682a2762f504d5449d8269a6f17f0b693";
|
|
168
168
|
var defaultNetwork = new URL(BETA_PENDING_TRANSACTIONS_ARCHIVIST);
|
|
169
169
|
var SubmitChainTransaction = /* @__PURE__ */ __name(() => {
|
|
@@ -198,37 +198,37 @@ var SubmitChainTransaction = /* @__PURE__ */ __name(() => {
|
|
|
198
198
|
const onNetworkChange = /* @__PURE__ */ __name((url) => {
|
|
199
199
|
setNetwork(url);
|
|
200
200
|
}, "onNetworkChange");
|
|
201
|
-
return /* @__PURE__ */
|
|
201
|
+
return /* @__PURE__ */ React4.createElement(Grid, {
|
|
202
202
|
container: true
|
|
203
|
-
}, /* @__PURE__ */
|
|
203
|
+
}, /* @__PURE__ */ React4.createElement(Grid, {
|
|
204
204
|
size: {
|
|
205
205
|
xs: 12,
|
|
206
206
|
sm: 6,
|
|
207
207
|
md: 4
|
|
208
208
|
}
|
|
209
|
-
}, /* @__PURE__ */
|
|
209
|
+
}, /* @__PURE__ */ React4.createElement(FlexGrowCol, {
|
|
210
210
|
alignItems: "start",
|
|
211
211
|
gap: 2
|
|
212
|
-
}, /* @__PURE__ */
|
|
212
|
+
}, /* @__PURE__ */ React4.createElement(ChainTransactionNetwork, {
|
|
213
213
|
network,
|
|
214
214
|
onNetworkChange
|
|
215
|
-
}), network ? /* @__PURE__ */
|
|
215
|
+
}), network ? /* @__PURE__ */ React4.createElement(ChainTransactionBuilder, {
|
|
216
216
|
onSubmitTx
|
|
217
|
-
}) : null, result?.[2].length === 0 ? /* @__PURE__ */
|
|
217
|
+
}) : null, result?.[2].length === 0 ? /* @__PURE__ */ React4.createElement(Alert, {
|
|
218
218
|
severity: "success"
|
|
219
|
-
}, "Success") : null, error ? /* @__PURE__ */
|
|
219
|
+
}, "Success") : null, error ? /* @__PURE__ */ React4.createElement(ErrorRender, {
|
|
220
220
|
error
|
|
221
|
-
}) : null, result?.[2] && result?.[2].length > 0 ? /* @__PURE__ */
|
|
221
|
+
}) : null, result?.[2] && result?.[2].length > 0 ? /* @__PURE__ */ React4.createElement(ErrorRender, {
|
|
222
222
|
error: new Error("Failed insert...see result below")
|
|
223
|
-
}) : null, result ? /* @__PURE__ */
|
|
223
|
+
}) : null, result ? /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(Typography, {
|
|
224
224
|
variant: "h6"
|
|
225
|
-
}, "Result:"), /* @__PURE__ */
|
|
225
|
+
}, "Result:"), /* @__PURE__ */ React4.createElement("pre", null, JSON.stringify(result, null, 2))) : null)));
|
|
226
226
|
}, "SubmitChainTransaction");
|
|
227
227
|
|
|
228
228
|
// src/components/transactions/TransactionCountChip.tsx
|
|
229
229
|
import CompareArrowsIcon from "@mui/icons-material/CompareArrows";
|
|
230
230
|
import { Chip, Icon } from "@mui/material";
|
|
231
|
-
import
|
|
231
|
+
import React5, { useMemo } from "react";
|
|
232
232
|
var TransactionCountChip = /* @__PURE__ */ __name(({ transactions, sx, ...props }) => {
|
|
233
233
|
const label = useMemo(() => {
|
|
234
234
|
if (!transactions) return "0";
|
|
@@ -236,8 +236,8 @@ var TransactionCountChip = /* @__PURE__ */ __name(({ transactions, sx, ...props
|
|
|
236
236
|
}, [
|
|
237
237
|
transactions
|
|
238
238
|
]);
|
|
239
|
-
return /* @__PURE__ */
|
|
240
|
-
avatar: /* @__PURE__ */
|
|
239
|
+
return /* @__PURE__ */ React5.createElement(Chip, {
|
|
240
|
+
avatar: /* @__PURE__ */ React5.createElement(Icon, null, /* @__PURE__ */ React5.createElement(CompareArrowsIcon, null)),
|
|
241
241
|
label,
|
|
242
242
|
title: transactions ? `Block contains ${transactions.length} transactions` : void 0,
|
|
243
243
|
sx: {
|
|
@@ -256,15 +256,15 @@ import { Alert as Alert2, AlertTitle, Collapse, Snackbar, Typography as Typograp
|
|
|
256
256
|
import { ErrorRender as ErrorRender2 } from "@xylabs/react-error";
|
|
257
257
|
import { FlexGrowCol as FlexGrowCol2, FlexGrowRow, FlexRow } from "@xylabs/react-flexbox";
|
|
258
258
|
import { QuickTipButton } from "@xylabs/react-quick-tip-button";
|
|
259
|
-
import
|
|
259
|
+
import { isDefined as isDefined2 } from "@xylabs/sdk-js";
|
|
260
|
+
import React6, { Fragment, useState as useState3 } from "react";
|
|
260
261
|
|
|
261
262
|
// src/hooks/chain-iterator/useChainIteratorParams.ts
|
|
262
263
|
import { usePromise } from "@xylabs/react-promise";
|
|
263
264
|
import { isHash } from "@xylabs/sdk-js";
|
|
264
265
|
import { assertEx, isDefined } from "@xylabs/sdk-js";
|
|
265
266
|
import { BoundWitnessBuilder } from "@xyo-network/boundwitness-builder";
|
|
266
|
-
import { isBlockBoundWitness } from "@xyo-network/xl1-
|
|
267
|
-
import { getDefaultConfig } from "@xyo-network/xl1-protocol-sdk";
|
|
267
|
+
import { getDefaultConfig, isBlockBoundWitness } from "@xyo-network/xl1-sdk";
|
|
268
268
|
var resolveDefinedHead = /* @__PURE__ */ __name(async (head, chainArchivist) => {
|
|
269
269
|
const [headPayload] = await chainArchivist.get([
|
|
270
270
|
head
|
|
@@ -327,10 +327,13 @@ var useTxsFromBlock = /* @__PURE__ */ __name((block) => {
|
|
|
327
327
|
var TransactionsQuickTipButton = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
328
328
|
const [transactions, transactionsError] = useTxsFromBlock(block);
|
|
329
329
|
const [copied, setCopied] = useState3(false);
|
|
330
|
-
const [
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
330
|
+
const [closeDialog, setCloseDialog] = useState3(false);
|
|
331
|
+
const open = isDefined2(transactionsError);
|
|
332
|
+
const [previousTransactionError, setPreviousTransactionError] = useState3(transactionsError);
|
|
333
|
+
if (isDefined2(transactionsError) && transactionsError !== previousTransactionError) {
|
|
334
|
+
setPreviousTransactionError(transactionsError);
|
|
335
|
+
setCloseDialog(false);
|
|
336
|
+
}
|
|
334
337
|
const onCopy = /* @__PURE__ */ __name(async (transactionHash) => {
|
|
335
338
|
await navigator.clipboard.writeText(transactionHash);
|
|
336
339
|
setCopied(true);
|
|
@@ -338,7 +341,7 @@ var TransactionsQuickTipButton = /* @__PURE__ */ __name(({ block, ...props }) =>
|
|
|
338
341
|
setCopied(false);
|
|
339
342
|
}, 5e3);
|
|
340
343
|
}, "onCopy");
|
|
341
|
-
return /* @__PURE__ */
|
|
344
|
+
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(QuickTipButton, {
|
|
342
345
|
Icon: Paid,
|
|
343
346
|
disabled: transactions?.length === 0,
|
|
344
347
|
hoverText: `Transaction Count: ${transactions?.length ?? 0}`,
|
|
@@ -348,32 +351,32 @@ var TransactionsQuickTipButton = /* @__PURE__ */ __name(({ block, ...props }) =>
|
|
|
348
351
|
maxWidth: "md"
|
|
349
352
|
},
|
|
350
353
|
...props
|
|
351
|
-
}, transactions?.length === 0 ? null : /* @__PURE__ */
|
|
354
|
+
}, transactions?.length === 0 ? null : /* @__PURE__ */ React6.createElement(FlexGrowCol2, {
|
|
352
355
|
gap: 1,
|
|
353
356
|
alignItems: "stretch"
|
|
354
|
-
}, transactions?.map(([
|
|
357
|
+
}, transactions?.map(([_transaction, hash]) => /* @__PURE__ */ React6.createElement(Fragment, {
|
|
355
358
|
key: hash
|
|
356
|
-
}, /* @__PURE__ */
|
|
359
|
+
}, /* @__PURE__ */ React6.createElement(FlexGrowRow, {
|
|
357
360
|
gap: 2,
|
|
358
361
|
justifyContent: "start"
|
|
359
|
-
}, /* @__PURE__ */
|
|
362
|
+
}, /* @__PURE__ */ React6.createElement(ContentCopyIcon, {
|
|
360
363
|
sx: {
|
|
361
364
|
cursor: "pointer"
|
|
362
365
|
},
|
|
363
366
|
onClick: /* @__PURE__ */ __name(() => void onCopy(hash), "onClick")
|
|
364
|
-
}), /* @__PURE__ */
|
|
367
|
+
}), /* @__PURE__ */ React6.createElement(Typography2, {
|
|
365
368
|
sx: {
|
|
366
369
|
overflow: "hidden",
|
|
367
370
|
textOverflow: "ellipsis",
|
|
368
371
|
whiteSpace: "nowrap"
|
|
369
372
|
}
|
|
370
|
-
}, hash)), /* @__PURE__ */
|
|
373
|
+
}, hash)), /* @__PURE__ */ React6.createElement(FlexRow, null, /* @__PURE__ */ React6.createElement(Collapse, {
|
|
371
374
|
in: copied,
|
|
372
375
|
unmountOnExit: true
|
|
373
|
-
}, /* @__PURE__ */
|
|
374
|
-
open:
|
|
375
|
-
onClose: /* @__PURE__ */ __name(() =>
|
|
376
|
-
}, /* @__PURE__ */
|
|
376
|
+
}, /* @__PURE__ */ React6.createElement(Alert2, null, /* @__PURE__ */ React6.createElement(AlertTitle, null, "Previous hash copied to clipboard")))))))), /* @__PURE__ */ React6.createElement(Snackbar, {
|
|
377
|
+
open: open && closeDialog === false,
|
|
378
|
+
onClose: /* @__PURE__ */ __name(() => setCloseDialog(true), "onClose")
|
|
379
|
+
}, /* @__PURE__ */ React6.createElement(ErrorRender2, {
|
|
377
380
|
error: transactionsError,
|
|
378
381
|
scope: "TransactionsQuickTipButton"
|
|
379
382
|
})));
|
|
@@ -407,9 +410,9 @@ var useBlockHeadingEvents = /* @__PURE__ */ __name((...args) => {
|
|
|
407
410
|
}, "useBlockHeadingEvents");
|
|
408
411
|
|
|
409
412
|
// src/components/block/hooks/useBlockProducer.ts
|
|
410
|
-
import { useMemo as
|
|
413
|
+
import { useMemo as useMemo2 } from "react";
|
|
411
414
|
var useBlockProducer = /* @__PURE__ */ __name((block) => {
|
|
412
|
-
return
|
|
415
|
+
return useMemo2(() => {
|
|
413
416
|
if (block) {
|
|
414
417
|
const producer = block[0].addresses[0];
|
|
415
418
|
return producer;
|
|
@@ -420,7 +423,7 @@ var useBlockProducer = /* @__PURE__ */ __name((block) => {
|
|
|
420
423
|
}, "useBlockProducer");
|
|
421
424
|
|
|
422
425
|
// src/components/block/hooks/usePayloadCountsFromBlock.ts
|
|
423
|
-
import { useMemo as
|
|
426
|
+
import { useMemo as useMemo3 } from "react";
|
|
424
427
|
|
|
425
428
|
// src/components/block/helpers/blockProducer.ts
|
|
426
429
|
var blockProducer = /* @__PURE__ */ __name((block) => {
|
|
@@ -428,13 +431,13 @@ var blockProducer = /* @__PURE__ */ __name((block) => {
|
|
|
428
431
|
}, "blockProducer");
|
|
429
432
|
|
|
430
433
|
// src/components/block/helpers/buildBlockChainRenderComponent.tsx
|
|
431
|
-
import
|
|
434
|
+
import React7 from "react";
|
|
432
435
|
var buildBlockChainRenderComponent = /* @__PURE__ */ __name(async (BlockComponent, blockComponentProps) => {
|
|
433
436
|
const { block, ...remainingProps } = blockComponentProps;
|
|
434
437
|
const blockTxs = await txsFromBlock(block);
|
|
435
438
|
const txHashes = blockTxs.map(([_, hash]) => hash);
|
|
436
439
|
const item = {
|
|
437
|
-
child: /* @__PURE__ */
|
|
440
|
+
child: /* @__PURE__ */ React7.createElement(BlockComponent, {
|
|
438
441
|
block,
|
|
439
442
|
transactions: txHashes,
|
|
440
443
|
...remainingProps
|
|
@@ -447,7 +450,7 @@ var buildBlockChainRenderComponent = /* @__PURE__ */ __name(async (BlockComponen
|
|
|
447
450
|
|
|
448
451
|
// src/components/block/helpers/payloadCountsFromBlock.ts
|
|
449
452
|
import { BoundWitnessSchema } from "@xyo-network/boundwitness-model";
|
|
450
|
-
import { isTransactionBoundWitness } from "@xyo-network/xl1-
|
|
453
|
+
import { isTransactionBoundWitness } from "@xyo-network/xl1-sdk";
|
|
451
454
|
var payloadCountsFromBlock = /* @__PURE__ */ __name(([block, payloads]) => {
|
|
452
455
|
const publicPayloads = block.payload_schemas.filter((schema) => schema !== BoundWitnessSchema);
|
|
453
456
|
const transactionHashes = payloads.filter((payload) => isTransactionBoundWitness(payload)).flatMap((payload) => payload.payload_hashes);
|
|
@@ -460,7 +463,7 @@ var payloadCountsFromBlock = /* @__PURE__ */ __name(([block, payloads]) => {
|
|
|
460
463
|
|
|
461
464
|
// src/components/block/hooks/usePayloadCountsFromBlock.ts
|
|
462
465
|
var usePayloadCountsFromBlock = /* @__PURE__ */ __name((block) => {
|
|
463
|
-
return
|
|
466
|
+
return useMemo3(() => {
|
|
464
467
|
if (block) {
|
|
465
468
|
return [
|
|
466
469
|
...payloadCountsFromBlock(block),
|
|
@@ -479,9 +482,9 @@ var usePayloadCountsFromBlock = /* @__PURE__ */ __name((block) => {
|
|
|
479
482
|
|
|
480
483
|
// src/components/block/LinkedDivider.tsx
|
|
481
484
|
import { Divider, Stack } from "@mui/material";
|
|
482
|
-
import
|
|
485
|
+
import React8 from "react";
|
|
483
486
|
var LinkedDivider = /* @__PURE__ */ __name(() => {
|
|
484
|
-
return /* @__PURE__ */
|
|
487
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(Stack, {
|
|
485
488
|
className: "divider-spacer",
|
|
486
489
|
justifyContent: "end",
|
|
487
490
|
sx: {
|
|
@@ -489,7 +492,7 @@ var LinkedDivider = /* @__PURE__ */ __name(() => {
|
|
|
489
492
|
height: 24,
|
|
490
493
|
justifyContent: "end"
|
|
491
494
|
}
|
|
492
|
-
}, /* @__PURE__ */
|
|
495
|
+
}, /* @__PURE__ */ React8.createElement(Divider, {
|
|
493
496
|
className: "divider",
|
|
494
497
|
orientation: "vertical",
|
|
495
498
|
flexItem: true,
|
|
@@ -505,16 +508,16 @@ var LinkedDivider = /* @__PURE__ */ __name(() => {
|
|
|
505
508
|
import { MoreVert } from "@mui/icons-material";
|
|
506
509
|
import { IconButton, Menu } from "@mui/material";
|
|
507
510
|
import { BWJsonMenuItem, BWPreviousHashMenuItem } from "@xyo-network/react-boundwitness-plugin";
|
|
508
|
-
import
|
|
511
|
+
import React9 from "react";
|
|
509
512
|
var BlockMenuExpanded = /* @__PURE__ */ __name(({ block }) => {
|
|
510
513
|
const { anchorEl, anchorRef, open, handleClick, handleClose } = useAnchorElement();
|
|
511
|
-
return /* @__PURE__ */
|
|
514
|
+
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(IconButton, {
|
|
512
515
|
ref: anchorRef,
|
|
513
516
|
size: "small",
|
|
514
517
|
onClick: handleClick
|
|
515
|
-
}, /* @__PURE__ */
|
|
518
|
+
}, /* @__PURE__ */ React9.createElement(MoreVert, {
|
|
516
519
|
fontSize: "inherit"
|
|
517
|
-
})), /* @__PURE__ */
|
|
520
|
+
})), /* @__PURE__ */ React9.createElement(Menu, {
|
|
518
521
|
open,
|
|
519
522
|
anchorEl,
|
|
520
523
|
anchorOrigin: {
|
|
@@ -522,11 +525,11 @@ var BlockMenuExpanded = /* @__PURE__ */ __name(({ block }) => {
|
|
|
522
525
|
vertical: "bottom"
|
|
523
526
|
},
|
|
524
527
|
onClose: handleClose
|
|
525
|
-
}, /* @__PURE__ */
|
|
528
|
+
}, /* @__PURE__ */ React9.createElement(BWPreviousHashMenuItem, {
|
|
526
529
|
boundwitness: block?.[0],
|
|
527
530
|
dense: true,
|
|
528
531
|
onDialogClose: handleClose
|
|
529
|
-
}), /* @__PURE__ */
|
|
532
|
+
}), /* @__PURE__ */ React9.createElement(BWJsonMenuItem, {
|
|
530
533
|
boundwitness: block?.[0],
|
|
531
534
|
dense: true,
|
|
532
535
|
onDialogClose: handleClose
|
|
@@ -537,13 +540,13 @@ var BlockMenuExpanded = /* @__PURE__ */ __name(({ block }) => {
|
|
|
537
540
|
import { Chip as Chip2 } from "@mui/material";
|
|
538
541
|
import { EthAddressWrapper, isString, isUndefined, toAddress } from "@xylabs/sdk-js";
|
|
539
542
|
import { BlockiesAvatar } from "@xyo-network/react-chain-blockies";
|
|
540
|
-
import
|
|
543
|
+
import React11, { useMemo as useMemo4 } from "react";
|
|
541
544
|
|
|
542
545
|
// src/components/block/ChipSkeleton.tsx
|
|
543
546
|
import { Skeleton } from "@mui/material";
|
|
544
|
-
import
|
|
547
|
+
import React10 from "react";
|
|
545
548
|
var ChipSkeleton = /* @__PURE__ */ __name((props) => {
|
|
546
|
-
return /* @__PURE__ */
|
|
549
|
+
return /* @__PURE__ */ React10.createElement(Skeleton, {
|
|
547
550
|
width: 100,
|
|
548
551
|
...props
|
|
549
552
|
});
|
|
@@ -557,7 +560,7 @@ var formatProducerAddress = /* @__PURE__ */ __name((address) => {
|
|
|
557
560
|
}, "formatProducerAddress");
|
|
558
561
|
var BlockProducerChip = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
559
562
|
const blockProducer2 = block?.[0].addresses[0];
|
|
560
|
-
return /* @__PURE__ */
|
|
563
|
+
return /* @__PURE__ */ React11.createElement(BlockAddressChip, {
|
|
561
564
|
address: blockProducer2,
|
|
562
565
|
toolTipTitle: `Block producer: ${blockProducer2}`,
|
|
563
566
|
...props
|
|
@@ -565,16 +568,16 @@ var BlockProducerChip = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
|
565
568
|
}, "BlockProducerChip");
|
|
566
569
|
var BlockAddressChip = /* @__PURE__ */ __name(({ address, sx, toolTipTitle, ...props }) => {
|
|
567
570
|
const shortedBlockProducer = address === void 0 ? null : formatProducerAddress(address);
|
|
568
|
-
const avatar =
|
|
571
|
+
const avatar = useMemo4(() => address === "" ? void 0 : /* @__PURE__ */ React11.createElement(BlockiesAvatar, {
|
|
569
572
|
blockiesOptions: {
|
|
570
573
|
seed: address
|
|
571
574
|
}
|
|
572
575
|
}), [
|
|
573
576
|
address
|
|
574
577
|
]);
|
|
575
|
-
return /* @__PURE__ */
|
|
578
|
+
return /* @__PURE__ */ React11.createElement(Chip2, {
|
|
576
579
|
avatar,
|
|
577
|
-
label: shortedBlockProducer ?? /* @__PURE__ */
|
|
580
|
+
label: shortedBlockProducer ?? /* @__PURE__ */ React11.createElement(ChipSkeleton, {
|
|
578
581
|
width: 115
|
|
579
582
|
}),
|
|
580
583
|
title: toolTipTitle,
|
|
@@ -597,12 +600,12 @@ var BlockHeadingFlexbox = /* @__PURE__ */ __name(({ block, defaultExpanded, tran
|
|
|
597
600
|
event.stopPropagation();
|
|
598
601
|
blockHeadingListener("transaction-count", "click", JSON.stringify(transactions2));
|
|
599
602
|
}, "handleTransactionCountClick");
|
|
600
|
-
return /* @__PURE__ */
|
|
603
|
+
return /* @__PURE__ */ React12.createElement(FlexCol2, {
|
|
601
604
|
className: "block-heading-flexbox",
|
|
602
605
|
alignItems: "stretch",
|
|
603
606
|
ref: blockHeadingRef,
|
|
604
607
|
onClick: /* @__PURE__ */ __name(() => blockHeadingListener("block-hash", "click", hash), "onClick")
|
|
605
|
-
}, /* @__PURE__ */
|
|
608
|
+
}, /* @__PURE__ */ React12.createElement(LinkedDivider, null), /* @__PURE__ */ React12.createElement(HashHeadingPaper, {
|
|
606
609
|
hash,
|
|
607
610
|
heading: block?.[0].block === void 0 ? "" : block?.[0].block.toString(),
|
|
608
611
|
paperProps: {
|
|
@@ -611,24 +614,24 @@ var BlockHeadingFlexbox = /* @__PURE__ */ __name(({ block, defaultExpanded, tran
|
|
|
611
614
|
width: "100%"
|
|
612
615
|
}
|
|
613
616
|
},
|
|
614
|
-
AdornmentEnd: /* @__PURE__ */
|
|
617
|
+
AdornmentEnd: /* @__PURE__ */ React12.createElement(FlexRow2, {
|
|
615
618
|
gap: 1
|
|
616
|
-
}, /* @__PURE__ */
|
|
619
|
+
}, /* @__PURE__ */ React12.createElement(BlockProducerChip, {
|
|
617
620
|
block
|
|
618
|
-
}), /* @__PURE__ */
|
|
621
|
+
}), /* @__PURE__ */ React12.createElement(TransactionCountChip, {
|
|
619
622
|
onClick: /* @__PURE__ */ __name((e) => handleTransactionCountClick(e, transactions ?? []), "onClick"),
|
|
620
623
|
transactions
|
|
621
|
-
}), /* @__PURE__ */
|
|
624
|
+
}), /* @__PURE__ */ React12.createElement(BWVerification, {
|
|
622
625
|
iconColors: true,
|
|
623
626
|
boundwitness: block?.[0]
|
|
624
|
-
}), /* @__PURE__ */
|
|
627
|
+
}), /* @__PURE__ */ React12.createElement("span", {
|
|
625
628
|
style: {
|
|
626
629
|
// maxWidth is required for css animation to work and 28px is the width of the icon button
|
|
627
630
|
display: "flex",
|
|
628
631
|
transition: "max-width .5s",
|
|
629
632
|
maxWidth: expanded ? "28px" : 0
|
|
630
633
|
}
|
|
631
|
-
}, /* @__PURE__ */
|
|
634
|
+
}, /* @__PURE__ */ React12.createElement(BlockMenuExpanded, {
|
|
632
635
|
block
|
|
633
636
|
}))),
|
|
634
637
|
identiconProps: {
|
|
@@ -641,10 +644,10 @@ var BlockHeadingFlexbox = /* @__PURE__ */ __name(({ block, defaultExpanded, tran
|
|
|
641
644
|
// src/components/block/table/cell/BlockNumber.tsx
|
|
642
645
|
import { Link, TableCell, Tooltip, Typography as Typography3 } from "@mui/material";
|
|
643
646
|
import { useEvent as useEvent2 } from "@xyo-network/react-event";
|
|
644
|
-
import
|
|
647
|
+
import React13 from "react";
|
|
645
648
|
var BlockNumberTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
646
649
|
const blockNumber = block?.[0].block;
|
|
647
|
-
return /* @__PURE__ */
|
|
650
|
+
return /* @__PURE__ */ React13.createElement(BlockNumberTableCellInner, {
|
|
648
651
|
blockNumber,
|
|
649
652
|
linked,
|
|
650
653
|
...props
|
|
@@ -653,15 +656,15 @@ var BlockNumberTableCell = /* @__PURE__ */ __name(({ block, linked, ...props })
|
|
|
653
656
|
var BlockNumberTableCellInner = /* @__PURE__ */ __name(({ blockNumber, linked, ...props }) => {
|
|
654
657
|
const [ref, dispatch] = useEvent2();
|
|
655
658
|
const handleClick = /* @__PURE__ */ __name(() => dispatch("block-number", "click", blockNumber?.toString() ?? ""), "handleClick");
|
|
656
|
-
return /* @__PURE__ */
|
|
659
|
+
return /* @__PURE__ */ React13.createElement(TableCell, {
|
|
657
660
|
ref,
|
|
658
661
|
...props
|
|
659
|
-
}, /* @__PURE__ */
|
|
662
|
+
}, /* @__PURE__ */ React13.createElement(Tooltip, {
|
|
660
663
|
title: `Block Number: ${blockNumber}`
|
|
661
|
-
}, /* @__PURE__ */
|
|
664
|
+
}, /* @__PURE__ */ React13.createElement(Typography3, {
|
|
662
665
|
component: "span",
|
|
663
666
|
variant: "body1"
|
|
664
|
-
}, linked ? /* @__PURE__ */
|
|
667
|
+
}, linked ? /* @__PURE__ */ React13.createElement(Link, {
|
|
665
668
|
onClick: handleClick,
|
|
666
669
|
sx: {
|
|
667
670
|
cursor: "pointer"
|
|
@@ -671,8 +674,8 @@ var BlockNumberTableCellInner = /* @__PURE__ */ __name(({ blockNumber, linked, .
|
|
|
671
674
|
|
|
672
675
|
// src/components/block/table/cell/Epoch.tsx
|
|
673
676
|
import { Skeleton as Skeleton2, TableCell as TableCell2, Tooltip as Tooltip2, Typography as Typography4 } from "@mui/material";
|
|
674
|
-
import { isDefined as
|
|
675
|
-
import
|
|
677
|
+
import { isDefined as isDefined3 } from "@xylabs/sdk-js";
|
|
678
|
+
import React14 from "react";
|
|
676
679
|
|
|
677
680
|
// src/components/block/table/cell/lib/timeFunctions.ts
|
|
678
681
|
var dateFormat = Intl.DateTimeFormat(globalThis.navigator.language ?? "en-US", {
|
|
@@ -737,25 +740,25 @@ var timeAgo = /* @__PURE__ */ __name((epoch, locale = navigator.language ?? "en-
|
|
|
737
740
|
var BlockEpochTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
738
741
|
const epoch = block?.[0]?.$epoch;
|
|
739
742
|
const dateTime = dateFormat.format(epoch);
|
|
740
|
-
const age =
|
|
741
|
-
return /* @__PURE__ */
|
|
743
|
+
const age = isDefined3(epoch) ? timeAgo(epoch) : void 0;
|
|
744
|
+
return /* @__PURE__ */ React14.createElement(TableCell2, props, /* @__PURE__ */ React14.createElement(Tooltip2, {
|
|
742
745
|
title: `Block Epoch: ${dateTime}`
|
|
743
|
-
}, /* @__PURE__ */
|
|
746
|
+
}, /* @__PURE__ */ React14.createElement(Typography4, {
|
|
744
747
|
component: "span",
|
|
745
748
|
variant: "body1"
|
|
746
|
-
}, age ?? /* @__PURE__ */
|
|
749
|
+
}, age ?? /* @__PURE__ */ React14.createElement(Skeleton2, {
|
|
747
750
|
width: 115
|
|
748
751
|
}))));
|
|
749
752
|
}, "BlockEpochTableCell");
|
|
750
753
|
var BlockEpochTableCellInner = /* @__PURE__ */ __name(({ epoch, linked, ...props }) => {
|
|
751
754
|
const dateTime = dateFormat.format(epoch);
|
|
752
|
-
const age =
|
|
753
|
-
return /* @__PURE__ */
|
|
755
|
+
const age = isDefined3(epoch) ? timeAgo(epoch) : void 0;
|
|
756
|
+
return /* @__PURE__ */ React14.createElement(TableCell2, props, /* @__PURE__ */ React14.createElement(Tooltip2, {
|
|
754
757
|
title: `Block Epoch: ${dateTime}`
|
|
755
|
-
}, /* @__PURE__ */
|
|
758
|
+
}, /* @__PURE__ */ React14.createElement(Typography4, {
|
|
756
759
|
component: "span",
|
|
757
760
|
variant: "body1"
|
|
758
|
-
}, age ?? /* @__PURE__ */
|
|
761
|
+
}, age ?? /* @__PURE__ */ React14.createElement(Skeleton2, {
|
|
759
762
|
width: 115
|
|
760
763
|
}))));
|
|
761
764
|
}, "BlockEpochTableCellInner");
|
|
@@ -764,12 +767,12 @@ var BlockEpochTableCellInner = /* @__PURE__ */ __name(({ epoch, linked, ...props
|
|
|
764
767
|
import { Link as Link2, TableCell as TableCell3, Tooltip as Tooltip3 } from "@mui/material";
|
|
765
768
|
import { isHash as isHash2 } from "@xylabs/sdk-js";
|
|
766
769
|
import { usePayloadRootHash } from "@xyo-network/react-shared";
|
|
767
|
-
import
|
|
770
|
+
import React16, { useState as useState5 } from "react";
|
|
768
771
|
|
|
769
772
|
// src/components/FeatureNotAvailable.tsx
|
|
770
773
|
import { Button as Button2, Dialog, DialogActions, DialogContent, DialogTitle } from "@mui/material";
|
|
771
|
-
import
|
|
772
|
-
var FeatureNotAvailable = /* @__PURE__ */ __name(({ featureName = "Feature", ...props }) => /* @__PURE__ */
|
|
774
|
+
import React15 from "react";
|
|
775
|
+
var FeatureNotAvailable = /* @__PURE__ */ __name(({ featureName = "Feature", ...props }) => /* @__PURE__ */ React15.createElement(Dialog, props, /* @__PURE__ */ React15.createElement(DialogTitle, null, `${featureName} Not Available`), /* @__PURE__ */ React15.createElement(DialogContent, null, "This feature is not currently available. Either you do not have access to it or it is currently undergoing maintenance."), /* @__PURE__ */ React15.createElement(DialogActions, null, /* @__PURE__ */ React15.createElement(Button2, {
|
|
773
776
|
onClick: /* @__PURE__ */ __name((e) => props.onClose?.(e, "backdropClick"), "onClick")
|
|
774
777
|
}, "Close"))), "FeatureNotAvailable");
|
|
775
778
|
|
|
@@ -802,17 +805,17 @@ var BlockHashTableCell = /* @__PURE__ */ __name(({ block, notAvailableDialog, li
|
|
|
802
805
|
const [ref, handleClick] = useLinkedBlockItem("block-hash", hash);
|
|
803
806
|
const [notAvailable, setNotAvailable] = useState5(false);
|
|
804
807
|
const shortenedHash = isHash2(hash) ? `${hash.slice(0, 4)}...${hash.slice(-5, -1)}` : void 0;
|
|
805
|
-
return /* @__PURE__ */
|
|
808
|
+
return /* @__PURE__ */ React16.createElement(TableCell3, {
|
|
806
809
|
ref,
|
|
807
810
|
...props
|
|
808
|
-
}, /* @__PURE__ */
|
|
811
|
+
}, /* @__PURE__ */ React16.createElement(Tooltip3, {
|
|
809
812
|
title: `Block Hash: ${hash}`
|
|
810
|
-
}, linked ? /* @__PURE__ */
|
|
813
|
+
}, linked ? /* @__PURE__ */ React16.createElement(Link2, {
|
|
811
814
|
sx: {
|
|
812
815
|
cursor: "pointer"
|
|
813
816
|
},
|
|
814
817
|
onClick: linked ? handleClick : () => setNotAvailable(true)
|
|
815
|
-
}, shortenedHash ?? /* @__PURE__ */
|
|
818
|
+
}, shortenedHash ?? /* @__PURE__ */ React16.createElement(ChipSkeleton, null)) : /* @__PURE__ */ React16.createElement("span", null, shortenedHash ?? /* @__PURE__ */ React16.createElement(ChipSkeleton, null))), notAvailableDialog && notAvailable ? /* @__PURE__ */ React16.createElement(FeatureNotAvailable, {
|
|
816
819
|
featureName: "Block Details",
|
|
817
820
|
open: notAvailable,
|
|
818
821
|
onClick: /* @__PURE__ */ __name(() => setNotAvailable(false), "onClick")
|
|
@@ -826,31 +829,31 @@ import { FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
|
|
|
826
829
|
import { ellipsize, isHash as isHash3 } from "@xylabs/sdk-js";
|
|
827
830
|
import { JsonViewerEx } from "@xyo-network/react-payload-raw-info";
|
|
828
831
|
import { usePayloadRootHash as usePayloadRootHash2 } from "@xyo-network/react-shared";
|
|
829
|
-
import
|
|
832
|
+
import React17, { useState as useState6 } from "react";
|
|
830
833
|
var BlockJsonViewTableCell = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
831
834
|
const [open, setOpen] = useState6(false);
|
|
832
835
|
const onClose = /* @__PURE__ */ __name(() => setOpen(false), "onClose");
|
|
833
836
|
const hash = usePayloadRootHash2(block?.[0]);
|
|
834
837
|
const title = isHash3(hash) ? `JSON for ${ellipsize(hash, 5)}` : "JSON";
|
|
835
|
-
return /* @__PURE__ */
|
|
838
|
+
return /* @__PURE__ */ React17.createElement(TableCell4, props, /* @__PURE__ */ React17.createElement(FlexRow3, {
|
|
836
839
|
onClick: /* @__PURE__ */ __name((e) => e.stopPropagation(), "onClick"),
|
|
837
840
|
sx: {
|
|
838
841
|
width: "100%"
|
|
839
842
|
}
|
|
840
|
-
}, /* @__PURE__ */
|
|
843
|
+
}, /* @__PURE__ */ React17.createElement(IconButton2, {
|
|
841
844
|
onClick: /* @__PURE__ */ __name(() => setOpen(true), "onClick")
|
|
842
|
-
}, /* @__PURE__ */
|
|
845
|
+
}, /* @__PURE__ */ React17.createElement(DataObject, null)), /* @__PURE__ */ React17.createElement(Dialog2, {
|
|
843
846
|
open,
|
|
844
847
|
onClose
|
|
845
|
-
}, /* @__PURE__ */
|
|
848
|
+
}, /* @__PURE__ */ React17.createElement(DialogTitle2, null, title), /* @__PURE__ */ React17.createElement(DialogContent2, null, /* @__PURE__ */ React17.createElement(JsonViewerEx, {
|
|
846
849
|
value: block
|
|
847
|
-
})), /* @__PURE__ */
|
|
850
|
+
})), /* @__PURE__ */ React17.createElement(DialogActions2, {
|
|
848
851
|
sx: {
|
|
849
852
|
display: "flex",
|
|
850
853
|
flexDirection: "row",
|
|
851
854
|
justifyContent: "end"
|
|
852
855
|
}
|
|
853
|
-
}, /* @__PURE__ */
|
|
856
|
+
}, /* @__PURE__ */ React17.createElement(Button3, {
|
|
854
857
|
variant: "contained",
|
|
855
858
|
onClick: onClose
|
|
856
859
|
}, "Close")))));
|
|
@@ -859,7 +862,7 @@ var BlockJsonViewTableCell = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
|
859
862
|
// src/components/block/table/cell/PayloadCounts.tsx
|
|
860
863
|
import { Error as Error2 } from "@mui/icons-material";
|
|
861
864
|
import { Link as Link3, TableCell as TableCell5, Tooltip as Tooltip4 } from "@mui/material";
|
|
862
|
-
import
|
|
865
|
+
import React18 from "react";
|
|
863
866
|
var BlockPayloadCountsTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
864
867
|
const [publicPayloads, privatePayloads, error] = usePayloadCountsFromBlock(block);
|
|
865
868
|
const data = block && privatePayloads !== void 0 && publicPayloads !== void 0 ? {
|
|
@@ -869,32 +872,32 @@ var BlockPayloadCountsTableCell = /* @__PURE__ */ __name(({ block, linked, ...pr
|
|
|
869
872
|
} : void 0;
|
|
870
873
|
const payloadCount = (publicPayloads ?? 0) + (privatePayloads ?? 0);
|
|
871
874
|
const [ref, handleClick] = useLinkedBlockItem("payload-counts", data);
|
|
872
|
-
return /* @__PURE__ */
|
|
875
|
+
return /* @__PURE__ */ React18.createElement(TableCell5, {
|
|
873
876
|
ref,
|
|
874
877
|
...props
|
|
875
|
-
}, /* @__PURE__ */
|
|
878
|
+
}, /* @__PURE__ */ React18.createElement("span", null, error ? /* @__PURE__ */ React18.createElement(Tooltip4, {
|
|
876
879
|
title: error.message
|
|
877
|
-
}, /* @__PURE__ */
|
|
880
|
+
}, /* @__PURE__ */ React18.createElement(Error2, {
|
|
878
881
|
color: "error"
|
|
879
|
-
})) : null, linked ? /* @__PURE__ */
|
|
882
|
+
})) : null, linked ? /* @__PURE__ */ React18.createElement(Tooltip4, {
|
|
880
883
|
title: `Public Payloads: ${publicPayloads ?? "--"} Private Payloads: ${privatePayloads ?? "--"}`
|
|
881
|
-
}, /* @__PURE__ */
|
|
884
|
+
}, /* @__PURE__ */ React18.createElement(Link3, {
|
|
882
885
|
onClick: handleClick,
|
|
883
886
|
sx: {
|
|
884
887
|
cursor: "pointer"
|
|
885
888
|
}
|
|
886
|
-
}, payloadCount)) : /* @__PURE__ */
|
|
889
|
+
}, payloadCount)) : /* @__PURE__ */ React18.createElement(Tooltip4, {
|
|
887
890
|
title: `Public Payloads: ${publicPayloads ?? "--"} Private Payloads: ${privatePayloads ?? "--"}`
|
|
888
|
-
}, /* @__PURE__ */
|
|
891
|
+
}, /* @__PURE__ */ React18.createElement("span", null, payloadCount))));
|
|
889
892
|
}, "BlockPayloadCountsTableCell");
|
|
890
893
|
|
|
891
894
|
// src/components/block/table/cell/Producer.tsx
|
|
892
895
|
import { TableCell as TableCell6, Tooltip as Tooltip5 } from "@mui/material";
|
|
893
|
-
import
|
|
896
|
+
import React19, { useState as useState7 } from "react";
|
|
894
897
|
var BlockProducerTableCell = /* @__PURE__ */ __name(({ block, linked, notAvailableDialog, producerChipProps, ...props }) => {
|
|
895
898
|
const [ref, handleClick] = useLinkedBlockItem("block-producer", JSON.stringify(block));
|
|
896
899
|
const producer = useBlockProducer(block);
|
|
897
|
-
return /* @__PURE__ */
|
|
900
|
+
return /* @__PURE__ */ React19.createElement(BlockProducerTableCellInner, {
|
|
898
901
|
address: producer,
|
|
899
902
|
handleClick,
|
|
900
903
|
linked,
|
|
@@ -906,9 +909,9 @@ var BlockProducerTableCell = /* @__PURE__ */ __name(({ block, linked, notAvailab
|
|
|
906
909
|
}, "BlockProducerTableCell");
|
|
907
910
|
var BlockProducerTableCellInner = /* @__PURE__ */ __name(({ address, handleClick, linked, notAvailableDialog, producerChipProps, ...props }) => {
|
|
908
911
|
const [notAvailable, setNotAvailable] = useState7(false);
|
|
909
|
-
return /* @__PURE__ */
|
|
912
|
+
return /* @__PURE__ */ React19.createElement(TableCell6, props, /* @__PURE__ */ React19.createElement(Tooltip5, {
|
|
910
913
|
title: `Block Producer: ${address}`
|
|
911
|
-
}, /* @__PURE__ */
|
|
914
|
+
}, /* @__PURE__ */ React19.createElement(BlockAddressChip, {
|
|
912
915
|
sx: {
|
|
913
916
|
cursor: "pointer"
|
|
914
917
|
},
|
|
@@ -916,7 +919,7 @@ var BlockProducerTableCellInner = /* @__PURE__ */ __name(({ address, handleClick
|
|
|
916
919
|
address,
|
|
917
920
|
toolTipTitle: `Block Producer: ${address}`,
|
|
918
921
|
...producerChipProps
|
|
919
|
-
})), notAvailableDialog && notAvailable ? /* @__PURE__ */
|
|
922
|
+
})), notAvailableDialog && notAvailable ? /* @__PURE__ */ React19.createElement(FeatureNotAvailable, {
|
|
920
923
|
featureName: "Producer Details",
|
|
921
924
|
open: notAvailable,
|
|
922
925
|
onClick: /* @__PURE__ */ __name(() => setNotAvailable(false), "onClick")
|
|
@@ -926,10 +929,10 @@ var BlockProducerTableCellInner = /* @__PURE__ */ __name(({ address, handleClick
|
|
|
926
929
|
// src/components/block/table/cell/TransactionCount.tsx
|
|
927
930
|
import { Error as Error3 } from "@mui/icons-material";
|
|
928
931
|
import { Link as Link4, TableCell as TableCell7, Tooltip as Tooltip6 } from "@mui/material";
|
|
929
|
-
import
|
|
932
|
+
import React20, { useMemo as useMemo5 } from "react";
|
|
930
933
|
var BlockTransactionCountTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
931
934
|
const [transactions, error] = useTxsFromBlock(block);
|
|
932
|
-
const txHashes =
|
|
935
|
+
const txHashes = useMemo5(() => transactions?.map(([, hash]) => hash), [
|
|
933
936
|
transactions
|
|
934
937
|
]);
|
|
935
938
|
const data = block && transactions !== void 0 ? {
|
|
@@ -937,14 +940,14 @@ var BlockTransactionCountTableCell = /* @__PURE__ */ __name(({ block, linked, ..
|
|
|
937
940
|
block: block[0]._hash
|
|
938
941
|
} : void 0;
|
|
939
942
|
const [ref, handleClick] = useLinkedBlockItem("transaction-count", data);
|
|
940
|
-
return /* @__PURE__ */
|
|
943
|
+
return /* @__PURE__ */ React20.createElement(TableCell7, {
|
|
941
944
|
ref,
|
|
942
945
|
...props
|
|
943
|
-
}, /* @__PURE__ */
|
|
946
|
+
}, /* @__PURE__ */ React20.createElement("span", null, error ? /* @__PURE__ */ React20.createElement(Tooltip6, {
|
|
944
947
|
title: error.message
|
|
945
|
-
}, /* @__PURE__ */
|
|
948
|
+
}, /* @__PURE__ */ React20.createElement(Error3, {
|
|
946
949
|
color: "error"
|
|
947
|
-
})) : null, linked ? /* @__PURE__ */
|
|
950
|
+
})) : null, linked ? /* @__PURE__ */ React20.createElement(Link4, {
|
|
948
951
|
onClick: handleClick,
|
|
949
952
|
sx: {
|
|
950
953
|
cursor: "pointer"
|
|
@@ -957,17 +960,17 @@ import { CheckCircleOutlineRounded } from "@mui/icons-material";
|
|
|
957
960
|
import { TableCell as TableCell8 } from "@mui/material";
|
|
958
961
|
import { FlexRow as FlexRow4 } from "@xylabs/react-flexbox";
|
|
959
962
|
import { BWVerification as BWVerification2 } from "@xyo-network/react-boundwitness-plugin";
|
|
960
|
-
import
|
|
963
|
+
import React21 from "react";
|
|
961
964
|
var BlockVerificationTableCell = /* @__PURE__ */ __name(({ block, linked, deepValidation, ...props }) => {
|
|
962
|
-
return /* @__PURE__ */
|
|
965
|
+
return /* @__PURE__ */ React21.createElement(TableCell8, props, /* @__PURE__ */ React21.createElement(FlexRow4, {
|
|
963
966
|
onClick: /* @__PURE__ */ __name((e) => e.stopPropagation(), "onClick"),
|
|
964
967
|
sx: {
|
|
965
968
|
width: "100%"
|
|
966
969
|
}
|
|
967
|
-
}, deepValidation ? /* @__PURE__ */
|
|
970
|
+
}, deepValidation ? /* @__PURE__ */ React21.createElement(BWVerification2, {
|
|
968
971
|
iconColors: true,
|
|
969
972
|
boundwitness: block?.[0]
|
|
970
|
-
}) : /* @__PURE__ */
|
|
973
|
+
}) : /* @__PURE__ */ React21.createElement(CheckCircleOutlineRounded, {
|
|
971
974
|
color: "success"
|
|
972
975
|
})));
|
|
973
976
|
}, "BlockVerificationTableCell");
|
|
@@ -975,57 +978,57 @@ var BlockVerificationTableCell = /* @__PURE__ */ __name(({ block, linked, deepVa
|
|
|
975
978
|
// src/components/block/table/Ex.tsx
|
|
976
979
|
import { TableBody } from "@mui/material";
|
|
977
980
|
import { TableEx } from "@xyo-network/react-table";
|
|
978
|
-
import
|
|
981
|
+
import React23 from "react";
|
|
979
982
|
|
|
980
983
|
// src/components/block/table/head/TableHead.tsx
|
|
981
984
|
import { InfoOutline } from "@mui/icons-material";
|
|
982
985
|
import { TableCell as TableCell9, TableHead, TableRow, Tooltip as Tooltip7, Typography as Typography5 } from "@mui/material";
|
|
983
986
|
import { FlexRow as FlexRow5 } from "@xylabs/react-flexbox";
|
|
984
|
-
import
|
|
987
|
+
import React22 from "react";
|
|
985
988
|
var ToolTipTableCell = /* @__PURE__ */ __name(({ children, align, title, ...props }) => {
|
|
986
|
-
return /* @__PURE__ */
|
|
989
|
+
return /* @__PURE__ */ React22.createElement(TableCell9, {
|
|
987
990
|
title,
|
|
988
991
|
...props
|
|
989
|
-
}, /* @__PURE__ */
|
|
992
|
+
}, /* @__PURE__ */ React22.createElement(FlexRow5, {
|
|
990
993
|
justifyContent: align
|
|
991
|
-
}, /* @__PURE__ */
|
|
994
|
+
}, /* @__PURE__ */ React22.createElement(Typography5, {
|
|
992
995
|
variant: "body2"
|
|
993
|
-
}, children), "\xA0", /* @__PURE__ */
|
|
996
|
+
}, children), "\xA0", /* @__PURE__ */ React22.createElement(Tooltip7, {
|
|
994
997
|
title
|
|
995
|
-
}, /* @__PURE__ */
|
|
998
|
+
}, /* @__PURE__ */ React22.createElement(InfoOutline, {
|
|
996
999
|
fontSize: "small"
|
|
997
1000
|
}))));
|
|
998
1001
|
}, "ToolTipTableCell");
|
|
999
1002
|
var BlockchainTableHead = /* @__PURE__ */ __name(() => {
|
|
1000
|
-
return /* @__PURE__ */
|
|
1003
|
+
return /* @__PURE__ */ React22.createElement(TableHead, null, /* @__PURE__ */ React22.createElement(TableRow, null, /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1001
1004
|
align: "left",
|
|
1002
1005
|
title: "The block number that is included in the block"
|
|
1003
|
-
}, "Block"), /* @__PURE__ */
|
|
1006
|
+
}, "Block"), /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1004
1007
|
title: "The hash of the block",
|
|
1005
1008
|
sx: {
|
|
1006
1009
|
width: "20%"
|
|
1007
1010
|
}
|
|
1008
|
-
}, "Hash"), /* @__PURE__ */
|
|
1011
|
+
}, "Hash"), /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1009
1012
|
title: "The epoch of the block",
|
|
1010
1013
|
sx: {
|
|
1011
1014
|
width: "20%"
|
|
1012
1015
|
}
|
|
1013
|
-
}, "Epoch"), /* @__PURE__ */
|
|
1016
|
+
}, "Epoch"), /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1014
1017
|
align: "left",
|
|
1015
1018
|
title: "The address of the block producer that produced the block",
|
|
1016
1019
|
sx: {
|
|
1017
1020
|
width: "20%"
|
|
1018
1021
|
}
|
|
1019
|
-
}, "Block Producer"), /* @__PURE__ */
|
|
1022
|
+
}, "Block Producer"), /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1020
1023
|
align: "left",
|
|
1021
1024
|
title: "Count of transactions that are included in the block"
|
|
1022
|
-
}, "Transactions"), /* @__PURE__ */
|
|
1025
|
+
}, "Transactions"), /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1023
1026
|
align: "left",
|
|
1024
1027
|
title: "Count of public and private payload counts for the block"
|
|
1025
|
-
}, "Payloads"), /* @__PURE__ */
|
|
1028
|
+
}, "Payloads"), /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1026
1029
|
align: "center",
|
|
1027
1030
|
title: "The result of the local validation check for the block"
|
|
1028
|
-
}, "Valid"), /* @__PURE__ */
|
|
1031
|
+
}, "Valid"), /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1029
1032
|
align: "center",
|
|
1030
1033
|
title: "Link to display the raw JSON of the block"
|
|
1031
1034
|
}, "JSON")));
|
|
@@ -1033,10 +1036,10 @@ var BlockchainTableHead = /* @__PURE__ */ __name(() => {
|
|
|
1033
1036
|
|
|
1034
1037
|
// src/components/block/table/Ex.tsx
|
|
1035
1038
|
var BlockchainTableEx = /* @__PURE__ */ __name(({ ref, children, ...props }) => {
|
|
1036
|
-
return /* @__PURE__ */
|
|
1039
|
+
return /* @__PURE__ */ React23.createElement(TableEx, {
|
|
1037
1040
|
ref,
|
|
1038
1041
|
...props
|
|
1039
|
-
}, /* @__PURE__ */
|
|
1042
|
+
}, /* @__PURE__ */ React23.createElement(BlockchainTableHead, null), /* @__PURE__ */ React23.createElement(TableBody, null, children));
|
|
1040
1043
|
}, "BlockchainTableEx");
|
|
1041
1044
|
BlockchainTableEx.displayName = "BlockchainTableEx";
|
|
1042
1045
|
|
|
@@ -1044,16 +1047,16 @@ BlockchainTableEx.displayName = "BlockchainTableEx";
|
|
|
1044
1047
|
import { TableRow as TableRow2, useTheme } from "@mui/material";
|
|
1045
1048
|
import { alphaCss } from "@xylabs/react-theme";
|
|
1046
1049
|
import { usePayloadRootHash as usePayloadRootHash3 } from "@xyo-network/react-shared";
|
|
1047
|
-
import
|
|
1050
|
+
import React24, { useMemo as useMemo6 } from "react";
|
|
1048
1051
|
var BlockChainTableRow = /* @__PURE__ */ __name(({ block, deepValidation, defaultExpanded, linked, sx, ...props }) => {
|
|
1049
|
-
const linkedTableCellProps =
|
|
1052
|
+
const linkedTableCellProps = useMemo6(() => ({
|
|
1050
1053
|
block,
|
|
1051
1054
|
linked
|
|
1052
1055
|
}), [
|
|
1053
1056
|
block,
|
|
1054
1057
|
linked
|
|
1055
1058
|
]);
|
|
1056
|
-
const defaultTableCellProps =
|
|
1059
|
+
const defaultTableCellProps = useMemo6(() => ({
|
|
1057
1060
|
block
|
|
1058
1061
|
}), [
|
|
1059
1062
|
block
|
|
@@ -1061,7 +1064,7 @@ var BlockChainTableRow = /* @__PURE__ */ __name(({ block, deepValidation, defaul
|
|
|
1061
1064
|
const hash = usePayloadRootHash3(block?.[0]);
|
|
1062
1065
|
const [ref, handleClick] = useLinkedBlockItem("block-hash", hash);
|
|
1063
1066
|
const theme = useTheme();
|
|
1064
|
-
return /* @__PURE__ */
|
|
1067
|
+
return /* @__PURE__ */ React24.createElement(TableRow2, {
|
|
1065
1068
|
onClick: linked ? handleClick : void 0,
|
|
1066
1069
|
ref,
|
|
1067
1070
|
sx: {
|
|
@@ -1073,47 +1076,47 @@ var BlockChainTableRow = /* @__PURE__ */ __name(({ block, deepValidation, defaul
|
|
|
1073
1076
|
...sx
|
|
1074
1077
|
},
|
|
1075
1078
|
...props
|
|
1076
|
-
}, /* @__PURE__ */
|
|
1079
|
+
}, /* @__PURE__ */ React24.createElement(BlockNumberTableCell, {
|
|
1077
1080
|
align: "left",
|
|
1078
1081
|
...linkedTableCellProps
|
|
1079
|
-
}), /* @__PURE__ */
|
|
1082
|
+
}), /* @__PURE__ */ React24.createElement(BlockHashTableCell, {
|
|
1080
1083
|
align: "left",
|
|
1081
1084
|
...linkedTableCellProps
|
|
1082
|
-
}), /* @__PURE__ */
|
|
1085
|
+
}), /* @__PURE__ */ React24.createElement(BlockEpochTableCell, {
|
|
1083
1086
|
align: "left",
|
|
1084
1087
|
...linkedTableCellProps
|
|
1085
|
-
}), /* @__PURE__ */
|
|
1088
|
+
}), /* @__PURE__ */ React24.createElement(BlockProducerTableCell, {
|
|
1086
1089
|
align: "left",
|
|
1087
1090
|
...linkedTableCellProps
|
|
1088
|
-
}), /* @__PURE__ */
|
|
1091
|
+
}), /* @__PURE__ */ React24.createElement(BlockTransactionCountTableCell, {
|
|
1089
1092
|
align: "left",
|
|
1090
1093
|
...linkedTableCellProps
|
|
1091
|
-
}), /* @__PURE__ */
|
|
1094
|
+
}), /* @__PURE__ */ React24.createElement(BlockPayloadCountsTableCell, {
|
|
1092
1095
|
align: "left",
|
|
1093
1096
|
...linkedTableCellProps
|
|
1094
|
-
}), /* @__PURE__ */
|
|
1097
|
+
}), /* @__PURE__ */ React24.createElement(BlockVerificationTableCell, {
|
|
1095
1098
|
deepValidation,
|
|
1096
1099
|
...defaultTableCellProps
|
|
1097
|
-
}), /* @__PURE__ */
|
|
1100
|
+
}), /* @__PURE__ */ React24.createElement(BlockJsonViewTableCell, defaultTableCellProps));
|
|
1098
1101
|
}, "BlockChainTableRow");
|
|
1099
1102
|
|
|
1100
1103
|
// src/components/account/table/cell/AddressTableCell.tsx
|
|
1101
1104
|
import { TableCell as TableCell10, Tooltip as Tooltip8 } from "@mui/material";
|
|
1102
1105
|
import { useEvent as useEvent4 } from "@xyo-network/react-event";
|
|
1103
|
-
import
|
|
1106
|
+
import React25 from "react";
|
|
1104
1107
|
var AddressTableCell = /* @__PURE__ */ __name(({ address, linked, toolTipTitle, sx, ...props }) => {
|
|
1105
1108
|
const [ref, dispatch] = useEvent4();
|
|
1106
1109
|
const handleClick = /* @__PURE__ */ __name(() => dispatch("address", "click", address), "handleClick");
|
|
1107
|
-
return /* @__PURE__ */
|
|
1110
|
+
return /* @__PURE__ */ React25.createElement(TableCell10, {
|
|
1108
1111
|
ref,
|
|
1109
1112
|
sx: {
|
|
1110
1113
|
cursor: linked ? "pointer" : "default",
|
|
1111
1114
|
...sx
|
|
1112
1115
|
},
|
|
1113
1116
|
...props
|
|
1114
|
-
}, /* @__PURE__ */
|
|
1117
|
+
}, /* @__PURE__ */ React25.createElement(Tooltip8, {
|
|
1115
1118
|
title: toolTipTitle
|
|
1116
|
-
}, /* @__PURE__ */
|
|
1119
|
+
}, /* @__PURE__ */ React25.createElement(BlockAddressChip, {
|
|
1117
1120
|
address,
|
|
1118
1121
|
onClick: handleClick
|
|
1119
1122
|
})));
|
|
@@ -1121,22 +1124,22 @@ var AddressTableCell = /* @__PURE__ */ __name(({ address, linked, toolTipTitle,
|
|
|
1121
1124
|
|
|
1122
1125
|
// src/components/account/table/cell/HashTableCell.tsx
|
|
1123
1126
|
import { Link as Link5, TableCell as TableCell11, Tooltip as Tooltip9, Typography as Typography6 } from "@mui/material";
|
|
1124
|
-
import { ellipsize as ellipsize2, isDefined as
|
|
1127
|
+
import { ellipsize as ellipsize2, isDefined as isDefined4 } from "@xylabs/sdk-js";
|
|
1125
1128
|
import { useEvent as useEvent5 } from "@xyo-network/react-event";
|
|
1126
|
-
import
|
|
1129
|
+
import React26 from "react";
|
|
1127
1130
|
var HashTableCell = /* @__PURE__ */ __name(({ hash, linked, toolTipTitle, sx, ...props }) => {
|
|
1128
1131
|
const [ref, dispatch] = useEvent5();
|
|
1129
1132
|
const handleClick = /* @__PURE__ */ __name(() => dispatch("tx-hash", "click", hash), "handleClick");
|
|
1130
|
-
const shortenedHash =
|
|
1131
|
-
return /* @__PURE__ */
|
|
1133
|
+
const shortenedHash = isDefined4(hash) ? ellipsize2(hash, 6) : "N/A";
|
|
1134
|
+
return /* @__PURE__ */ React26.createElement(TableCell11, {
|
|
1132
1135
|
ref,
|
|
1133
1136
|
...props
|
|
1134
|
-
}, hash ? /* @__PURE__ */
|
|
1137
|
+
}, hash ? /* @__PURE__ */ React26.createElement(Tooltip9, {
|
|
1135
1138
|
title: toolTipTitle
|
|
1136
|
-
}, /* @__PURE__ */
|
|
1139
|
+
}, /* @__PURE__ */ React26.createElement(Typography6, {
|
|
1137
1140
|
component: "span",
|
|
1138
1141
|
variant: "body1"
|
|
1139
|
-
}, linked ? /* @__PURE__ */
|
|
1142
|
+
}, linked ? /* @__PURE__ */ React26.createElement(Link5, {
|
|
1140
1143
|
onClick: handleClick,
|
|
1141
1144
|
sx: {
|
|
1142
1145
|
cursor: "pointer"
|
|
@@ -1146,15 +1149,15 @@ var HashTableCell = /* @__PURE__ */ __name(({ hash, linked, toolTipTitle, sx, ..
|
|
|
1146
1149
|
|
|
1147
1150
|
// src/components/account/table/RawAmountTableCell.tsx
|
|
1148
1151
|
import { Link as Link6, TableCell as TableCell12, Tooltip as Tooltip10 } from "@mui/material";
|
|
1149
|
-
import { isDefined as
|
|
1152
|
+
import { isDefined as isDefined5, toHex as toHex2 } from "@xylabs/sdk-js";
|
|
1150
1153
|
import { useEvent as useEvent6 } from "@xyo-network/react-event";
|
|
1151
1154
|
import { XL1Amount as XL1Amount2 } from "@xyo-network/xl1-protocol";
|
|
1152
|
-
import
|
|
1155
|
+
import React27 from "react";
|
|
1153
1156
|
var RawAmountTableCell = /* @__PURE__ */ __name(({ amount, linked, sx, type, ...props }) => {
|
|
1154
1157
|
const [ref, dispatch] = useEvent6();
|
|
1155
|
-
const handleClick = /* @__PURE__ */ __name(() => dispatch("amount", "click",
|
|
1158
|
+
const handleClick = /* @__PURE__ */ __name(() => dispatch("amount", "click", isDefined5(amount) ? toHex2(amount) : ""), "handleClick");
|
|
1156
1159
|
const formatAmount = /* @__PURE__ */ __name((amount2) => {
|
|
1157
|
-
if (!
|
|
1160
|
+
if (!isDefined5(amount2)) {
|
|
1158
1161
|
return "N/A";
|
|
1159
1162
|
}
|
|
1160
1163
|
const xl1Amount = new XL1Amount2(amount2);
|
|
@@ -1166,52 +1169,52 @@ var RawAmountTableCell = /* @__PURE__ */ __name(({ amount, linked, sx, type, ...
|
|
|
1166
1169
|
locale: navigator.language
|
|
1167
1170
|
});
|
|
1168
1171
|
}, "formatAmount");
|
|
1169
|
-
return /* @__PURE__ */
|
|
1172
|
+
return /* @__PURE__ */ React27.createElement(TableCell12, {
|
|
1170
1173
|
ref,
|
|
1171
1174
|
...props
|
|
1172
|
-
}, /* @__PURE__ */
|
|
1175
|
+
}, /* @__PURE__ */ React27.createElement(Tooltip10, {
|
|
1173
1176
|
title: `Raw Amount: ${amount}`
|
|
1174
|
-
}, linked ? /* @__PURE__ */
|
|
1177
|
+
}, linked ? /* @__PURE__ */ React27.createElement(Link6, {
|
|
1175
1178
|
onClick: handleClick,
|
|
1176
1179
|
sx: {
|
|
1177
1180
|
cursor: "pointer"
|
|
1178
1181
|
}
|
|
1179
|
-
}, type === "send" ? "-" : "", formatAmount(amount)) : /* @__PURE__ */
|
|
1182
|
+
}, type === "send" ? "-" : "", formatAmount(amount)) : /* @__PURE__ */ React27.createElement("span", null, type === "send" ? "-" : "", formatAmount(amount))));
|
|
1180
1183
|
}, "RawAmountTableCell");
|
|
1181
1184
|
|
|
1182
1185
|
// src/components/account/table/BalanceHistoryTableRow.tsx
|
|
1183
1186
|
var BalanceHistoryTableRow = /* @__PURE__ */ __name(({ linked, row, ...props }) => {
|
|
1184
1187
|
const { amount, blockNumber, debug, from, key, timestamp, to, type, txHash } = row ?? {};
|
|
1185
|
-
const linkedTableCallProps =
|
|
1188
|
+
const linkedTableCallProps = useMemo7(() => ({
|
|
1186
1189
|
linked
|
|
1187
1190
|
}), [
|
|
1188
1191
|
linked
|
|
1189
1192
|
]);
|
|
1190
|
-
return /* @__PURE__ */
|
|
1193
|
+
return /* @__PURE__ */ React28.createElement(TableRow3, {
|
|
1191
1194
|
key,
|
|
1192
1195
|
...props
|
|
1193
|
-
}, /* @__PURE__ */
|
|
1196
|
+
}, /* @__PURE__ */ React28.createElement(HashTableCell, {
|
|
1194
1197
|
hash: txHash,
|
|
1195
1198
|
toolTipTitle: `Transaction Hash: ${txHash}`,
|
|
1196
1199
|
...linkedTableCallProps
|
|
1197
|
-
}), /* @__PURE__ */
|
|
1200
|
+
}), /* @__PURE__ */ React28.createElement(BlockNumberTableCellInner, {
|
|
1198
1201
|
blockNumber,
|
|
1199
1202
|
...linkedTableCallProps
|
|
1200
|
-
}), /* @__PURE__ */
|
|
1203
|
+
}), /* @__PURE__ */ React28.createElement(BlockEpochTableCellInner, {
|
|
1201
1204
|
epoch: timestamp,
|
|
1202
1205
|
...linkedTableCallProps
|
|
1203
|
-
}), /* @__PURE__ */
|
|
1206
|
+
}), /* @__PURE__ */ React28.createElement(AddressTableCell, {
|
|
1204
1207
|
address: from,
|
|
1205
1208
|
toolTipTitle: `From Address: ${from}`,
|
|
1206
1209
|
...linkedTableCallProps
|
|
1207
|
-
}), /* @__PURE__ */
|
|
1210
|
+
}), /* @__PURE__ */ React28.createElement(AddressTableCell, {
|
|
1208
1211
|
address: to,
|
|
1209
1212
|
toolTipTitle: `To Address: ${to}`,
|
|
1210
1213
|
...linkedTableCallProps
|
|
1211
|
-
}), /* @__PURE__ */
|
|
1214
|
+
}), /* @__PURE__ */ React28.createElement(RawAmountTableCell, {
|
|
1212
1215
|
amount,
|
|
1213
1216
|
type
|
|
1214
|
-
}), /* @__PURE__ */
|
|
1217
|
+
}), /* @__PURE__ */ React28.createElement(TableCell13, null, /* @__PURE__ */ React28.createElement(RawInfoIconButton, {
|
|
1215
1218
|
rawValue: debug
|
|
1216
1219
|
})));
|
|
1217
1220
|
}, "BalanceHistoryTableRow");
|
|
@@ -1229,9 +1232,9 @@ var TableHeadingLabels = [
|
|
|
1229
1232
|
|
|
1230
1233
|
// src/components/account/table/BalanceHistoryTableEx.tsx
|
|
1231
1234
|
var AccountBalanceHistoryTableEx = /* @__PURE__ */ __name(({ history, linked, ...props }) => {
|
|
1232
|
-
return
|
|
1235
|
+
return isDefined6(history) ? /* @__PURE__ */ React29.createElement(TableEx2, props, /* @__PURE__ */ React29.createElement(TableHead2, null, /* @__PURE__ */ React29.createElement(TableRow4, null, TableHeadingLabels.map((heading) => /* @__PURE__ */ React29.createElement(TableCell14, {
|
|
1233
1236
|
key: heading
|
|
1234
|
-
}, heading)))), /* @__PURE__ */
|
|
1237
|
+
}, heading)))), /* @__PURE__ */ React29.createElement(TableBody2, null, history?.map((row) => /* @__PURE__ */ React29.createElement(BalanceHistoryTableRow, {
|
|
1235
1238
|
key: row.key,
|
|
1236
1239
|
linked,
|
|
1237
1240
|
row
|
|
@@ -1248,46 +1251,41 @@ var AccountBalanceHistoryFlexBox = /* @__PURE__ */ __name(({ address, refresh, v
|
|
|
1248
1251
|
],
|
|
1249
1252
|
history: void 0
|
|
1250
1253
|
};
|
|
1251
|
-
return
|
|
1254
|
+
return isDefined7(history) && isDefined7(address) ? /* @__PURE__ */ React30.createElement(FlexCol3, props, /* @__PURE__ */ React30.createElement(ErrorRender3, {
|
|
1252
1255
|
error,
|
|
1253
1256
|
scope: "AccountBalanceHistoryTable"
|
|
1254
|
-
}), /* @__PURE__ */
|
|
1257
|
+
}), /* @__PURE__ */ React30.createElement(Typography7, {
|
|
1255
1258
|
variant: "h6",
|
|
1256
1259
|
gutterBottom: true
|
|
1257
|
-
}, formatBalanceMagnitude(balance)), truncated ? /* @__PURE__ */
|
|
1260
|
+
}, formatBalanceMagnitude(balance)), truncated ? /* @__PURE__ */ React30.createElement(Typography7, {
|
|
1258
1261
|
variant: "caption",
|
|
1259
1262
|
gutterBottom: true
|
|
1260
|
-
}, "Ranged Balance from", " ", history.at(-1).blockNumber, " ", "-", " ", history[0].blockNumber) : null, /* @__PURE__ */
|
|
1263
|
+
}, "Ranged Balance from", " ", history.at(-1).blockNumber, " ", "-", " ", history[0].blockNumber) : null, /* @__PURE__ */ React30.createElement(AccountBalanceHistoryTableEx, {
|
|
1261
1264
|
history
|
|
1262
1265
|
})) : null;
|
|
1263
1266
|
}, "AccountBalanceHistoryFlexBox");
|
|
1264
1267
|
|
|
1265
1268
|
// src/components/account/hooks/usePagedAccountBalanceHistory.ts
|
|
1266
|
-
import { isDefined as
|
|
1269
|
+
import { isDefined as isDefined8 } from "@xylabs/sdk-js";
|
|
1267
1270
|
import { useAccountBalanceHistory as useAccountBalanceHistory2 } from "@xyo-network/react-chain-provider";
|
|
1268
|
-
import { useCallback,
|
|
1271
|
+
import { useCallback, useState as useState8 } from "react";
|
|
1269
1272
|
var usePagedAccountBalanceHistory = /* @__PURE__ */ __name((address, viewer, maxPage = 1) => {
|
|
1270
1273
|
const [updatedBlockRange, setUpdatedBlockRange] = useState8();
|
|
1271
1274
|
const [pagedHistory, setPagedHistory] = useState8();
|
|
1272
1275
|
const [results, error, loading] = useAccountBalanceHistory2(address, viewer, maxPage, updatedBlockRange);
|
|
1273
1276
|
const { history, truncated } = results || {};
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
history
|
|
1285
|
-
]);
|
|
1286
|
-
const firstBlock = isDefined7(history) ? history.at(0)?.blockNumber : void 0;
|
|
1287
|
-
const lastBlock = isDefined7(history) ? history.at(-1)?.blockNumber : void 0;
|
|
1288
|
-
const historyComplete = isDefined7(history) && history.length === 0;
|
|
1277
|
+
const [previousHistory, setPreviousHistory] = useState8(history);
|
|
1278
|
+
if (isDefined8(history) && history !== previousHistory) {
|
|
1279
|
+
setPagedHistory([
|
|
1280
|
+
...pagedHistory ?? [],
|
|
1281
|
+
...history
|
|
1282
|
+
]);
|
|
1283
|
+
setPreviousHistory(history);
|
|
1284
|
+
}
|
|
1285
|
+
const lastBlock = isDefined8(history) ? history.at(-1)?.blockNumber : void 0;
|
|
1286
|
+
const historyComplete = isDefined8(history) && history.length === 0;
|
|
1289
1287
|
const updateRange = useCallback(() => {
|
|
1290
|
-
if (
|
|
1288
|
+
if (isDefined8(lastBlock) && lastBlock > 0 && truncated) {
|
|
1291
1289
|
const newEndBlock = lastBlock - 1;
|
|
1292
1290
|
setUpdatedBlockRange([
|
|
1293
1291
|
0,
|
|
@@ -1295,7 +1293,6 @@ var usePagedAccountBalanceHistory = /* @__PURE__ */ __name((address, viewer, max
|
|
|
1295
1293
|
]);
|
|
1296
1294
|
}
|
|
1297
1295
|
}, [
|
|
1298
|
-
firstBlock,
|
|
1299
1296
|
lastBlock,
|
|
1300
1297
|
truncated
|
|
1301
1298
|
]);
|
|
@@ -1312,29 +1309,29 @@ var usePagedAccountBalanceHistory = /* @__PURE__ */ __name((address, viewer, max
|
|
|
1312
1309
|
import { Autorenew, Pause } from "@mui/icons-material";
|
|
1313
1310
|
import { Alert as Alert3, AlertTitle as AlertTitle2, Grow, Icon as Icon2, IconButton as IconButton4, Tooltip as Tooltip11 } from "@mui/material";
|
|
1314
1311
|
import { FlexRow as FlexRow6 } from "@xylabs/react-flexbox";
|
|
1315
|
-
import
|
|
1312
|
+
import React35, { memo } from "react";
|
|
1316
1313
|
|
|
1317
1314
|
// src/components/chain/stats/Dialog.tsx
|
|
1318
1315
|
import { QueryStats } from "@mui/icons-material";
|
|
1319
1316
|
import { Dialog as Dialog3, DialogContent as DialogContent3, DialogTitle as DialogTitle3, IconButton as IconButton3 } from "@mui/material";
|
|
1320
|
-
import
|
|
1317
|
+
import React33, { useState as useState9 } from "react";
|
|
1321
1318
|
|
|
1322
1319
|
// src/components/chain/stats/producer/ProducerFlexbox.tsx
|
|
1323
1320
|
import { ListItem, styled, Typography as Typography8 } from "@mui/material";
|
|
1324
1321
|
import { ErrorRender as ErrorRender4 } from "@xylabs/react-error";
|
|
1325
1322
|
import { FlexCol as FlexCol4 } from "@xylabs/react-flexbox";
|
|
1326
1323
|
import { isChainSummaryProducers } from "@xyo-network/chain-analyze";
|
|
1327
|
-
import
|
|
1324
|
+
import React32, { useMemo as useMemo8 } from "react";
|
|
1328
1325
|
|
|
1329
1326
|
// src/components/chain/stats/producer/Table.tsx
|
|
1330
1327
|
import { Table, TableBody as TableBody3, TableCell as TableCell15, TableHead as TableHead3, TableRow as TableRow5, useTheme as useTheme2 } from "@mui/material";
|
|
1331
1328
|
import { BlockiesAvatar as BlockiesAvatar2 } from "@xyo-network/react-chain-blockies";
|
|
1332
|
-
import
|
|
1329
|
+
import React31 from "react";
|
|
1333
1330
|
var ChainProducerStatsTable = /* @__PURE__ */ __name(({ producers, ...props }) => {
|
|
1334
1331
|
const theme = useTheme2();
|
|
1335
|
-
return /* @__PURE__ */
|
|
1332
|
+
return /* @__PURE__ */ React31.createElement(Table, props, /* @__PURE__ */ React31.createElement(TableHead3, null, /* @__PURE__ */ React31.createElement(TableRow5, null, /* @__PURE__ */ React31.createElement(TableCell15, null, "Address"), /* @__PURE__ */ React31.createElement(TableCell15, null, "Blocks Produced"), /* @__PURE__ */ React31.createElement(TableCell15, null, "Rewards Earned Produced"))), /* @__PURE__ */ React31.createElement(TableBody3, null, producers?.map((producer) => /* @__PURE__ */ React31.createElement(TableRow5, {
|
|
1336
1333
|
key: producer.address
|
|
1337
|
-
}, /* @__PURE__ */
|
|
1334
|
+
}, /* @__PURE__ */ React31.createElement(TableCell15, null, /* @__PURE__ */ React31.createElement(BlockiesAvatar2, {
|
|
1338
1335
|
blockiesOptions: {
|
|
1339
1336
|
seed: producer.address
|
|
1340
1337
|
},
|
|
@@ -1342,12 +1339,12 @@ var ChainProducerStatsTable = /* @__PURE__ */ __name(({ producers, ...props }) =
|
|
|
1342
1339
|
height: theme.spacing(2.75),
|
|
1343
1340
|
width: theme.spacing(2.75)
|
|
1344
1341
|
}
|
|
1345
|
-
})), /* @__PURE__ */
|
|
1342
|
+
})), /* @__PURE__ */ React31.createElement(TableCell15, null, producer.blocksProduced.toString()), /* @__PURE__ */ React31.createElement(TableCell15, null, producer.rewardsEarned.toString())))));
|
|
1346
1343
|
}, "ChainProducerStatsTable");
|
|
1347
1344
|
|
|
1348
1345
|
// src/components/chain/stats/producer/ProducerFlexbox.tsx
|
|
1349
1346
|
var BlockProducerStatsFlexbox = /* @__PURE__ */ __name(({ payload, ...props }) => {
|
|
1350
|
-
const [producer, producerError] =
|
|
1347
|
+
const [producer, producerError] = useMemo8(() => {
|
|
1351
1348
|
if (payload) {
|
|
1352
1349
|
return isChainSummaryProducers(payload) ? [
|
|
1353
1350
|
payload
|
|
@@ -1361,19 +1358,19 @@ var BlockProducerStatsFlexbox = /* @__PURE__ */ __name(({ payload, ...props }) =
|
|
|
1361
1358
|
}, [
|
|
1362
1359
|
payload
|
|
1363
1360
|
]);
|
|
1364
|
-
const producersArray =
|
|
1361
|
+
const producersArray = useMemo8(() => Object.values(producer?.producers ?? {}), [
|
|
1365
1362
|
producer
|
|
1366
1363
|
]);
|
|
1367
|
-
return /* @__PURE__ */
|
|
1364
|
+
return /* @__PURE__ */ React32.createElement(FlexCol4, {
|
|
1368
1365
|
alignItems: "start",
|
|
1369
1366
|
gap: 1,
|
|
1370
1367
|
...props
|
|
1371
|
-
}, /* @__PURE__ */
|
|
1368
|
+
}, /* @__PURE__ */ React32.createElement(ErrorRender4, {
|
|
1372
1369
|
error: producerError,
|
|
1373
1370
|
scope: "BlockProducerStatsFlexbox"
|
|
1374
|
-
}), /* @__PURE__ */
|
|
1371
|
+
}), /* @__PURE__ */ React32.createElement(Typography8, {
|
|
1375
1372
|
fontSize: "1rem"
|
|
1376
|
-
}, "Block Producers"), /* @__PURE__ */
|
|
1373
|
+
}, "Block Producers"), /* @__PURE__ */ React32.createElement(ChainProducerStatsTable, {
|
|
1377
1374
|
producers: producersArray
|
|
1378
1375
|
}));
|
|
1379
1376
|
}, "BlockProducerStatsFlexbox");
|
|
@@ -1385,18 +1382,18 @@ var StyledListItem = styled(ListItem)(() => ({
|
|
|
1385
1382
|
// src/components/chain/stats/Dialog.tsx
|
|
1386
1383
|
var ChainAnalyzerStatsDialog = /* @__PURE__ */ __name((props) => {
|
|
1387
1384
|
const { analyzers, statsUpdated } = useChainAnalyzersContext();
|
|
1388
|
-
return /* @__PURE__ */
|
|
1385
|
+
return /* @__PURE__ */ React33.createElement(Dialog3, props, /* @__PURE__ */ React33.createElement(DialogTitle3, null, "Chain Analysis"), /* @__PURE__ */ React33.createElement(DialogContent3, null, statsUpdated > 0 ? Object.entries(analyzers).map(([id2, analyzer]) => /* @__PURE__ */ React33.createElement("div", {
|
|
1389
1386
|
key: id2
|
|
1390
|
-
}, id2 === "producers" ? /* @__PURE__ */
|
|
1387
|
+
}, id2 === "producers" ? /* @__PURE__ */ React33.createElement(BlockProducerStatsFlexbox, {
|
|
1391
1388
|
payload: analyzer.result()
|
|
1392
1389
|
}) : null)) : null));
|
|
1393
1390
|
}, "ChainAnalyzerStatsDialog");
|
|
1394
1391
|
var ChainAnalyzerStatsDialogFromContext = /* @__PURE__ */ __name((props) => {
|
|
1395
1392
|
const [open, setOpen] = useState9(false);
|
|
1396
1393
|
const handleClose = /* @__PURE__ */ __name(() => setOpen(false), "handleClose");
|
|
1397
|
-
return /* @__PURE__ */
|
|
1394
|
+
return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(IconButton3, {
|
|
1398
1395
|
onClick: /* @__PURE__ */ __name(() => setOpen(true), "onClick")
|
|
1399
|
-
}, /* @__PURE__ */
|
|
1396
|
+
}, /* @__PURE__ */ React33.createElement(QueryStats, null)), /* @__PURE__ */ React33.createElement(ChainAnalyzerStatsDialog, {
|
|
1400
1397
|
onClose: handleClose,
|
|
1401
1398
|
open,
|
|
1402
1399
|
...props
|
|
@@ -1405,19 +1402,19 @@ var ChainAnalyzerStatsDialogFromContext = /* @__PURE__ */ __name((props) => {
|
|
|
1405
1402
|
|
|
1406
1403
|
// src/components/chain/controls/PulseSvgIcon.tsx
|
|
1407
1404
|
import { createSvgIcon, keyframes, styled as styled2 } from "@mui/material";
|
|
1408
|
-
import
|
|
1409
|
-
var PulseSvgIcon = createSvgIcon(/* @__PURE__ */
|
|
1405
|
+
import React34 from "react";
|
|
1406
|
+
var PulseSvgIcon = createSvgIcon(/* @__PURE__ */ React34.createElement("svg", {
|
|
1410
1407
|
viewBox: "0 0 80 80",
|
|
1411
1408
|
version: "1.1",
|
|
1412
1409
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1413
|
-
}, /* @__PURE__ */
|
|
1410
|
+
}, /* @__PURE__ */ React34.createElement("g", {
|
|
1414
1411
|
transform: "translate(34,34)"
|
|
1415
|
-
}, /* @__PURE__ */
|
|
1412
|
+
}, /* @__PURE__ */ React34.createElement("circle", {
|
|
1416
1413
|
className: "core",
|
|
1417
1414
|
cx: "0",
|
|
1418
1415
|
cy: "0",
|
|
1419
1416
|
r: "6"
|
|
1420
|
-
}), /* @__PURE__ */
|
|
1417
|
+
}), /* @__PURE__ */ React34.createElement("circle", {
|
|
1421
1418
|
className: "radar",
|
|
1422
1419
|
cx: "0",
|
|
1423
1420
|
cy: "0",
|
|
@@ -1481,24 +1478,24 @@ var StyledPulseSvgIcon = styled2(PulseSvgIcon)(({ theme }) => {
|
|
|
1481
1478
|
var PollingControlsFlexbox = /* @__PURE__ */ __name(({ blocksBehind, pollingState, setPollingState }) => {
|
|
1482
1479
|
const paused = pollingState === "paused";
|
|
1483
1480
|
const running = pollingState === "running";
|
|
1484
|
-
return /* @__PURE__ */
|
|
1481
|
+
return /* @__PURE__ */ React35.createElement(FlexRow6, {
|
|
1485
1482
|
justifyContent: "space-between",
|
|
1486
1483
|
width: "100%"
|
|
1487
|
-
}, /* @__PURE__ */
|
|
1484
|
+
}, /* @__PURE__ */ React35.createElement(FlexRow6, {
|
|
1488
1485
|
gap: 2
|
|
1489
|
-
}, running ? /* @__PURE__ */
|
|
1486
|
+
}, running ? /* @__PURE__ */ React35.createElement(IconButton4, {
|
|
1490
1487
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("paused"), "onClick"),
|
|
1491
1488
|
title: "Pause Block Stream"
|
|
1492
|
-
}, /* @__PURE__ */
|
|
1489
|
+
}, /* @__PURE__ */ React35.createElement(Pause, null)) : null, paused ? /* @__PURE__ */ React35.createElement(IconButton4, {
|
|
1493
1490
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("running"), "onClick"),
|
|
1494
1491
|
title: "Re-Sync Block Stream"
|
|
1495
|
-
}, /* @__PURE__ */
|
|
1492
|
+
}, /* @__PURE__ */ React35.createElement(Autorenew, null)) : null, /* @__PURE__ */ React35.createElement(ChainAnalyzerStatsDialogFromContext, null)), /* @__PURE__ */ React35.createElement(FlexRow6, {
|
|
1496
1493
|
gap: 2
|
|
1497
|
-
}, /* @__PURE__ */
|
|
1494
|
+
}, /* @__PURE__ */ React35.createElement(Grow, {
|
|
1498
1495
|
in: (blocksBehind ?? 0) > 0
|
|
1499
|
-
}, /* @__PURE__ */
|
|
1496
|
+
}, /* @__PURE__ */ React35.createElement(Tooltip11, {
|
|
1500
1497
|
title: "Click to Re-Sync"
|
|
1501
|
-
}, /* @__PURE__ */
|
|
1498
|
+
}, /* @__PURE__ */ React35.createElement(Alert3, {
|
|
1502
1499
|
sx: {
|
|
1503
1500
|
py: 0,
|
|
1504
1501
|
px: 1,
|
|
@@ -1506,11 +1503,11 @@ var PollingControlsFlexbox = /* @__PURE__ */ __name(({ blocksBehind, pollingStat
|
|
|
1506
1503
|
},
|
|
1507
1504
|
severity: "warning",
|
|
1508
1505
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("running"), "onClick")
|
|
1509
|
-
}, /* @__PURE__ */
|
|
1506
|
+
}, /* @__PURE__ */ React35.createElement(AlertTitle2, {
|
|
1510
1507
|
sx: {
|
|
1511
1508
|
mb: 0
|
|
1512
1509
|
}
|
|
1513
|
-
}, "Behind:", " ", blocksBehind)))), /* @__PURE__ */
|
|
1510
|
+
}, "Behind:", " ", blocksBehind)))), /* @__PURE__ */ React35.createElement(Icon2, null, /* @__PURE__ */ React35.createElement(StyledPulseSvgIcon, {
|
|
1514
1511
|
className: running ? "" : "paused"
|
|
1515
1512
|
}))));
|
|
1516
1513
|
}, "PollingControlsFlexbox");
|
|
@@ -1518,12 +1515,12 @@ var MemoizedPollingControlsFlexbox = /* @__PURE__ */ memo(PollingControlsFlexbox
|
|
|
1518
1515
|
|
|
1519
1516
|
// src/components/chain/dialog/Dialog.tsx
|
|
1520
1517
|
import { Button as Button4, Dialog as Dialog4, DialogActions as DialogActions3, DialogContent as DialogContent4 } from "@mui/material";
|
|
1521
|
-
import
|
|
1518
|
+
import React36 from "react";
|
|
1522
1519
|
var TransactionsDialog = /* @__PURE__ */ __name(({ onClose, ...props }) => {
|
|
1523
|
-
return /* @__PURE__ */
|
|
1520
|
+
return /* @__PURE__ */ React36.createElement(Dialog4, {
|
|
1524
1521
|
onClose,
|
|
1525
1522
|
...props
|
|
1526
|
-
}, /* @__PURE__ */
|
|
1523
|
+
}, /* @__PURE__ */ React36.createElement(DialogContent4, null, "Transactions Dialog"), /* @__PURE__ */ React36.createElement(DialogActions3, null, /* @__PURE__ */ React36.createElement(Button4, {
|
|
1527
1524
|
variant: "outlined",
|
|
1528
1525
|
onClick: /* @__PURE__ */ __name((e) => onClose?.(e, "escapeKeyDown"), "onClick")
|
|
1529
1526
|
}, "Close")));
|
|
@@ -1555,17 +1552,19 @@ var useOnBlock = /* @__PURE__ */ __name((initialHeadNumber, onAddBlock, liveHead
|
|
|
1555
1552
|
}
|
|
1556
1553
|
}
|
|
1557
1554
|
}, [
|
|
1555
|
+
initialHeadNumber,
|
|
1558
1556
|
liveHead,
|
|
1557
|
+
onAddBlock,
|
|
1559
1558
|
pollingState
|
|
1560
1559
|
]);
|
|
1561
|
-
return blocksWhilePaused
|
|
1560
|
+
return blocksWhilePaused;
|
|
1562
1561
|
}, "useOnBlock");
|
|
1563
1562
|
|
|
1564
1563
|
// src/components/chain/pagination/BlockChainPagination.tsx
|
|
1565
1564
|
import { TablePaginationActions } from "@xyo-network/react-payload-table";
|
|
1566
|
-
import
|
|
1565
|
+
import React37 from "react";
|
|
1567
1566
|
var BlockChainPagination = /* @__PURE__ */ __name(({ count = 0, onPageChange, page, rowsPerPage = 10 }) => {
|
|
1568
|
-
return /* @__PURE__ */
|
|
1567
|
+
return /* @__PURE__ */ React37.createElement(TablePaginationActions, {
|
|
1569
1568
|
count,
|
|
1570
1569
|
onPageChange,
|
|
1571
1570
|
page,
|
|
@@ -1574,10 +1573,10 @@ var BlockChainPagination = /* @__PURE__ */ __name(({ count = 0, onPageChange, pa
|
|
|
1574
1573
|
}, "BlockChainPagination");
|
|
1575
1574
|
|
|
1576
1575
|
// src/components/chain/pagination/hooks/usePagination.tsx
|
|
1577
|
-
import { useMemo as
|
|
1576
|
+
import { useMemo as useMemo9, useState as useState10 } from "react";
|
|
1578
1577
|
var useChainPagination = /* @__PURE__ */ __name((pageSize, blockComponents) => {
|
|
1579
1578
|
const [page, setPage] = useState10(0);
|
|
1580
|
-
const paginatedBlockComponents =
|
|
1579
|
+
const paginatedBlockComponents = useMemo9(() => {
|
|
1581
1580
|
const startIndex = page * pageSize;
|
|
1582
1581
|
const endIndex = startIndex + pageSize;
|
|
1583
1582
|
return blockComponents?.slice(startIndex, endIndex);
|
|
@@ -1616,19 +1615,19 @@ var BlockListWrapperFlexBox = styled3(FlexCol5, {
|
|
|
1616
1615
|
// src/components/payload/builder/Flexbox.tsx
|
|
1617
1616
|
import { FlexCol as FlexCol6 } from "@xylabs/react-flexbox";
|
|
1618
1617
|
import { JsonViewerEx as JsonViewerEx2 } from "@xyo-network/react-payload-raw-info";
|
|
1619
|
-
import
|
|
1618
|
+
import React38, { useState as useState11 } from "react";
|
|
1620
1619
|
var PayloadBuilderFlexbox = /* @__PURE__ */ __name(({ BuilderComponent, onBuild, ...props }) => {
|
|
1621
1620
|
const [payload, setPayload] = useState11();
|
|
1622
1621
|
const onBuildLocal = /* @__PURE__ */ __name((payload2) => {
|
|
1623
1622
|
onBuild?.(payload2);
|
|
1624
1623
|
setPayload(payload2);
|
|
1625
1624
|
}, "onBuildLocal");
|
|
1626
|
-
return /* @__PURE__ */
|
|
1625
|
+
return /* @__PURE__ */ React38.createElement(FlexCol6, {
|
|
1627
1626
|
gap: 2,
|
|
1628
1627
|
...props
|
|
1629
|
-
}, /* @__PURE__ */
|
|
1628
|
+
}, /* @__PURE__ */ React38.createElement(BuilderComponent, {
|
|
1630
1629
|
onBuild: onBuildLocal
|
|
1631
|
-
}), payload ? /* @__PURE__ */
|
|
1630
|
+
}), payload ? /* @__PURE__ */ React38.createElement(JsonViewerEx2, {
|
|
1632
1631
|
value: payload
|
|
1633
1632
|
}) : null);
|
|
1634
1633
|
}, "PayloadBuilderFlexbox");
|
|
@@ -1637,12 +1636,12 @@ var PayloadBuilderFlexbox = /* @__PURE__ */ __name(({ BuilderComponent, onBuild,
|
|
|
1637
1636
|
import { Button as Button5, FormControl as FormControl5 } from "@mui/material";
|
|
1638
1637
|
import { usePromise as usePromise3 } from "@xylabs/react-promise";
|
|
1639
1638
|
import { createProducerChainStakeIntent } from "@xyo-network/chain-protocol";
|
|
1640
|
-
import
|
|
1639
|
+
import React41, { useState as useState14 } from "react";
|
|
1641
1640
|
|
|
1642
1641
|
// src/components/payload/fields/BlockNumberTextField.tsx
|
|
1643
1642
|
import { FormControl as FormControl3, FormHelperText as FormHelperText2, TextField as TextField3 } from "@mui/material";
|
|
1644
1643
|
import { toXL1BlockNumber as toXL1BlockNumber2 } from "@xyo-network/xl1-protocol";
|
|
1645
|
-
import
|
|
1644
|
+
import React39, { useState as useState12 } from "react";
|
|
1646
1645
|
var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumberChanged, onChange, ...props }) => {
|
|
1647
1646
|
const [blockNumber, setBlockNumber] = useState12();
|
|
1648
1647
|
const handleChange = /* @__PURE__ */ __name((e) => {
|
|
@@ -1652,15 +1651,15 @@ var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumber
|
|
|
1652
1651
|
onChange?.(e);
|
|
1653
1652
|
}, "handleChange");
|
|
1654
1653
|
const errored = errorMessage !== void 0;
|
|
1655
|
-
return /* @__PURE__ */
|
|
1654
|
+
return /* @__PURE__ */ React39.createElement(FormControl3, {
|
|
1656
1655
|
fullWidth: true
|
|
1657
|
-
}, /* @__PURE__ */
|
|
1656
|
+
}, /* @__PURE__ */ React39.createElement(TextField3, {
|
|
1658
1657
|
error: errored,
|
|
1659
1658
|
onChange: handleChange,
|
|
1660
1659
|
type: "number",
|
|
1661
1660
|
value: blockNumber ?? "",
|
|
1662
1661
|
...props
|
|
1663
|
-
}), errored ? /* @__PURE__ */
|
|
1662
|
+
}), errored ? /* @__PURE__ */ React39.createElement(FormHelperText2, {
|
|
1664
1663
|
sx: {
|
|
1665
1664
|
color: "error.main"
|
|
1666
1665
|
}
|
|
@@ -1669,14 +1668,16 @@ var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumber
|
|
|
1669
1668
|
|
|
1670
1669
|
// src/components/payload/fields/XyoAddressTextField.tsx
|
|
1671
1670
|
import { FormControl as FormControl4, FormHelperText as FormHelperText3, TextField as TextField4 } from "@mui/material";
|
|
1672
|
-
import { asAddress, isAddress } from "@xylabs/sdk-js";
|
|
1673
|
-
import
|
|
1671
|
+
import { asAddress, isAddress, isDefined as isDefined9 } from "@xylabs/sdk-js";
|
|
1672
|
+
import React40, { useState as useState13 } from "react";
|
|
1674
1673
|
var XyoAddressTextField = /* @__PURE__ */ __name(({ onAddressChanged, onChange, resetValue, ...props }) => {
|
|
1675
1674
|
const [address, setAddress] = useState13("");
|
|
1676
1675
|
const [addressError, setAddressError] = useState13();
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1676
|
+
const [previousResetValue, setPreviousResetValue] = useState13(resetValue);
|
|
1677
|
+
if (isDefined9(resetValue) && resetValue !== previousResetValue) {
|
|
1678
|
+
setPreviousResetValue(resetValue);
|
|
1679
|
+
setAddress("");
|
|
1680
|
+
}
|
|
1680
1681
|
const handleChange = /* @__PURE__ */ __name((event) => {
|
|
1681
1682
|
const { value } = event.target;
|
|
1682
1683
|
onChange?.(event);
|
|
@@ -1694,15 +1695,15 @@ var XyoAddressTextField = /* @__PURE__ */ __name(({ onAddressChanged, onChange,
|
|
|
1694
1695
|
onAddressChanged?.();
|
|
1695
1696
|
}
|
|
1696
1697
|
}, "handleBlur");
|
|
1697
|
-
return /* @__PURE__ */
|
|
1698
|
+
return /* @__PURE__ */ React40.createElement(FormControl4, {
|
|
1698
1699
|
fullWidth: true
|
|
1699
|
-
}, /* @__PURE__ */
|
|
1700
|
+
}, /* @__PURE__ */ React40.createElement(TextField4, {
|
|
1700
1701
|
error: !!addressError,
|
|
1701
1702
|
onBlur: handleBlur,
|
|
1702
1703
|
onChange: handleChange,
|
|
1703
1704
|
value: address,
|
|
1704
1705
|
...props
|
|
1705
|
-
}), addressError ? /* @__PURE__ */
|
|
1706
|
+
}), addressError ? /* @__PURE__ */ React40.createElement(FormHelperText3, {
|
|
1706
1707
|
sx: {
|
|
1707
1708
|
color: "error.main"
|
|
1708
1709
|
}
|
|
@@ -1735,33 +1736,33 @@ var ProducerIntentBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
1735
1736
|
const onBuildLocal = /* @__PURE__ */ __name(() => {
|
|
1736
1737
|
if (onBuild && intentPayload) onBuild?.(intentPayload);
|
|
1737
1738
|
}, "onBuildLocal");
|
|
1738
|
-
return /* @__PURE__ */
|
|
1739
|
+
return /* @__PURE__ */ React41.createElement(React41.Fragment, null, /* @__PURE__ */ React41.createElement(FormControl5, {
|
|
1739
1740
|
fullWidth: true
|
|
1740
|
-
}, /* @__PURE__ */
|
|
1741
|
+
}, /* @__PURE__ */ React41.createElement(XyoAddressTextField, {
|
|
1741
1742
|
label: "Delegate",
|
|
1742
1743
|
name: "delegate",
|
|
1743
1744
|
onAddressChanged: setDelegate,
|
|
1744
1745
|
required: true,
|
|
1745
1746
|
size: "small"
|
|
1746
|
-
})), /* @__PURE__ */
|
|
1747
|
+
})), /* @__PURE__ */ React41.createElement(FormControl5, {
|
|
1747
1748
|
fullWidth: true
|
|
1748
|
-
}, /* @__PURE__ */
|
|
1749
|
+
}, /* @__PURE__ */ React41.createElement(BlockNumberTextField, {
|
|
1749
1750
|
errorMessage: blockRangeError?.message,
|
|
1750
1751
|
label: "Expires",
|
|
1751
1752
|
name: "exp",
|
|
1752
1753
|
onBlockNumberChanged: setExp,
|
|
1753
1754
|
required: true,
|
|
1754
1755
|
size: "small"
|
|
1755
|
-
})), /* @__PURE__ */
|
|
1756
|
+
})), /* @__PURE__ */ React41.createElement(FormControl5, {
|
|
1756
1757
|
fullWidth: true
|
|
1757
|
-
}, /* @__PURE__ */
|
|
1758
|
+
}, /* @__PURE__ */ React41.createElement(BlockNumberTextField, {
|
|
1758
1759
|
errorMessage: blockRangeError?.message,
|
|
1759
1760
|
label: "Not Before",
|
|
1760
1761
|
name: "nbf",
|
|
1761
1762
|
onBlockNumberChanged: setNbf,
|
|
1762
1763
|
required: true,
|
|
1763
1764
|
size: "small"
|
|
1764
|
-
})), /* @__PURE__ */
|
|
1765
|
+
})), /* @__PURE__ */ React41.createElement(Button5, {
|
|
1765
1766
|
disabled: !intentPayload,
|
|
1766
1767
|
variant: "contained",
|
|
1767
1768
|
onClick: onBuildLocal
|
|
@@ -1769,71 +1770,68 @@ var ProducerIntentBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
1769
1770
|
}, "ProducerIntentBuilderForm");
|
|
1770
1771
|
|
|
1771
1772
|
// src/components/payload/builder/transfer/Flexbox.tsx
|
|
1772
|
-
import
|
|
1773
|
+
import React44 from "react";
|
|
1773
1774
|
|
|
1774
1775
|
// src/components/payload/builder/transfer/Form.tsx
|
|
1775
1776
|
import { Button as Button6, FormControl as FormControl7 } from "@mui/material";
|
|
1776
1777
|
import { isAddress as isAddress3 } from "@xylabs/sdk-js";
|
|
1777
1778
|
import { TransferSchema } from "@xyo-network/xl1-protocol";
|
|
1778
|
-
import
|
|
1779
|
+
import React43, { useMemo as useMemo10, useState as useState16 } from "react";
|
|
1779
1780
|
|
|
1780
1781
|
// src/components/payload/builder/transfer/builder/SingleFlexbox.tsx
|
|
1781
1782
|
import { RemoveCircle } from "@mui/icons-material";
|
|
1782
1783
|
import { FormControl as FormControl6, Icon as Icon3, IconButton as IconButton5 } from "@mui/material";
|
|
1783
1784
|
import { FlexRow as FlexRow7 } from "@xylabs/react-flexbox";
|
|
1784
|
-
import { isAddress as isAddress2, toHex as toHex3 } from "@xylabs/sdk-js";
|
|
1785
|
+
import { isAddress as isAddress2, isDefinedNotNull, toHex as toHex3 } from "@xylabs/sdk-js";
|
|
1785
1786
|
import { BigIntInput } from "@xyo-network/react-shared";
|
|
1786
|
-
import
|
|
1787
|
+
import React42, { useEffect as useEffect2, useState as useState15 } from "react";
|
|
1787
1788
|
var SingleTransferBuilderFlexbox = /* @__PURE__ */ __name(({ onTransferUpdated, onRemoveTransfer, singleTransfer, ...props }) => {
|
|
1788
1789
|
const [toAddress3, setToAddress] = useState15();
|
|
1789
1790
|
const [amount, setAmount] = useState15();
|
|
1790
|
-
const transferAmount = useMemo13(() => {
|
|
1791
|
-
if (isAddress2(toAddress3) && amount !== void 0) {
|
|
1792
|
-
return {
|
|
1793
|
-
...singleTransfer,
|
|
1794
|
-
amount: toHex3(amount),
|
|
1795
|
-
to: toAddress3
|
|
1796
|
-
};
|
|
1797
|
-
}
|
|
1798
|
-
}, [
|
|
1799
|
-
toAddress3,
|
|
1800
|
-
amount
|
|
1801
|
-
]);
|
|
1802
1791
|
useEffect2(() => {
|
|
1792
|
+
const transferAmount = isAddress2(toAddress3) && isDefinedNotNull(amount) ? {
|
|
1793
|
+
...singleTransfer,
|
|
1794
|
+
amount: toHex3(amount),
|
|
1795
|
+
to: toAddress3
|
|
1796
|
+
} : void 0;
|
|
1803
1797
|
if (transferAmount) onTransferUpdated?.(transferAmount);
|
|
1804
1798
|
}, [
|
|
1805
|
-
|
|
1799
|
+
amount,
|
|
1800
|
+
onTransferUpdated,
|
|
1801
|
+
singleTransfer,
|
|
1802
|
+
toAddress3
|
|
1806
1803
|
]);
|
|
1807
|
-
return /* @__PURE__ */
|
|
1804
|
+
return /* @__PURE__ */ React42.createElement(FlexRow7, {
|
|
1808
1805
|
alignItems: "start",
|
|
1809
1806
|
gap: 1,
|
|
1810
1807
|
...props
|
|
1811
|
-
}, /* @__PURE__ */
|
|
1808
|
+
}, /* @__PURE__ */ React42.createElement(FormControl6, {
|
|
1812
1809
|
fullWidth: true
|
|
1813
|
-
}, /* @__PURE__ */
|
|
1810
|
+
}, /* @__PURE__ */ React42.createElement(XyoAddressTextField, {
|
|
1814
1811
|
label: "To",
|
|
1815
1812
|
name: "to",
|
|
1816
1813
|
onAddressChanged: setToAddress,
|
|
1817
1814
|
required: true,
|
|
1818
1815
|
size: "small"
|
|
1819
|
-
})), /* @__PURE__ */
|
|
1816
|
+
})), /* @__PURE__ */ React42.createElement(FormControl6, {
|
|
1820
1817
|
fullWidth: true
|
|
1821
|
-
}, /* @__PURE__ */
|
|
1818
|
+
}, /* @__PURE__ */ React42.createElement(BigIntInput.TextField, {
|
|
1822
1819
|
label: "Amount",
|
|
1823
1820
|
name: "amount",
|
|
1824
1821
|
onChangeFixedPoint: setAmount,
|
|
1825
1822
|
required: true,
|
|
1826
1823
|
size: "small"
|
|
1827
|
-
})), /* @__PURE__ */
|
|
1824
|
+
})), /* @__PURE__ */ React42.createElement(IconButton5, {
|
|
1828
1825
|
onClick: /* @__PURE__ */ __name(() => onRemoveTransfer?.(singleTransfer.transferId), "onClick")
|
|
1829
|
-
}, /* @__PURE__ */
|
|
1826
|
+
}, /* @__PURE__ */ React42.createElement(Icon3, null, /* @__PURE__ */ React42.createElement(RemoveCircle, null))));
|
|
1830
1827
|
}, "SingleTransferBuilderFlexbox");
|
|
1831
1828
|
|
|
1832
1829
|
// src/components/payload/builder/transfer/Form.tsx
|
|
1833
1830
|
var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
1834
1831
|
const [fromAddress, setFromAddress] = useState16();
|
|
1835
1832
|
const [transfers, setTransfers] = useState16([]);
|
|
1836
|
-
const
|
|
1833
|
+
const [epoch] = useState16(() => Date.now());
|
|
1834
|
+
const transferPayload = useMemo10(() => {
|
|
1837
1835
|
if (isAddress3(fromAddress) && transfers.length > 0) {
|
|
1838
1836
|
const transfersRecord = {};
|
|
1839
1837
|
for (const transfer of transfers) {
|
|
@@ -1843,12 +1841,13 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
1843
1841
|
from: fromAddress,
|
|
1844
1842
|
schema: TransferSchema,
|
|
1845
1843
|
transfers: transfersRecord,
|
|
1846
|
-
epoch
|
|
1844
|
+
epoch
|
|
1847
1845
|
};
|
|
1848
1846
|
}
|
|
1849
1847
|
}, [
|
|
1850
1848
|
fromAddress,
|
|
1851
|
-
transfers
|
|
1849
|
+
transfers,
|
|
1850
|
+
epoch
|
|
1852
1851
|
]);
|
|
1853
1852
|
const onBuildLocal = /* @__PURE__ */ __name(() => {
|
|
1854
1853
|
if (onBuild && transferPayload) onBuild?.(transferPayload);
|
|
@@ -1875,19 +1874,19 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
1875
1874
|
return transfer;
|
|
1876
1875
|
}));
|
|
1877
1876
|
}, "onTransferUpdated");
|
|
1878
|
-
return /* @__PURE__ */
|
|
1877
|
+
return /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(FormControl7, {
|
|
1879
1878
|
fullWidth: true
|
|
1880
|
-
}, /* @__PURE__ */
|
|
1879
|
+
}, /* @__PURE__ */ React43.createElement(XyoAddressTextField, {
|
|
1881
1880
|
label: "From",
|
|
1882
1881
|
name: "from",
|
|
1883
1882
|
onAddressChanged: setFromAddress,
|
|
1884
1883
|
required: true,
|
|
1885
1884
|
size: "small"
|
|
1886
|
-
})), /* @__PURE__ */
|
|
1885
|
+
})), /* @__PURE__ */ React43.createElement(Button6, {
|
|
1887
1886
|
onClick: onTransferAdded,
|
|
1888
1887
|
size: "small",
|
|
1889
1888
|
variant: "contained"
|
|
1890
|
-
}, "Add Transfer"), transfers.map((transfer) => /* @__PURE__ */
|
|
1889
|
+
}, "Add Transfer"), transfers.map((transfer) => /* @__PURE__ */ React43.createElement(SingleTransferBuilderFlexbox, {
|
|
1891
1890
|
key: transfer.transferId,
|
|
1892
1891
|
onTransferUpdated,
|
|
1893
1892
|
onRemoveTransfer: onTransferRemoved,
|
|
@@ -1895,7 +1894,7 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
1895
1894
|
sx: {
|
|
1896
1895
|
width: "100%"
|
|
1897
1896
|
}
|
|
1898
|
-
})), /* @__PURE__ */
|
|
1897
|
+
})), /* @__PURE__ */ React43.createElement(Button6, {
|
|
1899
1898
|
disabled: !transferPayload,
|
|
1900
1899
|
variant: "contained",
|
|
1901
1900
|
onClick: onBuildLocal
|
|
@@ -1903,7 +1902,7 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
1903
1902
|
}, "TransferBuilderForm");
|
|
1904
1903
|
|
|
1905
1904
|
// src/components/payload/builder/transfer/Flexbox.tsx
|
|
1906
|
-
var TransferBuilderFlexbox = /* @__PURE__ */ __name(({ onBuild, ...props }) => /* @__PURE__ */
|
|
1905
|
+
var TransferBuilderFlexbox = /* @__PURE__ */ __name(({ onBuild, ...props }) => /* @__PURE__ */ React44.createElement(PayloadBuilderFlexbox, {
|
|
1907
1906
|
gap: 4,
|
|
1908
1907
|
alignItems: "start",
|
|
1909
1908
|
BuilderComponent: TransferBuilderForm,
|
|
@@ -1911,6 +1910,391 @@ var TransferBuilderFlexbox = /* @__PURE__ */ __name(({ onBuild, ...props }) => /
|
|
|
1911
1910
|
...props
|
|
1912
1911
|
}), "TransferBuilderFlexbox");
|
|
1913
1912
|
|
|
1913
|
+
// src/components/rate/flexbox/FlexBox.tsx
|
|
1914
|
+
import { FlexCol as FlexCol7 } from "@xylabs/react-flexbox";
|
|
1915
|
+
import { isDefined as isDefined10 } from "@xylabs/sdk-js";
|
|
1916
|
+
|
|
1917
|
+
// src/helpers/rate/rateUnitToLabel.ts
|
|
1918
|
+
var rateUnitToLabel = /* @__PURE__ */ __name((rateUnit) => {
|
|
1919
|
+
switch (rateUnit) {
|
|
1920
|
+
case "millis": {
|
|
1921
|
+
return "b/ms";
|
|
1922
|
+
}
|
|
1923
|
+
case "seconds": {
|
|
1924
|
+
return "b/s";
|
|
1925
|
+
}
|
|
1926
|
+
case "minutes": {
|
|
1927
|
+
return "b/m";
|
|
1928
|
+
}
|
|
1929
|
+
case "hours": {
|
|
1930
|
+
return "b/h";
|
|
1931
|
+
}
|
|
1932
|
+
case "days": {
|
|
1933
|
+
return "b/d";
|
|
1934
|
+
}
|
|
1935
|
+
case "weeks": {
|
|
1936
|
+
return "b/w";
|
|
1937
|
+
}
|
|
1938
|
+
default: {
|
|
1939
|
+
return rateUnit;
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
}, "rateUnitToLabel");
|
|
1943
|
+
|
|
1944
|
+
// src/components/rate/SpanTypography.tsx
|
|
1945
|
+
import { ViewAgendaOutlined } from "@mui/icons-material";
|
|
1946
|
+
import { Tooltip as Tooltip12 } from "@mui/material";
|
|
1947
|
+
|
|
1948
|
+
// src/components/rate/support/MetricTypography.tsx
|
|
1949
|
+
import { Icon as Icon4, Typography as Typography9 } from "@mui/material";
|
|
1950
|
+
import { isUndefined as isUndefined2 } from "@xylabs/sdk-js";
|
|
1951
|
+
import { useEffect as useEffect3, useState as useState17 } from "react";
|
|
1952
|
+
var MetricTypography = /* @__PURE__ */ __name(({ animationDurationMs = 1e3, disableAnimation, icon, label, metric, sx, ...props }) => {
|
|
1953
|
+
const [displayValue, setDisplayValue] = useState17(0);
|
|
1954
|
+
if (isUndefined2(metric) && displayValue !== 0) {
|
|
1955
|
+
setDisplayValue(0);
|
|
1956
|
+
}
|
|
1957
|
+
useEffect3(() => {
|
|
1958
|
+
if (isUndefined2(metric)) return;
|
|
1959
|
+
const duration = animationDurationMs;
|
|
1960
|
+
const startTime = Date.now();
|
|
1961
|
+
const startValue = 0;
|
|
1962
|
+
const endValue = metric;
|
|
1963
|
+
const animate = /* @__PURE__ */ __name(() => {
|
|
1964
|
+
const now = Date.now();
|
|
1965
|
+
const elapsed = now - startTime;
|
|
1966
|
+
const progress = Math.min(elapsed / duration, 1);
|
|
1967
|
+
const easeProgress = 1 - Math.pow(1 - progress, 3);
|
|
1968
|
+
const currentValue = startValue + (endValue - startValue) * easeProgress;
|
|
1969
|
+
setDisplayValue(currentValue);
|
|
1970
|
+
if (progress < 1) {
|
|
1971
|
+
requestAnimationFrame(animate);
|
|
1972
|
+
}
|
|
1973
|
+
}, "animate");
|
|
1974
|
+
globalThis.requestAnimationFrame(animate);
|
|
1975
|
+
}, [
|
|
1976
|
+
animationDurationMs,
|
|
1977
|
+
metric
|
|
1978
|
+
]);
|
|
1979
|
+
const isWholeNumber = metric !== void 0 && Number.isInteger(metric);
|
|
1980
|
+
const formattedValue = disableAnimation ? metric : displayValue.toLocaleString(navigator.language, {
|
|
1981
|
+
minimumFractionDigits: 0,
|
|
1982
|
+
maximumFractionDigits: isWholeNumber ? 0 : 2
|
|
1983
|
+
});
|
|
1984
|
+
return /* @__PURE__ */ React.createElement(Typography9, {
|
|
1985
|
+
variant: "h4",
|
|
1986
|
+
mb: 1,
|
|
1987
|
+
sx: {
|
|
1988
|
+
display: "flex",
|
|
1989
|
+
alignItems: "end",
|
|
1990
|
+
gap: 0.5,
|
|
1991
|
+
...sx
|
|
1992
|
+
},
|
|
1993
|
+
...props
|
|
1994
|
+
}, /* @__PURE__ */ React.createElement(Icon4, {
|
|
1995
|
+
fontSize: "large"
|
|
1996
|
+
}, icon), formattedValue, " ", /* @__PURE__ */ React.createElement(Typography9, {
|
|
1997
|
+
component: "span",
|
|
1998
|
+
variant: "caption",
|
|
1999
|
+
lineHeight: 1.86
|
|
2000
|
+
}, label));
|
|
2001
|
+
}, "MetricTypography");
|
|
2002
|
+
|
|
2003
|
+
// src/components/rate/SpanTypography.tsx
|
|
2004
|
+
var BlockRateSpanTypography = /* @__PURE__ */ __name(({ range, span, sx, ...props }) => {
|
|
2005
|
+
return /* @__PURE__ */ React.createElement(Tooltip12, {
|
|
2006
|
+
title: `Block Range: ${range?.join(" - ")}`
|
|
2007
|
+
}, /* @__PURE__ */ React.createElement(MetricTypography, {
|
|
2008
|
+
icon: /* @__PURE__ */ React.createElement(ViewAgendaOutlined, {
|
|
2009
|
+
fontSize: "large"
|
|
2010
|
+
}),
|
|
2011
|
+
metric: span,
|
|
2012
|
+
label: "blocks",
|
|
2013
|
+
...props
|
|
2014
|
+
}));
|
|
2015
|
+
}, "BlockRateSpanTypography");
|
|
2016
|
+
|
|
2017
|
+
// src/components/rate/SpeedTypography.tsx
|
|
2018
|
+
import { SpeedOutlined } from "@mui/icons-material";
|
|
2019
|
+
var BlockRateSpeedTypography = /* @__PURE__ */ __name(({ rate, rateUnitLabel, ...props }) => {
|
|
2020
|
+
return /* @__PURE__ */ React.createElement(MetricTypography, {
|
|
2021
|
+
icon: /* @__PURE__ */ React.createElement(SpeedOutlined, {
|
|
2022
|
+
fontSize: "large"
|
|
2023
|
+
}),
|
|
2024
|
+
metric: rate,
|
|
2025
|
+
label: rateUnitLabel,
|
|
2026
|
+
...props
|
|
2027
|
+
});
|
|
2028
|
+
}, "BlockRateSpeedTypography");
|
|
2029
|
+
|
|
2030
|
+
// src/components/rate/TimeTypography.tsx
|
|
2031
|
+
import { TimelapseOutlined } from "@mui/icons-material";
|
|
2032
|
+
var BlockRateTimeTypography = /* @__PURE__ */ __name(({ rateUnit, timeDifference, sx, ...props }) => {
|
|
2033
|
+
return /* @__PURE__ */ React.createElement(MetricTypography, {
|
|
2034
|
+
icon: /* @__PURE__ */ React.createElement(TimelapseOutlined, {
|
|
2035
|
+
fontSize: "large"
|
|
2036
|
+
}),
|
|
2037
|
+
metric: timeDifference,
|
|
2038
|
+
label: rateUnit,
|
|
2039
|
+
...props
|
|
2040
|
+
});
|
|
2041
|
+
}, "BlockRateTimeTypography");
|
|
2042
|
+
|
|
2043
|
+
// src/components/rate/flexbox/FlexBox.tsx
|
|
2044
|
+
var BlockRateFlexBox = /* @__PURE__ */ __name(({ blockRate, ...flexBoxProps }) => {
|
|
2045
|
+
const { range, span, rate, rateUnit, timeDifference } = blockRate ?? {};
|
|
2046
|
+
const rateUnitLabel = isDefined10(rateUnit) ? rateUnitToLabel(rateUnit) : "";
|
|
2047
|
+
return /* @__PURE__ */ React.createElement(FlexCol7, {
|
|
2048
|
+
alignItems: "start",
|
|
2049
|
+
...flexBoxProps
|
|
2050
|
+
}, /* @__PURE__ */ React.createElement(BlockRateSpeedTypography, {
|
|
2051
|
+
rate,
|
|
2052
|
+
rateUnitLabel
|
|
2053
|
+
}), /* @__PURE__ */ React.createElement(BlockRateSpanTypography, {
|
|
2054
|
+
range,
|
|
2055
|
+
span
|
|
2056
|
+
}), /* @__PURE__ */ React.createElement(BlockRateTimeTypography, {
|
|
2057
|
+
rateUnit,
|
|
2058
|
+
timeDifference
|
|
2059
|
+
}));
|
|
2060
|
+
}, "BlockRateFlexBox");
|
|
2061
|
+
|
|
2062
|
+
// src/components/rate/gauge/Container.tsx
|
|
2063
|
+
import { GaugeContainer, GaugeReferenceArc, GaugeValueArc } from "@mui/x-charts";
|
|
2064
|
+
|
|
2065
|
+
// src/components/rate/gauge/helpers/blockRateConversions.ts
|
|
2066
|
+
import { isDefined as isDefined11, isUndefined as isUndefined3 } from "@xylabs/sdk-js";
|
|
2067
|
+
var toBlocksPerMillisecond = /* @__PURE__ */ __name((rateValue, unit) => {
|
|
2068
|
+
if (isUndefined3(unit)) return rateValue;
|
|
2069
|
+
const conversions = {
|
|
2070
|
+
millis: 1,
|
|
2071
|
+
seconds: 1e3,
|
|
2072
|
+
minutes: 6e4,
|
|
2073
|
+
hours: 36e5,
|
|
2074
|
+
days: 864e5,
|
|
2075
|
+
weeks: 6048e5
|
|
2076
|
+
};
|
|
2077
|
+
return rateValue * (isDefined11(conversions[unit]) ? conversions[unit] : 1);
|
|
2078
|
+
}, "toBlocksPerMillisecond");
|
|
2079
|
+
var toBlocksPerSecond = /* @__PURE__ */ __name((rateValue, unit) => {
|
|
2080
|
+
if (isUndefined3(unit)) return rateValue;
|
|
2081
|
+
const conversions = {
|
|
2082
|
+
millis: 1e-3,
|
|
2083
|
+
seconds: 1,
|
|
2084
|
+
minutes: 60,
|
|
2085
|
+
hours: 3600,
|
|
2086
|
+
days: 86400,
|
|
2087
|
+
weeks: 604800
|
|
2088
|
+
};
|
|
2089
|
+
return rateValue * (isDefined11(conversions[unit]) ? conversions[unit] : 1);
|
|
2090
|
+
}, "toBlocksPerSecond");
|
|
2091
|
+
var toBlocksPerMinute = /* @__PURE__ */ __name((rateValue, unit) => {
|
|
2092
|
+
if (isUndefined3(unit)) return rateValue;
|
|
2093
|
+
const conversions = {
|
|
2094
|
+
millis: 6e4,
|
|
2095
|
+
seconds: 60,
|
|
2096
|
+
minutes: 1,
|
|
2097
|
+
hours: 1 / 60,
|
|
2098
|
+
days: 1 / 1440,
|
|
2099
|
+
weeks: 1 / 10080
|
|
2100
|
+
};
|
|
2101
|
+
return rateValue * (isDefined11(conversions[unit]) ? conversions[unit] : 1);
|
|
2102
|
+
}, "toBlocksPerMinute");
|
|
2103
|
+
var toBlocksPerHour = /* @__PURE__ */ __name((rateValue, unit) => {
|
|
2104
|
+
if (isUndefined3(unit)) return rateValue;
|
|
2105
|
+
const conversions = {
|
|
2106
|
+
millis: 36e5,
|
|
2107
|
+
seconds: 3600,
|
|
2108
|
+
minutes: 60,
|
|
2109
|
+
hours: 1,
|
|
2110
|
+
days: 1 / 24,
|
|
2111
|
+
weeks: 1 / 168
|
|
2112
|
+
};
|
|
2113
|
+
return rateValue * (isDefined11(conversions[unit]) ? conversions[unit] : 1);
|
|
2114
|
+
}, "toBlocksPerHour");
|
|
2115
|
+
var toBlocksPerDay = /* @__PURE__ */ __name((rateValue, unit) => {
|
|
2116
|
+
if (isUndefined3(unit)) return rateValue;
|
|
2117
|
+
const conversions = {
|
|
2118
|
+
millis: 864e5,
|
|
2119
|
+
seconds: 86400,
|
|
2120
|
+
minutes: 1440,
|
|
2121
|
+
hours: 24,
|
|
2122
|
+
days: 1,
|
|
2123
|
+
weeks: 1 / 7
|
|
2124
|
+
};
|
|
2125
|
+
return rateValue * (isDefined11(conversions[unit]) ? conversions[unit] : 1);
|
|
2126
|
+
}, "toBlocksPerDay");
|
|
2127
|
+
var toBlocksPerWeek = /* @__PURE__ */ __name((rateValue, unit) => {
|
|
2128
|
+
if (isUndefined3(unit)) return rateValue;
|
|
2129
|
+
const conversions = {
|
|
2130
|
+
millis: 6048e5,
|
|
2131
|
+
seconds: 604800,
|
|
2132
|
+
minutes: 10080,
|
|
2133
|
+
hours: 168,
|
|
2134
|
+
days: 7,
|
|
2135
|
+
weeks: 1
|
|
2136
|
+
};
|
|
2137
|
+
return rateValue * (isDefined11(conversions[unit]) ? conversions[unit] : 1);
|
|
2138
|
+
}, "toBlocksPerWeek");
|
|
2139
|
+
var BlockRateConversions = {
|
|
2140
|
+
millis: toBlocksPerMillisecond,
|
|
2141
|
+
seconds: toBlocksPerSecond,
|
|
2142
|
+
minutes: toBlocksPerMinute,
|
|
2143
|
+
hours: toBlocksPerHour,
|
|
2144
|
+
days: toBlocksPerDay,
|
|
2145
|
+
weeks: toBlocksPerWeek
|
|
2146
|
+
};
|
|
2147
|
+
|
|
2148
|
+
// src/components/rate/gauge/Pointer.tsx
|
|
2149
|
+
import { useTheme as useTheme3 } from "@mui/material";
|
|
2150
|
+
import { useGaugeState } from "@mui/x-charts/Gauge";
|
|
2151
|
+
import { isDefined as isDefined12 } from "@xylabs/sdk-js";
|
|
2152
|
+
import { useEffect as useEffect4, useState as useState18 } from "react";
|
|
2153
|
+
var GaugePointer = /* @__PURE__ */ __name(({ pointerColor, startAngle = 0 }) => {
|
|
2154
|
+
const theme = useTheme3();
|
|
2155
|
+
const strokeColor = isDefined12(pointerColor) ? pointerColor : theme.palette.error.dark;
|
|
2156
|
+
const { valueAngle, outerRadius, cx, cy } = useGaugeState();
|
|
2157
|
+
const [currentAngle, setCurrentAngle] = useState18(startAngle);
|
|
2158
|
+
useEffect4(() => {
|
|
2159
|
+
if (valueAngle === null) return;
|
|
2160
|
+
const duration = 500;
|
|
2161
|
+
const startTime = Date.now();
|
|
2162
|
+
const animationStartAngle = currentAngle;
|
|
2163
|
+
const endAngle = valueAngle;
|
|
2164
|
+
const animate = /* @__PURE__ */ __name(() => {
|
|
2165
|
+
const now = Date.now();
|
|
2166
|
+
const elapsed = now - startTime;
|
|
2167
|
+
const progress = Math.min(elapsed / duration, 1);
|
|
2168
|
+
const easeProgress = 1 - Math.pow(1 - progress, 3);
|
|
2169
|
+
const newAngle = animationStartAngle + (endAngle - animationStartAngle) * easeProgress;
|
|
2170
|
+
setCurrentAngle(newAngle);
|
|
2171
|
+
if (progress < 1) {
|
|
2172
|
+
globalThis.requestAnimationFrame(animate);
|
|
2173
|
+
}
|
|
2174
|
+
}, "animate");
|
|
2175
|
+
globalThis.requestAnimationFrame(animate);
|
|
2176
|
+
}, [
|
|
2177
|
+
currentAngle,
|
|
2178
|
+
valueAngle
|
|
2179
|
+
]);
|
|
2180
|
+
if (valueAngle === null) {
|
|
2181
|
+
return null;
|
|
2182
|
+
}
|
|
2183
|
+
const target = {
|
|
2184
|
+
x: cx + outerRadius * Math.sin(currentAngle),
|
|
2185
|
+
y: cy - outerRadius * Math.cos(currentAngle)
|
|
2186
|
+
};
|
|
2187
|
+
return /* @__PURE__ */ React.createElement("g", {
|
|
2188
|
+
className: "GaugePointer"
|
|
2189
|
+
}, /* @__PURE__ */ React.createElement("circle", {
|
|
2190
|
+
cx,
|
|
2191
|
+
cy,
|
|
2192
|
+
r: 5,
|
|
2193
|
+
fill: strokeColor
|
|
2194
|
+
}), /* @__PURE__ */ React.createElement("path", {
|
|
2195
|
+
d: `M ${cx} ${cy} L ${target.x} ${target.y}`,
|
|
2196
|
+
stroke: strokeColor,
|
|
2197
|
+
strokeWidth: 3
|
|
2198
|
+
}));
|
|
2199
|
+
}, "GaugePointer");
|
|
2200
|
+
|
|
2201
|
+
// src/components/rate/gauge/Ticks.tsx
|
|
2202
|
+
import { useTheme as useTheme4 } from "@mui/material";
|
|
2203
|
+
import { useGaugeState as useGaugeState2 } from "@mui/x-charts/Gauge";
|
|
2204
|
+
import { isDefined as isDefined13 } from "@xylabs/sdk-js";
|
|
2205
|
+
var GaugeTicks = /* @__PURE__ */ __name(({ numTicks = 11, minorTicksPerMajor = 4, majorTickLength = 0.2, minorTickLength = 0.15, majorTickWidth = 2, minorTickWidth = 1, tickColor }) => {
|
|
2206
|
+
const theme = useTheme4();
|
|
2207
|
+
const { startAngle, endAngle, outerRadius, cx, cy } = useGaugeState2();
|
|
2208
|
+
const color = isDefined13(tickColor) ? tickColor : theme.vars.palette.text.secondary;
|
|
2209
|
+
if (startAngle === null || endAngle === null) {
|
|
2210
|
+
return null;
|
|
2211
|
+
}
|
|
2212
|
+
const ticks = [];
|
|
2213
|
+
const totalAngle = endAngle - startAngle;
|
|
2214
|
+
for (let i = 0; i < numTicks; i++) {
|
|
2215
|
+
const angle = startAngle + i / (numTicks - 1) * totalAngle;
|
|
2216
|
+
const tickLength = outerRadius * majorTickLength;
|
|
2217
|
+
const tickStart = outerRadius;
|
|
2218
|
+
const innerRadius = tickStart - tickLength;
|
|
2219
|
+
const x1 = cx + tickStart * Math.sin(angle);
|
|
2220
|
+
const y1 = cy - tickStart * Math.cos(angle);
|
|
2221
|
+
const x2 = cx + innerRadius * Math.sin(angle);
|
|
2222
|
+
const y2 = cy - innerRadius * Math.cos(angle);
|
|
2223
|
+
ticks.push(/* @__PURE__ */ React.createElement("line", {
|
|
2224
|
+
className: `GaugeTick-major-${i}`,
|
|
2225
|
+
key: `major-${i}`,
|
|
2226
|
+
x1,
|
|
2227
|
+
y1,
|
|
2228
|
+
x2,
|
|
2229
|
+
y2,
|
|
2230
|
+
stroke: color,
|
|
2231
|
+
strokeWidth: majorTickWidth
|
|
2232
|
+
}));
|
|
2233
|
+
if (i < numTicks - 1) {
|
|
2234
|
+
const angleStep = totalAngle / (numTicks - 1) / (minorTicksPerMajor + 1);
|
|
2235
|
+
for (let j = 1; j <= minorTicksPerMajor; j++) {
|
|
2236
|
+
const minorAngle = angle + angleStep * j;
|
|
2237
|
+
const minorTickLen = outerRadius * minorTickLength;
|
|
2238
|
+
const minorTickStart = outerRadius;
|
|
2239
|
+
const minorInnerRadius = minorTickStart - minorTickLen;
|
|
2240
|
+
const mx1 = cx + minorTickStart * Math.sin(minorAngle);
|
|
2241
|
+
const my1 = cy - minorTickStart * Math.cos(minorAngle);
|
|
2242
|
+
const mx2 = cx + minorInnerRadius * Math.sin(minorAngle);
|
|
2243
|
+
const my2 = cy - minorInnerRadius * Math.cos(minorAngle);
|
|
2244
|
+
ticks.push(/* @__PURE__ */ React.createElement("line", {
|
|
2245
|
+
key: `minor-${i}-${j}`,
|
|
2246
|
+
x1: mx1,
|
|
2247
|
+
y1: my1,
|
|
2248
|
+
x2: mx2,
|
|
2249
|
+
y2: my2,
|
|
2250
|
+
stroke: color,
|
|
2251
|
+
strokeWidth: minorTickWidth
|
|
2252
|
+
}));
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
2256
|
+
return /* @__PURE__ */ React.createElement("g", {
|
|
2257
|
+
className: "GaugeTicks"
|
|
2258
|
+
}, ticks);
|
|
2259
|
+
}, "GaugeTicks");
|
|
2260
|
+
|
|
2261
|
+
// src/components/rate/gauge/Container.tsx
|
|
2262
|
+
var BlockRateSpeedGaugeContainer = /* @__PURE__ */ __name(({ blockRate, children, gaugeConfig, startAngle = -110, endAngle = 110, width = 200, height = 150, ...props }) => {
|
|
2263
|
+
const { rate, rateUnit } = blockRate || {};
|
|
2264
|
+
const { targetBlockRate = 5, targetBlockRateUnit = "minutes", targetPosition = 75, showTicks = true } = gaugeConfig || {};
|
|
2265
|
+
const converter = BlockRateConversions[targetBlockRateUnit];
|
|
2266
|
+
const maxGaugeValue = endAngle;
|
|
2267
|
+
const blocksPerMinute = rate === void 0 ? 0 : converter(rate, rateUnit);
|
|
2268
|
+
const normalizedValue = Math.min(blocksPerMinute / targetBlockRate * targetPosition, maxGaugeValue);
|
|
2269
|
+
return /* @__PURE__ */ React.createElement(GaugeContainer, {
|
|
2270
|
+
width,
|
|
2271
|
+
height,
|
|
2272
|
+
startAngle,
|
|
2273
|
+
endAngle,
|
|
2274
|
+
value: normalizedValue,
|
|
2275
|
+
valueMax: endAngle,
|
|
2276
|
+
innerRadius: "95%",
|
|
2277
|
+
outerRadius: "100%",
|
|
2278
|
+
...props
|
|
2279
|
+
}, showTicks && /* @__PURE__ */ React.createElement(GaugeTicks, null), /* @__PURE__ */ React.createElement(GaugeReferenceArc, null), /* @__PURE__ */ React.createElement(GaugeValueArc, null), /* @__PURE__ */ React.createElement(GaugePointer, {
|
|
2280
|
+
startAngle: -2
|
|
2281
|
+
}), children);
|
|
2282
|
+
}, "BlockRateSpeedGaugeContainer");
|
|
2283
|
+
|
|
2284
|
+
// src/components/rate/gauge/WithLabel.tsx
|
|
2285
|
+
import { FlexCol as FlexCol8 } from "@xylabs/react-flexbox";
|
|
2286
|
+
import { isDefined as isDefined14 } from "@xylabs/sdk-js";
|
|
2287
|
+
var BlockRateSpeedGaugeWithLabel = /* @__PURE__ */ __name(({ blockRate, ...props }) => {
|
|
2288
|
+
const rateUnitLabel = isDefined14(blockRate?.rateUnit) ? rateUnitToLabel(blockRate.rateUnit) : "";
|
|
2289
|
+
return /* @__PURE__ */ React.createElement(FlexCol8, null, /* @__PURE__ */ React.createElement(BlockRateSpeedGaugeContainer, {
|
|
2290
|
+
blockRate,
|
|
2291
|
+
...props
|
|
2292
|
+
}), /* @__PURE__ */ React.createElement(BlockRateSpeedTypography, {
|
|
2293
|
+
rate: blockRate?.rate,
|
|
2294
|
+
rateUnitLabel
|
|
2295
|
+
}));
|
|
2296
|
+
}, "BlockRateSpeedGaugeWithLabel");
|
|
2297
|
+
|
|
1914
2298
|
// src/stories/ChainArchivistDecorator.tsx
|
|
1915
2299
|
import { CircularProgress } from "@mui/material";
|
|
1916
2300
|
import { usePromise as usePromise4 } from "@xylabs/react-promise";
|
|
@@ -1918,7 +2302,7 @@ import { MemoryArchivist } from "@xyo-network/archivist-memory";
|
|
|
1918
2302
|
import { ArchivistConfigSchema } from "@xyo-network/archivist-model";
|
|
1919
2303
|
import { buildRandomBlockChain } from "@xyo-network/react-chain-shared";
|
|
1920
2304
|
import { flattenHydratedBlocks } from "@xyo-network/xl1-protocol-sdk";
|
|
1921
|
-
import
|
|
2305
|
+
import React45, { useEffect as useEffect5 } from "react";
|
|
1922
2306
|
|
|
1923
2307
|
// src/lib/getChainId.ts
|
|
1924
2308
|
import { toAddress as toAddress2 } from "@xylabs/sdk-js";
|
|
@@ -1949,7 +2333,7 @@ var ChainArchivistDecorator = /* @__PURE__ */ __name((Story, { args, ...context
|
|
|
1949
2333
|
}, [
|
|
1950
2334
|
randomBlockChain
|
|
1951
2335
|
]);
|
|
1952
|
-
|
|
2336
|
+
useEffect5(() => {
|
|
1953
2337
|
if (blockChainRenderPropsError) {
|
|
1954
2338
|
console.error(blockChainRenderPropsError);
|
|
1955
2339
|
}
|
|
@@ -1967,7 +2351,7 @@ var ChainArchivistDecorator = /* @__PURE__ */ __name((Story, { args, ...context
|
|
|
1967
2351
|
}
|
|
1968
2352
|
}
|
|
1969
2353
|
};
|
|
1970
|
-
return blockChainRenderProps?.chainArchivist ? /* @__PURE__ */
|
|
2354
|
+
return blockChainRenderProps?.chainArchivist ? /* @__PURE__ */ React45.createElement(Story, props) : /* @__PURE__ */ React45.createElement(CircularProgress, null);
|
|
1971
2355
|
}, "ChainArchivistDecorator");
|
|
1972
2356
|
|
|
1973
2357
|
// src/stories/ChainArchivistDelayedInsertDecorator.tsx
|
|
@@ -1978,10 +2362,10 @@ import { MemoryArchivist as MemoryArchivist2 } from "@xyo-network/archivist-memo
|
|
|
1978
2362
|
import { ArchivistConfigSchema as ArchivistConfigSchema2 } from "@xyo-network/archivist-model";
|
|
1979
2363
|
import { buildRandomBlockChain as buildRandomBlockChain2 } from "@xyo-network/react-chain-shared";
|
|
1980
2364
|
import { flattenHydratedBlock } from "@xyo-network/xl1-protocol-sdk";
|
|
1981
|
-
import
|
|
2365
|
+
import React46, { useEffect as useEffect6, useState as useState19 } from "react";
|
|
1982
2366
|
var chainArchivistRef;
|
|
1983
2367
|
var ChainArchivistDelayedInsertDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
1984
|
-
const [firstBlock, setFirstBlock] =
|
|
2368
|
+
const [firstBlock, setFirstBlock] = useState19();
|
|
1985
2369
|
const [randomBlockChain] = usePromise5(async () => await buildRandomBlockChain2(), []);
|
|
1986
2370
|
const [chainArchivist] = usePromise5(async () => {
|
|
1987
2371
|
if (chainArchivistRef) {
|
|
@@ -2009,7 +2393,7 @@ var ChainArchivistDelayedInsertDecorator = /* @__PURE__ */ __name((Story, contex
|
|
|
2009
2393
|
chainArchivist,
|
|
2010
2394
|
randomBlockChain
|
|
2011
2395
|
]);
|
|
2012
|
-
|
|
2396
|
+
useEffect6(() => {
|
|
2013
2397
|
if (delayedInsertError) {
|
|
2014
2398
|
console.error(delayedInsertError);
|
|
2015
2399
|
}
|
|
@@ -2037,7 +2421,7 @@ var ChainArchivistDelayedInsertDecorator = /* @__PURE__ */ __name((Story, contex
|
|
|
2037
2421
|
}
|
|
2038
2422
|
}
|
|
2039
2423
|
};
|
|
2040
|
-
return firstBlock ? /* @__PURE__ */
|
|
2424
|
+
return firstBlock ? /* @__PURE__ */ React46.createElement(Story, props) : /* @__PURE__ */ React46.createElement(CircularProgress2, null);
|
|
2041
2425
|
}, "ChainArchivistDelayedInsertDecorator");
|
|
2042
2426
|
export {
|
|
2043
2427
|
AccountBalanceHistoryFlexBox,
|
|
@@ -2060,6 +2444,12 @@ export {
|
|
|
2060
2444
|
BlockProducerChip,
|
|
2061
2445
|
BlockProducerTableCell,
|
|
2062
2446
|
BlockProducerTableCellInner,
|
|
2447
|
+
BlockRateFlexBox,
|
|
2448
|
+
BlockRateSpanTypography,
|
|
2449
|
+
BlockRateSpeedGaugeContainer,
|
|
2450
|
+
BlockRateSpeedGaugeWithLabel,
|
|
2451
|
+
BlockRateSpeedTypography,
|
|
2452
|
+
BlockRateTimeTypography,
|
|
2063
2453
|
BlockTransactionCountTableCell,
|
|
2064
2454
|
BlockVerificationTableCell,
|
|
2065
2455
|
BlockchainTableEx,
|
|
@@ -2072,8 +2462,11 @@ export {
|
|
|
2072
2462
|
ChainTransactionNetwork,
|
|
2073
2463
|
ChipSkeleton,
|
|
2074
2464
|
FeatureNotAvailable,
|
|
2465
|
+
GaugePointer,
|
|
2466
|
+
GaugeTicks,
|
|
2075
2467
|
HashTableCell,
|
|
2076
2468
|
MemoizedPollingControlsFlexbox,
|
|
2469
|
+
MetricTypography,
|
|
2077
2470
|
PayloadBuilderFlexbox,
|
|
2078
2471
|
PollingControlsFlexbox,
|
|
2079
2472
|
ProducerIntentBuilderForm,
|