@xyo-network/etherscan-ethereum-gas-plugin 3.3.0 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,23 @@
1
- export * from './Config.ts';
2
- export { EthereumGasEtherscanPlugin as default, EthereumGasEtherscanPlugin } from './Plugin.ts';
3
- export * from './Schema.ts';
4
- export * from './Witness.ts';
5
- //# sourceMappingURL=index.d.ts.map
1
+ import { WitnessConfig, WitnessParams } from '@xyo-network/witness-model';
2
+ import * as _xyo_network_payloadset_plugin from '@xyo-network/payloadset-plugin';
3
+ import { AbstractWitness } from '@xyo-network/abstract-witness';
4
+ import { AnyConfigSchema } from '@xyo-network/module-model';
5
+ import { Schema, Payload } from '@xyo-network/payload-model';
6
+
7
+ type EthereumGasEtherscanWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config';
8
+ declare const EthereumGasEtherscanWitnessConfigSchema: EthereumGasEtherscanWitnessConfigSchema;
9
+
10
+ type EthereumGasEtherscanWitnessConfig = WitnessConfig<{
11
+ apiKey: string;
12
+ schema: EthereumGasEtherscanWitnessConfigSchema;
13
+ }>;
14
+
15
+ declare class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {
16
+ static readonly configSchemas: Schema[];
17
+ static readonly defaultConfigSchema: Schema;
18
+ protected observeHandler(): Promise<Payload[]>;
19
+ }
20
+
21
+ declare const EthereumGasEtherscanPlugin: () => _xyo_network_payloadset_plugin.PayloadSetWitnessPlugin<EthereumGasEtherscanWitness>;
22
+
23
+ export { EthereumGasEtherscanPlugin, EthereumGasEtherscanWitness, type EthereumGasEtherscanWitnessConfig, EthereumGasEtherscanWitnessConfigSchema, EthereumGasEtherscanPlugin as default };
@@ -25,7 +25,7 @@ var EthereumGasEtherscanWitness = class extends AbstractWitness {
25
25
  static defaultConfigSchema = EthereumGasEtherscanWitnessConfigSchema;
26
26
  async observeHandler() {
27
27
  const apiKey = assertEx(this.config?.apiKey, () => "apiKey is required");
28
- const payload = await new PayloadBuilder({ schema: EthereumGasEtherscanSchema }).fields(await getGasFromEtherscan(apiKey)).build();
28
+ const payload = new PayloadBuilder({ schema: EthereumGasEtherscanSchema }).fields(await getGasFromEtherscan(apiKey)).build();
29
29
  return [payload];
30
30
  }
31
31
  };
@@ -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 type { EthereumGasEtherscanPayload } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport type { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport type { WitnessParams } from '@xyo-network/witness-model'\n\nimport type { 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 type { 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;AAEhC,SAAS,kCAAkC;AAE3C,SAAS,sBAAsB;;;ACL/B,SAAS,aAAa;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,MAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACT;;;AFWG,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;;;ADlBO,IAAM,6BAA6B,MACxC;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,2BAA0B,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EAC1E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,4BAA4B,OAAO,MAAM;AAC9D,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["EthereumGasEtherscanSchema","EthereumGasEtherscanSchema"]}
1
+ {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEtherscanWitness } from './Witness.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 type { EthereumGasEtherscanPayload } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport type { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport type { WitnessParams } from '@xyo-network/witness-model'\n\nimport type { 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 = new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/axios'\nimport type { 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;AAEhC,SAAS,kCAAkC;AAE3C,SAAS,sBAAsB;;;ACL/B,SAAS,aAAa;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,MAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACT;;;AFWG,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,IAAI,eAA4C,EAAE,QAAQ,2BAA2B,CAAC,EACnG,OAAO,MAAM,oBAAoB,MAAM,CAAC,EACxC,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADlBO,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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/etherscan-ethereum-gas-plugin",
3
- "version": "3.3.0",
3
+ "version": "3.4.1",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -31,21 +31,21 @@
31
31
  "dependencies": {
32
32
  "@xylabs/assert": "^4.5.1",
33
33
  "@xylabs/axios": "^4.5.1",
34
- "@xyo-network/abstract-witness": "^3.7.0",
35
- "@xyo-network/etherscan-ethereum-gas-payload-plugin": "^3.3.0",
36
- "@xyo-network/module-model": "^3.7.0",
37
- "@xyo-network/payload-builder": "^3.7.0",
38
- "@xyo-network/payload-model": "^3.7.0",
39
- "@xyo-network/payloadset-plugin": "^3.7.0",
40
- "@xyo-network/witness-model": "^3.7.0"
34
+ "@xyo-network/abstract-witness": "^3.8.5",
35
+ "@xyo-network/etherscan-ethereum-gas-payload-plugin": "^3.4.1",
36
+ "@xyo-network/module-model": "^3.8.5",
37
+ "@xyo-network/payload-builder": "^3.8.5",
38
+ "@xyo-network/payload-model": "^3.8.5",
39
+ "@xyo-network/payloadset-plugin": "^3.8.5",
40
+ "@xyo-network/witness-model": "^3.8.5"
41
41
  },
42
42
  "devDependencies": {
43
- "@xylabs/ts-scripts-yarn3": "^4.2.6",
44
- "@xylabs/tsconfig": "^4.2.6",
43
+ "@xylabs/ts-scripts-yarn3": "^5.0.22",
44
+ "@xylabs/tsconfig": "^5.0.22",
45
45
  "@xylabs/vitest-extended": "^4.5.1",
46
- "@xyo-network/payload-wrapper": "^3.7.0",
46
+ "@xyo-network/payload-wrapper": "^3.8.5",
47
47
  "typescript": "^5.7.3",
48
- "vitest": "^3.0.4"
48
+ "vitest": "^3.0.5"
49
49
  },
50
50
  "publishConfig": {
51
51
  "access": "public"
package/src/Witness.ts CHANGED
@@ -17,7 +17,7 @@ export class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<A
17
17
 
18
18
  protected override async observeHandler(): Promise<Payload[]> {
19
19
  const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')
20
- const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })
20
+ const payload = new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })
21
21
  .fields(await getGasFromEtherscan(apiKey))
22
22
  .build()
23
23
  return [payload]
@@ -1,7 +0,0 @@
1
- import type { WitnessConfig } from '@xyo-network/witness-model';
2
- import type { EthereumGasEtherscanWitnessConfigSchema } from './Schema.ts';
3
- export type EthereumGasEtherscanWitnessConfig = WitnessConfig<{
4
- apiKey: string;
5
- schema: EthereumGasEtherscanWitnessConfigSchema;
6
- }>;
7
- //# sourceMappingURL=Config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE/D,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,aAAa,CAAA;AAE1E,MAAM,MAAM,iCAAiC,GAAG,aAAa,CAAC;IAC5D,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,uCAAuC,CAAA;CAChD,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- import { EthereumGasEtherscanWitness } from './Witness.ts';
2
- export declare const EthereumGasEtherscanPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<EthereumGasEtherscanWitness>;
3
- //# sourceMappingURL=Plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAA;AAE1D,eAAO,MAAM,0BAA0B,qGASpC,CAAA"}
@@ -1,3 +0,0 @@
1
- export type EthereumGasEtherscanWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config';
2
- export declare const EthereumGasEtherscanWitnessConfigSchema: EthereumGasEtherscanWitnessConfigSchema;
3
- //# sourceMappingURL=Schema.d.ts.map
@@ -1 +0,0 @@
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,uCACY,CAAA"}
@@ -1,11 +0,0 @@
1
- import { AbstractWitness } from '@xyo-network/abstract-witness';
2
- import type { AnyConfigSchema } from '@xyo-network/module-model';
3
- import type { Payload, Schema } from '@xyo-network/payload-model';
4
- import type { WitnessParams } from '@xyo-network/witness-model';
5
- import type { EthereumGasEtherscanWitnessConfig } from './Config.ts';
6
- export declare class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {
7
- static readonly configSchemas: Schema[];
8
- static readonly defaultConfigSchema: Schema;
9
- protected observeHandler(): Promise<Payload[]>;
10
- }
11
- //# sourceMappingURL=Witness.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAG/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAEhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE/D,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,aAAa,CAAA;AAIpE,qBAAa,2BAA4B,SAAQ,eAAe,CAAC,aAAa,CAAC,eAAe,CAAC,iCAAiC,CAAC,CAAC,CAAC;IACjI,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAoE;IACpH,gBAAyB,mBAAmB,EAAE,MAAM,CAA0C;cAErE,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAO9D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,0BAA0B,IAAI,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAC/F,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
@@ -1,3 +0,0 @@
1
- import type { EthereumGasEtherscanResponse } from '@xyo-network/etherscan-ethereum-gas-payload-plugin';
2
- export declare const getGasFromEtherscan: (apiKey: string) => Promise<EthereumGasEtherscanResponse>;
3
- //# sourceMappingURL=getGasFromEtherscan.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getGasFromEtherscan.d.ts","sourceRoot":"","sources":["../../../src/lib/getGasFromEtherscan.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAEtG,eAAO,MAAM,mBAAmB,WAAkB,MAAM,KAAG,OAAO,CAAC,4BAA4B,CAG9F,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './getGasFromEtherscan.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA"}