@xyo-network/etherchain-ethereum-gas-v2-plugin 2.97.0 → 2.98.0
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/dist/browser/index.cjs +71 -1
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts.map +1 -1
- package/dist/browser/index.d.mts.map +1 -1
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +48 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/neutral/index.cjs +71 -1
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.d.cts.map +1 -1
- package/dist/neutral/index.d.mts.map +1 -1
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.js +48 -1
- package/dist/neutral/index.js.map +1 -1
- package/dist/node/index.cjs +77 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts.map +1 -1
- package/dist/node/index.d.mts.map +1 -1
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +48 -1
- package/dist/node/index.js.map +1 -1
- package/package.json +13 -13
- package/src/index.ts +1 -0
package/dist/browser/index.cjs
CHANGED
|
@@ -1,2 +1,72 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
EtherchainEthereumGasWitnessV2: () => EtherchainEthereumGasWitnessV2,
|
|
24
|
+
EthereumGasEtherchainV2Plugin: () => EthereumGasEtherchainV2Plugin,
|
|
25
|
+
EthereumGasEtherchainV2WitnessConfigSchema: () => EthereumGasEtherchainV2WitnessConfigSchema,
|
|
26
|
+
default: () => EthereumGasEtherchainV2Plugin
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(src_exports);
|
|
29
|
+
|
|
30
|
+
// src/Plugin.ts
|
|
31
|
+
var import_etherchain_ethereum_gas_v2_payload_plugin2 = require("@xyo-network/etherchain-ethereum-gas-v2-payload-plugin");
|
|
32
|
+
var import_payload_model = require("@xyo-network/payload-model");
|
|
33
|
+
var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
|
|
34
|
+
|
|
35
|
+
// src/Witness.ts
|
|
36
|
+
var import_abstract_witness = require("@xyo-network/abstract-witness");
|
|
37
|
+
var import_etherchain_ethereum_gas_v2_payload_plugin = require("@xyo-network/etherchain-ethereum-gas-v2-payload-plugin");
|
|
38
|
+
|
|
39
|
+
// src/lib/getV2GasFromEtherchain.ts
|
|
40
|
+
var import_axios = require("@xylabs/axios");
|
|
41
|
+
var url = "https://beaconcha.in/api/v1/execution/gasnow";
|
|
42
|
+
var getV2GasFromEtherchain = async () => {
|
|
43
|
+
return (await import_axios.axios.get(url)).data;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// src/Schema.ts
|
|
47
|
+
var EthereumGasEtherchainV2WitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherchain.v2.witness.config";
|
|
48
|
+
|
|
49
|
+
// src/Witness.ts
|
|
50
|
+
var EtherchainEthereumGasWitnessV2 = class extends import_abstract_witness.AbstractWitness {
|
|
51
|
+
static configSchemas = [...super.configSchemas, EthereumGasEtherchainV2WitnessConfigSchema];
|
|
52
|
+
static defaultConfigSchema = EthereumGasEtherchainV2WitnessConfigSchema;
|
|
53
|
+
async observeHandler() {
|
|
54
|
+
const payload = {
|
|
55
|
+
...await getV2GasFromEtherchain(),
|
|
56
|
+
schema: import_etherchain_ethereum_gas_v2_payload_plugin.EthereumGasEtherchainV2Schema,
|
|
57
|
+
timestamp: Date.now()
|
|
58
|
+
};
|
|
59
|
+
return [payload];
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// src/Plugin.ts
|
|
64
|
+
var EthereumGasEtherchainV2Plugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
|
|
65
|
+
{ required: { [import_etherchain_ethereum_gas_v2_payload_plugin2.EthereumGasEtherchainV2Schema]: 1 }, schema: import_payload_model.PayloadSetSchema },
|
|
66
|
+
{
|
|
67
|
+
witness: async (params) => {
|
|
68
|
+
return await EtherchainEthereumGasWitnessV2.create(params);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
);
|
|
2
72
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getV2GasFromEtherchain.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config'\nexport { EthereumGasEtherchainV2Plugin as default, EthereumGasEtherchainV2Plugin } from './Plugin'\nexport * from './Schema'\nexport * from './Witness'\n","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'\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 { EthereumGasEtherchainV2Payload, EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherchainV2WitnessConfig } from './Config'\nimport { getV2GasFromEtherchain } from './lib'\nimport { EthereumGasEtherchainV2WitnessConfigSchema } from './Schema'\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 { 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":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getV2GasFromEtherchain.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config'\n// eslint-disable-next-line import/no-default-export\nexport { EthereumGasEtherchainV2Plugin as default, EthereumGasEtherchainV2Plugin } from './Plugin'\nexport * from './Schema'\nexport * from './Witness'\n","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'\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 { EthereumGasEtherchainV2Payload, EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherchainV2WitnessConfig } from './Config'\nimport { getV2GasFromEtherchain } from './lib'\nimport { EthereumGasEtherchainV2WitnessConfigSchema } from './Schema'\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 { 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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,oDAA8C;AAC9C,2BAAiC;AACjC,+BAA8C;;;ACF9C,8BAAgC;AAChC,uDAA8E;;;ACD9E,mBAAsB;AAGtB,IAAM,MAAM;AAEL,IAAM,yBAAyB,YAAsD;AAC1F,UAAQ,MAAM,mBAAM,IAAqC,GAAG,GAAG;AACjE;;;ACNO,IAAM,6CACX;;;AFUK,IAAM,iCAAN,cAA6C,wCAAsD;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;;;ADlBO,IAAM,gCAAgC,UAC3C;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,+EAA6B,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EAC7E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,+BAA+B,OAAO,MAAM;AAAA,IAC5D;AAAA,EACF;AACF;","names":["import_etherchain_ethereum_gas_v2_payload_plugin"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AAExB,OAAO,EAAE,6BAA6B,IAAI,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAClG,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AAExB,OAAO,EAAE,6BAA6B,IAAI,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAClG,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AAExB,OAAO,EAAE,6BAA6B,IAAI,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAClG,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
|
package/dist/browser/index.js
CHANGED
|
@@ -1,2 +1,49 @@
|
|
|
1
|
-
|
|
1
|
+
// src/Plugin.ts
|
|
2
|
+
import { EthereumGasEtherchainV2Schema as EthereumGasEtherchainV2Schema2 } from "@xyo-network/etherchain-ethereum-gas-v2-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 { AbstractWitness } from "@xyo-network/abstract-witness";
|
|
8
|
+
import { EthereumGasEtherchainV2Schema } from "@xyo-network/etherchain-ethereum-gas-v2-payload-plugin";
|
|
9
|
+
|
|
10
|
+
// src/lib/getV2GasFromEtherchain.ts
|
|
11
|
+
import { axios } from "@xylabs/axios";
|
|
12
|
+
var url = "https://beaconcha.in/api/v1/execution/gasnow";
|
|
13
|
+
var getV2GasFromEtherchain = async () => {
|
|
14
|
+
return (await axios.get(url)).data;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// src/Schema.ts
|
|
18
|
+
var EthereumGasEtherchainV2WitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherchain.v2.witness.config";
|
|
19
|
+
|
|
20
|
+
// src/Witness.ts
|
|
21
|
+
var EtherchainEthereumGasWitnessV2 = class extends AbstractWitness {
|
|
22
|
+
static configSchemas = [...super.configSchemas, EthereumGasEtherchainV2WitnessConfigSchema];
|
|
23
|
+
static defaultConfigSchema = EthereumGasEtherchainV2WitnessConfigSchema;
|
|
24
|
+
async observeHandler() {
|
|
25
|
+
const payload = {
|
|
26
|
+
...await getV2GasFromEtherchain(),
|
|
27
|
+
schema: EthereumGasEtherchainV2Schema,
|
|
28
|
+
timestamp: Date.now()
|
|
29
|
+
};
|
|
30
|
+
return [payload];
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// src/Plugin.ts
|
|
35
|
+
var EthereumGasEtherchainV2Plugin = () => createPayloadSetWitnessPlugin(
|
|
36
|
+
{ required: { [EthereumGasEtherchainV2Schema2]: 1 }, schema: PayloadSetSchema },
|
|
37
|
+
{
|
|
38
|
+
witness: async (params) => {
|
|
39
|
+
return await EtherchainEthereumGasWitnessV2.create(params);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
export {
|
|
44
|
+
EtherchainEthereumGasWitnessV2,
|
|
45
|
+
EthereumGasEtherchainV2Plugin,
|
|
46
|
+
EthereumGasEtherchainV2WitnessConfigSchema,
|
|
47
|
+
EthereumGasEtherchainV2Plugin as default
|
|
48
|
+
};
|
|
2
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -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'\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 { EthereumGasEtherchainV2Payload, EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherchainV2WitnessConfig } from './Config'\nimport { getV2GasFromEtherchain } from './lib'\nimport { EthereumGasEtherchainV2WitnessConfigSchema } from './Schema'\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 { 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,
|
|
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'\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 { EthereumGasEtherchainV2Payload, EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherchainV2WitnessConfig } from './Config'\nimport { getV2GasFromEtherchain } from './lib'\nimport { EthereumGasEtherchainV2WitnessConfigSchema } from './Schema'\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 { 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;AAChC,SAAyC,qCAAqC;;;ACD9E,SAAS,aAAa;AAGtB,IAAM,MAAM;AAEL,IAAM,yBAAyB,YAAsD;AAC1F,UAAQ,MAAM,MAAM,IAAqC,GAAG,GAAG;AACjE;;;ACNO,IAAM,6CACX;;;AFUK,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;;;ADlBO,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/dist/neutral/index.cjs
CHANGED
|
@@ -1,2 +1,72 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
EtherchainEthereumGasWitnessV2: () => EtherchainEthereumGasWitnessV2,
|
|
24
|
+
EthereumGasEtherchainV2Plugin: () => EthereumGasEtherchainV2Plugin,
|
|
25
|
+
EthereumGasEtherchainV2WitnessConfigSchema: () => EthereumGasEtherchainV2WitnessConfigSchema,
|
|
26
|
+
default: () => EthereumGasEtherchainV2Plugin
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(src_exports);
|
|
29
|
+
|
|
30
|
+
// src/Plugin.ts
|
|
31
|
+
var import_etherchain_ethereum_gas_v2_payload_plugin2 = require("@xyo-network/etherchain-ethereum-gas-v2-payload-plugin");
|
|
32
|
+
var import_payload_model = require("@xyo-network/payload-model");
|
|
33
|
+
var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
|
|
34
|
+
|
|
35
|
+
// src/Witness.ts
|
|
36
|
+
var import_abstract_witness = require("@xyo-network/abstract-witness");
|
|
37
|
+
var import_etherchain_ethereum_gas_v2_payload_plugin = require("@xyo-network/etherchain-ethereum-gas-v2-payload-plugin");
|
|
38
|
+
|
|
39
|
+
// src/lib/getV2GasFromEtherchain.ts
|
|
40
|
+
var import_axios = require("@xylabs/axios");
|
|
41
|
+
var url = "https://beaconcha.in/api/v1/execution/gasnow";
|
|
42
|
+
var getV2GasFromEtherchain = async () => {
|
|
43
|
+
return (await import_axios.axios.get(url)).data;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// src/Schema.ts
|
|
47
|
+
var EthereumGasEtherchainV2WitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherchain.v2.witness.config";
|
|
48
|
+
|
|
49
|
+
// src/Witness.ts
|
|
50
|
+
var EtherchainEthereumGasWitnessV2 = class extends import_abstract_witness.AbstractWitness {
|
|
51
|
+
static configSchemas = [...super.configSchemas, EthereumGasEtherchainV2WitnessConfigSchema];
|
|
52
|
+
static defaultConfigSchema = EthereumGasEtherchainV2WitnessConfigSchema;
|
|
53
|
+
async observeHandler() {
|
|
54
|
+
const payload = {
|
|
55
|
+
...await getV2GasFromEtherchain(),
|
|
56
|
+
schema: import_etherchain_ethereum_gas_v2_payload_plugin.EthereumGasEtherchainV2Schema,
|
|
57
|
+
timestamp: Date.now()
|
|
58
|
+
};
|
|
59
|
+
return [payload];
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// src/Plugin.ts
|
|
64
|
+
var EthereumGasEtherchainV2Plugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
|
|
65
|
+
{ required: { [import_etherchain_ethereum_gas_v2_payload_plugin2.EthereumGasEtherchainV2Schema]: 1 }, schema: import_payload_model.PayloadSetSchema },
|
|
66
|
+
{
|
|
67
|
+
witness: async (params) => {
|
|
68
|
+
return await EtherchainEthereumGasWitnessV2.create(params);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
);
|
|
2
72
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getV2GasFromEtherchain.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config'\nexport { EthereumGasEtherchainV2Plugin as default, EthereumGasEtherchainV2Plugin } from './Plugin'\nexport * from './Schema'\nexport * from './Witness'\n","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'\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 { EthereumGasEtherchainV2Payload, EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherchainV2WitnessConfig } from './Config'\nimport { getV2GasFromEtherchain } from './lib'\nimport { EthereumGasEtherchainV2WitnessConfigSchema } from './Schema'\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 { 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":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getV2GasFromEtherchain.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config'\n// eslint-disable-next-line import/no-default-export\nexport { EthereumGasEtherchainV2Plugin as default, EthereumGasEtherchainV2Plugin } from './Plugin'\nexport * from './Schema'\nexport * from './Witness'\n","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'\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 { EthereumGasEtherchainV2Payload, EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherchainV2WitnessConfig } from './Config'\nimport { getV2GasFromEtherchain } from './lib'\nimport { EthereumGasEtherchainV2WitnessConfigSchema } from './Schema'\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 { 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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,oDAA8C;AAC9C,2BAAiC;AACjC,+BAA8C;;;ACF9C,8BAAgC;AAChC,uDAA8E;;;ACD9E,mBAAsB;AAGtB,IAAM,MAAM;AAEL,IAAM,yBAAyB,YAAsD;AAC1F,UAAQ,MAAM,mBAAM,IAAqC,GAAG,GAAG;AACjE;;;ACNO,IAAM,6CACX;;;AFUK,IAAM,iCAAN,cAA6C,wCAAsD;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;;;ADlBO,IAAM,gCAAgC,UAC3C;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,+EAA6B,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EAC7E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,+BAA+B,OAAO,MAAM;AAAA,IAC5D;AAAA,EACF;AACF;","names":["import_etherchain_ethereum_gas_v2_payload_plugin"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AAExB,OAAO,EAAE,6BAA6B,IAAI,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAClG,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AAExB,OAAO,EAAE,6BAA6B,IAAI,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAClG,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AAExB,OAAO,EAAE,6BAA6B,IAAI,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAClG,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
|
package/dist/neutral/index.js
CHANGED
|
@@ -1,2 +1,49 @@
|
|
|
1
|
-
|
|
1
|
+
// src/Plugin.ts
|
|
2
|
+
import { EthereumGasEtherchainV2Schema as EthereumGasEtherchainV2Schema2 } from "@xyo-network/etherchain-ethereum-gas-v2-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 { AbstractWitness } from "@xyo-network/abstract-witness";
|
|
8
|
+
import { EthereumGasEtherchainV2Schema } from "@xyo-network/etherchain-ethereum-gas-v2-payload-plugin";
|
|
9
|
+
|
|
10
|
+
// src/lib/getV2GasFromEtherchain.ts
|
|
11
|
+
import { axios } from "@xylabs/axios";
|
|
12
|
+
var url = "https://beaconcha.in/api/v1/execution/gasnow";
|
|
13
|
+
var getV2GasFromEtherchain = async () => {
|
|
14
|
+
return (await axios.get(url)).data;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// src/Schema.ts
|
|
18
|
+
var EthereumGasEtherchainV2WitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherchain.v2.witness.config";
|
|
19
|
+
|
|
20
|
+
// src/Witness.ts
|
|
21
|
+
var EtherchainEthereumGasWitnessV2 = class extends AbstractWitness {
|
|
22
|
+
static configSchemas = [...super.configSchemas, EthereumGasEtherchainV2WitnessConfigSchema];
|
|
23
|
+
static defaultConfigSchema = EthereumGasEtherchainV2WitnessConfigSchema;
|
|
24
|
+
async observeHandler() {
|
|
25
|
+
const payload = {
|
|
26
|
+
...await getV2GasFromEtherchain(),
|
|
27
|
+
schema: EthereumGasEtherchainV2Schema,
|
|
28
|
+
timestamp: Date.now()
|
|
29
|
+
};
|
|
30
|
+
return [payload];
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// src/Plugin.ts
|
|
35
|
+
var EthereumGasEtherchainV2Plugin = () => createPayloadSetWitnessPlugin(
|
|
36
|
+
{ required: { [EthereumGasEtherchainV2Schema2]: 1 }, schema: PayloadSetSchema },
|
|
37
|
+
{
|
|
38
|
+
witness: async (params) => {
|
|
39
|
+
return await EtherchainEthereumGasWitnessV2.create(params);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
export {
|
|
44
|
+
EtherchainEthereumGasWitnessV2,
|
|
45
|
+
EthereumGasEtherchainV2Plugin,
|
|
46
|
+
EthereumGasEtherchainV2WitnessConfigSchema,
|
|
47
|
+
EthereumGasEtherchainV2Plugin as default
|
|
48
|
+
};
|
|
2
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -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'\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 { EthereumGasEtherchainV2Payload, EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherchainV2WitnessConfig } from './Config'\nimport { getV2GasFromEtherchain } from './lib'\nimport { EthereumGasEtherchainV2WitnessConfigSchema } from './Schema'\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 { 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,
|
|
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'\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 { EthereumGasEtherchainV2Payload, EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherchainV2WitnessConfig } from './Config'\nimport { getV2GasFromEtherchain } from './lib'\nimport { EthereumGasEtherchainV2WitnessConfigSchema } from './Schema'\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 { 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;AAChC,SAAyC,qCAAqC;;;ACD9E,SAAS,aAAa;AAGtB,IAAM,MAAM;AAEL,IAAM,yBAAyB,YAAsD;AAC1F,UAAQ,MAAM,MAAM,IAAqC,GAAG,GAAG;AACjE;;;ACNO,IAAM,6CACX;;;AFUK,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;;;ADlBO,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/dist/node/index.cjs
CHANGED
|
@@ -1,2 +1,78 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
EtherchainEthereumGasWitnessV2: () => EtherchainEthereumGasWitnessV2,
|
|
24
|
+
EthereumGasEtherchainV2Plugin: () => EthereumGasEtherchainV2Plugin,
|
|
25
|
+
EthereumGasEtherchainV2WitnessConfigSchema: () => EthereumGasEtherchainV2WitnessConfigSchema,
|
|
26
|
+
default: () => EthereumGasEtherchainV2Plugin
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(src_exports);
|
|
29
|
+
|
|
30
|
+
// src/Plugin.ts
|
|
31
|
+
var import_etherchain_ethereum_gas_v2_payload_plugin2 = require("@xyo-network/etherchain-ethereum-gas-v2-payload-plugin");
|
|
32
|
+
var import_payload_model = require("@xyo-network/payload-model");
|
|
33
|
+
var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
|
|
34
|
+
|
|
35
|
+
// src/Witness.ts
|
|
36
|
+
var import_abstract_witness = require("@xyo-network/abstract-witness");
|
|
37
|
+
var import_etherchain_ethereum_gas_v2_payload_plugin = require("@xyo-network/etherchain-ethereum-gas-v2-payload-plugin");
|
|
38
|
+
|
|
39
|
+
// src/lib/getV2GasFromEtherchain.ts
|
|
40
|
+
var import_axios = require("@xylabs/axios");
|
|
41
|
+
var url = "https://beaconcha.in/api/v1/execution/gasnow";
|
|
42
|
+
var getV2GasFromEtherchain = async () => {
|
|
43
|
+
return (await import_axios.axios.get(url)).data;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// src/Schema.ts
|
|
47
|
+
var EthereumGasEtherchainV2WitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherchain.v2.witness.config";
|
|
48
|
+
|
|
49
|
+
// src/Witness.ts
|
|
50
|
+
var EtherchainEthereumGasWitnessV2 = class extends import_abstract_witness.AbstractWitness {
|
|
51
|
+
static configSchemas = [...super.configSchemas, EthereumGasEtherchainV2WitnessConfigSchema];
|
|
52
|
+
static defaultConfigSchema = EthereumGasEtherchainV2WitnessConfigSchema;
|
|
53
|
+
async observeHandler() {
|
|
54
|
+
const payload = {
|
|
55
|
+
...await getV2GasFromEtherchain(),
|
|
56
|
+
schema: import_etherchain_ethereum_gas_v2_payload_plugin.EthereumGasEtherchainV2Schema,
|
|
57
|
+
timestamp: Date.now()
|
|
58
|
+
};
|
|
59
|
+
return [payload];
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// src/Plugin.ts
|
|
64
|
+
var EthereumGasEtherchainV2Plugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
|
|
65
|
+
{ required: { [import_etherchain_ethereum_gas_v2_payload_plugin2.EthereumGasEtherchainV2Schema]: 1 }, schema: import_payload_model.PayloadSetSchema },
|
|
66
|
+
{
|
|
67
|
+
witness: async (params) => {
|
|
68
|
+
return await EtherchainEthereumGasWitnessV2.create(params);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
73
|
+
0 && (module.exports = {
|
|
74
|
+
EtherchainEthereumGasWitnessV2,
|
|
75
|
+
EthereumGasEtherchainV2Plugin,
|
|
76
|
+
EthereumGasEtherchainV2WitnessConfigSchema
|
|
77
|
+
});
|
|
2
78
|
//# sourceMappingURL=index.cjs.map
|
package/dist/node/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getV2GasFromEtherchain.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config'\nexport { EthereumGasEtherchainV2Plugin as default, EthereumGasEtherchainV2Plugin } from './Plugin'\nexport * from './Schema'\nexport * from './Witness'\n","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'\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 { EthereumGasEtherchainV2Payload, EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherchainV2WitnessConfig } from './Config'\nimport { getV2GasFromEtherchain } from './lib'\nimport { EthereumGasEtherchainV2WitnessConfigSchema } from './Schema'\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 { 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":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getV2GasFromEtherchain.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config'\n// eslint-disable-next-line import/no-default-export\nexport { EthereumGasEtherchainV2Plugin as default, EthereumGasEtherchainV2Plugin } from './Plugin'\nexport * from './Schema'\nexport * from './Witness'\n","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'\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 { EthereumGasEtherchainV2Payload, EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherchainV2WitnessConfig } from './Config'\nimport { getV2GasFromEtherchain } from './lib'\nimport { EthereumGasEtherchainV2WitnessConfigSchema } from './Schema'\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 { 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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,oDAA8C;AAC9C,2BAAiC;AACjC,+BAA8C;;;ACF9C,8BAAgC;AAChC,uDAA8E;;;ACD9E,mBAAsB;AAGtB,IAAM,MAAM;AAEL,IAAM,yBAAyB,YAAsD;AAC1F,UAAQ,MAAM,mBAAM,IAAqC,GAAG,GAAG;AACjE;;;ACNO,IAAM,6CACX;;;AFUK,IAAM,iCAAN,cAA6C,wCAAsD;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;;;ADlBO,IAAM,gCAAgC,UAC3C;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,+EAA6B,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EAC7E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,+BAA+B,OAAO,MAAM;AAAA,IAC5D;AAAA,EACF;AACF;","names":["import_etherchain_ethereum_gas_v2_payload_plugin"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AAExB,OAAO,EAAE,6BAA6B,IAAI,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAClG,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AAExB,OAAO,EAAE,6BAA6B,IAAI,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAClG,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
|
package/dist/node/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AAExB,OAAO,EAAE,6BAA6B,IAAI,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAClG,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
|
package/dist/node/index.js
CHANGED
|
@@ -1,2 +1,49 @@
|
|
|
1
|
-
|
|
1
|
+
// src/Plugin.ts
|
|
2
|
+
import { EthereumGasEtherchainV2Schema as EthereumGasEtherchainV2Schema2 } from "@xyo-network/etherchain-ethereum-gas-v2-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 { AbstractWitness } from "@xyo-network/abstract-witness";
|
|
8
|
+
import { EthereumGasEtherchainV2Schema } from "@xyo-network/etherchain-ethereum-gas-v2-payload-plugin";
|
|
9
|
+
|
|
10
|
+
// src/lib/getV2GasFromEtherchain.ts
|
|
11
|
+
import { axios } from "@xylabs/axios";
|
|
12
|
+
var url = "https://beaconcha.in/api/v1/execution/gasnow";
|
|
13
|
+
var getV2GasFromEtherchain = async () => {
|
|
14
|
+
return (await axios.get(url)).data;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// src/Schema.ts
|
|
18
|
+
var EthereumGasEtherchainV2WitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.etherchain.v2.witness.config";
|
|
19
|
+
|
|
20
|
+
// src/Witness.ts
|
|
21
|
+
var EtherchainEthereumGasWitnessV2 = class extends AbstractWitness {
|
|
22
|
+
static configSchemas = [...super.configSchemas, EthereumGasEtherchainV2WitnessConfigSchema];
|
|
23
|
+
static defaultConfigSchema = EthereumGasEtherchainV2WitnessConfigSchema;
|
|
24
|
+
async observeHandler() {
|
|
25
|
+
const payload = {
|
|
26
|
+
...await getV2GasFromEtherchain(),
|
|
27
|
+
schema: EthereumGasEtherchainV2Schema,
|
|
28
|
+
timestamp: Date.now()
|
|
29
|
+
};
|
|
30
|
+
return [payload];
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// src/Plugin.ts
|
|
35
|
+
var EthereumGasEtherchainV2Plugin = () => createPayloadSetWitnessPlugin(
|
|
36
|
+
{ required: { [EthereumGasEtherchainV2Schema2]: 1 }, schema: PayloadSetSchema },
|
|
37
|
+
{
|
|
38
|
+
witness: async (params) => {
|
|
39
|
+
return await EtherchainEthereumGasWitnessV2.create(params);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
export {
|
|
44
|
+
EtherchainEthereumGasWitnessV2,
|
|
45
|
+
EthereumGasEtherchainV2Plugin,
|
|
46
|
+
EthereumGasEtherchainV2WitnessConfigSchema,
|
|
47
|
+
EthereumGasEtherchainV2Plugin as default
|
|
48
|
+
};
|
|
2
49
|
//# sourceMappingURL=index.js.map
|
package/dist/node/index.js.map
CHANGED
|
@@ -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'\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 { EthereumGasEtherchainV2Payload, EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherchainV2WitnessConfig } from './Config'\nimport { getV2GasFromEtherchain } from './lib'\nimport { EthereumGasEtherchainV2WitnessConfigSchema } from './Schema'\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 { 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,
|
|
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'\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 { EthereumGasEtherchainV2Payload, EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-ethereum-gas-v2-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherchainV2WitnessConfig } from './Config'\nimport { getV2GasFromEtherchain } from './lib'\nimport { EthereumGasEtherchainV2WitnessConfigSchema } from './Schema'\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 { 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;AAChC,SAAyC,qCAAqC;;;ACD9E,SAAS,aAAa;AAGtB,IAAM,MAAM;AAEL,IAAM,yBAAyB,YAAsD;AAC1F,UAAQ,MAAM,MAAM,IAAqC,GAAG,GAAG;AACjE;;;ACNO,IAAM,6CACX;;;AFUK,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;;;ADlBO,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
|
@@ -10,20 +10,20 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/plugins/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xylabs/axios": "^3.5.
|
|
14
|
-
"@xyo-network/abstract-witness": "^2.
|
|
15
|
-
"@xyo-network/etherchain-ethereum-gas-v2-payload-plugin": "
|
|
16
|
-
"@xyo-network/module-model": "^2.
|
|
17
|
-
"@xyo-network/payload-model": "^2.
|
|
18
|
-
"@xyo-network/payloadset-plugin": "^2.
|
|
19
|
-
"@xyo-network/witness-model": "^2.
|
|
13
|
+
"@xylabs/axios": "^3.5.2",
|
|
14
|
+
"@xyo-network/abstract-witness": "^2.108.0",
|
|
15
|
+
"@xyo-network/etherchain-ethereum-gas-v2-payload-plugin": "^2.98.0",
|
|
16
|
+
"@xyo-network/module-model": "^2.108.0",
|
|
17
|
+
"@xyo-network/payload-model": "^2.108.0",
|
|
18
|
+
"@xyo-network/payloadset-plugin": "^2.108.0",
|
|
19
|
+
"@xyo-network/witness-model": "^2.108.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@xylabs/ts-scripts-yarn3": "^3.11.
|
|
23
|
-
"@xylabs/tsconfig": "^3.11.
|
|
24
|
-
"@xyo-network/account": "^2.
|
|
25
|
-
"@xyo-network/payload-wrapper": "^2.
|
|
26
|
-
"typescript": "^5.5.
|
|
22
|
+
"@xylabs/ts-scripts-yarn3": "^3.11.12",
|
|
23
|
+
"@xylabs/tsconfig": "^3.11.12",
|
|
24
|
+
"@xyo-network/account": "^2.108.0",
|
|
25
|
+
"@xyo-network/payload-wrapper": "^2.108.0",
|
|
26
|
+
"typescript": "^5.5.3"
|
|
27
27
|
},
|
|
28
28
|
"description": "Typescript/Javascript Plugins for XYO Platform",
|
|
29
29
|
"types": "dist/node/index.d.ts",
|
|
@@ -64,6 +64,6 @@
|
|
|
64
64
|
"url": "https://github.com/XYOracleNetwork/plugins.git"
|
|
65
65
|
},
|
|
66
66
|
"sideEffects": false,
|
|
67
|
-
"version": "2.
|
|
67
|
+
"version": "2.98.0",
|
|
68
68
|
"type": "module"
|
|
69
69
|
}
|