@xyo-network/etherscan-ethereum-gas-plugin 5.2.3 → 5.3.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,3 +1,5 @@
1
- export type EthereumGasEtherscanWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config';
2
- export declare const EthereumGasEtherscanWitnessConfigSchema: EthereumGasEtherscanWitnessConfigSchema;
1
+ export type EthereumGasEtherscanWitnessConfigSchema = typeof EthereumGasEtherscanWitnessConfigSchema;
2
+ export declare const EthereumGasEtherscanWitnessConfigSchema: "network.xyo.blockchain.ethereum.gas.etherscan.witness.config" & {
3
+ readonly __schema: true;
4
+ };
3
5
  //# sourceMappingURL=Schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../src/Schema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uCAAuC,GAAG,8DAA8D,CAAA;AACpH,eAAO,MAAM,uCAAuC,EAAE,uCACY,CAAA"}
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"}
@@ -17,7 +17,8 @@ var getGasFromEtherscan = async (apiKey) => {
17
17
  };
18
18
 
19
19
  // src/Schema.ts
20
- var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherscan.witness.config";
20
+ import { asSchema } from "@xyo-network/payload-model";
21
+ var EthereumGasEtherscanWitnessConfigSchema = asSchema("network.xyo.blockchain.ethereum.gas.etherscan.witness.config", true);
21
22
 
22
23
  // src/Witness.ts
23
24
  var EthereumGasEtherscanWitness = class extends AbstractWitness {
@@ -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 = 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","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,iBAAiB;AAGnB,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,UAAU,IAAkC,GAAG,GAAG;AAClE;;;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"]}
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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/etherscan-ethereum-gas-plugin",
3
- "version": "5.2.3",
3
+ "version": "5.3.1",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -36,25 +36,25 @@
36
36
  "!**/*.test.*"
37
37
  ],
38
38
  "dependencies": {
39
- "@xylabs/assert": "~5.0.49",
40
- "@xylabs/axios": "~5.0.49",
41
- "@xyo-network/abstract-witness": "~5.2.14",
42
- "@xyo-network/etherscan-ethereum-gas-payload-plugin": "~5.2.3",
43
- "@xyo-network/module-model": "~5.2.14",
44
- "@xyo-network/payload-builder": "~5.2.14",
45
- "@xyo-network/payload-model": "~5.2.14",
46
- "@xyo-network/payloadset-plugin": "~5.2.14",
47
- "@xyo-network/witness-model": "~5.2.14"
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
48
  },
49
49
  "devDependencies": {
50
- "@xylabs/ts-scripts-yarn3": "~7.2.8",
51
- "@xylabs/tsconfig": "~7.2.8",
52
- "@xylabs/vitest-extended": "~5.0.49",
53
- "@xyo-network/payload-wrapper": "~5.2.14",
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",
54
54
  "typescript": "~5.9.3",
55
- "vitest": "~4.0.15"
55
+ "vitest": "~4.0.18"
56
56
  },
57
57
  "publishConfig": {
58
58
  "access": "public"
59
59
  }
60
- }
60
+ }
package/src/Schema.ts CHANGED
@@ -1,3 +1,5 @@
1
- export type EthereumGasEtherscanWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'
2
- export const EthereumGasEtherscanWitnessConfigSchema: EthereumGasEtherscanWitnessConfigSchema
3
- = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'
1
+ import { asSchema } from '@xyo-network/payload-model'
2
+
3
+ export type EthereumGasEtherscanWitnessConfigSchema = typeof EthereumGasEtherscanWitnessConfigSchema
4
+ export const EthereumGasEtherscanWitnessConfigSchema
5
+ = asSchema('network.xyo.blockchain.ethereum.gas.etherscan.witness.config', true)