@xyo-network/gas-price-plugin 2.99.5 → 3.0.0
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/neutral/index.d.ts +45 -4
- package/dist/neutral/index.mjs +93 -218
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +25 -44
- package/src/index.ts +1 -1
- package/xy.config.ts +4 -5
- package/dist/browser/Diviner.d.cts +0 -16
- package/dist/browser/Diviner.d.cts.map +0 -1
- package/dist/browser/Diviner.d.mts +0 -16
- package/dist/browser/Diviner.d.mts.map +0 -1
- package/dist/browser/Diviner.d.ts +0 -16
- package/dist/browser/Diviner.d.ts.map +0 -1
- package/dist/browser/Plugin.d.cts +0 -19
- package/dist/browser/Plugin.d.cts.map +0 -1
- package/dist/browser/Plugin.d.mts +0 -19
- package/dist/browser/Plugin.d.mts.map +0 -1
- package/dist/browser/Plugin.d.ts +0 -19
- package/dist/browser/Plugin.d.ts.map +0 -1
- package/dist/browser/Schema.d.cts +0 -5
- package/dist/browser/Schema.d.cts.map +0 -1
- package/dist/browser/Schema.d.mts +0 -5
- package/dist/browser/Schema.d.mts.map +0 -1
- package/dist/browser/Schema.d.ts +0 -5
- package/dist/browser/Schema.d.ts.map +0 -1
- package/dist/browser/index.cjs +0 -401
- package/dist/browser/index.cjs.map +0 -1
- package/dist/browser/index.d.cts +0 -4
- package/dist/browser/index.d.cts.map +0 -1
- package/dist/browser/index.d.mts +0 -4
- package/dist/browser/index.d.mts.map +0 -1
- package/dist/browser/index.d.ts +0 -4
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/index.mjs +0 -380
- package/dist/browser/index.mjs.map +0 -1
- package/dist/browser/lib/average.d.cts +0 -3
- package/dist/browser/lib/average.d.cts.map +0 -1
- package/dist/browser/lib/average.d.mts +0 -3
- package/dist/browser/lib/average.d.mts.map +0 -1
- package/dist/browser/lib/average.d.ts +0 -3
- package/dist/browser/lib/average.d.ts.map +0 -1
- package/dist/browser/lib/divineGas.d.cts +0 -4
- package/dist/browser/lib/divineGas.d.cts.map +0 -1
- package/dist/browser/lib/divineGas.d.mts +0 -4
- package/dist/browser/lib/divineGas.d.mts.map +0 -1
- package/dist/browser/lib/divineGas.d.ts +0 -4
- package/dist/browser/lib/divineGas.d.ts.map +0 -1
- package/dist/browser/lib/identities/index.d.cts +0 -6
- package/dist/browser/lib/identities/index.d.cts.map +0 -1
- package/dist/browser/lib/identities/index.d.mts +0 -6
- package/dist/browser/lib/identities/index.d.mts.map +0 -1
- package/dist/browser/lib/identities/index.d.ts +0 -6
- package/dist/browser/lib/identities/index.d.ts.map +0 -1
- package/dist/browser/lib/identities/isEthereumGasBlocknativePayload.d.cts +0 -4
- package/dist/browser/lib/identities/isEthereumGasBlocknativePayload.d.cts.map +0 -1
- package/dist/browser/lib/identities/isEthereumGasBlocknativePayload.d.mts +0 -4
- package/dist/browser/lib/identities/isEthereumGasBlocknativePayload.d.mts.map +0 -1
- package/dist/browser/lib/identities/isEthereumGasBlocknativePayload.d.ts +0 -4
- package/dist/browser/lib/identities/isEthereumGasBlocknativePayload.d.ts.map +0 -1
- package/dist/browser/lib/identities/isEthereumGasEtherchainV2Payload.d.cts +0 -4
- package/dist/browser/lib/identities/isEthereumGasEtherchainV2Payload.d.cts.map +0 -1
- package/dist/browser/lib/identities/isEthereumGasEtherchainV2Payload.d.mts +0 -4
- package/dist/browser/lib/identities/isEthereumGasEtherchainV2Payload.d.mts.map +0 -1
- package/dist/browser/lib/identities/isEthereumGasEtherchainV2Payload.d.ts +0 -4
- package/dist/browser/lib/identities/isEthereumGasEtherchainV2Payload.d.ts.map +0 -1
- package/dist/browser/lib/identities/isEthereumGasEthersPayload.d.cts +0 -4
- package/dist/browser/lib/identities/isEthereumGasEthersPayload.d.cts.map +0 -1
- package/dist/browser/lib/identities/isEthereumGasEthersPayload.d.mts +0 -4
- package/dist/browser/lib/identities/isEthereumGasEthersPayload.d.mts.map +0 -1
- package/dist/browser/lib/identities/isEthereumGasEthersPayload.d.ts +0 -4
- package/dist/browser/lib/identities/isEthereumGasEthersPayload.d.ts.map +0 -1
- package/dist/browser/lib/identities/isEthereumGasEtherscanPayload.d.cts +0 -4
- package/dist/browser/lib/identities/isEthereumGasEtherscanPayload.d.cts.map +0 -1
- package/dist/browser/lib/identities/isEthereumGasEtherscanPayload.d.mts +0 -4
- package/dist/browser/lib/identities/isEthereumGasEtherscanPayload.d.mts.map +0 -1
- package/dist/browser/lib/identities/isEthereumGasEtherscanPayload.d.ts +0 -4
- package/dist/browser/lib/identities/isEthereumGasEtherscanPayload.d.ts.map +0 -1
- package/dist/browser/lib/identities/isEthereumGasEthgasstationPayload.d.cts +0 -4
- package/dist/browser/lib/identities/isEthereumGasEthgasstationPayload.d.cts.map +0 -1
- package/dist/browser/lib/identities/isEthereumGasEthgasstationPayload.d.mts +0 -4
- package/dist/browser/lib/identities/isEthereumGasEthgasstationPayload.d.mts.map +0 -1
- package/dist/browser/lib/identities/isEthereumGasEthgasstationPayload.d.ts +0 -4
- package/dist/browser/lib/identities/isEthereumGasEthgasstationPayload.d.ts.map +0 -1
- package/dist/browser/lib/index.d.cts +0 -2
- package/dist/browser/lib/index.d.cts.map +0 -1
- package/dist/browser/lib/index.d.mts +0 -2
- package/dist/browser/lib/index.d.mts.map +0 -1
- package/dist/browser/lib/index.d.ts +0 -2
- package/dist/browser/lib/index.d.ts.map +0 -1
- package/dist/browser/lib/transforms/index.d.cts +0 -6
- package/dist/browser/lib/transforms/index.d.cts.map +0 -1
- package/dist/browser/lib/transforms/index.d.mts +0 -6
- package/dist/browser/lib/transforms/index.d.mts.map +0 -1
- package/dist/browser/lib/transforms/index.d.ts +0 -6
- package/dist/browser/lib/transforms/index.d.ts.map +0 -1
- package/dist/browser/lib/transforms/transformGasFromBlocknative.d.cts +0 -4
- package/dist/browser/lib/transforms/transformGasFromBlocknative.d.cts.map +0 -1
- package/dist/browser/lib/transforms/transformGasFromBlocknative.d.mts +0 -4
- package/dist/browser/lib/transforms/transformGasFromBlocknative.d.mts.map +0 -1
- package/dist/browser/lib/transforms/transformGasFromBlocknative.d.ts +0 -4
- package/dist/browser/lib/transforms/transformGasFromBlocknative.d.ts.map +0 -1
- package/dist/browser/lib/transforms/transformGasFromEtherchainV2.d.cts +0 -4
- package/dist/browser/lib/transforms/transformGasFromEtherchainV2.d.cts.map +0 -1
- package/dist/browser/lib/transforms/transformGasFromEtherchainV2.d.mts +0 -4
- package/dist/browser/lib/transforms/transformGasFromEtherchainV2.d.mts.map +0 -1
- package/dist/browser/lib/transforms/transformGasFromEtherchainV2.d.ts +0 -4
- package/dist/browser/lib/transforms/transformGasFromEtherchainV2.d.ts.map +0 -1
- package/dist/browser/lib/transforms/transformGasFromEthers.d.cts +0 -4
- package/dist/browser/lib/transforms/transformGasFromEthers.d.cts.map +0 -1
- package/dist/browser/lib/transforms/transformGasFromEthers.d.mts +0 -4
- package/dist/browser/lib/transforms/transformGasFromEthers.d.mts.map +0 -1
- package/dist/browser/lib/transforms/transformGasFromEthers.d.ts +0 -4
- package/dist/browser/lib/transforms/transformGasFromEthers.d.ts.map +0 -1
- package/dist/browser/lib/transforms/transformGasFromEtherscan.d.cts +0 -4
- package/dist/browser/lib/transforms/transformGasFromEtherscan.d.cts.map +0 -1
- package/dist/browser/lib/transforms/transformGasFromEtherscan.d.mts +0 -4
- package/dist/browser/lib/transforms/transformGasFromEtherscan.d.mts.map +0 -1
- package/dist/browser/lib/transforms/transformGasFromEtherscan.d.ts +0 -4
- package/dist/browser/lib/transforms/transformGasFromEtherscan.d.ts.map +0 -1
- package/dist/browser/lib/transforms/transformGasFromEthgasstation.d.cts +0 -4
- package/dist/browser/lib/transforms/transformGasFromEthgasstation.d.cts.map +0 -1
- package/dist/browser/lib/transforms/transformGasFromEthgasstation.d.mts +0 -4
- package/dist/browser/lib/transforms/transformGasFromEthgasstation.d.mts.map +0 -1
- package/dist/browser/lib/transforms/transformGasFromEthgasstation.d.ts +0 -4
- package/dist/browser/lib/transforms/transformGasFromEthgasstation.d.ts.map +0 -1
- package/dist/browser/test/index.d.cts +0 -6
- package/dist/browser/test/index.d.cts.map +0 -1
- package/dist/browser/test/index.d.mts +0 -6
- package/dist/browser/test/index.d.mts.map +0 -1
- package/dist/browser/test/index.d.ts +0 -6
- package/dist/browser/test/index.d.ts.map +0 -1
- package/dist/browser/test/sampleBlocknativeGas.d.cts +0 -3
- package/dist/browser/test/sampleBlocknativeGas.d.cts.map +0 -1
- package/dist/browser/test/sampleBlocknativeGas.d.mts +0 -3
- package/dist/browser/test/sampleBlocknativeGas.d.mts.map +0 -1
- package/dist/browser/test/sampleBlocknativeGas.d.ts +0 -3
- package/dist/browser/test/sampleBlocknativeGas.d.ts.map +0 -1
- package/dist/browser/test/sampleEtherchainGasV2.d.cts +0 -3
- package/dist/browser/test/sampleEtherchainGasV2.d.cts.map +0 -1
- package/dist/browser/test/sampleEtherchainGasV2.d.mts +0 -3
- package/dist/browser/test/sampleEtherchainGasV2.d.mts.map +0 -1
- package/dist/browser/test/sampleEtherchainGasV2.d.ts +0 -3
- package/dist/browser/test/sampleEtherchainGasV2.d.ts.map +0 -1
- package/dist/browser/test/sampleEthersGas.d.cts +0 -3
- package/dist/browser/test/sampleEthersGas.d.cts.map +0 -1
- package/dist/browser/test/sampleEthersGas.d.mts +0 -3
- package/dist/browser/test/sampleEthersGas.d.mts.map +0 -1
- package/dist/browser/test/sampleEthersGas.d.ts +0 -3
- package/dist/browser/test/sampleEthersGas.d.ts.map +0 -1
- package/dist/browser/test/sampleEtherscanGas.d.cts +0 -3
- package/dist/browser/test/sampleEtherscanGas.d.cts.map +0 -1
- package/dist/browser/test/sampleEtherscanGas.d.mts +0 -3
- package/dist/browser/test/sampleEtherscanGas.d.mts.map +0 -1
- package/dist/browser/test/sampleEtherscanGas.d.ts +0 -3
- package/dist/browser/test/sampleEtherscanGas.d.ts.map +0 -1
- package/dist/browser/test/sampleEthgasstationGas.d.cts +0 -3
- package/dist/browser/test/sampleEthgasstationGas.d.cts.map +0 -1
- package/dist/browser/test/sampleEthgasstationGas.d.mts +0 -3
- package/dist/browser/test/sampleEthgasstationGas.d.mts.map +0 -1
- package/dist/browser/test/sampleEthgasstationGas.d.ts +0 -3
- package/dist/browser/test/sampleEthgasstationGas.d.ts.map +0 -1
- package/dist/neutral/Diviner.d.cts +0 -16
- package/dist/neutral/Diviner.d.cts.map +0 -1
- package/dist/neutral/Diviner.d.mts +0 -16
- package/dist/neutral/Diviner.d.mts.map +0 -1
- package/dist/neutral/Diviner.d.ts +0 -16
- package/dist/neutral/Diviner.d.ts.map +0 -1
- package/dist/neutral/Plugin.d.cts +0 -19
- package/dist/neutral/Plugin.d.cts.map +0 -1
- package/dist/neutral/Plugin.d.mts +0 -19
- package/dist/neutral/Plugin.d.mts.map +0 -1
- package/dist/neutral/Plugin.d.ts +0 -19
- package/dist/neutral/Plugin.d.ts.map +0 -1
- package/dist/neutral/Schema.d.cts +0 -5
- package/dist/neutral/Schema.d.cts.map +0 -1
- package/dist/neutral/Schema.d.mts +0 -5
- package/dist/neutral/Schema.d.mts.map +0 -1
- package/dist/neutral/Schema.d.ts +0 -5
- package/dist/neutral/Schema.d.ts.map +0 -1
- package/dist/neutral/index.cjs +0 -401
- package/dist/neutral/index.cjs.map +0 -1
- package/dist/neutral/index.d.cts +0 -4
- package/dist/neutral/index.d.cts.map +0 -1
- package/dist/neutral/index.d.mts +0 -4
- package/dist/neutral/index.d.mts.map +0 -1
- package/dist/neutral/index.d.ts.map +0 -1
- package/dist/neutral/lib/average.d.cts +0 -3
- package/dist/neutral/lib/average.d.cts.map +0 -1
- package/dist/neutral/lib/average.d.mts +0 -3
- package/dist/neutral/lib/average.d.mts.map +0 -1
- package/dist/neutral/lib/average.d.ts +0 -3
- package/dist/neutral/lib/average.d.ts.map +0 -1
- package/dist/neutral/lib/divineGas.d.cts +0 -4
- package/dist/neutral/lib/divineGas.d.cts.map +0 -1
- package/dist/neutral/lib/divineGas.d.mts +0 -4
- package/dist/neutral/lib/divineGas.d.mts.map +0 -1
- package/dist/neutral/lib/divineGas.d.ts +0 -4
- package/dist/neutral/lib/divineGas.d.ts.map +0 -1
- package/dist/neutral/lib/identities/index.d.cts +0 -6
- package/dist/neutral/lib/identities/index.d.cts.map +0 -1
- package/dist/neutral/lib/identities/index.d.mts +0 -6
- package/dist/neutral/lib/identities/index.d.mts.map +0 -1
- package/dist/neutral/lib/identities/index.d.ts +0 -6
- package/dist/neutral/lib/identities/index.d.ts.map +0 -1
- package/dist/neutral/lib/identities/isEthereumGasBlocknativePayload.d.cts +0 -4
- package/dist/neutral/lib/identities/isEthereumGasBlocknativePayload.d.cts.map +0 -1
- package/dist/neutral/lib/identities/isEthereumGasBlocknativePayload.d.mts +0 -4
- package/dist/neutral/lib/identities/isEthereumGasBlocknativePayload.d.mts.map +0 -1
- package/dist/neutral/lib/identities/isEthereumGasBlocknativePayload.d.ts +0 -4
- package/dist/neutral/lib/identities/isEthereumGasBlocknativePayload.d.ts.map +0 -1
- package/dist/neutral/lib/identities/isEthereumGasEtherchainV2Payload.d.cts +0 -4
- package/dist/neutral/lib/identities/isEthereumGasEtherchainV2Payload.d.cts.map +0 -1
- package/dist/neutral/lib/identities/isEthereumGasEtherchainV2Payload.d.mts +0 -4
- package/dist/neutral/lib/identities/isEthereumGasEtherchainV2Payload.d.mts.map +0 -1
- package/dist/neutral/lib/identities/isEthereumGasEtherchainV2Payload.d.ts +0 -4
- package/dist/neutral/lib/identities/isEthereumGasEtherchainV2Payload.d.ts.map +0 -1
- package/dist/neutral/lib/identities/isEthereumGasEthersPayload.d.cts +0 -4
- package/dist/neutral/lib/identities/isEthereumGasEthersPayload.d.cts.map +0 -1
- package/dist/neutral/lib/identities/isEthereumGasEthersPayload.d.mts +0 -4
- package/dist/neutral/lib/identities/isEthereumGasEthersPayload.d.mts.map +0 -1
- package/dist/neutral/lib/identities/isEthereumGasEthersPayload.d.ts +0 -4
- package/dist/neutral/lib/identities/isEthereumGasEthersPayload.d.ts.map +0 -1
- package/dist/neutral/lib/identities/isEthereumGasEtherscanPayload.d.cts +0 -4
- package/dist/neutral/lib/identities/isEthereumGasEtherscanPayload.d.cts.map +0 -1
- package/dist/neutral/lib/identities/isEthereumGasEtherscanPayload.d.mts +0 -4
- package/dist/neutral/lib/identities/isEthereumGasEtherscanPayload.d.mts.map +0 -1
- package/dist/neutral/lib/identities/isEthereumGasEtherscanPayload.d.ts +0 -4
- package/dist/neutral/lib/identities/isEthereumGasEtherscanPayload.d.ts.map +0 -1
- package/dist/neutral/lib/identities/isEthereumGasEthgasstationPayload.d.cts +0 -4
- package/dist/neutral/lib/identities/isEthereumGasEthgasstationPayload.d.cts.map +0 -1
- package/dist/neutral/lib/identities/isEthereumGasEthgasstationPayload.d.mts +0 -4
- package/dist/neutral/lib/identities/isEthereumGasEthgasstationPayload.d.mts.map +0 -1
- package/dist/neutral/lib/identities/isEthereumGasEthgasstationPayload.d.ts +0 -4
- package/dist/neutral/lib/identities/isEthereumGasEthgasstationPayload.d.ts.map +0 -1
- package/dist/neutral/lib/index.d.cts +0 -2
- package/dist/neutral/lib/index.d.cts.map +0 -1
- package/dist/neutral/lib/index.d.mts +0 -2
- package/dist/neutral/lib/index.d.mts.map +0 -1
- package/dist/neutral/lib/index.d.ts +0 -2
- package/dist/neutral/lib/index.d.ts.map +0 -1
- package/dist/neutral/lib/transforms/index.d.cts +0 -6
- package/dist/neutral/lib/transforms/index.d.cts.map +0 -1
- package/dist/neutral/lib/transforms/index.d.mts +0 -6
- package/dist/neutral/lib/transforms/index.d.mts.map +0 -1
- package/dist/neutral/lib/transforms/index.d.ts +0 -6
- package/dist/neutral/lib/transforms/index.d.ts.map +0 -1
- package/dist/neutral/lib/transforms/transformGasFromBlocknative.d.cts +0 -4
- package/dist/neutral/lib/transforms/transformGasFromBlocknative.d.cts.map +0 -1
- package/dist/neutral/lib/transforms/transformGasFromBlocknative.d.mts +0 -4
- package/dist/neutral/lib/transforms/transformGasFromBlocknative.d.mts.map +0 -1
- package/dist/neutral/lib/transforms/transformGasFromBlocknative.d.ts +0 -4
- package/dist/neutral/lib/transforms/transformGasFromBlocknative.d.ts.map +0 -1
- package/dist/neutral/lib/transforms/transformGasFromEtherchainV2.d.cts +0 -4
- package/dist/neutral/lib/transforms/transformGasFromEtherchainV2.d.cts.map +0 -1
- package/dist/neutral/lib/transforms/transformGasFromEtherchainV2.d.mts +0 -4
- package/dist/neutral/lib/transforms/transformGasFromEtherchainV2.d.mts.map +0 -1
- package/dist/neutral/lib/transforms/transformGasFromEtherchainV2.d.ts +0 -4
- package/dist/neutral/lib/transforms/transformGasFromEtherchainV2.d.ts.map +0 -1
- package/dist/neutral/lib/transforms/transformGasFromEthers.d.cts +0 -4
- package/dist/neutral/lib/transforms/transformGasFromEthers.d.cts.map +0 -1
- package/dist/neutral/lib/transforms/transformGasFromEthers.d.mts +0 -4
- package/dist/neutral/lib/transforms/transformGasFromEthers.d.mts.map +0 -1
- package/dist/neutral/lib/transforms/transformGasFromEthers.d.ts +0 -4
- package/dist/neutral/lib/transforms/transformGasFromEthers.d.ts.map +0 -1
- package/dist/neutral/lib/transforms/transformGasFromEtherscan.d.cts +0 -4
- package/dist/neutral/lib/transforms/transformGasFromEtherscan.d.cts.map +0 -1
- package/dist/neutral/lib/transforms/transformGasFromEtherscan.d.mts +0 -4
- package/dist/neutral/lib/transforms/transformGasFromEtherscan.d.mts.map +0 -1
- package/dist/neutral/lib/transforms/transformGasFromEtherscan.d.ts +0 -4
- package/dist/neutral/lib/transforms/transformGasFromEtherscan.d.ts.map +0 -1
- package/dist/neutral/lib/transforms/transformGasFromEthgasstation.d.cts +0 -4
- package/dist/neutral/lib/transforms/transformGasFromEthgasstation.d.cts.map +0 -1
- package/dist/neutral/lib/transforms/transformGasFromEthgasstation.d.mts +0 -4
- package/dist/neutral/lib/transforms/transformGasFromEthgasstation.d.mts.map +0 -1
- package/dist/neutral/lib/transforms/transformGasFromEthgasstation.d.ts +0 -4
- package/dist/neutral/lib/transforms/transformGasFromEthgasstation.d.ts.map +0 -1
- package/dist/neutral/test/index.d.cts +0 -6
- package/dist/neutral/test/index.d.cts.map +0 -1
- package/dist/neutral/test/index.d.mts +0 -6
- package/dist/neutral/test/index.d.mts.map +0 -1
- package/dist/neutral/test/index.d.ts +0 -6
- package/dist/neutral/test/index.d.ts.map +0 -1
- package/dist/neutral/test/sampleBlocknativeGas.d.cts +0 -3
- package/dist/neutral/test/sampleBlocknativeGas.d.cts.map +0 -1
- package/dist/neutral/test/sampleBlocknativeGas.d.mts +0 -3
- package/dist/neutral/test/sampleBlocknativeGas.d.mts.map +0 -1
- package/dist/neutral/test/sampleBlocknativeGas.d.ts +0 -3
- package/dist/neutral/test/sampleBlocknativeGas.d.ts.map +0 -1
- package/dist/neutral/test/sampleEtherchainGasV2.d.cts +0 -3
- package/dist/neutral/test/sampleEtherchainGasV2.d.cts.map +0 -1
- package/dist/neutral/test/sampleEtherchainGasV2.d.mts +0 -3
- package/dist/neutral/test/sampleEtherchainGasV2.d.mts.map +0 -1
- package/dist/neutral/test/sampleEtherchainGasV2.d.ts +0 -3
- package/dist/neutral/test/sampleEtherchainGasV2.d.ts.map +0 -1
- package/dist/neutral/test/sampleEthersGas.d.cts +0 -3
- package/dist/neutral/test/sampleEthersGas.d.cts.map +0 -1
- package/dist/neutral/test/sampleEthersGas.d.mts +0 -3
- package/dist/neutral/test/sampleEthersGas.d.mts.map +0 -1
- package/dist/neutral/test/sampleEthersGas.d.ts +0 -3
- package/dist/neutral/test/sampleEthersGas.d.ts.map +0 -1
- package/dist/neutral/test/sampleEtherscanGas.d.cts +0 -3
- package/dist/neutral/test/sampleEtherscanGas.d.cts.map +0 -1
- package/dist/neutral/test/sampleEtherscanGas.d.mts +0 -3
- package/dist/neutral/test/sampleEtherscanGas.d.mts.map +0 -1
- package/dist/neutral/test/sampleEtherscanGas.d.ts +0 -3
- package/dist/neutral/test/sampleEtherscanGas.d.ts.map +0 -1
- package/dist/neutral/test/sampleEthgasstationGas.d.cts +0 -3
- package/dist/neutral/test/sampleEthgasstationGas.d.cts.map +0 -1
- package/dist/neutral/test/sampleEthgasstationGas.d.mts +0 -3
- package/dist/neutral/test/sampleEthgasstationGas.d.mts.map +0 -1
- package/dist/neutral/test/sampleEthgasstationGas.d.ts +0 -3
- package/dist/neutral/test/sampleEthgasstationGas.d.ts.map +0 -1
- package/dist/node/Diviner.d.cts +0 -16
- package/dist/node/Diviner.d.cts.map +0 -1
- package/dist/node/Diviner.d.mts +0 -16
- package/dist/node/Diviner.d.mts.map +0 -1
- package/dist/node/Diviner.d.ts +0 -16
- package/dist/node/Diviner.d.ts.map +0 -1
- package/dist/node/Plugin.d.cts +0 -19
- package/dist/node/Plugin.d.cts.map +0 -1
- package/dist/node/Plugin.d.mts +0 -19
- package/dist/node/Plugin.d.mts.map +0 -1
- package/dist/node/Plugin.d.ts +0 -19
- package/dist/node/Plugin.d.ts.map +0 -1
- package/dist/node/Schema.d.cts +0 -5
- package/dist/node/Schema.d.cts.map +0 -1
- package/dist/node/Schema.d.mts +0 -5
- package/dist/node/Schema.d.mts.map +0 -1
- package/dist/node/Schema.d.ts +0 -5
- package/dist/node/Schema.d.ts.map +0 -1
- package/dist/node/index.cjs +0 -415
- package/dist/node/index.cjs.map +0 -1
- package/dist/node/index.d.cts +0 -4
- package/dist/node/index.d.cts.map +0 -1
- package/dist/node/index.d.mts +0 -4
- package/dist/node/index.d.mts.map +0 -1
- package/dist/node/index.d.ts +0 -4
- package/dist/node/index.d.ts.map +0 -1
- package/dist/node/index.mjs +0 -387
- package/dist/node/index.mjs.map +0 -1
- package/dist/node/lib/average.d.cts +0 -3
- package/dist/node/lib/average.d.cts.map +0 -1
- package/dist/node/lib/average.d.mts +0 -3
- package/dist/node/lib/average.d.mts.map +0 -1
- package/dist/node/lib/average.d.ts +0 -3
- package/dist/node/lib/average.d.ts.map +0 -1
- package/dist/node/lib/divineGas.d.cts +0 -4
- package/dist/node/lib/divineGas.d.cts.map +0 -1
- package/dist/node/lib/divineGas.d.mts +0 -4
- package/dist/node/lib/divineGas.d.mts.map +0 -1
- package/dist/node/lib/divineGas.d.ts +0 -4
- package/dist/node/lib/divineGas.d.ts.map +0 -1
- package/dist/node/lib/identities/index.d.cts +0 -6
- package/dist/node/lib/identities/index.d.cts.map +0 -1
- package/dist/node/lib/identities/index.d.mts +0 -6
- package/dist/node/lib/identities/index.d.mts.map +0 -1
- package/dist/node/lib/identities/index.d.ts +0 -6
- package/dist/node/lib/identities/index.d.ts.map +0 -1
- package/dist/node/lib/identities/isEthereumGasBlocknativePayload.d.cts +0 -4
- package/dist/node/lib/identities/isEthereumGasBlocknativePayload.d.cts.map +0 -1
- package/dist/node/lib/identities/isEthereumGasBlocknativePayload.d.mts +0 -4
- package/dist/node/lib/identities/isEthereumGasBlocknativePayload.d.mts.map +0 -1
- package/dist/node/lib/identities/isEthereumGasBlocknativePayload.d.ts +0 -4
- package/dist/node/lib/identities/isEthereumGasBlocknativePayload.d.ts.map +0 -1
- package/dist/node/lib/identities/isEthereumGasEtherchainV2Payload.d.cts +0 -4
- package/dist/node/lib/identities/isEthereumGasEtherchainV2Payload.d.cts.map +0 -1
- package/dist/node/lib/identities/isEthereumGasEtherchainV2Payload.d.mts +0 -4
- package/dist/node/lib/identities/isEthereumGasEtherchainV2Payload.d.mts.map +0 -1
- package/dist/node/lib/identities/isEthereumGasEtherchainV2Payload.d.ts +0 -4
- package/dist/node/lib/identities/isEthereumGasEtherchainV2Payload.d.ts.map +0 -1
- package/dist/node/lib/identities/isEthereumGasEthersPayload.d.cts +0 -4
- package/dist/node/lib/identities/isEthereumGasEthersPayload.d.cts.map +0 -1
- package/dist/node/lib/identities/isEthereumGasEthersPayload.d.mts +0 -4
- package/dist/node/lib/identities/isEthereumGasEthersPayload.d.mts.map +0 -1
- package/dist/node/lib/identities/isEthereumGasEthersPayload.d.ts +0 -4
- package/dist/node/lib/identities/isEthereumGasEthersPayload.d.ts.map +0 -1
- package/dist/node/lib/identities/isEthereumGasEtherscanPayload.d.cts +0 -4
- package/dist/node/lib/identities/isEthereumGasEtherscanPayload.d.cts.map +0 -1
- package/dist/node/lib/identities/isEthereumGasEtherscanPayload.d.mts +0 -4
- package/dist/node/lib/identities/isEthereumGasEtherscanPayload.d.mts.map +0 -1
- package/dist/node/lib/identities/isEthereumGasEtherscanPayload.d.ts +0 -4
- package/dist/node/lib/identities/isEthereumGasEtherscanPayload.d.ts.map +0 -1
- package/dist/node/lib/identities/isEthereumGasEthgasstationPayload.d.cts +0 -4
- package/dist/node/lib/identities/isEthereumGasEthgasstationPayload.d.cts.map +0 -1
- package/dist/node/lib/identities/isEthereumGasEthgasstationPayload.d.mts +0 -4
- package/dist/node/lib/identities/isEthereumGasEthgasstationPayload.d.mts.map +0 -1
- package/dist/node/lib/identities/isEthereumGasEthgasstationPayload.d.ts +0 -4
- package/dist/node/lib/identities/isEthereumGasEthgasstationPayload.d.ts.map +0 -1
- package/dist/node/lib/index.d.cts +0 -2
- package/dist/node/lib/index.d.cts.map +0 -1
- package/dist/node/lib/index.d.mts +0 -2
- package/dist/node/lib/index.d.mts.map +0 -1
- package/dist/node/lib/index.d.ts +0 -2
- package/dist/node/lib/index.d.ts.map +0 -1
- package/dist/node/lib/transforms/index.d.cts +0 -6
- package/dist/node/lib/transforms/index.d.cts.map +0 -1
- package/dist/node/lib/transforms/index.d.mts +0 -6
- package/dist/node/lib/transforms/index.d.mts.map +0 -1
- package/dist/node/lib/transforms/index.d.ts +0 -6
- package/dist/node/lib/transforms/index.d.ts.map +0 -1
- package/dist/node/lib/transforms/transformGasFromBlocknative.d.cts +0 -4
- package/dist/node/lib/transforms/transformGasFromBlocknative.d.cts.map +0 -1
- package/dist/node/lib/transforms/transformGasFromBlocknative.d.mts +0 -4
- package/dist/node/lib/transforms/transformGasFromBlocknative.d.mts.map +0 -1
- package/dist/node/lib/transforms/transformGasFromBlocknative.d.ts +0 -4
- package/dist/node/lib/transforms/transformGasFromBlocknative.d.ts.map +0 -1
- package/dist/node/lib/transforms/transformGasFromEtherchainV2.d.cts +0 -4
- package/dist/node/lib/transforms/transformGasFromEtherchainV2.d.cts.map +0 -1
- package/dist/node/lib/transforms/transformGasFromEtherchainV2.d.mts +0 -4
- package/dist/node/lib/transforms/transformGasFromEtherchainV2.d.mts.map +0 -1
- package/dist/node/lib/transforms/transformGasFromEtherchainV2.d.ts +0 -4
- package/dist/node/lib/transforms/transformGasFromEtherchainV2.d.ts.map +0 -1
- package/dist/node/lib/transforms/transformGasFromEthers.d.cts +0 -4
- package/dist/node/lib/transforms/transformGasFromEthers.d.cts.map +0 -1
- package/dist/node/lib/transforms/transformGasFromEthers.d.mts +0 -4
- package/dist/node/lib/transforms/transformGasFromEthers.d.mts.map +0 -1
- package/dist/node/lib/transforms/transformGasFromEthers.d.ts +0 -4
- package/dist/node/lib/transforms/transformGasFromEthers.d.ts.map +0 -1
- package/dist/node/lib/transforms/transformGasFromEtherscan.d.cts +0 -4
- package/dist/node/lib/transforms/transformGasFromEtherscan.d.cts.map +0 -1
- package/dist/node/lib/transforms/transformGasFromEtherscan.d.mts +0 -4
- package/dist/node/lib/transforms/transformGasFromEtherscan.d.mts.map +0 -1
- package/dist/node/lib/transforms/transformGasFromEtherscan.d.ts +0 -4
- package/dist/node/lib/transforms/transformGasFromEtherscan.d.ts.map +0 -1
- package/dist/node/lib/transforms/transformGasFromEthgasstation.d.cts +0 -4
- package/dist/node/lib/transforms/transformGasFromEthgasstation.d.cts.map +0 -1
- package/dist/node/lib/transforms/transformGasFromEthgasstation.d.mts +0 -4
- package/dist/node/lib/transforms/transformGasFromEthgasstation.d.mts.map +0 -1
- package/dist/node/lib/transforms/transformGasFromEthgasstation.d.ts +0 -4
- package/dist/node/lib/transforms/transformGasFromEthgasstation.d.ts.map +0 -1
- package/dist/node/test/index.d.cts +0 -6
- package/dist/node/test/index.d.cts.map +0 -1
- package/dist/node/test/index.d.mts +0 -6
- package/dist/node/test/index.d.mts.map +0 -1
- package/dist/node/test/index.d.ts +0 -6
- package/dist/node/test/index.d.ts.map +0 -1
- package/dist/node/test/sampleBlocknativeGas.d.cts +0 -3
- package/dist/node/test/sampleBlocknativeGas.d.cts.map +0 -1
- package/dist/node/test/sampleBlocknativeGas.d.mts +0 -3
- package/dist/node/test/sampleBlocknativeGas.d.mts.map +0 -1
- package/dist/node/test/sampleBlocknativeGas.d.ts +0 -3
- package/dist/node/test/sampleBlocknativeGas.d.ts.map +0 -1
- package/dist/node/test/sampleEtherchainGasV2.d.cts +0 -3
- package/dist/node/test/sampleEtherchainGasV2.d.cts.map +0 -1
- package/dist/node/test/sampleEtherchainGasV2.d.mts +0 -3
- package/dist/node/test/sampleEtherchainGasV2.d.mts.map +0 -1
- package/dist/node/test/sampleEtherchainGasV2.d.ts +0 -3
- package/dist/node/test/sampleEtherchainGasV2.d.ts.map +0 -1
- package/dist/node/test/sampleEthersGas.d.cts +0 -3
- package/dist/node/test/sampleEthersGas.d.cts.map +0 -1
- package/dist/node/test/sampleEthersGas.d.mts +0 -3
- package/dist/node/test/sampleEthersGas.d.mts.map +0 -1
- package/dist/node/test/sampleEthersGas.d.ts +0 -3
- package/dist/node/test/sampleEthersGas.d.ts.map +0 -1
- package/dist/node/test/sampleEtherscanGas.d.cts +0 -3
- package/dist/node/test/sampleEtherscanGas.d.cts.map +0 -1
- package/dist/node/test/sampleEtherscanGas.d.mts +0 -3
- package/dist/node/test/sampleEtherscanGas.d.mts.map +0 -1
- package/dist/node/test/sampleEtherscanGas.d.ts +0 -3
- package/dist/node/test/sampleEtherscanGas.d.ts.map +0 -1
- package/dist/node/test/sampleEthgasstationGas.d.cts +0 -3
- package/dist/node/test/sampleEthgasstationGas.d.cts.map +0 -1
- package/dist/node/test/sampleEthgasstationGas.d.mts +0 -3
- package/dist/node/test/sampleEthgasstationGas.d.mts.map +0 -1
- package/dist/node/test/sampleEthgasstationGas.d.ts +0 -3
- package/dist/node/test/sampleEthgasstationGas.d.ts.map +0 -1
package/dist/browser/index.cjs
DELETED
|
@@ -1,401 +0,0 @@
|
|
|
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 __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/index.ts
|
|
22
|
-
var src_exports = {};
|
|
23
|
-
__export(src_exports, {
|
|
24
|
-
EthereumGasDiviner: () => EthereumGasDiviner,
|
|
25
|
-
EthereumGasDivinerConfigSchema: () => EthereumGasDivinerConfigSchema,
|
|
26
|
-
EthereumGasDivinerQuerySchema: () => EthereumGasDivinerQuerySchema,
|
|
27
|
-
EthereumGasPlugin: () => EthereumGasPlugin,
|
|
28
|
-
default: () => EthereumGasPlugin
|
|
29
|
-
});
|
|
30
|
-
module.exports = __toCommonJS(src_exports);
|
|
31
|
-
|
|
32
|
-
// src/Diviner.ts
|
|
33
|
-
var import_diviner_abstract = require("@xyo-network/diviner-abstract");
|
|
34
|
-
var import_gas_price_payload_plugin2 = require("@xyo-network/gas-price-payload-plugin");
|
|
35
|
-
|
|
36
|
-
// src/lib/divineGas.ts
|
|
37
|
-
var import_gas_price_payload_plugin = require("@xyo-network/gas-price-payload-plugin");
|
|
38
|
-
var import_payload_builder = require("@xyo-network/payload-builder");
|
|
39
|
-
|
|
40
|
-
// src/lib/average.ts
|
|
41
|
-
var import_exists = require("@xylabs/exists");
|
|
42
|
-
var listAverage = /* @__PURE__ */ __name((x) => x?.length ? x.reduce((a, b) => a + b) / x.length : void 0, "listAverage");
|
|
43
|
-
var averageProperty = /* @__PURE__ */ __name((data, propertyExpression) => {
|
|
44
|
-
return listAverage(data.map(propertyExpression).filter(import_exists.exists));
|
|
45
|
-
}, "averageProperty");
|
|
46
|
-
var average = /* @__PURE__ */ __name((input) => {
|
|
47
|
-
const data = input?.filter(import_exists.exists) || [];
|
|
48
|
-
const averaged = {
|
|
49
|
-
baseFee: averageProperty(data, (x) => x.baseFee),
|
|
50
|
-
feePerGas: {
|
|
51
|
-
high: averageProperty(data, (x) => x.feePerGas.high),
|
|
52
|
-
low: averageProperty(data, (x) => x.feePerGas.low),
|
|
53
|
-
medium: averageProperty(data, (x) => x.feePerGas.medium),
|
|
54
|
-
veryHigh: averageProperty(data, (x) => x.feePerGas.veryHigh)
|
|
55
|
-
},
|
|
56
|
-
priorityFeePerGas: {
|
|
57
|
-
high: averageProperty(data, (x) => x.priorityFeePerGas.high),
|
|
58
|
-
low: averageProperty(data, (x) => x.priorityFeePerGas.low),
|
|
59
|
-
medium: averageProperty(data, (x) => x.priorityFeePerGas.medium),
|
|
60
|
-
veryHigh: averageProperty(data, (x) => x.priorityFeePerGas.veryHigh)
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
return averaged;
|
|
64
|
-
}, "average");
|
|
65
|
-
|
|
66
|
-
// src/lib/identities/isEthereumGasBlocknativePayload.ts
|
|
67
|
-
var import_blocknative_ethereum_gas_payload_plugin = require("@xyo-network/blocknative-ethereum-gas-payload-plugin");
|
|
68
|
-
var isEthereumGasBlocknativePayload = /* @__PURE__ */ __name((payload) => {
|
|
69
|
-
return payload?.schema === import_blocknative_ethereum_gas_payload_plugin.EthereumGasBlocknativeSchema;
|
|
70
|
-
}, "isEthereumGasBlocknativePayload");
|
|
71
|
-
|
|
72
|
-
// src/lib/identities/isEthereumGasEtherchainV2Payload.ts
|
|
73
|
-
var import_etherchain_gas_ethereum_blockchain_payload_plugins = require("@xyo-network/etherchain-gas-ethereum-blockchain-payload-plugins");
|
|
74
|
-
var isEthereumGasEtherchainV2Payload = /* @__PURE__ */ __name((payload) => {
|
|
75
|
-
return payload?.schema === import_etherchain_gas_ethereum_blockchain_payload_plugins.EthereumGasEtherchainV2Schema;
|
|
76
|
-
}, "isEthereumGasEtherchainV2Payload");
|
|
77
|
-
|
|
78
|
-
// src/lib/identities/isEthereumGasEtherscanPayload.ts
|
|
79
|
-
var import_etherscan_ethereum_gas_payload_plugin = require("@xyo-network/etherscan-ethereum-gas-payload-plugin");
|
|
80
|
-
var isEthereumGasEtherscanPayload = /* @__PURE__ */ __name((payload) => {
|
|
81
|
-
return payload?.schema === import_etherscan_ethereum_gas_payload_plugin.EthereumGasEtherscanSchema;
|
|
82
|
-
}, "isEthereumGasEtherscanPayload");
|
|
83
|
-
|
|
84
|
-
// src/lib/identities/isEthereumGasEthersPayload.ts
|
|
85
|
-
var import_ethers_ethereum_gas_payload_plugin = require("@xyo-network/ethers-ethereum-gas-payload-plugin");
|
|
86
|
-
var isEthereumGasEthersPayload = /* @__PURE__ */ __name((payload) => {
|
|
87
|
-
return payload?.schema === import_ethers_ethereum_gas_payload_plugin.EthereumGasEthersSchema;
|
|
88
|
-
}, "isEthereumGasEthersPayload");
|
|
89
|
-
|
|
90
|
-
// src/lib/identities/isEthereumGasEthgasstationPayload.ts
|
|
91
|
-
var import_ethgasstation_ethereum_gas_payload_plugin = require("@xyo-network/ethgasstation-ethereum-gas-payload-plugin");
|
|
92
|
-
var isEthereumGasEthgasstationPayload = /* @__PURE__ */ __name((payload) => {
|
|
93
|
-
return payload?.schema === import_ethgasstation_ethereum_gas_payload_plugin.EthereumGasEthgasstationSchema;
|
|
94
|
-
}, "isEthereumGasEthgasstationPayload");
|
|
95
|
-
|
|
96
|
-
// src/lib/transforms/transformGasFromBlocknative.ts
|
|
97
|
-
var import_regression = require("regression");
|
|
98
|
-
var getBaseFee = /* @__PURE__ */ __name((payload) => {
|
|
99
|
-
return payload?.blockPrices?.[0]?.baseFeePerGas;
|
|
100
|
-
}, "getBaseFee");
|
|
101
|
-
var getFeePerGas = /* @__PURE__ */ __name((payload) => {
|
|
102
|
-
const sorted = payload.blockPrices?.[0].estimatedPrices?.sort((a, b) => a.confidence - b.confidence);
|
|
103
|
-
const trend = (0, import_regression.linear)([
|
|
104
|
-
[
|
|
105
|
-
0,
|
|
106
|
-
sorted?.[0].price
|
|
107
|
-
],
|
|
108
|
-
[
|
|
109
|
-
1,
|
|
110
|
-
sorted?.[1].price
|
|
111
|
-
],
|
|
112
|
-
[
|
|
113
|
-
2,
|
|
114
|
-
sorted?.[2].price
|
|
115
|
-
],
|
|
116
|
-
[
|
|
117
|
-
3,
|
|
118
|
-
sorted?.[3].price
|
|
119
|
-
],
|
|
120
|
-
[
|
|
121
|
-
4,
|
|
122
|
-
sorted?.[4].price
|
|
123
|
-
]
|
|
124
|
-
]);
|
|
125
|
-
const feePerGas = {
|
|
126
|
-
low: trend.predict(0.5)[1],
|
|
127
|
-
medium: trend.predict(1.5)[1],
|
|
128
|
-
high: trend.predict(2.5)[1],
|
|
129
|
-
veryHigh: trend.predict(3.5)[1]
|
|
130
|
-
};
|
|
131
|
-
return feePerGas;
|
|
132
|
-
}, "getFeePerGas");
|
|
133
|
-
var getPriorityFeePerGas = /* @__PURE__ */ __name((payload) => {
|
|
134
|
-
const sorted = payload.blockPrices?.[0].estimatedPrices?.sort((a, b) => a.confidence - b.confidence);
|
|
135
|
-
const trend = (0, import_regression.linear)([
|
|
136
|
-
[
|
|
137
|
-
0,
|
|
138
|
-
sorted?.[0].maxPriorityFeePerGas
|
|
139
|
-
],
|
|
140
|
-
[
|
|
141
|
-
1,
|
|
142
|
-
sorted?.[1].maxPriorityFeePerGas
|
|
143
|
-
],
|
|
144
|
-
[
|
|
145
|
-
2,
|
|
146
|
-
sorted?.[2].maxPriorityFeePerGas
|
|
147
|
-
],
|
|
148
|
-
[
|
|
149
|
-
3,
|
|
150
|
-
sorted?.[3].maxPriorityFeePerGas
|
|
151
|
-
],
|
|
152
|
-
[
|
|
153
|
-
4,
|
|
154
|
-
sorted?.[4].maxPriorityFeePerGas
|
|
155
|
-
]
|
|
156
|
-
]);
|
|
157
|
-
const priorityFeePerGas = {
|
|
158
|
-
low: trend.predict(0.5)[1],
|
|
159
|
-
medium: trend.predict(1.5)[1],
|
|
160
|
-
high: trend.predict(2.5)[1],
|
|
161
|
-
veryHigh: trend.predict(3.5)[1]
|
|
162
|
-
};
|
|
163
|
-
return priorityFeePerGas;
|
|
164
|
-
}, "getPriorityFeePerGas");
|
|
165
|
-
var transformGasFromBlocknative = /* @__PURE__ */ __name((payload) => {
|
|
166
|
-
const baseFee = getBaseFee(payload);
|
|
167
|
-
const feePerGas = getFeePerGas(payload);
|
|
168
|
-
const priorityFeePerGas = getPriorityFeePerGas(payload);
|
|
169
|
-
return {
|
|
170
|
-
baseFee,
|
|
171
|
-
feePerGas,
|
|
172
|
-
priorityFeePerGas
|
|
173
|
-
};
|
|
174
|
-
}, "transformGasFromBlocknative");
|
|
175
|
-
|
|
176
|
-
// src/lib/transforms/transformGasFromEtherchainV2.ts
|
|
177
|
-
var getFeePerGas2 = /* @__PURE__ */ __name((payload) => {
|
|
178
|
-
const { slow, standard, fast, rapid } = payload.data;
|
|
179
|
-
const low = slow / 1e9;
|
|
180
|
-
const medium = standard / 1e9;
|
|
181
|
-
const high = fast / 1e9;
|
|
182
|
-
const veryHigh = rapid / 1e9;
|
|
183
|
-
return {
|
|
184
|
-
high,
|
|
185
|
-
low,
|
|
186
|
-
medium,
|
|
187
|
-
veryHigh
|
|
188
|
-
};
|
|
189
|
-
}, "getFeePerGas");
|
|
190
|
-
var transformGasFromEtherchainV2 = /* @__PURE__ */ __name((payload) => {
|
|
191
|
-
const baseFee = void 0;
|
|
192
|
-
const feePerGas = getFeePerGas2(payload);
|
|
193
|
-
const priorityFeePerGas = {};
|
|
194
|
-
return {
|
|
195
|
-
baseFee,
|
|
196
|
-
feePerGas,
|
|
197
|
-
priorityFeePerGas
|
|
198
|
-
};
|
|
199
|
-
}, "transformGasFromEtherchainV2");
|
|
200
|
-
|
|
201
|
-
// src/lib/transforms/transformGasFromEthers.ts
|
|
202
|
-
var getBaseFee2 = /* @__PURE__ */ __name((payload) => {
|
|
203
|
-
const { gasPrice } = payload;
|
|
204
|
-
return gasPrice ? gasPrice / 1e9 : void 0;
|
|
205
|
-
}, "getBaseFee");
|
|
206
|
-
var getFeePerGas3 = /* @__PURE__ */ __name((payload) => {
|
|
207
|
-
const { maxFeePerGas } = payload;
|
|
208
|
-
const high = maxFeePerGas ? maxFeePerGas / 1e9 : void 0;
|
|
209
|
-
return {
|
|
210
|
-
high
|
|
211
|
-
};
|
|
212
|
-
}, "getFeePerGas");
|
|
213
|
-
var getPriorityFeePerGas2 = /* @__PURE__ */ __name((payload) => {
|
|
214
|
-
const { maxPriorityFeePerGas } = payload;
|
|
215
|
-
const high = maxPriorityFeePerGas ? maxPriorityFeePerGas / 1e9 : void 0;
|
|
216
|
-
return {
|
|
217
|
-
high
|
|
218
|
-
};
|
|
219
|
-
}, "getPriorityFeePerGas");
|
|
220
|
-
var transformGasFromEthers = /* @__PURE__ */ __name((payload) => {
|
|
221
|
-
const baseFee = getBaseFee2(payload);
|
|
222
|
-
const feePerGas = getFeePerGas3(payload);
|
|
223
|
-
const priorityFeePerGas = getPriorityFeePerGas2(payload);
|
|
224
|
-
return {
|
|
225
|
-
baseFee,
|
|
226
|
-
feePerGas,
|
|
227
|
-
priorityFeePerGas
|
|
228
|
-
};
|
|
229
|
-
}, "transformGasFromEthers");
|
|
230
|
-
|
|
231
|
-
// src/lib/transforms/transformGasFromEtherscan.ts
|
|
232
|
-
var import_regression2 = require("regression");
|
|
233
|
-
var getBaseFee3 = /* @__PURE__ */ __name((payload) => {
|
|
234
|
-
const { suggestBaseFee } = payload.result;
|
|
235
|
-
return Number.parseFloat(suggestBaseFee);
|
|
236
|
-
}, "getBaseFee");
|
|
237
|
-
var getFeePerGas4 = /* @__PURE__ */ __name((payload) => {
|
|
238
|
-
const { FastGasPrice, ProposeGasPrice, SafeGasPrice } = payload.result;
|
|
239
|
-
const low = Number.parseFloat(SafeGasPrice);
|
|
240
|
-
const medium = Number.parseFloat(ProposeGasPrice);
|
|
241
|
-
const high = Number.parseFloat(FastGasPrice);
|
|
242
|
-
const veryHigh = (0, import_regression2.linear)([
|
|
243
|
-
[
|
|
244
|
-
0,
|
|
245
|
-
low
|
|
246
|
-
],
|
|
247
|
-
[
|
|
248
|
-
1,
|
|
249
|
-
medium
|
|
250
|
-
],
|
|
251
|
-
[
|
|
252
|
-
2,
|
|
253
|
-
high
|
|
254
|
-
]
|
|
255
|
-
]).predict(3)[1];
|
|
256
|
-
return {
|
|
257
|
-
high,
|
|
258
|
-
low,
|
|
259
|
-
medium,
|
|
260
|
-
veryHigh
|
|
261
|
-
};
|
|
262
|
-
}, "getFeePerGas");
|
|
263
|
-
var transformGasFromEtherscan = /* @__PURE__ */ __name((payload) => {
|
|
264
|
-
const baseFee = getBaseFee3(payload);
|
|
265
|
-
const feePerGas = getFeePerGas4(payload);
|
|
266
|
-
const priorityFeePerGas = {};
|
|
267
|
-
return {
|
|
268
|
-
baseFee,
|
|
269
|
-
feePerGas,
|
|
270
|
-
priorityFeePerGas
|
|
271
|
-
};
|
|
272
|
-
}, "transformGasFromEtherscan");
|
|
273
|
-
|
|
274
|
-
// src/lib/transforms/transformGasFromEthgasstation.ts
|
|
275
|
-
var import_regression3 = require("regression");
|
|
276
|
-
var getBaseFee4 = /* @__PURE__ */ __name((payload) => {
|
|
277
|
-
const { baseFee } = payload;
|
|
278
|
-
return baseFee;
|
|
279
|
-
}, "getBaseFee");
|
|
280
|
-
var getFeePerGas5 = /* @__PURE__ */ __name((payload) => {
|
|
281
|
-
const { standard: medium, fast: high, instant: veryHigh } = payload.gasPrice;
|
|
282
|
-
const trend = (0, import_regression3.linear)([
|
|
283
|
-
[
|
|
284
|
-
1,
|
|
285
|
-
medium
|
|
286
|
-
],
|
|
287
|
-
[
|
|
288
|
-
2,
|
|
289
|
-
high
|
|
290
|
-
],
|
|
291
|
-
[
|
|
292
|
-
3,
|
|
293
|
-
veryHigh
|
|
294
|
-
]
|
|
295
|
-
]);
|
|
296
|
-
const low = trend.predict(0)[1];
|
|
297
|
-
return {
|
|
298
|
-
low,
|
|
299
|
-
medium,
|
|
300
|
-
high,
|
|
301
|
-
veryHigh
|
|
302
|
-
};
|
|
303
|
-
}, "getFeePerGas");
|
|
304
|
-
var getPriorityFeePerGas3 = /* @__PURE__ */ __name((payload) => {
|
|
305
|
-
const { standard: medium, fast: high, instant: veryHigh } = payload.priorityFee;
|
|
306
|
-
const trend = (0, import_regression3.linear)([
|
|
307
|
-
[
|
|
308
|
-
1,
|
|
309
|
-
medium
|
|
310
|
-
],
|
|
311
|
-
[
|
|
312
|
-
2,
|
|
313
|
-
high
|
|
314
|
-
],
|
|
315
|
-
[
|
|
316
|
-
3,
|
|
317
|
-
veryHigh
|
|
318
|
-
]
|
|
319
|
-
]);
|
|
320
|
-
const low = trend.predict(0)[1];
|
|
321
|
-
return {
|
|
322
|
-
low,
|
|
323
|
-
medium,
|
|
324
|
-
high,
|
|
325
|
-
veryHigh
|
|
326
|
-
};
|
|
327
|
-
}, "getPriorityFeePerGas");
|
|
328
|
-
var transformGasFromEthgasstation = /* @__PURE__ */ __name((payload) => {
|
|
329
|
-
const baseFee = getBaseFee4(payload);
|
|
330
|
-
const feePerGas = getFeePerGas5(payload);
|
|
331
|
-
const priorityFeePerGas = getPriorityFeePerGas3(payload);
|
|
332
|
-
return {
|
|
333
|
-
baseFee,
|
|
334
|
-
feePerGas,
|
|
335
|
-
priorityFeePerGas
|
|
336
|
-
};
|
|
337
|
-
}, "transformGasFromEthgasstation");
|
|
338
|
-
|
|
339
|
-
// src/lib/divineGas.ts
|
|
340
|
-
var divineGas = /* @__PURE__ */ __name(async (payloads) => {
|
|
341
|
-
const blocknative = payloads.filter(isEthereumGasBlocknativePayload).map(transformGasFromBlocknative);
|
|
342
|
-
const etherchainV2 = payloads.filter(isEthereumGasEtherchainV2Payload).map(transformGasFromEtherchainV2);
|
|
343
|
-
const ethers = payloads.filter(isEthereumGasEthersPayload).map(transformGasFromEthers);
|
|
344
|
-
const etherscan = payloads.filter(isEthereumGasEtherscanPayload).map(transformGasFromEtherscan);
|
|
345
|
-
const ethgasstation = payloads.filter(isEthereumGasEthgasstationPayload).map(transformGasFromEthgasstation);
|
|
346
|
-
const transactionCosts = [
|
|
347
|
-
...blocknative,
|
|
348
|
-
...etherchainV2,
|
|
349
|
-
...ethers,
|
|
350
|
-
...etherscan,
|
|
351
|
-
...ethgasstation
|
|
352
|
-
];
|
|
353
|
-
const avg = average(transactionCosts);
|
|
354
|
-
const timestamp = Date.now();
|
|
355
|
-
const payload = await new import_payload_builder.PayloadBuilder({
|
|
356
|
-
schema: import_gas_price_payload_plugin.EthereumGasSchema
|
|
357
|
-
}).fields({
|
|
358
|
-
...avg,
|
|
359
|
-
timestamp
|
|
360
|
-
}).build();
|
|
361
|
-
return payload;
|
|
362
|
-
}, "divineGas");
|
|
363
|
-
|
|
364
|
-
// src/Schema.ts
|
|
365
|
-
var EthereumGasDivinerQuerySchema = "network.xyo.blockchain.ethereum.gas.diviner.query";
|
|
366
|
-
var EthereumGasDivinerConfigSchema = "network.xyo.blockchain.ethereum.gas.diviner.config";
|
|
367
|
-
|
|
368
|
-
// src/Diviner.ts
|
|
369
|
-
var EthereumGasDiviner = class extends import_diviner_abstract.AbstractDiviner {
|
|
370
|
-
static {
|
|
371
|
-
__name(this, "EthereumGasDiviner");
|
|
372
|
-
}
|
|
373
|
-
static configSchemas = [
|
|
374
|
-
...super.configSchemas,
|
|
375
|
-
EthereumGasDivinerConfigSchema
|
|
376
|
-
];
|
|
377
|
-
static defaultConfigSchema = EthereumGasDivinerConfigSchema;
|
|
378
|
-
static targetSchema = import_gas_price_payload_plugin2.EthereumGasSchema;
|
|
379
|
-
async divineHandler(payloads) {
|
|
380
|
-
const cost = await divineGas(payloads ?? []);
|
|
381
|
-
return [
|
|
382
|
-
cost
|
|
383
|
-
];
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
|
-
|
|
387
|
-
// src/Plugin.ts
|
|
388
|
-
var import_gas_price_payload_plugin3 = require("@xyo-network/gas-price-payload-plugin");
|
|
389
|
-
var import_payload_model = require("@xyo-network/payload-model");
|
|
390
|
-
var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
|
|
391
|
-
var EthereumGasPlugin = /* @__PURE__ */ __name(() => (0, import_payloadset_plugin.createPayloadSetDivinerPlugin)({
|
|
392
|
-
required: {
|
|
393
|
-
[import_gas_price_payload_plugin3.EthereumGasSchema]: 1
|
|
394
|
-
},
|
|
395
|
-
schema: import_payload_model.PayloadSetSchema
|
|
396
|
-
}, {
|
|
397
|
-
diviner: /* @__PURE__ */ __name(async (params) => {
|
|
398
|
-
return await EthereumGasDiviner.create(params);
|
|
399
|
-
}, "diviner")
|
|
400
|
-
}), "EthereumGasPlugin");
|
|
401
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Diviner.ts","../../src/lib/divineGas.ts","../../src/lib/average.ts","../../src/lib/identities/isEthereumGasBlocknativePayload.ts","../../src/lib/identities/isEthereumGasEtherchainV2Payload.ts","../../src/lib/identities/isEthereumGasEtherscanPayload.ts","../../src/lib/identities/isEthereumGasEthersPayload.ts","../../src/lib/identities/isEthereumGasEthgasstationPayload.ts","../../src/lib/transforms/transformGasFromBlocknative.ts","../../src/lib/transforms/transformGasFromEtherchainV2.ts","../../src/lib/transforms/transformGasFromEthers.ts","../../src/lib/transforms/transformGasFromEtherscan.ts","../../src/lib/transforms/transformGasFromEthgasstation.ts","../../src/Schema.ts","../../src/Plugin.ts"],"sourcesContent":["export * from './Diviner.ts'\n// eslint-disable-next-line import/no-default-export\nexport { EthereumGasPlugin as default, EthereumGasPlugin } from './Plugin.ts'\nexport * from './Schema.ts'\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerConfig, DivinerModule, DivinerParams } from '@xyo-network/diviner-model'\nimport { EthereumGasSchema } from '@xyo-network/gas-price-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload, Schema } from '@xyo-network/payload-model'\n\nimport { divineGas } from './lib/index.ts'\nimport { EthereumGasDivinerConfigSchema } from './Schema.ts'\n\nexport type EthereumGasDivinerConfig = DivinerConfig<{ schema: EthereumGasDivinerConfigSchema }>\nexport type EthereumGasDivinerParams = DivinerParams<AnyConfigSchema<EthereumGasDivinerConfig>>\n\nexport class EthereumGasDiviner<TParams extends EthereumGasDivinerParams = EthereumGasDivinerParams>\n extends AbstractDiviner<TParams>\n implements DivinerModule {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasDivinerConfigSchema\n static override targetSchema: string = EthereumGasSchema\n\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const cost = await divineGas(payloads ?? [])\n return [cost]\n }\n}\n","import { EthereumGasPayload, EthereumGasSchema, FeeData } from '@xyo-network/gas-price-payload-plugin'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { average } from './average.ts'\nimport {\n isEthereumGasBlocknativePayload,\n isEthereumGasEtherchainV2Payload,\n isEthereumGasEtherscanPayload,\n isEthereumGasEthersPayload,\n isEthereumGasEthgasstationPayload,\n} from './identities/index.ts'\nimport {\n transformGasFromBlocknative,\n transformGasFromEtherchainV2,\n transformGasFromEthers,\n transformGasFromEtherscan,\n transformGasFromEthgasstation,\n} from './transforms/index.ts'\n\nexport const divineGas = async (payloads: Payload[]): Promise<EthereumGasPayload> => {\n const blocknative = payloads.filter(isEthereumGasBlocknativePayload).map(transformGasFromBlocknative)\n const etherchainV2 = payloads.filter(isEthereumGasEtherchainV2Payload).map(transformGasFromEtherchainV2)\n const ethers = payloads.filter(isEthereumGasEthersPayload).map(transformGasFromEthers)\n const etherscan = payloads.filter(isEthereumGasEtherscanPayload).map(transformGasFromEtherscan)\n const ethgasstation = payloads.filter(isEthereumGasEthgasstationPayload).map(transformGasFromEthgasstation)\n const transactionCosts: FeeData[] = [...blocknative, ...etherchainV2, ...ethers, ...etherscan, ...ethgasstation]\n const avg = average(transactionCosts)\n const timestamp = Date.now()\n const payload = await new PayloadBuilder<EthereumGasPayload>({ schema: EthereumGasSchema }).fields({ ...avg, timestamp }).build()\n return payload\n}\n","import { exists } from '@xylabs/exists'\nimport { FeeData } from '@xyo-network/gas-price-payload-plugin'\n\n/**\n * Averages an array of numbers\n * @param x Averages an array of numbers\n * @returns The average of the array of numbers or undefined if the\n * array is empty or undefined\n */\nconst listAverage = (x?: number[]) => (x?.length ? x.reduce((a, b) => a + b) / x.length : undefined)\n\n/**\n * Averages the property indicates by the supplied property\n * expression across the array of FeeData\n * @param data The array of data to average\n * @param propertyExpression The expression for the property to\n * average\n * @returns The average of the supplied property across the array\n */\nconst averageProperty = (data: FeeData[], propertyExpression: (x: FeeData) => number | undefined) => {\n return listAverage(data.map(propertyExpression).filter(exists))\n}\n\n/**\n * Averages the supplied FeeData\n * @param input An array of FeeData or undefined\n * @returns The average of the supplied FeeData\n */\nexport const average = (input?: (FeeData | undefined)[]): FeeData => {\n const data = input?.filter(exists) || []\n const averaged: FeeData = {\n baseFee: averageProperty(data, x => x.baseFee),\n feePerGas: {\n high: averageProperty(data, x => x.feePerGas.high),\n low: averageProperty(data, x => x.feePerGas.low),\n medium: averageProperty(data, x => x.feePerGas.medium),\n veryHigh: averageProperty(data, x => x.feePerGas.veryHigh),\n },\n priorityFeePerGas: {\n high: averageProperty(data, x => x.priorityFeePerGas.high),\n low: averageProperty(data, x => x.priorityFeePerGas.low),\n medium: averageProperty(data, x => x.priorityFeePerGas.medium),\n veryHigh: averageProperty(data, x => x.priorityFeePerGas.veryHigh),\n },\n }\n return averaged\n}\n","import { EthereumGasBlocknativePayload, EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport const isEthereumGasBlocknativePayload = (payload?: Payload | null): payload is EthereumGasBlocknativePayload => {\n return payload?.schema === EthereumGasBlocknativeSchema\n}\n","import { EthereumGasEtherchainV2Payload, EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-gas-ethereum-blockchain-payload-plugins'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport const isEthereumGasEtherchainV2Payload = (payload?: Payload | null): payload is EthereumGasEtherchainV2Payload => {\n return payload?.schema === EthereumGasEtherchainV2Schema\n}\n","import { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport const isEthereumGasEtherscanPayload = (payload?: Payload | null): payload is EthereumGasEtherscanPayload => {\n return payload?.schema === EthereumGasEtherscanSchema\n}\n","import { EthereumGasEthersPayload, EthereumGasEthersSchema } from '@xyo-network/ethers-ethereum-gas-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport const isEthereumGasEthersPayload = (payload?: Payload | null): payload is EthereumGasEthersPayload => {\n return payload?.schema === EthereumGasEthersSchema\n}\n","import { EthereumGasEthgasstationPayload, EthereumGasEthgasstationSchema } from '@xyo-network/ethgasstation-ethereum-gas-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport const isEthereumGasEthgasstationPayload = (payload?: Payload | null): payload is EthereumGasEthgasstationPayload => {\n return payload?.schema === EthereumGasEthgasstationSchema\n}\n","import { EthereumGasBlocknativePayload } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { FeeData, FeePerGas, PriorityFeePerGas } from '@xyo-network/gas-price-payload-plugin'\nimport { linear } from 'regression'\n\nconst getBaseFee = (payload: EthereumGasBlocknativePayload): number | undefined => {\n return payload?.blockPrices?.[0]?.baseFeePerGas\n}\n\nconst getFeePerGas = (payload: EthereumGasBlocknativePayload): Partial<FeePerGas> => {\n const sorted = payload.blockPrices?.[0].estimatedPrices?.sort((a, b) => a.confidence - b.confidence)\n const trend = linear([\n [0, sorted?.[0].price],\n [1, sorted?.[1].price],\n [2, sorted?.[2].price],\n [3, sorted?.[3].price],\n [4, sorted?.[4].price],\n ])\n const feePerGas: FeePerGas = {\n low: trend.predict(0.5)[1],\n medium: trend.predict(1.5)[1],\n high: trend.predict(2.5)[1],\n veryHigh: trend.predict(3.5)[1],\n }\n return feePerGas\n}\n\nconst getPriorityFeePerGas = (payload: EthereumGasBlocknativePayload): Partial<PriorityFeePerGas> => {\n const sorted = payload.blockPrices?.[0].estimatedPrices?.sort((a, b) => a.confidence - b.confidence)\n const trend = linear([\n [0, sorted?.[0].maxPriorityFeePerGas],\n [1, sorted?.[1].maxPriorityFeePerGas],\n [2, sorted?.[2].maxPriorityFeePerGas],\n [3, sorted?.[3].maxPriorityFeePerGas],\n [4, sorted?.[4].maxPriorityFeePerGas],\n ])\n const priorityFeePerGas: PriorityFeePerGas = {\n low: trend.predict(0.5)[1],\n medium: trend.predict(1.5)[1],\n high: trend.predict(2.5)[1],\n veryHigh: trend.predict(3.5)[1],\n }\n return priorityFeePerGas\n}\n\nexport const transformGasFromBlocknative = (payload: EthereumGasBlocknativePayload): FeeData => {\n const baseFee = getBaseFee(payload)\n const feePerGas = getFeePerGas(payload)\n const priorityFeePerGas = getPriorityFeePerGas(payload)\n return { baseFee, feePerGas, priorityFeePerGas }\n}\n","import { EthereumGasEtherchainV2Payload } from '@xyo-network/etherchain-gas-ethereum-blockchain-payload-plugins'\nimport { FeeData, FeePerGas } from '@xyo-network/gas-price-payload-plugin'\n\nconst getFeePerGas = (payload: EthereumGasEtherchainV2Payload): Partial<FeePerGas> => {\n const { slow, standard, fast, rapid } = payload.data\n const low = slow / 1_000_000_000\n const medium = standard / 1_000_000_000\n const high = fast / 1_000_000_000\n const veryHigh = rapid / 1_000_000_000\n return { high, low, medium, veryHigh }\n}\n\nexport const transformGasFromEtherchainV2 = (payload: EthereumGasEtherchainV2Payload): FeeData => {\n const baseFee = undefined\n const feePerGas = getFeePerGas(payload)\n const priorityFeePerGas = {}\n return { baseFee, feePerGas, priorityFeePerGas }\n}\n","import { EthereumGasEthersPayload } from '@xyo-network/ethers-ethereum-gas-payload-plugin'\nimport { FeeData, FeePerGas, PriorityFeePerGas } from '@xyo-network/gas-price-payload-plugin'\n\nconst getBaseFee = (payload: EthereumGasEthersPayload): number | undefined => {\n const { gasPrice } = payload\n return gasPrice ? gasPrice / 1_000_000_000 : undefined\n}\n\nconst getFeePerGas = (payload: EthereumGasEthersPayload): Partial<FeePerGas> => {\n const { maxFeePerGas } = payload\n const high = maxFeePerGas ? maxFeePerGas / 1_000_000_000 : undefined\n return { high }\n}\n\nconst getPriorityFeePerGas = (payload: EthereumGasEthersPayload): Partial<PriorityFeePerGas> => {\n const { maxPriorityFeePerGas } = payload\n const high = maxPriorityFeePerGas ? maxPriorityFeePerGas / 1_000_000_000 : undefined\n return { high }\n}\n\nexport const transformGasFromEthers = (payload: EthereumGasEthersPayload): FeeData => {\n const baseFee = getBaseFee(payload)\n const feePerGas = getFeePerGas(payload)\n const priorityFeePerGas = getPriorityFeePerGas(payload)\n return { baseFee, feePerGas, priorityFeePerGas }\n}\n","import { EthereumGasEtherscanPayload } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { FeeData, FeePerGas } from '@xyo-network/gas-price-payload-plugin'\nimport { linear } from 'regression'\n\nconst getBaseFee = (payload: EthereumGasEtherscanPayload): number | undefined => {\n const { suggestBaseFee } = payload.result\n return Number.parseFloat(suggestBaseFee)\n}\n\nconst getFeePerGas = (payload: EthereumGasEtherscanPayload): Partial<FeePerGas> => {\n const { FastGasPrice, ProposeGasPrice, SafeGasPrice } = payload.result\n const low = Number.parseFloat(SafeGasPrice)\n const medium = Number.parseFloat(ProposeGasPrice)\n const high = Number.parseFloat(FastGasPrice)\n const veryHigh = linear([\n [0, low],\n [1, medium],\n [2, high],\n ]).predict(3)[1]\n return { high, low, medium, veryHigh }\n}\n\nexport const transformGasFromEtherscan = (payload: EthereumGasEtherscanPayload): FeeData => {\n const baseFee = getBaseFee(payload)\n const feePerGas = getFeePerGas(payload)\n const priorityFeePerGas = {}\n return { baseFee, feePerGas, priorityFeePerGas }\n}\n","import { EthereumGasEthgasstationPayload } from '@xyo-network/ethgasstation-ethereum-gas-payload-plugin'\nimport { FeeData, FeePerGas, PriorityFeePerGas } from '@xyo-network/gas-price-payload-plugin'\nimport { linear } from 'regression'\n\nconst getBaseFee = (payload: EthereumGasEthgasstationPayload): number | undefined => {\n const { baseFee } = payload\n return baseFee\n}\n\nconst getFeePerGas = (payload: EthereumGasEthgasstationPayload): Partial<FeePerGas> => {\n const { standard: medium, fast: high, instant: veryHigh } = payload.gasPrice\n const trend = linear([\n [1, medium],\n [2, high],\n [3, veryHigh],\n ])\n const low = trend.predict(0)[1]\n return { low, medium, high, veryHigh }\n}\n\nconst getPriorityFeePerGas = (payload: EthereumGasEthgasstationPayload): Partial<PriorityFeePerGas> => {\n const { standard: medium, fast: high, instant: veryHigh } = payload.priorityFee\n const trend = linear([\n [1, medium],\n [2, high],\n [3, veryHigh],\n ])\n const low = trend.predict(0)[1]\n return { low, medium, high, veryHigh }\n}\n\nexport const transformGasFromEthgasstation = (payload: EthereumGasEthgasstationPayload): FeeData => {\n const baseFee = getBaseFee(payload)\n const feePerGas = getFeePerGas(payload)\n const priorityFeePerGas = getPriorityFeePerGas(payload)\n return { baseFee, feePerGas, priorityFeePerGas }\n}\n","export type EthereumGasDivinerQuerySchema = 'network.xyo.blockchain.ethereum.gas.diviner.query'\nexport const EthereumGasDivinerQuerySchema: EthereumGasDivinerQuerySchema = 'network.xyo.blockchain.ethereum.gas.diviner.query'\n\nexport type EthereumGasDivinerConfigSchema = 'network.xyo.blockchain.ethereum.gas.diviner.config'\nexport const EthereumGasDivinerConfigSchema: EthereumGasDivinerConfigSchema = 'network.xyo.blockchain.ethereum.gas.diviner.config'\n","import { EthereumGasSchema } from '@xyo-network/gas-price-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetDivinerPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasDiviner } from './Diviner.ts'\n\nexport const EthereumGasPlugin = () =>\n createPayloadSetDivinerPlugin<EthereumGasDiviner>(\n { required: { [EthereumGasSchema]: 1 }, schema: PayloadSetSchema },\n {\n diviner: async (params) => {\n return (await EthereumGasDiviner.create(params)) as EthereumGasDiviner\n },\n },\n )\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;ACAA,8BAAgC;AAEhC,IAAAA,mCAAkC;;;ACFlC,sCAA+D;AAC/D,6BAA+B;;;ACD/B,oBAAuB;AASvB,IAAMC,cAAc,wBAACC,MAAkBA,GAAGC,SAASD,EAAEE,OAAO,CAACC,GAAGC,MAAMD,IAAIC,CAAAA,IAAKJ,EAAEC,SAASI,QAAtE;AAUpB,IAAMC,kBAAkB,wBAACC,MAAiBC,uBAAAA;AACxC,SAAOT,YAAYQ,KAAKE,IAAID,kBAAAA,EAAoBE,OAAOC,oBAAAA,CAAAA;AACzD,GAFwB;AASjB,IAAMC,UAAU,wBAACC,UAAAA;AACtB,QAAMN,OAAOM,OAAOH,OAAOC,oBAAAA,KAAW,CAAA;AACtC,QAAMG,WAAoB;IACxBC,SAAST,gBAAgBC,MAAMP,CAAAA,MAAKA,EAAEe,OAAO;IAC7CC,WAAW;MACTC,MAAMX,gBAAgBC,MAAMP,CAAAA,MAAKA,EAAEgB,UAAUC,IAAI;MACjDC,KAAKZ,gBAAgBC,M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BC,gBAA0B;OAAI,MAAMA;IAAeC;;EAC5E,OAAyBC,sBAA8BD;EACvD,OAAgBE,eAAuBC;EAEvC,MAAyBC,cAAcC,UAA0C;AAC/E,UAAMC,OAAO,MAAMC,UAAUF,YAAY,CAAA,CAAE;AAC3C,WAAO;MAACC;;EACV;AACF;;;AcvBA,IAAAE,mCAAkC;AAClC,2BAAiC;AACjC,+BAA8C;AAIvC,IAAMC,oBAAoB,iCAC/BC,wDACE;EAAEC,UAAU;IAAE,CAACC,kDAAAA,GAAoB;EAAE;EAAGC,QAAQC;AAAiB,GACjE;EACEC,SAAS,8BAAOC,WAAAA;AACd,WAAQ,MAAMC,mBAAmBC,OAAOF,MAAAA;EAC1C,GAFS;AAGX,CAAA,GAP6B;","names":["import_gas_price_payload_plugin","listAverage","x","length","reduce","a","b","undefined","averageProperty","data","propertyExpression","map","filter","exists","average","input","averaged","baseFee","feePerGas","high","low","medium","veryHigh","priorityFeePerGas","isEthereumGasBlocknativePayload","payload","schema","EthereumGasBlocknativeSchema","isEthereumGasEtherchainV2Payload","payload","schema","EthereumGasEtherchainV2Schema","isEthereumGasEtherscanPayload","payload","schema","EthereumGasEtherscanSchema","isEthereumGasEthersPayload","payload","schema","EthereumGasEthersSchema","isEthereumGasEthgasstationPayload","payload","schema","EthereumGasEthgasstationSchema","getBaseFee","payload","blockPrices","baseFeePerGas","getFeePerGas","sorted","estimatedPrices","sort","a","b","confidence","trend","linear","price","feePerGas","low","predict","medium","high","veryHigh","getPriorityFeePerGas","maxPriorityFeePerGas","priorityFeePerGas","transformGasFromBlocknative","baseFee","getFeePerGas","payload","slow","standard","fast","rapid","data","low","medium","high","veryHigh","transformGasFromEtherchainV2","baseFee","undefined","feePerGas","priorityFeePerGas","getBaseFee","payload","gasPrice","undefined","getFeePerGas","maxFeePerGas","high","getPriorityFeePerGas","maxPriorityFeePerGas","transformGasFromEthers","baseFee","feePerGas","priorityFeePerGas","import_regression","getBaseFee","payload","suggestBaseFee","result","Number","parseFloat","getFeePerGas","FastGasPrice","ProposeGasPrice","SafeGasPrice","low","medium","high","veryHigh","linear","predict","transformGasFromEtherscan","baseFee","feePerGas","priorityFeePerGas","import_regression","getBaseFee","payload","baseFee","getFeePerGas","standard","medium","fast","high","instant","veryHigh","gasPrice","trend","linear","low","predict","getPriorityFeePerGas","priorityFee","transformGasFromEthgasstation","feePerGas","priorityFeePerGas","divineGas","payloads","blocknative","filter","isEthereumGasBlocknativePayload","map","transformGasFromBlocknative","etherchainV2","isEthereumGasEtherchainV2Payload","transformGasFromEtherchainV2","ethers","isEthereumGasEthersPayload","transformGasFromEthers","etherscan","isEthereumGasEtherscanPayload","transformGasFromEtherscan","ethgasstation","isEthereumGasEthgasstationPayload","transformGasFromEthgasstation","transactionCosts","avg","average","timestamp","Date","now","payload","PayloadBuilder","schema","EthereumGasSchema","fields","build","EthereumGasDivinerQuerySchema","EthereumGasDivinerConfigSchema","EthereumGasDiviner","AbstractDiviner","configSchemas","EthereumGasDivinerConfigSchema","defaultConfigSchema","targetSchema","EthereumGasSchema","divineHandler","payloads","cost","divineGas","import_gas_price_payload_plugin","EthereumGasPlugin","createPayloadSetDivinerPlugin","required","EthereumGasSchema","schema","PayloadSetSchema","diviner","params","EthereumGasDiviner","create"]}
|
package/dist/browser/index.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAE5B,OAAO,EAAE,iBAAiB,IAAI,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC7E,cAAc,aAAa,CAAA"}
|
package/dist/browser/index.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAE5B,OAAO,EAAE,iBAAiB,IAAI,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC7E,cAAc,aAAa,CAAA"}
|
package/dist/browser/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAE5B,OAAO,EAAE,iBAAiB,IAAI,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC7E,cAAc,aAAa,CAAA"}
|