@xyo-network/etherscan-ethereum-gas-plugin 2.99.5 → 2.99.6

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.
@@ -3,7 +3,6 @@ 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 __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
6
  var __export = (target, all) => {
8
7
  for (var name in all)
9
8
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -41,45 +40,33 @@ var import_payload_builder = require("@xyo-network/payload-builder");
41
40
 
42
41
  // src/lib/getGasFromEtherscan.ts
43
42
  var import_axios = require("@xylabs/axios");
44
- var getGasFromEtherscan = /* @__PURE__ */ __name(async (apiKey) => {
43
+ var getGasFromEtherscan = async (apiKey) => {
45
44
  const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`;
46
45
  return (await import_axios.axios.get(url)).data;
47
- }, "getGasFromEtherscan");
46
+ };
48
47
 
49
48
  // src/Schema.ts
50
49
  var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
51
50
 
52
51
  // src/Witness.ts
53
52
  var EthereumGasEtherscanWitness = class extends import_abstract_witness.AbstractWitness {
54
- static {
55
- __name(this, "EthereumGasEtherscanWitness");
56
- }
57
- static configSchemas = [
58
- ...super.configSchemas,
59
- EthereumGasEtherscanWitnessConfigSchema
60
- ];
53
+ static configSchemas = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema];
61
54
  static defaultConfigSchema = EthereumGasEtherscanWitnessConfigSchema;
62
55
  async observeHandler() {
63
56
  const apiKey = (0, import_assert.assertEx)(this.config?.apiKey, () => "apiKey is required");
64
- const payload = await new import_payload_builder.PayloadBuilder({
65
- schema: import_etherscan_ethereum_gas_payload_plugin.EthereumGasEtherscanSchema
66
- }).fields(await getGasFromEtherscan(apiKey)).build();
67
- return [
68
- payload
69
- ];
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];
70
59
  }
71
60
  };
72
61
 
73
62
  // src/Plugin.ts
74
- var EthereumGasEtherscanPlugin = /* @__PURE__ */ __name(() => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)({
75
- required: {
76
- [import_etherscan_ethereum_gas_payload_plugin2.EthereumGasEtherscanSchema]: 1
77
- },
78
- schema: import_payload_model.PayloadSetSchema
79
- }, {
80
- witness: /* @__PURE__ */ __name(async (params) => {
81
- const result = await EthereumGasEtherscanWitness.create(params);
82
- return result;
83
- }, "witness")
84
- }), "EthereumGasEtherscanPlugin");
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
+ );
85
72
  //# 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.ts'\n// eslint-disable-next-line import/no-default-export\nexport { EthereumGasEtherscanPlugin as default, EthereumGasEtherscanPlugin } from './Plugin.ts'\nexport * from './Schema.ts'\nexport * from './Witness.ts'\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.ts'\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.ts'\nimport { getGasFromEtherscan } from './lib/index.ts'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema.ts'\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;;;;;;;;;;ACAA,IAAAA,gDAA2C;AAC3C,2BAAiC;AACjC,+BAA8C;;;ACF9C,oBAAyB;AACzB,8BAAgC;AAChC,mDAAwE;AAExE,6BAA+B;;;ACJ/B,mBAAsB;AAGf,IAAMC,sBAAsB,8BAAOC,WAAAA;AACxC,QAAMC,MAAM,0EAA0ED,MAAAA;AACtF,UAAQ,MAAME,mBAAMC,IAAkCF,GAAAA,GAAMG;AAC9D,GAHmC;;;ACF5B,IAAMC,0CACT;;;AFUG,IAAMC,8BAAN,cAA0CC,wCAAAA;EAZjD,OAYiDA;;;EAC/C,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeC;;EAC5E,OAAyBC,sBAA8BD;EAEvD,MAAyBE,iBAAqC;AAC5D,UAAMC,aAASC,wBAAS,KAAKC,QAAQF,QAAQ,MAAM,oBAAA;AACnD,UAAMG,UAAU,MAAM,IAAIC,sCAA4C;MAAEC,QAAQC;IAA2B,CAAA,EACxGC,OAAO,MAAMC,oBAAoBR,MAAAA,CAAAA,EACjCS,MAAK;AACR,WAAO;MAACN;;EACV;AACF;;;ADjBO,IAAMO,6BAA6B,iCACxCC,wDACE;EAAEC,UAAU;IAAE,CAACC,wEAAAA,GAA6B;EAAE;EAAGC,QAAQC;AAAiB,GAC1E;EACEC,SAAS,8BAAOC,WAAAA;AACd,UAAMC,SAAS,MAAMC,4BAA4BC,OAAOH,MAAAA;AACxD,WAAOC;EACT,GAHS;AAIX,CAAA,GARsC;","names":["import_etherscan_ethereum_gas_payload_plugin","getGasFromEtherscan","apiKey","url","axios","get","data","EthereumGasEtherscanWitnessConfigSchema","EthereumGasEtherscanWitness","AbstractWitness","configSchemas","EthereumGasEtherscanWitnessConfigSchema","defaultConfigSchema","observeHandler","apiKey","assertEx","config","payload","PayloadBuilder","schema","EthereumGasEtherscanSchema","fields","getGasFromEtherscan","build","EthereumGasEtherscanPlugin","createPayloadSetWitnessPlugin","required","EthereumGasEtherscanSchema","schema","PayloadSetSchema","witness","params","result","EthereumGasEtherscanWitness","create"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config.ts'\n// eslint-disable-next-line import/no-default-export\nexport { EthereumGasEtherscanPlugin as default, EthereumGasEtherscanPlugin } from './Plugin.ts'\nexport * from './Schema.ts'\nexport * from './Witness.ts'\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.ts'\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.ts'\nimport { getGasFromEtherscan } from './lib/index.ts'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema.ts'\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,0CACT;;;AFUG,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,6 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/Plugin.ts
5
2
  import { EthereumGasEtherscanSchema as EthereumGasEtherscanSchema2 } from "@xyo-network/etherscan-ethereum-gas-payload-plugin";
6
3
  import { PayloadSetSchema } from "@xyo-network/payload-model";
@@ -14,47 +11,35 @@ import { PayloadBuilder } from "@xyo-network/payload-builder";
14
11
 
15
12
  // src/lib/getGasFromEtherscan.ts
16
13
  import { axios } from "@xylabs/axios";
17
- var getGasFromEtherscan = /* @__PURE__ */ __name(async (apiKey) => {
14
+ var getGasFromEtherscan = async (apiKey) => {
18
15
  const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`;
19
16
  return (await axios.get(url)).data;
20
- }, "getGasFromEtherscan");
17
+ };
21
18
 
22
19
  // src/Schema.ts
23
20
  var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
24
21
 
25
22
  // src/Witness.ts
26
23
  var EthereumGasEtherscanWitness = class extends AbstractWitness {
27
- static {
28
- __name(this, "EthereumGasEtherscanWitness");
29
- }
30
- static configSchemas = [
31
- ...super.configSchemas,
32
- EthereumGasEtherscanWitnessConfigSchema
33
- ];
24
+ static configSchemas = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema];
34
25
  static defaultConfigSchema = EthereumGasEtherscanWitnessConfigSchema;
35
26
  async observeHandler() {
36
27
  const apiKey = assertEx(this.config?.apiKey, () => "apiKey is required");
37
- const payload = await new PayloadBuilder({
38
- schema: EthereumGasEtherscanSchema
39
- }).fields(await getGasFromEtherscan(apiKey)).build();
40
- return [
41
- payload
42
- ];
28
+ const payload = await new PayloadBuilder({ schema: EthereumGasEtherscanSchema }).fields(await getGasFromEtherscan(apiKey)).build();
29
+ return [payload];
43
30
  }
44
31
  };
45
32
 
46
33
  // src/Plugin.ts
47
- var EthereumGasEtherscanPlugin = /* @__PURE__ */ __name(() => createPayloadSetWitnessPlugin({
48
- required: {
49
- [EthereumGasEtherscanSchema2]: 1
50
- },
51
- schema: PayloadSetSchema
52
- }, {
53
- witness: /* @__PURE__ */ __name(async (params) => {
54
- const result = await EthereumGasEtherscanWitness.create(params);
55
- return result;
56
- }, "witness")
57
- }), "EthereumGasEtherscanPlugin");
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
+ );
58
43
  export {
59
44
  EthereumGasEtherscanPlugin,
60
45
  EthereumGasEtherscanWitness,
@@ -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.ts'\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.ts'\nimport { getGasFromEtherscan } from './lib/index.ts'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema.ts'\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,SAASA,8BAAAA,mCAAkC;AAC3C,SAASC,wBAAwB;AACjC,SAASC,qCAAqC;;;ACF9C,SAASC,gBAAgB;AACzB,SAASC,uBAAuB;AAChC,SAAsCC,kCAAkC;AAExE,SAASC,sBAAsB;;;ACJ/B,SAASC,aAAa;AAGf,IAAMC,sBAAsB,8BAAOC,WAAAA;AACxC,QAAMC,MAAM,0EAA0ED,MAAAA;AACtF,UAAQ,MAAME,MAAMC,IAAkCF,GAAAA,GAAMG;AAC9D,GAHmC;;;ACF5B,IAAMC,0CACT;;;AFUG,IAAMC,8BAAN,cAA0CC,gBAAAA;EAZjD,OAYiDA;;;EAC/C,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeC;;EAC5E,OAAyBC,sBAA8BD;EAEvD,MAAyBE,iBAAqC;AAC5D,UAAMC,SAASC,SAAS,KAAKC,QAAQF,QAAQ,MAAM,oBAAA;AACnD,UAAMG,UAAU,MAAM,IAAIC,eAA4C;MAAEC,QAAQC;IAA2B,CAAA,EACxGC,OAAO,MAAMC,oBAAoBR,MAAAA,CAAAA,EACjCS,MAAK;AACR,WAAO;MAACN;;EACV;AACF;;;ADjBO,IAAMO,6BAA6B,6BACxCC,8BACE;EAAEC,UAAU;IAAE,CAACC,2BAAAA,GAA6B;EAAE;EAAGC,QAAQC;AAAiB,GAC1E;EACEC,SAAS,8BAAOC,WAAAA;AACd,UAAMC,SAAS,MAAMC,4BAA4BC,OAAOH,MAAAA;AACxD,WAAOC;EACT,GAHS;AAIX,CAAA,GARsC;","names":["EthereumGasEtherscanSchema","PayloadSetSchema","createPayloadSetWitnessPlugin","assertEx","AbstractWitness","EthereumGasEtherscanSchema","PayloadBuilder","axios","getGasFromEtherscan","apiKey","url","axios","get","data","EthereumGasEtherscanWitnessConfigSchema","EthereumGasEtherscanWitness","AbstractWitness","configSchemas","EthereumGasEtherscanWitnessConfigSchema","defaultConfigSchema","observeHandler","apiKey","assertEx","config","payload","PayloadBuilder","schema","EthereumGasEtherscanSchema","fields","getGasFromEtherscan","build","EthereumGasEtherscanPlugin","createPayloadSetWitnessPlugin","required","EthereumGasEtherscanSchema","schema","PayloadSetSchema","witness","params","result","EthereumGasEtherscanWitness","create"]}
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.ts'\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.ts'\nimport { getGasFromEtherscan } from './lib/index.ts'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema.ts'\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,0CACT;;;AFUG,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"]}
@@ -3,7 +3,6 @@ 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 __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
6
  var __export = (target, all) => {
8
7
  for (var name in all)
9
8
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -41,45 +40,33 @@ var import_payload_builder = require("@xyo-network/payload-builder");
41
40
 
42
41
  // src/lib/getGasFromEtherscan.ts
43
42
  var import_axios = require("@xylabs/axios");
44
- var getGasFromEtherscan = /* @__PURE__ */ __name(async (apiKey) => {
43
+ var getGasFromEtherscan = async (apiKey) => {
45
44
  const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`;
46
45
  return (await import_axios.axios.get(url)).data;
47
- }, "getGasFromEtherscan");
46
+ };
48
47
 
49
48
  // src/Schema.ts
50
49
  var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
51
50
 
52
51
  // src/Witness.ts
53
52
  var EthereumGasEtherscanWitness = class extends import_abstract_witness.AbstractWitness {
54
- static {
55
- __name(this, "EthereumGasEtherscanWitness");
56
- }
57
- static configSchemas = [
58
- ...super.configSchemas,
59
- EthereumGasEtherscanWitnessConfigSchema
60
- ];
53
+ static configSchemas = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema];
61
54
  static defaultConfigSchema = EthereumGasEtherscanWitnessConfigSchema;
62
55
  async observeHandler() {
63
56
  const apiKey = (0, import_assert.assertEx)(this.config?.apiKey, () => "apiKey is required");
64
- const payload = await new import_payload_builder.PayloadBuilder({
65
- schema: import_etherscan_ethereum_gas_payload_plugin.EthereumGasEtherscanSchema
66
- }).fields(await getGasFromEtherscan(apiKey)).build();
67
- return [
68
- payload
69
- ];
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];
70
59
  }
71
60
  };
72
61
 
73
62
  // src/Plugin.ts
74
- var EthereumGasEtherscanPlugin = /* @__PURE__ */ __name(() => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)({
75
- required: {
76
- [import_etherscan_ethereum_gas_payload_plugin2.EthereumGasEtherscanSchema]: 1
77
- },
78
- schema: import_payload_model.PayloadSetSchema
79
- }, {
80
- witness: /* @__PURE__ */ __name(async (params) => {
81
- const result = await EthereumGasEtherscanWitness.create(params);
82
- return result;
83
- }, "witness")
84
- }), "EthereumGasEtherscanPlugin");
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
+ );
85
72
  //# 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.ts'\n// eslint-disable-next-line import/no-default-export\nexport { EthereumGasEtherscanPlugin as default, EthereumGasEtherscanPlugin } from './Plugin.ts'\nexport * from './Schema.ts'\nexport * from './Witness.ts'\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.ts'\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.ts'\nimport { getGasFromEtherscan } from './lib/index.ts'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema.ts'\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;;;;;;;;;;ACAA,IAAAA,gDAA2C;AAC3C,2BAAiC;AACjC,+BAA8C;;;ACF9C,oBAAyB;AACzB,8BAAgC;AAChC,mDAAwE;AAExE,6BAA+B;;;ACJ/B,mBAAsB;AAGf,IAAMC,sBAAsB,8BAAOC,WAAAA;AACxC,QAAMC,MAAM,0EAA0ED,MAAAA;AACtF,UAAQ,MAAME,mBAAMC,IAAkCF,GAAAA,GAAMG;AAC9D,GAHmC;;;ACF5B,IAAMC,0CACT;;;AFUG,IAAMC,8BAAN,cAA0CC,wCAAAA;EAZjD,OAYiDA;;;EAC/C,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeC;;EAC5E,OAAyBC,sBAA8BD;EAEvD,MAAyBE,iBAAqC;AAC5D,UAAMC,aAASC,wBAAS,KAAKC,QAAQF,QAAQ,MAAM,oBAAA;AACnD,UAAMG,UAAU,MAAM,IAAIC,sCAA4C;MAAEC,QAAQC;IAA2B,CAAA,EACxGC,OAAO,MAAMC,oBAAoBR,MAAAA,CAAAA,EACjCS,MAAK;AACR,WAAO;MAACN;;EACV;AACF;;;ADjBO,IAAMO,6BAA6B,iCACxCC,wDACE;EAAEC,UAAU;IAAE,CAACC,wEAAAA,GAA6B;EAAE;EAAGC,QAAQC;AAAiB,GAC1E;EACEC,SAAS,8BAAOC,WAAAA;AACd,UAAMC,SAAS,MAAMC,4BAA4BC,OAAOH,MAAAA;AACxD,WAAOC;EACT,GAHS;AAIX,CAAA,GARsC;","names":["import_etherscan_ethereum_gas_payload_plugin","getGasFromEtherscan","apiKey","url","axios","get","data","EthereumGasEtherscanWitnessConfigSchema","EthereumGasEtherscanWitness","AbstractWitness","configSchemas","EthereumGasEtherscanWitnessConfigSchema","defaultConfigSchema","observeHandler","apiKey","assertEx","config","payload","PayloadBuilder","schema","EthereumGasEtherscanSchema","fields","getGasFromEtherscan","build","EthereumGasEtherscanPlugin","createPayloadSetWitnessPlugin","required","EthereumGasEtherscanSchema","schema","PayloadSetSchema","witness","params","result","EthereumGasEtherscanWitness","create"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config.ts'\n// eslint-disable-next-line import/no-default-export\nexport { EthereumGasEtherscanPlugin as default, EthereumGasEtherscanPlugin } from './Plugin.ts'\nexport * from './Schema.ts'\nexport * from './Witness.ts'\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.ts'\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.ts'\nimport { getGasFromEtherscan } from './lib/index.ts'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema.ts'\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,0CACT;;;AFUG,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,6 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/Plugin.ts
5
2
  import { EthereumGasEtherscanSchema as EthereumGasEtherscanSchema2 } from "@xyo-network/etherscan-ethereum-gas-payload-plugin";
6
3
  import { PayloadSetSchema } from "@xyo-network/payload-model";
@@ -14,47 +11,35 @@ import { PayloadBuilder } from "@xyo-network/payload-builder";
14
11
 
15
12
  // src/lib/getGasFromEtherscan.ts
16
13
  import { axios } from "@xylabs/axios";
17
- var getGasFromEtherscan = /* @__PURE__ */ __name(async (apiKey) => {
14
+ var getGasFromEtherscan = async (apiKey) => {
18
15
  const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`;
19
16
  return (await axios.get(url)).data;
20
- }, "getGasFromEtherscan");
17
+ };
21
18
 
22
19
  // src/Schema.ts
23
20
  var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
24
21
 
25
22
  // src/Witness.ts
26
23
  var EthereumGasEtherscanWitness = class extends AbstractWitness {
27
- static {
28
- __name(this, "EthereumGasEtherscanWitness");
29
- }
30
- static configSchemas = [
31
- ...super.configSchemas,
32
- EthereumGasEtherscanWitnessConfigSchema
33
- ];
24
+ static configSchemas = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema];
34
25
  static defaultConfigSchema = EthereumGasEtherscanWitnessConfigSchema;
35
26
  async observeHandler() {
36
27
  const apiKey = assertEx(this.config?.apiKey, () => "apiKey is required");
37
- const payload = await new PayloadBuilder({
38
- schema: EthereumGasEtherscanSchema
39
- }).fields(await getGasFromEtherscan(apiKey)).build();
40
- return [
41
- payload
42
- ];
28
+ const payload = await new PayloadBuilder({ schema: EthereumGasEtherscanSchema }).fields(await getGasFromEtherscan(apiKey)).build();
29
+ return [payload];
43
30
  }
44
31
  };
45
32
 
46
33
  // src/Plugin.ts
47
- var EthereumGasEtherscanPlugin = /* @__PURE__ */ __name(() => createPayloadSetWitnessPlugin({
48
- required: {
49
- [EthereumGasEtherscanSchema2]: 1
50
- },
51
- schema: PayloadSetSchema
52
- }, {
53
- witness: /* @__PURE__ */ __name(async (params) => {
54
- const result = await EthereumGasEtherscanWitness.create(params);
55
- return result;
56
- }, "witness")
57
- }), "EthereumGasEtherscanPlugin");
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
+ );
58
43
  export {
59
44
  EthereumGasEtherscanPlugin,
60
45
  EthereumGasEtherscanWitness,
@@ -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.ts'\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.ts'\nimport { getGasFromEtherscan } from './lib/index.ts'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema.ts'\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,SAASA,8BAAAA,mCAAkC;AAC3C,SAASC,wBAAwB;AACjC,SAASC,qCAAqC;;;ACF9C,SAASC,gBAAgB;AACzB,SAASC,uBAAuB;AAChC,SAAsCC,kCAAkC;AAExE,SAASC,sBAAsB;;;ACJ/B,SAASC,aAAa;AAGf,IAAMC,sBAAsB,8BAAOC,WAAAA;AACxC,QAAMC,MAAM,0EAA0ED,MAAAA;AACtF,UAAQ,MAAME,MAAMC,IAAkCF,GAAAA,GAAMG;AAC9D,GAHmC;;;ACF5B,IAAMC,0CACT;;;AFUG,IAAMC,8BAAN,cAA0CC,gBAAAA;EAZjD,OAYiDA;;;EAC/C,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeC;;EAC5E,OAAyBC,sBAA8BD;EAEvD,MAAyBE,iBAAqC;AAC5D,UAAMC,SAASC,SAAS,KAAKC,QAAQF,QAAQ,MAAM,oBAAA;AACnD,UAAMG,UAAU,MAAM,IAAIC,eAA4C;MAAEC,QAAQC;IAA2B,CAAA,EACxGC,OAAO,MAAMC,oBAAoBR,MAAAA,CAAAA,EACjCS,MAAK;AACR,WAAO;MAACN;;EACV;AACF;;;ADjBO,IAAMO,6BAA6B,6BACxCC,8BACE;EAAEC,UAAU;IAAE,CAACC,2BAAAA,GAA6B;EAAE;EAAGC,QAAQC;AAAiB,GAC1E;EACEC,SAAS,8BAAOC,WAAAA;AACd,UAAMC,SAAS,MAAMC,4BAA4BC,OAAOH,MAAAA;AACxD,WAAOC;EACT,GAHS;AAIX,CAAA,GARsC;","names":["EthereumGasEtherscanSchema","PayloadSetSchema","createPayloadSetWitnessPlugin","assertEx","AbstractWitness","EthereumGasEtherscanSchema","PayloadBuilder","axios","getGasFromEtherscan","apiKey","url","axios","get","data","EthereumGasEtherscanWitnessConfigSchema","EthereumGasEtherscanWitness","AbstractWitness","configSchemas","EthereumGasEtherscanWitnessConfigSchema","defaultConfigSchema","observeHandler","apiKey","assertEx","config","payload","PayloadBuilder","schema","EthereumGasEtherscanSchema","fields","getGasFromEtherscan","build","EthereumGasEtherscanPlugin","createPayloadSetWitnessPlugin","required","EthereumGasEtherscanSchema","schema","PayloadSetSchema","witness","params","result","EthereumGasEtherscanWitness","create"]}
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.ts'\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.ts'\nimport { getGasFromEtherscan } from './lib/index.ts'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema.ts'\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,0CACT;;;AFUG,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"]}
@@ -2,11 +2,7 @@
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __reflectGet = Reflect.get;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
10
6
  var __export = (target, all) => {
11
7
  for (var name in all)
12
8
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -20,8 +16,6 @@ var __copyProps = (to, from, except, desc) => {
20
16
  return to;
21
17
  };
22
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
24
- var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
25
19
 
26
20
  // src/index.ts
27
21
  var src_exports = {};
@@ -46,47 +40,36 @@ var import_payload_builder = require("@xyo-network/payload-builder");
46
40
 
47
41
  // src/lib/getGasFromEtherscan.ts
48
42
  var import_axios = require("@xylabs/axios");
49
- var getGasFromEtherscan = /* @__PURE__ */ __name(async (apiKey) => {
43
+ var getGasFromEtherscan = async (apiKey) => {
50
44
  const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`;
51
45
  return (await import_axios.axios.get(url)).data;
52
- }, "getGasFromEtherscan");
46
+ };
53
47
 
54
48
  // src/Schema.ts
55
49
  var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
56
50
 
57
51
  // src/Witness.ts
58
- var _EthereumGasEtherscanWitness = class _EthereumGasEtherscanWitness extends import_abstract_witness.AbstractWitness {
52
+ var EthereumGasEtherscanWitness = class extends import_abstract_witness.AbstractWitness {
53
+ static configSchemas = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema];
54
+ static defaultConfigSchema = EthereumGasEtherscanWitnessConfigSchema;
59
55
  async observeHandler() {
60
56
  var _a;
61
57
  const apiKey = (0, import_assert.assertEx)((_a = this.config) == null ? void 0 : _a.apiKey, () => "apiKey is required");
62
- const payload = await new import_payload_builder.PayloadBuilder({
63
- schema: import_etherscan_ethereum_gas_payload_plugin.EthereumGasEtherscanSchema
64
- }).fields(await getGasFromEtherscan(apiKey)).build();
65
- return [
66
- payload
67
- ];
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];
68
60
  }
69
61
  };
70
- __name(_EthereumGasEtherscanWitness, "EthereumGasEtherscanWitness");
71
- __publicField(_EthereumGasEtherscanWitness, "configSchemas", [
72
- ...__superGet(_EthereumGasEtherscanWitness, _EthereumGasEtherscanWitness, "configSchemas"),
73
- EthereumGasEtherscanWitnessConfigSchema
74
- ]);
75
- __publicField(_EthereumGasEtherscanWitness, "defaultConfigSchema", EthereumGasEtherscanWitnessConfigSchema);
76
- var EthereumGasEtherscanWitness = _EthereumGasEtherscanWitness;
77
62
 
78
63
  // src/Plugin.ts
79
- var EthereumGasEtherscanPlugin = /* @__PURE__ */ __name(() => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)({
80
- required: {
81
- [import_etherscan_ethereum_gas_payload_plugin2.EthereumGasEtherscanSchema]: 1
82
- },
83
- schema: import_payload_model.PayloadSetSchema
84
- }, {
85
- witness: /* @__PURE__ */ __name(async (params) => {
86
- const result = await EthereumGasEtherscanWitness.create(params);
87
- return result;
88
- }, "witness")
89
- }), "EthereumGasEtherscanPlugin");
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
+ );
90
73
  // Annotate the CommonJS export names for ESM import in node:
91
74
  0 && (module.exports = {
92
75
  EthereumGasEtherscanPlugin,
@@ -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.ts'\n// eslint-disable-next-line import/no-default-export\nexport { EthereumGasEtherscanPlugin as default, EthereumGasEtherscanPlugin } from './Plugin.ts'\nexport * from './Schema.ts'\nexport * from './Witness.ts'\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.ts'\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.ts'\nimport { getGasFromEtherscan } from './lib/index.ts'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema.ts'\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;;;;;;;;;;ACAA,IAAAA,gDAA2C;AAC3C,2BAAiC;AACjC,+BAA8C;;;ACF9C,oBAAyB;AACzB,8BAAgC;AAChC,mDAAwE;AAExE,6BAA+B;;;ACJ/B,mBAAsB;AAGf,IAAMC,sBAAsB,8BAAOC,WAAAA;AACxC,QAAMC,MAAM,0EAA0ED,MAAAA;AACtF,UAAQ,MAAME,mBAAMC,IAAkCF,GAAAA,GAAMG;AAC9D,GAHmC;;;ACF5B,IAAMC,0CACT;;;AFUG,IAAMC,+BAAN,MAAMA,qCAAoCC,wCAAAA;EAI/C,MAAyBC,iBAAqC;AAhBhE;AAiBI,UAAMC,aAASC,yBAAS,UAAKC,WAAL,mBAAaF,QAAQ,MAAM,oBAAA;AACnD,UAAMG,UAAU,MAAM,IAAIC,sCAA4C;MAAEC,QAAQC;IAA2B,CAAA,EACxGC,OAAO,MAAMC,oBAAoBR,MAAAA,CAAAA,EACjCS,MAAK;AACR,WAAO;MAACN;;EACV;AACF;AAXiDL;AAC/C,cADWD,8BACca,iBAA0B;KAAI,uEAAMA;EAAeC;;AAC5E,cAFWd,8BAEce,uBAA8BD;AAFlD,IAAMd,8BAAN;;;ADNA,IAAMgB,6BAA6B,iCACxCC,wDACE;EAAEC,UAAU;IAAE,CAACC,wEAAAA,GAA6B;EAAE;EAAGC,QAAQC;AAAiB,GAC1E;EACEC,SAAS,8BAAOC,WAAAA;AACd,UAAMC,SAAS,MAAMC,4BAA4BC,OAAOH,MAAAA;AACxD,WAAOC;EACT,GAHS;AAIX,CAAA,GARsC;","names":["import_etherscan_ethereum_gas_payload_plugin","getGasFromEtherscan","apiKey","url","axios","get","data","EthereumGasEtherscanWitnessConfigSchema","EthereumGasEtherscanWitness","AbstractWitness","observeHandler","apiKey","assertEx","config","payload","PayloadBuilder","schema","EthereumGasEtherscanSchema","fields","getGasFromEtherscan","build","configSchemas","EthereumGasEtherscanWitnessConfigSchema","defaultConfigSchema","EthereumGasEtherscanPlugin","createPayloadSetWitnessPlugin","required","EthereumGasEtherscanSchema","schema","PayloadSetSchema","witness","params","result","EthereumGasEtherscanWitness","create"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config.ts'\n// eslint-disable-next-line import/no-default-export\nexport { EthereumGasEtherscanPlugin as default, EthereumGasEtherscanPlugin } from './Plugin.ts'\nexport * from './Schema.ts'\nexport * from './Witness.ts'\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.ts'\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.ts'\nimport { getGasFromEtherscan } from './lib/index.ts'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema.ts'\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,0CACT;;;AFUG,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,11 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __getProtoOf = Object.getPrototypeOf;
3
- var __reflectGet = Reflect.get;
4
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
7
- var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
8
-
9
1
  // src/Plugin.ts
10
2
  import { EthereumGasEtherscanSchema as EthereumGasEtherscanSchema2 } from "@xyo-network/etherscan-ethereum-gas-payload-plugin";
11
3
  import { PayloadSetSchema } from "@xyo-network/payload-model";
@@ -19,47 +11,36 @@ import { PayloadBuilder } from "@xyo-network/payload-builder";
19
11
 
20
12
  // src/lib/getGasFromEtherscan.ts
21
13
  import { axios } from "@xylabs/axios";
22
- var getGasFromEtherscan = /* @__PURE__ */ __name(async (apiKey) => {
14
+ var getGasFromEtherscan = async (apiKey) => {
23
15
  const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`;
24
16
  return (await axios.get(url)).data;
25
- }, "getGasFromEtherscan");
17
+ };
26
18
 
27
19
  // src/Schema.ts
28
20
  var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
29
21
 
30
22
  // src/Witness.ts
31
- var _EthereumGasEtherscanWitness = class _EthereumGasEtherscanWitness extends AbstractWitness {
23
+ var EthereumGasEtherscanWitness = class extends AbstractWitness {
24
+ static configSchemas = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema];
25
+ static defaultConfigSchema = EthereumGasEtherscanWitnessConfigSchema;
32
26
  async observeHandler() {
33
27
  var _a;
34
28
  const apiKey = assertEx((_a = this.config) == null ? void 0 : _a.apiKey, () => "apiKey is required");
35
- const payload = await new PayloadBuilder({
36
- schema: EthereumGasEtherscanSchema
37
- }).fields(await getGasFromEtherscan(apiKey)).build();
38
- return [
39
- payload
40
- ];
29
+ const payload = await new PayloadBuilder({ schema: EthereumGasEtherscanSchema }).fields(await getGasFromEtherscan(apiKey)).build();
30
+ return [payload];
41
31
  }
42
32
  };
43
- __name(_EthereumGasEtherscanWitness, "EthereumGasEtherscanWitness");
44
- __publicField(_EthereumGasEtherscanWitness, "configSchemas", [
45
- ...__superGet(_EthereumGasEtherscanWitness, _EthereumGasEtherscanWitness, "configSchemas"),
46
- EthereumGasEtherscanWitnessConfigSchema
47
- ]);
48
- __publicField(_EthereumGasEtherscanWitness, "defaultConfigSchema", EthereumGasEtherscanWitnessConfigSchema);
49
- var EthereumGasEtherscanWitness = _EthereumGasEtherscanWitness;
50
33
 
51
34
  // src/Plugin.ts
52
- var EthereumGasEtherscanPlugin = /* @__PURE__ */ __name(() => createPayloadSetWitnessPlugin({
53
- required: {
54
- [EthereumGasEtherscanSchema2]: 1
55
- },
56
- schema: PayloadSetSchema
57
- }, {
58
- witness: /* @__PURE__ */ __name(async (params) => {
59
- const result = await EthereumGasEtherscanWitness.create(params);
60
- return result;
61
- }, "witness")
62
- }), "EthereumGasEtherscanPlugin");
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
+ );
63
44
  export {
64
45
  EthereumGasEtherscanPlugin,
65
46
  EthereumGasEtherscanWitness,
@@ -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.ts'\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.ts'\nimport { getGasFromEtherscan } from './lib/index.ts'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema.ts'\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,SAASA,8BAAAA,mCAAkC;AAC3C,SAASC,wBAAwB;AACjC,SAASC,qCAAqC;;;ACF9C,SAASC,gBAAgB;AACzB,SAASC,uBAAuB;AAChC,SAAsCC,kCAAkC;AAExE,SAASC,sBAAsB;;;ACJ/B,SAASC,aAAa;AAGf,IAAMC,sBAAsB,8BAAOC,WAAAA;AACxC,QAAMC,MAAM,0EAA0ED,MAAAA;AACtF,UAAQ,MAAME,MAAMC,IAAkCF,GAAAA,GAAMG;AAC9D,GAHmC;;;ACF5B,IAAMC,0CACT;;;AFUG,IAAMC,+BAAN,MAAMA,qCAAoCC,gBAAAA;EAI/C,MAAyBC,iBAAqC;AAhBhE;AAiBI,UAAMC,SAASC,UAAS,UAAKC,WAAL,mBAAaF,QAAQ,MAAM,oBAAA;AACnD,UAAMG,UAAU,MAAM,IAAIC,eAA4C;MAAEC,QAAQC;IAA2B,CAAA,EACxGC,OAAO,MAAMC,oBAAoBR,MAAAA,CAAAA,EACjCS,MAAK;AACR,WAAO;MAACN;;EACV;AACF;AAXiDL;AAC/C,cADWD,8BACca,iBAA0B;KAAI,uEAAMA;EAAeC;;AAC5E,cAFWd,8BAEce,uBAA8BD;AAFlD,IAAMd,8BAAN;;;ADNA,IAAMgB,6BAA6B,6BACxCC,8BACE;EAAEC,UAAU;IAAE,CAACC,2BAAAA,GAA6B;EAAE;EAAGC,QAAQC;AAAiB,GAC1E;EACEC,SAAS,8BAAOC,WAAAA;AACd,UAAMC,SAAS,MAAMC,4BAA4BC,OAAOH,MAAAA;AACxD,WAAOC;EACT,GAHS;AAIX,CAAA,GARsC;","names":["EthereumGasEtherscanSchema","PayloadSetSchema","createPayloadSetWitnessPlugin","assertEx","AbstractWitness","EthereumGasEtherscanSchema","PayloadBuilder","axios","getGasFromEtherscan","apiKey","url","axios","get","data","EthereumGasEtherscanWitnessConfigSchema","EthereumGasEtherscanWitness","AbstractWitness","observeHandler","apiKey","assertEx","config","payload","PayloadBuilder","schema","EthereumGasEtherscanSchema","fields","getGasFromEtherscan","build","configSchemas","EthereumGasEtherscanWitnessConfigSchema","defaultConfigSchema","EthereumGasEtherscanPlugin","createPayloadSetWitnessPlugin","required","EthereumGasEtherscanSchema","schema","PayloadSetSchema","witness","params","result","EthereumGasEtherscanWitness","create"]}
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.ts'\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.ts'\nimport { getGasFromEtherscan } from './lib/index.ts'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema.ts'\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,0CACT;;;AFUG,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"]}
package/package.json CHANGED
@@ -10,21 +10,21 @@
10
10
  "url": "https://github.com/XYOracleNetwork/plugins/issues"
11
11
  },
12
12
  "dependencies": {
13
- "@xylabs/assert": "^3.6.8",
14
- "@xylabs/axios": "^3.6.8",
15
- "@xyo-network/abstract-witness": "^2.111.2",
16
- "@xyo-network/etherscan-ethereum-gas-payload-plugin": "^2.99.5",
17
- "@xyo-network/module-model": "^2.111.2",
18
- "@xyo-network/payload-builder": "^2.111.2",
19
- "@xyo-network/payload-model": "^2.111.2",
20
- "@xyo-network/payloadset-plugin": "^2.111.2",
21
- "@xyo-network/witness-model": "^2.111.2"
13
+ "@xylabs/assert": "^3.6.12",
14
+ "@xylabs/axios": "^3.6.12",
15
+ "@xyo-network/abstract-witness": "^2.111.3",
16
+ "@xyo-network/etherscan-ethereum-gas-payload-plugin": "^2.99.6",
17
+ "@xyo-network/module-model": "^2.111.3",
18
+ "@xyo-network/payload-builder": "^2.111.3",
19
+ "@xyo-network/payload-model": "^2.111.3",
20
+ "@xyo-network/payloadset-plugin": "^2.111.3",
21
+ "@xyo-network/witness-model": "^2.111.3"
22
22
  },
23
23
  "devDependencies": {
24
- "@xylabs/jest-helpers": "^3.6.8",
25
- "@xylabs/ts-scripts-yarn3": "^3.15.13",
26
- "@xylabs/tsconfig": "^3.15.13",
27
- "@xyo-network/payload-wrapper": "^2.111.2",
24
+ "@xylabs/jest-helpers": "^3.6.12",
25
+ "@xylabs/ts-scripts-yarn3": "^3.15.14",
26
+ "@xylabs/tsconfig": "^3.15.14",
27
+ "@xyo-network/payload-wrapper": "^2.111.3",
28
28
  "jest": "^29.7.0",
29
29
  "typescript": "^5.5.4"
30
30
  },
@@ -67,6 +67,6 @@
67
67
  "url": "https://github.com/XYOracleNetwork/plugins.git"
68
68
  },
69
69
  "sideEffects": false,
70
- "version": "2.99.5",
70
+ "version": "2.99.6",
71
71
  "type": "module"
72
72
  }