@xyo-network/etherscan-ethereum-gas-plugin 2.92.1 → 2.93.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/Witness.d.cts +3 -2
- package/dist/browser/Witness.d.cts.map +1 -1
- package/dist/browser/Witness.d.mts +3 -2
- package/dist/browser/Witness.d.mts.map +1 -1
- package/dist/browser/Witness.d.ts +3 -2
- package/dist/browser/Witness.d.ts.map +1 -1
- package/dist/browser/index.cjs +2 -1
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +2 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/node/Witness.d.cts +3 -2
- package/dist/node/Witness.d.cts.map +1 -1
- package/dist/node/Witness.d.mts +3 -2
- package/dist/node/Witness.d.mts.map +1 -1
- package/dist/node/Witness.d.ts +3 -2
- package/dist/node/Witness.d.ts.map +1 -1
- package/dist/node/index.cjs +2 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +2 -1
- package/dist/node/index.js.map +1 -1
- package/package.json +14 -14
- package/src/Witness.ts +3 -2
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
2
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
|
-
import { Payload } from '@xyo-network/payload-model';
|
|
3
|
+
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
4
|
import { WitnessParams } from '@xyo-network/witness-model';
|
|
5
5
|
import { EthereumGasEtherscanWitnessConfig } from './Config';
|
|
6
6
|
export declare class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {
|
|
7
|
-
static configSchemas:
|
|
7
|
+
static configSchemas: Schema[];
|
|
8
|
+
static defaultConfigSchema: Schema;
|
|
8
9
|
protected observeHandler(): Promise<Payload[]>;
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=Witness.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAA;AAI5D,qBAAa,2BAA4B,SAAQ,eAAe,CAAC,aAAa,CAAC,eAAe,CAAC,iCAAiC,CAAC,CAAC,CAAC;IACjI,OAAgB,aAAa,EAAE,MAAM,EAAE,CAAoE;IAC3G,OAAgB,mBAAmB,EAAE,MAAM,CAA0C;cAE5D,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAO9D"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
2
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
|
-
import { Payload } from '@xyo-network/payload-model';
|
|
3
|
+
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
4
|
import { WitnessParams } from '@xyo-network/witness-model';
|
|
5
5
|
import { EthereumGasEtherscanWitnessConfig } from './Config';
|
|
6
6
|
export declare class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {
|
|
7
|
-
static configSchemas:
|
|
7
|
+
static configSchemas: Schema[];
|
|
8
|
+
static defaultConfigSchema: Schema;
|
|
8
9
|
protected observeHandler(): Promise<Payload[]>;
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=Witness.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAA;AAI5D,qBAAa,2BAA4B,SAAQ,eAAe,CAAC,aAAa,CAAC,eAAe,CAAC,iCAAiC,CAAC,CAAC,CAAC;IACjI,OAAgB,aAAa,EAAE,MAAM,EAAE,CAAoE;IAC3G,OAAgB,mBAAmB,EAAE,MAAM,CAA0C;cAE5D,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAO9D"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
2
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
|
-
import { Payload } from '@xyo-network/payload-model';
|
|
3
|
+
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
4
|
import { WitnessParams } from '@xyo-network/witness-model';
|
|
5
5
|
import { EthereumGasEtherscanWitnessConfig } from './Config';
|
|
6
6
|
export declare class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {
|
|
7
|
-
static configSchemas:
|
|
7
|
+
static configSchemas: Schema[];
|
|
8
|
+
static defaultConfigSchema: Schema;
|
|
8
9
|
protected observeHandler(): Promise<Payload[]>;
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=Witness.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAA;AAI5D,qBAAa,2BAA4B,SAAQ,eAAe,CAAC,aAAa,CAAC,eAAe,CAAC,iCAAiC,CAAC,CAAC,CAAC;IACjI,OAAgB,aAAa,EAAE,MAAM,EAAE,CAAoE;IAC3G,OAAgB,mBAAmB,EAAE,MAAM,CAA0C;cAE5D,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAO9D"}
|
package/dist/browser/index.cjs
CHANGED
|
@@ -50,7 +50,8 @@ var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.g
|
|
|
50
50
|
|
|
51
51
|
// src/Witness.ts
|
|
52
52
|
var EthereumGasEtherscanWitness = class extends import_abstract_witness.AbstractWitness {
|
|
53
|
-
static configSchemas = [EthereumGasEtherscanWitnessConfigSchema];
|
|
53
|
+
static configSchemas = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema];
|
|
54
|
+
static defaultConfigSchema = EthereumGasEtherscanWitnessConfigSchema;
|
|
54
55
|
async observeHandler() {
|
|
55
56
|
const apiKey = (0, import_assert.assertEx)(this.config?.apiKey, () => "apiKey is required");
|
|
56
57
|
const payload = await new import_payload_builder.PayloadBuilder({ schema: import_etherscan_ethereum_gas_payload_plugin.EthereumGasEtherscanSchema }).fields(await getGasFromEtherscan(apiKey)).build();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config'\nexport { EthereumGasEtherscanPlugin as default, EthereumGasEtherscanPlugin } from './Plugin'\nexport * from './Schema'\nexport * from './Witness'\n","import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEtherscanWitness } from './Witness'\n\nexport const EthereumGasEtherscanPlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasEtherscanWitness>(\n { required: { [EthereumGasEtherscanSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await EthereumGasEtherscanWitness.create(params)\n return result as EthereumGasEtherscanWitness\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherscanWitnessConfig } from './Config'\nimport { getGasFromEtherscan } from './lib'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema'\n\nexport class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {\n static override configSchemas = [EthereumGasEtherscanWitnessConfigSchema]\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/axios'\nimport { EthereumGasEtherscanResponse } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\n\nexport const getGasFromEtherscan = async (apiKey: string): Promise<EthereumGasEtherscanResponse> => {\n const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`\n return (await axios.get<EthereumGasEtherscanResponse>(url)).data\n}\n","export type EthereumGasEtherscanWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\nexport const EthereumGasEtherscanWitnessConfigSchema: EthereumGasEtherscanWitnessConfigSchema =\n 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gDAA2C;AAC3C,2BAAiC;AACjC,+BAA8C;;;ACF9C,oBAAyB;AACzB,8BAAgC;AAChC,mDAAwE;AAExE,6BAA+B;;;ACJ/B,mBAAsB;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,mBAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACX;;;AFUK,IAAM,8BAAN,cAA0C,wCAAmF;AAAA,EAClI,OAAgB,
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config'\nexport { EthereumGasEtherscanPlugin as default, EthereumGasEtherscanPlugin } from './Plugin'\nexport * from './Schema'\nexport * from './Witness'\n","import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEtherscanWitness } from './Witness'\n\nexport const EthereumGasEtherscanPlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasEtherscanWitness>(\n { required: { [EthereumGasEtherscanSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await EthereumGasEtherscanWitness.create(params)\n return result as EthereumGasEtherscanWitness\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherscanWitnessConfig } from './Config'\nimport { getGasFromEtherscan } from './lib'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema'\n\nexport class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {\n static override configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema]\n static override defaultConfigSchema: Schema = EthereumGasEtherscanWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/axios'\nimport { EthereumGasEtherscanResponse } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\n\nexport const getGasFromEtherscan = async (apiKey: string): Promise<EthereumGasEtherscanResponse> => {\n const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`\n return (await axios.get<EthereumGasEtherscanResponse>(url)).data\n}\n","export type EthereumGasEtherscanWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\nexport const EthereumGasEtherscanWitnessConfigSchema: EthereumGasEtherscanWitnessConfigSchema =\n 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gDAA2C;AAC3C,2BAAiC;AACjC,+BAA8C;;;ACF9C,oBAAyB;AACzB,8BAAgC;AAChC,mDAAwE;AAExE,6BAA+B;;;ACJ/B,mBAAsB;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,mBAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACX;;;AFUK,IAAM,8BAAN,cAA0C,wCAAmF;AAAA,EAClI,OAAgB,gBAA0B,CAAC,GAAG,MAAM,eAAe,uCAAuC;AAAA,EAC1G,OAAgB,sBAA8B;AAAA,EAE9C,MAAyB,iBAAqC;AAC5D,UAAM,aAAS,wBAAS,KAAK,QAAQ,QAAQ,MAAM,oBAAoB;AACvE,UAAM,UAAU,MAAM,IAAI,sCAA4C,EAAE,QAAQ,wEAA2B,CAAC,EACzG,OAAO,MAAM,oBAAoB,MAAM,CAAC,EACxC,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADjBO,IAAM,6BAA6B,UACxC;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,wEAA0B,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EAC1E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,4BAA4B,OAAO,MAAM;AAC9D,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["import_etherscan_ethereum_gas_payload_plugin"]}
|
package/dist/browser/index.js
CHANGED
|
@@ -21,7 +21,8 @@ var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.g
|
|
|
21
21
|
|
|
22
22
|
// src/Witness.ts
|
|
23
23
|
var EthereumGasEtherscanWitness = class extends AbstractWitness {
|
|
24
|
-
static configSchemas = [EthereumGasEtherscanWitnessConfigSchema];
|
|
24
|
+
static configSchemas = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema];
|
|
25
|
+
static defaultConfigSchema = EthereumGasEtherscanWitnessConfigSchema;
|
|
25
26
|
async observeHandler() {
|
|
26
27
|
const apiKey = assertEx(this.config?.apiKey, () => "apiKey is required");
|
|
27
28
|
const payload = await new PayloadBuilder({ schema: EthereumGasEtherscanSchema }).fields(await getGasFromEtherscan(apiKey)).build();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEtherscanWitness } from './Witness'\n\nexport const EthereumGasEtherscanPlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasEtherscanWitness>(\n { required: { [EthereumGasEtherscanSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await EthereumGasEtherscanWitness.create(params)\n return result as EthereumGasEtherscanWitness\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherscanWitnessConfig } from './Config'\nimport { getGasFromEtherscan } from './lib'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema'\n\nexport class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {\n static override configSchemas = [EthereumGasEtherscanWitnessConfigSchema]\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/axios'\nimport { EthereumGasEtherscanResponse } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\n\nexport const getGasFromEtherscan = async (apiKey: string): Promise<EthereumGasEtherscanResponse> => {\n const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`\n return (await axios.get<EthereumGasEtherscanResponse>(url)).data\n}\n","export type EthereumGasEtherscanWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\nexport const EthereumGasEtherscanWitnessConfigSchema: EthereumGasEtherscanWitnessConfigSchema =\n 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\n"],"mappings":";AAAA,SAAS,8BAAAA,mCAAkC;AAC3C,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAsC,kCAAkC;AAExE,SAAS,sBAAsB;;;ACJ/B,SAAS,aAAa;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,MAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACX;;;AFUK,IAAM,8BAAN,cAA0C,gBAAmF;AAAA,EAClI,OAAgB,
|
|
1
|
+
{"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEtherscanWitness } from './Witness'\n\nexport const EthereumGasEtherscanPlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasEtherscanWitness>(\n { required: { [EthereumGasEtherscanSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await EthereumGasEtherscanWitness.create(params)\n return result as EthereumGasEtherscanWitness\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherscanWitnessConfig } from './Config'\nimport { getGasFromEtherscan } from './lib'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema'\n\nexport class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {\n static override configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema]\n static override defaultConfigSchema: Schema = EthereumGasEtherscanWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/axios'\nimport { EthereumGasEtherscanResponse } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\n\nexport const getGasFromEtherscan = async (apiKey: string): Promise<EthereumGasEtherscanResponse> => {\n const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`\n return (await axios.get<EthereumGasEtherscanResponse>(url)).data\n}\n","export type EthereumGasEtherscanWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\nexport const EthereumGasEtherscanWitnessConfigSchema: EthereumGasEtherscanWitnessConfigSchema =\n 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\n"],"mappings":";AAAA,SAAS,8BAAAA,mCAAkC;AAC3C,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAsC,kCAAkC;AAExE,SAAS,sBAAsB;;;ACJ/B,SAAS,aAAa;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,MAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACX;;;AFUK,IAAM,8BAAN,cAA0C,gBAAmF;AAAA,EAClI,OAAgB,gBAA0B,CAAC,GAAG,MAAM,eAAe,uCAAuC;AAAA,EAC1G,OAAgB,sBAA8B;AAAA,EAE9C,MAAyB,iBAAqC;AAC5D,UAAM,SAAS,SAAS,KAAK,QAAQ,QAAQ,MAAM,oBAAoB;AACvE,UAAM,UAAU,MAAM,IAAI,eAA4C,EAAE,QAAQ,2BAA2B,CAAC,EACzG,OAAO,MAAM,oBAAoB,MAAM,CAAC,EACxC,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADjBO,IAAM,6BAA6B,MACxC;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,2BAA0B,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EAC1E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,4BAA4B,OAAO,MAAM;AAC9D,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["EthereumGasEtherscanSchema","EthereumGasEtherscanSchema"]}
|
package/dist/node/Witness.d.cts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
2
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
|
-
import { Payload } from '@xyo-network/payload-model';
|
|
3
|
+
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
4
|
import { WitnessParams } from '@xyo-network/witness-model';
|
|
5
5
|
import { EthereumGasEtherscanWitnessConfig } from './Config';
|
|
6
6
|
export declare class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {
|
|
7
|
-
static configSchemas:
|
|
7
|
+
static configSchemas: Schema[];
|
|
8
|
+
static defaultConfigSchema: Schema;
|
|
8
9
|
protected observeHandler(): Promise<Payload[]>;
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=Witness.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAA;AAI5D,qBAAa,2BAA4B,SAAQ,eAAe,CAAC,aAAa,CAAC,eAAe,CAAC,iCAAiC,CAAC,CAAC,CAAC;IACjI,OAAgB,aAAa,EAAE,MAAM,EAAE,CAAoE;IAC3G,OAAgB,mBAAmB,EAAE,MAAM,CAA0C;cAE5D,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAO9D"}
|
package/dist/node/Witness.d.mts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
2
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
|
-
import { Payload } from '@xyo-network/payload-model';
|
|
3
|
+
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
4
|
import { WitnessParams } from '@xyo-network/witness-model';
|
|
5
5
|
import { EthereumGasEtherscanWitnessConfig } from './Config';
|
|
6
6
|
export declare class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {
|
|
7
|
-
static configSchemas:
|
|
7
|
+
static configSchemas: Schema[];
|
|
8
|
+
static defaultConfigSchema: Schema;
|
|
8
9
|
protected observeHandler(): Promise<Payload[]>;
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=Witness.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAA;AAI5D,qBAAa,2BAA4B,SAAQ,eAAe,CAAC,aAAa,CAAC,eAAe,CAAC,iCAAiC,CAAC,CAAC,CAAC;IACjI,OAAgB,aAAa,EAAE,MAAM,EAAE,CAAoE;IAC3G,OAAgB,mBAAmB,EAAE,MAAM,CAA0C;cAE5D,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAO9D"}
|
package/dist/node/Witness.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
2
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
|
-
import { Payload } from '@xyo-network/payload-model';
|
|
3
|
+
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
4
|
import { WitnessParams } from '@xyo-network/witness-model';
|
|
5
5
|
import { EthereumGasEtherscanWitnessConfig } from './Config';
|
|
6
6
|
export declare class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {
|
|
7
|
-
static configSchemas:
|
|
7
|
+
static configSchemas: Schema[];
|
|
8
|
+
static defaultConfigSchema: Schema;
|
|
8
9
|
protected observeHandler(): Promise<Payload[]>;
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=Witness.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAA;AAI5D,qBAAa,2BAA4B,SAAQ,eAAe,CAAC,aAAa,CAAC,eAAe,CAAC,iCAAiC,CAAC,CAAC,CAAC;IACjI,OAAgB,aAAa,EAAE,MAAM,EAAE,CAAoE;IAC3G,OAAgB,mBAAmB,EAAE,MAAM,CAA0C;cAE5D,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAO9D"}
|
package/dist/node/index.cjs
CHANGED
|
@@ -50,7 +50,8 @@ var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.g
|
|
|
50
50
|
|
|
51
51
|
// src/Witness.ts
|
|
52
52
|
var EthereumGasEtherscanWitness = class extends import_abstract_witness.AbstractWitness {
|
|
53
|
-
static configSchemas = [EthereumGasEtherscanWitnessConfigSchema];
|
|
53
|
+
static configSchemas = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema];
|
|
54
|
+
static defaultConfigSchema = EthereumGasEtherscanWitnessConfigSchema;
|
|
54
55
|
async observeHandler() {
|
|
55
56
|
var _a;
|
|
56
57
|
const apiKey = (0, import_assert.assertEx)((_a = this.config) == null ? void 0 : _a.apiKey, () => "apiKey is required");
|
package/dist/node/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config'\nexport { EthereumGasEtherscanPlugin as default, EthereumGasEtherscanPlugin } from './Plugin'\nexport * from './Schema'\nexport * from './Witness'\n","import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEtherscanWitness } from './Witness'\n\nexport const EthereumGasEtherscanPlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasEtherscanWitness>(\n { required: { [EthereumGasEtherscanSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await EthereumGasEtherscanWitness.create(params)\n return result as EthereumGasEtherscanWitness\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherscanWitnessConfig } from './Config'\nimport { getGasFromEtherscan } from './lib'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema'\n\nexport class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {\n static override configSchemas = [EthereumGasEtherscanWitnessConfigSchema]\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/axios'\nimport { EthereumGasEtherscanResponse } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\n\nexport const getGasFromEtherscan = async (apiKey: string): Promise<EthereumGasEtherscanResponse> => {\n const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`\n return (await axios.get<EthereumGasEtherscanResponse>(url)).data\n}\n","export type EthereumGasEtherscanWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\nexport const EthereumGasEtherscanWitnessConfigSchema: EthereumGasEtherscanWitnessConfigSchema =\n 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gDAA2C;AAC3C,2BAAiC;AACjC,+BAA8C;;;ACF9C,oBAAyB;AACzB,8BAAgC;AAChC,mDAAwE;AAExE,6BAA+B;;;ACJ/B,mBAAsB;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,mBAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACX;;;AFUK,IAAM,8BAAN,cAA0C,wCAAmF;AAAA,EAClI,OAAgB,
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config'\nexport { EthereumGasEtherscanPlugin as default, EthereumGasEtherscanPlugin } from './Plugin'\nexport * from './Schema'\nexport * from './Witness'\n","import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEtherscanWitness } from './Witness'\n\nexport const EthereumGasEtherscanPlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasEtherscanWitness>(\n { required: { [EthereumGasEtherscanSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await EthereumGasEtherscanWitness.create(params)\n return result as EthereumGasEtherscanWitness\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherscanWitnessConfig } from './Config'\nimport { getGasFromEtherscan } from './lib'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema'\n\nexport class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {\n static override configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema]\n static override defaultConfigSchema: Schema = EthereumGasEtherscanWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/axios'\nimport { EthereumGasEtherscanResponse } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\n\nexport const getGasFromEtherscan = async (apiKey: string): Promise<EthereumGasEtherscanResponse> => {\n const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`\n return (await axios.get<EthereumGasEtherscanResponse>(url)).data\n}\n","export type EthereumGasEtherscanWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\nexport const EthereumGasEtherscanWitnessConfigSchema: EthereumGasEtherscanWitnessConfigSchema =\n 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gDAA2C;AAC3C,2BAAiC;AACjC,+BAA8C;;;ACF9C,oBAAyB;AACzB,8BAAgC;AAChC,mDAAwE;AAExE,6BAA+B;;;ACJ/B,mBAAsB;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,mBAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACX;;;AFUK,IAAM,8BAAN,cAA0C,wCAAmF;AAAA,EAClI,OAAgB,gBAA0B,CAAC,GAAG,MAAM,eAAe,uCAAuC;AAAA,EAC1G,OAAgB,sBAA8B;AAAA,EAE9C,MAAyB,iBAAqC;AAhBhE;AAiBI,UAAM,aAAS,yBAAS,UAAK,WAAL,mBAAa,QAAQ,MAAM,oBAAoB;AACvE,UAAM,UAAU,MAAM,IAAI,sCAA4C,EAAE,QAAQ,wEAA2B,CAAC,EACzG,OAAO,MAAM,oBAAoB,MAAM,CAAC,EACxC,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADjBO,IAAM,6BAA6B,UACxC;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,wEAA0B,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EAC1E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,4BAA4B,OAAO,MAAM;AAC9D,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["import_etherscan_ethereum_gas_payload_plugin"]}
|
package/dist/node/index.js
CHANGED
|
@@ -21,7 +21,8 @@ var EthereumGasEtherscanWitnessConfigSchema = "network.xyo.blockchain.ethereum.g
|
|
|
21
21
|
|
|
22
22
|
// src/Witness.ts
|
|
23
23
|
var EthereumGasEtherscanWitness = class extends AbstractWitness {
|
|
24
|
-
static configSchemas = [EthereumGasEtherscanWitnessConfigSchema];
|
|
24
|
+
static configSchemas = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema];
|
|
25
|
+
static defaultConfigSchema = EthereumGasEtherscanWitnessConfigSchema;
|
|
25
26
|
async observeHandler() {
|
|
26
27
|
var _a;
|
|
27
28
|
const apiKey = assertEx((_a = this.config) == null ? void 0 : _a.apiKey, () => "apiKey is required");
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEtherscanWitness } from './Witness'\n\nexport const EthereumGasEtherscanPlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasEtherscanWitness>(\n { required: { [EthereumGasEtherscanSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await EthereumGasEtherscanWitness.create(params)\n return result as EthereumGasEtherscanWitness\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherscanWitnessConfig } from './Config'\nimport { getGasFromEtherscan } from './lib'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema'\n\nexport class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {\n static override configSchemas = [EthereumGasEtherscanWitnessConfigSchema]\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/axios'\nimport { EthereumGasEtherscanResponse } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\n\nexport const getGasFromEtherscan = async (apiKey: string): Promise<EthereumGasEtherscanResponse> => {\n const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`\n return (await axios.get<EthereumGasEtherscanResponse>(url)).data\n}\n","export type EthereumGasEtherscanWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\nexport const EthereumGasEtherscanWitnessConfigSchema: EthereumGasEtherscanWitnessConfigSchema =\n 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\n"],"mappings":";AAAA,SAAS,8BAAAA,mCAAkC;AAC3C,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAsC,kCAAkC;AAExE,SAAS,sBAAsB;;;ACJ/B,SAAS,aAAa;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,MAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACX;;;AFUK,IAAM,8BAAN,cAA0C,gBAAmF;AAAA,EAClI,OAAgB,
|
|
1
|
+
{"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEtherscanWitness } from './Witness'\n\nexport const EthereumGasEtherscanPlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasEtherscanWitness>(\n { required: { [EthereumGasEtherscanSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await EthereumGasEtherscanWitness.create(params)\n return result as EthereumGasEtherscanWitness\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { EthereumGasEtherscanWitnessConfig } from './Config'\nimport { getGasFromEtherscan } from './lib'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema'\n\nexport class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {\n static override configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema]\n static override defaultConfigSchema: Schema = EthereumGasEtherscanWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = await new PayloadBuilder<EthereumGasEtherscanPayload>({ schema: EthereumGasEtherscanSchema })\n .fields(await getGasFromEtherscan(apiKey))\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/axios'\nimport { EthereumGasEtherscanResponse } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\n\nexport const getGasFromEtherscan = async (apiKey: string): Promise<EthereumGasEtherscanResponse> => {\n const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`\n return (await axios.get<EthereumGasEtherscanResponse>(url)).data\n}\n","export type EthereumGasEtherscanWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\nexport const EthereumGasEtherscanWitnessConfigSchema: EthereumGasEtherscanWitnessConfigSchema =\n 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config'\n"],"mappings":";AAAA,SAAS,8BAAAA,mCAAkC;AAC3C,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAsC,kCAAkC;AAExE,SAAS,sBAAsB;;;ACJ/B,SAAS,aAAa;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,MAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACX;;;AFUK,IAAM,8BAAN,cAA0C,gBAAmF;AAAA,EAClI,OAAgB,gBAA0B,CAAC,GAAG,MAAM,eAAe,uCAAuC;AAAA,EAC1G,OAAgB,sBAA8B;AAAA,EAE9C,MAAyB,iBAAqC;AAhBhE;AAiBI,UAAM,SAAS,UAAS,UAAK,WAAL,mBAAa,QAAQ,MAAM,oBAAoB;AACvE,UAAM,UAAU,MAAM,IAAI,eAA4C,EAAE,QAAQ,2BAA2B,CAAC,EACzG,OAAO,MAAM,oBAAoB,MAAM,CAAC,EACxC,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADjBO,IAAM,6BAA6B,MACxC;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,2BAA0B,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EAC1E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,4BAA4B,OAAO,MAAM;AAC9D,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["EthereumGasEtherscanSchema","EthereumGasEtherscanSchema"]}
|
package/package.json
CHANGED
|
@@ -10,21 +10,21 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/plugins/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xylabs/assert": "^3.1.
|
|
14
|
-
"@xylabs/axios": "^3.1.
|
|
15
|
-
"@xyo-network/abstract-witness": "^2.
|
|
16
|
-
"@xyo-network/etherscan-ethereum-gas-payload-plugin": "~2.
|
|
17
|
-
"@xyo-network/module-model": "^2.
|
|
18
|
-
"@xyo-network/payload-builder": "^2.
|
|
19
|
-
"@xyo-network/payload-model": "^2.
|
|
20
|
-
"@xyo-network/payloadset-plugin": "^2.
|
|
21
|
-
"@xyo-network/witness-model": "^2.
|
|
13
|
+
"@xylabs/assert": "^3.1.10",
|
|
14
|
+
"@xylabs/axios": "^3.1.10",
|
|
15
|
+
"@xyo-network/abstract-witness": "^2.98.3",
|
|
16
|
+
"@xyo-network/etherscan-ethereum-gas-payload-plugin": "~2.93.1",
|
|
17
|
+
"@xyo-network/module-model": "^2.98.3",
|
|
18
|
+
"@xyo-network/payload-builder": "^2.98.3",
|
|
19
|
+
"@xyo-network/payload-model": "^2.98.3",
|
|
20
|
+
"@xyo-network/payloadset-plugin": "^2.98.3",
|
|
21
|
+
"@xyo-network/witness-model": "^2.98.3"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@xylabs/jest-helpers": "^3.1.
|
|
25
|
-
"@xylabs/ts-scripts-yarn3": "^3.9.
|
|
26
|
-
"@xylabs/tsconfig": "^3.9.
|
|
27
|
-
"@xyo-network/payload-wrapper": "^2.
|
|
24
|
+
"@xylabs/jest-helpers": "^3.1.10",
|
|
25
|
+
"@xylabs/ts-scripts-yarn3": "^3.9.1",
|
|
26
|
+
"@xylabs/tsconfig": "^3.9.1",
|
|
27
|
+
"@xyo-network/payload-wrapper": "^2.98.3",
|
|
28
28
|
"jest": "^29.7.0",
|
|
29
29
|
"typescript": "^5.4.5"
|
|
30
30
|
},
|
|
@@ -67,6 +67,6 @@
|
|
|
67
67
|
"url": "https://github.com/XYOracleNetwork/plugins.git"
|
|
68
68
|
},
|
|
69
69
|
"sideEffects": false,
|
|
70
|
-
"version": "2.
|
|
70
|
+
"version": "2.93.1",
|
|
71
71
|
"type": "module"
|
|
72
72
|
}
|
package/src/Witness.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { AbstractWitness } from '@xyo-network/abstract-witness'
|
|
|
3
3
|
import { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'
|
|
4
4
|
import { AnyConfigSchema } from '@xyo-network/module-model'
|
|
5
5
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
6
|
-
import { Payload } from '@xyo-network/payload-model'
|
|
6
|
+
import { Payload, Schema } from '@xyo-network/payload-model'
|
|
7
7
|
import { WitnessParams } from '@xyo-network/witness-model'
|
|
8
8
|
|
|
9
9
|
import { EthereumGasEtherscanWitnessConfig } from './Config'
|
|
@@ -11,7 +11,8 @@ import { getGasFromEtherscan } from './lib'
|
|
|
11
11
|
import { EthereumGasEtherscanWitnessConfigSchema } from './Schema'
|
|
12
12
|
|
|
13
13
|
export class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {
|
|
14
|
-
static override configSchemas = [EthereumGasEtherscanWitnessConfigSchema]
|
|
14
|
+
static override configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema]
|
|
15
|
+
static override defaultConfigSchema: Schema = EthereumGasEtherscanWitnessConfigSchema
|
|
15
16
|
|
|
16
17
|
protected override async observeHandler(): Promise<Payload[]> {
|
|
17
18
|
const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')
|