@xyo-network/react-chain-boundwitness 1.22.0 → 1.23.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.mjs +577 -618
- package/dist/browser/index.mjs.map +7 -1
- package/package.json +47 -59
package/dist/browser/index.mjs
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
1
|
// src/components/block/BlockBoundWitnessDetails.tsx
|
|
5
2
|
import { ErrorRender as ErrorRender2 } from "@xylabs/react-error";
|
|
6
3
|
import { FlexCol as FlexCol2 } from "@xylabs/react-flexbox";
|
|
@@ -8,12 +5,17 @@ import { usePromise as usePromise3 } from "@xylabs/react-promise";
|
|
|
8
5
|
import { filterAs } from "@xylabs/sdk-js";
|
|
9
6
|
import { isBoundWitness } from "@xyo-network/boundwitness-model";
|
|
10
7
|
import { HydratedBlockWrapper } from "@xyo-network/chain-wrappers";
|
|
11
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
BoundWitnessPayloadsTable,
|
|
10
|
+
BoundWitnessSignatureTable,
|
|
11
|
+
HashHeadingPaper,
|
|
12
|
+
HeadingPaper as HeadingPaper2
|
|
13
|
+
} from "@xyo-network/react-boundwitness-plugin";
|
|
12
14
|
import { useTxsFromBlock } from "@xyo-network/react-chain-blockchain";
|
|
13
15
|
import { usePayloadHash as usePayloadHash2 } from "@xyo-network/react-shared";
|
|
14
16
|
import { PayloadBuilder } from "@xyo-network/sdk-js";
|
|
15
17
|
import { isTransactionBoundWitness } from "@xyo-network/xl1-sdk";
|
|
16
|
-
import
|
|
18
|
+
import { useMemo as useMemo3 } from "react";
|
|
17
19
|
import { FaSignature } from "react-icons/fa";
|
|
18
20
|
import { GrTransaction } from "react-icons/gr";
|
|
19
21
|
import { VscSymbolMethod as VscSymbolMethod2, VscSymbolNamespace as VscSymbolNamespace2 } from "react-icons/vsc";
|
|
@@ -21,86 +23,97 @@ import { VscSymbolMethod as VscSymbolMethod2, VscSymbolNamespace as VscSymbolNam
|
|
|
21
23
|
// src/lib/formatFees.ts
|
|
22
24
|
import { isUndefined } from "@xylabs/sdk-js";
|
|
23
25
|
import { bigIntToFixedPointString } from "@xyo-network/chain-utils";
|
|
24
|
-
var formatFee =
|
|
26
|
+
var formatFee = (fee) => {
|
|
25
27
|
if (isUndefined(fee)) return "N/A";
|
|
26
28
|
const stringValue = bigIntToFixedPointString(fee, 12);
|
|
27
29
|
if (stringValue === "0") return stringValue;
|
|
28
30
|
return stringValue;
|
|
29
|
-
}
|
|
31
|
+
};
|
|
30
32
|
|
|
31
33
|
// src/lib/formatNumber.ts
|
|
32
|
-
var formatNumber =
|
|
34
|
+
var formatNumber = (num) => {
|
|
33
35
|
return num.toLocaleString(navigator.language ?? "en-US");
|
|
34
|
-
}
|
|
36
|
+
};
|
|
35
37
|
|
|
36
38
|
// src/lib/formatPayloadsForTable.ts
|
|
37
|
-
var formatPayloadsForTable =
|
|
39
|
+
var formatPayloadsForTable = (pairs) => {
|
|
38
40
|
const hashes = [];
|
|
39
41
|
const schemas = [];
|
|
40
42
|
for (const [bw, hash] of pairs ?? []) {
|
|
41
43
|
hashes.push(hash);
|
|
42
44
|
schemas.push(bw?.schema ?? "");
|
|
43
45
|
}
|
|
44
|
-
return {
|
|
45
|
-
|
|
46
|
-
schemas
|
|
47
|
-
};
|
|
48
|
-
}, "formatPayloadsForTable");
|
|
46
|
+
return { hashes, schemas };
|
|
47
|
+
};
|
|
49
48
|
|
|
50
49
|
// src/lib/formatResults.ts
|
|
51
|
-
var formatResults =
|
|
52
|
-
const result = {
|
|
53
|
-
labels: [],
|
|
54
|
-
values: []
|
|
55
|
-
};
|
|
50
|
+
var formatResults = (results) => {
|
|
51
|
+
const result = { labels: [], values: [] };
|
|
56
52
|
for (const [label, value] of Object.entries(results)) {
|
|
57
53
|
result.labels.push(label);
|
|
58
54
|
result.values.push(value);
|
|
59
55
|
}
|
|
60
56
|
return result;
|
|
61
|
-
}
|
|
57
|
+
};
|
|
62
58
|
|
|
63
59
|
// src/components/PayloadTable.tsx
|
|
64
60
|
import { InfoOutlined } from "@mui/icons-material";
|
|
65
61
|
import { Tooltip } from "@mui/material";
|
|
66
62
|
import { FlexCol } from "@xylabs/react-flexbox";
|
|
67
63
|
import { isDefined } from "@xylabs/sdk-js";
|
|
68
|
-
import {
|
|
64
|
+
import {
|
|
65
|
+
BoundWitnessPayloadTableBody,
|
|
66
|
+
BoundWitnessPayloadTableHead,
|
|
67
|
+
HeadingPaper
|
|
68
|
+
} from "@xyo-network/react-boundwitness-plugin";
|
|
69
69
|
import { TableEx } from "@xyo-network/react-table";
|
|
70
|
-
import React from "react";
|
|
71
70
|
import { VscSymbolMethod } from "react-icons/vsc";
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
72
|
+
var PayloadTableFlexbox = ({
|
|
73
|
+
IconComponent,
|
|
74
|
+
eventNoun,
|
|
75
|
+
hashes,
|
|
76
|
+
schemas,
|
|
77
|
+
headingTitle,
|
|
78
|
+
clickableFields,
|
|
79
|
+
tooltip,
|
|
80
|
+
...props
|
|
81
|
+
}) => {
|
|
82
|
+
const resolvedIconComponent = IconComponent ?? /* @__PURE__ */ jsx(VscSymbolMethod, {});
|
|
83
|
+
return /* @__PURE__ */ jsxs(
|
|
84
|
+
FlexCol,
|
|
85
|
+
{
|
|
86
|
+
...props,
|
|
87
|
+
sx: [{
|
|
78
88
|
alignItems: "stretch",
|
|
79
89
|
rowGap: 1
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
|
|
90
|
+
}, ...Array.isArray(props.sx) ? props.sx : [props.sx]],
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ jsx(
|
|
93
|
+
HeadingPaper,
|
|
94
|
+
{
|
|
95
|
+
AdornmentEnd: isDefined(tooltip) ? /* @__PURE__ */ jsx(Tooltip, { title: tooltip, children: /* @__PURE__ */ jsx(
|
|
96
|
+
InfoOutlined,
|
|
97
|
+
{
|
|
98
|
+
sx: {
|
|
99
|
+
fontSize: "small",
|
|
100
|
+
py: 2,
|
|
101
|
+
px: 1
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
) }) : null,
|
|
105
|
+
IconComponent: resolvedIconComponent,
|
|
106
|
+
heading: headingTitle
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
/* @__PURE__ */ jsxs(TableEx, { children: [
|
|
110
|
+
/* @__PURE__ */ jsx(BoundWitnessPayloadTableHead, {}),
|
|
111
|
+
/* @__PURE__ */ jsx(BoundWitnessPayloadTableBody, { payloadHashes: hashes, payloadSchemas: schemas, eventNoun, clickableFields })
|
|
112
|
+
] })
|
|
83
113
|
]
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
title: tooltip
|
|
88
|
-
}, /* @__PURE__ */ React.createElement(InfoOutlined, {
|
|
89
|
-
sx: {
|
|
90
|
-
fontSize: "small",
|
|
91
|
-
py: 2,
|
|
92
|
-
px: 1
|
|
93
|
-
}
|
|
94
|
-
})) : null,
|
|
95
|
-
IconComponent: resolvedIconComponent,
|
|
96
|
-
heading: headingTitle
|
|
97
|
-
}), /* @__PURE__ */ React.createElement(TableEx, null, /* @__PURE__ */ React.createElement(BoundWitnessPayloadTableHead, null), /* @__PURE__ */ React.createElement(BoundWitnessPayloadTableBody, {
|
|
98
|
-
payloadHashes: hashes,
|
|
99
|
-
payloadSchemas: schemas,
|
|
100
|
-
eventNoun,
|
|
101
|
-
clickableFields
|
|
102
|
-
})));
|
|
103
|
-
}, "PayloadTableFlexbox");
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
};
|
|
104
117
|
|
|
105
118
|
// src/components/block/card/actions/BlockBoundWitnessActions.tsx
|
|
106
119
|
import { DataObject as DataObjectIcon } from "@mui/icons-material";
|
|
@@ -109,7 +122,6 @@ import { QuickTipButton } from "@xylabs/react-quick-tip-button";
|
|
|
109
122
|
import { ellipsize } from "@xylabs/sdk-js";
|
|
110
123
|
import { BWPreviousHashQuickTipButton } from "@xyo-network/react-boundwitness-plugin";
|
|
111
124
|
import { usePayloadHash } from "@xyo-network/react-shared";
|
|
112
|
-
import React3 from "react";
|
|
113
125
|
|
|
114
126
|
// src/components/block/card/actions/BlockBoundWitnessVerification.tsx
|
|
115
127
|
import { CancelRounded as CancelRoundedIcon } from "@mui/icons-material";
|
|
@@ -119,24 +131,18 @@ import { assertEx, isDefined as isDefined2 } from "@xylabs/sdk-js";
|
|
|
119
131
|
import { validateBlock } from "@xyo-network/chain-validation";
|
|
120
132
|
import { useBaseContext } from "@xyo-network/react-chain-blockchain";
|
|
121
133
|
import { isBlockBoundWitness } from "@xyo-network/xl1-sdk";
|
|
122
|
-
import
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
ref,
|
|
126
|
-
...props
|
|
127
|
-
}), "InvalidIcon");
|
|
134
|
+
import { useMemo } from "react";
|
|
135
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
136
|
+
var InvalidIcon = ({ ref, ...props }) => /* @__PURE__ */ jsx2(CancelRoundedIcon, { color: "error", ref, ...props });
|
|
128
137
|
InvalidIcon.displayName = "InvalidIcon";
|
|
129
|
-
var BlockBoundWitnessVerification =
|
|
138
|
+
var BlockBoundWitnessVerification = ({ block, ...props }) => {
|
|
130
139
|
const context = useBaseContext();
|
|
131
140
|
const [validationErrors, validateError] = usePromise(async () => {
|
|
132
141
|
if (isDefined2(block)) {
|
|
133
142
|
const resolvedBlock = assertEx(isBlockBoundWitness(block) ? block : void 0, () => "Block must be a BlockBoundWitness");
|
|
134
143
|
return await validateBlock(context, resolvedBlock);
|
|
135
144
|
}
|
|
136
|
-
}, [
|
|
137
|
-
block,
|
|
138
|
-
context
|
|
139
|
-
]);
|
|
145
|
+
}, [block, context]);
|
|
140
146
|
const resolvedErrors = useMemo(() => {
|
|
141
147
|
const errors = [];
|
|
142
148
|
if (isDefined2(validationErrors)) {
|
|
@@ -145,119 +151,128 @@ var BlockBoundWitnessVerification = /* @__PURE__ */ __name(({ block, ...props })
|
|
|
145
151
|
if (isDefined2(validateError)) errors.push(validateError);
|
|
146
152
|
return errors;
|
|
147
153
|
}
|
|
148
|
-
}, [
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
]);
|
|
152
|
-
return /* @__PURE__ */ React2.createElement(ErrorQuickTipButton, {
|
|
153
|
-
boundWitnessType: "Block",
|
|
154
|
-
errors: resolvedErrors,
|
|
155
|
-
...props
|
|
156
|
-
});
|
|
157
|
-
}, "BlockBoundWitnessVerification");
|
|
154
|
+
}, [validateError, validationErrors]);
|
|
155
|
+
return /* @__PURE__ */ jsx2(ErrorQuickTipButton, { boundWitnessType: "Block", errors: resolvedErrors, ...props });
|
|
156
|
+
};
|
|
158
157
|
|
|
159
158
|
// src/components/block/card/actions/BlockBoundWitnessActions.tsx
|
|
160
|
-
|
|
159
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
160
|
+
var BlockBoundWitnessActions = ({
|
|
161
|
+
boundwitness,
|
|
162
|
+
validationIconColors = false,
|
|
163
|
+
...props
|
|
164
|
+
}) => {
|
|
161
165
|
const hash = usePayloadHash(boundwitness);
|
|
162
|
-
return /* @__PURE__ */
|
|
163
|
-
boundwitness
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
wordBreak: "break-all"
|
|
177
|
-
}
|
|
178
|
-
}, boundwitness ? JSON.stringify(boundwitness, null, 2) : null)));
|
|
179
|
-
}, "BlockBoundWitnessActions");
|
|
166
|
+
return /* @__PURE__ */ jsxs2(FlexRow, { ...props, children: [
|
|
167
|
+
boundwitness?.previous_hashes.length === 0 ? null : /* @__PURE__ */ jsx3(BWPreviousHashQuickTipButton, { boundwitness }),
|
|
168
|
+
/* @__PURE__ */ jsx3(BlockBoundWitnessVerification, { iconColors: validationIconColors, block: boundwitness }),
|
|
169
|
+
/* @__PURE__ */ jsx3(
|
|
170
|
+
QuickTipButton,
|
|
171
|
+
{
|
|
172
|
+
Icon: DataObjectIcon,
|
|
173
|
+
title: `JSON for ${ellipsize(hash ?? "", 8)}`,
|
|
174
|
+
dialogProps: { fullWidth: true, maxWidth: "md" },
|
|
175
|
+
children: /* @__PURE__ */ jsx3("pre", { style: { wordBreak: "break-all" }, children: boundwitness ? JSON.stringify(boundwitness, null, 2) : null })
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
] });
|
|
179
|
+
};
|
|
180
180
|
|
|
181
181
|
// src/components/block/card/Card.tsx
|
|
182
|
-
import {
|
|
182
|
+
import {
|
|
183
|
+
Card,
|
|
184
|
+
CardContent,
|
|
185
|
+
Grid,
|
|
186
|
+
Skeleton,
|
|
187
|
+
Stack
|
|
188
|
+
} from "@mui/material";
|
|
183
189
|
import { ErrorRender } from "@xylabs/react-error";
|
|
184
190
|
import { isUndefined as isUndefined3 } from "@xylabs/sdk-js";
|
|
185
191
|
import { DetailsStack, LabelValueStack } from "@xyo-network/react-chain-shared";
|
|
186
|
-
import React5 from "react";
|
|
187
192
|
import { GrSteps } from "react-icons/gr";
|
|
188
193
|
import { IoStatsChartOutline } from "react-icons/io5";
|
|
189
194
|
import { VscSymbolNamespace } from "react-icons/vsc";
|
|
190
195
|
|
|
191
196
|
// src/components/block/card/CardHeader.tsx
|
|
192
|
-
import {
|
|
197
|
+
import {
|
|
198
|
+
CardHeader,
|
|
199
|
+
Icon,
|
|
200
|
+
IconButton,
|
|
201
|
+
Link,
|
|
202
|
+
Tooltip as Tooltip2,
|
|
203
|
+
Typography
|
|
204
|
+
} from "@mui/material";
|
|
193
205
|
import { ellipsize as ellipsize2, isDefined as isDefined3 } from "@xylabs/sdk-js";
|
|
194
|
-
import { BlockiesAvatarAddress } from "@xyo-network/react-chain-blockies";
|
|
195
206
|
import { useEvent } from "@xyo-network/react-event";
|
|
196
|
-
import
|
|
207
|
+
import { BlockiesAvatarAddress } from "@xyo-network/xl1-blockies";
|
|
197
208
|
import { FaCopy } from "react-icons/fa";
|
|
198
|
-
|
|
209
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
210
|
+
var BlockBoundWitnessCardHeader = ({
|
|
211
|
+
linked = true,
|
|
212
|
+
address,
|
|
213
|
+
chainId
|
|
214
|
+
}) => {
|
|
199
215
|
const [ref, dispatch] = useEvent();
|
|
200
|
-
return /* @__PURE__ */
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}
|
|
216
|
+
return /* @__PURE__ */ jsx4(
|
|
217
|
+
CardHeader,
|
|
218
|
+
{
|
|
219
|
+
ref,
|
|
220
|
+
title: /* @__PURE__ */ jsx4(
|
|
221
|
+
Typography,
|
|
222
|
+
{
|
|
223
|
+
onClick: () => linked && dispatch("address", "click", address),
|
|
224
|
+
variant: "body2",
|
|
225
|
+
sx: {
|
|
226
|
+
maxWidth: "100%",
|
|
227
|
+
textOverflow: "ellipsis",
|
|
228
|
+
overflow: "hidden",
|
|
229
|
+
fontFamily: "monospace"
|
|
230
|
+
},
|
|
231
|
+
children: linked ? /* @__PURE__ */ jsx4(Link, { sx: { cursor: "pointer" }, children: address }) : address
|
|
232
|
+
}
|
|
233
|
+
),
|
|
234
|
+
subheader: isDefined3(chainId) ? /* @__PURE__ */ jsxs3(
|
|
235
|
+
Typography,
|
|
236
|
+
{
|
|
237
|
+
variant: "subtitle2",
|
|
238
|
+
sx: {
|
|
239
|
+
fontFamily: "monospace",
|
|
240
|
+
fontSize: 12,
|
|
241
|
+
opacity: 0.5,
|
|
242
|
+
mt: 0.25
|
|
243
|
+
},
|
|
244
|
+
title: `chain: ${chainId}`,
|
|
245
|
+
children: [
|
|
246
|
+
ellipsize2(chainId, 8),
|
|
247
|
+
/* @__PURE__ */ jsx4(IconButton, { size: "small", onClick: () => void navigator.clipboard.writeText(chainId), children: /* @__PURE__ */ jsx4(Icon, { sx: { fontSize: "0.7rem" }, children: /* @__PURE__ */ jsx4(FaCopy, {}) }) })
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
) : null,
|
|
251
|
+
avatar: /* @__PURE__ */ jsx4(Tooltip2, { title: `Address - ${address}`, children: /* @__PURE__ */ jsx4(
|
|
252
|
+
BlockiesAvatarAddress,
|
|
253
|
+
{
|
|
254
|
+
address,
|
|
255
|
+
onClick: () => dispatch("address", "click", address),
|
|
256
|
+
size: 21,
|
|
257
|
+
sx: { cursor: "pointer" }
|
|
258
|
+
}
|
|
259
|
+
) })
|
|
260
|
+
}
|
|
261
|
+
);
|
|
262
|
+
};
|
|
245
263
|
|
|
246
264
|
// src/components/block/card/hooks/useDetails.ts
|
|
247
265
|
import { usePromise as usePromise2 } from "@xylabs/react-promise";
|
|
248
266
|
import { isUndefined as isUndefined2 } from "@xylabs/sdk-js";
|
|
249
267
|
import { StepSizes } from "@xyo-network/xl1-sdk";
|
|
250
268
|
import { useMemo as useMemo2 } from "react";
|
|
251
|
-
var generateStepHashText =
|
|
269
|
+
var generateStepHashText = (blockNumber, stepHashIndex) => {
|
|
252
270
|
const stepSize = StepSizes[stepHashIndex];
|
|
253
271
|
const stepStart = blockNumber - stepSize + 1;
|
|
254
272
|
const stepStop = blockNumber;
|
|
255
|
-
return [
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
];
|
|
259
|
-
}, "generateStepHashText");
|
|
260
|
-
var useBlockDetails = /* @__PURE__ */ __name((wrapper, viewer) => {
|
|
273
|
+
return [`Step ${stepHashIndex} (${stepSize})`, `${formatNumber(stepStart)} - ${formatNumber(stepStop)}`];
|
|
274
|
+
};
|
|
275
|
+
var useBlockDetails = (wrapper, viewer) => {
|
|
261
276
|
const stats = useMemo2(() => {
|
|
262
277
|
if (isUndefined2(wrapper)) return;
|
|
263
278
|
const epochDate = new Date(wrapper.boundWitness.$epoch);
|
|
@@ -269,9 +284,7 @@ var useBlockDetails = /* @__PURE__ */ __name((wrapper, viewer) => {
|
|
|
269
284
|
$epoch: `${epochDate.toLocaleDateString()} ${epochDate.toLocaleTimeString()}`
|
|
270
285
|
};
|
|
271
286
|
return formatResults(stats2);
|
|
272
|
-
}, [
|
|
273
|
-
wrapper
|
|
274
|
-
]);
|
|
287
|
+
}, [wrapper]);
|
|
275
288
|
const payloads = useMemo2(() => {
|
|
276
289
|
if (isUndefined2(wrapper)) return;
|
|
277
290
|
const payloads2 = {
|
|
@@ -279,9 +292,7 @@ var useBlockDetails = /* @__PURE__ */ __name((wrapper, viewer) => {
|
|
|
279
292
|
"Total Payloads": formatNumber(wrapper.payloadCount)
|
|
280
293
|
};
|
|
281
294
|
return formatResults(payloads2);
|
|
282
|
-
}, [
|
|
283
|
-
wrapper
|
|
284
|
-
]);
|
|
295
|
+
}, [wrapper]);
|
|
285
296
|
const [stepHashes, stepHashesError, stepHashesLoading] = usePromise2(async () => {
|
|
286
297
|
if (isUndefined2(wrapper) || isUndefined2(viewer)) return;
|
|
287
298
|
const stepHashes2 = {};
|
|
@@ -302,15 +313,7 @@ var useBlockDetails = /* @__PURE__ */ __name((wrapper, viewer) => {
|
|
|
302
313
|
}
|
|
303
314
|
}
|
|
304
315
|
return formatResults(stepHashes2);
|
|
305
|
-
}, [
|
|
306
|
-
wrapper,
|
|
307
|
-
viewer
|
|
308
|
-
], {
|
|
309
|
-
defaultValue: {
|
|
310
|
-
labels: [],
|
|
311
|
-
values: []
|
|
312
|
-
}
|
|
313
|
-
});
|
|
316
|
+
}, [wrapper, viewer], { defaultValue: { labels: [], values: [] } });
|
|
314
317
|
return {
|
|
315
318
|
stats,
|
|
316
319
|
payloads,
|
|
@@ -318,200 +321,182 @@ var useBlockDetails = /* @__PURE__ */ __name((wrapper, viewer) => {
|
|
|
318
321
|
stepHashesError,
|
|
319
322
|
stepHashesLoading
|
|
320
323
|
};
|
|
321
|
-
}
|
|
324
|
+
};
|
|
322
325
|
|
|
323
326
|
// src/components/block/card/Card.tsx
|
|
324
|
-
|
|
325
|
-
|
|
327
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
328
|
+
var BlockBoundWitnessCard = ({
|
|
329
|
+
linkedAddress = true,
|
|
330
|
+
viewer,
|
|
331
|
+
wrapper,
|
|
332
|
+
...props
|
|
333
|
+
}) => {
|
|
334
|
+
const {
|
|
335
|
+
stats,
|
|
336
|
+
payloads,
|
|
337
|
+
stepHashes,
|
|
338
|
+
stepHashesError,
|
|
339
|
+
stepHashesLoading
|
|
340
|
+
} = useBlockDetails(wrapper, viewer);
|
|
326
341
|
if (isUndefined3(wrapper) || isUndefined3(stats) || isUndefined3(payloads) || isUndefined3(stepHashes)) return null;
|
|
327
|
-
return /* @__PURE__ */
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
sx: {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
width: "100%",
|
|
384
|
-
height: 20
|
|
385
|
-
}), /* @__PURE__ */ React5.createElement(Skeleton, {
|
|
386
|
-
variant: "text",
|
|
387
|
-
width: "100%",
|
|
388
|
-
height: 20
|
|
389
|
-
}), /* @__PURE__ */ React5.createElement(Skeleton, {
|
|
390
|
-
variant: "text",
|
|
391
|
-
width: "100%",
|
|
392
|
-
height: 20
|
|
393
|
-
}), /* @__PURE__ */ React5.createElement(Skeleton, {
|
|
394
|
-
variant: "text",
|
|
395
|
-
width: "100%",
|
|
396
|
-
height: 20
|
|
397
|
-
})) : null, /* @__PURE__ */ React5.createElement(LabelValueStack, {
|
|
398
|
-
labels: stepHashes?.labels ?? [],
|
|
399
|
-
values: stepHashes?.values ?? []
|
|
400
|
-
}))))));
|
|
401
|
-
}, "BlockBoundWitnessCard");
|
|
342
|
+
return /* @__PURE__ */ jsxs4(Card, { ...props, children: [
|
|
343
|
+
wrapper?.boundWitness.addresses.map((address) => /* @__PURE__ */ jsx5(
|
|
344
|
+
BlockBoundWitnessCardHeader,
|
|
345
|
+
{
|
|
346
|
+
address,
|
|
347
|
+
linked: linkedAddress,
|
|
348
|
+
chainId: wrapper.boundWitness.chain
|
|
349
|
+
},
|
|
350
|
+
address
|
|
351
|
+
)),
|
|
352
|
+
/* @__PURE__ */ jsx5(ErrorRender, { error: stepHashesError, scope: "BlockBoundWitnessCard.tsx:stepHashesError" }),
|
|
353
|
+
/* @__PURE__ */ jsx5(CardContent, { children: /* @__PURE__ */ jsxs4(Grid, { container: true, spacing: 6, sx: { width: "100%" }, children: [
|
|
354
|
+
/* @__PURE__ */ jsx5(
|
|
355
|
+
Grid,
|
|
356
|
+
{
|
|
357
|
+
size: {
|
|
358
|
+
xs: 12,
|
|
359
|
+
sm: 6,
|
|
360
|
+
md: 4
|
|
361
|
+
},
|
|
362
|
+
children: /* @__PURE__ */ jsx5(DetailsStack, { IconComponent: IoStatsChartOutline, heading: "Stats", tooltipTitle: "Block Statistics", children: /* @__PURE__ */ jsx5(LabelValueStack, { labels: stats.labels, values: stats.values }) })
|
|
363
|
+
}
|
|
364
|
+
),
|
|
365
|
+
/* @__PURE__ */ jsx5(
|
|
366
|
+
Grid,
|
|
367
|
+
{
|
|
368
|
+
size: {
|
|
369
|
+
xs: 12,
|
|
370
|
+
sm: 6,
|
|
371
|
+
md: 4
|
|
372
|
+
},
|
|
373
|
+
children: /* @__PURE__ */ jsx5(DetailsStack, { IconComponent: VscSymbolNamespace, heading: "Payloads", tooltipTitle: "Payloads within the Block", children: /* @__PURE__ */ jsx5(LabelValueStack, { labels: payloads.labels, values: payloads.values }) })
|
|
374
|
+
}
|
|
375
|
+
),
|
|
376
|
+
/* @__PURE__ */ jsx5(
|
|
377
|
+
Grid,
|
|
378
|
+
{
|
|
379
|
+
size: {
|
|
380
|
+
xs: 12,
|
|
381
|
+
sm: 6,
|
|
382
|
+
md: 4
|
|
383
|
+
},
|
|
384
|
+
children: /* @__PURE__ */ jsxs4(DetailsStack, { IconComponent: GrSteps, heading: "Step Hashes", tooltipTitle: "Step Hashes for the Block", children: [
|
|
385
|
+
stepHashesLoading === "pending" ? /* @__PURE__ */ jsxs4(Stack, { sx: { gap: 0.25 }, children: [
|
|
386
|
+
/* @__PURE__ */ jsx5(Skeleton, { variant: "text", width: "100%", height: 20 }),
|
|
387
|
+
/* @__PURE__ */ jsx5(Skeleton, { variant: "text", width: "100%", height: 20 }),
|
|
388
|
+
/* @__PURE__ */ jsx5(Skeleton, { variant: "text", width: "100%", height: 20 }),
|
|
389
|
+
/* @__PURE__ */ jsx5(Skeleton, { variant: "text", width: "100%", height: 20 })
|
|
390
|
+
] }) : null,
|
|
391
|
+
/* @__PURE__ */ jsx5(LabelValueStack, { labels: stepHashes?.labels ?? [], values: stepHashes?.values ?? [] })
|
|
392
|
+
] })
|
|
393
|
+
}
|
|
394
|
+
)
|
|
395
|
+
] }) })
|
|
396
|
+
] });
|
|
397
|
+
};
|
|
402
398
|
|
|
403
399
|
// src/components/block/BlockBoundWitnessDetails.tsx
|
|
404
|
-
|
|
400
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
401
|
+
var BlockBoundWitnessDetails = ({
|
|
402
|
+
block,
|
|
403
|
+
paper,
|
|
404
|
+
viewer,
|
|
405
|
+
children,
|
|
406
|
+
...props
|
|
407
|
+
}) => {
|
|
405
408
|
const [wrapper, wrapperError] = usePromise3(async () => {
|
|
406
409
|
if (block) {
|
|
407
410
|
return await HydratedBlockWrapper.parse(block);
|
|
408
411
|
}
|
|
409
|
-
}, [
|
|
410
|
-
block
|
|
411
|
-
]);
|
|
412
|
+
}, [block]);
|
|
412
413
|
const boundWitness = block?.[0];
|
|
413
414
|
const payloads = block?.[1];
|
|
414
415
|
const hash = usePayloadHash2(boundWitness);
|
|
415
416
|
const [transactions, txFromBlockError] = useTxsFromBlock(block);
|
|
416
|
-
const { hashes: txHashes, schemas: txSchemas } = useMemo3(() => formatPayloadsForTable(transactions ?? []), [
|
|
417
|
-
transactions
|
|
418
|
-
]);
|
|
417
|
+
const { hashes: txHashes, schemas: txSchemas } = useMemo3(() => formatPayloadsForTable(transactions ?? []), [transactions]);
|
|
419
418
|
const [nonTxBoundWitnesses, bwsFromBlockError] = usePromise3(async () => {
|
|
420
419
|
const bws = filterAs(payloads ?? [], (payload) => !isTransactionBoundWitness(payload) && isBoundWitness(payload) ? payload : void 0);
|
|
421
420
|
return await PayloadBuilder.hashPairs(bws);
|
|
422
|
-
}, [
|
|
423
|
-
|
|
424
|
-
]);
|
|
425
|
-
const { hashes: nonTxBwHashes, schemas: nonTxBwSchemas } = useMemo3(() => formatPayloadsForTable(nonTxBoundWitnesses ?? []), [
|
|
426
|
-
nonTxBoundWitnesses
|
|
427
|
-
]);
|
|
421
|
+
}, [payloads]);
|
|
422
|
+
const { hashes: nonTxBwHashes, schemas: nonTxBwSchemas } = useMemo3(() => formatPayloadsForTable(nonTxBoundWitnesses ?? []), [nonTxBoundWitnesses]);
|
|
428
423
|
const hasNonTxBoundWitnesses = (nonTxBoundWitnesses?.length ?? 0) > 0;
|
|
429
|
-
return /* @__PURE__ */
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
424
|
+
return /* @__PURE__ */ jsxs5(
|
|
425
|
+
FlexCol2,
|
|
426
|
+
{
|
|
427
|
+
...props,
|
|
428
|
+
sx: [{
|
|
433
429
|
alignItems: "stretch",
|
|
434
430
|
rowGap: 4
|
|
435
|
-
},
|
|
436
|
-
|
|
437
|
-
|
|
431
|
+
}, ...Array.isArray(props.sx) ? props.sx : [props.sx]],
|
|
432
|
+
children: [
|
|
433
|
+
/* @__PURE__ */ jsx6(ErrorRender2, { error: txFromBlockError ?? bwsFromBlockError, scope: "BlockBoundWitnessDetails.tsx" }),
|
|
434
|
+
/* @__PURE__ */ jsx6(ErrorRender2, { error: wrapperError, scope: "BlockBoundWitnessDetails.tsx:wrapperError" }),
|
|
435
|
+
/* @__PURE__ */ jsx6(
|
|
436
|
+
HashHeadingPaper,
|
|
437
|
+
{
|
|
438
|
+
hash,
|
|
439
|
+
paperProps: { sx: { p: 2 } },
|
|
440
|
+
AdornmentEnd: /* @__PURE__ */ jsx6(BlockBoundWitnessActions, { boundwitness: boundWitness }),
|
|
441
|
+
identiconProps: { sx: { p: 0.75 }, size: 24 }
|
|
442
|
+
}
|
|
443
|
+
),
|
|
444
|
+
/* @__PURE__ */ jsx6(BlockBoundWitnessCard, { elevation: 4, viewer, wrapper }),
|
|
445
|
+
(transactions?.length ?? 0) > 0 ? /* @__PURE__ */ jsx6(
|
|
446
|
+
PayloadTableFlexbox,
|
|
447
|
+
{
|
|
448
|
+
IconComponent: /* @__PURE__ */ jsx6(GrTransaction, {}),
|
|
449
|
+
eventNoun: "transaction",
|
|
450
|
+
clickableFields: ["hash"],
|
|
451
|
+
hashes: txHashes,
|
|
452
|
+
headingTitle: "Transactions",
|
|
453
|
+
schemas: txSchemas,
|
|
454
|
+
sx: { mb: 1 }
|
|
455
|
+
}
|
|
456
|
+
) : null,
|
|
457
|
+
/* @__PURE__ */ jsxs5(
|
|
458
|
+
FlexCol2,
|
|
459
|
+
{
|
|
460
|
+
sx: {
|
|
461
|
+
alignItems: "stretch",
|
|
462
|
+
rowGap: 1,
|
|
463
|
+
mb: 1
|
|
464
|
+
},
|
|
465
|
+
children: [
|
|
466
|
+
/* @__PURE__ */ jsx6(HeadingPaper2, { IconComponent: /* @__PURE__ */ jsx6(VscSymbolNamespace2, {}), heading: "Payloads" }),
|
|
467
|
+
/* @__PURE__ */ jsx6(BoundWitnessPayloadsTable, { boundwitness: boundWitness, eventNoun: "payload", clickableFields: ["hash"] })
|
|
468
|
+
]
|
|
469
|
+
}
|
|
470
|
+
),
|
|
471
|
+
hasNonTxBoundWitnesses ? /* @__PURE__ */ jsx6(
|
|
472
|
+
PayloadTableFlexbox,
|
|
473
|
+
{
|
|
474
|
+
IconComponent: /* @__PURE__ */ jsx6(VscSymbolMethod2, {}),
|
|
475
|
+
eventNoun: "boundwitness",
|
|
476
|
+
hashes: nonTxBwHashes,
|
|
477
|
+
headingTitle: "Bound Witnesses",
|
|
478
|
+
schemas: nonTxBwSchemas,
|
|
479
|
+
sx: { mb: 1 }
|
|
480
|
+
}
|
|
481
|
+
) : null,
|
|
482
|
+
/* @__PURE__ */ jsxs5(
|
|
483
|
+
FlexCol2,
|
|
484
|
+
{
|
|
485
|
+
sx: {
|
|
486
|
+
alignItems: "stretch",
|
|
487
|
+
rowGap: 1,
|
|
488
|
+
mb: 1
|
|
489
|
+
},
|
|
490
|
+
children: [
|
|
491
|
+
/* @__PURE__ */ jsx6(HeadingPaper2, { IconComponent: /* @__PURE__ */ jsx6(FaSignature, {}), heading: "Signatures" }),
|
|
492
|
+
/* @__PURE__ */ jsx6(BoundWitnessSignatureTable, { block: boundWitness })
|
|
493
|
+
]
|
|
494
|
+
}
|
|
495
|
+
)
|
|
438
496
|
]
|
|
439
|
-
]
|
|
440
|
-
}, /* @__PURE__ */ React6.createElement(ErrorRender2, {
|
|
441
|
-
error: txFromBlockError ?? bwsFromBlockError,
|
|
442
|
-
scope: "BlockBoundWitnessDetails.tsx"
|
|
443
|
-
}), /* @__PURE__ */ React6.createElement(ErrorRender2, {
|
|
444
|
-
error: wrapperError,
|
|
445
|
-
scope: "BlockBoundWitnessDetails.tsx:wrapperError"
|
|
446
|
-
}), /* @__PURE__ */ React6.createElement(HashHeadingPaper, {
|
|
447
|
-
hash,
|
|
448
|
-
paperProps: {
|
|
449
|
-
sx: {
|
|
450
|
-
p: 2
|
|
451
|
-
}
|
|
452
|
-
},
|
|
453
|
-
AdornmentEnd: /* @__PURE__ */ React6.createElement(BlockBoundWitnessActions, {
|
|
454
|
-
boundwitness: boundWitness
|
|
455
|
-
}),
|
|
456
|
-
identiconProps: {
|
|
457
|
-
sx: {
|
|
458
|
-
p: 0.75
|
|
459
|
-
},
|
|
460
|
-
size: 24
|
|
461
|
-
}
|
|
462
|
-
}), /* @__PURE__ */ React6.createElement(BlockBoundWitnessCard, {
|
|
463
|
-
elevation: 4,
|
|
464
|
-
viewer,
|
|
465
|
-
wrapper
|
|
466
|
-
}), (transactions?.length ?? 0) > 0 ? /* @__PURE__ */ React6.createElement(PayloadTableFlexbox, {
|
|
467
|
-
IconComponent: /* @__PURE__ */ React6.createElement(GrTransaction, null),
|
|
468
|
-
eventNoun: "transaction",
|
|
469
|
-
clickableFields: [
|
|
470
|
-
"hash"
|
|
471
|
-
],
|
|
472
|
-
hashes: txHashes,
|
|
473
|
-
headingTitle: "Transactions",
|
|
474
|
-
schemas: txSchemas,
|
|
475
|
-
sx: {
|
|
476
|
-
mb: 1
|
|
477
|
-
}
|
|
478
|
-
}) : null, /* @__PURE__ */ React6.createElement(FlexCol2, {
|
|
479
|
-
sx: {
|
|
480
|
-
alignItems: "stretch",
|
|
481
|
-
rowGap: 1,
|
|
482
|
-
mb: 1
|
|
483
497
|
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
heading: "Payloads"
|
|
487
|
-
}), /* @__PURE__ */ React6.createElement(BoundWitnessPayloadsTable, {
|
|
488
|
-
boundwitness: boundWitness,
|
|
489
|
-
eventNoun: "payload",
|
|
490
|
-
clickableFields: [
|
|
491
|
-
"hash"
|
|
492
|
-
]
|
|
493
|
-
})), hasNonTxBoundWitnesses ? /* @__PURE__ */ React6.createElement(PayloadTableFlexbox, {
|
|
494
|
-
IconComponent: /* @__PURE__ */ React6.createElement(VscSymbolMethod2, null),
|
|
495
|
-
eventNoun: "boundwitness",
|
|
496
|
-
hashes: nonTxBwHashes,
|
|
497
|
-
headingTitle: "Bound Witnesses",
|
|
498
|
-
schemas: nonTxBwSchemas,
|
|
499
|
-
sx: {
|
|
500
|
-
mb: 1
|
|
501
|
-
}
|
|
502
|
-
}) : null, /* @__PURE__ */ React6.createElement(FlexCol2, {
|
|
503
|
-
sx: {
|
|
504
|
-
alignItems: "stretch",
|
|
505
|
-
rowGap: 1,
|
|
506
|
-
mb: 1
|
|
507
|
-
}
|
|
508
|
-
}, /* @__PURE__ */ React6.createElement(HeadingPaper2, {
|
|
509
|
-
IconComponent: /* @__PURE__ */ React6.createElement(FaSignature, null),
|
|
510
|
-
heading: "Signatures"
|
|
511
|
-
}), /* @__PURE__ */ React6.createElement(BoundWitnessSignatureTable, {
|
|
512
|
-
block: boundWitness
|
|
513
|
-
})));
|
|
514
|
-
}, "BlockBoundWitnessDetails");
|
|
498
|
+
);
|
|
499
|
+
};
|
|
515
500
|
|
|
516
501
|
// src/components/transactions/card/actions/TransactionActions.tsx
|
|
517
502
|
import { DataObject as DataObjectIcon2 } from "@mui/icons-material";
|
|
@@ -520,7 +505,6 @@ import { QuickTipButton as QuickTipButton2 } from "@xylabs/react-quick-tip-butto
|
|
|
520
505
|
import { ellipsize as ellipsize3 } from "@xylabs/sdk-js";
|
|
521
506
|
import { BWPreviousHashQuickTipButton as BWPreviousHashQuickTipButton2 } from "@xyo-network/react-boundwitness-plugin";
|
|
522
507
|
import { usePayloadHash as usePayloadHash3 } from "@xyo-network/react-shared";
|
|
523
|
-
import React8 from "react";
|
|
524
508
|
|
|
525
509
|
// src/components/transactions/card/actions/TransactionVerification.tsx
|
|
526
510
|
import { CancelRounded as CancelRoundedIcon2 } from "@mui/icons-material";
|
|
@@ -528,25 +512,17 @@ import { ErrorQuickTipButton as ErrorQuickTipButton2 } from "@xylabs/react-error
|
|
|
528
512
|
import { usePromise as usePromise4 } from "@xylabs/react-promise";
|
|
529
513
|
import { assertEx as assertEx2, isDefined as isDefined4 } from "@xylabs/sdk-js";
|
|
530
514
|
import { isSignedHydratedTransactionWithStorageMeta, validateTransaction } from "@xyo-network/xl1-sdk";
|
|
531
|
-
import
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
ref,
|
|
535
|
-
...props
|
|
536
|
-
}), "InvalidIcon");
|
|
515
|
+
import { useMemo as useMemo4 } from "react";
|
|
516
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
517
|
+
var InvalidIcon2 = ({ ref, ...props }) => /* @__PURE__ */ jsx7(CancelRoundedIcon2, { color: "error", ref, ...props });
|
|
537
518
|
InvalidIcon2.displayName = "InvalidIcon";
|
|
538
|
-
var TransactionVerification =
|
|
519
|
+
var TransactionVerification = ({ transaction, ...props }) => {
|
|
539
520
|
const [validationErrors, validateError] = usePromise4(async () => {
|
|
540
521
|
if (isDefined4(transaction)) {
|
|
541
522
|
const resolvedTransaction = assertEx2(isSignedHydratedTransactionWithStorageMeta(transaction) ? transaction : void 0, () => "Transaction must be a SignedHydratedTransactionWithStorageMeta");
|
|
542
|
-
return await validateTransaction({
|
|
543
|
-
singletons: {},
|
|
544
|
-
chainId: resolvedTransaction[0].chain
|
|
545
|
-
}, resolvedTransaction);
|
|
523
|
+
return await validateTransaction({ singletons: {}, chainId: resolvedTransaction[0].chain }, resolvedTransaction);
|
|
546
524
|
}
|
|
547
|
-
}, [
|
|
548
|
-
transaction
|
|
549
|
-
]);
|
|
525
|
+
}, [transaction]);
|
|
550
526
|
const resolvedErrors = useMemo4(() => {
|
|
551
527
|
const errors = [];
|
|
552
528
|
if (isDefined4(validationErrors)) {
|
|
@@ -555,47 +531,54 @@ var TransactionVerification = /* @__PURE__ */ __name(({ transaction, ...props })
|
|
|
555
531
|
if (isDefined4(validateError)) errors.push(validateError);
|
|
556
532
|
return errors;
|
|
557
533
|
}
|
|
558
|
-
}, [
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
]);
|
|
562
|
-
return /* @__PURE__ */ React7.createElement(ErrorQuickTipButton2, {
|
|
563
|
-
boundWitnessType: "Transaction",
|
|
564
|
-
errors: resolvedErrors,
|
|
565
|
-
...props
|
|
566
|
-
});
|
|
567
|
-
}, "TransactionVerification");
|
|
534
|
+
}, [validateError, validationErrors]);
|
|
535
|
+
return /* @__PURE__ */ jsx7(ErrorQuickTipButton2, { boundWitnessType: "Transaction", errors: resolvedErrors, ...props });
|
|
536
|
+
};
|
|
568
537
|
|
|
569
538
|
// src/components/transactions/card/actions/TransactionActions.tsx
|
|
570
|
-
|
|
539
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
540
|
+
var TransactionActions = ({
|
|
541
|
+
transaction,
|
|
542
|
+
validationIconColors = false,
|
|
543
|
+
...props
|
|
544
|
+
}) => {
|
|
571
545
|
const txBw = transaction?.[0];
|
|
572
546
|
const hash = usePayloadHash3(txBw);
|
|
573
|
-
return /* @__PURE__ */
|
|
574
|
-
boundwitness: txBw
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
wordBreak: "break-all"
|
|
588
|
-
}
|
|
589
|
-
}, transaction ? JSON.stringify(transaction, null, 2) : null)));
|
|
590
|
-
}, "TransactionActions");
|
|
547
|
+
return /* @__PURE__ */ jsxs6(FlexRow2, { ...props, children: [
|
|
548
|
+
txBw?.previous_hashes.length === 0 ? null : /* @__PURE__ */ jsx8(BWPreviousHashQuickTipButton2, { boundwitness: txBw }),
|
|
549
|
+
/* @__PURE__ */ jsx8(TransactionVerification, { iconColors: validationIconColors, transaction }),
|
|
550
|
+
/* @__PURE__ */ jsx8(
|
|
551
|
+
QuickTipButton2,
|
|
552
|
+
{
|
|
553
|
+
Icon: DataObjectIcon2,
|
|
554
|
+
title: `JSON for ${ellipsize3(hash ?? "", 8)}`,
|
|
555
|
+
dialogProps: { fullWidth: true, maxWidth: "md" },
|
|
556
|
+
children: /* @__PURE__ */ jsx8("pre", { style: { wordBreak: "break-all" }, children: transaction ? JSON.stringify(transaction, null, 2) : null })
|
|
557
|
+
}
|
|
558
|
+
)
|
|
559
|
+
] });
|
|
560
|
+
};
|
|
591
561
|
|
|
592
562
|
// src/components/transactions/card/Card.tsx
|
|
593
|
-
import {
|
|
594
|
-
|
|
595
|
-
|
|
563
|
+
import {
|
|
564
|
+
Card as Card2,
|
|
565
|
+
CardContent as CardContent2,
|
|
566
|
+
CardHeader as CardHeader2,
|
|
567
|
+
Grid as Grid2,
|
|
568
|
+
Icon as Icon2,
|
|
569
|
+
IconButton as IconButton2,
|
|
570
|
+
Link as Link2,
|
|
571
|
+
Tooltip as Tooltip3,
|
|
572
|
+
Typography as Typography2
|
|
573
|
+
} from "@mui/material";
|
|
574
|
+
import {
|
|
575
|
+
ellipsize as ellipsize4,
|
|
576
|
+
isDefined as isDefined5,
|
|
577
|
+
isUndefined as isUndefined5
|
|
578
|
+
} from "@xylabs/sdk-js";
|
|
596
579
|
import { DetailsStack as DetailsStack2, LabelValueStack as LabelValueStack2 } from "@xyo-network/react-chain-shared";
|
|
597
580
|
import { useEvent as useEvent2 } from "@xyo-network/react-event";
|
|
598
|
-
import
|
|
581
|
+
import { BlockiesAvatarAddress as BlockiesAvatarAddress2 } from "@xyo-network/xl1-blockies";
|
|
599
582
|
import { FaCopy as FaCopy2 } from "react-icons/fa";
|
|
600
583
|
import { GiReceiveMoney, GiSandsOfTime } from "react-icons/gi";
|
|
601
584
|
import { IoStatsChartOutline as IoStatsChartOutline2 } from "react-icons/io5";
|
|
@@ -603,7 +586,7 @@ import { IoStatsChartOutline as IoStatsChartOutline2 } from "react-icons/io5";
|
|
|
603
586
|
// src/components/transactions/card/hooks/useDetails.ts
|
|
604
587
|
import { isUndefined as isUndefined4 } from "@xylabs/sdk-js";
|
|
605
588
|
import { useMemo as useMemo5 } from "react";
|
|
606
|
-
var useTransactionDetails =
|
|
589
|
+
var useTransactionDetails = (wrapper) => {
|
|
607
590
|
const stats = useMemo5(() => {
|
|
608
591
|
if (isUndefined4(wrapper)) return;
|
|
609
592
|
const stats2 = {
|
|
@@ -614,9 +597,7 @@ var useTransactionDetails = /* @__PURE__ */ __name((wrapper) => {
|
|
|
614
597
|
"Signatures": formatNumber(wrapper.signatureCount)
|
|
615
598
|
};
|
|
616
599
|
return formatResults(stats2);
|
|
617
|
-
}, [
|
|
618
|
-
wrapper
|
|
619
|
-
]);
|
|
600
|
+
}, [wrapper]);
|
|
620
601
|
const fees = useMemo5(() => {
|
|
621
602
|
if (isUndefined4(wrapper)) return;
|
|
622
603
|
const fees2 = {
|
|
@@ -626,9 +607,7 @@ var useTransactionDetails = /* @__PURE__ */ __name((wrapper) => {
|
|
|
626
607
|
"Gas Limit": formatFee(wrapper.fees.gasLimit)
|
|
627
608
|
};
|
|
628
609
|
return formatResults(fees2);
|
|
629
|
-
}, [
|
|
630
|
-
wrapper
|
|
631
|
-
]);
|
|
610
|
+
}, [wrapper]);
|
|
632
611
|
const blockDuration = useMemo5(() => {
|
|
633
612
|
if (isUndefined4(wrapper)) return;
|
|
634
613
|
const blockDuration2 = {
|
|
@@ -636,122 +615,123 @@ var useTransactionDetails = /* @__PURE__ */ __name((wrapper) => {
|
|
|
636
615
|
"Not Before": wrapper.boundWitness.nbf.toLocaleString(navigator.language ?? "en-US")
|
|
637
616
|
};
|
|
638
617
|
return formatResults(blockDuration2);
|
|
639
|
-
}, [
|
|
640
|
-
wrapper
|
|
641
|
-
]);
|
|
618
|
+
}, [wrapper]);
|
|
642
619
|
return {
|
|
643
620
|
stats,
|
|
644
621
|
fees,
|
|
645
622
|
blockDuration
|
|
646
623
|
};
|
|
647
|
-
}
|
|
624
|
+
};
|
|
648
625
|
|
|
649
626
|
// src/components/transactions/card/Card.tsx
|
|
650
|
-
|
|
627
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
628
|
+
var TransactionBoundWitnessCard = ({
|
|
629
|
+
linkedAddress = true,
|
|
630
|
+
wrapper,
|
|
631
|
+
...props
|
|
632
|
+
}) => {
|
|
651
633
|
const chainId = wrapper?.boundWitness.chain;
|
|
652
|
-
const {
|
|
634
|
+
const {
|
|
635
|
+
stats,
|
|
636
|
+
fees,
|
|
637
|
+
blockDuration
|
|
638
|
+
} = useTransactionDetails(wrapper);
|
|
653
639
|
const [ref, dispatch] = useEvent2();
|
|
654
640
|
if (isUndefined5(wrapper) || isUndefined5(stats) || isUndefined5(fees) || isUndefined5(blockDuration)) return null;
|
|
655
|
-
return /* @__PURE__ */
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
641
|
+
return /* @__PURE__ */ jsxs7(Card2, { ref, ...props, children: [
|
|
642
|
+
/* @__PURE__ */ jsx9(
|
|
643
|
+
CardHeader2,
|
|
644
|
+
{
|
|
645
|
+
title: /* @__PURE__ */ jsx9(
|
|
646
|
+
Typography2,
|
|
647
|
+
{
|
|
648
|
+
onClick: () => linkedAddress && dispatch("address", "click", wrapper.boundWitness.from),
|
|
649
|
+
variant: "body2",
|
|
650
|
+
sx: {
|
|
651
|
+
maxWidth: "100%",
|
|
652
|
+
textOverflow: "ellipsis",
|
|
653
|
+
overflow: "hidden",
|
|
654
|
+
fontFamily: "monospace"
|
|
655
|
+
},
|
|
656
|
+
children: linkedAddress ? /* @__PURE__ */ jsx9(Link2, { sx: { cursor: "pointer" }, children: wrapper?.boundWitness.from }) : wrapper?.boundWitness.from
|
|
657
|
+
}
|
|
658
|
+
),
|
|
659
|
+
subheader: isDefined5(chainId) ? /* @__PURE__ */ jsxs7(
|
|
660
|
+
Typography2,
|
|
661
|
+
{
|
|
662
|
+
variant: "subtitle2",
|
|
663
|
+
sx: {
|
|
664
|
+
fontFamily: "monospace",
|
|
665
|
+
fontSize: 12,
|
|
666
|
+
opacity: 0.5,
|
|
667
|
+
mt: 0.25
|
|
668
|
+
},
|
|
669
|
+
title: `chain: ${chainId}`,
|
|
670
|
+
children: [
|
|
671
|
+
ellipsize4(chainId, 8),
|
|
672
|
+
/* @__PURE__ */ jsx9(IconButton2, { size: "small", onClick: () => void navigator.clipboard.writeText(chainId), children: /* @__PURE__ */ jsx9(Icon2, { sx: { fontSize: "0.7rem" }, children: /* @__PURE__ */ jsx9(FaCopy2, {}) }) })
|
|
673
|
+
]
|
|
674
|
+
}
|
|
675
|
+
) : null,
|
|
676
|
+
avatar: /* @__PURE__ */ jsx9(Tooltip3, { title: `From Address - ${wrapper?.boundWitness.from}`, children: /* @__PURE__ */ jsx9(
|
|
677
|
+
BlockiesAvatarAddress2,
|
|
678
|
+
{
|
|
679
|
+
address: wrapper?.boundWitness.from,
|
|
680
|
+
onClick: () => dispatch("address", "click", wrapper.boundWitness.from),
|
|
681
|
+
size: 21,
|
|
682
|
+
sx: { cursor: "pointer" }
|
|
683
|
+
}
|
|
684
|
+
) })
|
|
698
685
|
}
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
}
|
|
738
|
-
}, /* @__PURE__ */ React9.createElement(DetailsStack2, {
|
|
739
|
-
IconComponent: GiSandsOfTime,
|
|
740
|
-
heading: "Block Duration",
|
|
741
|
-
tooltipTitle: "Block window for the transaction to be valid"
|
|
742
|
-
}, /* @__PURE__ */ React9.createElement(LabelValueStack2, {
|
|
743
|
-
labels: blockDuration.labels,
|
|
744
|
-
values: blockDuration.values
|
|
745
|
-
}))))));
|
|
746
|
-
}, "TransactionBoundWitnessCard");
|
|
686
|
+
),
|
|
687
|
+
/* @__PURE__ */ jsx9(CardContent2, { children: /* @__PURE__ */ jsxs7(Grid2, { container: true, spacing: 6, sx: { width: "100%" }, children: [
|
|
688
|
+
/* @__PURE__ */ jsx9(
|
|
689
|
+
Grid2,
|
|
690
|
+
{
|
|
691
|
+
size: {
|
|
692
|
+
xs: 12,
|
|
693
|
+
sm: 6,
|
|
694
|
+
md: 4
|
|
695
|
+
},
|
|
696
|
+
children: /* @__PURE__ */ jsx9(DetailsStack2, { IconComponent: IoStatsChartOutline2, heading: "Stats", tooltipTitle: "Transaction Statistics", children: /* @__PURE__ */ jsx9(LabelValueStack2, { labels: stats.labels, values: stats.values }) })
|
|
697
|
+
}
|
|
698
|
+
),
|
|
699
|
+
/* @__PURE__ */ jsx9(
|
|
700
|
+
Grid2,
|
|
701
|
+
{
|
|
702
|
+
size: {
|
|
703
|
+
xs: 12,
|
|
704
|
+
sm: 6,
|
|
705
|
+
md: 4
|
|
706
|
+
},
|
|
707
|
+
children: /* @__PURE__ */ jsx9(DetailsStack2, { IconComponent: GiReceiveMoney, heading: "Fees", tooltipTitle: "Fees offered to the producer", children: /* @__PURE__ */ jsx9(LabelValueStack2, { labels: fees.labels, values: fees.values }) })
|
|
708
|
+
}
|
|
709
|
+
),
|
|
710
|
+
/* @__PURE__ */ jsx9(
|
|
711
|
+
Grid2,
|
|
712
|
+
{
|
|
713
|
+
size: {
|
|
714
|
+
xs: 12,
|
|
715
|
+
sm: 6,
|
|
716
|
+
md: 4
|
|
717
|
+
},
|
|
718
|
+
children: /* @__PURE__ */ jsx9(DetailsStack2, { IconComponent: GiSandsOfTime, heading: "Block Duration", tooltipTitle: "Block window for the transaction to be valid", children: /* @__PURE__ */ jsx9(LabelValueStack2, { labels: blockDuration.labels, values: blockDuration.values }) })
|
|
719
|
+
}
|
|
720
|
+
)
|
|
721
|
+
] }) })
|
|
722
|
+
] });
|
|
723
|
+
};
|
|
747
724
|
|
|
748
725
|
// src/components/transactions/TransactionBoundWitnessDetails.tsx
|
|
749
726
|
import { ErrorRender as ErrorRender3 } from "@xylabs/react-error";
|
|
750
727
|
import { FlexCol as FlexCol3 } from "@xylabs/react-flexbox";
|
|
751
728
|
import { usePromise as usePromise6 } from "@xylabs/react-promise";
|
|
752
|
-
import {
|
|
729
|
+
import {
|
|
730
|
+
BoundWitnessSignatureTable as BoundWitnessSignatureTable2,
|
|
731
|
+
HashHeadingPaper as HashHeadingPaper2,
|
|
732
|
+
HeadingPaper as HeadingPaper3
|
|
733
|
+
} from "@xyo-network/react-boundwitness-plugin";
|
|
753
734
|
import { HydratedTransactionWrapper } from "@xyo-network/xl1-sdk";
|
|
754
|
-
import React10 from "react";
|
|
755
735
|
import { FaSignature as FaSignature2 } from "react-icons/fa";
|
|
756
736
|
import { VscSymbolNamespace as VscSymbolNamespace3 } from "react-icons/vsc";
|
|
757
737
|
|
|
@@ -760,40 +740,27 @@ import { usePromise as usePromise5 } from "@xylabs/react-promise";
|
|
|
760
740
|
import { isDefined as isDefined6, isHash } from "@xylabs/sdk-js";
|
|
761
741
|
import { isSchema, PayloadBuilder as PayloadBuilder2 } from "@xyo-network/sdk-js";
|
|
762
742
|
import { useMemo as useMemo6 } from "react";
|
|
763
|
-
var useTransactionPayloadTypes =
|
|
743
|
+
var useTransactionPayloadTypes = (wrapper) => {
|
|
764
744
|
const [elevatedPayloadSets, elevatedPayloadSetsError] = usePromise5(async () => {
|
|
765
745
|
if (isDefined6(wrapper)) {
|
|
766
746
|
const elevatedPayloads = wrapper.elevatedPayloads;
|
|
767
747
|
const pairs = await PayloadBuilder2.hashPairs(elevatedPayloads);
|
|
768
748
|
return formatPayloadsForTable(pairs);
|
|
769
749
|
} else {
|
|
770
|
-
return {
|
|
771
|
-
hashes: [],
|
|
772
|
-
schemas: []
|
|
773
|
-
};
|
|
750
|
+
return { hashes: [], schemas: [] };
|
|
774
751
|
}
|
|
775
|
-
}, [
|
|
776
|
-
wrapper
|
|
777
|
-
]);
|
|
752
|
+
}, [wrapper]);
|
|
778
753
|
const [publicPayloads, publicPayloadsError] = usePromise5(async () => {
|
|
779
754
|
if (isDefined6(wrapper)) {
|
|
780
755
|
const publicPayloads2 = wrapper.publicExternalPayloads;
|
|
781
756
|
const pairs = await PayloadBuilder2.hashPairs(publicPayloads2);
|
|
782
757
|
return formatPayloadsForTable(pairs);
|
|
783
758
|
} else {
|
|
784
|
-
return {
|
|
785
|
-
hashes: [],
|
|
786
|
-
schemas: []
|
|
787
|
-
};
|
|
759
|
+
return { hashes: [], schemas: [] };
|
|
788
760
|
}
|
|
789
|
-
}, [
|
|
790
|
-
wrapper
|
|
791
|
-
]);
|
|
761
|
+
}, [wrapper]);
|
|
792
762
|
const [referencedPayloads, referencedPayloadsError] = useMemo6(() => {
|
|
793
|
-
const ret = {
|
|
794
|
-
hashes: [],
|
|
795
|
-
schemas: []
|
|
796
|
-
};
|
|
763
|
+
const ret = { hashes: [], schemas: [] };
|
|
797
764
|
const errors = [];
|
|
798
765
|
if (isDefined6(wrapper)) {
|
|
799
766
|
const referencedPayloads2 = wrapper.privateExternalPayloads;
|
|
@@ -807,13 +774,8 @@ var useTransactionPayloadTypes = /* @__PURE__ */ __name((wrapper) => {
|
|
|
807
774
|
}
|
|
808
775
|
}
|
|
809
776
|
}
|
|
810
|
-
return [
|
|
811
|
-
|
|
812
|
-
errors
|
|
813
|
-
];
|
|
814
|
-
}, [
|
|
815
|
-
wrapper
|
|
816
|
-
]);
|
|
777
|
+
return [ret, errors];
|
|
778
|
+
}, [wrapper]);
|
|
817
779
|
const { hashes: elevatedPayloadHashes, schemas: elevatedPayloadSchemas } = elevatedPayloadSets ?? {};
|
|
818
780
|
const { hashes: publicPayloadHashes, schemas: publicPayloadSchemas } = publicPayloads ?? {};
|
|
819
781
|
const { hashes: referencedPayloadHashes, schemas: referencedPayloadSchemas } = referencedPayloads ?? {};
|
|
@@ -828,114 +790,111 @@ var useTransactionPayloadTypes = /* @__PURE__ */ __name((wrapper) => {
|
|
|
828
790
|
referencedPayloadSchemas,
|
|
829
791
|
referencedPayloadsError
|
|
830
792
|
};
|
|
831
|
-
}
|
|
793
|
+
};
|
|
832
794
|
|
|
833
795
|
// src/components/transactions/TransactionBoundWitnessDetails.tsx
|
|
834
|
-
|
|
796
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
797
|
+
var TransactionBoundWitnessDetails = ({
|
|
798
|
+
linkedProducerAddress,
|
|
799
|
+
transaction,
|
|
800
|
+
...props
|
|
801
|
+
}) => {
|
|
835
802
|
const [wrapper, wrapperError] = usePromise6(async () => {
|
|
836
803
|
if (transaction) {
|
|
837
804
|
return await HydratedTransactionWrapper.parse(transaction);
|
|
838
805
|
}
|
|
839
|
-
}, [
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
806
|
+
}, [transaction]);
|
|
807
|
+
const {
|
|
808
|
+
elevatedPayloadHashes,
|
|
809
|
+
elevatedPayloadSchemas,
|
|
810
|
+
elevatedPayloadSetsError,
|
|
811
|
+
publicPayloadHashes,
|
|
812
|
+
publicPayloadSchemas,
|
|
813
|
+
publicPayloadsError,
|
|
814
|
+
referencedPayloadHashes,
|
|
815
|
+
referencedPayloadSchemas,
|
|
816
|
+
referencedPayloadsError
|
|
817
|
+
} = useTransactionPayloadTypes(wrapper);
|
|
818
|
+
return /* @__PURE__ */ jsxs8(
|
|
819
|
+
FlexCol3,
|
|
820
|
+
{
|
|
821
|
+
...props,
|
|
822
|
+
sx: [{
|
|
847
823
|
alignItems: "stretch",
|
|
848
824
|
rowGap: 2
|
|
849
|
-
},
|
|
850
|
-
|
|
851
|
-
|
|
825
|
+
}, ...Array.isArray(props.sx) ? props.sx : [props.sx]],
|
|
826
|
+
children: [
|
|
827
|
+
/* @__PURE__ */ jsx10(
|
|
828
|
+
HashHeadingPaper2,
|
|
829
|
+
{
|
|
830
|
+
hash: wrapper?.boundWitness?._hash,
|
|
831
|
+
paperProps: { sx: { p: 2 } },
|
|
832
|
+
AdornmentEnd: /* @__PURE__ */ jsx10(TransactionActions, { transaction }),
|
|
833
|
+
identiconProps: { sx: { p: 0.75 }, size: 24 }
|
|
834
|
+
}
|
|
835
|
+
),
|
|
836
|
+
/* @__PURE__ */ jsx10(ErrorRender3, { error: wrapperError, scope: "wrapperError:TransactionBoundWitnessDetails.tsx" }),
|
|
837
|
+
/* @__PURE__ */ jsx10(ErrorRender3, { error: elevatedPayloadSetsError, scope: "elevatedPayloadSetsError:TransactionBoundWitnessDetails.tsx" }),
|
|
838
|
+
/* @__PURE__ */ jsx10(ErrorRender3, { error: publicPayloadsError, scope: "publicPayloadsError:TransactionBoundWitnessDetails.tsx" }),
|
|
839
|
+
referencedPayloadsError.map((error) => /* @__PURE__ */ jsx10(ErrorRender3, { error, scope: "referencedPayloadsError:TransactionBoundWitnessDetails.tsx" }, error.message)),
|
|
840
|
+
/* @__PURE__ */ jsx10(TransactionBoundWitnessCard, { elevation: 4, linkedAddress: linkedProducerAddress, wrapper }),
|
|
841
|
+
/* @__PURE__ */ jsx10(
|
|
842
|
+
PayloadTableFlexbox,
|
|
843
|
+
{
|
|
844
|
+
eventNoun: "payload",
|
|
845
|
+
clickableFields: ["hash"],
|
|
846
|
+
tooltip: "Payloads included in the transaction that are elevated and validated.",
|
|
847
|
+
IconComponent: /* @__PURE__ */ jsx10(VscSymbolNamespace3, {}),
|
|
848
|
+
hashes: elevatedPayloadHashes,
|
|
849
|
+
headingTitle: "On Chain Payloads",
|
|
850
|
+
schemas: elevatedPayloadSchemas,
|
|
851
|
+
sx: { mb: 1 }
|
|
852
|
+
}
|
|
853
|
+
),
|
|
854
|
+
(publicPayloadHashes?.length ?? 0) > 0 ? /* @__PURE__ */ jsx10(
|
|
855
|
+
PayloadTableFlexbox,
|
|
856
|
+
{
|
|
857
|
+
eventNoun: "payload",
|
|
858
|
+
clickableFields: ["hash"],
|
|
859
|
+
tooltip: "Public payloads included in the transaction.",
|
|
860
|
+
IconComponent: /* @__PURE__ */ jsx10(VscSymbolNamespace3, {}),
|
|
861
|
+
hashes: publicPayloadHashes,
|
|
862
|
+
headingTitle: "Public Payloads",
|
|
863
|
+
schemas: publicPayloadSchemas,
|
|
864
|
+
sx: { mb: 1 }
|
|
865
|
+
}
|
|
866
|
+
) : null,
|
|
867
|
+
(referencedPayloadHashes?.length ?? 0) > 0 ? /* @__PURE__ */ jsx10(
|
|
868
|
+
PayloadTableFlexbox,
|
|
869
|
+
{
|
|
870
|
+
eventNoun: "payload",
|
|
871
|
+
clickableFields: ["hash"],
|
|
872
|
+
tooltip: "Payload hashes referenced by the transaction but not included.",
|
|
873
|
+
IconComponent: /* @__PURE__ */ jsx10(VscSymbolNamespace3, {}),
|
|
874
|
+
hashes: referencedPayloadHashes,
|
|
875
|
+
headingTitle: "Referenced Payloads",
|
|
876
|
+
schemas: referencedPayloadSchemas,
|
|
877
|
+
sx: { mb: 1 }
|
|
878
|
+
}
|
|
879
|
+
) : null,
|
|
880
|
+
/* @__PURE__ */ jsxs8(
|
|
881
|
+
FlexCol3,
|
|
882
|
+
{
|
|
883
|
+
sx: {
|
|
884
|
+
alignItems: "stretch",
|
|
885
|
+
rowGap: 1,
|
|
886
|
+
mb: 1
|
|
887
|
+
},
|
|
888
|
+
children: [
|
|
889
|
+
/* @__PURE__ */ jsx10(HeadingPaper3, { IconComponent: /* @__PURE__ */ jsx10(FaSignature2, {}), heading: "Signatures" }),
|
|
890
|
+
/* @__PURE__ */ jsx10(BoundWitnessSignatureTable2, { block: wrapper?.boundWitness })
|
|
891
|
+
]
|
|
892
|
+
}
|
|
893
|
+
)
|
|
852
894
|
]
|
|
853
|
-
]
|
|
854
|
-
}, /* @__PURE__ */ React10.createElement(HashHeadingPaper2, {
|
|
855
|
-
hash: wrapper?.boundWitness?._hash,
|
|
856
|
-
paperProps: {
|
|
857
|
-
sx: {
|
|
858
|
-
p: 2
|
|
859
|
-
}
|
|
860
|
-
},
|
|
861
|
-
AdornmentEnd: /* @__PURE__ */ React10.createElement(TransactionActions, {
|
|
862
|
-
transaction
|
|
863
|
-
}),
|
|
864
|
-
identiconProps: {
|
|
865
|
-
sx: {
|
|
866
|
-
p: 0.75
|
|
867
|
-
},
|
|
868
|
-
size: 24
|
|
869
|
-
}
|
|
870
|
-
}), /* @__PURE__ */ React10.createElement(ErrorRender3, {
|
|
871
|
-
error: wrapperError,
|
|
872
|
-
scope: "wrapperError:TransactionBoundWitnessDetails.tsx"
|
|
873
|
-
}), /* @__PURE__ */ React10.createElement(ErrorRender3, {
|
|
874
|
-
error: elevatedPayloadSetsError,
|
|
875
|
-
scope: "elevatedPayloadSetsError:TransactionBoundWitnessDetails.tsx"
|
|
876
|
-
}), /* @__PURE__ */ React10.createElement(ErrorRender3, {
|
|
877
|
-
error: publicPayloadsError,
|
|
878
|
-
scope: "publicPayloadsError:TransactionBoundWitnessDetails.tsx"
|
|
879
|
-
}), referencedPayloadsError.map((error) => /* @__PURE__ */ React10.createElement(ErrorRender3, {
|
|
880
|
-
key: error.message,
|
|
881
|
-
error,
|
|
882
|
-
scope: "referencedPayloadsError:TransactionBoundWitnessDetails.tsx"
|
|
883
|
-
})), /* @__PURE__ */ React10.createElement(TransactionBoundWitnessCard, {
|
|
884
|
-
elevation: 4,
|
|
885
|
-
linkedAddress: linkedProducerAddress,
|
|
886
|
-
wrapper
|
|
887
|
-
}), /* @__PURE__ */ React10.createElement(PayloadTableFlexbox, {
|
|
888
|
-
eventNoun: "payload",
|
|
889
|
-
clickableFields: [
|
|
890
|
-
"hash"
|
|
891
|
-
],
|
|
892
|
-
tooltip: "Payloads included in the transaction that are elevated and validated.",
|
|
893
|
-
IconComponent: /* @__PURE__ */ React10.createElement(VscSymbolNamespace3, null),
|
|
894
|
-
hashes: elevatedPayloadHashes,
|
|
895
|
-
headingTitle: "On Chain Payloads",
|
|
896
|
-
schemas: elevatedPayloadSchemas,
|
|
897
|
-
sx: {
|
|
898
|
-
mb: 1
|
|
899
|
-
}
|
|
900
|
-
}), (publicPayloadHashes?.length ?? 0) > 0 ? /* @__PURE__ */ React10.createElement(PayloadTableFlexbox, {
|
|
901
|
-
eventNoun: "payload",
|
|
902
|
-
clickableFields: [
|
|
903
|
-
"hash"
|
|
904
|
-
],
|
|
905
|
-
tooltip: "Public payloads included in the transaction.",
|
|
906
|
-
IconComponent: /* @__PURE__ */ React10.createElement(VscSymbolNamespace3, null),
|
|
907
|
-
hashes: publicPayloadHashes,
|
|
908
|
-
headingTitle: "Public Payloads",
|
|
909
|
-
schemas: publicPayloadSchemas,
|
|
910
|
-
sx: {
|
|
911
|
-
mb: 1
|
|
912
895
|
}
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
clickableFields: [
|
|
916
|
-
"hash"
|
|
917
|
-
],
|
|
918
|
-
tooltip: "Payload hashes referenced by the transaction but not included.",
|
|
919
|
-
IconComponent: /* @__PURE__ */ React10.createElement(VscSymbolNamespace3, null),
|
|
920
|
-
hashes: referencedPayloadHashes,
|
|
921
|
-
headingTitle: "Referenced Payloads",
|
|
922
|
-
schemas: referencedPayloadSchemas,
|
|
923
|
-
sx: {
|
|
924
|
-
mb: 1
|
|
925
|
-
}
|
|
926
|
-
}) : null, /* @__PURE__ */ React10.createElement(FlexCol3, {
|
|
927
|
-
sx: {
|
|
928
|
-
alignItems: "stretch",
|
|
929
|
-
rowGap: 1,
|
|
930
|
-
mb: 1
|
|
931
|
-
}
|
|
932
|
-
}, /* @__PURE__ */ React10.createElement(HeadingPaper3, {
|
|
933
|
-
IconComponent: /* @__PURE__ */ React10.createElement(FaSignature2, null),
|
|
934
|
-
heading: "Signatures"
|
|
935
|
-
}), /* @__PURE__ */ React10.createElement(BoundWitnessSignatureTable2, {
|
|
936
|
-
block: wrapper?.boundWitness
|
|
937
|
-
})));
|
|
938
|
-
}, "TransactionBoundWitnessDetails");
|
|
896
|
+
);
|
|
897
|
+
};
|
|
939
898
|
export {
|
|
940
899
|
BlockBoundWitnessActions,
|
|
941
900
|
BlockBoundWitnessCard,
|
|
@@ -947,4 +906,4 @@ export {
|
|
|
947
906
|
TransactionBoundWitnessDetails,
|
|
948
907
|
TransactionVerification
|
|
949
908
|
};
|
|
950
|
-
//# sourceMappingURL=index.mjs.map
|
|
909
|
+
//# sourceMappingURL=index.mjs.map
|