@xyo-network/etherscan-ethereum-gas-plugin 2.75.14 → 2.75.15
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/Config.cjs.map +1 -1
- package/dist/browser/Config.d.cts +1 -1
- package/dist/browser/Config.d.cts.map +1 -1
- package/dist/browser/Config.d.mts +1 -1
- package/dist/browser/Config.d.mts.map +1 -1
- package/dist/browser/Config.d.ts +1 -1
- package/dist/browser/Config.d.ts.map +1 -1
- package/dist/browser/Plugin.cjs +2 -2
- package/dist/browser/Plugin.cjs.map +1 -1
- package/dist/browser/Plugin.js +1 -1
- package/dist/browser/Plugin.js.map +1 -1
- package/dist/browser/Witness.cjs +2 -2
- package/dist/browser/Witness.cjs.map +1 -1
- package/dist/browser/Witness.d.cts +2 -1
- package/dist/browser/Witness.d.cts.map +1 -1
- package/dist/browser/Witness.d.mts +2 -1
- package/dist/browser/Witness.d.mts.map +1 -1
- package/dist/browser/Witness.d.ts +2 -1
- package/dist/browser/Witness.d.ts.map +1 -1
- package/dist/browser/Witness.js +1 -1
- package/dist/browser/Witness.js.map +1 -1
- package/dist/browser/index.cjs +2 -2
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/docs.json +3747 -3062
- package/dist/node/Config.d.cts +1 -1
- package/dist/node/Config.d.cts.map +1 -1
- package/dist/node/Config.d.mts +1 -1
- package/dist/node/Config.d.mts.map +1 -1
- package/dist/node/Config.d.ts +1 -1
- package/dist/node/Config.d.ts.map +1 -1
- package/dist/node/Config.js.map +1 -1
- package/dist/node/Plugin.js +2 -2
- package/dist/node/Plugin.js.map +1 -1
- package/dist/node/Plugin.mjs +1 -1
- package/dist/node/Plugin.mjs.map +1 -1
- package/dist/node/Witness.d.cts +2 -1
- package/dist/node/Witness.d.cts.map +1 -1
- package/dist/node/Witness.d.mts +2 -1
- package/dist/node/Witness.d.mts.map +1 -1
- package/dist/node/Witness.d.ts +2 -1
- package/dist/node/Witness.d.ts.map +1 -1
- package/dist/node/Witness.js +2 -2
- package/dist/node/Witness.js.map +1 -1
- package/dist/node/Witness.mjs +1 -1
- package/dist/node/Witness.mjs.map +1 -1
- package/dist/node/index.js +2 -2
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/node/index.mjs.map +1 -1
- package/package.json +12 -11
- package/src/Config.ts +1 -1
- package/src/Witness.ts +2 -1
package/dist/node/Config.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,OAAO,EAAE,uCAAuC,EAAE,MAAM,UAAU,CAAA;AAElE,MAAM,MAAM,iCAAiC,GAAG,aAAa,CAAC;IAC5D,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,uCAAuC,CAAA;CAChD,CAAC,CAAA"}
|
package/dist/node/Config.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,OAAO,EAAE,uCAAuC,EAAE,MAAM,UAAU,CAAA;AAElE,MAAM,MAAM,iCAAiC,GAAG,aAAa,CAAC;IAC5D,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,uCAAuC,CAAA;CAChD,CAAC,CAAA"}
|
package/dist/node/Config.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,OAAO,EAAE,uCAAuC,EAAE,MAAM,UAAU,CAAA;AAElE,MAAM,MAAM,iCAAiC,GAAG,aAAa,CAAC;IAC5D,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,uCAAuC,CAAA;CAChD,CAAC,CAAA"}
|
package/dist/node/Config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Config.ts"],"sourcesContent":["import { WitnessConfig } from '@xyo-network/witness'\n\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema'\n\nexport type EthereumGasEtherscanWitnessConfig = WitnessConfig<{\n apiKey: string\n schema: EthereumGasEtherscanWitnessConfigSchema\n}>\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/Config.ts"],"sourcesContent":["import { WitnessConfig } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema'\n\nexport type EthereumGasEtherscanWitnessConfig = WitnessConfig<{\n apiKey: string\n schema: EthereumGasEtherscanWitnessConfigSchema\n}>\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/dist/node/Plugin.js
CHANGED
|
@@ -29,9 +29,9 @@ var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
|
|
|
29
29
|
|
|
30
30
|
// src/Witness.ts
|
|
31
31
|
var import_assert = require("@xylabs/assert");
|
|
32
|
+
var import_abstract_witness = require("@xyo-network/abstract-witness");
|
|
32
33
|
var import_etherscan_ethereum_gas_payload_plugin = require("@xyo-network/etherscan-ethereum-gas-payload-plugin");
|
|
33
34
|
var import_payload_builder = require("@xyo-network/payload-builder");
|
|
34
|
-
var import_witness = require("@xyo-network/witness");
|
|
35
35
|
|
|
36
36
|
// src/lib/getGasFromEtherscan.ts
|
|
37
37
|
var import_axios = require("@xyo-network/axios");
|
|
@@ -44,7 +44,7 @@ var getGasFromEtherscan = async (apiKey) => {
|
|
|
44
44
|
var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
|
|
45
45
|
|
|
46
46
|
// src/Witness.ts
|
|
47
|
-
var EthereumGasEtherscanWitness = class extends
|
|
47
|
+
var EthereumGasEtherscanWitness = class extends import_abstract_witness.AbstractWitness {
|
|
48
48
|
static configSchemas = [EthereumGasEtherscanWitnessConfigSchema];
|
|
49
49
|
async observeHandler() {
|
|
50
50
|
var _a;
|
package/dist/node/Plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEtherscanWitness } from './Witness'\n\nexport const EthereumGasEtherscanPlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasEtherscanWitness>(\n { required: { [EthereumGasEtherscanSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await EthereumGasEtherscanWitness.create(params)\n return result as EthereumGasEtherscanWitness\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEtherscanWitness } from './Witness'\n\nexport const EthereumGasEtherscanPlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasEtherscanWitness>(\n { required: { [EthereumGasEtherscanSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await EthereumGasEtherscanWitness.create(params)\n return result as EthereumGasEtherscanWitness\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherscanWitnessConfig } from './Config'\nimport { getGasFromEtherscan } from './lib'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema'\n\nexport class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {\n static override configSchemas = [EthereumGasEtherscanWitnessConfigSchema]\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, 'apiKey is required')\n const payload = new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xyo-network/axios'\nimport { EthereumGasEtherscanResponse } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\n\nexport const getGasFromEtherscan = async (apiKey: string): Promise<EthereumGasEtherscanResponse> => {\n const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`\n return (await axios.get<EthereumGasEtherscanResponse>(url)).data\n}\n","export type EthereumGasEtherscanWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\nexport const EthereumGasEtherscanWitnessConfigSchema: EthereumGasEtherscanWitnessConfigSchema =\n 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,gDAA2C;AAC3C,2BAAiC;AACjC,+BAA8C;;;ACF9C,oBAAyB;AACzB,8BAAgC;AAChC,mDAAwE;AAExE,6BAA+B;;;ACJ/B,mBAAsB;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,mBAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACX;;;AFUK,IAAM,8BAAN,cAA0C,wCAAmF;AAAA,EAClI,OAAgB,gBAAgB,CAAC,uCAAuC;AAAA,EAExE,MAAyB,iBAAqC;AAfhE;AAgBI,UAAM,aAAS,yBAAS,UAAK,WAAL,mBAAa,QAAQ,oBAAoB;AACjE,UAAM,UAAU,IAAI,sCAA4C,EAAE,QAAQ,wEAA2B,CAAC,EACnG,OAAO,MAAM,oBAAoB,MAAM,CAAC,EACxC,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADhBO,IAAM,6BAA6B,UACxC;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,wEAA0B,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EAC1E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,4BAA4B,OAAO,MAAM;AAC9D,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["import_etherscan_ethereum_gas_payload_plugin"]}
|
package/dist/node/Plugin.mjs
CHANGED
|
@@ -5,9 +5,9 @@ import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
|
|
|
5
5
|
|
|
6
6
|
// src/Witness.ts
|
|
7
7
|
import { assertEx } from "@xylabs/assert";
|
|
8
|
+
import { AbstractWitness } from "@xyo-network/abstract-witness";
|
|
8
9
|
import { EthereumGasEtherscanSchema } from "@xyo-network/etherscan-ethereum-gas-payload-plugin";
|
|
9
10
|
import { PayloadBuilder } from "@xyo-network/payload-builder";
|
|
10
|
-
import { AbstractWitness } from "@xyo-network/witness";
|
|
11
11
|
|
|
12
12
|
// src/lib/getGasFromEtherscan.ts
|
|
13
13
|
import { axios } from "@xyo-network/axios";
|
package/dist/node/Plugin.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEtherscanWitness } from './Witness'\n\nexport const EthereumGasEtherscanPlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasEtherscanWitness>(\n { required: { [EthereumGasEtherscanSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await EthereumGasEtherscanWitness.create(params)\n return result as EthereumGasEtherscanWitness\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEtherscanWitness } from './Witness'\n\nexport const EthereumGasEtherscanPlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasEtherscanWitness>(\n { required: { [EthereumGasEtherscanSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await EthereumGasEtherscanWitness.create(params)\n return result as EthereumGasEtherscanWitness\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherscanWitnessConfig } from './Config'\nimport { getGasFromEtherscan } from './lib'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema'\n\nexport class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {\n static override configSchemas = [EthereumGasEtherscanWitnessConfigSchema]\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, 'apiKey is required')\n const payload = new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xyo-network/axios'\nimport { EthereumGasEtherscanResponse } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\n\nexport const getGasFromEtherscan = async (apiKey: string): Promise<EthereumGasEtherscanResponse> => {\n const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`\n return (await axios.get<EthereumGasEtherscanResponse>(url)).data\n}\n","export type EthereumGasEtherscanWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\nexport const EthereumGasEtherscanWitnessConfigSchema: EthereumGasEtherscanWitnessConfigSchema =\n 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\n"],"mappings":";AAAA,SAAS,8BAAAA,mCAAkC;AAC3C,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAsC,kCAAkC;AAExE,SAAS,sBAAsB;;;ACJ/B,SAAS,aAAa;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,MAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACX;;;AFUK,IAAM,8BAAN,cAA0C,gBAAmF;AAAA,EAClI,OAAgB,gBAAgB,CAAC,uCAAuC;AAAA,EAExE,MAAyB,iBAAqC;AAfhE;AAgBI,UAAM,SAAS,UAAS,UAAK,WAAL,mBAAa,QAAQ,oBAAoB;AACjE,UAAM,UAAU,IAAI,eAA4C,EAAE,QAAQ,2BAA2B,CAAC,EACnG,OAAO,MAAM,oBAAoB,MAAM,CAAC,EACxC,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADhBO,IAAM,6BAA6B,MACxC;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,2BAA0B,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EAC1E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,4BAA4B,OAAO,MAAM;AAC9D,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["EthereumGasEtherscanSchema","EthereumGasEtherscanSchema"]}
|
package/dist/node/Witness.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
1
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
2
3
|
import { Payload } from '@xyo-network/payload-model';
|
|
3
|
-
import {
|
|
4
|
+
import { WitnessParams } from '@xyo-network/witness-model';
|
|
4
5
|
import { EthereumGasEtherscanWitnessConfig } from './Config';
|
|
5
6
|
export declare class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {
|
|
6
7
|
static configSchemas: "network.xyo.blockchain.ethereum.gas.etherscan.witness.config"[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAA;AAI5D,qBAAa,2BAA4B,SAAQ,eAAe,CAAC,aAAa,CAAC,eAAe,CAAC,iCAAiC,CAAC,CAAC,CAAC;IACjI,OAAgB,aAAa,mEAA4C;cAEhD,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAO9D"}
|
package/dist/node/Witness.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
1
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
2
3
|
import { Payload } from '@xyo-network/payload-model';
|
|
3
|
-
import {
|
|
4
|
+
import { WitnessParams } from '@xyo-network/witness-model';
|
|
4
5
|
import { EthereumGasEtherscanWitnessConfig } from './Config';
|
|
5
6
|
export declare class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {
|
|
6
7
|
static configSchemas: "network.xyo.blockchain.ethereum.gas.etherscan.witness.config"[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAA;AAI5D,qBAAa,2BAA4B,SAAQ,eAAe,CAAC,aAAa,CAAC,eAAe,CAAC,iCAAiC,CAAC,CAAC,CAAC;IACjI,OAAgB,aAAa,mEAA4C;cAEhD,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAO9D"}
|
package/dist/node/Witness.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
1
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
2
3
|
import { Payload } from '@xyo-network/payload-model';
|
|
3
|
-
import {
|
|
4
|
+
import { WitnessParams } from '@xyo-network/witness-model';
|
|
4
5
|
import { EthereumGasEtherscanWitnessConfig } from './Config';
|
|
5
6
|
export declare class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {
|
|
6
7
|
static configSchemas: "network.xyo.blockchain.ethereum.gas.etherscan.witness.config"[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAA;AAI5D,qBAAa,2BAA4B,SAAQ,eAAe,CAAC,aAAa,CAAC,eAAe,CAAC,iCAAiC,CAAC,CAAC,CAAC;IACjI,OAAgB,aAAa,mEAA4C;cAEhD,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAO9D"}
|
package/dist/node/Witness.js
CHANGED
|
@@ -24,9 +24,9 @@ __export(Witness_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(Witness_exports);
|
|
26
26
|
var import_assert = require("@xylabs/assert");
|
|
27
|
+
var import_abstract_witness = require("@xyo-network/abstract-witness");
|
|
27
28
|
var import_etherscan_ethereum_gas_payload_plugin = require("@xyo-network/etherscan-ethereum-gas-payload-plugin");
|
|
28
29
|
var import_payload_builder = require("@xyo-network/payload-builder");
|
|
29
|
-
var import_witness = require("@xyo-network/witness");
|
|
30
30
|
|
|
31
31
|
// src/lib/getGasFromEtherscan.ts
|
|
32
32
|
var import_axios = require("@xyo-network/axios");
|
|
@@ -39,7 +39,7 @@ var getGasFromEtherscan = async (apiKey) => {
|
|
|
39
39
|
var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
|
|
40
40
|
|
|
41
41
|
// src/Witness.ts
|
|
42
|
-
var EthereumGasEtherscanWitness = class extends
|
|
42
|
+
var EthereumGasEtherscanWitness = class extends import_abstract_witness.AbstractWitness {
|
|
43
43
|
static configSchemas = [EthereumGasEtherscanWitnessConfigSchema];
|
|
44
44
|
async observeHandler() {
|
|
45
45
|
var _a;
|
package/dist/node/Witness.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherscanWitnessConfig } from './Config'\nimport { getGasFromEtherscan } from './lib'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema'\n\nexport class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {\n static override configSchemas = [EthereumGasEtherscanWitnessConfigSchema]\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, 'apiKey is required')\n const payload = new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xyo-network/axios'\nimport { EthereumGasEtherscanResponse } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\n\nexport const getGasFromEtherscan = async (apiKey: string): Promise<EthereumGasEtherscanResponse> => {\n const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`\n return (await axios.get<EthereumGasEtherscanResponse>(url)).data\n}\n","export type EthereumGasEtherscanWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\nexport const EthereumGasEtherscanWitnessConfigSchema: EthereumGasEtherscanWitnessConfigSchema =\n 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAyB;AACzB,8BAAgC;AAChC,mDAAwE;AAExE,6BAA+B;;;ACJ/B,mBAAsB;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,mBAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACX;;;AFUK,IAAM,8BAAN,cAA0C,wCAAmF;AAAA,EAClI,OAAgB,gBAAgB,CAAC,uCAAuC;AAAA,EAExE,MAAyB,iBAAqC;AAfhE;AAgBI,UAAM,aAAS,yBAAS,UAAK,WAAL,mBAAa,QAAQ,oBAAoB;AACjE,UAAM,UAAU,IAAI,sCAA4C,EAAE,QAAQ,wEAA2B,CAAC,EACnG,OAAO,MAAM,oBAAoB,MAAM,CAAC,EACxC,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;","names":[]}
|
package/dist/node/Witness.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/Witness.ts
|
|
2
2
|
import { assertEx } from "@xylabs/assert";
|
|
3
|
+
import { AbstractWitness } from "@xyo-network/abstract-witness";
|
|
3
4
|
import { EthereumGasEtherscanSchema } from "@xyo-network/etherscan-ethereum-gas-payload-plugin";
|
|
4
5
|
import { PayloadBuilder } from "@xyo-network/payload-builder";
|
|
5
|
-
import { AbstractWitness } from "@xyo-network/witness";
|
|
6
6
|
|
|
7
7
|
// src/lib/getGasFromEtherscan.ts
|
|
8
8
|
import { axios } from "@xyo-network/axios";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherscanWitnessConfig } from './Config'\nimport { getGasFromEtherscan } from './lib'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema'\n\nexport class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {\n static override configSchemas = [EthereumGasEtherscanWitnessConfigSchema]\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, 'apiKey is required')\n const payload = new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xyo-network/axios'\nimport { EthereumGasEtherscanResponse } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\n\nexport const getGasFromEtherscan = async (apiKey: string): Promise<EthereumGasEtherscanResponse> => {\n const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`\n return (await axios.get<EthereumGasEtherscanResponse>(url)).data\n}\n","export type EthereumGasEtherscanWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\nexport const EthereumGasEtherscanWitnessConfigSchema: EthereumGasEtherscanWitnessConfigSchema =\n 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAsC,kCAAkC;AAExE,SAAS,sBAAsB;;;ACJ/B,SAAS,aAAa;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,MAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACX;;;AFUK,IAAM,8BAAN,cAA0C,gBAAmF;AAAA,EAClI,OAAgB,gBAAgB,CAAC,uCAAuC;AAAA,EAExE,MAAyB,iBAAqC;AAfhE;AAgBI,UAAM,SAAS,UAAS,UAAK,WAAL,mBAAa,QAAQ,oBAAoB;AACjE,UAAM,UAAU,IAAI,eAA4C,EAAE,QAAQ,2BAA2B,CAAC,EACnG,OAAO,MAAM,oBAAoB,MAAM,CAAC,EACxC,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;","names":[]}
|
package/dist/node/index.js
CHANGED
|
@@ -34,9 +34,9 @@ var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
|
|
|
34
34
|
|
|
35
35
|
// src/Witness.ts
|
|
36
36
|
var import_assert = require("@xylabs/assert");
|
|
37
|
+
var import_abstract_witness = require("@xyo-network/abstract-witness");
|
|
37
38
|
var import_etherscan_ethereum_gas_payload_plugin = require("@xyo-network/etherscan-ethereum-gas-payload-plugin");
|
|
38
39
|
var import_payload_builder = require("@xyo-network/payload-builder");
|
|
39
|
-
var import_witness = require("@xyo-network/witness");
|
|
40
40
|
|
|
41
41
|
// src/lib/getGasFromEtherscan.ts
|
|
42
42
|
var import_axios = require("@xyo-network/axios");
|
|
@@ -49,7 +49,7 @@ var getGasFromEtherscan = async (apiKey) => {
|
|
|
49
49
|
var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
|
|
50
50
|
|
|
51
51
|
// src/Witness.ts
|
|
52
|
-
var EthereumGasEtherscanWitness = class extends
|
|
52
|
+
var EthereumGasEtherscanWitness = class extends import_abstract_witness.AbstractWitness {
|
|
53
53
|
static configSchemas = [EthereumGasEtherscanWitnessConfigSchema];
|
|
54
54
|
async observeHandler() {
|
|
55
55
|
var _a;
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEtherscanPlugin } from './Plugin'\n\nexport * from './Config'\nexport * from './Schema'\nexport * from './Witness'\n\nexport { EthereumGasEtherscanPlugin }\n\n// eslint-disable-next-line import/no-default-export\nexport default EthereumGasEtherscanPlugin\n","import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEtherscanWitness } from './Witness'\n\nexport const EthereumGasEtherscanPlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasEtherscanWitness>(\n { required: { [EthereumGasEtherscanSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await EthereumGasEtherscanWitness.create(params)\n return result as EthereumGasEtherscanWitness\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEtherscanPlugin } from './Plugin'\n\nexport * from './Config'\nexport * from './Schema'\nexport * from './Witness'\n\nexport { EthereumGasEtherscanPlugin }\n\n// eslint-disable-next-line import/no-default-export\nexport default EthereumGasEtherscanPlugin\n","import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEtherscanWitness } from './Witness'\n\nexport const EthereumGasEtherscanPlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasEtherscanWitness>(\n { required: { [EthereumGasEtherscanSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await EthereumGasEtherscanWitness.create(params)\n return result as EthereumGasEtherscanWitness\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherscanWitnessConfig } from './Config'\nimport { getGasFromEtherscan } from './lib'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema'\n\nexport class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {\n static override configSchemas = [EthereumGasEtherscanWitnessConfigSchema]\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, 'apiKey is required')\n const payload = new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xyo-network/axios'\nimport { EthereumGasEtherscanResponse } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\n\nexport const getGasFromEtherscan = async (apiKey: string): Promise<EthereumGasEtherscanResponse> => {\n const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`\n return (await axios.get<EthereumGasEtherscanResponse>(url)).data\n}\n","export type EthereumGasEtherscanWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\nexport const EthereumGasEtherscanWitnessConfigSchema: EthereumGasEtherscanWitnessConfigSchema =\n 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gDAA2C;AAC3C,2BAAiC;AACjC,+BAA8C;;;ACF9C,oBAAyB;AACzB,8BAAgC;AAChC,mDAAwE;AAExE,6BAA+B;;;ACJ/B,mBAAsB;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,mBAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACX;;;AFUK,IAAM,8BAAN,cAA0C,wCAAmF;AAAA,EAClI,OAAgB,gBAAgB,CAAC,uCAAuC;AAAA,EAExE,MAAyB,iBAAqC;AAfhE;AAgBI,UAAM,aAAS,yBAAS,UAAK,WAAL,mBAAa,QAAQ,oBAAoB;AACjE,UAAM,UAAU,IAAI,sCAA4C,EAAE,QAAQ,wEAA2B,CAAC,EACnG,OAAO,MAAM,oBAAoB,MAAM,CAAC,EACxC,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADhBO,IAAM,6BAA6B,UACxC;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,wEAA0B,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EAC1E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,4BAA4B,OAAO,MAAM;AAC9D,aAAO;AAAA,IACT;AAAA,EACF;AACF;;;ADNF,IAAO,cAAQ;","names":["import_etherscan_ethereum_gas_payload_plugin"]}
|
package/dist/node/index.mjs
CHANGED
|
@@ -5,9 +5,9 @@ import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
|
|
|
5
5
|
|
|
6
6
|
// src/Witness.ts
|
|
7
7
|
import { assertEx } from "@xylabs/assert";
|
|
8
|
+
import { AbstractWitness } from "@xyo-network/abstract-witness";
|
|
8
9
|
import { EthereumGasEtherscanSchema } from "@xyo-network/etherscan-ethereum-gas-payload-plugin";
|
|
9
10
|
import { PayloadBuilder } from "@xyo-network/payload-builder";
|
|
10
|
-
import { AbstractWitness } from "@xyo-network/witness";
|
|
11
11
|
|
|
12
12
|
// src/lib/getGasFromEtherscan.ts
|
|
13
13
|
import { axios } from "@xyo-network/axios";
|
package/dist/node/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts","../../src/index.ts"],"sourcesContent":["import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEtherscanWitness } from './Witness'\n\nexport const EthereumGasEtherscanPlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasEtherscanWitness>(\n { required: { [EthereumGasEtherscanSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await EthereumGasEtherscanWitness.create(params)\n return result as EthereumGasEtherscanWitness\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts","../../src/index.ts"],"sourcesContent":["import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEtherscanWitness } from './Witness'\n\nexport const EthereumGasEtherscanPlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasEtherscanWitness>(\n { required: { [EthereumGasEtherscanSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await EthereumGasEtherscanWitness.create(params)\n return result as EthereumGasEtherscanWitness\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherscanWitnessConfig } from './Config'\nimport { getGasFromEtherscan } from './lib'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema'\n\nexport class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {\n static override configSchemas = [EthereumGasEtherscanWitnessConfigSchema]\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, 'apiKey is required')\n const payload = new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xyo-network/axios'\nimport { EthereumGasEtherscanResponse } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\n\nexport const getGasFromEtherscan = async (apiKey: string): Promise<EthereumGasEtherscanResponse> => {\n const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`\n return (await axios.get<EthereumGasEtherscanResponse>(url)).data\n}\n","export type EthereumGasEtherscanWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\nexport const EthereumGasEtherscanWitnessConfigSchema: EthereumGasEtherscanWitnessConfigSchema =\n 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\n","import { EthereumGasEtherscanPlugin } from './Plugin'\n\nexport * from './Config'\nexport * from './Schema'\nexport * from './Witness'\n\nexport { EthereumGasEtherscanPlugin }\n\n// eslint-disable-next-line import/no-default-export\nexport default EthereumGasEtherscanPlugin\n"],"mappings":";AAAA,SAAS,8BAAAA,mCAAkC;AAC3C,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAsC,kCAAkC;AAExE,SAAS,sBAAsB;;;ACJ/B,SAAS,aAAa;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,MAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACX;;;AFUK,IAAM,8BAAN,cAA0C,gBAAmF;AAAA,EAClI,OAAgB,gBAAgB,CAAC,uCAAuC;AAAA,EAExE,MAAyB,iBAAqC;AAfhE;AAgBI,UAAM,SAAS,UAAS,UAAK,WAAL,mBAAa,QAAQ,oBAAoB;AACjE,UAAM,UAAU,IAAI,eAA4C,EAAE,QAAQ,2BAA2B,CAAC,EACnG,OAAO,MAAM,oBAAoB,MAAM,CAAC,EACxC,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADhBO,IAAM,6BAA6B,MACxC;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,2BAA0B,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EAC1E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,4BAA4B,OAAO,MAAM;AAC9D,aAAO;AAAA,IACT;AAAA,EACF;AACF;;;AINF,IAAO,cAAQ;","names":["EthereumGasEtherscanSchema","EthereumGasEtherscanSchema"]}
|
package/package.json
CHANGED
|
@@ -10,20 +10,21 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xylabs/assert": "^2.12.
|
|
14
|
-
"@xyo-network/
|
|
15
|
-
"@xyo-network/
|
|
16
|
-
"@xyo-network/
|
|
17
|
-
"@xyo-network/
|
|
18
|
-
"@xyo-network/payload-
|
|
19
|
-
"@xyo-network/
|
|
20
|
-
"@xyo-network/
|
|
13
|
+
"@xylabs/assert": "^2.12.22",
|
|
14
|
+
"@xyo-network/abstract-witness": "~2.75.15",
|
|
15
|
+
"@xyo-network/axios": "~2.75.15",
|
|
16
|
+
"@xyo-network/etherscan-ethereum-gas-payload-plugin": "~2.75.15",
|
|
17
|
+
"@xyo-network/module-model": "~2.75.15",
|
|
18
|
+
"@xyo-network/payload-builder": "~2.75.15",
|
|
19
|
+
"@xyo-network/payload-model": "~2.75.15",
|
|
20
|
+
"@xyo-network/payloadset-plugin": "~2.75.15",
|
|
21
|
+
"@xyo-network/witness-model": "~2.75.15"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
|
-
"@xylabs/jest-helpers": "^2.12.
|
|
24
|
+
"@xylabs/jest-helpers": "^2.12.22",
|
|
24
25
|
"@xylabs/ts-scripts-yarn3": "^3.0.88",
|
|
25
26
|
"@xylabs/tsconfig": "^3.0.88",
|
|
26
|
-
"@xyo-network/payload-wrapper": "~2.75.
|
|
27
|
+
"@xyo-network/payload-wrapper": "~2.75.15",
|
|
27
28
|
"jest": "^29.7.0",
|
|
28
29
|
"typescript": "^5.2.2"
|
|
29
30
|
},
|
|
@@ -70,5 +71,5 @@
|
|
|
70
71
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
71
72
|
},
|
|
72
73
|
"sideEffects": false,
|
|
73
|
-
"version": "2.75.
|
|
74
|
+
"version": "2.75.15"
|
|
74
75
|
}
|
package/src/Config.ts
CHANGED
package/src/Witness.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { assertEx } from '@xylabs/assert'
|
|
2
|
+
import { AbstractWitness } from '@xyo-network/abstract-witness'
|
|
2
3
|
import { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'
|
|
3
4
|
import { AnyConfigSchema } from '@xyo-network/module-model'
|
|
4
5
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
5
6
|
import { Payload } from '@xyo-network/payload-model'
|
|
6
|
-
import {
|
|
7
|
+
import { WitnessParams } from '@xyo-network/witness-model'
|
|
7
8
|
|
|
8
9
|
import { EthereumGasEtherscanWitnessConfig } from './Config'
|
|
9
10
|
import { getGasFromEtherscan } from './lib'
|