@xyo-network/etherscan-ethereum-gas-plugin 2.75.0 → 2.75.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.
Files changed (68) hide show
  1. package/dist/browser/Config.d.cts +7 -0
  2. package/dist/browser/Config.d.cts.map +1 -0
  3. package/dist/browser/Plugin.d.cts +3 -0
  4. package/dist/browser/Plugin.d.cts.map +1 -0
  5. package/dist/browser/Plugin.js +4 -32
  6. package/dist/browser/Plugin.js.map +1 -1
  7. package/dist/browser/Schema.d.cts +3 -0
  8. package/dist/browser/Schema.d.cts.map +1 -0
  9. package/dist/browser/Schema.js +1 -2
  10. package/dist/browser/Schema.js.map +1 -1
  11. package/dist/browser/Witness.d.cts +9 -0
  12. package/dist/browser/Witness.d.cts.map +1 -0
  13. package/dist/browser/Witness.js +4 -15
  14. package/dist/browser/Witness.js.map +1 -1
  15. package/dist/browser/index.d.cts +7 -0
  16. package/dist/browser/index.d.cts.map +1 -0
  17. package/dist/browser/index.js +4 -45
  18. package/dist/browser/index.js.map +1 -1
  19. package/dist/browser/lib/getGasFromEtherscan.d.cts +3 -0
  20. package/dist/browser/lib/getGasFromEtherscan.d.cts.map +1 -0
  21. package/dist/browser/lib/getGasFromEtherscan.js +1 -2
  22. package/dist/browser/lib/getGasFromEtherscan.js.map +1 -1
  23. package/dist/browser/lib/index.d.cts +2 -0
  24. package/dist/browser/lib/index.d.cts.map +1 -0
  25. package/dist/browser/lib/index.js +1 -9
  26. package/dist/browser/lib/index.js.map +1 -1
  27. package/dist/docs.json +54180 -0
  28. package/dist/node/Config.d.cts +7 -0
  29. package/dist/node/Config.d.cts.map +1 -0
  30. package/dist/node/Config.js +2 -0
  31. package/dist/node/Config.js.map +1 -1
  32. package/dist/node/Plugin.d.cts +3 -0
  33. package/dist/node/Plugin.d.cts.map +1 -0
  34. package/dist/node/Plugin.js +35 -5
  35. package/dist/node/Plugin.js.map +1 -1
  36. package/dist/node/Plugin.mjs +33 -4
  37. package/dist/node/Plugin.mjs.map +1 -1
  38. package/dist/node/Schema.d.cts +3 -0
  39. package/dist/node/Schema.d.cts.map +1 -0
  40. package/dist/node/Schema.js +3 -1
  41. package/dist/node/Schema.js.map +1 -1
  42. package/dist/node/Schema.mjs +2 -1
  43. package/dist/node/Schema.mjs.map +1 -1
  44. package/dist/node/Witness.d.cts +9 -0
  45. package/dist/node/Witness.d.cts.map +1 -0
  46. package/dist/node/Witness.js +20 -7
  47. package/dist/node/Witness.js.map +1 -1
  48. package/dist/node/Witness.mjs +17 -5
  49. package/dist/node/Witness.mjs.map +1 -1
  50. package/dist/node/index.d.cts +7 -0
  51. package/dist/node/index.d.cts.map +1 -0
  52. package/dist/node/index.js +53 -10
  53. package/dist/node/index.js.map +1 -1
  54. package/dist/node/index.mjs +46 -4
  55. package/dist/node/index.mjs.map +1 -1
  56. package/dist/node/lib/getGasFromEtherscan.d.cts +3 -0
  57. package/dist/node/lib/getGasFromEtherscan.d.cts.map +1 -0
  58. package/dist/node/lib/getGasFromEtherscan.js +3 -1
  59. package/dist/node/lib/getGasFromEtherscan.js.map +1 -1
  60. package/dist/node/lib/getGasFromEtherscan.mjs +2 -1
  61. package/dist/node/lib/getGasFromEtherscan.mjs.map +1 -1
  62. package/dist/node/lib/index.d.cts +2 -0
  63. package/dist/node/lib/index.d.cts.map +1 -0
  64. package/dist/node/lib/index.js +17 -3
  65. package/dist/node/lib/index.js.map +1 -1
  66. package/dist/node/lib/index.mjs +9 -1
  67. package/dist/node/lib/index.mjs.map +1 -1
  68. package/package.json +12 -12
@@ -0,0 +1,7 @@
1
+ import { WitnessConfig } from '@xyo-network/witness';
2
+ import { EthereumGasEtherscanWitnessConfigSchema } from './Schema';
3
+ export type EthereumGasEtherscanWitnessConfig = WitnessConfig<{
4
+ apiKey: string;
5
+ schema: EthereumGasEtherscanWitnessConfigSchema;
6
+ }>;
7
+ //# sourceMappingURL=Config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,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"}
@@ -12,6 +12,8 @@ var __copyProps = (to, from, except, desc) => {
12
12
  return to;
13
13
  };
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/Config.ts
15
17
  var Config_exports = {};
16
18
  module.exports = __toCommonJS(Config_exports);
17
19
  //# sourceMappingURL=Config.js.map
@@ -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'\n\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema'\n\nexport type EthereumGasEtherscanWitnessConfig = WitnessConfig<{\n apiKey: string\n schema: EthereumGasEtherscanWitnessConfigSchema\n}>\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1,3 @@
1
+ import { EthereumGasEtherscanWitness } from './Witness';
2
+ export declare const EthereumGasEtherscanPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<EthereumGasEtherscanWitness>;
3
+ //# sourceMappingURL=Plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAA;AAEvD,eAAO,MAAM,0BAA0B,qGASpC,CAAA"}
@@ -16,20 +16,50 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/Plugin.ts
19
21
  var Plugin_exports = {};
20
22
  __export(Plugin_exports, {
21
23
  EthereumGasEtherscanPlugin: () => EthereumGasEtherscanPlugin
22
24
  });
23
25
  module.exports = __toCommonJS(Plugin_exports);
24
- var import_etherscan_ethereum_gas_payload_plugin = require("@xyo-network/etherscan-ethereum-gas-payload-plugin");
26
+ var import_etherscan_ethereum_gas_payload_plugin2 = require("@xyo-network/etherscan-ethereum-gas-payload-plugin");
25
27
  var import_payload_model = require("@xyo-network/payload-model");
26
28
  var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
27
- var import_Witness = require("./Witness");
28
- const EthereumGasEtherscanPlugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
29
- { required: { [import_etherscan_ethereum_gas_payload_plugin.EthereumGasEtherscanSchema]: 1 }, schema: import_payload_model.PayloadSetSchema },
29
+
30
+ // src/Witness.ts
31
+ var import_assert = require("@xylabs/assert");
32
+ var import_etherscan_ethereum_gas_payload_plugin = require("@xyo-network/etherscan-ethereum-gas-payload-plugin");
33
+ var import_payload_builder = require("@xyo-network/payload-builder");
34
+ var import_witness = require("@xyo-network/witness");
35
+
36
+ // src/lib/getGasFromEtherscan.ts
37
+ var import_axios = require("@xyo-network/axios");
38
+ var getGasFromEtherscan = async (apiKey) => {
39
+ const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`;
40
+ return (await import_axios.axios.get(url)).data;
41
+ };
42
+
43
+ // src/Schema.ts
44
+ var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
45
+
46
+ // src/Witness.ts
47
+ var EthereumGasEtherscanWitness = class extends import_witness.AbstractWitness {
48
+ static configSchemas = [EthereumGasEtherscanWitnessConfigSchema];
49
+ async observeHandler() {
50
+ var _a;
51
+ const apiKey = (0, import_assert.assertEx)((_a = this.config) == null ? void 0 : _a.apiKey, "apiKey is required");
52
+ const payload = new import_payload_builder.PayloadBuilder({ schema: import_etherscan_ethereum_gas_payload_plugin.EthereumGasEtherscanSchema }).fields(await getGasFromEtherscan(apiKey)).build();
53
+ return [payload];
54
+ }
55
+ };
56
+
57
+ // src/Plugin.ts
58
+ var EthereumGasEtherscanPlugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
59
+ { required: { [import_etherscan_ethereum_gas_payload_plugin2.EthereumGasEtherscanSchema]: 1 }, schema: import_payload_model.PayloadSetSchema },
30
60
  {
31
61
  witness: async (params) => {
32
- const result = await import_Witness.EthereumGasEtherscanWitness.create(params);
62
+ const result = await EthereumGasEtherscanWitness.create(params);
33
63
  return result;
34
64
  }
35
65
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Plugin.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"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mDAA2C;AAC3C,2BAAiC;AACjC,+BAA8C;AAE9C,qBAA4C;AAErC,MAAM,6BAA6B,UACxC;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,uEAA0B,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EAC1E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,2CAA4B,OAAO,MAAM;AAC9D,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[]}
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 { AbstractWitness, WitnessParams } from '@xyo-network/witness'\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,mDAAwE;AAExE,6BAA+B;AAE/B,qBAA+C;;;ACL/C,mBAAsB;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,mBAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACX;;;AFSK,IAAM,8BAAN,cAA0C,+BAAmF;AAAA,EAClI,OAAgB,gBAAgB,CAAC,uCAAuC;AAAA,EAExE,MAAyB,iBAAqC;AAdhE;AAeI,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;;;ADfO,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,9 +1,38 @@
1
- import { EthereumGasEtherscanSchema } from "@xyo-network/etherscan-ethereum-gas-payload-plugin";
1
+ // src/Plugin.ts
2
+ import { EthereumGasEtherscanSchema as EthereumGasEtherscanSchema2 } from "@xyo-network/etherscan-ethereum-gas-payload-plugin";
2
3
  import { PayloadSetSchema } from "@xyo-network/payload-model";
3
4
  import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
4
- import { EthereumGasEtherscanWitness } from "./Witness";
5
- const EthereumGasEtherscanPlugin = () => createPayloadSetWitnessPlugin(
6
- { required: { [EthereumGasEtherscanSchema]: 1 }, schema: PayloadSetSchema },
5
+
6
+ // src/Witness.ts
7
+ import { assertEx } from "@xylabs/assert";
8
+ import { EthereumGasEtherscanSchema } from "@xyo-network/etherscan-ethereum-gas-payload-plugin";
9
+ import { PayloadBuilder } from "@xyo-network/payload-builder";
10
+ import { AbstractWitness } from "@xyo-network/witness";
11
+
12
+ // src/lib/getGasFromEtherscan.ts
13
+ import { axios } from "@xyo-network/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 = [EthereumGasEtherscanWitnessConfigSchema];
25
+ async observeHandler() {
26
+ var _a;
27
+ const apiKey = assertEx((_a = this.config) == null ? void 0 : _a.apiKey, "apiKey is required");
28
+ const payload = 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 },
7
36
  {
8
37
  witness: async (params) => {
9
38
  const result = await EthereumGasEtherscanWitness.create(params);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Plugin.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"],"mappings":"AAAA,SAAS,kCAAkC;AAC3C,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;AAE9C,SAAS,mCAAmC;AAErC,MAAM,6BAA6B,MACxC;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,0BAA0B,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":[]}
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 { AbstractWitness, WitnessParams } from '@xyo-network/witness'\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,SAAsC,kCAAkC;AAExE,SAAS,sBAAsB;AAE/B,SAAS,uBAAsC;;;ACL/C,SAAS,aAAa;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,MAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACX;;;AFSK,IAAM,8BAAN,cAA0C,gBAAmF;AAAA,EAClI,OAAgB,gBAAgB,CAAC,uCAAuC;AAAA,EAExE,MAAyB,iBAAqC;AAdhE;AAeI,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;;;ADfO,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"]}
@@ -0,0 +1,3 @@
1
+ export type EthereumGasEtherscanWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config';
2
+ export declare const EthereumGasEtherscanWitnessConfigSchema: EthereumGasEtherscanWitnessConfigSchema;
3
+ //# sourceMappingURL=Schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../src/Schema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uCAAuC,GAAG,8DAA8D,CAAA;AACpH,eAAO,MAAM,uCAAuC,EAAE,uCACU,CAAA"}
@@ -16,12 +16,14 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/Schema.ts
19
21
  var Schema_exports = {};
20
22
  __export(Schema_exports, {
21
23
  EthereumGasEtherscanWitnessConfigSchema: () => EthereumGasEtherscanWitnessConfigSchema
22
24
  });
23
25
  module.exports = __toCommonJS(Schema_exports);
24
- const EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
26
+ var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
25
27
  // Annotate the CommonJS export names for ESM import in node:
26
28
  0 && (module.exports = {
27
29
  EthereumGasEtherscanWitnessConfigSchema
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Schema.ts"],"sourcesContent":["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;AACO,MAAM,0CACX;","names":[]}
1
+ {"version":3,"sources":["../../src/Schema.ts"],"sourcesContent":["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;AACO,IAAM,0CACX;","names":[]}
@@ -1,4 +1,5 @@
1
- const EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
1
+ // src/Schema.ts
2
+ var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
2
3
  export {
3
4
  EthereumGasEtherscanWitnessConfigSchema
4
5
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Schema.ts"],"sourcesContent":["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":"AACO,MAAM,0CACX;","names":[]}
1
+ {"version":3,"sources":["../../src/Schema.ts"],"sourcesContent":["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":";AACO,IAAM,0CACX;","names":[]}
@@ -0,0 +1,9 @@
1
+ import { AnyConfigSchema } from '@xyo-network/module-model';
2
+ import { Payload } from '@xyo-network/payload-model';
3
+ import { AbstractWitness, WitnessParams } from '@xyo-network/witness';
4
+ import { EthereumGasEtherscanWitnessConfig } from './Config';
5
+ export declare class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {
6
+ static configSchemas: "network.xyo.blockchain.ethereum.gas.etherscan.witness.config"[];
7
+ protected observeHandler(): Promise<Payload[]>;
8
+ }
9
+ //# sourceMappingURL=Witness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAErE,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"}
@@ -16,6 +16,8 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/Witness.ts
19
21
  var Witness_exports = {};
20
22
  __export(Witness_exports, {
21
23
  EthereumGasEtherscanWitness: () => EthereumGasEtherscanWitness
@@ -25,16 +27,27 @@ var import_assert = require("@xylabs/assert");
25
27
  var import_etherscan_ethereum_gas_payload_plugin = require("@xyo-network/etherscan-ethereum-gas-payload-plugin");
26
28
  var import_payload_builder = require("@xyo-network/payload-builder");
27
29
  var import_witness = require("@xyo-network/witness");
28
- var import_lib = require("./lib");
29
- var import_Schema = require("./Schema");
30
- class EthereumGasEtherscanWitness extends import_witness.AbstractWitness {
31
- static configSchemas = [import_Schema.EthereumGasEtherscanWitnessConfigSchema];
30
+
31
+ // src/lib/getGasFromEtherscan.ts
32
+ var import_axios = require("@xyo-network/axios");
33
+ var getGasFromEtherscan = async (apiKey) => {
34
+ const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`;
35
+ return (await import_axios.axios.get(url)).data;
36
+ };
37
+
38
+ // src/Schema.ts
39
+ var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
40
+
41
+ // src/Witness.ts
42
+ var EthereumGasEtherscanWitness = class extends import_witness.AbstractWitness {
43
+ static configSchemas = [EthereumGasEtherscanWitnessConfigSchema];
32
44
  async observeHandler() {
33
- const apiKey = (0, import_assert.assertEx)(this.config?.apiKey, "apiKey is required");
34
- const payload = new import_payload_builder.PayloadBuilder({ schema: import_etherscan_ethereum_gas_payload_plugin.EthereumGasEtherscanSchema }).fields(await (0, import_lib.getGasFromEtherscan)(apiKey)).build();
45
+ var _a;
46
+ const apiKey = (0, import_assert.assertEx)((_a = this.config) == null ? void 0 : _a.apiKey, "apiKey is required");
47
+ const payload = new import_payload_builder.PayloadBuilder({ schema: import_etherscan_ethereum_gas_payload_plugin.EthereumGasEtherscanSchema }).fields(await getGasFromEtherscan(apiKey)).build();
35
48
  return [payload];
36
49
  }
37
- }
50
+ };
38
51
  // Annotate the CommonJS export names for ESM import in node:
39
52
  0 && (module.exports = {
40
53
  EthereumGasEtherscanWitness
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Witness.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 { AbstractWitness, WitnessParams } from '@xyo-network/witness'\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"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAyB;AACzB,mDAAwE;AAExE,6BAA+B;AAE/B,qBAA+C;AAG/C,iBAAoC;AACpC,oBAAwD;AAEjD,MAAM,oCAAoC,+BAAmF;AAAA,EAClI,OAAgB,gBAAgB,CAAC,qDAAuC;AAAA,EAExE,MAAyB,iBAAqC;AAC5D,UAAM,aAAS,wBAAS,KAAK,QAAQ,QAAQ,oBAAoB;AACjE,UAAM,UAAU,IAAI,sCAA4C,EAAE,QAAQ,wEAA2B,CAAC,EACnG,OAAO,UAAM,gCAAoB,MAAM,CAAC,EACxC,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;","names":[]}
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 { AbstractWitness, WitnessParams } from '@xyo-network/witness'\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,mDAAwE;AAExE,6BAA+B;AAE/B,qBAA+C;;;ACL/C,mBAAsB;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,mBAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACX;;;AFSK,IAAM,8BAAN,cAA0C,+BAAmF;AAAA,EAClI,OAAgB,gBAAgB,CAAC,uCAAuC;AAAA,EAExE,MAAyB,iBAAqC;AAdhE;AAeI,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":[]}
@@ -1,17 +1,29 @@
1
+ // src/Witness.ts
1
2
  import { assertEx } from "@xylabs/assert";
2
3
  import { EthereumGasEtherscanSchema } from "@xyo-network/etherscan-ethereum-gas-payload-plugin";
3
4
  import { PayloadBuilder } from "@xyo-network/payload-builder";
4
5
  import { AbstractWitness } from "@xyo-network/witness";
5
- import { getGasFromEtherscan } from "./lib";
6
- import { EthereumGasEtherscanWitnessConfigSchema } from "./Schema";
7
- class EthereumGasEtherscanWitness extends AbstractWitness {
6
+
7
+ // src/lib/getGasFromEtherscan.ts
8
+ import { axios } from "@xyo-network/axios";
9
+ var getGasFromEtherscan = async (apiKey) => {
10
+ const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`;
11
+ return (await axios.get(url)).data;
12
+ };
13
+
14
+ // src/Schema.ts
15
+ var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
16
+
17
+ // src/Witness.ts
18
+ var EthereumGasEtherscanWitness = class extends AbstractWitness {
8
19
  static configSchemas = [EthereumGasEtherscanWitnessConfigSchema];
9
20
  async observeHandler() {
10
- const apiKey = assertEx(this.config?.apiKey, "apiKey is required");
21
+ var _a;
22
+ const apiKey = assertEx((_a = this.config) == null ? void 0 : _a.apiKey, "apiKey is required");
11
23
  const payload = new PayloadBuilder({ schema: EthereumGasEtherscanSchema }).fields(await getGasFromEtherscan(apiKey)).build();
12
24
  return [payload];
13
25
  }
14
- }
26
+ };
15
27
  export {
16
28
  EthereumGasEtherscanWitness
17
29
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Witness.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 { AbstractWitness, WitnessParams } from '@xyo-network/witness'\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"],"mappings":"AAAA,SAAS,gBAAgB;AACzB,SAAsC,kCAAkC;AAExE,SAAS,sBAAsB;AAE/B,SAAS,uBAAsC;AAG/C,SAAS,2BAA2B;AACpC,SAAS,+CAA+C;AAEjD,MAAM,oCAAoC,gBAAmF;AAAA,EAClI,OAAgB,gBAAgB,CAAC,uCAAuC;AAAA,EAExE,MAAyB,iBAAqC;AAC5D,UAAM,SAAS,SAAS,KAAK,QAAQ,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":[]}
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 { AbstractWitness, WitnessParams } from '@xyo-network/witness'\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,SAAsC,kCAAkC;AAExE,SAAS,sBAAsB;AAE/B,SAAS,uBAAsC;;;ACL/C,SAAS,aAAa;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,MAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACX;;;AFSK,IAAM,8BAAN,cAA0C,gBAAmF;AAAA,EAClI,OAAgB,gBAAgB,CAAC,uCAAuC;AAAA,EAExE,MAAyB,iBAAqC;AAdhE;AAeI,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":[]}
@@ -0,0 +1,7 @@
1
+ import { EthereumGasEtherscanPlugin } from './Plugin';
2
+ export * from './Config';
3
+ export * from './Schema';
4
+ export * from './Witness';
5
+ export { EthereumGasEtherscanPlugin };
6
+ export default EthereumGasEtherscanPlugin;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAErD,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,0BAA0B,EAAE,CAAA;AAGrC,eAAe,0BAA0B,CAAA"}
@@ -15,24 +15,67 @@ var __copyProps = (to, from, except, desc) => {
15
15
  }
16
16
  return to;
17
17
  };
18
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
20
21
  var src_exports = {};
21
22
  __export(src_exports, {
22
- EthereumGasEtherscanPlugin: () => import_Plugin.EthereumGasEtherscanPlugin,
23
+ EthereumGasEtherscanPlugin: () => EthereumGasEtherscanPlugin,
24
+ EthereumGasEtherscanWitness: () => EthereumGasEtherscanWitness,
25
+ EthereumGasEtherscanWitnessConfigSchema: () => EthereumGasEtherscanWitnessConfigSchema,
23
26
  default: () => src_default
24
27
  });
25
28
  module.exports = __toCommonJS(src_exports);
26
- var import_Plugin = require("./Plugin");
27
- __reExport(src_exports, require("./Config"), module.exports);
28
- __reExport(src_exports, require("./Schema"), module.exports);
29
- __reExport(src_exports, require("./Witness"), module.exports);
30
- var src_default = import_Plugin.EthereumGasEtherscanPlugin;
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_etherscan_ethereum_gas_payload_plugin = require("@xyo-network/etherscan-ethereum-gas-payload-plugin");
38
+ var import_payload_builder = require("@xyo-network/payload-builder");
39
+ var import_witness = require("@xyo-network/witness");
40
+
41
+ // src/lib/getGasFromEtherscan.ts
42
+ var import_axios = require("@xyo-network/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_witness.AbstractWitness {
53
+ static configSchemas = [EthereumGasEtherscanWitnessConfigSchema];
54
+ async observeHandler() {
55
+ var _a;
56
+ const apiKey = (0, import_assert.assertEx)((_a = this.config) == null ? void 0 : _a.apiKey, "apiKey is required");
57
+ const payload = 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
+ );
72
+
73
+ // src/index.ts
74
+ var src_default = EthereumGasEtherscanPlugin;
31
75
  // Annotate the CommonJS export names for ESM import in node:
32
76
  0 && (module.exports = {
33
77
  EthereumGasEtherscanPlugin,
34
- ...require("./Config"),
35
- ...require("./Schema"),
36
- ...require("./Witness")
78
+ EthereumGasEtherscanWitness,
79
+ EthereumGasEtherscanWitnessConfigSchema
37
80
  });
38
81
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.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"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA2C;AAE3C,wBAAc,qBAFd;AAGA,wBAAc,qBAHd;AAIA,wBAAc,sBAJd;AASA,IAAO,cAAQ;","names":[]}
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 { AbstractWitness, WitnessParams } from '@xyo-network/witness'\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,mDAAwE;AAExE,6BAA+B;AAE/B,qBAA+C;;;ACL/C,mBAAsB;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,mBAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACX;;;AFSK,IAAM,8BAAN,cAA0C,+BAAmF;AAAA,EAClI,OAAgB,gBAAgB,CAAC,uCAAuC;AAAA,EAExE,MAAyB,iBAAqC;AAdhE;AAeI,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;;;ADfO,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"]}
@@ -1,10 +1,52 @@
1
- import { EthereumGasEtherscanPlugin } from "./Plugin";
2
- export * from "./Config";
3
- export * from "./Schema";
4
- export * from "./Witness";
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 { EthereumGasEtherscanSchema } from "@xyo-network/etherscan-ethereum-gas-payload-plugin";
9
+ import { PayloadBuilder } from "@xyo-network/payload-builder";
10
+ import { AbstractWitness } from "@xyo-network/witness";
11
+
12
+ // src/lib/getGasFromEtherscan.ts
13
+ import { axios } from "@xyo-network/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 = [EthereumGasEtherscanWitnessConfigSchema];
25
+ async observeHandler() {
26
+ var _a;
27
+ const apiKey = assertEx((_a = this.config) == null ? void 0 : _a.apiKey, "apiKey is required");
28
+ const payload = 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
+
44
+ // src/index.ts
5
45
  var src_default = EthereumGasEtherscanPlugin;
6
46
  export {
7
47
  EthereumGasEtherscanPlugin,
48
+ EthereumGasEtherscanWitness,
49
+ EthereumGasEtherscanWitnessConfigSchema,
8
50
  src_default as default
9
51
  };
10
52
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.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"],"mappings":"AAAA,SAAS,kCAAkC;AAE3C,cAAc;AACd,cAAc;AACd,cAAc;AAKd,IAAO,cAAQ;","names":[]}
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 { AbstractWitness, WitnessParams } from '@xyo-network/witness'\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,SAAsC,kCAAkC;AAExE,SAAS,sBAAsB;AAE/B,SAAS,uBAAsC;;;ACL/C,SAAS,aAAa;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,MAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACX;;;AFSK,IAAM,8BAAN,cAA0C,gBAAmF;AAAA,EAClI,OAAgB,gBAAgB,CAAC,uCAAuC;AAAA,EAExE,MAAyB,iBAAqC;AAdhE;AAeI,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;;;ADfO,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"]}
@@ -0,0 +1,3 @@
1
+ import { EthereumGasEtherscanResponse } from '@xyo-network/etherscan-ethereum-gas-payload-plugin';
2
+ export declare const getGasFromEtherscan: (apiKey: string) => Promise<EthereumGasEtherscanResponse>;
3
+ //# sourceMappingURL=getGasFromEtherscan.d.ts.map
@@ -0,0 +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"}
@@ -16,13 +16,15 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/lib/getGasFromEtherscan.ts
19
21
  var getGasFromEtherscan_exports = {};
20
22
  __export(getGasFromEtherscan_exports, {
21
23
  getGasFromEtherscan: () => getGasFromEtherscan
22
24
  });
23
25
  module.exports = __toCommonJS(getGasFromEtherscan_exports);
24
26
  var import_axios = require("@xyo-network/axios");
25
- const getGasFromEtherscan = async (apiKey) => {
27
+ var getGasFromEtherscan = async (apiKey) => {
26
28
  const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`;
27
29
  return (await import_axios.axios.get(url)).data;
28
30
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/getGasFromEtherscan.ts"],"sourcesContent":["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"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsB;AAGf,MAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,mBAAM,IAAkC,GAAG,GAAG;AAC9D;","names":[]}
1
+ {"version":3,"sources":["../../../src/lib/getGasFromEtherscan.ts"],"sourcesContent":["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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsB;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,mBAAM,IAAkC,GAAG,GAAG;AAC9D;","names":[]}
@@ -1,5 +1,6 @@
1
+ // src/lib/getGasFromEtherscan.ts
1
2
  import { axios } from "@xyo-network/axios";
2
- const getGasFromEtherscan = async (apiKey) => {
3
+ var getGasFromEtherscan = async (apiKey) => {
3
4
  const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`;
4
5
  return (await axios.get(url)).data;
5
6
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/getGasFromEtherscan.ts"],"sourcesContent":["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"],"mappings":"AAAA,SAAS,aAAa;AAGf,MAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,MAAM,IAAkC,GAAG,GAAG;AAC9D;","names":[]}
1
+ {"version":3,"sources":["../../../src/lib/getGasFromEtherscan.ts"],"sourcesContent":["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"],"mappings":";AAAA,SAAS,aAAa;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,MAAM,IAAkC,GAAG,GAAG;AAC9D;","names":[]}
@@ -0,0 +1,2 @@
1
+ export * from './getGasFromEtherscan';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA"}
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
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
+ };
6
10
  var __copyProps = (to, from, except, desc) => {
7
11
  if (from && typeof from === "object" || typeof from === "function") {
8
12
  for (let key of __getOwnPropNames(from))
@@ -11,13 +15,23 @@ var __copyProps = (to, from, except, desc) => {
11
15
  }
12
16
  return to;
13
17
  };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/lib/index.ts
16
21
  var lib_exports = {};
22
+ __export(lib_exports, {
23
+ getGasFromEtherscan: () => getGasFromEtherscan
24
+ });
17
25
  module.exports = __toCommonJS(lib_exports);
18
- __reExport(lib_exports, require("./getGasFromEtherscan"), module.exports);
26
+
27
+ // src/lib/getGasFromEtherscan.ts
28
+ var import_axios = require("@xyo-network/axios");
29
+ var getGasFromEtherscan = async (apiKey) => {
30
+ const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`;
31
+ return (await import_axios.axios.get(url)).data;
32
+ };
19
33
  // Annotate the CommonJS export names for ESM import in node:
20
34
  0 && (module.exports = {
21
- ...require("./getGasFromEtherscan")
35
+ getGasFromEtherscan
22
36
  });
23
37
  //# sourceMappingURL=index.js.map