@xyo-network/etherchain-ethereum-gas-v2-plugin 5.1.3 → 5.1.5

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.
@@ -8,10 +8,10 @@ import { AbstractWitness } from "@xyo-network/abstract-witness";
8
8
  import { EthereumGasEtherchainV2Schema } from "@xyo-network/etherchain-ethereum-gas-v2-payload-plugin";
9
9
 
10
10
  // src/lib/getV2GasFromEtherchain.ts
11
- import { axios } from "@xylabs/axios";
11
+ import { axiosJson } from "@xylabs/axios";
12
12
  var url = "https://beaconcha.in/api/v1/execution/gasnow";
13
13
  var getV2GasFromEtherchain = async () => {
14
- return (await axios.get(url)).data;
14
+ return (await axiosJson.get(url)).data;
15
15
  };
16
16
 
17
17
  // src/Schema.ts
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getV2GasFromEtherchain.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EtherchainEthereumGasWitnessV2 } from './Witness.ts'\n\nexport const EthereumGasEtherchainV2Plugin = () =>\n createPayloadSetWitnessPlugin(\n { required: { [EthereumGasEtherchainV2Schema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return (await EtherchainEthereumGasWitnessV2.create(params)) as EtherchainEthereumGasWitnessV2\n },\n },\n )\n","import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport type { EthereumGasEtherchainV2Payload } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport type { AnyConfigSchema } from '@xyo-network/module-model'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport type { WitnessParams } from '@xyo-network/witness-model'\n\nimport type { EthereumGasEtherchainV2WitnessConfig } from './Config.ts'\nimport { getV2GasFromEtherchain } from './lib/index.ts'\nimport { EthereumGasEtherchainV2WitnessConfigSchema } from './Schema.ts'\n\nexport type EtherchainEthereumGasWitnessV2Params = WitnessParams<AnyConfigSchema<EthereumGasEtherchainV2WitnessConfig>>\n\nexport class EtherchainEthereumGasWitnessV2 extends AbstractWitness<EtherchainEthereumGasWitnessV2Params> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherchainV2WitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasEtherchainV2WitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const payload: EthereumGasEtherchainV2Payload = {\n ...(await getV2GasFromEtherchain()),\n schema: EthereumGasEtherchainV2Schema,\n timestamp: Date.now(),\n }\n return [payload]\n }\n}\n","import { axios } from '@xylabs/axios'\nimport type { EthereumGasEtherchainV2Response } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\n\nconst url = 'https://beaconcha.in/api/v1/execution/gasnow'\n\nexport const getV2GasFromEtherchain = async (): Promise<EthereumGasEtherchainV2Response> => {\n return (await axios.get<EthereumGasEtherchainV2Response>(url)).data\n}\n","export type EthereumGasEtherchainV2WitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherchain.v2.witness.config'\nexport const EthereumGasEtherchainV2WitnessConfigSchema: EthereumGasEtherchainV2WitnessConfigSchema\n = 'network.xyo.blockchain.ethereum.gas.etherchain.v2.witness.config'\n"],"mappings":";AAAA,SAAS,iCAAAA,sCAAqC;AAC9C,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,uBAAuB;AAEhC,SAAS,qCAAqC;;;ACF9C,SAAS,aAAa;AAGtB,IAAM,MAAM;AAEL,IAAM,yBAAyB,YAAsD;AAC1F,UAAQ,MAAM,MAAM,IAAqC,GAAG,GAAG;AACjE;;;ACNO,IAAM,6CACT;;;AFWG,IAAM,iCAAN,cAA6C,gBAAsD;AAAA,EACxG,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,0CAA0C;AAAA,EACtH,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,iBAAqC;AAC5D,UAAM,UAA0C;AAAA,MAC9C,GAAI,MAAM,uBAAuB;AAAA,MACjC,QAAQ;AAAA,MACR,WAAW,KAAK,IAAI;AAAA,IACtB;AACA,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADnBO,IAAM,gCAAgC,MAC3C;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,8BAA6B,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EAC7E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,+BAA+B,OAAO,MAAM;AAAA,IAC5D;AAAA,EACF;AACF;","names":["EthereumGasEtherchainV2Schema","EthereumGasEtherchainV2Schema"]}
1
+ {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getV2GasFromEtherchain.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EtherchainEthereumGasWitnessV2 } from './Witness.ts'\n\nexport const EthereumGasEtherchainV2Plugin = () =>\n createPayloadSetWitnessPlugin(\n { required: { [EthereumGasEtherchainV2Schema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return (await EtherchainEthereumGasWitnessV2.create(params)) as EtherchainEthereumGasWitnessV2\n },\n },\n )\n","import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport type { EthereumGasEtherchainV2Payload } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport type { AnyConfigSchema } from '@xyo-network/module-model'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport type { WitnessParams } from '@xyo-network/witness-model'\n\nimport type { EthereumGasEtherchainV2WitnessConfig } from './Config.ts'\nimport { getV2GasFromEtherchain } from './lib/index.ts'\nimport { EthereumGasEtherchainV2WitnessConfigSchema } from './Schema.ts'\n\nexport type EtherchainEthereumGasWitnessV2Params = WitnessParams<AnyConfigSchema<EthereumGasEtherchainV2WitnessConfig>>\n\nexport class EtherchainEthereumGasWitnessV2 extends AbstractWitness<EtherchainEthereumGasWitnessV2Params> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherchainV2WitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasEtherchainV2WitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const payload: EthereumGasEtherchainV2Payload = {\n ...(await getV2GasFromEtherchain()),\n schema: EthereumGasEtherchainV2Schema,\n timestamp: Date.now(),\n }\n return [payload]\n }\n}\n","import { axiosJson } from '@xylabs/axios'\nimport type { EthereumGasEtherchainV2Response } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\n\nconst url = 'https://beaconcha.in/api/v1/execution/gasnow'\n\nexport const getV2GasFromEtherchain = async (): Promise<EthereumGasEtherchainV2Response> => {\n return (await axiosJson.get<EthereumGasEtherchainV2Response>(url)).data\n}\n","export type EthereumGasEtherchainV2WitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherchain.v2.witness.config'\nexport const EthereumGasEtherchainV2WitnessConfigSchema: EthereumGasEtherchainV2WitnessConfigSchema\n = 'network.xyo.blockchain.ethereum.gas.etherchain.v2.witness.config'\n"],"mappings":";AAAA,SAAS,iCAAAA,sCAAqC;AAC9C,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,uBAAuB;AAEhC,SAAS,qCAAqC;;;ACF9C,SAAS,iBAAiB;AAG1B,IAAM,MAAM;AAEL,IAAM,yBAAyB,YAAsD;AAC1F,UAAQ,MAAM,UAAU,IAAqC,GAAG,GAAG;AACrE;;;ACNO,IAAM,6CACT;;;AFWG,IAAM,iCAAN,cAA6C,gBAAsD;AAAA,EACxG,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,0CAA0C;AAAA,EACtH,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,iBAAqC;AAC5D,UAAM,UAA0C;AAAA,MAC9C,GAAI,MAAM,uBAAuB;AAAA,MACjC,QAAQ;AAAA,MACR,WAAW,KAAK,IAAI;AAAA,IACtB;AACA,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADnBO,IAAM,gCAAgC,MAC3C;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,8BAA6B,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EAC7E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,+BAA+B,OAAO,MAAM;AAAA,IAC5D;AAAA,EACF;AACF;","names":["EthereumGasEtherchainV2Schema","EthereumGasEtherchainV2Schema"]}
@@ -8,10 +8,10 @@ import { AbstractWitness } from "@xyo-network/abstract-witness";
8
8
  import { EthereumGasEtherchainV2Schema } from "@xyo-network/etherchain-ethereum-gas-v2-payload-plugin";
9
9
 
10
10
  // src/lib/getV2GasFromEtherchain.ts
11
- import { axios } from "@xylabs/axios";
11
+ import { axiosJson } from "@xylabs/axios";
12
12
  var url = "https://beaconcha.in/api/v1/execution/gasnow";
13
13
  var getV2GasFromEtherchain = async () => {
14
- return (await axios.get(url)).data;
14
+ return (await axiosJson.get(url)).data;
15
15
  };
16
16
 
17
17
  // src/Schema.ts
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getV2GasFromEtherchain.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EtherchainEthereumGasWitnessV2 } from './Witness.ts'\n\nexport const EthereumGasEtherchainV2Plugin = () =>\n createPayloadSetWitnessPlugin(\n { required: { [EthereumGasEtherchainV2Schema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return (await EtherchainEthereumGasWitnessV2.create(params)) as EtherchainEthereumGasWitnessV2\n },\n },\n )\n","import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport type { EthereumGasEtherchainV2Payload } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport type { AnyConfigSchema } from '@xyo-network/module-model'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport type { WitnessParams } from '@xyo-network/witness-model'\n\nimport type { EthereumGasEtherchainV2WitnessConfig } from './Config.ts'\nimport { getV2GasFromEtherchain } from './lib/index.ts'\nimport { EthereumGasEtherchainV2WitnessConfigSchema } from './Schema.ts'\n\nexport type EtherchainEthereumGasWitnessV2Params = WitnessParams<AnyConfigSchema<EthereumGasEtherchainV2WitnessConfig>>\n\nexport class EtherchainEthereumGasWitnessV2 extends AbstractWitness<EtherchainEthereumGasWitnessV2Params> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherchainV2WitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasEtherchainV2WitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const payload: EthereumGasEtherchainV2Payload = {\n ...(await getV2GasFromEtherchain()),\n schema: EthereumGasEtherchainV2Schema,\n timestamp: Date.now(),\n }\n return [payload]\n }\n}\n","import { axios } from '@xylabs/axios'\nimport type { EthereumGasEtherchainV2Response } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\n\nconst url = 'https://beaconcha.in/api/v1/execution/gasnow'\n\nexport const getV2GasFromEtherchain = async (): Promise<EthereumGasEtherchainV2Response> => {\n return (await axios.get<EthereumGasEtherchainV2Response>(url)).data\n}\n","export type EthereumGasEtherchainV2WitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherchain.v2.witness.config'\nexport const EthereumGasEtherchainV2WitnessConfigSchema: EthereumGasEtherchainV2WitnessConfigSchema\n = 'network.xyo.blockchain.ethereum.gas.etherchain.v2.witness.config'\n"],"mappings":";AAAA,SAAS,iCAAAA,sCAAqC;AAC9C,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,uBAAuB;AAEhC,SAAS,qCAAqC;;;ACF9C,SAAS,aAAa;AAGtB,IAAM,MAAM;AAEL,IAAM,yBAAyB,YAAsD;AAC1F,UAAQ,MAAM,MAAM,IAAqC,GAAG,GAAG;AACjE;;;ACNO,IAAM,6CACT;;;AFWG,IAAM,iCAAN,cAA6C,gBAAsD;AAAA,EACxG,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,0CAA0C;AAAA,EACtH,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,iBAAqC;AAC5D,UAAM,UAA0C;AAAA,MAC9C,GAAI,MAAM,uBAAuB;AAAA,MACjC,QAAQ;AAAA,MACR,WAAW,KAAK,IAAI;AAAA,IACtB;AACA,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADnBO,IAAM,gCAAgC,MAC3C;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,8BAA6B,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EAC7E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,+BAA+B,OAAO,MAAM;AAAA,IAC5D;AAAA,EACF;AACF;","names":["EthereumGasEtherchainV2Schema","EthereumGasEtherchainV2Schema"]}
1
+ {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getV2GasFromEtherchain.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EtherchainEthereumGasWitnessV2 } from './Witness.ts'\n\nexport const EthereumGasEtherchainV2Plugin = () =>\n createPayloadSetWitnessPlugin(\n { required: { [EthereumGasEtherchainV2Schema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return (await EtherchainEthereumGasWitnessV2.create(params)) as EtherchainEthereumGasWitnessV2\n },\n },\n )\n","import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport type { EthereumGasEtherchainV2Payload } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport type { AnyConfigSchema } from '@xyo-network/module-model'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport type { WitnessParams } from '@xyo-network/witness-model'\n\nimport type { EthereumGasEtherchainV2WitnessConfig } from './Config.ts'\nimport { getV2GasFromEtherchain } from './lib/index.ts'\nimport { EthereumGasEtherchainV2WitnessConfigSchema } from './Schema.ts'\n\nexport type EtherchainEthereumGasWitnessV2Params = WitnessParams<AnyConfigSchema<EthereumGasEtherchainV2WitnessConfig>>\n\nexport class EtherchainEthereumGasWitnessV2 extends AbstractWitness<EtherchainEthereumGasWitnessV2Params> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherchainV2WitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasEtherchainV2WitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const payload: EthereumGasEtherchainV2Payload = {\n ...(await getV2GasFromEtherchain()),\n schema: EthereumGasEtherchainV2Schema,\n timestamp: Date.now(),\n }\n return [payload]\n }\n}\n","import { axiosJson } from '@xylabs/axios'\nimport type { EthereumGasEtherchainV2Response } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\n\nconst url = 'https://beaconcha.in/api/v1/execution/gasnow'\n\nexport const getV2GasFromEtherchain = async (): Promise<EthereumGasEtherchainV2Response> => {\n return (await axiosJson.get<EthereumGasEtherchainV2Response>(url)).data\n}\n","export type EthereumGasEtherchainV2WitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherchain.v2.witness.config'\nexport const EthereumGasEtherchainV2WitnessConfigSchema: EthereumGasEtherchainV2WitnessConfigSchema\n = 'network.xyo.blockchain.ethereum.gas.etherchain.v2.witness.config'\n"],"mappings":";AAAA,SAAS,iCAAAA,sCAAqC;AAC9C,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,uBAAuB;AAEhC,SAAS,qCAAqC;;;ACF9C,SAAS,iBAAiB;AAG1B,IAAM,MAAM;AAEL,IAAM,yBAAyB,YAAsD;AAC1F,UAAQ,MAAM,UAAU,IAAqC,GAAG,GAAG;AACrE;;;ACNO,IAAM,6CACT;;;AFWG,IAAM,iCAAN,cAA6C,gBAAsD;AAAA,EACxG,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,0CAA0C;AAAA,EACtH,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,iBAAqC;AAC5D,UAAM,UAA0C;AAAA,MAC9C,GAAI,MAAM,uBAAuB;AAAA,MACjC,QAAQ;AAAA,MACR,WAAW,KAAK,IAAI;AAAA,IACtB;AACA,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADnBO,IAAM,gCAAgC,MAC3C;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,8BAA6B,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EAC7E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,+BAA+B,OAAO,MAAM;AAAA,IAC5D;AAAA,EACF;AACF;","names":["EthereumGasEtherchainV2Schema","EthereumGasEtherchainV2Schema"]}
@@ -8,10 +8,10 @@ import { AbstractWitness } from "@xyo-network/abstract-witness";
8
8
  import { EthereumGasEtherchainV2Schema } from "@xyo-network/etherchain-ethereum-gas-v2-payload-plugin";
9
9
 
10
10
  // src/lib/getV2GasFromEtherchain.ts
11
- import { axios } from "@xylabs/axios";
11
+ import { axiosJson } from "@xylabs/axios";
12
12
  var url = "https://beaconcha.in/api/v1/execution/gasnow";
13
13
  var getV2GasFromEtherchain = async () => {
14
- return (await axios.get(url)).data;
14
+ return (await axiosJson.get(url)).data;
15
15
  };
16
16
 
17
17
  // src/Schema.ts
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getV2GasFromEtherchain.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EtherchainEthereumGasWitnessV2 } from './Witness.ts'\n\nexport const EthereumGasEtherchainV2Plugin = () =>\n createPayloadSetWitnessPlugin(\n { required: { [EthereumGasEtherchainV2Schema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return (await EtherchainEthereumGasWitnessV2.create(params)) as EtherchainEthereumGasWitnessV2\n },\n },\n )\n","import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport type { EthereumGasEtherchainV2Payload } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport type { AnyConfigSchema } from '@xyo-network/module-model'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport type { WitnessParams } from '@xyo-network/witness-model'\n\nimport type { EthereumGasEtherchainV2WitnessConfig } from './Config.ts'\nimport { getV2GasFromEtherchain } from './lib/index.ts'\nimport { EthereumGasEtherchainV2WitnessConfigSchema } from './Schema.ts'\n\nexport type EtherchainEthereumGasWitnessV2Params = WitnessParams<AnyConfigSchema<EthereumGasEtherchainV2WitnessConfig>>\n\nexport class EtherchainEthereumGasWitnessV2 extends AbstractWitness<EtherchainEthereumGasWitnessV2Params> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherchainV2WitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasEtherchainV2WitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const payload: EthereumGasEtherchainV2Payload = {\n ...(await getV2GasFromEtherchain()),\n schema: EthereumGasEtherchainV2Schema,\n timestamp: Date.now(),\n }\n return [payload]\n }\n}\n","import { axios } from '@xylabs/axios'\nimport type { EthereumGasEtherchainV2Response } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\n\nconst url = 'https://beaconcha.in/api/v1/execution/gasnow'\n\nexport const getV2GasFromEtherchain = async (): Promise<EthereumGasEtherchainV2Response> => {\n return (await axios.get<EthereumGasEtherchainV2Response>(url)).data\n}\n","export type EthereumGasEtherchainV2WitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherchain.v2.witness.config'\nexport const EthereumGasEtherchainV2WitnessConfigSchema: EthereumGasEtherchainV2WitnessConfigSchema\n = 'network.xyo.blockchain.ethereum.gas.etherchain.v2.witness.config'\n"],"mappings":";AAAA,SAAS,iCAAAA,sCAAqC;AAC9C,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,uBAAuB;AAEhC,SAAS,qCAAqC;;;ACF9C,SAAS,aAAa;AAGtB,IAAM,MAAM;AAEL,IAAM,yBAAyB,YAAsD;AAC1F,UAAQ,MAAM,MAAM,IAAqC,GAAG,GAAG;AACjE;;;ACNO,IAAM,6CACT;;;AFWG,IAAM,iCAAN,cAA6C,gBAAsD;AAAA,EACxG,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,0CAA0C;AAAA,EACtH,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,iBAAqC;AAC5D,UAAM,UAA0C;AAAA,MAC9C,GAAI,MAAM,uBAAuB;AAAA,MACjC,QAAQ;AAAA,MACR,WAAW,KAAK,IAAI;AAAA,IACtB;AACA,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADnBO,IAAM,gCAAgC,MAC3C;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,8BAA6B,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EAC7E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,+BAA+B,OAAO,MAAM;AAAA,IAC5D;AAAA,EACF;AACF;","names":["EthereumGasEtherchainV2Schema","EthereumGasEtherchainV2Schema"]}
1
+ {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getV2GasFromEtherchain.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EtherchainEthereumGasWitnessV2 } from './Witness.ts'\n\nexport const EthereumGasEtherchainV2Plugin = () =>\n createPayloadSetWitnessPlugin(\n { required: { [EthereumGasEtherchainV2Schema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return (await EtherchainEthereumGasWitnessV2.create(params)) as EtherchainEthereumGasWitnessV2\n },\n },\n )\n","import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport type { EthereumGasEtherchainV2Payload } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport type { AnyConfigSchema } from '@xyo-network/module-model'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport type { WitnessParams } from '@xyo-network/witness-model'\n\nimport type { EthereumGasEtherchainV2WitnessConfig } from './Config.ts'\nimport { getV2GasFromEtherchain } from './lib/index.ts'\nimport { EthereumGasEtherchainV2WitnessConfigSchema } from './Schema.ts'\n\nexport type EtherchainEthereumGasWitnessV2Params = WitnessParams<AnyConfigSchema<EthereumGasEtherchainV2WitnessConfig>>\n\nexport class EtherchainEthereumGasWitnessV2 extends AbstractWitness<EtherchainEthereumGasWitnessV2Params> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherchainV2WitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasEtherchainV2WitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const payload: EthereumGasEtherchainV2Payload = {\n ...(await getV2GasFromEtherchain()),\n schema: EthereumGasEtherchainV2Schema,\n timestamp: Date.now(),\n }\n return [payload]\n }\n}\n","import { axiosJson } from '@xylabs/axios'\nimport type { EthereumGasEtherchainV2Response } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\n\nconst url = 'https://beaconcha.in/api/v1/execution/gasnow'\n\nexport const getV2GasFromEtherchain = async (): Promise<EthereumGasEtherchainV2Response> => {\n return (await axiosJson.get<EthereumGasEtherchainV2Response>(url)).data\n}\n","export type EthereumGasEtherchainV2WitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherchain.v2.witness.config'\nexport const EthereumGasEtherchainV2WitnessConfigSchema: EthereumGasEtherchainV2WitnessConfigSchema\n = 'network.xyo.blockchain.ethereum.gas.etherchain.v2.witness.config'\n"],"mappings":";AAAA,SAAS,iCAAAA,sCAAqC;AAC9C,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,uBAAuB;AAEhC,SAAS,qCAAqC;;;ACF9C,SAAS,iBAAiB;AAG1B,IAAM,MAAM;AAEL,IAAM,yBAAyB,YAAsD;AAC1F,UAAQ,MAAM,UAAU,IAAqC,GAAG,GAAG;AACrE;;;ACNO,IAAM,6CACT;;;AFWG,IAAM,iCAAN,cAA6C,gBAAsD;AAAA,EACxG,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,0CAA0C;AAAA,EACtH,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,iBAAqC;AAC5D,UAAM,UAA0C;AAAA,MAC9C,GAAI,MAAM,uBAAuB;AAAA,MACjC,QAAQ;AAAA,MACR,WAAW,KAAK,IAAI;AAAA,IACtB;AACA,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADnBO,IAAM,gCAAgC,MAC3C;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,8BAA6B,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EAC7E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,+BAA+B,OAAO,MAAM;AAAA,IAC5D;AAAA,EACF;AACF;","names":["EthereumGasEtherchainV2Schema","EthereumGasEtherchainV2Schema"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/etherchain-ethereum-gas-v2-plugin",
3
- "version": "5.1.3",
3
+ "version": "5.1.5",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -30,24 +30,27 @@
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "files": [
32
32
  "dist",
33
- "src"
33
+ "src",
34
+ "!**/*.bench.*",
35
+ "!**/*.spec.*",
36
+ "!**/*.test.*"
34
37
  ],
35
38
  "dependencies": {
36
- "@xylabs/axios": "~5.0.11",
37
- "@xyo-network/abstract-witness": "~5.1.2",
38
- "@xyo-network/etherchain-ethereum-gas-v2-payload-plugin": "~5.1.3",
39
- "@xyo-network/module-model": "~5.1.2",
40
- "@xyo-network/payload-model": "~5.1.2",
41
- "@xyo-network/payloadset-plugin": "~5.1.2",
42
- "@xyo-network/witness-model": "~5.1.2"
39
+ "@xylabs/axios": "~5.0.37",
40
+ "@xyo-network/abstract-witness": "~5.1.23",
41
+ "@xyo-network/etherchain-ethereum-gas-v2-payload-plugin": "~5.1.5",
42
+ "@xyo-network/module-model": "~5.1.23",
43
+ "@xyo-network/payload-model": "~5.1.23",
44
+ "@xyo-network/payloadset-plugin": "~5.1.23",
45
+ "@xyo-network/witness-model": "~5.1.23"
43
46
  },
44
47
  "devDependencies": {
45
- "@xylabs/ts-scripts-yarn3": "~7.1.7",
46
- "@xylabs/tsconfig": "~7.1.7",
47
- "@xylabs/vitest-extended": "~5.0.11",
48
- "@xyo-network/payload-wrapper": "~5.1.2",
49
- "typescript": "~5.9.2",
50
- "vitest": "~3.2.4"
48
+ "@xylabs/ts-scripts-yarn3": "~7.2.8",
49
+ "@xylabs/tsconfig": "~7.2.8",
50
+ "@xylabs/vitest-extended": "~5.0.37",
51
+ "@xyo-network/payload-wrapper": "~5.1.23",
52
+ "typescript": "~5.9.3",
53
+ "vitest": "~4.0.10"
51
54
  },
52
55
  "publishConfig": {
53
56
  "access": "public"
@@ -1,8 +1,8 @@
1
- import { axios } from '@xylabs/axios'
1
+ import { axiosJson } from '@xylabs/axios'
2
2
  import type { EthereumGasEtherchainV2Response } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'
3
3
 
4
4
  const url = 'https://beaconcha.in/api/v1/execution/gasnow'
5
5
 
6
6
  export const getV2GasFromEtherchain = async (): Promise<EthereumGasEtherchainV2Response> => {
7
- return (await axios.get<EthereumGasEtherchainV2Response>(url)).data
7
+ return (await axiosJson.get<EthereumGasEtherchainV2Response>(url)).data
8
8
  }
@@ -1,2 +0,0 @@
1
- import '@xylabs/vitest-extended';
2
- //# sourceMappingURL=getV2GasFromEtherchain.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getV2GasFromEtherchain.spec.d.ts","sourceRoot":"","sources":["../../../../src/lib/spec/getV2GasFromEtherchain.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
@@ -1,2 +0,0 @@
1
- import '@xylabs/vitest-extended';
2
- //# sourceMappingURL=Plugin.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Plugin.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Plugin.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
@@ -1,2 +0,0 @@
1
- import '@xylabs/vitest-extended';
2
- //# sourceMappingURL=Witness.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Witness.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Witness.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
@@ -1,2 +0,0 @@
1
- import '@xylabs/vitest-extended';
2
- //# sourceMappingURL=getV2GasFromEtherchain.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getV2GasFromEtherchain.spec.d.ts","sourceRoot":"","sources":["../../../../src/lib/spec/getV2GasFromEtherchain.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
@@ -1,2 +0,0 @@
1
- import '@xylabs/vitest-extended';
2
- //# sourceMappingURL=Plugin.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Plugin.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Plugin.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
@@ -1,2 +0,0 @@
1
- import '@xylabs/vitest-extended';
2
- //# sourceMappingURL=Witness.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Witness.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Witness.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
@@ -1,2 +0,0 @@
1
- import '@xylabs/vitest-extended';
2
- //# sourceMappingURL=getV2GasFromEtherchain.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getV2GasFromEtherchain.spec.d.ts","sourceRoot":"","sources":["../../../../src/lib/spec/getV2GasFromEtherchain.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
@@ -1,2 +0,0 @@
1
- import '@xylabs/vitest-extended';
2
- //# sourceMappingURL=Plugin.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Plugin.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Plugin.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
@@ -1,2 +0,0 @@
1
- import '@xylabs/vitest-extended';
2
- //# sourceMappingURL=Witness.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Witness.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Witness.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
@@ -1,23 +0,0 @@
1
- import '@xylabs/vitest-extended'
2
-
3
- import {
4
- describe, expect,
5
- test,
6
- } from 'vitest'
7
-
8
- import { getV2GasFromEtherchain } from '../getV2GasFromEtherchain.ts'
9
-
10
- describe('getV2GasFromEtherchain', () => {
11
- test('returns prices', async () => {
12
- const gas = await getV2GasFromEtherchain()
13
- expect(gas).toBeObject()
14
- expect(gas.code).toBeNumber()
15
- expect(gas.data).toBeObject()
16
- expect(gas.data.fast).toBeNumber()
17
- expect(gas.data.priceUSD).toBeNumber()
18
- expect(gas.data.rapid).toBeNumber()
19
- expect(gas.data.slow).toBeNumber()
20
- expect(gas.data.standard).toBeNumber()
21
- expect(gas.data.timestamp).toBeNumber()
22
- })
23
- })
@@ -1,18 +0,0 @@
1
- import '@xylabs/vitest-extended'
2
-
3
- import { PayloadSetPluginResolver } from '@xyo-network/payloadset-plugin'
4
- import {
5
- describe, expect,
6
- test,
7
- } from 'vitest'
8
-
9
- import { EthereumGasEtherchainV2Plugin } from '../Plugin.ts'
10
-
11
- describe('EthereumGasEtherchainV2Plugin', () => {
12
- test('Add to Resolver', async () => {
13
- const plugin = EthereumGasEtherchainV2Plugin()
14
- const resolver = await new PayloadSetPluginResolver().register(plugin)
15
- expect(await resolver.resolve(plugin.set)).toBeObject()
16
- expect(await resolver.witness(plugin.set)).toBeObject()
17
- })
18
- })
@@ -1,42 +0,0 @@
1
- import '@xylabs/vitest-extended'
2
-
3
- import type { EthereumGasEtherchainV2Payload } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'
4
- import { EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'
5
- import { PayloadWrapper } from '@xyo-network/payload-wrapper'
6
- import {
7
- describe, expect,
8
- test,
9
- } from 'vitest'
10
-
11
- import { EthereumGasEtherchainV2WitnessConfigSchema } from '../Schema.ts'
12
- import { EtherchainEthereumGasWitnessV2 } from '../Witness.ts'
13
-
14
- describe('EtherchainEthereumGasWitnessV2', () => {
15
- test('returns observation', async () => {
16
- const sut = await EtherchainEthereumGasWitnessV2.create({
17
- account: 'random',
18
- config: { schema: EthereumGasEtherchainV2WitnessConfigSchema },
19
- })
20
- const [actual] = (await sut.observe()) as EthereumGasEtherchainV2Payload[]
21
- expect(actual).toBeObject()
22
- expect(actual.code).toBeNumber()
23
- expect(actual.data).toBeObject()
24
- expect(actual.timestamp).toBeNumber()
25
- expect(actual.schema).toBe(EthereumGasEtherchainV2Schema)
26
-
27
- const answerWrapper = PayloadWrapper.wrap(actual)
28
- expect(await answerWrapper.getValid()).toBe(true)
29
- })
30
- test('returns observation [no config]', async () => {
31
- const sut = await EtherchainEthereumGasWitnessV2.create({ account: 'random' })
32
- const [actual] = (await sut.observe()) as EthereumGasEtherchainV2Payload[]
33
- expect(actual).toBeObject()
34
- expect(actual.code).toBeNumber()
35
- expect(actual.data).toBeObject()
36
- expect(actual.timestamp).toBeNumber()
37
- expect(actual.schema).toBe(EthereumGasEtherchainV2Schema)
38
-
39
- const answerWrapper = PayloadWrapper.wrap(actual)
40
- expect(await answerWrapper.getValid()).toBe(true)
41
- })
42
- })