@xyo-network/react-ethereum-gas-price-blocknative-plugin 5.0.0 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.mjs +4 -8
- package/dist/browser/index.mjs.map +1 -1
- package/dist/types/components/Card/Card.d.ts +1 -4
- package/dist/types/components/Card/Card.d.ts.map +1 -1
- package/dist/types/components/Card/CardContent.d.ts +1 -6
- package/dist/types/components/Card/CardContent.d.ts.map +1 -1
- package/dist/types/components/Card/CardHeader.d.ts +1 -6
- package/dist/types/components/Card/CardHeader.d.ts.map +1 -1
- package/dist/types/components/Details/Box/BlocknativeGasPriceDetailsBox.d.ts +1 -6
- package/dist/types/components/Details/Box/BlocknativeGasPriceDetailsBox.d.ts.map +1 -1
- package/package.json +10 -10
- package/src/components/Card/Card.tsx +1 -1
- package/src/components/Card/CardContent.tsx +1 -4
- package/src/components/Card/CardHeader.tsx +2 -2
- package/src/components/Details/Box/BlocknativeGasPriceDetailsBox.tsx +4 -4
package/dist/browser/index.mjs
CHANGED
|
@@ -44,7 +44,7 @@ var getBlocknativeTransformer = /* @__PURE__ */ __name((payload) => {
|
|
|
44
44
|
|
|
45
45
|
// src/components/Card/CardContent.tsx
|
|
46
46
|
var isEmpty = /* @__PURE__ */ __name((obj) => Object.keys(obj ?? {}).length === 0, "isEmpty");
|
|
47
|
-
var BlocknativeGasPriceCardContent = /* @__PURE__ */ __name(({
|
|
47
|
+
var BlocknativeGasPriceCardContent = /* @__PURE__ */ __name(({ payload, ...props }) => {
|
|
48
48
|
const gasPricePayload = payload ? payload : void 0;
|
|
49
49
|
const parsedPayload = getBlocknativeTransformer(gasPricePayload);
|
|
50
50
|
if (isEmpty(gasPricePayload) || !gasPricePayload?.blockPrices?.length) {
|
|
@@ -56,7 +56,6 @@ var BlocknativeGasPriceCardContent = /* @__PURE__ */ __name(({ ref, payload, ...
|
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
return /* @__PURE__ */ React.createElement(CardContent, {
|
|
59
|
-
ref,
|
|
60
59
|
sx: {
|
|
61
60
|
display: "flex",
|
|
62
61
|
flexDirection: "column",
|
|
@@ -99,13 +98,12 @@ import React2 from "react";
|
|
|
99
98
|
var RenderTitle = "Blocknative Gas Tracker";
|
|
100
99
|
|
|
101
100
|
// src/components/Card/CardHeader.tsx
|
|
102
|
-
var BlocknativeGasPriceCardHeader = /* @__PURE__ */ __name(({
|
|
101
|
+
var BlocknativeGasPriceCardHeader = /* @__PURE__ */ __name(({ payload }) => {
|
|
103
102
|
const gasPricePayload = payload ? payload : void 0;
|
|
104
103
|
const parsedPayload = getBlocknativeTransformer(gasPricePayload);
|
|
105
104
|
return /* @__PURE__ */ React2.createElement(GasPriceWitnessCardHeader, {
|
|
106
105
|
title: RenderTitle,
|
|
107
|
-
parsedPayload
|
|
108
|
-
ref
|
|
106
|
+
parsedPayload
|
|
109
107
|
});
|
|
110
108
|
}, "BlocknativeGasPriceCardHeader");
|
|
111
109
|
BlocknativeGasPriceCardHeader.displayName = "BlocknativeGasPriceCardHeader";
|
|
@@ -132,7 +130,6 @@ import React4 from "react";
|
|
|
132
130
|
var isEmpty2 = /* @__PURE__ */ __name((obj) => Object.keys(obj ?? {}).length === 0, "isEmpty");
|
|
133
131
|
var BlocknativeGasPriceDetailsBox = /* @__PURE__ */ __name(({
|
|
134
132
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
135
|
-
ref,
|
|
136
133
|
payload,
|
|
137
134
|
listMode,
|
|
138
135
|
...props
|
|
@@ -144,8 +141,7 @@ var BlocknativeGasPriceDetailsBox = /* @__PURE__ */ __name(({
|
|
|
144
141
|
}) : /* @__PURE__ */ React4.createElement(FlexCol, {
|
|
145
142
|
alignItems: "start",
|
|
146
143
|
rowGap: 4,
|
|
147
|
-
...props
|
|
148
|
-
ref
|
|
144
|
+
...props
|
|
149
145
|
}, /* @__PURE__ */ React4.createElement(GasPriceWitnessHeaderBox, {
|
|
150
146
|
heading: RenderTitle,
|
|
151
147
|
parsedPayload
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/Card/Card.tsx","../../src/components/Card/CardContent.tsx","../../src/components/hooks/getBlocknativeTransformer.tsx","../../src/components/Card/CardHeader.tsx","../../src/components/lib/constants.ts","../../src/components/Details/Box/BlocknativeGasPriceDetailsBox.tsx","../../src/Plugin.ts"],"sourcesContent":["import type { CardProps } from '@mui/material'\nimport { Card } from '@mui/material'\nimport type { PayloadRenderProps } from '@xyo-network/react-payload-plugin'\nimport React from 'react'\n\nimport { BlocknativeGasPriceCardContent } from './CardContent.tsx'\nimport { BlocknativeGasPriceCardHeader } from './CardHeader.tsx'\n\nexport const BlocknativeGasPriceCard = ({\n ref, payload, ...props\n}: PayloadRenderProps & CardProps & { ref?: React.RefObject<HTMLDivElement | null> }) => {\n return (\n <Card ref={ref} {...props}>\n <BlocknativeGasPriceCardHeader payload={payload} />\n <BlocknativeGasPriceCardContent payload={payload} />\n </Card>\n )\n}\n\nBlocknativeGasPriceCard.displayName = 'BlocknativeGasPriceCard'\n","import type { CardContentProps } from '@mui/material'\nimport { CardContent, Grid } from '@mui/material'\nimport type { EthereumGasBlocknativePayload } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { GasFeeCard, ToggleRawPayloadBox } from '@xyo-network/react-gas-price'\nimport type { PayloadRenderProps } from '@xyo-network/react-payload-plugin'\nimport { PayloadDataMissing } from '@xyo-network/react-shared'\nimport React from 'react'\n\nimport { getBlocknativeTransformer } from '../hooks/index.ts'\n\nconst isEmpty = (obj?: object) => Object.keys(obj ?? {}).length === 0\n\nexport const BlocknativeGasPriceCardContent = ({\n ref, payload, ...props\n}: Omit<PayloadRenderProps & CardContentProps, 'ref'> & { ref?: React.RefObject<HTMLDivElement | null> }) => {\n const gasPricePayload = payload ? (payload as EthereumGasBlocknativePayload) : undefined\n const parsedPayload = getBlocknativeTransformer(gasPricePayload)\n\n if (isEmpty(gasPricePayload) || !gasPricePayload?.blockPrices?.length) {\n return <PayloadDataMissing alertBody=\"Payload is missing valid gas fee data.\" sx={{ m: 1 }} />\n }\n\n return (\n <CardContent\n ref={ref}\n sx={{\n display: 'flex', flexDirection: 'column', rowGap: 4,\n }}\n {...props}\n >\n <Grid\n container\n spacing={3}\n columns={{\n lg: 15, md: 15, sm: 12, xs: 12,\n }}\n >\n {parsedPayload\n && parsedPayload?.gasPrice?.map(({ price }) => (\n <Grid key={price?.label} item xs={12} sm={6} md={5} lg={3}>\n <GasFeeCard gasPrice={price?.value} speed={price?.label} speedPaperElevation={4} />\n </Grid>\n ))}\n </Grid>\n <ToggleRawPayloadBox gasPricePayload={gasPricePayload} alignItems=\"start\" pr={1} />\n </CardContent>\n )\n}\n\nBlocknativeGasPriceCardContent.displayName = 'BlocknativeGasPriceCardContent'\n","import type { EthereumGasBlocknativePayload } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport type { GasPriceWitnessUIBasePayload } from '@xyo-network/react-gas-price'\n\nexport const getBlocknativeTransformer = (payload?: EthereumGasBlocknativePayload): GasPriceWitnessUIBasePayload | undefined => {\n const blockPrices = payload?.blockPrices?.[0]\n if (blockPrices && blockPrices.estimatedPrices?.length) {\n const estimatedPrices = blockPrices?.estimatedPrices\n const gasPrice = estimatedPrices.map(price => ({\n price: {\n label: `Confidence - ${price.confidence}`,\n value: price.price,\n },\n priorityFee: {\n label: 'maxPriorityFeePerGas',\n value: price.maxPriorityFeePerGas,\n },\n }))\n\n return {\n baseFee: {\n label: 'baseFeePerGas',\n value: blockPrices.baseFeePerGas,\n },\n blockNumber: {\n label: 'blockNumber',\n value: blockPrices.blockNumber,\n },\n gasPrice,\n timestamp: payload.timestamp,\n website: 'https://docs.Blocknative.io/v5/api/providers/provider/#Provider-getFeeData',\n }\n }\n}\n","import type { CardHeaderProps } from '@mui/material'\nimport type { EthereumGasBlocknativePayload } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { GasPriceWitnessCardHeader } from '@xyo-network/react-gas-price'\nimport type { PayloadRenderProps } from '@xyo-network/react-payload-plugin'\nimport React from 'react'\n\nimport { getBlocknativeTransformer } from '../hooks/index.ts'\nimport { RenderTitle } from '../lib/index.ts'\n\nexport const BlocknativeGasPriceCardHeader = ({ ref, payload }: PayloadRenderProps & CardHeaderProps & { ref?: React.RefObject<HTMLDivElement | null> }) => {\n const gasPricePayload = payload ? (payload as EthereumGasBlocknativePayload) : undefined\n const parsedPayload = getBlocknativeTransformer(gasPricePayload)\n return <GasPriceWitnessCardHeader title={RenderTitle} parsedPayload={parsedPayload} ref={ref} />\n}\n\nBlocknativeGasPriceCardHeader.displayName = 'BlocknativeGasPriceCardHeader'\n","export const RenderTitle = 'Blocknative Gas Tracker'\n","import { Grid } from '@mui/material'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport type { EthereumGasBlocknativePayload } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport {\n GasFeeCard, GasPriceWitnessHeaderBox, ToggleRawPayloadBox,\n} from '@xyo-network/react-gas-price'\nimport type { PayloadDetailsListRenderProps } from '@xyo-network/react-payload-plugin'\nimport { PayloadDataMissing } from '@xyo-network/react-shared'\nimport React from 'react'\n\nimport { getBlocknativeTransformer } from '../../hooks/index.ts'\nimport { RenderTitle } from '../../lib/index.ts'\n\nconst isEmpty = (obj?: object) => Object.keys(obj ?? {}).length === 0\n\nexport const BlocknativeGasPriceDetailsBox = ({\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ref, payload, listMode, ...props\n}: PayloadDetailsListRenderProps & FlexBoxProps & { ref?: React.RefObject<HTMLDivElement | null> }) => {\n const gasPricePayload: EthereumGasBlocknativePayload | undefined = payload ? (payload as EthereumGasBlocknativePayload) : undefined\n const parsedPayload = getBlocknativeTransformer(gasPricePayload)\n\n return (\n <>\n {isEmpty(gasPricePayload) || !gasPricePayload?.blockPrices?.length\n ? <PayloadDataMissing alertBody=\"Payload is missing valid gas fee data.\" />\n : (\n <FlexCol alignItems=\"start\" rowGap={4} {...props} ref={ref}>\n <GasPriceWitnessHeaderBox heading={RenderTitle} parsedPayload={parsedPayload} />\n <Grid\n container\n spacing={3}\n columns={{\n lg: 15, md: 15, sm: 12, xs: 12,\n }}\n >\n {parsedPayload\n && parsedPayload?.gasPrice?.map(({ price, priorityFee }) => (\n <Grid key={price?.label} item xs={12} sm={6} md={5} lg={3}>\n <GasFeeCard\n key={price?.label}\n gasPrice={price?.value}\n speed={price?.label}\n priorityFee={priorityFee?.value}\n priorityFeeLabel={priorityFee?.label}\n />\n </Grid>\n ))}\n </Grid>\n <ToggleRawPayloadBox gasPricePayload={gasPricePayload} alignItems=\"start\" />\n </FlexCol>\n )}\n </>\n )\n}\n\nBlocknativeGasPriceDetailsBox.displayName = 'BlocknativeGasPriceDetailsBox'\n","import { EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { EthereumGasPriceAvatar } from '@xyo-network/react-gas-price'\nimport type { PayloadRenderPlugin } from '@xyo-network/react-payload-plugin'\nimport { createPayloadRenderPlugin } from '@xyo-network/react-payload-plugin'\n\nimport {\n BlocknativeGasPriceCardContent, BlocknativeGasPriceCardHeader, BlocknativeGasPriceDetailsBox,\n} from './components/index.ts'\n\nexport const EthereumGasPriceBlocknativePlugin: PayloadRenderPlugin = {\n ...createPayloadRenderPlugin({\n canRender: (payload?: Payload) => payload?.schema === EthereumGasBlocknativeSchema,\n components: {\n avatar: { image: EthereumGasPriceAvatar },\n box: { detailsBox: BlocknativeGasPriceDetailsBox },\n card: {\n content: BlocknativeGasPriceCardContent,\n header: BlocknativeGasPriceCardHeader,\n },\n },\n name: 'Ethereum Gas Price Blocknative',\n }),\n}\n"],"mappings":";;;;AACA,SAASA,YAAY;AAErB,OAAOC,YAAW;;;ACFlB,SAASC,aAAaC,YAAY;AAElC,SAASC,YAAYC,2BAA2B;AAEh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card","React","CardContent","Grid","GasFeeCard","ToggleRawPayloadBox","PayloadDataMissing","React","getBlocknativeTransformer","payload","blockPrices","estimatedPrices","length","gasPrice","map","price","label","confidence","value","priorityFee","maxPriorityFeePerGas","baseFee","baseFeePerGas","blockNumber","timestamp","website","isEmpty","obj","Object","keys","length","BlocknativeGasPriceCardContent","ref","payload","props","gasPricePayload","undefined","parsedPayload","getBlocknativeTransformer","blockPrices","PayloadDataMissing","alertBody","sx","m","CardContent","display","flexDirection","rowGap","Grid","container","spacing","columns","lg","md","sm","xs","gasPrice","map","price","key","label","item","GasFeeCard","value","speed","speedPaperElevation","ToggleRawPayloadBox","alignItems","pr","displayName","GasPriceWitnessCardHeader","React","RenderTitle","BlocknativeGasPriceCardHeader","ref","payload","gasPricePayload","undefined","parsedPayload","getBlocknativeTransformer","React","GasPriceWitnessCardHeader","title","RenderTitle","displayName","BlocknativeGasPriceCard","ref","payload","props","React","Card","BlocknativeGasPriceCardHeader","BlocknativeGasPriceCardContent","displayName","Grid","FlexCol","GasFeeCard","GasPriceWitnessHeaderBox","ToggleRawPayloadBox","PayloadDataMissing","React","isEmpty","obj","Object","keys","length","BlocknativeGasPriceDetailsBox","ref","payload","listMode","props","gasPricePayload","undefined","parsedPayload","getBlocknativeTransformer","React","blockPrices","PayloadDataMissing","alertBody","FlexCol","alignItems","rowGap","GasPriceWitnessHeaderBox","heading","RenderTitle","Grid","container","spacing","columns","lg","md","sm","xs","gasPrice","map","price","priorityFee","key","label","item","GasFeeCard","value","speed","priorityFeeLabel","ToggleRawPayloadBox","displayName","EthereumGasBlocknativeSchema","EthereumGasPriceAvatar","createPayloadRenderPlugin","EthereumGasPriceBlocknativePlugin","createPayloadRenderPlugin","canRender","payload","schema","EthereumGasBlocknativeSchema","components","avatar","image","EthereumGasPriceAvatar","box","detailsBox","BlocknativeGasPriceDetailsBox","card","content","BlocknativeGasPriceCardContent","header","BlocknativeGasPriceCardHeader","name"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/Card/Card.tsx","../../src/components/Card/CardContent.tsx","../../src/components/hooks/getBlocknativeTransformer.tsx","../../src/components/Card/CardHeader.tsx","../../src/components/lib/constants.ts","../../src/components/Details/Box/BlocknativeGasPriceDetailsBox.tsx","../../src/Plugin.ts"],"sourcesContent":["import type { CardProps } from '@mui/material'\nimport { Card } from '@mui/material'\nimport type { PayloadRenderProps } from '@xyo-network/react-payload-plugin'\nimport React from 'react'\n\nimport { BlocknativeGasPriceCardContent } from './CardContent.tsx'\nimport { BlocknativeGasPriceCardHeader } from './CardHeader.tsx'\n\nexport const BlocknativeGasPriceCard = ({\n ref, payload, ...props\n}: PayloadRenderProps & CardProps) => {\n return (\n <Card ref={ref} {...props}>\n <BlocknativeGasPriceCardHeader payload={payload} />\n <BlocknativeGasPriceCardContent payload={payload} />\n </Card>\n )\n}\n\nBlocknativeGasPriceCard.displayName = 'BlocknativeGasPriceCard'\n","import type { CardContentProps } from '@mui/material'\nimport { CardContent, Grid } from '@mui/material'\nimport type { EthereumGasBlocknativePayload } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { GasFeeCard, ToggleRawPayloadBox } from '@xyo-network/react-gas-price'\nimport type { PayloadRenderProps } from '@xyo-network/react-payload-plugin'\nimport { PayloadDataMissing } from '@xyo-network/react-shared'\nimport React from 'react'\n\nimport { getBlocknativeTransformer } from '../hooks/index.ts'\n\nconst isEmpty = (obj?: object) => Object.keys(obj ?? {}).length === 0\n\nexport const BlocknativeGasPriceCardContent: React.FC<PayloadRenderProps & CardContentProps> = ({ payload, ...props }) => {\n const gasPricePayload = payload ? (payload as EthereumGasBlocknativePayload) : undefined\n const parsedPayload = getBlocknativeTransformer(gasPricePayload)\n\n if (isEmpty(gasPricePayload) || !gasPricePayload?.blockPrices?.length) {\n return <PayloadDataMissing alertBody=\"Payload is missing valid gas fee data.\" sx={{ m: 1 }} />\n }\n\n return (\n <CardContent\n sx={{\n display: 'flex', flexDirection: 'column', rowGap: 4,\n }}\n {...props}\n >\n <Grid\n container\n spacing={3}\n columns={{\n lg: 15, md: 15, sm: 12, xs: 12,\n }}\n >\n {parsedPayload\n && parsedPayload?.gasPrice?.map(({ price }) => (\n <Grid key={price?.label} item xs={12} sm={6} md={5} lg={3}>\n <GasFeeCard gasPrice={price?.value} speed={price?.label} speedPaperElevation={4} />\n </Grid>\n ))}\n </Grid>\n <ToggleRawPayloadBox gasPricePayload={gasPricePayload} alignItems=\"start\" pr={1} />\n </CardContent>\n )\n}\n\nBlocknativeGasPriceCardContent.displayName = 'BlocknativeGasPriceCardContent'\n","import type { EthereumGasBlocknativePayload } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport type { GasPriceWitnessUIBasePayload } from '@xyo-network/react-gas-price'\n\nexport const getBlocknativeTransformer = (payload?: EthereumGasBlocknativePayload): GasPriceWitnessUIBasePayload | undefined => {\n const blockPrices = payload?.blockPrices?.[0]\n if (blockPrices && blockPrices.estimatedPrices?.length) {\n const estimatedPrices = blockPrices?.estimatedPrices\n const gasPrice = estimatedPrices.map(price => ({\n price: {\n label: `Confidence - ${price.confidence}`,\n value: price.price,\n },\n priorityFee: {\n label: 'maxPriorityFeePerGas',\n value: price.maxPriorityFeePerGas,\n },\n }))\n\n return {\n baseFee: {\n label: 'baseFeePerGas',\n value: blockPrices.baseFeePerGas,\n },\n blockNumber: {\n label: 'blockNumber',\n value: blockPrices.blockNumber,\n },\n gasPrice,\n timestamp: payload.timestamp,\n website: 'https://docs.Blocknative.io/v5/api/providers/provider/#Provider-getFeeData',\n }\n }\n}\n","import type { CardHeaderProps } from '@mui/material'\nimport type { EthereumGasBlocknativePayload } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { GasPriceWitnessCardHeader } from '@xyo-network/react-gas-price'\nimport type { PayloadRenderProps } from '@xyo-network/react-payload-plugin'\nimport React from 'react'\n\nimport { getBlocknativeTransformer } from '../hooks/index.ts'\nimport { RenderTitle } from '../lib/index.ts'\n\nexport const BlocknativeGasPriceCardHeader: React.FC<PayloadRenderProps & CardHeaderProps> = ({ payload }) => {\n const gasPricePayload = payload ? (payload as EthereumGasBlocknativePayload) : undefined\n const parsedPayload = getBlocknativeTransformer(gasPricePayload)\n return <GasPriceWitnessCardHeader title={RenderTitle} parsedPayload={parsedPayload} />\n}\n\nBlocknativeGasPriceCardHeader.displayName = 'BlocknativeGasPriceCardHeader'\n","export const RenderTitle = 'Blocknative Gas Tracker'\n","import { Grid } from '@mui/material'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport type { EthereumGasBlocknativePayload } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport {\n GasFeeCard, GasPriceWitnessHeaderBox, ToggleRawPayloadBox,\n} from '@xyo-network/react-gas-price'\nimport type { PayloadDetailsListRenderProps } from '@xyo-network/react-payload-plugin'\nimport { PayloadDataMissing } from '@xyo-network/react-shared'\nimport React from 'react'\n\nimport { getBlocknativeTransformer } from '../../hooks/index.ts'\nimport { RenderTitle } from '../../lib/index.ts'\n\nconst isEmpty = (obj?: object) => Object.keys(obj ?? {}).length === 0\n\nexport const BlocknativeGasPriceDetailsBox: React.FC<PayloadDetailsListRenderProps & FlexBoxProps> = ({\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n payload, listMode, ...props\n}) => {\n const gasPricePayload: EthereumGasBlocknativePayload | undefined = payload ? (payload as EthereumGasBlocknativePayload) : undefined\n const parsedPayload = getBlocknativeTransformer(gasPricePayload)\n\n return (\n <>\n {isEmpty(gasPricePayload) || !gasPricePayload?.blockPrices?.length\n ? <PayloadDataMissing alertBody=\"Payload is missing valid gas fee data.\" />\n : (\n <FlexCol alignItems=\"start\" rowGap={4} {...props}>\n <GasPriceWitnessHeaderBox heading={RenderTitle} parsedPayload={parsedPayload} />\n <Grid\n container\n spacing={3}\n columns={{\n lg: 15, md: 15, sm: 12, xs: 12,\n }}\n >\n {parsedPayload\n && parsedPayload?.gasPrice?.map(({ price, priorityFee }) => (\n <Grid key={price?.label} item xs={12} sm={6} md={5} lg={3}>\n <GasFeeCard\n key={price?.label}\n gasPrice={price?.value}\n speed={price?.label}\n priorityFee={priorityFee?.value}\n priorityFeeLabel={priorityFee?.label}\n />\n </Grid>\n ))}\n </Grid>\n <ToggleRawPayloadBox gasPricePayload={gasPricePayload} alignItems=\"start\" />\n </FlexCol>\n )}\n </>\n )\n}\n\nBlocknativeGasPriceDetailsBox.displayName = 'BlocknativeGasPriceDetailsBox'\n","import { EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { EthereumGasPriceAvatar } from '@xyo-network/react-gas-price'\nimport type { PayloadRenderPlugin } from '@xyo-network/react-payload-plugin'\nimport { createPayloadRenderPlugin } from '@xyo-network/react-payload-plugin'\n\nimport {\n BlocknativeGasPriceCardContent, BlocknativeGasPriceCardHeader, BlocknativeGasPriceDetailsBox,\n} from './components/index.ts'\n\nexport const EthereumGasPriceBlocknativePlugin: PayloadRenderPlugin = {\n ...createPayloadRenderPlugin({\n canRender: (payload?: Payload) => payload?.schema === EthereumGasBlocknativeSchema,\n components: {\n avatar: { image: EthereumGasPriceAvatar },\n box: { detailsBox: BlocknativeGasPriceDetailsBox },\n card: {\n content: BlocknativeGasPriceCardContent,\n header: BlocknativeGasPriceCardHeader,\n },\n },\n name: 'Ethereum Gas Price Blocknative',\n }),\n}\n"],"mappings":";;;;AACA,SAASA,YAAY;AAErB,OAAOC,YAAW;;;ACFlB,SAASC,aAAaC,YAAY;AAElC,SAASC,YAAYC,2BAA2B;AAEhD,SAASC,0BAA0B;AACnC,OAAOC,WAAW;;;ACHX,IAAMC,4BAA4B,wBAACC,YAAAA;AACxC,QAAMC,cAAcD,SAASC,cAAc,CAAA;AAC3C,MAAIA,eAAeA,YAAYC,iBAAiBC,QAAQ;AACtD,UAAMD,kBAAkBD,aAAaC;AACrC,UAAME,WAAWF,gBAAgBG,IAAIC,CAAAA,WAAU;MAC7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AK,OAAA,cAACO,0BAAAA;IAAyBC,SAASC;IAAaX;MAChD,gBAAAE,OAAA,cAACU,OAAAA;IACCC,WAAAA;IACAC,SAAS;IACTC,SAAS;MACPC,IAAI;MAAIC,IAAI;MAAIC,IAAI;MAAIC,IAAI;IAC9B;KAECnB,iBACIA,eAAeoB,UAAUC,IAAI,CAAC,EAAEC,OAAOC,YAAW,MACnD,gBAAArB,OAAA,cAACU,OAAAA;IAAKY,KAAKF,OAAOG;IAAOC,MAAAA;IAAKP,IAAI;IAAID,IAAI;IAAGD,IAAI;IAAGD,IAAI;KACtD,gBAAAd,OAAA,cAACyB,aAAAA;IACCH,KAAKF,OAAOG;IACZL,UAAUE,OAAOM;IACjBC,OAAOP,OAAOG;IACdF,aAAaA,aAAaK;IAC1BE,kBAAkBP,aAAaE;SAKzC,gBAAAvB,OAAA,cAAC6B,sBAAAA;IAAoBjC;IAAkCS,YAAW;;AAKhF,GAvCqG;AAyCrGb,8BAA8BsC,cAAc;;;ACzD5C,SAASC,oCAAoC;AAE7C,SAASC,8BAA8B;AAEvC,SAASC,iCAAiC;AAMnC,IAAMC,oCAAyD;EACpE,GAAGC,0BAA0B;IAC3BC,WAAW,wBAACC,YAAsBA,SAASC,WAAWC,8BAA3C;IACXC,YAAY;MACVC,QAAQ;QAAEC,OAAOC;MAAuB;MACxCC,KAAK;QAAEC,YAAYC;MAA8B;MACjDC,MAAM;QACJC,SAASC;QACTC,QAAQC;MACV;IACF;IACAC,MAAM;EACR,CAAA;AACF;","names":["Card","React","CardContent","Grid","GasFeeCard","ToggleRawPayloadBox","PayloadDataMissing","React","getBlocknativeTransformer","payload","blockPrices","estimatedPrices","length","gasPrice","map","price","label","confidence","value","priorityFee","maxPriorityFeePerGas","baseFee","baseFeePerGas","blockNumber","timestamp","website","isEmpty","obj","Object","keys","length","BlocknativeGasPriceCardContent","payload","props","gasPricePayload","undefined","parsedPayload","getBlocknativeTransformer","blockPrices","PayloadDataMissing","alertBody","sx","m","CardContent","display","flexDirection","rowGap","Grid","container","spacing","columns","lg","md","sm","xs","gasPrice","map","price","key","label","item","GasFeeCard","value","speed","speedPaperElevation","ToggleRawPayloadBox","alignItems","pr","displayName","GasPriceWitnessCardHeader","React","RenderTitle","BlocknativeGasPriceCardHeader","payload","gasPricePayload","undefined","parsedPayload","getBlocknativeTransformer","React","GasPriceWitnessCardHeader","title","RenderTitle","displayName","BlocknativeGasPriceCard","ref","payload","props","React","Card","BlocknativeGasPriceCardHeader","BlocknativeGasPriceCardContent","displayName","Grid","FlexCol","GasFeeCard","GasPriceWitnessHeaderBox","ToggleRawPayloadBox","PayloadDataMissing","React","isEmpty","obj","Object","keys","length","BlocknativeGasPriceDetailsBox","payload","listMode","props","gasPricePayload","undefined","parsedPayload","getBlocknativeTransformer","React","blockPrices","PayloadDataMissing","alertBody","FlexCol","alignItems","rowGap","GasPriceWitnessHeaderBox","heading","RenderTitle","Grid","container","spacing","columns","lg","md","sm","xs","gasPrice","map","price","priorityFee","key","label","item","GasFeeCard","value","speed","priorityFeeLabel","ToggleRawPayloadBox","displayName","EthereumGasBlocknativeSchema","EthereumGasPriceAvatar","createPayloadRenderPlugin","EthereumGasPriceBlocknativePlugin","createPayloadRenderPlugin","canRender","payload","schema","EthereumGasBlocknativeSchema","components","avatar","image","EthereumGasPriceAvatar","box","detailsBox","BlocknativeGasPriceDetailsBox","card","content","BlocknativeGasPriceCardContent","header","BlocknativeGasPriceCardHeader","name"]}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import type { CardProps } from '@mui/material';
|
|
2
2
|
import type { PayloadRenderProps } from '@xyo-network/react-payload-plugin';
|
|
3
|
-
import React from 'react';
|
|
4
3
|
export declare const BlocknativeGasPriceCard: {
|
|
5
|
-
({ ref, payload, ...props }: PayloadRenderProps & CardProps
|
|
6
|
-
ref?: React.RefObject<HTMLDivElement | null>;
|
|
7
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
({ ref, payload, ...props }: PayloadRenderProps & CardProps): import("react/jsx-runtime").JSX.Element;
|
|
8
5
|
displayName: string;
|
|
9
6
|
};
|
|
10
7
|
//# sourceMappingURL=Card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAM3E,eAAO,MAAM,uBAAuB;iCAEjC,kBAAkB,GAAG,SAAS;;CAOhC,CAAA"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import type { CardContentProps } from '@mui/material';
|
|
2
2
|
import type { PayloadRenderProps } from '@xyo-network/react-payload-plugin';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
export declare const BlocknativeGasPriceCardContent:
|
|
5
|
-
({ ref, payload, ...props }: Omit<PayloadRenderProps & CardContentProps, "ref"> & {
|
|
6
|
-
ref?: React.RefObject<HTMLDivElement | null>;
|
|
7
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
displayName: string;
|
|
9
|
-
};
|
|
4
|
+
export declare const BlocknativeGasPriceCardContent: React.FC<PayloadRenderProps & CardContentProps>;
|
|
10
5
|
//# sourceMappingURL=CardContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardContent.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/CardContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAIrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAE3E,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,eAAO,MAAM,8BAA8B
|
|
1
|
+
{"version":3,"file":"CardContent.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/CardContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAIrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAE3E,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,eAAO,MAAM,8BAA8B,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,GAAG,gBAAgB,CAgC1F,CAAA"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import type { CardHeaderProps } from '@mui/material';
|
|
2
2
|
import type { PayloadRenderProps } from '@xyo-network/react-payload-plugin';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
export declare const BlocknativeGasPriceCardHeader:
|
|
5
|
-
({ ref, payload }: PayloadRenderProps & CardHeaderProps & {
|
|
6
|
-
ref?: React.RefObject<HTMLDivElement | null>;
|
|
7
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
displayName: string;
|
|
9
|
-
};
|
|
4
|
+
export declare const BlocknativeGasPriceCardHeader: React.FC<PayloadRenderProps & CardHeaderProps>;
|
|
10
5
|
//# sourceMappingURL=CardHeader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/CardHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAGpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,eAAO,MAAM,6BAA6B
|
|
1
|
+
{"version":3,"file":"CardHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/CardHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAGpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,eAAO,MAAM,6BAA6B,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,GAAG,eAAe,CAIxF,CAAA"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import type { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
2
2
|
import type { PayloadDetailsListRenderProps } from '@xyo-network/react-payload-plugin';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
export declare const BlocknativeGasPriceDetailsBox:
|
|
5
|
-
({ ref, payload, listMode, ...props }: PayloadDetailsListRenderProps & FlexBoxProps & {
|
|
6
|
-
ref?: React.RefObject<HTMLDivElement | null>;
|
|
7
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
displayName: string;
|
|
9
|
-
};
|
|
4
|
+
export declare const BlocknativeGasPriceDetailsBox: React.FC<PayloadDetailsListRenderProps & FlexBoxProps>;
|
|
10
5
|
//# sourceMappingURL=BlocknativeGasPriceDetailsBox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlocknativeGasPriceDetailsBox.d.ts","sourceRoot":"","sources":["../../../../../src/components/Details/Box/BlocknativeGasPriceDetailsBox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAMzD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAA;AAEtF,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,eAAO,MAAM,6BAA6B
|
|
1
|
+
{"version":3,"file":"BlocknativeGasPriceDetailsBox.d.ts","sourceRoot":"","sources":["../../../../../src/components/Details/Box/BlocknativeGasPriceDetailsBox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAMzD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAA;AAEtF,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,eAAO,MAAM,6BAA6B,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,GAAG,YAAY,CAuChG,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/react-ethereum-gas-price-blocknative-plugin",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"description": "Common React library for all XYO projects that use React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xyo",
|
|
@@ -37,18 +37,18 @@
|
|
|
37
37
|
"./package.json": "./package.json"
|
|
38
38
|
},
|
|
39
39
|
"module": "dist/browser/index.mjs",
|
|
40
|
-
"types": "dist/
|
|
40
|
+
"types": "dist/types/index.d.ts",
|
|
41
41
|
"scripts": {
|
|
42
42
|
"license": "yarn license-checker --exclude \"MIT, ISC, Apache-2.0, BSD, BSD-2-Clause, CC-BY-4.0, Unlicense, CC-BY-3.0, CC0-1.0\"",
|
|
43
43
|
"lint-pkg": "npmPkgJsonLint ."
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@xylabs/react-flexbox": "^6.0.
|
|
47
|
-
"@xyo-network/blocknative-ethereum-gas-payload-plugin": "^3.4.
|
|
46
|
+
"@xylabs/react-flexbox": "^6.0.4",
|
|
47
|
+
"@xyo-network/blocknative-ethereum-gas-payload-plugin": "^3.4.4",
|
|
48
48
|
"@xyo-network/payload-model": "^3.9.37",
|
|
49
|
-
"@xyo-network/react-gas-price": "^5.0.
|
|
50
|
-
"@xyo-network/react-payload-plugin": "^5.0.
|
|
51
|
-
"@xyo-network/react-shared": "^5.0.
|
|
49
|
+
"@xyo-network/react-gas-price": "^5.0.2",
|
|
50
|
+
"@xyo-network/react-payload-plugin": "^5.0.2",
|
|
51
|
+
"@xyo-network/react-shared": "^5.0.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@emotion/react": "^11.14.0",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"@mui/styles": "^6.4.7",
|
|
59
59
|
"@storybook/react": "^8.6.4",
|
|
60
60
|
"@types/react": "^19.0.10",
|
|
61
|
-
"@xylabs/ts-scripts-yarn3": "^6.0.
|
|
62
|
-
"@xylabs/tsconfig-react": "^6.0.
|
|
63
|
-
"@xyo-network/react-storybook": "^5.0.
|
|
61
|
+
"@xylabs/ts-scripts-yarn3": "^6.0.8",
|
|
62
|
+
"@xylabs/tsconfig-react": "^6.0.8",
|
|
63
|
+
"@xyo-network/react-storybook": "^5.0.2",
|
|
64
64
|
"react": "^19.0.0",
|
|
65
65
|
"react-dom": "^19.0.0",
|
|
66
66
|
"storybook": "^8.6.4",
|
|
@@ -8,7 +8,7 @@ import { BlocknativeGasPriceCardHeader } from './CardHeader.tsx'
|
|
|
8
8
|
|
|
9
9
|
export const BlocknativeGasPriceCard = ({
|
|
10
10
|
ref, payload, ...props
|
|
11
|
-
}: PayloadRenderProps & CardProps
|
|
11
|
+
}: PayloadRenderProps & CardProps) => {
|
|
12
12
|
return (
|
|
13
13
|
<Card ref={ref} {...props}>
|
|
14
14
|
<BlocknativeGasPriceCardHeader payload={payload} />
|
|
@@ -10,9 +10,7 @@ import { getBlocknativeTransformer } from '../hooks/index.ts'
|
|
|
10
10
|
|
|
11
11
|
const isEmpty = (obj?: object) => Object.keys(obj ?? {}).length === 0
|
|
12
12
|
|
|
13
|
-
export const BlocknativeGasPriceCardContent = ({
|
|
14
|
-
ref, payload, ...props
|
|
15
|
-
}: Omit<PayloadRenderProps & CardContentProps, 'ref'> & { ref?: React.RefObject<HTMLDivElement | null> }) => {
|
|
13
|
+
export const BlocknativeGasPriceCardContent: React.FC<PayloadRenderProps & CardContentProps> = ({ payload, ...props }) => {
|
|
16
14
|
const gasPricePayload = payload ? (payload as EthereumGasBlocknativePayload) : undefined
|
|
17
15
|
const parsedPayload = getBlocknativeTransformer(gasPricePayload)
|
|
18
16
|
|
|
@@ -22,7 +20,6 @@ export const BlocknativeGasPriceCardContent = ({
|
|
|
22
20
|
|
|
23
21
|
return (
|
|
24
22
|
<CardContent
|
|
25
|
-
ref={ref}
|
|
26
23
|
sx={{
|
|
27
24
|
display: 'flex', flexDirection: 'column', rowGap: 4,
|
|
28
25
|
}}
|
|
@@ -7,10 +7,10 @@ import React from 'react'
|
|
|
7
7
|
import { getBlocknativeTransformer } from '../hooks/index.ts'
|
|
8
8
|
import { RenderTitle } from '../lib/index.ts'
|
|
9
9
|
|
|
10
|
-
export const BlocknativeGasPriceCardHeader
|
|
10
|
+
export const BlocknativeGasPriceCardHeader: React.FC<PayloadRenderProps & CardHeaderProps> = ({ payload }) => {
|
|
11
11
|
const gasPricePayload = payload ? (payload as EthereumGasBlocknativePayload) : undefined
|
|
12
12
|
const parsedPayload = getBlocknativeTransformer(gasPricePayload)
|
|
13
|
-
return <GasPriceWitnessCardHeader title={RenderTitle} parsedPayload={parsedPayload}
|
|
13
|
+
return <GasPriceWitnessCardHeader title={RenderTitle} parsedPayload={parsedPayload} />
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
BlocknativeGasPriceCardHeader.displayName = 'BlocknativeGasPriceCardHeader'
|
|
@@ -14,10 +14,10 @@ import { RenderTitle } from '../../lib/index.ts'
|
|
|
14
14
|
|
|
15
15
|
const isEmpty = (obj?: object) => Object.keys(obj ?? {}).length === 0
|
|
16
16
|
|
|
17
|
-
export const BlocknativeGasPriceDetailsBox = ({
|
|
17
|
+
export const BlocknativeGasPriceDetailsBox: React.FC<PayloadDetailsListRenderProps & FlexBoxProps> = ({
|
|
18
18
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
19
|
-
|
|
20
|
-
}
|
|
19
|
+
payload, listMode, ...props
|
|
20
|
+
}) => {
|
|
21
21
|
const gasPricePayload: EthereumGasBlocknativePayload | undefined = payload ? (payload as EthereumGasBlocknativePayload) : undefined
|
|
22
22
|
const parsedPayload = getBlocknativeTransformer(gasPricePayload)
|
|
23
23
|
|
|
@@ -26,7 +26,7 @@ export const BlocknativeGasPriceDetailsBox = ({
|
|
|
26
26
|
{isEmpty(gasPricePayload) || !gasPricePayload?.blockPrices?.length
|
|
27
27
|
? <PayloadDataMissing alertBody="Payload is missing valid gas fee data." />
|
|
28
28
|
: (
|
|
29
|
-
<FlexCol alignItems="start" rowGap={4} {...props}
|
|
29
|
+
<FlexCol alignItems="start" rowGap={4} {...props}>
|
|
30
30
|
<GasPriceWitnessHeaderBox heading={RenderTitle} parsedPayload={parsedPayload} />
|
|
31
31
|
<Grid
|
|
32
32
|
container
|