@xyo-network/etherscan-ethereum-gas-plugin 3.0.2 → 3.0.4
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/neutral/Config.d.ts +7 -0
- package/dist/neutral/Config.d.ts.map +1 -0
- package/dist/neutral/Plugin.d.ts +3 -0
- package/dist/neutral/Plugin.d.ts.map +1 -0
- package/dist/neutral/Schema.d.ts +3 -0
- package/dist/neutral/Schema.d.ts.map +1 -0
- package/dist/neutral/Witness.d.ts +11 -0
- package/dist/neutral/Witness.d.ts.map +1 -0
- package/dist/neutral/index.d.ts +5 -23
- package/dist/neutral/index.d.ts.map +1 -0
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/lib/getGasFromEtherscan.d.ts +3 -0
- package/dist/neutral/lib/getGasFromEtherscan.d.ts.map +1 -0
- package/dist/neutral/lib/index.d.ts +2 -0
- package/dist/neutral/lib/index.d.ts.map +1 -0
- package/package.json +36 -36
- package/src/Config.ts +2 -2
- package/src/Witness.ts +6 -5
- package/src/lib/getGasFromEtherscan.ts +1 -1
- package/xy.config.ts +2 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { WitnessConfig } from '@xyo-network/witness-model';
|
|
2
|
+
import type { EthereumGasEtherscanWitnessConfigSchema } from './Schema.ts';
|
|
3
|
+
export type EthereumGasEtherscanWitnessConfig = WitnessConfig<{
|
|
4
|
+
apiKey: string;
|
|
5
|
+
schema: EthereumGasEtherscanWitnessConfigSchema;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=Config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE/D,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,aAAa,CAAA;AAE1E,MAAM,MAAM,iCAAiC,GAAG,aAAa,CAAC;IAC5D,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,uCAAuC,CAAA;CAChD,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAA;AAE1D,eAAO,MAAM,0BAA0B,qGASpC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../src/Schema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uCAAuC,GAAG,8DAA8D,CAAA;AACpH,eAAO,MAAM,uCAAuC,EAAE,uCACY,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
2
|
+
import type { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
|
+
import type { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
|
+
import type { WitnessParams } from '@xyo-network/witness-model';
|
|
5
|
+
import type { EthereumGasEtherscanWitnessConfig } from './Config.ts';
|
|
6
|
+
export declare class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {
|
|
7
|
+
static readonly configSchemas: Schema[];
|
|
8
|
+
static readonly defaultConfigSchema: Schema;
|
|
9
|
+
protected observeHandler(): Promise<Payload[]>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=Witness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAG/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAEhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE/D,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,aAAa,CAAA;AAIpE,qBAAa,2BAA4B,SAAQ,eAAe,CAAC,aAAa,CAAC,eAAe,CAAC,iCAAiC,CAAC,CAAC,CAAC;IACjI,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAoE;IACpH,gBAAyB,mBAAmB,EAAE,MAAM,CAA0C;cAErE,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAO9D"}
|
package/dist/neutral/index.d.ts
CHANGED
|
@@ -1,23 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
type EthereumGasEtherscanWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.etherscan.witness.config';
|
|
8
|
-
declare const EthereumGasEtherscanWitnessConfigSchema: EthereumGasEtherscanWitnessConfigSchema;
|
|
9
|
-
|
|
10
|
-
type EthereumGasEtherscanWitnessConfig = WitnessConfig<{
|
|
11
|
-
apiKey: string;
|
|
12
|
-
schema: EthereumGasEtherscanWitnessConfigSchema;
|
|
13
|
-
}>;
|
|
14
|
-
|
|
15
|
-
declare class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {
|
|
16
|
-
static readonly configSchemas: Schema[];
|
|
17
|
-
static readonly defaultConfigSchema: Schema;
|
|
18
|
-
protected observeHandler(): Promise<Payload[]>;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
declare const EthereumGasEtherscanPlugin: () => _xyo_network_payloadset_plugin.PayloadSetWitnessPlugin<EthereumGasEtherscanWitness>;
|
|
22
|
-
|
|
23
|
-
export { EthereumGasEtherscanPlugin, EthereumGasEtherscanWitness, type EthereumGasEtherscanWitnessConfig, EthereumGasEtherscanWitnessConfigSchema, EthereumGasEtherscanPlugin as default };
|
|
1
|
+
export * from './Config.ts';
|
|
2
|
+
export { EthereumGasEtherscanPlugin as default, EthereumGasEtherscanPlugin } from './Plugin.ts';
|
|
3
|
+
export * from './Schema.ts';
|
|
4
|
+
export * from './Witness.ts';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAE3B,OAAO,EAAE,0BAA0B,IAAI,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAC/F,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEtherscanWitness } from './Witness.ts'\n\nexport const EthereumGasEtherscanPlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasEtherscanWitness>(\n { required: { [EthereumGasEtherscanSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await EthereumGasEtherscanWitness.create(params)\n return result as EthereumGasEtherscanWitness\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasEtherscanPayload
|
|
1
|
+
{"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEtherscan.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEtherscanWitness } from './Witness.ts'\n\nexport const EthereumGasEtherscanPlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasEtherscanWitness>(\n { required: { [EthereumGasEtherscanSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await EthereumGasEtherscanWitness.create(params)\n return result as EthereumGasEtherscanWitness\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport type { EthereumGasEtherscanPayload } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport type { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport type { WitnessParams } from '@xyo-network/witness-model'\n\nimport type { EthereumGasEtherscanWitnessConfig } from './Config.ts'\nimport { getGasFromEtherscan } from './lib/index.ts'\nimport { EthereumGasEtherscanWitnessConfigSchema } from './Schema.ts'\n\nexport class EthereumGasEtherscanWitness extends AbstractWitness<WitnessParams<AnyConfigSchema<EthereumGasEtherscanWitnessConfig>>> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasEtherscanWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasEtherscanWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const apiKey = assertEx(this.config?.apiKey, () => 'apiKey is required')\n const payload = 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 type { EthereumGasEtherscanResponse } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\n\nexport const getGasFromEtherscan = async (apiKey: string): Promise<EthereumGasEtherscanResponse> => {\n const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`\n return (await 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;AAEhC,SAAS,kCAAkC;AAE3C,SAAS,sBAAsB;;;ACL/B,SAAS,aAAa;AAGf,IAAM,sBAAsB,OAAO,WAA0D;AAClG,QAAM,MAAM,0EAA0E,MAAM;AAC5F,UAAQ,MAAM,MAAM,IAAkC,GAAG,GAAG;AAC9D;;;ACLO,IAAM,0CACT;;;AFWG,IAAM,8BAAN,cAA0C,gBAAmF;AAAA,EAClI,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,uCAAuC;AAAA,EACnH,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,iBAAqC;AAC5D,UAAM,SAAS,SAAS,KAAK,QAAQ,QAAQ,MAAM,oBAAoB;AACvE,UAAM,UAAU,MAAM,IAAI,eAA4C,EAAE,QAAQ,2BAA2B,CAAC,EACzG,OAAO,MAAM,oBAAoB,MAAM,CAAC,EACxC,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADlBO,IAAM,6BAA6B,MACxC;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,2BAA0B,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EAC1E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,4BAA4B,OAAO,MAAM;AAC9D,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["EthereumGasEtherscanSchema","EthereumGasEtherscanSchema"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getGasFromEtherscan.d.ts","sourceRoot":"","sources":["../../../src/lib/getGasFromEtherscan.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAEtG,eAAO,MAAM,mBAAmB,WAAkB,MAAM,KAAG,OAAO,CAAC,4BAA4B,CAG9F,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,35 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/etherscan-ethereum-gas-plugin",
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"url": "https://xyo.network"
|
|
7
|
-
},
|
|
3
|
+
"version": "3.0.4",
|
|
4
|
+
"description": "Typescript/Javascript Plugins for XYO Platform",
|
|
5
|
+
"homepage": "https://xyo.network",
|
|
8
6
|
"bugs": {
|
|
9
|
-
"
|
|
10
|
-
"
|
|
7
|
+
"url": "git+https://github.com/XYOracleNetwork/plugins/issues",
|
|
8
|
+
"email": "support@xyo.network"
|
|
11
9
|
},
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"@xyo-network/abstract-witness": "^3.0.2",
|
|
16
|
-
"@xyo-network/etherscan-ethereum-gas-payload-plugin": "^3.0.2",
|
|
17
|
-
"@xyo-network/module-model": "^3.0.2",
|
|
18
|
-
"@xyo-network/payload-builder": "^3.0.2",
|
|
19
|
-
"@xyo-network/payload-model": "^3.0.2",
|
|
20
|
-
"@xyo-network/payloadset-plugin": "^3.0.2",
|
|
21
|
-
"@xyo-network/witness-model": "^3.0.2"
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/XYOracleNetwork/plugins.git"
|
|
22
13
|
},
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"jest": "^29.7.0",
|
|
29
|
-
"typescript": "^5.5.4"
|
|
14
|
+
"license": "LGPL-3.0-only",
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "XYO Development Team",
|
|
17
|
+
"email": "support@xyo.network",
|
|
18
|
+
"url": "https://xyo.network"
|
|
30
19
|
},
|
|
31
|
-
"
|
|
32
|
-
"
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"type": "module",
|
|
33
22
|
"exports": {
|
|
34
23
|
".": {
|
|
35
24
|
"types": "./dist/neutral/index.d.ts",
|
|
@@ -38,16 +27,27 @@
|
|
|
38
27
|
"./package.json": "./package.json"
|
|
39
28
|
},
|
|
40
29
|
"module": "dist/neutral/index.mjs",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
"
|
|
30
|
+
"types": "dist/neutral/index.d.ts",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@xylabs/assert": "^4.0.4",
|
|
33
|
+
"@xylabs/axios": "^4.0.4",
|
|
34
|
+
"@xyo-network/abstract-witness": "^3.0.10",
|
|
35
|
+
"@xyo-network/etherscan-ethereum-gas-payload-plugin": "^3.0.4",
|
|
36
|
+
"@xyo-network/module-model": "^3.0.10",
|
|
37
|
+
"@xyo-network/payload-builder": "^3.0.10",
|
|
38
|
+
"@xyo-network/payload-model": "^3.0.10",
|
|
39
|
+
"@xyo-network/payloadset-plugin": "^3.0.10",
|
|
40
|
+
"@xyo-network/witness-model": "^3.0.10"
|
|
45
41
|
},
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@xylabs/jest-helpers": "^4.0.4",
|
|
44
|
+
"@xylabs/ts-scripts-yarn3": "^4.0.7",
|
|
45
|
+
"@xylabs/tsconfig": "^4.0.7",
|
|
46
|
+
"@xyo-network/payload-wrapper": "^3.0.10",
|
|
47
|
+
"jest": "^29.7.0",
|
|
48
|
+
"typescript": "^5.5.4"
|
|
49
49
|
},
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
}
|
|
53
53
|
}
|
package/src/Config.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { WitnessConfig } from '@xyo-network/witness-model'
|
|
1
|
+
import type { WitnessConfig } from '@xyo-network/witness-model'
|
|
2
2
|
|
|
3
|
-
import { EthereumGasEtherscanWitnessConfigSchema } from './Schema.ts'
|
|
3
|
+
import type { EthereumGasEtherscanWitnessConfigSchema } from './Schema.ts'
|
|
4
4
|
|
|
5
5
|
export type EthereumGasEtherscanWitnessConfig = WitnessConfig<{
|
|
6
6
|
apiKey: string
|
package/src/Witness.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { assertEx } from '@xylabs/assert'
|
|
2
2
|
import { AbstractWitness } from '@xyo-network/abstract-witness'
|
|
3
|
-
import { EthereumGasEtherscanPayload
|
|
4
|
-
import {
|
|
3
|
+
import type { EthereumGasEtherscanPayload } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'
|
|
4
|
+
import { EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'
|
|
5
|
+
import type { AnyConfigSchema } from '@xyo-network/module-model'
|
|
5
6
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
6
|
-
import { Payload, Schema } from '@xyo-network/payload-model'
|
|
7
|
-
import { WitnessParams } from '@xyo-network/witness-model'
|
|
7
|
+
import type { Payload, Schema } from '@xyo-network/payload-model'
|
|
8
|
+
import type { WitnessParams } from '@xyo-network/witness-model'
|
|
8
9
|
|
|
9
|
-
import { EthereumGasEtherscanWitnessConfig } from './Config.ts'
|
|
10
|
+
import type { EthereumGasEtherscanWitnessConfig } from './Config.ts'
|
|
10
11
|
import { getGasFromEtherscan } from './lib/index.ts'
|
|
11
12
|
import { EthereumGasEtherscanWitnessConfigSchema } from './Schema.ts'
|
|
12
13
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { axios } from '@xylabs/axios'
|
|
2
|
-
import { EthereumGasEtherscanResponse } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'
|
|
2
|
+
import type { EthereumGasEtherscanResponse } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'
|
|
3
3
|
|
|
4
4
|
export const getGasFromEtherscan = async (apiKey: string): Promise<EthereumGasEtherscanResponse> => {
|
|
5
5
|
const url = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${apiKey}`
|
package/xy.config.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
|
|
1
|
+
import type { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
|
|
2
2
|
const config: XyTsupConfig = {
|
|
3
3
|
compile: {
|
|
4
4
|
browser: {},
|
|
5
5
|
node: {},
|
|
6
|
-
neutral: {
|
|
7
|
-
src: true,
|
|
8
|
-
},
|
|
6
|
+
neutral: { src: true },
|
|
9
7
|
},
|
|
10
8
|
}
|
|
11
9
|
|