@xyo-network/gas-price-plugin 2.53.0 → 2.53.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/cjs/Diviner.js.map +1 -1
- package/dist/cjs/lib/divineGas.js +1 -1
- package/dist/cjs/lib/divineGas.js.map +1 -1
- package/dist/cjs/lib/identities/isXyoEthereumGasBlocknativePayload.js.map +1 -1
- package/dist/cjs/lib/identities/isXyoEthereumGasEtherchainV2Payload.js.map +1 -1
- package/dist/cjs/lib/identities/isXyoEthereumGasEthersPayload.js.map +1 -1
- package/dist/cjs/lib/identities/isXyoEthereumGasEtherscanPayload.js.map +1 -1
- package/dist/cjs/lib/identities/isXyoEthereumGasEthgasstationPayload.js.map +1 -1
- package/dist/docs.json +231 -237
- package/dist/esm/Diviner.js.map +1 -1
- package/dist/esm/lib/divineGas.js +2 -2
- package/dist/esm/lib/divineGas.js.map +1 -1
- package/dist/esm/lib/identities/isXyoEthereumGasBlocknativePayload.js.map +1 -1
- package/dist/esm/lib/identities/isXyoEthereumGasEtherchainV2Payload.js.map +1 -1
- package/dist/esm/lib/identities/isXyoEthereumGasEthersPayload.js.map +1 -1
- package/dist/esm/lib/identities/isXyoEthereumGasEtherscanPayload.js.map +1 -1
- package/dist/esm/lib/identities/isXyoEthereumGasEthgasstationPayload.js.map +1 -1
- package/dist/types/Diviner.d.ts +2 -2
- package/dist/types/Diviner.d.ts.map +1 -1
- package/dist/types/lib/divineGas.d.ts +2 -4
- package/dist/types/lib/divineGas.d.ts.map +1 -1
- package/dist/types/lib/identities/isXyoEthereumGasBlocknativePayload.d.ts +2 -2
- package/dist/types/lib/identities/isXyoEthereumGasBlocknativePayload.d.ts.map +1 -1
- package/dist/types/lib/identities/isXyoEthereumGasEtherchainV2Payload.d.ts +2 -2
- package/dist/types/lib/identities/isXyoEthereumGasEtherchainV2Payload.d.ts.map +1 -1
- package/dist/types/lib/identities/isXyoEthereumGasEthersPayload.d.ts +2 -2
- package/dist/types/lib/identities/isXyoEthereumGasEthersPayload.d.ts.map +1 -1
- package/dist/types/lib/identities/isXyoEthereumGasEtherscanPayload.d.ts +2 -2
- package/dist/types/lib/identities/isXyoEthereumGasEtherscanPayload.d.ts.map +1 -1
- package/dist/types/lib/identities/isXyoEthereumGasEthgasstationPayload.d.ts +2 -2
- package/dist/types/lib/identities/isXyoEthereumGasEthgasstationPayload.d.ts.map +1 -1
- package/package.json +13 -13
- package/src/Diviner.ts +2 -2
- package/src/lib/divineGas.ts +4 -4
- package/src/lib/identities/isXyoEthereumGasBlocknativePayload.ts +2 -2
- package/src/lib/identities/isXyoEthereumGasEtherchainV2Payload.ts +2 -2
- package/src/lib/identities/isXyoEthereumGasEthersPayload.ts +2 -2
- package/src/lib/identities/isXyoEthereumGasEtherscanPayload.ts +2 -2
- package/src/lib/identities/isXyoEthereumGasEthgasstationPayload.ts +2 -2
package/dist/esm/Diviner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Diviner.js","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAA+C,MAAM,sBAAsB,CAAA;AACnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAK5E,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAA;AAK5D,MAAM,OAAO,qBACX,SAAQ,eAAwB;IAGhC,MAAM,CAAU,YAAY,GAAW,iCAAiC,CAAA;IACxE,MAAM,CAAU,YAAY,GAAW,oBAAoB,CAAA;IAElD,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"Diviner.js","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAA+C,MAAM,sBAAsB,CAAA;AACnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAK5E,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAA;AAK5D,MAAM,OAAO,qBACX,SAAQ,eAAwB;IAGhC,MAAM,CAAU,YAAY,GAAW,iCAAiC,CAAA;IACxE,MAAM,CAAU,YAAY,GAAW,oBAAoB,CAAA;IAElD,MAAM,CAAC,QAAoB;QAClC,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAA;QACtC,OAAO,CAAC,IAAI,CAAC,CAAA;IACf,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { XyoEthereumGasSchema } from '@xyo-network/gas-price-payload-plugin';
|
|
2
|
-
import {
|
|
2
|
+
import { PayloadBuilder } from '@xyo-network/payload-builder';
|
|
3
3
|
import { average } from './average';
|
|
4
4
|
import { isXyoEthereumGasBlocknativePayload, isXyoEthereumGasEtherchainV2Payload, isXyoEthereumGasEtherscanPayload, isXyoEthereumGasEthersPayload, isXyoEthereumGasEthgasstationPayload, } from './identities';
|
|
5
5
|
import { transformGasFromBlocknative, transformGasFromEtherchainV2, transformGasFromEthers, transformGasFromEtherscan, transformGasFromEthgasstation, } from './transforms';
|
|
@@ -12,7 +12,7 @@ export const divineGas = (payloads) => {
|
|
|
12
12
|
const transactionCosts = [...blocknative, ...etherchainV2, ...ethers, ...etherscan, ...ethgasstation];
|
|
13
13
|
const avg = average(transactionCosts);
|
|
14
14
|
const timestamp = Date.now();
|
|
15
|
-
const payload = new
|
|
15
|
+
const payload = new PayloadBuilder({ schema: XyoEthereumGasSchema }).fields({ ...avg, timestamp }).build();
|
|
16
16
|
return payload;
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=divineGas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divineGas.js","sourceRoot":"","sources":["../../../src/lib/divineGas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAC5G,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"divineGas.js","sourceRoot":"","sources":["../../../src/lib/divineGas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAC5G,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAG7D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EACL,kCAAkC,EAClC,mCAAmC,EACnC,gCAAgC,EAChC,6BAA6B,EAC7B,oCAAoC,GACrC,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,sBAAsB,EACtB,yBAAyB,EACzB,6BAA6B,GAC9B,MAAM,cAAc,CAAA;AAErB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,QAAmB,EAAyB,EAAE;IACtE,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,kCAAkC,CAAC,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAA;IACxG,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,mCAAmC,CAAC,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;IAC3G,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAA;IACzF,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,gCAAgC,CAAC,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAA;IAClG,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC,oCAAoC,CAAC,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAA;IAC9G,MAAM,gBAAgB,GAAc,CAAC,GAAG,WAAW,EAAE,GAAG,YAAY,EAAE,GAAG,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,aAAa,CAAC,CAAA;IAChH,MAAM,GAAG,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;IACrC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;IAC5B,MAAM,OAAO,GAAG,IAAI,cAAc,CAAwB,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,KAAK,EAAE,CAAA;IACjI,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isXyoEthereumGasBlocknativePayload.js","sourceRoot":"","sources":["../../../../src/lib/identities/isXyoEthereumGasBlocknativePayload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,+BAA+B,EAAE,MAAM,sDAAsD,CAAA;AAGxI,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"isXyoEthereumGasBlocknativePayload.js","sourceRoot":"","sources":["../../../../src/lib/identities/isXyoEthereumGasBlocknativePayload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,+BAA+B,EAAE,MAAM,sDAAsD,CAAA;AAGxI,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,OAAwB,EAA+C,EAAE;IAC1H,OAAO,OAAO,EAAE,MAAM,KAAK,+BAA+B,CAAA;AAC5D,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isXyoEthereumGasEtherchainV2Payload.js","sourceRoot":"","sources":["../../../../src/lib/identities/isXyoEthereumGasEtherchainV2Payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,gCAAgC,EAAE,MAAM,iEAAiE,CAAA;AAGrJ,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"isXyoEthereumGasEtherchainV2Payload.js","sourceRoot":"","sources":["../../../../src/lib/identities/isXyoEthereumGasEtherchainV2Payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,gCAAgC,EAAE,MAAM,iEAAiE,CAAA;AAGrJ,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,OAAwB,EAAgD,EAAE;IAC5H,OAAO,OAAO,EAAE,MAAM,KAAK,gCAAgC,CAAA;AAC7D,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isXyoEthereumGasEthersPayload.js","sourceRoot":"","sources":["../../../../src/lib/identities/isXyoEthereumGasEthersPayload.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,0BAA0B,EAAE,MAAM,iDAAiD,CAAA;AAGzH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"isXyoEthereumGasEthersPayload.js","sourceRoot":"","sources":["../../../../src/lib/identities/isXyoEthereumGasEthersPayload.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,0BAA0B,EAAE,MAAM,iDAAiD,CAAA;AAGzH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,OAAwB,EAA0C,EAAE;IAChH,OAAO,OAAO,EAAE,MAAM,KAAK,0BAA0B,CAAA;AACvD,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isXyoEthereumGasEtherscanPayload.js","sourceRoot":"","sources":["../../../../src/lib/identities/isXyoEthereumGasEtherscanPayload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,6BAA6B,EAAE,MAAM,oDAAoD,CAAA;AAGlI,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"isXyoEthereumGasEtherscanPayload.js","sourceRoot":"","sources":["../../../../src/lib/identities/isXyoEthereumGasEtherscanPayload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,6BAA6B,EAAE,MAAM,oDAAoD,CAAA;AAGlI,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,OAAwB,EAA6C,EAAE;IACtH,OAAO,OAAO,EAAE,MAAM,KAAK,6BAA6B,CAAA;AAC1D,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isXyoEthereumGasEthgasstationPayload.js","sourceRoot":"","sources":["../../../../src/lib/identities/isXyoEthereumGasEthgasstationPayload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,iCAAiC,EAAE,MAAM,wDAAwD,CAAA;AAG9I,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"isXyoEthereumGasEthgasstationPayload.js","sourceRoot":"","sources":["../../../../src/lib/identities/isXyoEthereumGasEthgasstationPayload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,iCAAiC,EAAE,MAAM,wDAAwD,CAAA;AAG9I,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,OAAwB,EAAiD,EAAE;IAC9H,OAAO,OAAO,EAAE,MAAM,KAAK,iCAAiC,CAAA;AAC9D,CAAC,CAAA"}
|
package/dist/types/Diviner.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbstractDiviner, DivinerConfig, DivinerModule, DivinerParams } from '@xyo-network/diviner';
|
|
2
2
|
import { AnyConfigSchema } from '@xyo-network/module';
|
|
3
|
-
import {
|
|
3
|
+
import { Payload } from '@xyo-network/payload-model';
|
|
4
4
|
import { Promisable } from '@xyo-network/promise';
|
|
5
5
|
import { XyoEthereumGasDivinerConfigSchema } from './Schema';
|
|
6
6
|
export type XyoEthereumGasDivinerConfig = DivinerConfig<{
|
|
@@ -10,6 +10,6 @@ export type XyoEthereumGasDivinerParams = DivinerParams<AnyConfigSchema<XyoEther
|
|
|
10
10
|
export declare class XyoEthereumGasDiviner<TParams extends XyoEthereumGasDivinerParams = XyoEthereumGasDivinerParams> extends AbstractDiviner<TParams> implements DivinerModule {
|
|
11
11
|
static configSchema: string;
|
|
12
12
|
static targetSchema: string;
|
|
13
|
-
divine(payloads?:
|
|
13
|
+
divine(payloads?: Payload[]): Promisable<Payload[]>;
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=Diviner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEnG,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEnG,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAGjD,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAA;AAE5D,MAAM,MAAM,2BAA2B,GAAG,aAAa,CAAC;IAAE,MAAM,EAAE,iCAAiC,CAAA;CAAE,CAAC,CAAA;AACtG,MAAM,MAAM,2BAA2B,GAAG,aAAa,CAAC,eAAe,CAAC,2BAA2B,CAAC,CAAC,CAAA;AAErG,qBAAa,qBAAqB,CAAC,OAAO,SAAS,2BAA2B,GAAG,2BAA2B,CAC1G,SAAQ,eAAe,CAAC,OAAO,CAC/B,YAAW,aAAa;IAExB,OAAgB,YAAY,EAAE,MAAM,CAAoC;IACxE,OAAgB,YAAY,EAAE,MAAM,CAAuB;IAElD,MAAM,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC;CAI7D"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { XyoEthereumGasPayload } from '@xyo-network/gas-price-payload-plugin';
|
|
2
|
-
import {
|
|
3
|
-
export declare const divineGas: (payloads:
|
|
4
|
-
schema: string;
|
|
5
|
-
}>) => XyoEthereumGasPayload;
|
|
2
|
+
import { Payload } from '@xyo-network/payload-model';
|
|
3
|
+
export declare const divineGas: (payloads: Payload[]) => XyoEthereumGasPayload;
|
|
6
4
|
//# sourceMappingURL=divineGas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divineGas.d.ts","sourceRoot":"","sources":["../../../src/lib/divineGas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,qBAAqB,EAAwB,MAAM,uCAAuC,CAAA;AAE5G,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"divineGas.d.ts","sourceRoot":"","sources":["../../../src/lib/divineGas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,qBAAqB,EAAwB,MAAM,uCAAuC,CAAA;AAE5G,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAkBpD,eAAO,MAAM,SAAS,aAAc,OAAO,EAAE,KAAG,qBAW/C,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const isXyoEthereumGasBlocknativePayload: (payload?:
|
|
1
|
+
import { Payload } from '@xyo-network/payload-model';
|
|
2
|
+
export declare const isXyoEthereumGasBlocknativePayload: (payload?: Payload | null) => payload is import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/blocknative-ethereum-gas-payload-plugin").EthereumGasBlocknativeResponse & {
|
|
3
3
|
schema: "network.xyo.blockchain.ethereum.gas.blocknative";
|
|
4
4
|
timestamp: number;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isXyoEthereumGasBlocknativePayload.d.ts","sourceRoot":"","sources":["../../../../src/lib/identities/isXyoEthereumGasBlocknativePayload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"isXyoEthereumGasBlocknativePayload.d.ts","sourceRoot":"","sources":["../../../../src/lib/identities/isXyoEthereumGasBlocknativePayload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,eAAO,MAAM,kCAAkC,aAAc,OAAO,GAAG,IAAI;;;CAE1E,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const isXyoEthereumGasEtherchainV2Payload: (payload?:
|
|
1
|
+
import { Payload } from '@xyo-network/payload-model';
|
|
2
|
+
export declare const isXyoEthereumGasEtherchainV2Payload: (payload?: Payload | null) => payload is import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/etherchain-gas-ethereum-blockchain-payload-plugins").EthereumGasEtherchainV2Response & {
|
|
3
3
|
schema: "network.xyo.blockchain.ethereum.gas.etherchain.v2";
|
|
4
4
|
timestamp: number;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isXyoEthereumGasEtherchainV2Payload.d.ts","sourceRoot":"","sources":["../../../../src/lib/identities/isXyoEthereumGasEtherchainV2Payload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"isXyoEthereumGasEtherchainV2Payload.d.ts","sourceRoot":"","sources":["../../../../src/lib/identities/isXyoEthereumGasEtherchainV2Payload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,eAAO,MAAM,mCAAmC,aAAc,OAAO,GAAG,IAAI;;;CAE3E,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const isXyoEthereumGasEthersPayload: (payload?:
|
|
1
|
+
import { Payload } from '@xyo-network/payload-model';
|
|
2
|
+
export declare const isXyoEthereumGasEthersPayload: (payload?: Payload | null) => payload is import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/ethers-ethereum-gas-payload-plugin").EthereumGasEthersResponse & {
|
|
3
3
|
schema: "network.xyo.blockchain.ethereum.gas.ethers";
|
|
4
4
|
timestamp: number;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isXyoEthereumGasEthersPayload.d.ts","sourceRoot":"","sources":["../../../../src/lib/identities/isXyoEthereumGasEthersPayload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"isXyoEthereumGasEthersPayload.d.ts","sourceRoot":"","sources":["../../../../src/lib/identities/isXyoEthereumGasEthersPayload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,eAAO,MAAM,6BAA6B,aAAc,OAAO,GAAG,IAAI;;;CAErE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const isXyoEthereumGasEtherscanPayload: (payload?:
|
|
1
|
+
import { Payload } from '@xyo-network/payload-model';
|
|
2
|
+
export declare const isXyoEthereumGasEtherscanPayload: (payload?: Payload | null) => payload is import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/etherscan-ethereum-gas-payload-plugin").EthereumGasEtherscanResponse & {
|
|
3
3
|
schema: "network.xyo.blockchain.ethereum.gas.etherscan";
|
|
4
4
|
timestamp: number;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isXyoEthereumGasEtherscanPayload.d.ts","sourceRoot":"","sources":["../../../../src/lib/identities/isXyoEthereumGasEtherscanPayload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"isXyoEthereumGasEtherscanPayload.d.ts","sourceRoot":"","sources":["../../../../src/lib/identities/isXyoEthereumGasEtherscanPayload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,eAAO,MAAM,gCAAgC,aAAc,OAAO,GAAG,IAAI;;;CAExE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const isXyoEthereumGasEthgasstationPayload: (payload?:
|
|
1
|
+
import { Payload } from '@xyo-network/payload-model';
|
|
2
|
+
export declare const isXyoEthereumGasEthgasstationPayload: (payload?: Payload | null) => payload is import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/ethgasstation-ethereum-gas-payload-plugin").EthereumGasEthgasstationResponse & {
|
|
3
3
|
schema: "network.xyo.blockchain.ethereum.gas.ethgasstation";
|
|
4
4
|
timestamp: number;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isXyoEthereumGasEthgasstationPayload.d.ts","sourceRoot":"","sources":["../../../../src/lib/identities/isXyoEthereumGasEthgasstationPayload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"isXyoEthereumGasEthgasstationPayload.d.ts","sourceRoot":"","sources":["../../../../src/lib/identities/isXyoEthereumGasEthgasstationPayload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,eAAO,MAAM,oCAAoC,aAAc,OAAO,GAAG,IAAI;;;CAE5E,CAAA"}
|
package/package.json
CHANGED
|
@@ -11,18 +11,18 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@xylabs/exists": "^2.7.4",
|
|
14
|
-
"@xyo-network/blocknative-ethereum-gas-payload-plugin": "^2.53.
|
|
15
|
-
"@xyo-network/diviner": "^2.53.
|
|
16
|
-
"@xyo-network/etherchain-gas-ethereum-blockchain-payload-plugins": "^2.53.
|
|
17
|
-
"@xyo-network/ethers-ethereum-gas-payload-plugin": "^2.53.
|
|
18
|
-
"@xyo-network/etherscan-ethereum-gas-payload-plugin": "^2.53.
|
|
19
|
-
"@xyo-network/ethgasstation-ethereum-gas-payload-plugin": "^2.53.
|
|
20
|
-
"@xyo-network/gas-price-payload-plugin": "^2.53.
|
|
21
|
-
"@xyo-network/module": "^2.53.
|
|
22
|
-
"@xyo-network/payload-builder": "^2.53.
|
|
23
|
-
"@xyo-network/payload-model": "^2.53.
|
|
24
|
-
"@xyo-network/payloadset-plugin": "^2.53.
|
|
25
|
-
"@xyo-network/promise": "^2.53.
|
|
14
|
+
"@xyo-network/blocknative-ethereum-gas-payload-plugin": "^2.53.2",
|
|
15
|
+
"@xyo-network/diviner": "^2.53.2",
|
|
16
|
+
"@xyo-network/etherchain-gas-ethereum-blockchain-payload-plugins": "^2.53.2",
|
|
17
|
+
"@xyo-network/ethers-ethereum-gas-payload-plugin": "^2.53.2",
|
|
18
|
+
"@xyo-network/etherscan-ethereum-gas-payload-plugin": "^2.53.2",
|
|
19
|
+
"@xyo-network/ethgasstation-ethereum-gas-payload-plugin": "^2.53.2",
|
|
20
|
+
"@xyo-network/gas-price-payload-plugin": "^2.53.2",
|
|
21
|
+
"@xyo-network/module": "^2.53.2",
|
|
22
|
+
"@xyo-network/payload-builder": "^2.53.2",
|
|
23
|
+
"@xyo-network/payload-model": "^2.53.2",
|
|
24
|
+
"@xyo-network/payloadset-plugin": "^2.53.2",
|
|
25
|
+
"@xyo-network/promise": "^2.53.2",
|
|
26
26
|
"regression": "^2.0.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
},
|
|
83
83
|
"sideEffects": false,
|
|
84
84
|
"types": "dist/types/index.d.ts",
|
|
85
|
-
"version": "2.53.
|
|
85
|
+
"version": "2.53.2"
|
|
86
86
|
}
|
package/src/Diviner.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractDiviner, DivinerConfig, DivinerModule, DivinerParams } from '@xyo-network/diviner'
|
|
2
2
|
import { XyoEthereumGasSchema } from '@xyo-network/gas-price-payload-plugin'
|
|
3
3
|
import { AnyConfigSchema } from '@xyo-network/module'
|
|
4
|
-
import {
|
|
4
|
+
import { Payload } from '@xyo-network/payload-model'
|
|
5
5
|
import { Promisable } from '@xyo-network/promise'
|
|
6
6
|
|
|
7
7
|
import { divineGas } from './lib'
|
|
@@ -17,7 +17,7 @@ export class XyoEthereumGasDiviner<TParams extends XyoEthereumGasDivinerParams =
|
|
|
17
17
|
static override configSchema: string = XyoEthereumGasDivinerConfigSchema
|
|
18
18
|
static override targetSchema: string = XyoEthereumGasSchema
|
|
19
19
|
|
|
20
|
-
override divine(payloads?:
|
|
20
|
+
override divine(payloads?: Payload[]): Promisable<Payload[]> {
|
|
21
21
|
const cost = divineGas(payloads ?? [])
|
|
22
22
|
return [cost]
|
|
23
23
|
}
|
package/src/lib/divineGas.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FeeData, XyoEthereumGasPayload, XyoEthereumGasSchema } from '@xyo-network/gas-price-payload-plugin'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
3
|
+
import { Payload } from '@xyo-network/payload-model'
|
|
4
4
|
|
|
5
5
|
import { average } from './average'
|
|
6
6
|
import {
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
transformGasFromEthgasstation,
|
|
19
19
|
} from './transforms'
|
|
20
20
|
|
|
21
|
-
export const divineGas = (payloads:
|
|
21
|
+
export const divineGas = (payloads: Payload[]): XyoEthereumGasPayload => {
|
|
22
22
|
const blocknative = payloads.filter(isXyoEthereumGasBlocknativePayload).map(transformGasFromBlocknative)
|
|
23
23
|
const etherchainV2 = payloads.filter(isXyoEthereumGasEtherchainV2Payload).map(transformGasFromEtherchainV2)
|
|
24
24
|
const ethers = payloads.filter(isXyoEthereumGasEthersPayload).map(transformGasFromEthers)
|
|
@@ -27,6 +27,6 @@ export const divineGas = (payloads: XyoPayloads): XyoEthereumGasPayload => {
|
|
|
27
27
|
const transactionCosts: FeeData[] = [...blocknative, ...etherchainV2, ...ethers, ...etherscan, ...ethgasstation]
|
|
28
28
|
const avg = average(transactionCosts)
|
|
29
29
|
const timestamp = Date.now()
|
|
30
|
-
const payload = new
|
|
30
|
+
const payload = new PayloadBuilder<XyoEthereumGasPayload>({ schema: XyoEthereumGasSchema }).fields({ ...avg, timestamp }).build()
|
|
31
31
|
return payload
|
|
32
32
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { XyoEthereumGasBlocknativePayload, XyoEthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'
|
|
2
|
-
import {
|
|
2
|
+
import { Payload } from '@xyo-network/payload-model'
|
|
3
3
|
|
|
4
|
-
export const isXyoEthereumGasBlocknativePayload = (payload?:
|
|
4
|
+
export const isXyoEthereumGasBlocknativePayload = (payload?: Payload | null): payload is XyoEthereumGasBlocknativePayload => {
|
|
5
5
|
return payload?.schema === XyoEthereumGasBlocknativeSchema
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { XyoEthereumGasEtherchainV2Payload, XyoEthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-gas-ethereum-blockchain-payload-plugins'
|
|
2
|
-
import {
|
|
2
|
+
import { Payload } from '@xyo-network/payload-model'
|
|
3
3
|
|
|
4
|
-
export const isXyoEthereumGasEtherchainV2Payload = (payload?:
|
|
4
|
+
export const isXyoEthereumGasEtherchainV2Payload = (payload?: Payload | null): payload is XyoEthereumGasEtherchainV2Payload => {
|
|
5
5
|
return payload?.schema === XyoEthereumGasEtherchainV2Schema
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { XyoEthereumGasEthersPayload, XyoEthereumGasEthersSchema } from '@xyo-network/ethers-ethereum-gas-payload-plugin'
|
|
2
|
-
import {
|
|
2
|
+
import { Payload } from '@xyo-network/payload-model'
|
|
3
3
|
|
|
4
|
-
export const isXyoEthereumGasEthersPayload = (payload?:
|
|
4
|
+
export const isXyoEthereumGasEthersPayload = (payload?: Payload | null): payload is XyoEthereumGasEthersPayload => {
|
|
5
5
|
return payload?.schema === XyoEthereumGasEthersSchema
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { XyoEthereumGasEtherscanPayload, XyoEthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'
|
|
2
|
-
import {
|
|
2
|
+
import { Payload } from '@xyo-network/payload-model'
|
|
3
3
|
|
|
4
|
-
export const isXyoEthereumGasEtherscanPayload = (payload?:
|
|
4
|
+
export const isXyoEthereumGasEtherscanPayload = (payload?: Payload | null): payload is XyoEthereumGasEtherscanPayload => {
|
|
5
5
|
return payload?.schema === XyoEthereumGasEtherscanSchema
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { XyoEthereumGasEthgasstationPayload, XyoEthereumGasEthgasstationSchema } from '@xyo-network/ethgasstation-ethereum-gas-payload-plugin'
|
|
2
|
-
import {
|
|
2
|
+
import { Payload } from '@xyo-network/payload-model'
|
|
3
3
|
|
|
4
|
-
export const isXyoEthereumGasEthgasstationPayload = (payload?:
|
|
4
|
+
export const isXyoEthereumGasEthgasstationPayload = (payload?: Payload | null): payload is XyoEthereumGasEthgasstationPayload => {
|
|
5
5
|
return payload?.schema === XyoEthereumGasEthgasstationSchema
|
|
6
6
|
}
|