@xyo-network/gas-price-plugin 2.96.0 → 2.96.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/Plugin.d.cts +7 -7
- package/dist/browser/Plugin.d.mts +7 -7
- package/dist/browser/Plugin.d.ts +7 -7
- package/dist/browser/index.cjs +1 -277
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +1 -254
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/lib/average.d.cts +0 -5
- package/dist/browser/lib/average.d.cts.map +1 -1
- package/dist/browser/lib/average.d.mts +0 -5
- package/dist/browser/lib/average.d.mts.map +1 -1
- package/dist/browser/lib/average.d.ts +0 -5
- package/dist/browser/lib/average.d.ts.map +1 -1
- package/dist/browser/lib/divineGas.d.cts.map +1 -1
- package/dist/browser/lib/divineGas.d.mts.map +1 -1
- package/dist/browser/lib/divineGas.d.ts.map +1 -1
- package/dist/browser/lib/identities/isEthereumGasBlocknativePayload.d.cts +2 -3
- package/dist/browser/lib/identities/isEthereumGasBlocknativePayload.d.cts.map +1 -1
- package/dist/browser/lib/identities/isEthereumGasBlocknativePayload.d.mts +2 -3
- package/dist/browser/lib/identities/isEthereumGasBlocknativePayload.d.mts.map +1 -1
- package/dist/browser/lib/identities/isEthereumGasBlocknativePayload.d.ts +2 -3
- package/dist/browser/lib/identities/isEthereumGasBlocknativePayload.d.ts.map +1 -1
- package/dist/browser/lib/identities/isEthereumGasEtherchainV2Payload.d.cts +2 -4
- package/dist/browser/lib/identities/isEthereumGasEtherchainV2Payload.d.cts.map +1 -1
- package/dist/browser/lib/identities/isEthereumGasEtherchainV2Payload.d.mts +2 -4
- package/dist/browser/lib/identities/isEthereumGasEtherchainV2Payload.d.mts.map +1 -1
- package/dist/browser/lib/identities/isEthereumGasEtherchainV2Payload.d.ts +2 -4
- package/dist/browser/lib/identities/isEthereumGasEtherchainV2Payload.d.ts.map +1 -1
- package/dist/browser/lib/identities/isEthereumGasEthersPayload.d.cts +2 -3
- package/dist/browser/lib/identities/isEthereumGasEthersPayload.d.cts.map +1 -1
- package/dist/browser/lib/identities/isEthereumGasEthersPayload.d.mts +2 -3
- package/dist/browser/lib/identities/isEthereumGasEthersPayload.d.mts.map +1 -1
- package/dist/browser/lib/identities/isEthereumGasEthersPayload.d.ts +2 -3
- package/dist/browser/lib/identities/isEthereumGasEthersPayload.d.ts.map +1 -1
- package/dist/browser/lib/identities/isEthereumGasEtherscanPayload.d.cts +2 -3
- package/dist/browser/lib/identities/isEthereumGasEtherscanPayload.d.cts.map +1 -1
- package/dist/browser/lib/identities/isEthereumGasEtherscanPayload.d.mts +2 -3
- package/dist/browser/lib/identities/isEthereumGasEtherscanPayload.d.mts.map +1 -1
- package/dist/browser/lib/identities/isEthereumGasEtherscanPayload.d.ts +2 -3
- package/dist/browser/lib/identities/isEthereumGasEtherscanPayload.d.ts.map +1 -1
- package/dist/browser/lib/identities/isEthereumGasEthgasstationPayload.d.cts +2 -4
- package/dist/browser/lib/identities/isEthereumGasEthgasstationPayload.d.cts.map +1 -1
- package/dist/browser/lib/identities/isEthereumGasEthgasstationPayload.d.mts +2 -4
- package/dist/browser/lib/identities/isEthereumGasEthgasstationPayload.d.mts.map +1 -1
- package/dist/browser/lib/identities/isEthereumGasEthgasstationPayload.d.ts +2 -4
- package/dist/browser/lib/identities/isEthereumGasEthgasstationPayload.d.ts.map +1 -1
- package/dist/neutral/Plugin.d.cts +7 -7
- package/dist/neutral/Plugin.d.mts +7 -7
- package/dist/neutral/Plugin.d.ts +7 -7
- package/dist/neutral/index.cjs +1 -277
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.js +1 -254
- package/dist/neutral/index.js.map +1 -1
- package/dist/neutral/lib/average.d.cts +0 -5
- package/dist/neutral/lib/average.d.cts.map +1 -1
- package/dist/neutral/lib/average.d.mts +0 -5
- package/dist/neutral/lib/average.d.mts.map +1 -1
- package/dist/neutral/lib/average.d.ts +0 -5
- package/dist/neutral/lib/average.d.ts.map +1 -1
- package/dist/neutral/lib/divineGas.d.cts.map +1 -1
- package/dist/neutral/lib/divineGas.d.mts.map +1 -1
- package/dist/neutral/lib/divineGas.d.ts.map +1 -1
- package/dist/neutral/lib/identities/isEthereumGasBlocknativePayload.d.cts +2 -3
- package/dist/neutral/lib/identities/isEthereumGasBlocknativePayload.d.cts.map +1 -1
- package/dist/neutral/lib/identities/isEthereumGasBlocknativePayload.d.mts +2 -3
- package/dist/neutral/lib/identities/isEthereumGasBlocknativePayload.d.mts.map +1 -1
- package/dist/neutral/lib/identities/isEthereumGasBlocknativePayload.d.ts +2 -3
- package/dist/neutral/lib/identities/isEthereumGasBlocknativePayload.d.ts.map +1 -1
- package/dist/neutral/lib/identities/isEthereumGasEtherchainV2Payload.d.cts +2 -4
- package/dist/neutral/lib/identities/isEthereumGasEtherchainV2Payload.d.cts.map +1 -1
- package/dist/neutral/lib/identities/isEthereumGasEtherchainV2Payload.d.mts +2 -4
- package/dist/neutral/lib/identities/isEthereumGasEtherchainV2Payload.d.mts.map +1 -1
- package/dist/neutral/lib/identities/isEthereumGasEtherchainV2Payload.d.ts +2 -4
- package/dist/neutral/lib/identities/isEthereumGasEtherchainV2Payload.d.ts.map +1 -1
- package/dist/neutral/lib/identities/isEthereumGasEthersPayload.d.cts +2 -3
- package/dist/neutral/lib/identities/isEthereumGasEthersPayload.d.cts.map +1 -1
- package/dist/neutral/lib/identities/isEthereumGasEthersPayload.d.mts +2 -3
- package/dist/neutral/lib/identities/isEthereumGasEthersPayload.d.mts.map +1 -1
- package/dist/neutral/lib/identities/isEthereumGasEthersPayload.d.ts +2 -3
- package/dist/neutral/lib/identities/isEthereumGasEthersPayload.d.ts.map +1 -1
- package/dist/neutral/lib/identities/isEthereumGasEtherscanPayload.d.cts +2 -3
- package/dist/neutral/lib/identities/isEthereumGasEtherscanPayload.d.cts.map +1 -1
- package/dist/neutral/lib/identities/isEthereumGasEtherscanPayload.d.mts +2 -3
- package/dist/neutral/lib/identities/isEthereumGasEtherscanPayload.d.mts.map +1 -1
- package/dist/neutral/lib/identities/isEthereumGasEtherscanPayload.d.ts +2 -3
- package/dist/neutral/lib/identities/isEthereumGasEtherscanPayload.d.ts.map +1 -1
- package/dist/neutral/lib/identities/isEthereumGasEthgasstationPayload.d.cts +2 -4
- package/dist/neutral/lib/identities/isEthereumGasEthgasstationPayload.d.cts.map +1 -1
- package/dist/neutral/lib/identities/isEthereumGasEthgasstationPayload.d.mts +2 -4
- package/dist/neutral/lib/identities/isEthereumGasEthgasstationPayload.d.mts.map +1 -1
- package/dist/neutral/lib/identities/isEthereumGasEthgasstationPayload.d.ts +2 -4
- package/dist/neutral/lib/identities/isEthereumGasEthgasstationPayload.d.ts.map +1 -1
- package/dist/node/Plugin.d.cts +7 -7
- package/dist/node/Plugin.d.mts +7 -7
- package/dist/node/Plugin.d.ts +7 -7
- package/dist/node/index.cjs +1 -287
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +1 -257
- package/dist/node/index.js.map +1 -1
- package/dist/node/lib/average.d.cts +0 -5
- package/dist/node/lib/average.d.cts.map +1 -1
- package/dist/node/lib/average.d.mts +0 -5
- package/dist/node/lib/average.d.mts.map +1 -1
- package/dist/node/lib/average.d.ts +0 -5
- package/dist/node/lib/average.d.ts.map +1 -1
- package/dist/node/lib/divineGas.d.cts.map +1 -1
- package/dist/node/lib/divineGas.d.mts.map +1 -1
- package/dist/node/lib/divineGas.d.ts.map +1 -1
- package/dist/node/lib/identities/isEthereumGasBlocknativePayload.d.cts +2 -3
- package/dist/node/lib/identities/isEthereumGasBlocknativePayload.d.cts.map +1 -1
- package/dist/node/lib/identities/isEthereumGasBlocknativePayload.d.mts +2 -3
- package/dist/node/lib/identities/isEthereumGasBlocknativePayload.d.mts.map +1 -1
- package/dist/node/lib/identities/isEthereumGasBlocknativePayload.d.ts +2 -3
- package/dist/node/lib/identities/isEthereumGasBlocknativePayload.d.ts.map +1 -1
- package/dist/node/lib/identities/isEthereumGasEtherchainV2Payload.d.cts +2 -4
- package/dist/node/lib/identities/isEthereumGasEtherchainV2Payload.d.cts.map +1 -1
- package/dist/node/lib/identities/isEthereumGasEtherchainV2Payload.d.mts +2 -4
- package/dist/node/lib/identities/isEthereumGasEtherchainV2Payload.d.mts.map +1 -1
- package/dist/node/lib/identities/isEthereumGasEtherchainV2Payload.d.ts +2 -4
- package/dist/node/lib/identities/isEthereumGasEtherchainV2Payload.d.ts.map +1 -1
- package/dist/node/lib/identities/isEthereumGasEthersPayload.d.cts +2 -3
- package/dist/node/lib/identities/isEthereumGasEthersPayload.d.cts.map +1 -1
- package/dist/node/lib/identities/isEthereumGasEthersPayload.d.mts +2 -3
- package/dist/node/lib/identities/isEthereumGasEthersPayload.d.mts.map +1 -1
- package/dist/node/lib/identities/isEthereumGasEthersPayload.d.ts +2 -3
- package/dist/node/lib/identities/isEthereumGasEthersPayload.d.ts.map +1 -1
- package/dist/node/lib/identities/isEthereumGasEtherscanPayload.d.cts +2 -3
- package/dist/node/lib/identities/isEthereumGasEtherscanPayload.d.cts.map +1 -1
- package/dist/node/lib/identities/isEthereumGasEtherscanPayload.d.mts +2 -3
- package/dist/node/lib/identities/isEthereumGasEtherscanPayload.d.mts.map +1 -1
- package/dist/node/lib/identities/isEthereumGasEtherscanPayload.d.ts +2 -3
- package/dist/node/lib/identities/isEthereumGasEtherscanPayload.d.ts.map +1 -1
- package/dist/node/lib/identities/isEthereumGasEthgasstationPayload.d.cts +2 -4
- package/dist/node/lib/identities/isEthereumGasEthgasstationPayload.d.cts.map +1 -1
- package/dist/node/lib/identities/isEthereumGasEthgasstationPayload.d.mts +2 -4
- package/dist/node/lib/identities/isEthereumGasEthgasstationPayload.d.mts.map +1 -1
- package/dist/node/lib/identities/isEthereumGasEthgasstationPayload.d.ts +2 -4
- package/dist/node/lib/identities/isEthereumGasEthgasstationPayload.d.ts.map +1 -1
- package/package.json +22 -22
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { EthereumGasDiviner } from './Diviner';
|
|
2
2
|
export declare const EthereumGasPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetDivinerPlugin<EthereumGasDiviner<import("@xylabs/object").BaseParamsFields & {
|
|
3
|
-
account?: import("@xyo-network/account-model").AccountInstance | "random"
|
|
4
|
-
addToResolvers?: boolean
|
|
5
|
-
additionalSigners?: import("@xyo-network/account-model").AccountInstance[]
|
|
6
|
-
allowNameResolution?: boolean
|
|
3
|
+
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
4
|
+
addToResolvers?: boolean;
|
|
5
|
+
additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
|
|
6
|
+
allowNameResolution?: boolean;
|
|
7
7
|
config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & {
|
|
8
8
|
schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
|
|
9
9
|
} & {
|
|
10
|
-
schema: "
|
|
10
|
+
schema: import("./Schema").EthereumGasDivinerConfigSchema;
|
|
11
11
|
}, "schema"> & {
|
|
12
12
|
schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
|
|
13
13
|
}, "schema"> & {
|
|
14
14
|
schema: string;
|
|
15
15
|
};
|
|
16
|
-
ephemeralQueryAccountEnabled?: boolean
|
|
17
|
-
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[]
|
|
16
|
+
ephemeralQueryAccountEnabled?: boolean;
|
|
17
|
+
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
|
|
18
18
|
}>>;
|
|
19
19
|
//# sourceMappingURL=Plugin.d.ts.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { EthereumGasDiviner } from './Diviner';
|
|
2
2
|
export declare const EthereumGasPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetDivinerPlugin<EthereumGasDiviner<import("@xylabs/object").BaseParamsFields & {
|
|
3
|
-
account?: import("@xyo-network/account-model").AccountInstance | "random"
|
|
4
|
-
addToResolvers?: boolean
|
|
5
|
-
additionalSigners?: import("@xyo-network/account-model").AccountInstance[]
|
|
6
|
-
allowNameResolution?: boolean
|
|
3
|
+
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
4
|
+
addToResolvers?: boolean;
|
|
5
|
+
additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
|
|
6
|
+
allowNameResolution?: boolean;
|
|
7
7
|
config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & {
|
|
8
8
|
schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
|
|
9
9
|
} & {
|
|
10
|
-
schema: "
|
|
10
|
+
schema: import("./Schema").EthereumGasDivinerConfigSchema;
|
|
11
11
|
}, "schema"> & {
|
|
12
12
|
schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
|
|
13
13
|
}, "schema"> & {
|
|
14
14
|
schema: string;
|
|
15
15
|
};
|
|
16
|
-
ephemeralQueryAccountEnabled?: boolean
|
|
17
|
-
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[]
|
|
16
|
+
ephemeralQueryAccountEnabled?: boolean;
|
|
17
|
+
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
|
|
18
18
|
}>>;
|
|
19
19
|
//# sourceMappingURL=Plugin.d.ts.map
|
package/dist/browser/Plugin.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { EthereumGasDiviner } from './Diviner';
|
|
2
2
|
export declare const EthereumGasPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetDivinerPlugin<EthereumGasDiviner<import("@xylabs/object").BaseParamsFields & {
|
|
3
|
-
account?: import("@xyo-network/account-model").AccountInstance | "random"
|
|
4
|
-
addToResolvers?: boolean
|
|
5
|
-
additionalSigners?: import("@xyo-network/account-model").AccountInstance[]
|
|
6
|
-
allowNameResolution?: boolean
|
|
3
|
+
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
4
|
+
addToResolvers?: boolean;
|
|
5
|
+
additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
|
|
6
|
+
allowNameResolution?: boolean;
|
|
7
7
|
config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & {
|
|
8
8
|
schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
|
|
9
9
|
} & {
|
|
10
|
-
schema: "
|
|
10
|
+
schema: import("./Schema").EthereumGasDivinerConfigSchema;
|
|
11
11
|
}, "schema"> & {
|
|
12
12
|
schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
|
|
13
13
|
}, "schema"> & {
|
|
14
14
|
schema: string;
|
|
15
15
|
};
|
|
16
|
-
ephemeralQueryAccountEnabled?: boolean
|
|
17
|
-
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[]
|
|
16
|
+
ephemeralQueryAccountEnabled?: boolean;
|
|
17
|
+
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
|
|
18
18
|
}>>;
|
|
19
19
|
//# sourceMappingURL=Plugin.d.ts.map
|
package/dist/browser/index.cjs
CHANGED
|
@@ -1,278 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var src_exports = {};
|
|
22
|
-
__export(src_exports, {
|
|
23
|
-
EthereumGasDiviner: () => EthereumGasDiviner,
|
|
24
|
-
EthereumGasDivinerConfigSchema: () => EthereumGasDivinerConfigSchema,
|
|
25
|
-
EthereumGasDivinerQuerySchema: () => EthereumGasDivinerQuerySchema,
|
|
26
|
-
EthereumGasPlugin: () => EthereumGasPlugin,
|
|
27
|
-
default: () => EthereumGasPlugin
|
|
28
|
-
});
|
|
29
|
-
module.exports = __toCommonJS(src_exports);
|
|
30
|
-
|
|
31
|
-
// src/Diviner.ts
|
|
32
|
-
var import_diviner_abstract = require("@xyo-network/diviner-abstract");
|
|
33
|
-
var import_gas_price_payload_plugin2 = require("@xyo-network/gas-price-payload-plugin");
|
|
34
|
-
|
|
35
|
-
// src/lib/divineGas.ts
|
|
36
|
-
var import_gas_price_payload_plugin = require("@xyo-network/gas-price-payload-plugin");
|
|
37
|
-
var import_payload_builder = require("@xyo-network/payload-builder");
|
|
38
|
-
|
|
39
|
-
// src/lib/average.ts
|
|
40
|
-
var import_exists = require("@xylabs/exists");
|
|
41
|
-
var listAverage = (x) => x?.length ? x.reduce((a, b) => a + b) / x.length : void 0;
|
|
42
|
-
var averageProperty = (data, propertyExpression) => {
|
|
43
|
-
return listAverage(data.map(propertyExpression).filter(import_exists.exists));
|
|
44
|
-
};
|
|
45
|
-
var average = (input) => {
|
|
46
|
-
const data = input?.filter(import_exists.exists) || [];
|
|
47
|
-
const averaged = {
|
|
48
|
-
baseFee: averageProperty(data, (x) => x.baseFee),
|
|
49
|
-
feePerGas: {
|
|
50
|
-
high: averageProperty(data, (x) => x.feePerGas.high),
|
|
51
|
-
low: averageProperty(data, (x) => x.feePerGas.low),
|
|
52
|
-
medium: averageProperty(data, (x) => x.feePerGas.medium),
|
|
53
|
-
veryHigh: averageProperty(data, (x) => x.feePerGas.veryHigh)
|
|
54
|
-
},
|
|
55
|
-
priorityFeePerGas: {
|
|
56
|
-
high: averageProperty(data, (x) => x.priorityFeePerGas.high),
|
|
57
|
-
low: averageProperty(data, (x) => x.priorityFeePerGas.low),
|
|
58
|
-
medium: averageProperty(data, (x) => x.priorityFeePerGas.medium),
|
|
59
|
-
veryHigh: averageProperty(data, (x) => x.priorityFeePerGas.veryHigh)
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
return averaged;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
// src/lib/identities/isEthereumGasBlocknativePayload.ts
|
|
66
|
-
var import_blocknative_ethereum_gas_payload_plugin = require("@xyo-network/blocknative-ethereum-gas-payload-plugin");
|
|
67
|
-
var isEthereumGasBlocknativePayload = (payload) => {
|
|
68
|
-
return payload?.schema === import_blocknative_ethereum_gas_payload_plugin.EthereumGasBlocknativeSchema;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
// src/lib/identities/isEthereumGasEtherchainV2Payload.ts
|
|
72
|
-
var import_etherchain_gas_ethereum_blockchain_payload_plugins = require("@xyo-network/etherchain-gas-ethereum-blockchain-payload-plugins");
|
|
73
|
-
var isEthereumGasEtherchainV2Payload = (payload) => {
|
|
74
|
-
return payload?.schema === import_etherchain_gas_ethereum_blockchain_payload_plugins.EthereumGasEtherchainV2Schema;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
// src/lib/identities/isEthereumGasEtherscanPayload.ts
|
|
78
|
-
var import_etherscan_ethereum_gas_payload_plugin = require("@xyo-network/etherscan-ethereum-gas-payload-plugin");
|
|
79
|
-
var isEthereumGasEtherscanPayload = (payload) => {
|
|
80
|
-
return payload?.schema === import_etherscan_ethereum_gas_payload_plugin.EthereumGasEtherscanSchema;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
// src/lib/identities/isEthereumGasEthersPayload.ts
|
|
84
|
-
var import_ethers_ethereum_gas_payload_plugin = require("@xyo-network/ethers-ethereum-gas-payload-plugin");
|
|
85
|
-
var isEthereumGasEthersPayload = (payload) => {
|
|
86
|
-
return payload?.schema === import_ethers_ethereum_gas_payload_plugin.EthereumGasEthersSchema;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
// src/lib/identities/isEthereumGasEthgasstationPayload.ts
|
|
90
|
-
var import_ethgasstation_ethereum_gas_payload_plugin = require("@xyo-network/ethgasstation-ethereum-gas-payload-plugin");
|
|
91
|
-
var isEthereumGasEthgasstationPayload = (payload) => {
|
|
92
|
-
return payload?.schema === import_ethgasstation_ethereum_gas_payload_plugin.EthereumGasEthgasstationSchema;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
// src/lib/transforms/transformGasFromBlocknative.ts
|
|
96
|
-
var import_regression = require("regression");
|
|
97
|
-
var getBaseFee = (payload) => {
|
|
98
|
-
return payload?.blockPrices?.[0]?.baseFeePerGas;
|
|
99
|
-
};
|
|
100
|
-
var getFeePerGas = (payload) => {
|
|
101
|
-
const sorted = payload.blockPrices?.[0].estimatedPrices?.sort((a, b) => a.confidence - b.confidence);
|
|
102
|
-
const trend = (0, import_regression.linear)([
|
|
103
|
-
[0, sorted?.[0].price],
|
|
104
|
-
[1, sorted?.[1].price],
|
|
105
|
-
[2, sorted?.[2].price],
|
|
106
|
-
[3, sorted?.[3].price],
|
|
107
|
-
[4, sorted?.[4].price]
|
|
108
|
-
]);
|
|
109
|
-
const feePerGas = {
|
|
110
|
-
low: trend.predict(0.5)[1],
|
|
111
|
-
medium: trend.predict(1.5)[1],
|
|
112
|
-
high: trend.predict(2.5)[1],
|
|
113
|
-
veryHigh: trend.predict(3.5)[1]
|
|
114
|
-
};
|
|
115
|
-
return feePerGas;
|
|
116
|
-
};
|
|
117
|
-
var getPriorityFeePerGas = (payload) => {
|
|
118
|
-
const sorted = payload.blockPrices?.[0].estimatedPrices?.sort((a, b) => a.confidence - b.confidence);
|
|
119
|
-
const trend = (0, import_regression.linear)([
|
|
120
|
-
[0, sorted?.[0].maxPriorityFeePerGas],
|
|
121
|
-
[1, sorted?.[1].maxPriorityFeePerGas],
|
|
122
|
-
[2, sorted?.[2].maxPriorityFeePerGas],
|
|
123
|
-
[3, sorted?.[3].maxPriorityFeePerGas],
|
|
124
|
-
[4, sorted?.[4].maxPriorityFeePerGas]
|
|
125
|
-
]);
|
|
126
|
-
const priorityFeePerGas = {
|
|
127
|
-
low: trend.predict(0.5)[1],
|
|
128
|
-
medium: trend.predict(1.5)[1],
|
|
129
|
-
high: trend.predict(2.5)[1],
|
|
130
|
-
veryHigh: trend.predict(3.5)[1]
|
|
131
|
-
};
|
|
132
|
-
return priorityFeePerGas;
|
|
133
|
-
};
|
|
134
|
-
var transformGasFromBlocknative = (payload) => {
|
|
135
|
-
const baseFee = getBaseFee(payload);
|
|
136
|
-
const feePerGas = getFeePerGas(payload);
|
|
137
|
-
const priorityFeePerGas = getPriorityFeePerGas(payload);
|
|
138
|
-
return { baseFee, feePerGas, priorityFeePerGas };
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
// src/lib/transforms/transformGasFromEtherchainV2.ts
|
|
142
|
-
var getFeePerGas2 = (payload) => {
|
|
143
|
-
const { slow, standard, fast, rapid } = payload.data;
|
|
144
|
-
const low = slow / 1e9;
|
|
145
|
-
const medium = standard / 1e9;
|
|
146
|
-
const high = fast / 1e9;
|
|
147
|
-
const veryHigh = rapid / 1e9;
|
|
148
|
-
return { high, low, medium, veryHigh };
|
|
149
|
-
};
|
|
150
|
-
var transformGasFromEtherchainV2 = (payload) => {
|
|
151
|
-
const baseFee = void 0;
|
|
152
|
-
const feePerGas = getFeePerGas2(payload);
|
|
153
|
-
const priorityFeePerGas = {};
|
|
154
|
-
return { baseFee, feePerGas, priorityFeePerGas };
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
// src/lib/transforms/transformGasFromEthers.ts
|
|
158
|
-
var getBaseFee2 = (payload) => {
|
|
159
|
-
const { gasPrice } = payload;
|
|
160
|
-
return gasPrice ? gasPrice / 1e9 : void 0;
|
|
161
|
-
};
|
|
162
|
-
var getFeePerGas3 = (payload) => {
|
|
163
|
-
const { maxFeePerGas } = payload;
|
|
164
|
-
const high = maxFeePerGas ? maxFeePerGas / 1e9 : void 0;
|
|
165
|
-
return { high };
|
|
166
|
-
};
|
|
167
|
-
var getPriorityFeePerGas2 = (payload) => {
|
|
168
|
-
const { maxPriorityFeePerGas } = payload;
|
|
169
|
-
const high = maxPriorityFeePerGas ? maxPriorityFeePerGas / 1e9 : void 0;
|
|
170
|
-
return { high };
|
|
171
|
-
};
|
|
172
|
-
var transformGasFromEthers = (payload) => {
|
|
173
|
-
const baseFee = getBaseFee2(payload);
|
|
174
|
-
const feePerGas = getFeePerGas3(payload);
|
|
175
|
-
const priorityFeePerGas = getPriorityFeePerGas2(payload);
|
|
176
|
-
return { baseFee, feePerGas, priorityFeePerGas };
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
// src/lib/transforms/transformGasFromEtherscan.ts
|
|
180
|
-
var import_regression2 = require("regression");
|
|
181
|
-
var getBaseFee3 = (payload) => {
|
|
182
|
-
const { suggestBaseFee } = payload.result;
|
|
183
|
-
return Number.parseFloat(suggestBaseFee);
|
|
184
|
-
};
|
|
185
|
-
var getFeePerGas4 = (payload) => {
|
|
186
|
-
const { FastGasPrice, ProposeGasPrice, SafeGasPrice } = payload.result;
|
|
187
|
-
const low = Number.parseFloat(SafeGasPrice);
|
|
188
|
-
const medium = Number.parseFloat(ProposeGasPrice);
|
|
189
|
-
const high = Number.parseFloat(FastGasPrice);
|
|
190
|
-
const veryHigh = (0, import_regression2.linear)([
|
|
191
|
-
[0, low],
|
|
192
|
-
[1, medium],
|
|
193
|
-
[2, high]
|
|
194
|
-
]).predict(3)[1];
|
|
195
|
-
return { high, low, medium, veryHigh };
|
|
196
|
-
};
|
|
197
|
-
var transformGasFromEtherscan = (payload) => {
|
|
198
|
-
const baseFee = getBaseFee3(payload);
|
|
199
|
-
const feePerGas = getFeePerGas4(payload);
|
|
200
|
-
const priorityFeePerGas = {};
|
|
201
|
-
return { baseFee, feePerGas, priorityFeePerGas };
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
// src/lib/transforms/transformGasFromEthgasstation.ts
|
|
205
|
-
var import_regression3 = require("regression");
|
|
206
|
-
var getBaseFee4 = (payload) => {
|
|
207
|
-
const { baseFee } = payload;
|
|
208
|
-
return baseFee;
|
|
209
|
-
};
|
|
210
|
-
var getFeePerGas5 = (payload) => {
|
|
211
|
-
const { standard: medium, fast: high, instant: veryHigh } = payload.gasPrice;
|
|
212
|
-
const trend = (0, import_regression3.linear)([
|
|
213
|
-
[1, medium],
|
|
214
|
-
[2, high],
|
|
215
|
-
[3, veryHigh]
|
|
216
|
-
]);
|
|
217
|
-
const low = trend.predict(0)[1];
|
|
218
|
-
return { low, medium, high, veryHigh };
|
|
219
|
-
};
|
|
220
|
-
var getPriorityFeePerGas3 = (payload) => {
|
|
221
|
-
const { standard: medium, fast: high, instant: veryHigh } = payload.priorityFee;
|
|
222
|
-
const trend = (0, import_regression3.linear)([
|
|
223
|
-
[1, medium],
|
|
224
|
-
[2, high],
|
|
225
|
-
[3, veryHigh]
|
|
226
|
-
]);
|
|
227
|
-
const low = trend.predict(0)[1];
|
|
228
|
-
return { low, medium, high, veryHigh };
|
|
229
|
-
};
|
|
230
|
-
var transformGasFromEthgasstation = (payload) => {
|
|
231
|
-
const baseFee = getBaseFee4(payload);
|
|
232
|
-
const feePerGas = getFeePerGas5(payload);
|
|
233
|
-
const priorityFeePerGas = getPriorityFeePerGas3(payload);
|
|
234
|
-
return { baseFee, feePerGas, priorityFeePerGas };
|
|
235
|
-
};
|
|
236
|
-
|
|
237
|
-
// src/lib/divineGas.ts
|
|
238
|
-
var divineGas = async (payloads) => {
|
|
239
|
-
const blocknative = payloads.filter(isEthereumGasBlocknativePayload).map(transformGasFromBlocknative);
|
|
240
|
-
const etherchainV2 = payloads.filter(isEthereumGasEtherchainV2Payload).map(transformGasFromEtherchainV2);
|
|
241
|
-
const ethers = payloads.filter(isEthereumGasEthersPayload).map(transformGasFromEthers);
|
|
242
|
-
const etherscan = payloads.filter(isEthereumGasEtherscanPayload).map(transformGasFromEtherscan);
|
|
243
|
-
const ethgasstation = payloads.filter(isEthereumGasEthgasstationPayload).map(transformGasFromEthgasstation);
|
|
244
|
-
const transactionCosts = [...blocknative, ...etherchainV2, ...ethers, ...etherscan, ...ethgasstation];
|
|
245
|
-
const avg = average(transactionCosts);
|
|
246
|
-
const timestamp = Date.now();
|
|
247
|
-
const payload = await new import_payload_builder.PayloadBuilder({ schema: import_gas_price_payload_plugin.EthereumGasSchema }).fields({ ...avg, timestamp }).build();
|
|
248
|
-
return payload;
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
// src/Schema.ts
|
|
252
|
-
var EthereumGasDivinerQuerySchema = "network.xyo.blockchain.ethereum.gas.diviner.query";
|
|
253
|
-
var EthereumGasDivinerConfigSchema = "network.xyo.blockchain.ethereum.gas.diviner.config";
|
|
254
|
-
|
|
255
|
-
// src/Diviner.ts
|
|
256
|
-
var EthereumGasDiviner = class extends import_diviner_abstract.AbstractDiviner {
|
|
257
|
-
static configSchemas = [...super.configSchemas, EthereumGasDivinerConfigSchema];
|
|
258
|
-
static defaultConfigSchema = EthereumGasDivinerConfigSchema;
|
|
259
|
-
static targetSchema = import_gas_price_payload_plugin2.EthereumGasSchema;
|
|
260
|
-
async divineHandler(payloads) {
|
|
261
|
-
const cost = await divineGas(payloads ?? []);
|
|
262
|
-
return [cost];
|
|
263
|
-
}
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
// src/Plugin.ts
|
|
267
|
-
var import_gas_price_payload_plugin3 = require("@xyo-network/gas-price-payload-plugin");
|
|
268
|
-
var import_payload_model = require("@xyo-network/payload-model");
|
|
269
|
-
var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
|
|
270
|
-
var EthereumGasPlugin = () => (0, import_payloadset_plugin.createPayloadSetDivinerPlugin)(
|
|
271
|
-
{ required: { [import_gas_price_payload_plugin3.EthereumGasSchema]: 1 }, schema: import_payload_model.PayloadSetSchema },
|
|
272
|
-
{
|
|
273
|
-
diviner: async (params) => {
|
|
274
|
-
return await EthereumGasDiviner.create(params);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
);
|
|
1
|
+
"use strict";var u=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var L=(e,r)=>{for(var t in r)u(e,t,{get:r[t],enumerable:!0})},O=(e,r,t,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of J(r))!K.call(e,o)&&o!==t&&u(e,o,{get:()=>r[o],enumerable:!(a=I(r,o))||a.enumerable});return e};var R=e=>O(u({},"__esModule",{value:!0}),e);var me={};L(me,{EthereumGasDiviner:()=>c,EthereumGasDivinerConfigSchema:()=>h,EthereumGasDivinerQuerySchema:()=>ne,EthereumGasPlugin:()=>y,default:()=>y});module.exports=R(me);var Q=require("@xyo-network/diviner-abstract"),M=require("@xyo-network/gas-price-payload-plugin");var A=require("@xyo-network/gas-price-payload-plugin"),N=require("@xyo-network/payload-builder");var d=require("@xylabs/exists"),U=e=>e?.length?e.reduce((r,t)=>r+t)/e.length:void 0,i=(e,r)=>U(e.map(r).filter(d.exists)),E=e=>{let r=e?.filter(d.exists)||[];return{baseFee:i(r,a=>a.baseFee),feePerGas:{high:i(r,a=>a.feePerGas.high),low:i(r,a=>a.feePerGas.low),medium:i(r,a=>a.feePerGas.medium),veryHigh:i(r,a=>a.feePerGas.veryHigh)},priorityFeePerGas:{high:i(r,a=>a.priorityFeePerGas.high),low:i(r,a=>a.priorityFeePerGas.low),medium:i(r,a=>a.priorityFeePerGas.medium),veryHigh:i(r,a=>a.priorityFeePerGas.veryHigh)}}};var f=require("@xyo-network/blocknative-ethereum-gas-payload-plugin"),p=e=>e?.schema===f.EthereumGasBlocknativeSchema;var F=require("@xyo-network/etherchain-gas-ethereum-blockchain-payload-plugins"),g=e=>e?.schema===F.EthereumGasEtherchainV2Schema;var v=require("@xyo-network/etherscan-ethereum-gas-payload-plugin"),D=e=>e?.schema===v.EthereumGasEtherscanSchema;var x=require("@xyo-network/ethers-ethereum-gas-payload-plugin"),b=e=>e?.schema===x.EthereumGasEthersSchema;var S=require("@xyo-network/ethgasstation-ethereum-gas-payload-plugin"),k=e=>e?.schema===S.EthereumGasEthgasstationSchema;var G=require("regression"),W=e=>e?.blockPrices?.[0]?.baseFeePerGas,X=e=>{let r=e.blockPrices?.[0].estimatedPrices?.sort((o,s)=>o.confidence-s.confidence),t=(0,G.linear)([[0,r?.[0].price],[1,r?.[1].price],[2,r?.[2].price],[3,r?.[3].price],[4,r?.[4].price]]);return{low:t.predict(.5)[1],medium:t.predict(1.5)[1],high:t.predict(2.5)[1],veryHigh:t.predict(3.5)[1]}},Y=e=>{let r=e.blockPrices?.[0].estimatedPrices?.sort((o,s)=>o.confidence-s.confidence),t=(0,G.linear)([[0,r?.[0].maxPriorityFeePerGas],[1,r?.[1].maxPriorityFeePerGas],[2,r?.[2].maxPriorityFeePerGas],[3,r?.[3].maxPriorityFeePerGas],[4,r?.[4].maxPriorityFeePerGas]]);return{low:t.predict(.5)[1],medium:t.predict(1.5)[1],high:t.predict(2.5)[1],veryHigh:t.predict(3.5)[1]}},w=e=>{let r=W(e),t=X(e),a=Y(e);return{baseFee:r,feePerGas:t,priorityFeePerGas:a}};var Z=e=>{let{slow:r,standard:t,fast:a,rapid:o}=e.data,s=r/1e9,n=t/1e9,m=a/1e9,P=o/1e9;return{high:m,low:s,medium:n,veryHigh:P}},_=e=>({baseFee:void 0,feePerGas:Z(e),priorityFeePerGas:{}});var $=e=>{let{gasPrice:r}=e;return r?r/1e9:void 0},ee=e=>{let{maxFeePerGas:r}=e;return{high:r?r/1e9:void 0}},re=e=>{let{maxPriorityFeePerGas:r}=e;return{high:r?r/1e9:void 0}},B=e=>{let r=$(e),t=ee(e),a=re(e);return{baseFee:r,feePerGas:t,priorityFeePerGas:a}};var C=require("regression"),ae=e=>{let{suggestBaseFee:r}=e.result;return Number.parseFloat(r)},te=e=>{let{FastGasPrice:r,ProposeGasPrice:t,SafeGasPrice:a}=e.result,o=Number.parseFloat(a),s=Number.parseFloat(t),n=Number.parseFloat(r),m=(0,C.linear)([[0,o],[1,s],[2,n]]).predict(3)[1];return{high:n,low:o,medium:s,veryHigh:m}},H=e=>{let r=ae(e),t=te(e);return{baseFee:r,feePerGas:t,priorityFeePerGas:{}}};var l=require("regression"),oe=e=>{let{baseFee:r}=e;return r},se=e=>{let{standard:r,fast:t,instant:a}=e.gasPrice;return{low:(0,l.linear)([[1,r],[2,t],[3,a]]).predict(0)[1],medium:r,high:t,veryHigh:a}},ie=e=>{let{standard:r,fast:t,instant:a}=e.priorityFee;return{low:(0,l.linear)([[1,r],[2,t],[3,a]]).predict(0)[1],medium:r,high:t,veryHigh:a}},V=e=>{let r=oe(e),t=se(e),a=ie(e);return{baseFee:r,feePerGas:t,priorityFeePerGas:a}};var q=async e=>{let r=e.filter(p).map(w),t=e.filter(g).map(_),a=e.filter(b).map(B),o=e.filter(D).map(H),s=e.filter(k).map(V),n=[...r,...t,...a,...o,...s],m=E(n),P=Date.now();return await new N.PayloadBuilder({schema:A.EthereumGasSchema}).fields({...m,timestamp:P}).build()};var ne="network.xyo.blockchain.ethereum.gas.diviner.query",h="network.xyo.blockchain.ethereum.gas.diviner.config";var c=class extends Q.AbstractDiviner{static configSchemas=[...super.configSchemas,h];static defaultConfigSchema=h;static targetSchema=M.EthereumGasSchema;async divineHandler(r){return[await q(r??[])]}};var T=require("@xyo-network/gas-price-payload-plugin"),j=require("@xyo-network/payload-model"),z=require("@xyo-network/payloadset-plugin");var y=()=>(0,z.createPayloadSetDivinerPlugin)({required:{[T.EthereumGasSchema]:1},schema:j.PayloadSetSchema},{diviner:async e=>await c.create(e)});
|
|
278
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
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'\nexport { EthereumGasPlugin as default, EthereumGasPlugin } from './Plugin'\nexport * from './Schema'\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'\nimport { EthereumGasDivinerConfigSchema } from './Schema'\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{\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'\nimport {\n isEthereumGasBlocknativePayload,\n isEthereumGasEtherchainV2Payload,\n isEthereumGasEtherscanPayload,\n isEthereumGasEthersPayload,\n isEthereumGasEthgasstationPayload,\n} from './identities'\nimport {\n transformGasFromBlocknative,\n transformGasFromEtherchainV2,\n transformGasFromEthers,\n transformGasFromEtherscan,\n transformGasFromEthgasstation,\n} from './transforms'\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","/* eslint-disable sort-keys-fix/sort-keys-fix */\nimport { 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","/* eslint-disable sort-keys-fix/sort-keys-fix */\nimport { 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'\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,8BAAgC;AAEhC,IAAAA,mCAAkC;;;ACFlC,sCAA+D;AAC/D,6BAA+B;;;ACD/B,oBAAuB;AASvB,IAAM,cAAc,CAAC,MAAkB,GAAG,SAAS,EAAE,OAAO,CAAC,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,SAAS;AAU1F,IAAM,kBAAkB,CAAC,MAAiB,uBAA2D;AACnG,SAAO,YAAY,KAAK,IAAI,kBAAkB,EAAE,OAAO,oBAAM,CAAC;AAChE;AAOO,IAAM,UAAU,CAAC,UAA6C;AACnE,QAAM,OAAO,OAAO,OAAO,oBAAM,KAAK,CAAC;AACvC,QAAM,WAAoB;AAAA,IACxB,SAAS,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO;AAAA,IAC/C,WAAW;AAAA,MACT,MAAM,gBAAgB,MAAM,CAAC,MAAM,EAAE,UAAU,IAAI;AAAA,MACnD,KAAK,gBAAgB,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG;AAAA,MACjD,QAAQ,gBAAgB,MAAM,CAAC,MAAM,EAAE,UAAU,MAAM;AAAA,MACvD,UAAU,gBAAgB,MAAM,CAAC,MAAM,EAAE,UAAU,QAAQ;AAAA,IAC7D;AAAA,IACA,mBAAmB;AAAA,MACjB,MAAM,gBAAgB,MAAM,CAAC,MAAM,EAAE,kBAAkB,IAAI;AAAA,MAC3D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eePerGas","import_regression","getBaseFee","getFeePerGas","getPriorityFeePerGas","import_gas_price_payload_plugin"]}
|
|
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'\nexport { EthereumGasPlugin as default, EthereumGasPlugin } from './Plugin'\nexport * from './Schema'\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'\nimport { EthereumGasDivinerConfigSchema } from './Schema'\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{\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'\nimport {\n isEthereumGasBlocknativePayload,\n isEthereumGasEtherchainV2Payload,\n isEthereumGasEtherscanPayload,\n isEthereumGasEthersPayload,\n isEthereumGasEthgasstationPayload,\n} from './identities'\nimport {\n transformGasFromBlocknative,\n transformGasFromEtherchainV2,\n transformGasFromEthers,\n transformGasFromEtherscan,\n transformGasFromEthgasstation,\n} from './transforms'\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","/* eslint-disable sort-keys-fix/sort-keys-fix */\nimport { 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","/* eslint-disable sort-keys-fix/sort-keys-fix */\nimport { 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'\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":"yaAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,wBAAAE,EAAA,mCAAAC,EAAA,kCAAAC,GAAA,sBAAAC,EAAA,YAAAA,IAAA,eAAAC,EAAAN,ICAA,IAAAO,EAAgC,yCAEhCC,EAAkC,iDCFlC,IAAAC,EAA+D,iDAC/DC,EA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":["src_exports","__export","EthereumGasDiviner","EthereumGasDivinerConfigSchema","EthereumGasDivinerQuerySchema","EthereumGasPlugin","__toCommonJS","import_diviner_abstract","import_gas_price_payload_plugin","import_gas_price_payload_plugin","import_payload_builder","import_exists","listAverage","x","a","b","averageProperty","data","propertyExpression","average","input","import_blocknative_ethereum_gas_payload_plugin","isEthereumGasBlocknativePayload","payload","import_etherchain_gas_ethereum_blockchain_payload_plugins","isEthereumGasEtherchainV2Payload","payload","import_etherscan_ethereum_gas_payload_plugin","isEthereumGasEtherscanPayload","payload","import_ethers_ethereum_gas_payload_plugin","isEthereumGasEthersPayload","payload","import_ethgasstation_ethereum_gas_payload_plugin","isEthereumGasEthgasstationPayload","payload","import_regression","getBaseFee","payload","getFeePerGas","sorted","a","b","trend","getPriorityFeePerGas","transformGasFromBlocknative","baseFee","feePerGas","priorityFeePerGas","getFeePerGas","payload","slow","standard","fast","rapid","low","medium","high","veryHigh","transformGasFromEtherchainV2","getBaseFee","payload","gasPrice","getFeePerGas","maxFeePerGas","getPriorityFeePerGas","maxPriorityFeePerGas","transformGasFromEthers","baseFee","feePerGas","priorityFeePerGas","import_regression","getBaseFee","payload","suggestBaseFee","getFeePerGas","FastGasPrice","ProposeGasPrice","SafeGasPrice","low","medium","high","veryHigh","transformGasFromEtherscan","baseFee","feePerGas","import_regression","getBaseFee","payload","baseFee","getFeePerGas","medium","high","veryHigh","getPriorityFeePerGas","transformGasFromEthgasstation","feePerGas","priorityFeePerGas","divineGas","payloads","blocknative","isEthereumGasBlocknativePayload","transformGasFromBlocknative","etherchainV2","isEthereumGasEtherchainV2Payload","transformGasFromEtherchainV2","ethers","isEthereumGasEthersPayload","transformGasFromEthers","etherscan","isEthereumGasEtherscanPayload","transformGasFromEtherscan","ethgasstation","isEthereumGasEthgasstationPayload","transformGasFromEthgasstation","transactionCosts","avg","average","timestamp","EthereumGasDivinerQuerySchema","EthereumGasDivinerConfigSchema","EthereumGasDiviner","EthereumGasDivinerConfigSchema","payloads","divineGas","import_gas_price_payload_plugin","import_payload_model","import_payloadset_plugin","EthereumGasPlugin","params","EthereumGasDiviner"]}
|