@xyo-network/etherscan-ethereum-gas-plugin 5.3.1 → 5.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/etherscan-ethereum-gas-plugin",
3
- "version": "5.3.1",
3
+ "version": "5.3.2",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -35,24 +35,25 @@
35
35
  "!**/*.spec.*",
36
36
  "!**/*.test.*"
37
37
  ],
38
- "dependencies": {
39
- "@xylabs/assert": "~5.0.64",
40
- "@xylabs/axios": "~5.0.64",
41
- "@xyo-network/abstract-witness": "~5.3.2",
42
- "@xyo-network/etherscan-ethereum-gas-payload-plugin": "5.3.1",
43
- "@xyo-network/module-model": "~5.3.2",
44
- "@xyo-network/payload-builder": "~5.3.2",
45
- "@xyo-network/payload-model": "~5.3.2",
46
- "@xyo-network/payloadset-plugin": "~5.3.2",
47
- "@xyo-network/witness-model": "~5.3.2"
48
- },
49
38
  "devDependencies": {
50
- "@xylabs/ts-scripts-yarn3": "~7.3.2",
51
- "@xylabs/tsconfig": "~7.3.2",
52
- "@xylabs/vitest-extended": "~5.0.64",
53
- "@xyo-network/payload-wrapper": "~5.3.2",
39
+ "@xylabs/sdk-js": "^5.0.90",
40
+ "@xylabs/ts-scripts-yarn3": "~7.5.10",
41
+ "@xylabs/tsconfig": "~7.5.10",
42
+ "@xylabs/vitest-extended": "~5.0.90",
43
+ "@xyo-network/abstract-witness": "~5.3.5",
44
+ "@xyo-network/etherscan-ethereum-gas-payload-plugin": "5.3.2",
45
+ "@xyo-network/module-model": "~5.3.5",
46
+ "@xyo-network/payload-model": "~5.3.5",
47
+ "@xyo-network/payloadset-plugin": "~5.3.5",
48
+ "@xyo-network/sdk-js": "~5.3.5",
49
+ "@xyo-network/witness-model": "~5.3.5",
54
50
  "typescript": "~5.9.3",
55
- "vitest": "~4.0.18"
51
+ "vitest": "~4.1.2",
52
+ "zod": "^4.3.6"
53
+ },
54
+ "peerDependencies": {
55
+ "@xylabs/sdk-js": "^5.0.79",
56
+ "zod": "^4"
56
57
  },
57
58
  "publishConfig": {
58
59
  "access": "public"
package/src/Witness.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { assertEx } from '@xylabs/assert'
1
+ import { assertEx } from '@xylabs/sdk-js'
2
2
  import { AbstractWitness } from '@xyo-network/abstract-witness'
3
3
  import type { EthereumGasEtherscanPayload } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'
4
4
  import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'
5
5
  import type { AnyConfigSchema } from '@xyo-network/module-model'
6
- import { PayloadBuilder } from '@xyo-network/payload-builder'
7
6
  import type { Payload, Schema } from '@xyo-network/payload-model'
7
+ import { PayloadBuilder } from '@xyo-network/sdk-js'
8
8
  import type { WitnessParams } from '@xyo-network/witness-model'
9
9
 
10
10
  import type { EthereumGasEtherscanWitnessConfig } from './Config.ts'
@@ -1,4 +1,4 @@
1
- import { axiosJson } from '@xylabs/axios'
1
+ import { axiosJson } from '@xylabs/sdk-js'
2
2
  import type { EthereumGasEtherscanResponse } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'
3
3
 
4
4
  export const getGasFromEtherscan = async (apiKey: string): Promise<EthereumGasEtherscanResponse> => {
@@ -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,5 +0,0 @@
1
- export type EthereumGasEtherscanWitnessConfigSchema = typeof EthereumGasEtherscanWitnessConfigSchema;
2
- export declare const EthereumGasEtherscanWitnessConfigSchema: "network.xyo.blockchain.ethereum.gas.etherscan.witness.config" & {
3
- readonly __schema: true;
4
- };
5
- //# sourceMappingURL=Schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../src/Schema.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,uCAAuC,GAAG,OAAO,uCAAuC,CAAA;AACpG,eAAO,MAAM,uCAAuC;;CAC8B,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,5 +0,0 @@
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 +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,50 +0,0 @@
1
- // src/Plugin.ts
2
- import { EthereumGasEtherscanSchema as EthereumGasEtherscanSchema2 } from "@xyo-network/etherscan-ethereum-gas-payload-plugin";
3
- import { PayloadSetSchema } from "@xyo-network/payload-model";
4
- import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
5
-
6
- // src/Witness.ts
7
- import { assertEx } from "@xylabs/assert";
8
- import { AbstractWitness } from "@xyo-network/abstract-witness";
9
- import { EthereumGasEtherscanSchema } from "@xyo-network/etherscan-ethereum-gas-payload-plugin";
10
- import { PayloadBuilder } from "@xyo-network/payload-builder";
11
-
12
- // src/lib/getGasFromEtherscan.ts
13
- import { axiosJson } from "@xylabs/axios";
14
- var getGasFromEtherscan = async (apiKey) => {
15
- const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`;
16
- return (await axiosJson.get(url)).data;
17
- };
18
-
19
- // src/Schema.ts
20
- import { asSchema } from "@xyo-network/payload-model";
21
- var EthereumGasEtherscanWitnessConfigSchema = asSchema("network.xyo.blockchain.ethereum.gas.etherscan.witness.config", true);
22
-
23
- // src/Witness.ts
24
- var EthereumGasEtherscanWitness = class extends AbstractWitness {
25
- static configSchemas = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema];
26
- static defaultConfigSchema = EthereumGasEtherscanWitnessConfigSchema;
27
- async observeHandler() {
28
- const apiKey = assertEx(this.config?.apiKey, () => "apiKey is required");
29
- const payload = new PayloadBuilder({ schema: EthereumGasEtherscanSchema }).fields(await getGasFromEtherscan(apiKey)).build();
30
- return [payload];
31
- }
32
- };
33
-
34
- // src/Plugin.ts
35
- var EthereumGasEtherscanPlugin = () => createPayloadSetWitnessPlugin(
36
- { required: { [EthereumGasEtherscanSchema2]: 1 }, schema: PayloadSetSchema },
37
- {
38
- witness: async (params) => {
39
- const result = await EthereumGasEtherscanWitness.create(params);
40
- return result;
41
- }
42
- }
43
- );
44
- export {
45
- EthereumGasEtherscanPlugin,
46
- EthereumGasEtherscanWitness,
47
- EthereumGasEtherscanWitnessConfigSchema,
48
- EthereumGasEtherscanPlugin as default
49
- };
50
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
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 { axiosJson } 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 axiosJson.get<EthereumGasEtherscanResponse>(url)).data\n}\n","import { asSchema } from '@xyo-network/payload-model'\n\nexport type EthereumGasEtherscanWitnessConfigSchema = typeof EthereumGasEtherscanWitnessConfigSchema\nexport const EthereumGasEtherscanWitnessConfigSchema\n = asSchema('network.xyo.blockchain.ethereum.gas.etherscan.witness.config', true)\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,iBAAiB;AAGnB,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,UAAU,IAAkC,GAAG,GAAG;AAClE;;;ACNA,SAAS,gBAAgB;AAGlB,IAAM,0CACT,SAAS,gEAAgE,IAAI;;;AFS1E,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"]}
@@ -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,GAAU,QAAQ,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"}