@xyo-network/etherscan-ethereum-gas-plugin 2.96.1 → 2.96.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,72 +1,2 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
23
- EthereumGasEtherscanPlugin: () => EthereumGasEtherscanPlugin,
24
- EthereumGasEtherscanWitness: () => EthereumGasEtherscanWitness,
25
- EthereumGasEtherscanWitnessConfigSchema: () => EthereumGasEtherscanWitnessConfigSchema,
26
- default: () => EthereumGasEtherscanPlugin
27
- });
28
- module.exports = __toCommonJS(src_exports);
29
-
30
- // src/Plugin.ts
31
- var import_etherscan_ethereum_gas_payload_plugin2 = require("@xyo-network/etherscan-ethereum-gas-payload-plugin");
32
- var import_payload_model = require("@xyo-network/payload-model");
33
- var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
34
-
35
- // src/Witness.ts
36
- var import_assert = require("@xylabs/assert");
37
- var import_abstract_witness = require("@xyo-network/abstract-witness");
38
- var import_etherscan_ethereum_gas_payload_plugin = require("@xyo-network/etherscan-ethereum-gas-payload-plugin");
39
- var import_payload_builder = require("@xyo-network/payload-builder");
40
-
41
- // src/lib/getGasFromEtherscan.ts
42
- var import_axios = require("@xylabs/axios");
43
- var getGasFromEtherscan = async (apiKey) => {
44
- const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`;
45
- return (await import_axios.axios.get(url)).data;
46
- };
47
-
48
- // src/Schema.ts
49
- var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
50
-
51
- // src/Witness.ts
52
- var EthereumGasEtherscanWitness = class extends import_abstract_witness.AbstractWitness {
53
- static configSchemas = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema];
54
- static defaultConfigSchema = EthereumGasEtherscanWitnessConfigSchema;
55
- async observeHandler() {
56
- const apiKey = (0, import_assert.assertEx)(this.config?.apiKey, () => "apiKey is required");
57
- const payload = await new import_payload_builder.PayloadBuilder({ schema: import_etherscan_ethereum_gas_payload_plugin.EthereumGasEtherscanSchema }).fields(await getGasFromEtherscan(apiKey)).build();
58
- return [payload];
59
- }
60
- };
61
-
62
- // src/Plugin.ts
63
- var EthereumGasEtherscanPlugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
64
- { required: { [import_etherscan_ethereum_gas_payload_plugin2.EthereumGasEtherscanSchema]: 1 }, schema: import_payload_model.PayloadSetSchema },
65
- {
66
- witness: async (params) => {
67
- const result = await EthereumGasEtherscanWitness.create(params);
68
- return result;
69
- }
70
- }
71
- );
1
+ "use strict";var n=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var P=(r,e)=>{for(var t in e)n(r,t,{get:e[t],enumerable:!0})},x=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of G(e))!S.call(r,a)&&a!==t&&n(r,a,{get:()=>e[a],enumerable:!(i=y(e,a))||i.enumerable});return r};var W=r=>x(n({},"__esModule",{value:!0}),r);var w={};P(w,{EthereumGasEtherscanPlugin:()=>m,EthereumGasEtherscanWitness:()=>s,EthereumGasEtherscanWitnessConfigSchema:()=>o,default:()=>m});module.exports=W(w);var l=require("@xyo-network/etherscan-ethereum-gas-payload-plugin"),d=require("@xyo-network/payload-model"),g=require("@xyo-network/payloadset-plugin");var p=require("@xylabs/assert"),E=require("@xyo-network/abstract-witness"),u=require("@xyo-network/etherscan-ethereum-gas-payload-plugin"),f=require("@xyo-network/payload-builder");var c=require("@xylabs/axios"),h=async r=>{let e=`https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${r}`;return(await c.axios.get(e)).data};var o="network.xyo.blockchain.ethereum.gas.etherscan.witness.config";var s=class extends E.AbstractWitness{static configSchemas=[...super.configSchemas,o];static defaultConfigSchema=o;async observeHandler(){let e=(0,p.assertEx)(this.config?.apiKey,()=>"apiKey is required");return[await new f.PayloadBuilder({schema:u.EthereumGasEtherscanSchema}).fields(await h(e)).build()]}};var m=()=>(0,g.createPayloadSetWitnessPlugin)({required:{[l.EthereumGasEtherscanSchema]:1},schema:d.PayloadSetSchema},{witness:async r=>await s.create(r)});
72
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config'\nexport { EthereumGasEtherscanPlugin as default, EthereumGasEtherscanPlugin } from './Plugin'\nexport * from './Schema'\nexport * from './Witness'\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, Schema } 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 readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasEtherscanWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,uCAAuC;AAAA,EACnH,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,iBAAqC;AAC5D,UAAM,aAAS,wBAAS,KAAK,QAAQ,QAAQ,MAAM,oBAAoB;AACvE,UAAM,UAAU,MAAM,IAAI,sCAA4C,EAAE,QAAQ,wEAA2B,CAAC,EACzG,OAAO,MAAM,oBAAoB,MAAM,CAAC,EACxC,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADjBO,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"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config'\nexport { EthereumGasEtherscanPlugin as default, EthereumGasEtherscanPlugin } from './Plugin'\nexport * from './Schema'\nexport * from './Witness'\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, Schema } 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 readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasEtherscanWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gCAAAE,EAAA,gCAAAC,EAAA,4CAAAC,EAAA,YAAAF,IAAA,eAAAG,EAAAL,GCAA,IAAAM,EAA2C,8DAC3CC,EAAiC,sCACjCC,EAA8C,0CCF9C,IAAAC,EAAyB,0BACzBC,EAAgC,yCAChCC,EAAwE,8DAExEC,EAA+B,wCCJ/B,IAAAC,EAAsB,yBAGTC,EAAsB,MAAOC,GAA0D,CAClG,IAAMC,EAAM,0EAA0ED,CAAM,GAC5F,OAAQ,MAAM,QAAM,IAAkCC,CAAG,GAAG,IAC9D,ECLO,IAAMC,EACX,+DFUK,IAAMC,EAAN,cAA0C,iBAAmF,CAClI,OAAyB,cAA0B,CAAC,GAAG,MAAM,cAAeC,CAAuC,EACnH,OAAyB,oBAA8BA,EAEvD,MAAyB,gBAAqC,CAC5D,IAAMC,KAAS,YAAS,KAAK,QAAQ,OAAQ,IAAM,oBAAoB,EAIvE,MAAO,CAHS,MAAM,IAAI,iBAA4C,CAAE,OAAQ,4BAA2B,CAAC,EACzG,OAAO,MAAMC,EAAoBD,CAAM,CAAC,EACxC,MAAM,CACM,CACjB,CACF,EDjBO,IAAME,EAA6B,OACxC,iCACE,CAAE,SAAU,CAAE,CAAC,4BAA0B,EAAG,CAAE,EAAG,OAAQ,kBAAiB,EAC1E,CACE,QAAS,MAAOC,GACC,MAAMC,EAA4B,OAAOD,CAAM,CAGlE,CACF","names":["src_exports","__export","EthereumGasEtherscanPlugin","EthereumGasEtherscanWitness","EthereumGasEtherscanWitnessConfigSchema","__toCommonJS","import_etherscan_ethereum_gas_payload_plugin","import_payload_model","import_payloadset_plugin","import_assert","import_abstract_witness","import_etherscan_ethereum_gas_payload_plugin","import_payload_builder","import_axios","getGasFromEtherscan","apiKey","url","EthereumGasEtherscanWitnessConfigSchema","EthereumGasEtherscanWitness","EthereumGasEtherscanWitnessConfigSchema","apiKey","getGasFromEtherscan","EthereumGasEtherscanPlugin","params","EthereumGasEtherscanWitness"]}
@@ -1,49 +1,2 @@
1
- // src/Plugin.ts
2
- import { EthereumGasEtherscanSchema as EthereumGasEtherscanSchema2 } from "@xyo-network/etherscan-ethereum-gas-payload-plugin";
3
- import { PayloadSetSchema } from "@xyo-network/payload-model";
4
- import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
5
-
6
- // src/Witness.ts
7
- import { assertEx } from "@xylabs/assert";
8
- import { AbstractWitness } from "@xyo-network/abstract-witness";
9
- import { EthereumGasEtherscanSchema } from "@xyo-network/etherscan-ethereum-gas-payload-plugin";
10
- import { PayloadBuilder } from "@xyo-network/payload-builder";
11
-
12
- // src/lib/getGasFromEtherscan.ts
13
- import { axios } from "@xylabs/axios";
14
- var getGasFromEtherscan = async (apiKey) => {
15
- const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`;
16
- return (await axios.get(url)).data;
17
- };
18
-
19
- // src/Schema.ts
20
- var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
21
-
22
- // src/Witness.ts
23
- var EthereumGasEtherscanWitness = class extends AbstractWitness {
24
- static configSchemas = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema];
25
- static defaultConfigSchema = EthereumGasEtherscanWitnessConfigSchema;
26
- async observeHandler() {
27
- const apiKey = assertEx(this.config?.apiKey, () => "apiKey is required");
28
- const payload = await new PayloadBuilder({ schema: EthereumGasEtherscanSchema }).fields(await getGasFromEtherscan(apiKey)).build();
29
- return [payload];
30
- }
31
- };
32
-
33
- // src/Plugin.ts
34
- var EthereumGasEtherscanPlugin = () => createPayloadSetWitnessPlugin(
35
- { required: { [EthereumGasEtherscanSchema2]: 1 }, schema: PayloadSetSchema },
36
- {
37
- witness: async (params) => {
38
- const result = await EthereumGasEtherscanWitness.create(params);
39
- return result;
40
- }
41
- }
42
- );
43
- export {
44
- EthereumGasEtherscanPlugin,
45
- EthereumGasEtherscanWitness,
46
- EthereumGasEtherscanWitnessConfigSchema,
47
- EthereumGasEtherscanPlugin as default
48
- };
1
+ import{EthereumGasEtherscanSchema as p}from"@xyo-network/etherscan-ethereum-gas-payload-plugin";import{PayloadSetSchema as E}from"@xyo-network/payload-model";import{createPayloadSetWitnessPlugin as u}from"@xyo-network/payloadset-plugin";import{assertEx as m}from"@xylabs/assert";import{AbstractWitness as i}from"@xyo-network/abstract-witness";import{EthereumGasEtherscanSchema as c}from"@xyo-network/etherscan-ethereum-gas-payload-plugin";import{PayloadBuilder as h}from"@xyo-network/payload-builder";import{axios as n}from"@xylabs/axios";var s=async e=>{let r=`https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${e}`;return(await n.get(r)).data};var a="network.xyo.blockchain.ethereum.gas.etherscan.witness.config";var t=class extends i{static configSchemas=[...super.configSchemas,a];static defaultConfigSchema=a;async observeHandler(){let r=m(this.config?.apiKey,()=>"apiKey is required");return[await new h({schema:c}).fields(await s(r)).build()]}};var o=()=>u({required:{[p]:1},schema:E},{witness:async e=>await t.create(e)});export{o as EthereumGasEtherscanPlugin,t as EthereumGasEtherscanWitness,a as EthereumGasEtherscanWitnessConfigSchema,o as default};
49
2
  //# sourceMappingURL=index.js.map
@@ -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 { 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, Schema } 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 readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasEtherscanWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,uCAAuC;AAAA,EACnH,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,iBAAqC;AAC5D,UAAM,SAAS,SAAS,KAAK,QAAQ,QAAQ,MAAM,oBAAoB;AACvE,UAAM,UAAU,MAAM,IAAI,eAA4C,EAAE,QAAQ,2BAA2B,CAAC,EACzG,OAAO,MAAM,oBAAoB,MAAM,CAAC,EACxC,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADjBO,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"]}
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, Schema } 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 readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasEtherscanWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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,OAAS,8BAAAA,MAAkC,qDAC3C,OAAS,oBAAAC,MAAwB,6BACjC,OAAS,iCAAAC,MAAqC,iCCF9C,OAAS,YAAAC,MAAgB,iBACzB,OAAS,mBAAAC,MAAuB,gCAChC,OAAsC,8BAAAC,MAAkC,qDAExE,OAAS,kBAAAC,MAAsB,+BCJ/B,OAAS,SAAAC,MAAa,gBAGf,IAAMC,EAAsB,MAAOC,GAA0D,CAClG,IAAMC,EAAM,0EAA0ED,CAAM,GAC5F,OAAQ,MAAMF,EAAM,IAAkCG,CAAG,GAAG,IAC9D,ECLO,IAAMC,EACX,+DFUK,IAAMC,EAAN,cAA0CC,CAAmF,CAClI,OAAyB,cAA0B,CAAC,GAAG,MAAM,cAAeC,CAAuC,EACnH,OAAyB,oBAA8BA,EAEvD,MAAyB,gBAAqC,CAC5D,IAAMC,EAASC,EAAS,KAAK,QAAQ,OAAQ,IAAM,oBAAoB,EAIvE,MAAO,CAHS,MAAM,IAAIC,EAA4C,CAAE,OAAQC,CAA2B,CAAC,EACzG,OAAO,MAAMC,EAAoBJ,CAAM,CAAC,EACxC,MAAM,CACM,CACjB,CACF,EDjBO,IAAMK,EAA6B,IACxCC,EACE,CAAE,SAAU,CAAE,CAACC,CAA0B,EAAG,CAAE,EAAG,OAAQC,CAAiB,EAC1E,CACE,QAAS,MAAOC,GACC,MAAMC,EAA4B,OAAOD,CAAM,CAGlE,CACF","names":["EthereumGasEtherscanSchema","PayloadSetSchema","createPayloadSetWitnessPlugin","assertEx","AbstractWitness","EthereumGasEtherscanSchema","PayloadBuilder","axios","getGasFromEtherscan","apiKey","url","EthereumGasEtherscanWitnessConfigSchema","EthereumGasEtherscanWitness","AbstractWitness","EthereumGasEtherscanWitnessConfigSchema","apiKey","assertEx","PayloadBuilder","EthereumGasEtherscanSchema","getGasFromEtherscan","EthereumGasEtherscanPlugin","createPayloadSetWitnessPlugin","EthereumGasEtherscanSchema","PayloadSetSchema","params","EthereumGasEtherscanWitness"]}
@@ -1 +1 @@
1
- {"version":3,"file":"getGasFromEtherscan.d.ts","sourceRoot":"","sources":["../../../src/lib/getGasFromEtherscan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAEjG,eAAO,MAAM,mBAAmB,WAAkB,MAAM,KAAG,QAAQ,4BAA4B,CAG9F,CAAA"}
1
+ {"version":3,"file":"getGasFromEtherscan.d.ts","sourceRoot":"","sources":["../../../src/lib/getGasFromEtherscan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAEjG,eAAO,MAAM,mBAAmB,WAAkB,MAAM,KAAG,OAAO,CAAC,4BAA4B,CAG9F,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getGasFromEtherscan.d.ts","sourceRoot":"","sources":["../../../src/lib/getGasFromEtherscan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAEjG,eAAO,MAAM,mBAAmB,WAAkB,MAAM,KAAG,QAAQ,4BAA4B,CAG9F,CAAA"}
1
+ {"version":3,"file":"getGasFromEtherscan.d.ts","sourceRoot":"","sources":["../../../src/lib/getGasFromEtherscan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAEjG,eAAO,MAAM,mBAAmB,WAAkB,MAAM,KAAG,OAAO,CAAC,4BAA4B,CAG9F,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getGasFromEtherscan.d.ts","sourceRoot":"","sources":["../../../src/lib/getGasFromEtherscan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAEjG,eAAO,MAAM,mBAAmB,WAAkB,MAAM,KAAG,QAAQ,4BAA4B,CAG9F,CAAA"}
1
+ {"version":3,"file":"getGasFromEtherscan.d.ts","sourceRoot":"","sources":["../../../src/lib/getGasFromEtherscan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAEjG,eAAO,MAAM,mBAAmB,WAAkB,MAAM,KAAG,OAAO,CAAC,4BAA4B,CAG9F,CAAA"}
@@ -1,72 +1,2 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
23
- EthereumGasEtherscanPlugin: () => EthereumGasEtherscanPlugin,
24
- EthereumGasEtherscanWitness: () => EthereumGasEtherscanWitness,
25
- EthereumGasEtherscanWitnessConfigSchema: () => EthereumGasEtherscanWitnessConfigSchema,
26
- default: () => EthereumGasEtherscanPlugin
27
- });
28
- module.exports = __toCommonJS(src_exports);
29
-
30
- // src/Plugin.ts
31
- var import_etherscan_ethereum_gas_payload_plugin2 = require("@xyo-network/etherscan-ethereum-gas-payload-plugin");
32
- var import_payload_model = require("@xyo-network/payload-model");
33
- var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
34
-
35
- // src/Witness.ts
36
- var import_assert = require("@xylabs/assert");
37
- var import_abstract_witness = require("@xyo-network/abstract-witness");
38
- var import_etherscan_ethereum_gas_payload_plugin = require("@xyo-network/etherscan-ethereum-gas-payload-plugin");
39
- var import_payload_builder = require("@xyo-network/payload-builder");
40
-
41
- // src/lib/getGasFromEtherscan.ts
42
- var import_axios = require("@xylabs/axios");
43
- var getGasFromEtherscan = async (apiKey) => {
44
- const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`;
45
- return (await import_axios.axios.get(url)).data;
46
- };
47
-
48
- // src/Schema.ts
49
- var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
50
-
51
- // src/Witness.ts
52
- var EthereumGasEtherscanWitness = class extends import_abstract_witness.AbstractWitness {
53
- static configSchemas = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema];
54
- static defaultConfigSchema = EthereumGasEtherscanWitnessConfigSchema;
55
- async observeHandler() {
56
- const apiKey = (0, import_assert.assertEx)(this.config?.apiKey, () => "apiKey is required");
57
- const payload = await new import_payload_builder.PayloadBuilder({ schema: import_etherscan_ethereum_gas_payload_plugin.EthereumGasEtherscanSchema }).fields(await getGasFromEtherscan(apiKey)).build();
58
- return [payload];
59
- }
60
- };
61
-
62
- // src/Plugin.ts
63
- var EthereumGasEtherscanPlugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
64
- { required: { [import_etherscan_ethereum_gas_payload_plugin2.EthereumGasEtherscanSchema]: 1 }, schema: import_payload_model.PayloadSetSchema },
65
- {
66
- witness: async (params) => {
67
- const result = await EthereumGasEtherscanWitness.create(params);
68
- return result;
69
- }
70
- }
71
- );
1
+ "use strict";var n=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var P=(r,e)=>{for(var t in e)n(r,t,{get:e[t],enumerable:!0})},x=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of G(e))!S.call(r,a)&&a!==t&&n(r,a,{get:()=>e[a],enumerable:!(i=y(e,a))||i.enumerable});return r};var W=r=>x(n({},"__esModule",{value:!0}),r);var w={};P(w,{EthereumGasEtherscanPlugin:()=>m,EthereumGasEtherscanWitness:()=>s,EthereumGasEtherscanWitnessConfigSchema:()=>o,default:()=>m});module.exports=W(w);var l=require("@xyo-network/etherscan-ethereum-gas-payload-plugin"),d=require("@xyo-network/payload-model"),g=require("@xyo-network/payloadset-plugin");var p=require("@xylabs/assert"),E=require("@xyo-network/abstract-witness"),u=require("@xyo-network/etherscan-ethereum-gas-payload-plugin"),f=require("@xyo-network/payload-builder");var c=require("@xylabs/axios"),h=async r=>{let e=`https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${r}`;return(await c.axios.get(e)).data};var o="network.xyo.blockchain.ethereum.gas.etherscan.witness.config";var s=class extends E.AbstractWitness{static configSchemas=[...super.configSchemas,o];static defaultConfigSchema=o;async observeHandler(){let e=(0,p.assertEx)(this.config?.apiKey,()=>"apiKey is required");return[await new f.PayloadBuilder({schema:u.EthereumGasEtherscanSchema}).fields(await h(e)).build()]}};var m=()=>(0,g.createPayloadSetWitnessPlugin)({required:{[l.EthereumGasEtherscanSchema]:1},schema:d.PayloadSetSchema},{witness:async r=>await s.create(r)});
72
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config'\nexport { EthereumGasEtherscanPlugin as default, EthereumGasEtherscanPlugin } from './Plugin'\nexport * from './Schema'\nexport * from './Witness'\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, Schema } 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 readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasEtherscanWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,uCAAuC;AAAA,EACnH,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,iBAAqC;AAC5D,UAAM,aAAS,wBAAS,KAAK,QAAQ,QAAQ,MAAM,oBAAoB;AACvE,UAAM,UAAU,MAAM,IAAI,sCAA4C,EAAE,QAAQ,wEAA2B,CAAC,EACzG,OAAO,MAAM,oBAAoB,MAAM,CAAC,EACxC,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADjBO,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"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config'\nexport { EthereumGasEtherscanPlugin as default, EthereumGasEtherscanPlugin } from './Plugin'\nexport * from './Schema'\nexport * from './Witness'\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, Schema } 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 readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasEtherscanWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gCAAAE,EAAA,gCAAAC,EAAA,4CAAAC,EAAA,YAAAF,IAAA,eAAAG,EAAAL,GCAA,IAAAM,EAA2C,8DAC3CC,EAAiC,sCACjCC,EAA8C,0CCF9C,IAAAC,EAAyB,0BACzBC,EAAgC,yCAChCC,EAAwE,8DAExEC,EAA+B,wCCJ/B,IAAAC,EAAsB,yBAGTC,EAAsB,MAAOC,GAA0D,CAClG,IAAMC,EAAM,0EAA0ED,CAAM,GAC5F,OAAQ,MAAM,QAAM,IAAkCC,CAAG,GAAG,IAC9D,ECLO,IAAMC,EACX,+DFUK,IAAMC,EAAN,cAA0C,iBAAmF,CAClI,OAAyB,cAA0B,CAAC,GAAG,MAAM,cAAeC,CAAuC,EACnH,OAAyB,oBAA8BA,EAEvD,MAAyB,gBAAqC,CAC5D,IAAMC,KAAS,YAAS,KAAK,QAAQ,OAAQ,IAAM,oBAAoB,EAIvE,MAAO,CAHS,MAAM,IAAI,iBAA4C,CAAE,OAAQ,4BAA2B,CAAC,EACzG,OAAO,MAAMC,EAAoBD,CAAM,CAAC,EACxC,MAAM,CACM,CACjB,CACF,EDjBO,IAAME,EAA6B,OACxC,iCACE,CAAE,SAAU,CAAE,CAAC,4BAA0B,EAAG,CAAE,EAAG,OAAQ,kBAAiB,EAC1E,CACE,QAAS,MAAOC,GACC,MAAMC,EAA4B,OAAOD,CAAM,CAGlE,CACF","names":["src_exports","__export","EthereumGasEtherscanPlugin","EthereumGasEtherscanWitness","EthereumGasEtherscanWitnessConfigSchema","__toCommonJS","import_etherscan_ethereum_gas_payload_plugin","import_payload_model","import_payloadset_plugin","import_assert","import_abstract_witness","import_etherscan_ethereum_gas_payload_plugin","import_payload_builder","import_axios","getGasFromEtherscan","apiKey","url","EthereumGasEtherscanWitnessConfigSchema","EthereumGasEtherscanWitness","EthereumGasEtherscanWitnessConfigSchema","apiKey","getGasFromEtherscan","EthereumGasEtherscanPlugin","params","EthereumGasEtherscanWitness"]}
@@ -1,49 +1,2 @@
1
- // src/Plugin.ts
2
- import { EthereumGasEtherscanSchema as EthereumGasEtherscanSchema2 } from "@xyo-network/etherscan-ethereum-gas-payload-plugin";
3
- import { PayloadSetSchema } from "@xyo-network/payload-model";
4
- import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
5
-
6
- // src/Witness.ts
7
- import { assertEx } from "@xylabs/assert";
8
- import { AbstractWitness } from "@xyo-network/abstract-witness";
9
- import { EthereumGasEtherscanSchema } from "@xyo-network/etherscan-ethereum-gas-payload-plugin";
10
- import { PayloadBuilder } from "@xyo-network/payload-builder";
11
-
12
- // src/lib/getGasFromEtherscan.ts
13
- import { axios } from "@xylabs/axios";
14
- var getGasFromEtherscan = async (apiKey) => {
15
- const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`;
16
- return (await axios.get(url)).data;
17
- };
18
-
19
- // src/Schema.ts
20
- var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
21
-
22
- // src/Witness.ts
23
- var EthereumGasEtherscanWitness = class extends AbstractWitness {
24
- static configSchemas = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema];
25
- static defaultConfigSchema = EthereumGasEtherscanWitnessConfigSchema;
26
- async observeHandler() {
27
- const apiKey = assertEx(this.config?.apiKey, () => "apiKey is required");
28
- const payload = await new PayloadBuilder({ schema: EthereumGasEtherscanSchema }).fields(await getGasFromEtherscan(apiKey)).build();
29
- return [payload];
30
- }
31
- };
32
-
33
- // src/Plugin.ts
34
- var EthereumGasEtherscanPlugin = () => createPayloadSetWitnessPlugin(
35
- { required: { [EthereumGasEtherscanSchema2]: 1 }, schema: PayloadSetSchema },
36
- {
37
- witness: async (params) => {
38
- const result = await EthereumGasEtherscanWitness.create(params);
39
- return result;
40
- }
41
- }
42
- );
43
- export {
44
- EthereumGasEtherscanPlugin,
45
- EthereumGasEtherscanWitness,
46
- EthereumGasEtherscanWitnessConfigSchema,
47
- EthereumGasEtherscanPlugin as default
48
- };
1
+ import{EthereumGasEtherscanSchema as p}from"@xyo-network/etherscan-ethereum-gas-payload-plugin";import{PayloadSetSchema as E}from"@xyo-network/payload-model";import{createPayloadSetWitnessPlugin as u}from"@xyo-network/payloadset-plugin";import{assertEx as m}from"@xylabs/assert";import{AbstractWitness as i}from"@xyo-network/abstract-witness";import{EthereumGasEtherscanSchema as c}from"@xyo-network/etherscan-ethereum-gas-payload-plugin";import{PayloadBuilder as h}from"@xyo-network/payload-builder";import{axios as n}from"@xylabs/axios";var s=async e=>{let r=`https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${e}`;return(await n.get(r)).data};var a="network.xyo.blockchain.ethereum.gas.etherscan.witness.config";var t=class extends i{static configSchemas=[...super.configSchemas,a];static defaultConfigSchema=a;async observeHandler(){let r=m(this.config?.apiKey,()=>"apiKey is required");return[await new h({schema:c}).fields(await s(r)).build()]}};var o=()=>u({required:{[p]:1},schema:E},{witness:async e=>await t.create(e)});export{o as EthereumGasEtherscanPlugin,t as EthereumGasEtherscanWitness,a as EthereumGasEtherscanWitnessConfigSchema,o as default};
49
2
  //# sourceMappingURL=index.js.map
@@ -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 { 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, Schema } 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 readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasEtherscanWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,uCAAuC;AAAA,EACnH,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,iBAAqC;AAC5D,UAAM,SAAS,SAAS,KAAK,QAAQ,QAAQ,MAAM,oBAAoB;AACvE,UAAM,UAAU,MAAM,IAAI,eAA4C,EAAE,QAAQ,2BAA2B,CAAC,EACzG,OAAO,MAAM,oBAAoB,MAAM,CAAC,EACxC,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADjBO,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"]}
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, Schema } 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 readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasEtherscanWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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,OAAS,8BAAAA,MAAkC,qDAC3C,OAAS,oBAAAC,MAAwB,6BACjC,OAAS,iCAAAC,MAAqC,iCCF9C,OAAS,YAAAC,MAAgB,iBACzB,OAAS,mBAAAC,MAAuB,gCAChC,OAAsC,8BAAAC,MAAkC,qDAExE,OAAS,kBAAAC,MAAsB,+BCJ/B,OAAS,SAAAC,MAAa,gBAGf,IAAMC,EAAsB,MAAOC,GAA0D,CAClG,IAAMC,EAAM,0EAA0ED,CAAM,GAC5F,OAAQ,MAAMF,EAAM,IAAkCG,CAAG,GAAG,IAC9D,ECLO,IAAMC,EACX,+DFUK,IAAMC,EAAN,cAA0CC,CAAmF,CAClI,OAAyB,cAA0B,CAAC,GAAG,MAAM,cAAeC,CAAuC,EACnH,OAAyB,oBAA8BA,EAEvD,MAAyB,gBAAqC,CAC5D,IAAMC,EAASC,EAAS,KAAK,QAAQ,OAAQ,IAAM,oBAAoB,EAIvE,MAAO,CAHS,MAAM,IAAIC,EAA4C,CAAE,OAAQC,CAA2B,CAAC,EACzG,OAAO,MAAMC,EAAoBJ,CAAM,CAAC,EACxC,MAAM,CACM,CACjB,CACF,EDjBO,IAAMK,EAA6B,IACxCC,EACE,CAAE,SAAU,CAAE,CAACC,CAA0B,EAAG,CAAE,EAAG,OAAQC,CAAiB,EAC1E,CACE,QAAS,MAAOC,GACC,MAAMC,EAA4B,OAAOD,CAAM,CAGlE,CACF","names":["EthereumGasEtherscanSchema","PayloadSetSchema","createPayloadSetWitnessPlugin","assertEx","AbstractWitness","EthereumGasEtherscanSchema","PayloadBuilder","axios","getGasFromEtherscan","apiKey","url","EthereumGasEtherscanWitnessConfigSchema","EthereumGasEtherscanWitness","AbstractWitness","EthereumGasEtherscanWitnessConfigSchema","apiKey","assertEx","PayloadBuilder","EthereumGasEtherscanSchema","getGasFromEtherscan","EthereumGasEtherscanPlugin","createPayloadSetWitnessPlugin","EthereumGasEtherscanSchema","PayloadSetSchema","params","EthereumGasEtherscanWitness"]}
@@ -1 +1 @@
1
- {"version":3,"file":"getGasFromEtherscan.d.ts","sourceRoot":"","sources":["../../../src/lib/getGasFromEtherscan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAEjG,eAAO,MAAM,mBAAmB,WAAkB,MAAM,KAAG,QAAQ,4BAA4B,CAG9F,CAAA"}
1
+ {"version":3,"file":"getGasFromEtherscan.d.ts","sourceRoot":"","sources":["../../../src/lib/getGasFromEtherscan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAEjG,eAAO,MAAM,mBAAmB,WAAkB,MAAM,KAAG,OAAO,CAAC,4BAA4B,CAG9F,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getGasFromEtherscan.d.ts","sourceRoot":"","sources":["../../../src/lib/getGasFromEtherscan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAEjG,eAAO,MAAM,mBAAmB,WAAkB,MAAM,KAAG,QAAQ,4BAA4B,CAG9F,CAAA"}
1
+ {"version":3,"file":"getGasFromEtherscan.d.ts","sourceRoot":"","sources":["../../../src/lib/getGasFromEtherscan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAEjG,eAAO,MAAM,mBAAmB,WAAkB,MAAM,KAAG,OAAO,CAAC,4BAA4B,CAG9F,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getGasFromEtherscan.d.ts","sourceRoot":"","sources":["../../../src/lib/getGasFromEtherscan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAEjG,eAAO,MAAM,mBAAmB,WAAkB,MAAM,KAAG,QAAQ,4BAA4B,CAG9F,CAAA"}
1
+ {"version":3,"file":"getGasFromEtherscan.d.ts","sourceRoot":"","sources":["../../../src/lib/getGasFromEtherscan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAEjG,eAAO,MAAM,mBAAmB,WAAkB,MAAM,KAAG,OAAO,CAAC,4BAA4B,CAG9F,CAAA"}
@@ -1,79 +1,2 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
23
- EthereumGasEtherscanPlugin: () => EthereumGasEtherscanPlugin,
24
- EthereumGasEtherscanWitness: () => EthereumGasEtherscanWitness,
25
- EthereumGasEtherscanWitnessConfigSchema: () => EthereumGasEtherscanWitnessConfigSchema,
26
- default: () => EthereumGasEtherscanPlugin
27
- });
28
- module.exports = __toCommonJS(src_exports);
29
-
30
- // src/Plugin.ts
31
- var import_etherscan_ethereum_gas_payload_plugin2 = require("@xyo-network/etherscan-ethereum-gas-payload-plugin");
32
- var import_payload_model = require("@xyo-network/payload-model");
33
- var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
34
-
35
- // src/Witness.ts
36
- var import_assert = require("@xylabs/assert");
37
- var import_abstract_witness = require("@xyo-network/abstract-witness");
38
- var import_etherscan_ethereum_gas_payload_plugin = require("@xyo-network/etherscan-ethereum-gas-payload-plugin");
39
- var import_payload_builder = require("@xyo-network/payload-builder");
40
-
41
- // src/lib/getGasFromEtherscan.ts
42
- var import_axios = require("@xylabs/axios");
43
- var getGasFromEtherscan = async (apiKey) => {
44
- const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`;
45
- return (await import_axios.axios.get(url)).data;
46
- };
47
-
48
- // src/Schema.ts
49
- var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
50
-
51
- // src/Witness.ts
52
- var EthereumGasEtherscanWitness = class extends import_abstract_witness.AbstractWitness {
53
- static configSchemas = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema];
54
- static defaultConfigSchema = EthereumGasEtherscanWitnessConfigSchema;
55
- async observeHandler() {
56
- var _a;
57
- const apiKey = (0, import_assert.assertEx)((_a = this.config) == null ? void 0 : _a.apiKey, () => "apiKey is required");
58
- const payload = await new import_payload_builder.PayloadBuilder({ schema: import_etherscan_ethereum_gas_payload_plugin.EthereumGasEtherscanSchema }).fields(await getGasFromEtherscan(apiKey)).build();
59
- return [payload];
60
- }
61
- };
62
-
63
- // src/Plugin.ts
64
- var EthereumGasEtherscanPlugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
65
- { required: { [import_etherscan_ethereum_gas_payload_plugin2.EthereumGasEtherscanSchema]: 1 }, schema: import_payload_model.PayloadSetSchema },
66
- {
67
- witness: async (params) => {
68
- const result = await EthereumGasEtherscanWitness.create(params);
69
- return result;
70
- }
71
- }
72
- );
73
- // Annotate the CommonJS export names for ESM import in node:
74
- 0 && (module.exports = {
75
- EthereumGasEtherscanPlugin,
76
- EthereumGasEtherscanWitness,
77
- EthereumGasEtherscanWitnessConfigSchema
78
- });
1
+ "use strict";var m=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var P=(r,e)=>{for(var t in e)m(r,t,{get:e[t],enumerable:!0})},x=(r,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of G(e))!S.call(r,s)&&s!==t&&m(r,s,{get:()=>e[s],enumerable:!(a=y(e,s))||a.enumerable});return r};var W=r=>x(m({},"__esModule",{value:!0}),r);var w={};P(w,{EthereumGasEtherscanPlugin:()=>i,EthereumGasEtherscanWitness:()=>o,EthereumGasEtherscanWitnessConfigSchema:()=>n,default:()=>i});module.exports=W(w);var l=require("@xyo-network/etherscan-ethereum-gas-payload-plugin"),d=require("@xyo-network/payload-model"),g=require("@xyo-network/payloadset-plugin");var p=require("@xylabs/assert"),E=require("@xyo-network/abstract-witness"),u=require("@xyo-network/etherscan-ethereum-gas-payload-plugin"),f=require("@xyo-network/payload-builder");var c=require("@xylabs/axios"),h=async r=>{let e=`https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${r}`;return(await c.axios.get(e)).data};var n="network.xyo.blockchain.ethereum.gas.etherscan.witness.config";var o=class extends E.AbstractWitness{static configSchemas=[...super.configSchemas,n];static defaultConfigSchema=n;async observeHandler(){var a;let e=(0,p.assertEx)((a=this.config)==null?void 0:a.apiKey,()=>"apiKey is required");return[await new f.PayloadBuilder({schema:u.EthereumGasEtherscanSchema}).fields(await h(e)).build()]}};var i=()=>(0,g.createPayloadSetWitnessPlugin)({required:{[l.EthereumGasEtherscanSchema]:1},schema:d.PayloadSetSchema},{witness:async r=>await o.create(r)});0&&(module.exports={EthereumGasEtherscanPlugin,EthereumGasEtherscanWitness,EthereumGasEtherscanWitnessConfigSchema});
79
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config'\nexport { EthereumGasEtherscanPlugin as default, EthereumGasEtherscanPlugin } from './Plugin'\nexport * from './Schema'\nexport * from './Witness'\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, Schema } 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 readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasEtherscanWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,uCAAuC;AAAA,EACnH,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,iBAAqC;AAhBhE;AAiBI,UAAM,aAAS,yBAAS,UAAK,WAAL,mBAAa,QAAQ,MAAM,oBAAoB;AACvE,UAAM,UAAU,MAAM,IAAI,sCAA4C,EAAE,QAAQ,wEAA2B,CAAC,EACzG,OAAO,MAAM,oBAAoB,MAAM,CAAC,EACxC,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADjBO,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"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config'\nexport { EthereumGasEtherscanPlugin as default, EthereumGasEtherscanPlugin } from './Plugin'\nexport * from './Schema'\nexport * from './Witness'\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, Schema } 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 readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasEtherscanWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gCAAAE,EAAA,gCAAAC,EAAA,4CAAAC,EAAA,YAAAF,IAAA,eAAAG,EAAAL,GCAA,IAAAM,EAA2C,8DAC3CC,EAAiC,sCACjCC,EAA8C,0CCF9C,IAAAC,EAAyB,0BACzBC,EAAgC,yCAChCC,EAAwE,8DAExEC,EAA+B,wCCJ/B,IAAAC,EAAsB,yBAGTC,EAAsB,MAAOC,GAA0D,CAClG,IAAMC,EAAM,0EAA0ED,CAAM,GAC5F,OAAQ,MAAM,QAAM,IAAkCC,CAAG,GAAG,IAC9D,ECLO,IAAMC,EACX,+DFUK,IAAMC,EAAN,cAA0C,iBAAmF,CAClI,OAAyB,cAA0B,CAAC,GAAG,MAAM,cAAeC,CAAuC,EACnH,OAAyB,oBAA8BA,EAEvD,MAAyB,gBAAqC,CAhBhE,IAAAC,EAiBI,IAAMC,KAAS,aAASD,EAAA,KAAK,SAAL,YAAAA,EAAa,OAAQ,IAAM,oBAAoB,EAIvE,MAAO,CAHS,MAAM,IAAI,iBAA4C,CAAE,OAAQ,4BAA2B,CAAC,EACzG,OAAO,MAAME,EAAoBD,CAAM,CAAC,EACxC,MAAM,CACM,CACjB,CACF,EDjBO,IAAME,EAA6B,OACxC,iCACE,CAAE,SAAU,CAAE,CAAC,4BAA0B,EAAG,CAAE,EAAG,OAAQ,kBAAiB,EAC1E,CACE,QAAS,MAAOC,GACC,MAAMC,EAA4B,OAAOD,CAAM,CAGlE,CACF","names":["src_exports","__export","EthereumGasEtherscanPlugin","EthereumGasEtherscanWitness","EthereumGasEtherscanWitnessConfigSchema","__toCommonJS","import_etherscan_ethereum_gas_payload_plugin","import_payload_model","import_payloadset_plugin","import_assert","import_abstract_witness","import_etherscan_ethereum_gas_payload_plugin","import_payload_builder","import_axios","getGasFromEtherscan","apiKey","url","EthereumGasEtherscanWitnessConfigSchema","EthereumGasEtherscanWitness","EthereumGasEtherscanWitnessConfigSchema","_a","apiKey","getGasFromEtherscan","EthereumGasEtherscanPlugin","params","EthereumGasEtherscanWitness"]}
@@ -1,50 +1,2 @@
1
- // src/Plugin.ts
2
- import { EthereumGasEtherscanSchema as EthereumGasEtherscanSchema2 } from "@xyo-network/etherscan-ethereum-gas-payload-plugin";
3
- import { PayloadSetSchema } from "@xyo-network/payload-model";
4
- import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
5
-
6
- // src/Witness.ts
7
- import { assertEx } from "@xylabs/assert";
8
- import { AbstractWitness } from "@xyo-network/abstract-witness";
9
- import { EthereumGasEtherscanSchema } from "@xyo-network/etherscan-ethereum-gas-payload-plugin";
10
- import { PayloadBuilder } from "@xyo-network/payload-builder";
11
-
12
- // src/lib/getGasFromEtherscan.ts
13
- import { axios } from "@xylabs/axios";
14
- var getGasFromEtherscan = async (apiKey) => {
15
- const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`;
16
- return (await axios.get(url)).data;
17
- };
18
-
19
- // src/Schema.ts
20
- var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
21
-
22
- // src/Witness.ts
23
- var EthereumGasEtherscanWitness = class extends AbstractWitness {
24
- static configSchemas = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema];
25
- static defaultConfigSchema = EthereumGasEtherscanWitnessConfigSchema;
26
- async observeHandler() {
27
- var _a;
28
- const apiKey = assertEx((_a = this.config) == null ? void 0 : _a.apiKey, () => "apiKey is required");
29
- const payload = await new PayloadBuilder({ schema: EthereumGasEtherscanSchema }).fields(await getGasFromEtherscan(apiKey)).build();
30
- return [payload];
31
- }
32
- };
33
-
34
- // src/Plugin.ts
35
- var EthereumGasEtherscanPlugin = () => createPayloadSetWitnessPlugin(
36
- { required: { [EthereumGasEtherscanSchema2]: 1 }, schema: PayloadSetSchema },
37
- {
38
- witness: async (params) => {
39
- const result = await EthereumGasEtherscanWitness.create(params);
40
- return result;
41
- }
42
- }
43
- );
44
- export {
45
- EthereumGasEtherscanPlugin,
46
- EthereumGasEtherscanWitness,
47
- EthereumGasEtherscanWitnessConfigSchema,
48
- EthereumGasEtherscanPlugin as default
49
- };
1
+ import{EthereumGasEtherscanSchema as E}from"@xyo-network/etherscan-ethereum-gas-payload-plugin";import{PayloadSetSchema as u}from"@xyo-network/payload-model";import{createPayloadSetWitnessPlugin as f}from"@xyo-network/payloadset-plugin";import{assertEx as i}from"@xylabs/assert";import{AbstractWitness as c}from"@xyo-network/abstract-witness";import{EthereumGasEtherscanSchema as h}from"@xyo-network/etherscan-ethereum-gas-payload-plugin";import{PayloadBuilder as p}from"@xyo-network/payload-builder";import{axios as m}from"@xylabs/axios";var o=async e=>{let r=`https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${e}`;return(await m.get(r)).data};var a="network.xyo.blockchain.ethereum.gas.etherscan.witness.config";var t=class extends c{static configSchemas=[...super.configSchemas,a];static defaultConfigSchema=a;async observeHandler(){var s;let r=i((s=this.config)==null?void 0:s.apiKey,()=>"apiKey is required");return[await new p({schema:h}).fields(await o(r)).build()]}};var n=()=>f({required:{[E]:1},schema:u},{witness:async e=>await t.create(e)});export{n as EthereumGasEtherscanPlugin,t as EthereumGasEtherscanWitness,a as EthereumGasEtherscanWitnessConfigSchema,n as default};
50
2
  //# sourceMappingURL=index.js.map
@@ -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 { 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, Schema } 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 readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasEtherscanWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,uCAAuC;AAAA,EACnH,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,iBAAqC;AAhBhE;AAiBI,UAAM,SAAS,UAAS,UAAK,WAAL,mBAAa,QAAQ,MAAM,oBAAoB;AACvE,UAAM,UAAU,MAAM,IAAI,eAA4C,EAAE,QAAQ,2BAA2B,CAAC,EACzG,OAAO,MAAM,oBAAoB,MAAM,CAAC,EACxC,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADjBO,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"]}
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, Schema } 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 readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasEtherscanWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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,OAAS,8BAAAA,MAAkC,qDAC3C,OAAS,oBAAAC,MAAwB,6BACjC,OAAS,iCAAAC,MAAqC,iCCF9C,OAAS,YAAAC,MAAgB,iBACzB,OAAS,mBAAAC,MAAuB,gCAChC,OAAsC,8BAAAC,MAAkC,qDAExE,OAAS,kBAAAC,MAAsB,+BCJ/B,OAAS,SAAAC,MAAa,gBAGf,IAAMC,EAAsB,MAAOC,GAA0D,CAClG,IAAMC,EAAM,0EAA0ED,CAAM,GAC5F,OAAQ,MAAMF,EAAM,IAAkCG,CAAG,GAAG,IAC9D,ECLO,IAAMC,EACX,+DFUK,IAAMC,EAAN,cAA0CC,CAAmF,CAClI,OAAyB,cAA0B,CAAC,GAAG,MAAM,cAAeC,CAAuC,EACnH,OAAyB,oBAA8BA,EAEvD,MAAyB,gBAAqC,CAhBhE,IAAAC,EAiBI,IAAMC,EAASC,GAASF,EAAA,KAAK,SAAL,YAAAA,EAAa,OAAQ,IAAM,oBAAoB,EAIvE,MAAO,CAHS,MAAM,IAAIG,EAA4C,CAAE,OAAQC,CAA2B,CAAC,EACzG,OAAO,MAAMC,EAAoBJ,CAAM,CAAC,EACxC,MAAM,CACM,CACjB,CACF,EDjBO,IAAMK,EAA6B,IACxCC,EACE,CAAE,SAAU,CAAE,CAACC,CAA0B,EAAG,CAAE,EAAG,OAAQC,CAAiB,EAC1E,CACE,QAAS,MAAOC,GACC,MAAMC,EAA4B,OAAOD,CAAM,CAGlE,CACF","names":["EthereumGasEtherscanSchema","PayloadSetSchema","createPayloadSetWitnessPlugin","assertEx","AbstractWitness","EthereumGasEtherscanSchema","PayloadBuilder","axios","getGasFromEtherscan","apiKey","url","EthereumGasEtherscanWitnessConfigSchema","EthereumGasEtherscanWitness","AbstractWitness","EthereumGasEtherscanWitnessConfigSchema","_a","apiKey","assertEx","PayloadBuilder","EthereumGasEtherscanSchema","getGasFromEtherscan","EthereumGasEtherscanPlugin","createPayloadSetWitnessPlugin","EthereumGasEtherscanSchema","PayloadSetSchema","params","EthereumGasEtherscanWitness"]}
@@ -1 +1 @@
1
- {"version":3,"file":"getGasFromEtherscan.d.ts","sourceRoot":"","sources":["../../../src/lib/getGasFromEtherscan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAEjG,eAAO,MAAM,mBAAmB,WAAkB,MAAM,KAAG,QAAQ,4BAA4B,CAG9F,CAAA"}
1
+ {"version":3,"file":"getGasFromEtherscan.d.ts","sourceRoot":"","sources":["../../../src/lib/getGasFromEtherscan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAEjG,eAAO,MAAM,mBAAmB,WAAkB,MAAM,KAAG,OAAO,CAAC,4BAA4B,CAG9F,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getGasFromEtherscan.d.ts","sourceRoot":"","sources":["../../../src/lib/getGasFromEtherscan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAEjG,eAAO,MAAM,mBAAmB,WAAkB,MAAM,KAAG,QAAQ,4BAA4B,CAG9F,CAAA"}
1
+ {"version":3,"file":"getGasFromEtherscan.d.ts","sourceRoot":"","sources":["../../../src/lib/getGasFromEtherscan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAEjG,eAAO,MAAM,mBAAmB,WAAkB,MAAM,KAAG,OAAO,CAAC,4BAA4B,CAG9F,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getGasFromEtherscan.d.ts","sourceRoot":"","sources":["../../../src/lib/getGasFromEtherscan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAEjG,eAAO,MAAM,mBAAmB,WAAkB,MAAM,KAAG,QAAQ,4BAA4B,CAG9F,CAAA"}
1
+ {"version":3,"file":"getGasFromEtherscan.d.ts","sourceRoot":"","sources":["../../../src/lib/getGasFromEtherscan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAEjG,eAAO,MAAM,mBAAmB,WAAkB,MAAM,KAAG,OAAO,CAAC,4BAA4B,CAG9F,CAAA"}
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "@xylabs/assert": "^3.5.1",
14
14
  "@xylabs/axios": "^3.5.1",
15
15
  "@xyo-network/abstract-witness": "^2.106.0",
16
- "@xyo-network/etherscan-ethereum-gas-payload-plugin": "~2.96.1",
16
+ "@xyo-network/etherscan-ethereum-gas-payload-plugin": "~2.96.2",
17
17
  "@xyo-network/module-model": "^2.106.0",
18
18
  "@xyo-network/payload-builder": "^2.106.0",
19
19
  "@xyo-network/payload-model": "^2.106.0",
@@ -22,11 +22,11 @@
22
22
  },
23
23
  "devDependencies": {
24
24
  "@xylabs/jest-helpers": "^3.5.1",
25
- "@xylabs/ts-scripts-yarn3": "^3.11.2",
26
- "@xylabs/tsconfig": "^3.11.2",
25
+ "@xylabs/ts-scripts-yarn3": "^3.11.7",
26
+ "@xylabs/tsconfig": "^3.11.7",
27
27
  "@xyo-network/payload-wrapper": "^2.106.0",
28
28
  "jest": "^29.7.0",
29
- "typescript": "^5.4.5"
29
+ "typescript": "^5.5.2"
30
30
  },
31
31
  "description": "Typescript/Javascript Plugins for XYO Platform",
32
32
  "types": "dist/node/index.d.ts",
@@ -67,6 +67,6 @@
67
67
  "url": "https://github.com/XYOracleNetwork/plugins.git"
68
68
  },
69
69
  "sideEffects": false,
70
- "version": "2.96.1",
70
+ "version": "2.96.2",
71
71
  "type": "module"
72
72
  }