@xyo-network/etherscan-ethereum-gas-plugin 3.0.2 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +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, 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.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 { 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,0CACT;;;AFUG,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;;;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"]}
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"]}
package/package.json CHANGED
@@ -7,24 +7,24 @@
7
7
  },
8
8
  "bugs": {
9
9
  "email": "support@xyo.network",
10
- "url": "https://github.com/XYOracleNetwork/plugins/issues"
10
+ "url": "git+https://github.com/XYOracleNetwork/plugins/issues"
11
11
  },
12
12
  "dependencies": {
13
- "@xylabs/assert": "^4.0.1",
14
- "@xylabs/axios": "^4.0.1",
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"
13
+ "@xylabs/assert": "^4.0.2",
14
+ "@xylabs/axios": "^4.0.2",
15
+ "@xyo-network/abstract-witness": "^3.0.3",
16
+ "@xyo-network/etherscan-ethereum-gas-payload-plugin": "^3.0.3",
17
+ "@xyo-network/module-model": "^3.0.3",
18
+ "@xyo-network/payload-builder": "^3.0.3",
19
+ "@xyo-network/payload-model": "^3.0.3",
20
+ "@xyo-network/payloadset-plugin": "^3.0.3",
21
+ "@xyo-network/witness-model": "^3.0.3"
22
22
  },
23
23
  "devDependencies": {
24
- "@xylabs/jest-helpers": "^4.0.1",
25
- "@xylabs/ts-scripts-yarn3": "^4.0.0-rc.15",
26
- "@xylabs/tsconfig": "^4.0.0-rc.15",
27
- "@xyo-network/payload-wrapper": "^3.0.2",
24
+ "@xylabs/jest-helpers": "^4.0.2",
25
+ "@xylabs/ts-scripts-yarn3": "^4.0.0-rc.20",
26
+ "@xylabs/tsconfig": "^4.0.0-rc.20",
27
+ "@xyo-network/payload-wrapper": "^3.0.3",
28
28
  "jest": "^29.7.0",
29
29
  "typescript": "^5.5.4"
30
30
  },
@@ -45,9 +45,9 @@
45
45
  },
46
46
  "repository": {
47
47
  "type": "git",
48
- "url": "https://github.com/XYOracleNetwork/plugins.git"
48
+ "url": "git+https://github.com/XYOracleNetwork/plugins.git"
49
49
  },
50
50
  "sideEffects": false,
51
- "version": "3.0.2",
51
+ "version": "3.0.3",
52
52
  "type": "module"
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, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'
4
- import { AnyConfigSchema } from '@xyo-network/module-model'
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,4 +1,4 @@
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: {},