@xyo-network/react-gas-price 2.78.0 → 2.78.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.cjs +234 -1
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +211 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/neutral/index.cjs +234 -1
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.js +211 -1
- package/dist/neutral/index.js.map +1 -1
- package/dist/node/index.cjs +251 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +215 -1
- package/dist/node/index.js.map +1 -1
- package/package.json +5 -5
package/dist/browser/index.cjs
CHANGED
|
@@ -1,2 +1,235 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
EthereumGasPriceAvatar: () => EthereumGasPriceAvatar,
|
|
24
|
+
GasFeeCard: () => GasFeeCard,
|
|
25
|
+
GasPriceHeaderActionsBox: () => GasPriceHeaderActionsBox,
|
|
26
|
+
GasPriceHeaderTypography: () => GasPriceHeaderTypography,
|
|
27
|
+
GasPriceHeadingTypography: () => GasPriceHeadingTypography,
|
|
28
|
+
GasPriceWitnessCardHeader: () => GasPriceWitnessCardHeader,
|
|
29
|
+
GasPriceWitnessHeaderBox: () => GasPriceWitnessHeaderBox,
|
|
30
|
+
StyledCardHeader: () => StyledCardHeader,
|
|
31
|
+
StyledGasPriceHeaderBox: () => StyledGasPriceHeaderBox,
|
|
32
|
+
ToggleRawPayloadBox: () => ToggleRawPayloadBox
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(src_exports);
|
|
35
|
+
|
|
36
|
+
// src/components/Avatar/EthereumGasPriceAvatar.tsx
|
|
37
|
+
var import_icons_material = require("@mui/icons-material");
|
|
38
|
+
var import_material = require("@mui/material");
|
|
39
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
|
+
var EthereumGasPriceAvatar = ({ ...props }) => {
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Avatar, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.LocalGasStationRounded, {}) });
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// src/components/CardHeader/CardHeader.tsx
|
|
45
|
+
var import_react = require("react");
|
|
46
|
+
|
|
47
|
+
// src/components/HeaderComponents/Actions.tsx
|
|
48
|
+
var import_material2 = require("@mui/material");
|
|
49
|
+
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
50
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
51
|
+
var GasPriceHeaderActionsBox = ({
|
|
52
|
+
baseFee,
|
|
53
|
+
baseFeeLabel = "Base Fee",
|
|
54
|
+
blockNumber,
|
|
55
|
+
blockNumberLabel = "Block Number",
|
|
56
|
+
timestamp,
|
|
57
|
+
...props
|
|
58
|
+
}) => {
|
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react_flexbox.FlexRow, { columnGap: 1, rowGap: 1, flexWrap: "wrap", ...props, children: [
|
|
60
|
+
timestamp ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.Chip, { label: new Date(timestamp).toLocaleString() }) : null,
|
|
61
|
+
baseFee ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.Chip, { label: `${baseFeeLabel} - ${baseFee.toFixed(2)} GWEI` }) : null,
|
|
62
|
+
blockNumber ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.Chip, { label: `${blockNumberLabel} - ${blockNumber}` }) : null
|
|
63
|
+
] });
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// src/components/HeaderComponents/Header/Header.tsx
|
|
67
|
+
var import_material4 = require("@mui/material");
|
|
68
|
+
var import_react_shared2 = require("@xyo-network/react-shared");
|
|
69
|
+
|
|
70
|
+
// src/components/HeaderComponents/Header/Heading.tsx
|
|
71
|
+
var import_material3 = require("@mui/material");
|
|
72
|
+
var import_react_shared = require("@xyo-network/react-shared");
|
|
73
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
74
|
+
var GasPriceHeadingTypography = ({ children, heading, networkIcon, ...props }) => {
|
|
75
|
+
const theme = (0, import_material3.useTheme)();
|
|
76
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_shared.TypographyEx, { fontSize: theme.spacing(6), lineHeight: 1, ...props, children: [
|
|
77
|
+
heading,
|
|
78
|
+
" ",
|
|
79
|
+
networkIcon,
|
|
80
|
+
" ",
|
|
81
|
+
children
|
|
82
|
+
] });
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
// src/components/HeaderComponents/Header/Header.tsx
|
|
86
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
87
|
+
var GasPriceHeaderTypography = ({ heading, children, ...props }) => {
|
|
88
|
+
const theme = (0, import_material4.useTheme)();
|
|
89
|
+
const [ethData] = (0, import_react_shared2.useGetTokenData)(["eth"]);
|
|
90
|
+
const networkIcon = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("img", { height: theme.spacing(4), src: ethData.icon });
|
|
91
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GasPriceHeadingTypography, { heading, networkIcon, ...props, children });
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
// src/components/layout/Header.tsx
|
|
95
|
+
var import_material5 = require("@mui/material");
|
|
96
|
+
var import_react_flexbox2 = require("@xylabs/react-flexbox");
|
|
97
|
+
var StyledGasPriceHeaderBox = (0, import_material5.styled)(import_react_flexbox2.FlexRow, { name: "StyledGasPriceEstimateBox" })(({ theme }) => ({
|
|
98
|
+
alignItems: "end",
|
|
99
|
+
columnGap: theme.spacing(2),
|
|
100
|
+
flexWrap: "wrap",
|
|
101
|
+
justifyContent: "space-between",
|
|
102
|
+
justifyItems: "space-between",
|
|
103
|
+
rowGap: theme.spacing(2),
|
|
104
|
+
width: "100%"
|
|
105
|
+
}));
|
|
106
|
+
|
|
107
|
+
// src/components/layout/StyledCardHeader.tsx
|
|
108
|
+
var import_material6 = require("@mui/material");
|
|
109
|
+
var StyledCardHeader = (0, import_material6.styled)(import_material6.CardHeader, { name: "StyledCardHeader" })(({ theme }) => ({
|
|
110
|
+
flexWrap: "wrap",
|
|
111
|
+
rowGap: theme.spacing(2)
|
|
112
|
+
}));
|
|
113
|
+
|
|
114
|
+
// src/components/CardHeader/CardHeader.tsx
|
|
115
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
116
|
+
var GasPriceWitnessCardHeader = (0, import_react.forwardRef)(({ title, parsedPayload, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
117
|
+
StyledCardHeader,
|
|
118
|
+
{
|
|
119
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GasPriceHeaderTypography, { heading: title }),
|
|
120
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
121
|
+
GasPriceHeaderActionsBox,
|
|
122
|
+
{
|
|
123
|
+
timestamp: parsedPayload?.timestamp,
|
|
124
|
+
baseFee: parsedPayload?.baseFee?.value,
|
|
125
|
+
baseFeeLabel: parsedPayload?.baseFee?.label,
|
|
126
|
+
blockNumber: parsedPayload?.blockNumber?.value,
|
|
127
|
+
blockNumberLabel: parsedPayload?.blockNumber?.label
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
ref,
|
|
131
|
+
...props
|
|
132
|
+
}
|
|
133
|
+
));
|
|
134
|
+
GasPriceWitnessCardHeader.displayName = "GasPriceWitnessCardHeader";
|
|
135
|
+
|
|
136
|
+
// src/components/GasFees/Card.tsx
|
|
137
|
+
var import_material10 = require("@mui/material");
|
|
138
|
+
var import_react_flexbox6 = require("@xylabs/react-flexbox");
|
|
139
|
+
var import_react_card = require("@xyo-network/react-card");
|
|
140
|
+
|
|
141
|
+
// src/components/GasFees/components/GasPriceBox.tsx
|
|
142
|
+
var import_material7 = require("@mui/material");
|
|
143
|
+
var import_react_flexbox3 = require("@xylabs/react-flexbox");
|
|
144
|
+
var import_react_shared4 = require("@xyo-network/react-shared");
|
|
145
|
+
|
|
146
|
+
// src/components/GasFees/components/GweiLabelTypography.tsx
|
|
147
|
+
var import_react_shared3 = require("@xyo-network/react-shared");
|
|
148
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
149
|
+
var GweiLabelTypography = (props) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_shared3.TypographyEx, { variant: "caption", ...props, children: "GWEI" });
|
|
150
|
+
|
|
151
|
+
// src/components/GasFees/components/GasPriceBox.tsx
|
|
152
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
153
|
+
var GasPriceBox = ({ gasPrice, ...props }) => {
|
|
154
|
+
const theme = (0, import_material7.useTheme)();
|
|
155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react_flexbox3.FlexRow, { columnGap: 1.5, rowGap: 1.5, alignItems: "end", ...props, children: [
|
|
156
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_shared4.TypographyEx, { lineHeight: 1, fontWeight: "200", fontSize: theme.spacing(6), title: gasPrice?.toString() ?? "", children: gasPrice?.toFixed(2) }),
|
|
157
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GweiLabelTypography, { fontSize: theme.spacing(2) })
|
|
158
|
+
] });
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
// src/components/GasFees/components/PriorityFeeBox.tsx
|
|
162
|
+
var import_icons_material2 = require("@mui/icons-material");
|
|
163
|
+
var import_material8 = require("@mui/material");
|
|
164
|
+
var import_react_flexbox4 = require("@xylabs/react-flexbox");
|
|
165
|
+
var import_react_shared5 = require("@xyo-network/react-shared");
|
|
166
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
167
|
+
var PriorityFeeBox = ({ priorityFee, priorityFeeLabel = "Priority Fee", ...props }) => {
|
|
168
|
+
const theme = (0, import_material8.useTheme)();
|
|
169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_flexbox4.FlexGrowRow, { width: "100%", justifyContent: "space-between", alignItems: "end", ...props, children: [
|
|
170
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_flexbox4.FlexCol, { alignItems: "start", children: [
|
|
171
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_shared5.TypographyEx, { children: priorityFeeLabel }),
|
|
172
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_shared5.TypographyEx, { title: priorityFee?.toString() ?? "", children: [
|
|
173
|
+
priorityFee?.toFixed(2),
|
|
174
|
+
" ",
|
|
175
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GweiLabelTypography, { fontSize: theme.spacing(1) })
|
|
176
|
+
] })
|
|
177
|
+
] }),
|
|
178
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons_material2.LocalGasStationRounded, {})
|
|
179
|
+
] });
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
// src/components/GasFees/components/SpeedBox.tsx
|
|
183
|
+
var import_material9 = require("@mui/material");
|
|
184
|
+
var import_react_flexbox5 = require("@xylabs/react-flexbox");
|
|
185
|
+
var import_react_shared6 = require("@xyo-network/react-shared");
|
|
186
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
187
|
+
var SpeedBox = ({ speed, ...props }) => {
|
|
188
|
+
const theme = (0, import_material9.useTheme)();
|
|
189
|
+
return speed ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_flexbox5.FlexGrowCol, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_shared6.TypographyEx, { fontSize: theme.spacing(3), fontWeight: "200", p: 1, children: speed }) }) : null;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
// src/components/GasFees/Card.tsx
|
|
193
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
194
|
+
var GasFeeCard = ({ gasPrice, speedPaperElevation, priorityFee, priorityFeeLabel, speed = "low", ...props }) => {
|
|
195
|
+
const theme = (0, import_material10.useTheme)();
|
|
196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material10.Card, { sx: { p: 0 }, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_card.CardContentEx, { removePadding: true, sx: { flexDirection: "column", flexGrow: 1, p: 0, rowGap: 2 }, children: [
|
|
197
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_flexbox6.FlexGrowCol, { bgcolor: theme.palette.secondary.dark, alignItems: "start", p: 2, rowGap: 1.5, color: theme.palette.common.white, children: [
|
|
198
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(GasPriceBox, { gasPrice }),
|
|
199
|
+
priorityFee ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PriorityFeeBox, { priorityFee, priorityFeeLabel }) : null
|
|
200
|
+
] }),
|
|
201
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material10.Paper, { elevation: speedPaperElevation, sx: { borderRadius: `0 0 ${theme.shape.borderRadius}px ${theme.shape.borderRadius}px` }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SpeedBox, { speed }) })
|
|
202
|
+
] }) });
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
// src/components/HeaderBox.tsx
|
|
206
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
207
|
+
var GasPriceWitnessHeaderBox = ({ heading, parsedPayload, ...props }) => {
|
|
208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(StyledGasPriceHeaderBox, { ...props, children: [
|
|
209
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GasPriceHeaderTypography, { heading }),
|
|
210
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
211
|
+
GasPriceHeaderActionsBox,
|
|
212
|
+
{
|
|
213
|
+
timestamp: parsedPayload?.timestamp,
|
|
214
|
+
baseFee: parsedPayload?.baseFee?.value,
|
|
215
|
+
baseFeeLabel: parsedPayload?.baseFee?.label,
|
|
216
|
+
blockNumber: parsedPayload?.blockNumber?.value,
|
|
217
|
+
blockNumberLabel: parsedPayload?.blockNumber?.label
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
] });
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
// src/components/RawPayload/ToggleRawPayloadBox.tsx
|
|
224
|
+
var import_material11 = require("@mui/material");
|
|
225
|
+
var import_react_flexbox7 = require("@xylabs/react-flexbox");
|
|
226
|
+
var import_react2 = require("react");
|
|
227
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
228
|
+
var ToggleRawPayloadBox = ({ gasPricePayload, ...props }) => {
|
|
229
|
+
const [collapse, setCollapse] = (0, import_react2.useState)(false);
|
|
230
|
+
return gasPricePayload ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_flexbox7.FlexCol, { rowGap: 1, ...props, children: [
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_material11.Button, { color: "secondary", sx: { bgcolor: "secondary.dark", color: "white" }, variant: "contained", onClick: () => setCollapse(!collapse), children: "Raw Payload" }),
|
|
232
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_material11.Collapse, { in: collapse, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_material11.Paper, { elevation: 4, sx: { p: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("pre", { children: JSON.stringify(gasPricePayload, null, 2) }) }) })
|
|
233
|
+
] }) : null;
|
|
234
|
+
};
|
|
2
235
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/components/Avatar/EthereumGasPriceAvatar.tsx","../../src/components/CardHeader/CardHeader.tsx","../../src/components/HeaderComponents/Actions.tsx","../../src/components/HeaderComponents/Header/Header.tsx","../../src/components/HeaderComponents/Header/Heading.tsx","../../src/components/layout/Header.tsx","../../src/components/layout/StyledCardHeader.tsx","../../src/components/GasFees/Card.tsx","../../src/components/GasFees/components/GasPriceBox.tsx","../../src/components/GasFees/components/GweiLabelTypography.tsx","../../src/components/GasFees/components/PriorityFeeBox.tsx","../../src/components/GasFees/components/SpeedBox.tsx","../../src/components/HeaderBox.tsx","../../src/components/RawPayload/ToggleRawPayloadBox.tsx"],"sourcesContent":["export * from './components'\nexport * from './types'\n","import { LocalGasStationRounded as LocalGasStationRoundedIcon } from '@mui/icons-material'\nimport { Avatar, AvatarProps } from '@mui/material'\n\nexport const EthereumGasPriceAvatar: React.FC<AvatarProps> = ({ ...props }) => {\n return (\n <Avatar {...props}>\n <LocalGasStationRoundedIcon />\n </Avatar>\n )\n}\n","import { CardProps } from '@mui/material'\nimport { forwardRef } from 'react'\n\nimport { GasPriceWitnessUIBasePayload } from '../../types'\nimport { GasPriceHeaderActionsBox, GasPriceHeaderTypography } from '../HeaderComponents'\nimport { StyledCardHeader } from '../layout'\n\nexport interface GasPriceCardHeaderProps extends CardProps {\n parsedPayload?: GasPriceWitnessUIBasePayload\n title?: string\n}\nexport const GasPriceWitnessCardHeader = forwardRef<HTMLDivElement, GasPriceCardHeaderProps>(({ title, parsedPayload, ...props }, ref) => (\n <StyledCardHeader\n title={<GasPriceHeaderTypography heading={title} />}\n action={\n <GasPriceHeaderActionsBox\n timestamp={parsedPayload?.timestamp}\n baseFee={parsedPayload?.baseFee?.value}\n baseFeeLabel={parsedPayload?.baseFee?.label}\n blockNumber={parsedPayload?.blockNumber?.value}\n blockNumberLabel={parsedPayload?.blockNumber?.label}\n />\n }\n ref={ref}\n {...props}\n />\n))\n\nGasPriceWitnessCardHeader.displayName = 'GasPriceWitnessCardHeader'\n","import { Chip } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\n\nexport interface GasPriceEstimateActionsBoxProps extends FlexBoxProps {\n baseFee?: number\n baseFeeLabel?: string\n blockNumber?: number\n blockNumberLabel?: string\n timestamp?: number\n}\n\nexport const GasPriceHeaderActionsBox: React.FC<GasPriceEstimateActionsBoxProps> = ({\n baseFee,\n baseFeeLabel = 'Base Fee',\n blockNumber,\n blockNumberLabel = 'Block Number',\n timestamp,\n ...props\n}) => {\n return (\n <FlexRow columnGap={1} rowGap={1} flexWrap=\"wrap\" {...props}>\n {timestamp ?\n <Chip label={new Date(timestamp).toLocaleString()} />\n : null}\n {baseFee ?\n <Chip label={`${baseFeeLabel} - ${baseFee.toFixed(2)} GWEI`} />\n : null}\n {blockNumber ?\n <Chip label={`${blockNumberLabel} - ${blockNumber}`} />\n : null}\n </FlexRow>\n )\n}\n","import { useTheme } from '@mui/material'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { TypographyExProps, useGetTokenData } from '@xyo-network/react-shared'\n\nimport { GasPriceHeadingTypography } from './Heading'\n\nexport interface GasPriceHeaderTypographyProps extends TypographyExProps, WithChildren {\n heading?: string\n}\n\nexport const GasPriceHeaderTypography: React.FC<GasPriceHeaderTypographyProps> = ({ heading, children, ...props }) => {\n const theme = useTheme()\n const [ethData] = useGetTokenData(['eth'])\n const networkIcon = <img height={theme.spacing(4)} src={ethData.icon} />\n\n return (\n <GasPriceHeadingTypography heading={heading} networkIcon={networkIcon} {...props}>\n {children}\n </GasPriceHeadingTypography>\n )\n}\n","import { useTheme } from '@mui/material'\nimport { TypographyEx, TypographyExProps } from '@xyo-network/react-shared'\nimport { ReactNode } from 'react'\n\nexport interface GasPriceHeadingTypographyProps extends TypographyExProps {\n children?: ReactNode\n heading?: string\n networkIcon?: ReactNode\n}\n\nexport const GasPriceHeadingTypography: React.FC<GasPriceHeadingTypographyProps> = ({ children, heading, networkIcon, ...props }) => {\n const theme = useTheme()\n return (\n <TypographyEx fontSize={theme.spacing(6)} lineHeight={1} {...props}>\n {heading} {networkIcon} {children}\n </TypographyEx>\n )\n}\n","import { styled } from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\n\nexport const StyledGasPriceHeaderBox = styled(FlexRow, { name: 'StyledGasPriceEstimateBox' })(({ theme }) => ({\n alignItems: 'end',\n columnGap: theme.spacing(2),\n flexWrap: 'wrap',\n justifyContent: 'space-between',\n justifyItems: 'space-between',\n rowGap: theme.spacing(2),\n width: '100%',\n}))\n","import { CardHeader, styled } from '@mui/material'\n\nexport const StyledCardHeader = styled(CardHeader, { name: 'StyledCardHeader' })(({ theme }) => ({\n flexWrap: 'wrap',\n rowGap: theme.spacing(2),\n}))\n","import { Card, CardProps, Paper, useTheme } from '@mui/material'\nimport { FlexGrowCol } from '@xylabs/react-flexbox'\nimport { CardContentEx } from '@xyo-network/react-card'\n\nimport { GasPriceBox, PriorityFeeBox, SpeedBox } from './components'\n\nexport interface GasFeeCardProps extends CardProps {\n gasPrice?: number\n priorityFee?: number\n priorityFeeLabel?: string\n speed?: string\n speedPaperElevation?: number\n}\n\nexport const GasFeeCard: React.FC<GasFeeCardProps> = ({ gasPrice, speedPaperElevation, priorityFee, priorityFeeLabel, speed = 'low', ...props }) => {\n const theme = useTheme()\n\n return (\n <Card sx={{ p: 0 }} {...props}>\n <CardContentEx removePadding sx={{ flexDirection: 'column', flexGrow: 1, p: 0, rowGap: 2 }}>\n <FlexGrowCol bgcolor={theme.palette.secondary.dark} alignItems=\"start\" p={2} rowGap={1.5} color={theme.palette.common.white}>\n <GasPriceBox gasPrice={gasPrice} />\n {priorityFee ?\n <PriorityFeeBox priorityFee={priorityFee} priorityFeeLabel={priorityFeeLabel} />\n : null}\n </FlexGrowCol>\n <Paper elevation={speedPaperElevation} sx={{ borderRadius: `0 0 ${theme.shape.borderRadius}px ${theme.shape.borderRadius}px` }}>\n <SpeedBox speed={speed} />\n </Paper>\n </CardContentEx>\n </Card>\n )\n}\n","import { useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { TypographyEx } from '@xyo-network/react-shared'\n\nimport { GweiLabelTypography } from './GweiLabelTypography'\n\nexport interface GasPriceBoxProps extends FlexBoxProps {\n gasPrice?: number\n}\n\nexport const GasPriceBox: React.FC<GasPriceBoxProps> = ({ gasPrice, ...props }) => {\n const theme = useTheme()\n return (\n <FlexRow columnGap={1.5} rowGap={1.5} alignItems=\"end\" {...props}>\n <TypographyEx lineHeight={1} fontWeight=\"200\" fontSize={theme.spacing(6)} title={gasPrice?.toString() ?? ''}>\n {gasPrice?.toFixed(2)}\n </TypographyEx>\n <GweiLabelTypography fontSize={theme.spacing(2)} />\n </FlexRow>\n )\n}\n","import { TypographyEx, TypographyExProps } from '@xyo-network/react-shared'\n\nexport const GweiLabelTypography: React.FC<TypographyExProps> = (props) => (\n <TypographyEx variant=\"caption\" {...props}>\n GWEI\n </TypographyEx>\n)\n","import { LocalGasStationRounded as LocalGasStationRoundedIcon } from '@mui/icons-material'\nimport { useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexCol, FlexGrowRow } from '@xylabs/react-flexbox'\nimport { TypographyEx } from '@xyo-network/react-shared'\n\nimport { GweiLabelTypography } from './GweiLabelTypography'\n\nexport interface PriorityFeeBoxProps extends FlexBoxProps {\n priorityFee?: number\n priorityFeeLabel?: string\n}\n\nexport const PriorityFeeBox: React.FC<PriorityFeeBoxProps> = ({ priorityFee, priorityFeeLabel = 'Priority Fee', ...props }) => {\n const theme = useTheme()\n\n return (\n <FlexGrowRow width=\"100%\" justifyContent=\"space-between\" alignItems=\"end\" {...props}>\n <FlexCol alignItems=\"start\">\n <TypographyEx>{priorityFeeLabel}</TypographyEx>\n <TypographyEx title={priorityFee?.toString() ?? ''}>\n {priorityFee?.toFixed(2)} <GweiLabelTypography fontSize={theme.spacing(1)} />\n </TypographyEx>\n </FlexCol>\n <LocalGasStationRoundedIcon />\n </FlexGrowRow>\n )\n}\n","import { useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexGrowCol } from '@xylabs/react-flexbox'\nimport { TypographyEx } from '@xyo-network/react-shared'\n\nexport interface SpeedBoxProps extends FlexBoxProps {\n speed?: string\n}\n\nexport const SpeedBox: React.FC<SpeedBoxProps> = ({ speed, ...props }) => {\n const theme = useTheme()\n\n return speed ?\n <FlexGrowCol {...props}>\n <TypographyEx fontSize={theme.spacing(3)} fontWeight=\"200\" p={1}>\n {speed}\n </TypographyEx>\n </FlexGrowCol>\n : null\n}\n","import { FlexBoxProps } from '@xylabs/react-flexbox'\n\nimport { GasPriceWitnessUIBasePayload } from '../types'\nimport { GasPriceHeaderActionsBox, GasPriceHeaderTypography } from './HeaderComponents'\nimport { StyledGasPriceHeaderBox } from './layout'\n\nexport interface GasPriceWitnessHeaderBoxProps extends FlexBoxProps {\n heading?: string\n parsedPayload?: GasPriceWitnessUIBasePayload\n}\n\nexport const GasPriceWitnessHeaderBox: React.FC<GasPriceWitnessHeaderBoxProps> = ({ heading, parsedPayload, ...props }) => {\n return (\n <StyledGasPriceHeaderBox {...props}>\n <GasPriceHeaderTypography heading={heading} />\n <GasPriceHeaderActionsBox\n timestamp={parsedPayload?.timestamp}\n baseFee={parsedPayload?.baseFee?.value}\n baseFeeLabel={parsedPayload?.baseFee?.label}\n blockNumber={parsedPayload?.blockNumber?.value}\n blockNumberLabel={parsedPayload?.blockNumber?.label}\n />\n </StyledGasPriceHeaderBox>\n )\n}\n","import { Button, Collapse, Paper } from '@mui/material'\nimport { FlexBoxProps, FlexCol } from '@xylabs/react-flexbox'\nimport { useState } from 'react'\n\nexport interface ToggleRawPayloadBoxProps extends FlexBoxProps {\n gasPricePayload?: object\n}\n\nexport const ToggleRawPayloadBox: React.FC<ToggleRawPayloadBoxProps> = ({ gasPricePayload, ...props }) => {\n const [collapse, setCollapse] = useState(false)\n return gasPricePayload ?\n <FlexCol rowGap={1} {...props}>\n <Button color=\"secondary\" sx={{ bgcolor: 'secondary.dark', color: 'white' }} variant=\"contained\" onClick={() => setCollapse(!collapse)}>\n Raw Payload\n </Button>\n <Collapse in={collapse}>\n <Paper elevation={4} sx={{ p: 2 }}>\n <pre>{JSON.stringify(gasPricePayload, null, 2)}</pre>\n </Paper>\n </Collapse>\n </FlexCol>\n : null\n}\n"],"mappings":"mbAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,4BAAAE,GAAA,eAAAC,GAAA,6BAAAC,EAAA,6BAAAC,EAAA,8BAAAC,EAAA,8BAAAC,EAAA,6BAAAC,GAAA,qBAAAC,EAAA,4BAAAC,EAAA,wBAAAC,KAAA,eAAAC,GAAAZ,ICAA,IAAAa,EAAqE,+BACrEC,EAAoC,yBAK9BC,EAAA,6BAHOC,GAAgD,CAAC,CAAE,GAAGC,CAAM,OAErE,OAAC,UAAQ,GAAGA,EACV,mBAAC,EAAAC,uBAAA,EAA2B,EAC9B,ECNJ,IAAAC,EAA2B,iBCD3B,IAAAC,EAAqB,yBAC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,GACF,EACA,IACN","names":["src_exports","__export","EthereumGasPriceAvatar","GasFeeCard","GasPriceHeaderActionsBox","GasPriceHeaderTypography","GasPriceHeadingTypography","GasPriceWitnessCardHeader","GasPriceWitnessHeaderBox","StyledCardHeader","StyledGasPriceHeaderBox","ToggleRawPayloadBox","__toCommonJS","import_icons_material","import_material","import_jsx_runtime","EthereumGasPriceAvatar","props","LocalGasStationRoundedIcon","import_react","import_material","import_react_flexbox","import_jsx_runtime","GasPriceHeaderActionsBox","baseFee","baseFeeLabel","blockNumber","blockNumberLabel","timestamp","props","import_material","import_react_shared","import_material","import_react_shared","import_jsx_runtime","GasPriceHeadingTypography","children","heading","networkIcon","props","theme","import_jsx_runtime","GasPriceHeaderTypography","heading","children","props","theme","ethData","networkIcon","GasPriceHeadingTypography","import_material","import_react_flexbox","StyledGasPriceHeaderBox","theme","import_material","StyledCardHeader","theme","import_jsx_runtime","GasPriceWitnessCardHeader","title","parsedPayload","props","ref","StyledCardHeader","GasPriceHeaderTypography","GasPriceHeaderActionsBox","import_material","import_react_flexbox","import_react_card","import_material","import_react_flexbox","import_react_shared","import_react_shared","import_jsx_runtime","GweiLabelTypography","props","import_jsx_runtime","GasPriceBox","gasPrice","props","theme","GweiLabelTypography","import_icons_material","import_material","import_react_flexbox","import_react_shared","import_jsx_runtime","PriorityFeeBox","priorityFee","priorityFeeLabel","props","theme","GweiLabelTypography","LocalGasStationRoundedIcon","import_material","import_react_flexbox","import_react_shared","import_jsx_runtime","SpeedBox","speed","props","theme","import_jsx_runtime","GasFeeCard","gasPrice","speedPaperElevation","priorityFee","priorityFeeLabel","speed","props","theme","GasPriceBox","PriorityFeeBox","SpeedBox","import_jsx_runtime","GasPriceWitnessHeaderBox","heading","parsedPayload","props","StyledGasPriceHeaderBox","GasPriceHeaderTypography","GasPriceHeaderActionsBox","import_material","import_react_flexbox","import_react","import_jsx_runtime","ToggleRawPayloadBox","gasPricePayload","props","collapse","setCollapse"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/components/Avatar/EthereumGasPriceAvatar.tsx","../../src/components/CardHeader/CardHeader.tsx","../../src/components/HeaderComponents/Actions.tsx","../../src/components/HeaderComponents/Header/Header.tsx","../../src/components/HeaderComponents/Header/Heading.tsx","../../src/components/layout/Header.tsx","../../src/components/layout/StyledCardHeader.tsx","../../src/components/GasFees/Card.tsx","../../src/components/GasFees/components/GasPriceBox.tsx","../../src/components/GasFees/components/GweiLabelTypography.tsx","../../src/components/GasFees/components/PriorityFeeBox.tsx","../../src/components/GasFees/components/SpeedBox.tsx","../../src/components/HeaderBox.tsx","../../src/components/RawPayload/ToggleRawPayloadBox.tsx"],"sourcesContent":["export * from './components'\nexport * from './types'\n","import { LocalGasStationRounded as LocalGasStationRoundedIcon } from '@mui/icons-material'\nimport { Avatar, AvatarProps } from '@mui/material'\n\nexport const EthereumGasPriceAvatar: React.FC<AvatarProps> = ({ ...props }) => {\n return (\n <Avatar {...props}>\n <LocalGasStationRoundedIcon />\n </Avatar>\n )\n}\n","import { CardProps } from '@mui/material'\nimport { forwardRef } from 'react'\n\nimport { GasPriceWitnessUIBasePayload } from '../../types'\nimport { GasPriceHeaderActionsBox, GasPriceHeaderTypography } from '../HeaderComponents'\nimport { StyledCardHeader } from '../layout'\n\nexport interface GasPriceCardHeaderProps extends CardProps {\n parsedPayload?: GasPriceWitnessUIBasePayload\n title?: string\n}\nexport const GasPriceWitnessCardHeader = forwardRef<HTMLDivElement, GasPriceCardHeaderProps>(({ title, parsedPayload, ...props }, ref) => (\n <StyledCardHeader\n title={<GasPriceHeaderTypography heading={title} />}\n action={\n <GasPriceHeaderActionsBox\n timestamp={parsedPayload?.timestamp}\n baseFee={parsedPayload?.baseFee?.value}\n baseFeeLabel={parsedPayload?.baseFee?.label}\n blockNumber={parsedPayload?.blockNumber?.value}\n blockNumberLabel={parsedPayload?.blockNumber?.label}\n />\n }\n ref={ref}\n {...props}\n />\n))\n\nGasPriceWitnessCardHeader.displayName = 'GasPriceWitnessCardHeader'\n","import { Chip } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\n\nexport interface GasPriceEstimateActionsBoxProps extends FlexBoxProps {\n baseFee?: number\n baseFeeLabel?: string\n blockNumber?: number\n blockNumberLabel?: string\n timestamp?: number\n}\n\nexport const GasPriceHeaderActionsBox: React.FC<GasPriceEstimateActionsBoxProps> = ({\n baseFee,\n baseFeeLabel = 'Base Fee',\n blockNumber,\n blockNumberLabel = 'Block Number',\n timestamp,\n ...props\n}) => {\n return (\n <FlexRow columnGap={1} rowGap={1} flexWrap=\"wrap\" {...props}>\n {timestamp ?\n <Chip label={new Date(timestamp).toLocaleString()} />\n : null}\n {baseFee ?\n <Chip label={`${baseFeeLabel} - ${baseFee.toFixed(2)} GWEI`} />\n : null}\n {blockNumber ?\n <Chip label={`${blockNumberLabel} - ${blockNumber}`} />\n : null}\n </FlexRow>\n )\n}\n","import { useTheme } from '@mui/material'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { TypographyExProps, useGetTokenData } from '@xyo-network/react-shared'\n\nimport { GasPriceHeadingTypography } from './Heading'\n\nexport interface GasPriceHeaderTypographyProps extends TypographyExProps, WithChildren {\n heading?: string\n}\n\nexport const GasPriceHeaderTypography: React.FC<GasPriceHeaderTypographyProps> = ({ heading, children, ...props }) => {\n const theme = useTheme()\n const [ethData] = useGetTokenData(['eth'])\n const networkIcon = <img height={theme.spacing(4)} src={ethData.icon} />\n\n return (\n <GasPriceHeadingTypography heading={heading} networkIcon={networkIcon} {...props}>\n {children}\n </GasPriceHeadingTypography>\n )\n}\n","import { useTheme } from '@mui/material'\nimport { TypographyEx, TypographyExProps } from '@xyo-network/react-shared'\nimport { ReactNode } from 'react'\n\nexport interface GasPriceHeadingTypographyProps extends TypographyExProps {\n children?: ReactNode\n heading?: string\n networkIcon?: ReactNode\n}\n\nexport const GasPriceHeadingTypography: React.FC<GasPriceHeadingTypographyProps> = ({ children, heading, networkIcon, ...props }) => {\n const theme = useTheme()\n return (\n <TypographyEx fontSize={theme.spacing(6)} lineHeight={1} {...props}>\n {heading} {networkIcon} {children}\n </TypographyEx>\n )\n}\n","import { styled } from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\n\nexport const StyledGasPriceHeaderBox = styled(FlexRow, { name: 'StyledGasPriceEstimateBox' })(({ theme }) => ({\n alignItems: 'end',\n columnGap: theme.spacing(2),\n flexWrap: 'wrap',\n justifyContent: 'space-between',\n justifyItems: 'space-between',\n rowGap: theme.spacing(2),\n width: '100%',\n}))\n","import { CardHeader, styled } from '@mui/material'\n\nexport const StyledCardHeader = styled(CardHeader, { name: 'StyledCardHeader' })(({ theme }) => ({\n flexWrap: 'wrap',\n rowGap: theme.spacing(2),\n}))\n","import { Card, CardProps, Paper, useTheme } from '@mui/material'\nimport { FlexGrowCol } from '@xylabs/react-flexbox'\nimport { CardContentEx } from '@xyo-network/react-card'\n\nimport { GasPriceBox, PriorityFeeBox, SpeedBox } from './components'\n\nexport interface GasFeeCardProps extends CardProps {\n gasPrice?: number\n priorityFee?: number\n priorityFeeLabel?: string\n speed?: string\n speedPaperElevation?: number\n}\n\nexport const GasFeeCard: React.FC<GasFeeCardProps> = ({ gasPrice, speedPaperElevation, priorityFee, priorityFeeLabel, speed = 'low', ...props }) => {\n const theme = useTheme()\n\n return (\n <Card sx={{ p: 0 }} {...props}>\n <CardContentEx removePadding sx={{ flexDirection: 'column', flexGrow: 1, p: 0, rowGap: 2 }}>\n <FlexGrowCol bgcolor={theme.palette.secondary.dark} alignItems=\"start\" p={2} rowGap={1.5} color={theme.palette.common.white}>\n <GasPriceBox gasPrice={gasPrice} />\n {priorityFee ?\n <PriorityFeeBox priorityFee={priorityFee} priorityFeeLabel={priorityFeeLabel} />\n : null}\n </FlexGrowCol>\n <Paper elevation={speedPaperElevation} sx={{ borderRadius: `0 0 ${theme.shape.borderRadius}px ${theme.shape.borderRadius}px` }}>\n <SpeedBox speed={speed} />\n </Paper>\n </CardContentEx>\n </Card>\n )\n}\n","import { useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { TypographyEx } from '@xyo-network/react-shared'\n\nimport { GweiLabelTypography } from './GweiLabelTypography'\n\nexport interface GasPriceBoxProps extends FlexBoxProps {\n gasPrice?: number\n}\n\nexport const GasPriceBox: React.FC<GasPriceBoxProps> = ({ gasPrice, ...props }) => {\n const theme = useTheme()\n return (\n <FlexRow columnGap={1.5} rowGap={1.5} alignItems=\"end\" {...props}>\n <TypographyEx lineHeight={1} fontWeight=\"200\" fontSize={theme.spacing(6)} title={gasPrice?.toString() ?? ''}>\n {gasPrice?.toFixed(2)}\n </TypographyEx>\n <GweiLabelTypography fontSize={theme.spacing(2)} />\n </FlexRow>\n )\n}\n","import { TypographyEx, TypographyExProps } from '@xyo-network/react-shared'\n\nexport const GweiLabelTypography: React.FC<TypographyExProps> = (props) => (\n <TypographyEx variant=\"caption\" {...props}>\n GWEI\n </TypographyEx>\n)\n","import { LocalGasStationRounded as LocalGasStationRoundedIcon } from '@mui/icons-material'\nimport { useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexCol, FlexGrowRow } from '@xylabs/react-flexbox'\nimport { TypographyEx } from '@xyo-network/react-shared'\n\nimport { GweiLabelTypography } from './GweiLabelTypography'\n\nexport interface PriorityFeeBoxProps extends FlexBoxProps {\n priorityFee?: number\n priorityFeeLabel?: string\n}\n\nexport const PriorityFeeBox: React.FC<PriorityFeeBoxProps> = ({ priorityFee, priorityFeeLabel = 'Priority Fee', ...props }) => {\n const theme = useTheme()\n\n return (\n <FlexGrowRow width=\"100%\" justifyContent=\"space-between\" alignItems=\"end\" {...props}>\n <FlexCol alignItems=\"start\">\n <TypographyEx>{priorityFeeLabel}</TypographyEx>\n <TypographyEx title={priorityFee?.toString() ?? ''}>\n {priorityFee?.toFixed(2)} <GweiLabelTypography fontSize={theme.spacing(1)} />\n </TypographyEx>\n </FlexCol>\n <LocalGasStationRoundedIcon />\n </FlexGrowRow>\n )\n}\n","import { useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexGrowCol } from '@xylabs/react-flexbox'\nimport { TypographyEx } from '@xyo-network/react-shared'\n\nexport interface SpeedBoxProps extends FlexBoxProps {\n speed?: string\n}\n\nexport const SpeedBox: React.FC<SpeedBoxProps> = ({ speed, ...props }) => {\n const theme = useTheme()\n\n return speed ?\n <FlexGrowCol {...props}>\n <TypographyEx fontSize={theme.spacing(3)} fontWeight=\"200\" p={1}>\n {speed}\n </TypographyEx>\n </FlexGrowCol>\n : null\n}\n","import { FlexBoxProps } from '@xylabs/react-flexbox'\n\nimport { GasPriceWitnessUIBasePayload } from '../types'\nimport { GasPriceHeaderActionsBox, GasPriceHeaderTypography } from './HeaderComponents'\nimport { StyledGasPriceHeaderBox } from './layout'\n\nexport interface GasPriceWitnessHeaderBoxProps extends FlexBoxProps {\n heading?: string\n parsedPayload?: GasPriceWitnessUIBasePayload\n}\n\nexport const GasPriceWitnessHeaderBox: React.FC<GasPriceWitnessHeaderBoxProps> = ({ heading, parsedPayload, ...props }) => {\n return (\n <StyledGasPriceHeaderBox {...props}>\n <GasPriceHeaderTypography heading={heading} />\n <GasPriceHeaderActionsBox\n timestamp={parsedPayload?.timestamp}\n baseFee={parsedPayload?.baseFee?.value}\n baseFeeLabel={parsedPayload?.baseFee?.label}\n blockNumber={parsedPayload?.blockNumber?.value}\n blockNumberLabel={parsedPayload?.blockNumber?.label}\n />\n </StyledGasPriceHeaderBox>\n )\n}\n","import { Button, Collapse, Paper } from '@mui/material'\nimport { FlexBoxProps, FlexCol } from '@xylabs/react-flexbox'\nimport { useState } from 'react'\n\nexport interface ToggleRawPayloadBoxProps extends FlexBoxProps {\n gasPricePayload?: object\n}\n\nexport const ToggleRawPayloadBox: React.FC<ToggleRawPayloadBoxProps> = ({ gasPricePayload, ...props }) => {\n const [collapse, setCollapse] = useState(false)\n return gasPricePayload ?\n <FlexCol rowGap={1} {...props}>\n <Button color=\"secondary\" sx={{ bgcolor: 'secondary.dark', color: 'white' }} variant=\"contained\" onClick={() => setCollapse(!collapse)}>\n Raw Payload\n </Button>\n <Collapse in={collapse}>\n <Paper elevation={4} sx={{ p: 2 }}>\n <pre>{JSON.stringify(gasPricePayload, null, 2)}</pre>\n </Paper>\n </Collapse>\n </FlexCol>\n : null\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,4BAAqE;AACrE,sBAAoC;AAK9B;AAHC,IAAM,yBAAgD,CAAC,EAAE,GAAG,MAAM,MAAM;AAC7E,SACE,4CAAC,0BAAQ,GAAG,OACV,sDAAC,sBAAAA,wBAAA,EAA2B,GAC9B;AAEJ;;;ACRA,mBAA2B;;;ACD3B,IAAAC,mBAAqB;AACrB,2BAAsC;AAmBlC,IAAAC,sBAAA;AATG,IAAM,2BAAsE,CAAC;AAAA,EAClF;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA,mBAAmB;AAAA,EACnB;AAAA,EACA,GAAG;AACL,MAAM;AACJ,SACE,8CAAC,gCAAQ,WAAW,GAAG,QAAQ,GAAG,UAAS,QAAQ,GAAG,OACnD;AAAA,gBACC,6CAAC,yBAAK,OAAO,IAAI,KAAK,SAAS,EAAE,eAAe,GAAG,IACnD;AAAA,IACD,UACC,6CAAC,yBAAK,OAAO,GAAG,YAAY,MAAM,QAAQ,QAAQ,CAAC,CAAC,SAAS,IAC7D;AAAA,IACD,cACC,6CAAC,yBAAK,OAAO,GAAG,gBAAgB,MAAM,WAAW,IAAI,IACrD;AAAA,KACJ;AAEJ;;;AChCA,IAAAC,mBAAyB;AAEzB,IAAAC,uBAAmD;;;ACFnD,IAAAC,mBAAyB;AACzB,0BAAgD;AAY5C,IAAAC,sBAAA;AAHG,IAAM,4BAAsE,CAAC,EAAE,UAAU,SAAS,aAAa,GAAG,MAAM,MAAM;AACnI,QAAM,YAAQ,2BAAS;AACvB,S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AS,eAAe,GAAG,MAAM,MAAM;AACzH,SACE,+CAAC,2BAAyB,GAAG,OAC3B;AAAA,kDAAC,4BAAyB,SAAkB;AAAA,IAC5C;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,eAAe;AAAA,QAC1B,SAAS,eAAe,SAAS;AAAA,QACjC,cAAc,eAAe,SAAS;AAAA,QACtC,aAAa,eAAe,aAAa;AAAA,QACzC,kBAAkB,eAAe,aAAa;AAAA;AAAA,IAChD;AAAA,KACF;AAEJ;;;ACxBA,IAAAC,oBAAwC;AACxC,IAAAC,wBAAsC;AACtC,IAAAC,gBAAyB;AASnB,IAAAC,uBAAA;AAHC,IAAM,sBAA0D,CAAC,EAAE,iBAAiB,GAAG,MAAM,MAAM;AACxG,QAAM,CAAC,UAAU,WAAW,QAAI,wBAAS,KAAK;AAC9C,SAAO,kBACH,+CAAC,iCAAQ,QAAQ,GAAI,GAAG,OACtB;AAAA,kDAAC,4BAAO,OAAM,aAAY,IAAI,EAAE,SAAS,kBAAkB,OAAO,QAAQ,GAAG,SAAQ,aAAY,SAAS,MAAM,YAAY,CAAC,QAAQ,GAAG,yBAExI;AAAA,IACA,8CAAC,8BAAS,IAAI,UACZ,wDAAC,2BAAM,WAAW,GAAG,IAAI,EAAE,GAAG,EAAE,GAC9B,wDAAC,SAAK,eAAK,UAAU,iBAAiB,MAAM,CAAC,GAAE,GACjD,GACF;AAAA,KACF,IACA;AACN;","names":["LocalGasStationRoundedIcon","import_material","import_jsx_runtime","import_material","import_react_shared","import_material","import_jsx_runtime","import_jsx_runtime","import_material","import_react_flexbox","import_material","import_jsx_runtime","import_material","import_react_flexbox","import_material","import_react_flexbox","import_react_shared","import_react_shared","import_jsx_runtime","import_jsx_runtime","import_icons_material","import_material","import_react_flexbox","import_react_shared","import_jsx_runtime","LocalGasStationRoundedIcon","import_material","import_react_flexbox","import_react_shared","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_material","import_react_flexbox","import_react","import_jsx_runtime"]}
|
package/dist/browser/index.js
CHANGED
|
@@ -1,2 +1,212 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/Avatar/EthereumGasPriceAvatar.tsx
|
|
2
|
+
import { LocalGasStationRounded as LocalGasStationRoundedIcon } from "@mui/icons-material";
|
|
3
|
+
import { Avatar } from "@mui/material";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var EthereumGasPriceAvatar = ({ ...props }) => {
|
|
6
|
+
return /* @__PURE__ */ jsx(Avatar, { ...props, children: /* @__PURE__ */ jsx(LocalGasStationRoundedIcon, {}) });
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
// src/components/CardHeader/CardHeader.tsx
|
|
10
|
+
import { forwardRef } from "react";
|
|
11
|
+
|
|
12
|
+
// src/components/HeaderComponents/Actions.tsx
|
|
13
|
+
import { Chip } from "@mui/material";
|
|
14
|
+
import { FlexRow } from "@xylabs/react-flexbox";
|
|
15
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
16
|
+
var GasPriceHeaderActionsBox = ({
|
|
17
|
+
baseFee,
|
|
18
|
+
baseFeeLabel = "Base Fee",
|
|
19
|
+
blockNumber,
|
|
20
|
+
blockNumberLabel = "Block Number",
|
|
21
|
+
timestamp,
|
|
22
|
+
...props
|
|
23
|
+
}) => {
|
|
24
|
+
return /* @__PURE__ */ jsxs(FlexRow, { columnGap: 1, rowGap: 1, flexWrap: "wrap", ...props, children: [
|
|
25
|
+
timestamp ? /* @__PURE__ */ jsx2(Chip, { label: new Date(timestamp).toLocaleString() }) : null,
|
|
26
|
+
baseFee ? /* @__PURE__ */ jsx2(Chip, { label: `${baseFeeLabel} - ${baseFee.toFixed(2)} GWEI` }) : null,
|
|
27
|
+
blockNumber ? /* @__PURE__ */ jsx2(Chip, { label: `${blockNumberLabel} - ${blockNumber}` }) : null
|
|
28
|
+
] });
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// src/components/HeaderComponents/Header/Header.tsx
|
|
32
|
+
import { useTheme as useTheme2 } from "@mui/material";
|
|
33
|
+
import { useGetTokenData } from "@xyo-network/react-shared";
|
|
34
|
+
|
|
35
|
+
// src/components/HeaderComponents/Header/Heading.tsx
|
|
36
|
+
import { useTheme } from "@mui/material";
|
|
37
|
+
import { TypographyEx } from "@xyo-network/react-shared";
|
|
38
|
+
import { jsxs as jsxs2 } from "react/jsx-runtime";
|
|
39
|
+
var GasPriceHeadingTypography = ({ children, heading, networkIcon, ...props }) => {
|
|
40
|
+
const theme = useTheme();
|
|
41
|
+
return /* @__PURE__ */ jsxs2(TypographyEx, { fontSize: theme.spacing(6), lineHeight: 1, ...props, children: [
|
|
42
|
+
heading,
|
|
43
|
+
" ",
|
|
44
|
+
networkIcon,
|
|
45
|
+
" ",
|
|
46
|
+
children
|
|
47
|
+
] });
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// src/components/HeaderComponents/Header/Header.tsx
|
|
51
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
52
|
+
var GasPriceHeaderTypography = ({ heading, children, ...props }) => {
|
|
53
|
+
const theme = useTheme2();
|
|
54
|
+
const [ethData] = useGetTokenData(["eth"]);
|
|
55
|
+
const networkIcon = /* @__PURE__ */ jsx3("img", { height: theme.spacing(4), src: ethData.icon });
|
|
56
|
+
return /* @__PURE__ */ jsx3(GasPriceHeadingTypography, { heading, networkIcon, ...props, children });
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// src/components/layout/Header.tsx
|
|
60
|
+
import { styled } from "@mui/material";
|
|
61
|
+
import { FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
|
|
62
|
+
var StyledGasPriceHeaderBox = styled(FlexRow2, { name: "StyledGasPriceEstimateBox" })(({ theme }) => ({
|
|
63
|
+
alignItems: "end",
|
|
64
|
+
columnGap: theme.spacing(2),
|
|
65
|
+
flexWrap: "wrap",
|
|
66
|
+
justifyContent: "space-between",
|
|
67
|
+
justifyItems: "space-between",
|
|
68
|
+
rowGap: theme.spacing(2),
|
|
69
|
+
width: "100%"
|
|
70
|
+
}));
|
|
71
|
+
|
|
72
|
+
// src/components/layout/StyledCardHeader.tsx
|
|
73
|
+
import { CardHeader, styled as styled2 } from "@mui/material";
|
|
74
|
+
var StyledCardHeader = styled2(CardHeader, { name: "StyledCardHeader" })(({ theme }) => ({
|
|
75
|
+
flexWrap: "wrap",
|
|
76
|
+
rowGap: theme.spacing(2)
|
|
77
|
+
}));
|
|
78
|
+
|
|
79
|
+
// src/components/CardHeader/CardHeader.tsx
|
|
80
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
81
|
+
var GasPriceWitnessCardHeader = forwardRef(({ title, parsedPayload, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
82
|
+
StyledCardHeader,
|
|
83
|
+
{
|
|
84
|
+
title: /* @__PURE__ */ jsx4(GasPriceHeaderTypography, { heading: title }),
|
|
85
|
+
action: /* @__PURE__ */ jsx4(
|
|
86
|
+
GasPriceHeaderActionsBox,
|
|
87
|
+
{
|
|
88
|
+
timestamp: parsedPayload?.timestamp,
|
|
89
|
+
baseFee: parsedPayload?.baseFee?.value,
|
|
90
|
+
baseFeeLabel: parsedPayload?.baseFee?.label,
|
|
91
|
+
blockNumber: parsedPayload?.blockNumber?.value,
|
|
92
|
+
blockNumberLabel: parsedPayload?.blockNumber?.label
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
ref,
|
|
96
|
+
...props
|
|
97
|
+
}
|
|
98
|
+
));
|
|
99
|
+
GasPriceWitnessCardHeader.displayName = "GasPriceWitnessCardHeader";
|
|
100
|
+
|
|
101
|
+
// src/components/GasFees/Card.tsx
|
|
102
|
+
import { Card, Paper, useTheme as useTheme6 } from "@mui/material";
|
|
103
|
+
import { FlexGrowCol as FlexGrowCol2 } from "@xylabs/react-flexbox";
|
|
104
|
+
import { CardContentEx } from "@xyo-network/react-card";
|
|
105
|
+
|
|
106
|
+
// src/components/GasFees/components/GasPriceBox.tsx
|
|
107
|
+
import { useTheme as useTheme3 } from "@mui/material";
|
|
108
|
+
import { FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
|
|
109
|
+
import { TypographyEx as TypographyEx3 } from "@xyo-network/react-shared";
|
|
110
|
+
|
|
111
|
+
// src/components/GasFees/components/GweiLabelTypography.tsx
|
|
112
|
+
import { TypographyEx as TypographyEx2 } from "@xyo-network/react-shared";
|
|
113
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
114
|
+
var GweiLabelTypography = (props) => /* @__PURE__ */ jsx5(TypographyEx2, { variant: "caption", ...props, children: "GWEI" });
|
|
115
|
+
|
|
116
|
+
// src/components/GasFees/components/GasPriceBox.tsx
|
|
117
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
118
|
+
var GasPriceBox = ({ gasPrice, ...props }) => {
|
|
119
|
+
const theme = useTheme3();
|
|
120
|
+
return /* @__PURE__ */ jsxs3(FlexRow3, { columnGap: 1.5, rowGap: 1.5, alignItems: "end", ...props, children: [
|
|
121
|
+
/* @__PURE__ */ jsx6(TypographyEx3, { lineHeight: 1, fontWeight: "200", fontSize: theme.spacing(6), title: gasPrice?.toString() ?? "", children: gasPrice?.toFixed(2) }),
|
|
122
|
+
/* @__PURE__ */ jsx6(GweiLabelTypography, { fontSize: theme.spacing(2) })
|
|
123
|
+
] });
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// src/components/GasFees/components/PriorityFeeBox.tsx
|
|
127
|
+
import { LocalGasStationRounded as LocalGasStationRoundedIcon2 } from "@mui/icons-material";
|
|
128
|
+
import { useTheme as useTheme4 } from "@mui/material";
|
|
129
|
+
import { FlexCol, FlexGrowRow } from "@xylabs/react-flexbox";
|
|
130
|
+
import { TypographyEx as TypographyEx4 } from "@xyo-network/react-shared";
|
|
131
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
132
|
+
var PriorityFeeBox = ({ priorityFee, priorityFeeLabel = "Priority Fee", ...props }) => {
|
|
133
|
+
const theme = useTheme4();
|
|
134
|
+
return /* @__PURE__ */ jsxs4(FlexGrowRow, { width: "100%", justifyContent: "space-between", alignItems: "end", ...props, children: [
|
|
135
|
+
/* @__PURE__ */ jsxs4(FlexCol, { alignItems: "start", children: [
|
|
136
|
+
/* @__PURE__ */ jsx7(TypographyEx4, { children: priorityFeeLabel }),
|
|
137
|
+
/* @__PURE__ */ jsxs4(TypographyEx4, { title: priorityFee?.toString() ?? "", children: [
|
|
138
|
+
priorityFee?.toFixed(2),
|
|
139
|
+
" ",
|
|
140
|
+
/* @__PURE__ */ jsx7(GweiLabelTypography, { fontSize: theme.spacing(1) })
|
|
141
|
+
] })
|
|
142
|
+
] }),
|
|
143
|
+
/* @__PURE__ */ jsx7(LocalGasStationRoundedIcon2, {})
|
|
144
|
+
] });
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
// src/components/GasFees/components/SpeedBox.tsx
|
|
148
|
+
import { useTheme as useTheme5 } from "@mui/material";
|
|
149
|
+
import { FlexGrowCol } from "@xylabs/react-flexbox";
|
|
150
|
+
import { TypographyEx as TypographyEx5 } from "@xyo-network/react-shared";
|
|
151
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
152
|
+
var SpeedBox = ({ speed, ...props }) => {
|
|
153
|
+
const theme = useTheme5();
|
|
154
|
+
return speed ? /* @__PURE__ */ jsx8(FlexGrowCol, { ...props, children: /* @__PURE__ */ jsx8(TypographyEx5, { fontSize: theme.spacing(3), fontWeight: "200", p: 1, children: speed }) }) : null;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// src/components/GasFees/Card.tsx
|
|
158
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
159
|
+
var GasFeeCard = ({ gasPrice, speedPaperElevation, priorityFee, priorityFeeLabel, speed = "low", ...props }) => {
|
|
160
|
+
const theme = useTheme6();
|
|
161
|
+
return /* @__PURE__ */ jsx9(Card, { sx: { p: 0 }, ...props, children: /* @__PURE__ */ jsxs5(CardContentEx, { removePadding: true, sx: { flexDirection: "column", flexGrow: 1, p: 0, rowGap: 2 }, children: [
|
|
162
|
+
/* @__PURE__ */ jsxs5(FlexGrowCol2, { bgcolor: theme.palette.secondary.dark, alignItems: "start", p: 2, rowGap: 1.5, color: theme.palette.common.white, children: [
|
|
163
|
+
/* @__PURE__ */ jsx9(GasPriceBox, { gasPrice }),
|
|
164
|
+
priorityFee ? /* @__PURE__ */ jsx9(PriorityFeeBox, { priorityFee, priorityFeeLabel }) : null
|
|
165
|
+
] }),
|
|
166
|
+
/* @__PURE__ */ jsx9(Paper, { elevation: speedPaperElevation, sx: { borderRadius: `0 0 ${theme.shape.borderRadius}px ${theme.shape.borderRadius}px` }, children: /* @__PURE__ */ jsx9(SpeedBox, { speed }) })
|
|
167
|
+
] }) });
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
// src/components/HeaderBox.tsx
|
|
171
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
172
|
+
var GasPriceWitnessHeaderBox = ({ heading, parsedPayload, ...props }) => {
|
|
173
|
+
return /* @__PURE__ */ jsxs6(StyledGasPriceHeaderBox, { ...props, children: [
|
|
174
|
+
/* @__PURE__ */ jsx10(GasPriceHeaderTypography, { heading }),
|
|
175
|
+
/* @__PURE__ */ jsx10(
|
|
176
|
+
GasPriceHeaderActionsBox,
|
|
177
|
+
{
|
|
178
|
+
timestamp: parsedPayload?.timestamp,
|
|
179
|
+
baseFee: parsedPayload?.baseFee?.value,
|
|
180
|
+
baseFeeLabel: parsedPayload?.baseFee?.label,
|
|
181
|
+
blockNumber: parsedPayload?.blockNumber?.value,
|
|
182
|
+
blockNumberLabel: parsedPayload?.blockNumber?.label
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
] });
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// src/components/RawPayload/ToggleRawPayloadBox.tsx
|
|
189
|
+
import { Button, Collapse, Paper as Paper2 } from "@mui/material";
|
|
190
|
+
import { FlexCol as FlexCol2 } from "@xylabs/react-flexbox";
|
|
191
|
+
import { useState } from "react";
|
|
192
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
193
|
+
var ToggleRawPayloadBox = ({ gasPricePayload, ...props }) => {
|
|
194
|
+
const [collapse, setCollapse] = useState(false);
|
|
195
|
+
return gasPricePayload ? /* @__PURE__ */ jsxs7(FlexCol2, { rowGap: 1, ...props, children: [
|
|
196
|
+
/* @__PURE__ */ jsx11(Button, { color: "secondary", sx: { bgcolor: "secondary.dark", color: "white" }, variant: "contained", onClick: () => setCollapse(!collapse), children: "Raw Payload" }),
|
|
197
|
+
/* @__PURE__ */ jsx11(Collapse, { in: collapse, children: /* @__PURE__ */ jsx11(Paper2, { elevation: 4, sx: { p: 2 }, children: /* @__PURE__ */ jsx11("pre", { children: JSON.stringify(gasPricePayload, null, 2) }) }) })
|
|
198
|
+
] }) : null;
|
|
199
|
+
};
|
|
200
|
+
export {
|
|
201
|
+
EthereumGasPriceAvatar,
|
|
202
|
+
GasFeeCard,
|
|
203
|
+
GasPriceHeaderActionsBox,
|
|
204
|
+
GasPriceHeaderTypography,
|
|
205
|
+
GasPriceHeadingTypography,
|
|
206
|
+
GasPriceWitnessCardHeader,
|
|
207
|
+
GasPriceWitnessHeaderBox,
|
|
208
|
+
StyledCardHeader,
|
|
209
|
+
StyledGasPriceHeaderBox,
|
|
210
|
+
ToggleRawPayloadBox
|
|
211
|
+
};
|
|
2
212
|
//# sourceMappingURL=index.js.map
|