@xyo-network/gas-price-plugin 2.99.0 → 2.99.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/Diviner.d.cts +1 -1
- package/dist/browser/Diviner.d.cts.map +1 -1
- package/dist/browser/Diviner.d.mts +1 -1
- package/dist/browser/Diviner.d.mts.map +1 -1
- package/dist/browser/Diviner.d.ts +1 -1
- package/dist/browser/Diviner.d.ts.map +1 -1
- package/dist/browser/Plugin.d.cts +2 -2
- package/dist/browser/Plugin.d.cts.map +1 -1
- package/dist/browser/Plugin.d.mts +2 -2
- package/dist/browser/Plugin.d.mts.map +1 -1
- package/dist/browser/Plugin.d.ts +2 -2
- package/dist/browser/Plugin.d.ts.map +1 -1
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +3 -3
- package/dist/browser/index.d.cts.map +1 -1
- package/dist/browser/index.d.mts +3 -3
- package/dist/browser/index.d.mts.map +1 -1
- package/dist/browser/index.d.ts +3 -3
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/lib/identities/index.d.cts +5 -5
- package/dist/browser/lib/identities/index.d.cts.map +1 -1
- package/dist/browser/lib/identities/index.d.mts +5 -5
- package/dist/browser/lib/identities/index.d.mts.map +1 -1
- package/dist/browser/lib/identities/index.d.ts +5 -5
- package/dist/browser/lib/identities/index.d.ts.map +1 -1
- package/dist/browser/lib/index.d.cts +1 -1
- package/dist/browser/lib/index.d.cts.map +1 -1
- package/dist/browser/lib/index.d.mts +1 -1
- package/dist/browser/lib/index.d.mts.map +1 -1
- package/dist/browser/lib/index.d.ts +1 -1
- package/dist/browser/lib/index.d.ts.map +1 -1
- package/dist/browser/lib/transforms/index.d.cts +5 -5
- package/dist/browser/lib/transforms/index.d.cts.map +1 -1
- package/dist/browser/lib/transforms/index.d.mts +5 -5
- package/dist/browser/lib/transforms/index.d.mts.map +1 -1
- package/dist/browser/lib/transforms/index.d.ts +5 -5
- package/dist/browser/lib/transforms/index.d.ts.map +1 -1
- package/dist/browser/test/index.d.cts +5 -5
- package/dist/browser/test/index.d.cts.map +1 -1
- package/dist/browser/test/index.d.mts +5 -5
- package/dist/browser/test/index.d.mts.map +1 -1
- package/dist/browser/test/index.d.ts +5 -5
- package/dist/browser/test/index.d.ts.map +1 -1
- package/dist/neutral/Diviner.d.cts +1 -1
- package/dist/neutral/Diviner.d.cts.map +1 -1
- package/dist/neutral/Diviner.d.mts +1 -1
- package/dist/neutral/Diviner.d.mts.map +1 -1
- package/dist/neutral/Diviner.d.ts +1 -1
- package/dist/neutral/Diviner.d.ts.map +1 -1
- package/dist/neutral/Plugin.d.cts +2 -2
- package/dist/neutral/Plugin.d.cts.map +1 -1
- package/dist/neutral/Plugin.d.mts +2 -2
- package/dist/neutral/Plugin.d.mts.map +1 -1
- package/dist/neutral/Plugin.d.ts +2 -2
- package/dist/neutral/Plugin.d.ts.map +1 -1
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.d.cts +3 -3
- package/dist/neutral/index.d.cts.map +1 -1
- package/dist/neutral/index.d.mts +3 -3
- package/dist/neutral/index.d.mts.map +1 -1
- package/dist/neutral/index.d.ts +3 -3
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.js.map +1 -1
- package/dist/neutral/lib/identities/index.d.cts +5 -5
- package/dist/neutral/lib/identities/index.d.cts.map +1 -1
- package/dist/neutral/lib/identities/index.d.mts +5 -5
- package/dist/neutral/lib/identities/index.d.mts.map +1 -1
- package/dist/neutral/lib/identities/index.d.ts +5 -5
- package/dist/neutral/lib/identities/index.d.ts.map +1 -1
- package/dist/neutral/lib/index.d.cts +1 -1
- package/dist/neutral/lib/index.d.cts.map +1 -1
- package/dist/neutral/lib/index.d.mts +1 -1
- package/dist/neutral/lib/index.d.mts.map +1 -1
- package/dist/neutral/lib/index.d.ts +1 -1
- package/dist/neutral/lib/index.d.ts.map +1 -1
- package/dist/neutral/lib/transforms/index.d.cts +5 -5
- package/dist/neutral/lib/transforms/index.d.cts.map +1 -1
- package/dist/neutral/lib/transforms/index.d.mts +5 -5
- package/dist/neutral/lib/transforms/index.d.mts.map +1 -1
- package/dist/neutral/lib/transforms/index.d.ts +5 -5
- package/dist/neutral/lib/transforms/index.d.ts.map +1 -1
- package/dist/neutral/test/index.d.cts +5 -5
- package/dist/neutral/test/index.d.cts.map +1 -1
- package/dist/neutral/test/index.d.mts +5 -5
- package/dist/neutral/test/index.d.mts.map +1 -1
- package/dist/neutral/test/index.d.ts +5 -5
- package/dist/neutral/test/index.d.ts.map +1 -1
- package/dist/node/Diviner.d.cts +1 -1
- package/dist/node/Diviner.d.cts.map +1 -1
- package/dist/node/Diviner.d.mts +1 -1
- package/dist/node/Diviner.d.mts.map +1 -1
- package/dist/node/Diviner.d.ts +1 -1
- package/dist/node/Diviner.d.ts.map +1 -1
- package/dist/node/Plugin.d.cts +2 -2
- package/dist/node/Plugin.d.cts.map +1 -1
- package/dist/node/Plugin.d.mts +2 -2
- package/dist/node/Plugin.d.mts.map +1 -1
- package/dist/node/Plugin.d.ts +2 -2
- package/dist/node/Plugin.d.ts.map +1 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +3 -3
- package/dist/node/index.d.cts.map +1 -1
- package/dist/node/index.d.mts +3 -3
- package/dist/node/index.d.mts.map +1 -1
- package/dist/node/index.d.ts +3 -3
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js.map +1 -1
- package/dist/node/lib/identities/index.d.cts +5 -5
- package/dist/node/lib/identities/index.d.cts.map +1 -1
- package/dist/node/lib/identities/index.d.mts +5 -5
- package/dist/node/lib/identities/index.d.mts.map +1 -1
- package/dist/node/lib/identities/index.d.ts +5 -5
- package/dist/node/lib/identities/index.d.ts.map +1 -1
- package/dist/node/lib/index.d.cts +1 -1
- package/dist/node/lib/index.d.cts.map +1 -1
- package/dist/node/lib/index.d.mts +1 -1
- package/dist/node/lib/index.d.mts.map +1 -1
- package/dist/node/lib/index.d.ts +1 -1
- package/dist/node/lib/index.d.ts.map +1 -1
- package/dist/node/lib/transforms/index.d.cts +5 -5
- package/dist/node/lib/transforms/index.d.cts.map +1 -1
- package/dist/node/lib/transforms/index.d.mts +5 -5
- package/dist/node/lib/transforms/index.d.mts.map +1 -1
- package/dist/node/lib/transforms/index.d.ts +5 -5
- package/dist/node/lib/transforms/index.d.ts.map +1 -1
- package/dist/node/test/index.d.cts +5 -5
- package/dist/node/test/index.d.cts.map +1 -1
- package/dist/node/test/index.d.mts +5 -5
- package/dist/node/test/index.d.mts.map +1 -1
- package/dist/node/test/index.d.ts +5 -5
- package/dist/node/test/index.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/Diviner.ts +2 -2
- package/src/Plugin.ts +1 -1
- package/src/index.ts +3 -3
- package/src/lib/divineGas.ts +3 -3
- package/src/lib/identities/index.ts +5 -5
- package/src/lib/index.ts +1 -1
- package/src/lib/transforms/index.ts +5 -5
- package/src/test/index.ts +5 -5
package/dist/node/Diviner.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { AbstractDiviner } from '@xyo-network/diviner-abstract';
|
|
|
2
2
|
import { DivinerConfig, DivinerModule, DivinerParams } from '@xyo-network/diviner-model';
|
|
3
3
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
4
4
|
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
5
|
-
import { EthereumGasDivinerConfigSchema } from './Schema';
|
|
5
|
+
import { EthereumGasDivinerConfigSchema } from './Schema.js';
|
|
6
6
|
export type EthereumGasDivinerConfig = DivinerConfig<{
|
|
7
7
|
schema: EthereumGasDivinerConfigSchema;
|
|
8
8
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAExF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAG5D,OAAO,EAAE,8BAA8B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAExF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAG5D,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAA;AAE5D,MAAM,MAAM,wBAAwB,GAAG,aAAa,CAAC;IAAE,MAAM,EAAE,8BAA8B,CAAA;CAAE,CAAC,CAAA;AAChG,MAAM,MAAM,wBAAwB,GAAG,aAAa,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC,CAAA;AAE/F,qBAAa,kBAAkB,CAAC,OAAO,SAAS,wBAAwB,GAAG,wBAAwB,CACjG,SAAQ,eAAe,CAAC,OAAO,CAC/B,YAAW,aAAa;IAExB,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA2D;IAC3G,gBAAyB,mBAAmB,EAAE,MAAM,CAAiC;IACrF,OAAgB,YAAY,EAAE,MAAM,CAAoB;cAE/B,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAIjF"}
|
package/dist/node/Diviner.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { AbstractDiviner } from '@xyo-network/diviner-abstract';
|
|
|
2
2
|
import { DivinerConfig, DivinerModule, DivinerParams } from '@xyo-network/diviner-model';
|
|
3
3
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
4
4
|
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
5
|
-
import { EthereumGasDivinerConfigSchema } from './Schema';
|
|
5
|
+
import { EthereumGasDivinerConfigSchema } from './Schema.js';
|
|
6
6
|
export type EthereumGasDivinerConfig = DivinerConfig<{
|
|
7
7
|
schema: EthereumGasDivinerConfigSchema;
|
|
8
8
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAExF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAG5D,OAAO,EAAE,8BAA8B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAExF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAG5D,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAA;AAE5D,MAAM,MAAM,wBAAwB,GAAG,aAAa,CAAC;IAAE,MAAM,EAAE,8BAA8B,CAAA;CAAE,CAAC,CAAA;AAChG,MAAM,MAAM,wBAAwB,GAAG,aAAa,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC,CAAA;AAE/F,qBAAa,kBAAkB,CAAC,OAAO,SAAS,wBAAwB,GAAG,wBAAwB,CACjG,SAAQ,eAAe,CAAC,OAAO,CAC/B,YAAW,aAAa;IAExB,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA2D;IAC3G,gBAAyB,mBAAmB,EAAE,MAAM,CAAiC;IACrF,OAAgB,YAAY,EAAE,MAAM,CAAoB;cAE/B,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAIjF"}
|
package/dist/node/Diviner.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { AbstractDiviner } from '@xyo-network/diviner-abstract';
|
|
|
2
2
|
import { DivinerConfig, DivinerModule, DivinerParams } from '@xyo-network/diviner-model';
|
|
3
3
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
4
4
|
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
5
|
-
import { EthereumGasDivinerConfigSchema } from './Schema';
|
|
5
|
+
import { EthereumGasDivinerConfigSchema } from './Schema.js';
|
|
6
6
|
export type EthereumGasDivinerConfig = DivinerConfig<{
|
|
7
7
|
schema: EthereumGasDivinerConfigSchema;
|
|
8
8
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAExF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAG5D,OAAO,EAAE,8BAA8B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAExF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAG5D,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAA;AAE5D,MAAM,MAAM,wBAAwB,GAAG,aAAa,CAAC;IAAE,MAAM,EAAE,8BAA8B,CAAA;CAAE,CAAC,CAAA;AAChG,MAAM,MAAM,wBAAwB,GAAG,aAAa,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC,CAAA;AAE/F,qBAAa,kBAAkB,CAAC,OAAO,SAAS,wBAAwB,GAAG,wBAAwB,CACjG,SAAQ,eAAe,CAAC,OAAO,CAC/B,YAAW,aAAa;IAExB,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA2D;IAC3G,gBAAyB,mBAAmB,EAAE,MAAM,CAAiC;IACrF,OAAgB,YAAY,EAAE,MAAM,CAAoB;cAE/B,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAIjF"}
|
package/dist/node/Plugin.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EthereumGasDiviner } from './Diviner';
|
|
1
|
+
import { EthereumGasDiviner } from './Diviner.js';
|
|
2
2
|
export declare const EthereumGasPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetDivinerPlugin<EthereumGasDiviner<import("@xylabs/object").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
4
4
|
addToResolvers?: boolean;
|
|
@@ -7,7 +7,7 @@ export declare const EthereumGasPlugin: () => import("@xyo-network/payloadset-pl
|
|
|
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: import("./Schema").EthereumGasDivinerConfigSchema;
|
|
10
|
+
schema: import("./Schema.js").EthereumGasDivinerConfigSchema;
|
|
11
11
|
}, "schema"> & {
|
|
12
12
|
schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
|
|
13
13
|
}, "schema"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAEjD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;GAQ3B,CAAA"}
|
package/dist/node/Plugin.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EthereumGasDiviner } from './Diviner';
|
|
1
|
+
import { EthereumGasDiviner } from './Diviner.js';
|
|
2
2
|
export declare const EthereumGasPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetDivinerPlugin<EthereumGasDiviner<import("@xylabs/object").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
4
4
|
addToResolvers?: boolean;
|
|
@@ -7,7 +7,7 @@ export declare const EthereumGasPlugin: () => import("@xyo-network/payloadset-pl
|
|
|
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: import("./Schema").EthereumGasDivinerConfigSchema;
|
|
10
|
+
schema: import("./Schema.js").EthereumGasDivinerConfigSchema;
|
|
11
11
|
}, "schema"> & {
|
|
12
12
|
schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
|
|
13
13
|
}, "schema"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAEjD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;GAQ3B,CAAA"}
|
package/dist/node/Plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EthereumGasDiviner } from './Diviner';
|
|
1
|
+
import { EthereumGasDiviner } from './Diviner.js';
|
|
2
2
|
export declare const EthereumGasPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetDivinerPlugin<EthereumGasDiviner<import("@xylabs/object").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
4
4
|
addToResolvers?: boolean;
|
|
@@ -7,7 +7,7 @@ export declare const EthereumGasPlugin: () => import("@xyo-network/payloadset-pl
|
|
|
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: import("./Schema").EthereumGasDivinerConfigSchema;
|
|
10
|
+
schema: import("./Schema.js").EthereumGasDivinerConfigSchema;
|
|
11
11
|
}, "schema"> & {
|
|
12
12
|
schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
|
|
13
13
|
}, "schema"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAEjD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;GAQ3B,CAAA"}
|
package/dist/node/index.cjs.map
CHANGED
|
@@ -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'\n// eslint-disable-next-line import/no-default-export\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,OAAkB,uBAAG,UAAS,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,QAAO,+BAAO,OAAO,0BAAW,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,QAA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AAiB,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EACjE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,mBAAmB,OAAO,MAAM;AAAA,IAChD;AAAA,EACF;AACF;","names":["import_gas_price_payload_plugin","getFeePerGas","getBaseFee","getFeePerGas","getPriorityFeePerGas","import_regression","getBaseFee","getFeePerGas","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.js'\n// eslint-disable-next-line import/no-default-export\nexport { EthereumGasPlugin as default, EthereumGasPlugin } from './Plugin.js'\nexport * from './Schema.js'\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.js'\nimport { EthereumGasDivinerConfigSchema } from './Schema.js'\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.js'\nimport {\n isEthereumGasBlocknativePayload,\n isEthereumGasEtherchainV2Payload,\n isEthereumGasEtherscanPayload,\n isEthereumGasEthersPayload,\n isEthereumGasEthgasstationPayload,\n} from './identities/index.js'\nimport {\n transformGasFromBlocknative,\n transformGasFromEtherchainV2,\n transformGasFromEthers,\n transformGasFromEtherscan,\n transformGasFromEthgasstation,\n} from './transforms/index.js'\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.js'\n\nexport const EthereumGasPlugin = () =>\n createPayloadSetDivinerPlugin<EthereumGasDiviner>(\n { required: { [EthereumGasSchema]: 1 }, schema: PayloadSetS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BAAgB,SAAS,OAAO,iCAAiC,EAAE,IAAI,6BAA6B;AAC1G,QAAM,mBAA8B,CAAC,GAAG,aAAa,GAAG,cAAc,GAAG,QAAQ,GAAG,WAAW,GAAG,aAAa;AAC/G,QAAM,MAAM,QAAQ,gBAAgB;AACpC,QAAM,YAAY,KAAK,IAAI;AAC3B,QAAM,UAAU,MAAM,IAAI,sCAAmC,EAAE,QAAQ,kDAAkB,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,UAAU,CAAC,EAAE,MAAM;AAChI,SAAO;AACT;;;AY9BO,IAAM,gCAA+D;AAGrE,IAAM,iCAAiE;;;AbQvE,IAAM,qBAAN,cACG,wCAEV;AAAA,EACE,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,8BAA8B;AAAA,EAC1G,OAAyB,sBAA8B;AAAA,EACvD,OAAgB,eAAuB;AAAA,EAEvC,MAAyB,cAAc,UAA0C;AAC/E,UAAM,OAAO,MAAM,UAAU,YAAY,CAAC,CAAC;AAC3C,WAAO,CAAC,IAAI;AAAA,EACd;AACF;;;AcxBA,IAAAC,mCAAkC;AAClC,2BAAiC;AACjC,+BAA8C;AAIvC,IAAM,oBAAoB,UAC/B;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,kDAAiB,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EACjE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,mBAAmB,OAAO,MAAM;AAAA,IAChD;AAAA,EACF;AACF;","names":["import_gas_price_payload_plugin","getFeePerGas","getBaseFee","getFeePerGas","getPriorityFeePerGas","import_regression","getBaseFee","getFeePerGas","import_regression","getBaseFee","getFeePerGas","getPriorityFeePerGas","import_gas_price_payload_plugin"]}
|
package/dist/node/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './Diviner';
|
|
2
|
-
export { EthereumGasPlugin as default, EthereumGasPlugin } from './Plugin';
|
|
3
|
-
export * from './Schema';
|
|
1
|
+
export * from './Diviner.js';
|
|
2
|
+
export { EthereumGasPlugin as default, EthereumGasPlugin } from './Plugin.js';
|
|
3
|
+
export * from './Schema.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
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/node/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './Diviner';
|
|
2
|
-
export { EthereumGasPlugin as default, EthereumGasPlugin } from './Plugin';
|
|
3
|
-
export * from './Schema';
|
|
1
|
+
export * from './Diviner.js';
|
|
2
|
+
export { EthereumGasPlugin as default, EthereumGasPlugin } from './Plugin.js';
|
|
3
|
+
export * from './Schema.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
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/node/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './Diviner';
|
|
2
|
-
export { EthereumGasPlugin as default, EthereumGasPlugin } from './Plugin';
|
|
3
|
-
export * from './Schema';
|
|
1
|
+
export * from './Diviner.js';
|
|
2
|
+
export { EthereumGasPlugin as default, EthereumGasPlugin } from './Plugin.js';
|
|
3
|
+
export * from './Schema.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/node/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
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/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../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":["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,SAAS,uBAAuB;AAEhC,SAAS,qBAAAA,0BAAyB;;;ACFlC,SAA6B,yBAAkC;AAC/D,SAAS,sBAAsB;;;ACD/B,SAAS,cAAc;AASvB,IAAM,cAAc,CAAC,OAAkB,uBAAG,UAAS,EAAE,OAAO,CAAC,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,SAAS;AAU1F,IAAM,kBAAkB,CAAC,MAAiB,uBAA2D;AACnG,SAAO,YAAY,KAAK,IAAI,kBAAkB,EAAE,OAAO,MAAM,CAAC;AAChE;AAOO,IAAM,UAAU,CAAC,UAA6C;AACnE,QAAM,QAAO,+BAAO,OAAO,YAAW,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,KAAK,gBAAgB,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG;AAAA,MACzD,QAAQ,gBAAgB,MAAM,CAAC,MAAM,EAAE,kBAAkB,MAAM;AAAA,MAC/D,UAAU,gBAAgB,MAAM,CAAC,MAAM,EAAE,kBAAkB,QAAQ;AAAA,IACrE;AAAA,EACF;AACA,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Y,SAAS,OAAO,6BAA6B,EAAE,IAAI,yBAAyB;AAC9F,QAAM,gBAAgB,SAAS,OAAO,iCAAiC,EAAE,IAAI,6BAA6B;AAC1G,QAAM,mBAA8B,CAAC,GAAG,aAAa,GAAG,cAAc,GAAG,QAAQ,GAAG,WAAW,GAAG,aAAa;AAC/G,QAAM,MAAM,QAAQ,gBAAgB;AACpC,QAAM,YAAY,KAAK,IAAI;AAC3B,QAAM,UAAU,MAAM,IAAI,eAAmC,EAAE,QAAQ,kBAAkB,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,UAAU,CAAC,EAAE,MAAM;AAChI,SAAO;AACT;;;AY9BO,IAAM,gCAA+D;AAGrE,IAAM,iCAAiE;;;AbQvE,IAAM,qBAAN,cACG,gBAEV;AAAA,EACE,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,8BAA8B;AAAA,EAC1G,OAAyB,sBAA8B;AAAA,EACvD,OAAgB,eAAuBC;AAAA,EAEvC,MAAyB,cAAc,UAA0C;AAC/E,UAAM,OAAO,MAAM,UAAU,YAAY,CAAC,CAAC;AAC3C,WAAO,CAAC,IAAI;AAAA,EACd;AACF;;;AcxBA,SAAS,qBAAAC,0BAAyB;AAClC,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;AAIvC,IAAM,oBAAoB,MAC/B;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,kBAAiB,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EACjE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,mBAAmB,OAAO,MAAM;AAAA,IAChD;AAAA,EACF;AACF;","names":["EthereumGasSchema","getFeePerGas","getBaseFee","getFeePerGas","getPriorityFeePerGas","linear","getBaseFee","getFeePerGas","linear","getBaseFee","getFeePerGas","getPriorityFeePerGas","EthereumGasSchema","EthereumGasSchema","EthereumGasSchema"]}
|
|
1
|
+
{"version":3,"sources":["../../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":["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.js'\nimport { EthereumGasDivinerConfigSchema } from './Schema.js'\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.js'\nimport {\n isEthereumGasBlocknativePayload,\n isEthereumGasEtherchainV2Payload,\n isEthereumGasEtherscanPayload,\n isEthereumGasEthersPayload,\n isEthereumGasEthgasstationPayload,\n} from './identities/index.js'\nimport {\n transformGasFromBlocknative,\n transformGasFromEtherchainV2,\n transformGasFromEthers,\n transformGasFromEtherscan,\n transformGasFromEthgasstation,\n} from './transforms/index.js'\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.js'\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,SAAS,uBAAuB;AAEhC,SAAS,qBAAAA,0BAAyB;;;ACFlC,SAA6B,yBAAkC;AAC/D,SAAS,sBAAsB;;;ACD/B,SAAS,cAAc;AASvB,IAAM,cAAc,CAAC,OAAkB,uBAAG,UAAS,EAAE,OAAO,CAAC,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,SAAS;AAU1F,IAAM,kBAAkB,CAAC,MAAiB,uBAA2D;AACnG,SAAO,YAAY,KAAK,IAAI,kBAAkB,EAAE,OAAO,MAAM,CAAC;AAChE;AAOO,IAAM,UAAU,CAAC,UAA6C;AACnE,QAAM,QAAO,+BAAO,OAA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1G,OAAyB,sBAA8B;AAAA,EACvD,OAAgB,eAAuBC;AAAA,EAEvC,MAAyB,cAAc,UAA0C;AAC/E,UAAM,OAAO,MAAM,UAAU,YAAY,CAAC,CAAC;AAC3C,WAAO,CAAC,IAAI;AAAA,EACd;AACF;;;AcxBA,SAAS,qBAAAC,0BAAyB;AAClC,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;AAIvC,IAAM,oBAAoB,MAC/B;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,kBAAiB,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EACjE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,mBAAmB,OAAO,MAAM;AAAA,IAChD;AAAA,EACF;AACF;","names":["EthereumGasSchema","getFeePerGas","getBaseFee","getFeePerGas","getPriorityFeePerGas","linear","getBaseFee","getFeePerGas","linear","getBaseFee","getFeePerGas","getPriorityFeePerGas","EthereumGasSchema","EthereumGasSchema","EthereumGasSchema"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './isEthereumGasBlocknativePayload';
|
|
2
|
-
export * from './isEthereumGasEtherchainV2Payload';
|
|
3
|
-
export * from './isEthereumGasEtherscanPayload';
|
|
4
|
-
export * from './isEthereumGasEthersPayload';
|
|
5
|
-
export * from './isEthereumGasEthgasstationPayload';
|
|
1
|
+
export * from './isEthereumGasBlocknativePayload.js';
|
|
2
|
+
export * from './isEthereumGasEtherchainV2Payload.js';
|
|
3
|
+
export * from './isEthereumGasEtherscanPayload.js';
|
|
4
|
+
export * from './isEthereumGasEthersPayload.js';
|
|
5
|
+
export * from './isEthereumGasEthgasstationPayload.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/identities/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/identities/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAA;AACpD,cAAc,uCAAuC,CAAA;AACrD,cAAc,oCAAoC,CAAA;AAClD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,wCAAwC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './isEthereumGasBlocknativePayload';
|
|
2
|
-
export * from './isEthereumGasEtherchainV2Payload';
|
|
3
|
-
export * from './isEthereumGasEtherscanPayload';
|
|
4
|
-
export * from './isEthereumGasEthersPayload';
|
|
5
|
-
export * from './isEthereumGasEthgasstationPayload';
|
|
1
|
+
export * from './isEthereumGasBlocknativePayload.js';
|
|
2
|
+
export * from './isEthereumGasEtherchainV2Payload.js';
|
|
3
|
+
export * from './isEthereumGasEtherscanPayload.js';
|
|
4
|
+
export * from './isEthereumGasEthersPayload.js';
|
|
5
|
+
export * from './isEthereumGasEthgasstationPayload.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/identities/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/identities/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAA;AACpD,cAAc,uCAAuC,CAAA;AACrD,cAAc,oCAAoC,CAAA;AAClD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,wCAAwC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './isEthereumGasBlocknativePayload';
|
|
2
|
-
export * from './isEthereumGasEtherchainV2Payload';
|
|
3
|
-
export * from './isEthereumGasEtherscanPayload';
|
|
4
|
-
export * from './isEthereumGasEthersPayload';
|
|
5
|
-
export * from './isEthereumGasEthgasstationPayload';
|
|
1
|
+
export * from './isEthereumGasBlocknativePayload.js';
|
|
2
|
+
export * from './isEthereumGasEtherchainV2Payload.js';
|
|
3
|
+
export * from './isEthereumGasEtherscanPayload.js';
|
|
4
|
+
export * from './isEthereumGasEthersPayload.js';
|
|
5
|
+
export * from './isEthereumGasEthgasstationPayload.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/identities/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/identities/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAA;AACpD,cAAc,uCAAuC,CAAA;AACrD,cAAc,oCAAoC,CAAA;AAClD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,wCAAwC,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './divineGas';
|
|
1
|
+
export * from './divineGas.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './divineGas';
|
|
1
|
+
export * from './divineGas.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
|
package/dist/node/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './divineGas';
|
|
1
|
+
export * from './divineGas.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './transformGasFromBlocknative';
|
|
2
|
-
export * from './transformGasFromEtherchainV2';
|
|
3
|
-
export * from './transformGasFromEthers';
|
|
4
|
-
export * from './transformGasFromEtherscan';
|
|
5
|
-
export * from './transformGasFromEthgasstation';
|
|
1
|
+
export * from './transformGasFromBlocknative.js';
|
|
2
|
+
export * from './transformGasFromEtherchainV2.js';
|
|
3
|
+
export * from './transformGasFromEthers.js';
|
|
4
|
+
export * from './transformGasFromEtherscan.js';
|
|
5
|
+
export * from './transformGasFromEthgasstation.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/transforms/index.ts"],"names":[],"mappings":"AAAA,cAAc
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/transforms/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAA;AAChD,cAAc,mCAAmC,CAAA;AACjD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,oCAAoC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './transformGasFromBlocknative';
|
|
2
|
-
export * from './transformGasFromEtherchainV2';
|
|
3
|
-
export * from './transformGasFromEthers';
|
|
4
|
-
export * from './transformGasFromEtherscan';
|
|
5
|
-
export * from './transformGasFromEthgasstation';
|
|
1
|
+
export * from './transformGasFromBlocknative.js';
|
|
2
|
+
export * from './transformGasFromEtherchainV2.js';
|
|
3
|
+
export * from './transformGasFromEthers.js';
|
|
4
|
+
export * from './transformGasFromEtherscan.js';
|
|
5
|
+
export * from './transformGasFromEthgasstation.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/transforms/index.ts"],"names":[],"mappings":"AAAA,cAAc
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/transforms/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAA;AAChD,cAAc,mCAAmC,CAAA;AACjD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,oCAAoC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './transformGasFromBlocknative';
|
|
2
|
-
export * from './transformGasFromEtherchainV2';
|
|
3
|
-
export * from './transformGasFromEthers';
|
|
4
|
-
export * from './transformGasFromEtherscan';
|
|
5
|
-
export * from './transformGasFromEthgasstation';
|
|
1
|
+
export * from './transformGasFromBlocknative.js';
|
|
2
|
+
export * from './transformGasFromEtherchainV2.js';
|
|
3
|
+
export * from './transformGasFromEthers.js';
|
|
4
|
+
export * from './transformGasFromEtherscan.js';
|
|
5
|
+
export * from './transformGasFromEthgasstation.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/transforms/index.ts"],"names":[],"mappings":"AAAA,cAAc
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/transforms/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAA;AAChD,cAAc,mCAAmC,CAAA;AACjD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,oCAAoC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './sampleBlocknativeGas';
|
|
2
|
-
export * from './sampleEtherchainGasV2';
|
|
3
|
-
export * from './sampleEtherscanGas';
|
|
4
|
-
export * from './sampleEthersGas';
|
|
5
|
-
export * from './sampleEthgasstationGas';
|
|
1
|
+
export * from './sampleBlocknativeGas.js';
|
|
2
|
+
export * from './sampleEtherchainGasV2.js';
|
|
3
|
+
export * from './sampleEtherscanGas.js';
|
|
4
|
+
export * from './sampleEthersGas.js';
|
|
5
|
+
export * from './sampleEthgasstationGas.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/test/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/test/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA;AACpC,cAAc,6BAA6B,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './sampleBlocknativeGas';
|
|
2
|
-
export * from './sampleEtherchainGasV2';
|
|
3
|
-
export * from './sampleEtherscanGas';
|
|
4
|
-
export * from './sampleEthersGas';
|
|
5
|
-
export * from './sampleEthgasstationGas';
|
|
1
|
+
export * from './sampleBlocknativeGas.js';
|
|
2
|
+
export * from './sampleEtherchainGasV2.js';
|
|
3
|
+
export * from './sampleEtherscanGas.js';
|
|
4
|
+
export * from './sampleEthersGas.js';
|
|
5
|
+
export * from './sampleEthgasstationGas.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/test/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/test/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA;AACpC,cAAc,6BAA6B,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './sampleBlocknativeGas';
|
|
2
|
-
export * from './sampleEtherchainGasV2';
|
|
3
|
-
export * from './sampleEtherscanGas';
|
|
4
|
-
export * from './sampleEthersGas';
|
|
5
|
-
export * from './sampleEthgasstationGas';
|
|
1
|
+
export * from './sampleBlocknativeGas.js';
|
|
2
|
+
export * from './sampleEtherchainGasV2.js';
|
|
3
|
+
export * from './sampleEtherscanGas.js';
|
|
4
|
+
export * from './sampleEthersGas.js';
|
|
5
|
+
export * from './sampleEthgasstationGas.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/test/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/test/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA;AACpC,cAAc,6BAA6B,CAAA"}
|