@xyo-network/ethers-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.
- package/dist/neutral/index.d.ts +5 -5
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +16 -16
- package/src/Config.ts +2 -2
- package/src/Witness.ts +7 -6
- package/src/lib/getGasFromEthers.ts +2 -2
- package/xy.config.ts +1 -1
package/dist/neutral/index.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ import * as _xyo_network_module_model from '@xyo-network/module-model';
|
|
|
6
6
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
7
7
|
import * as _xyo_network_payload_model from '@xyo-network/payload-model';
|
|
8
8
|
import { Schema, Payload } from '@xyo-network/payload-model';
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
9
|
+
import * as _store__xyo_network_account_model_virtual_e036bb1dc5_package from '.store/@xyo-network-account-model-virtual-e036bb1dc5/package';
|
|
10
|
+
import * as _store__xylabs_object_npm_4_0_2_c4743812cc_package from '.store/@xylabs-object-npm-4.0.2-c4743812cc/package';
|
|
11
11
|
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
12
12
|
|
|
13
13
|
type EthereumGasEthersWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.ethers.witness.config';
|
|
@@ -28,10 +28,10 @@ declare class EthereumGasEthersWitness<TParams extends EthereumGasEthersWitnessP
|
|
|
28
28
|
protected observeHandler(): Promise<Payload[]>;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
declare const EthereumGasEthersPlugin: () => _xyo_network_payloadset_plugin.PayloadSetWitnessPlugin<EthereumGasEthersWitness<
|
|
32
|
-
account?:
|
|
31
|
+
declare const EthereumGasEthersPlugin: () => _xyo_network_payloadset_plugin.PayloadSetWitnessPlugin<EthereumGasEthersWitness<_store__xylabs_object_npm_4_0_2_c4743812cc_package.BaseParamsFields & {
|
|
32
|
+
account?: _store__xyo_network_account_model_virtual_e036bb1dc5_package.AccountInstance | "random";
|
|
33
33
|
addToResolvers?: boolean;
|
|
34
|
-
additionalSigners?:
|
|
34
|
+
additionalSigners?: _store__xyo_network_account_model_virtual_e036bb1dc5_package.AccountInstance[];
|
|
35
35
|
allowNameResolution?: boolean;
|
|
36
36
|
config: _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & Omit<_xyo_network_module_model.ArchivingModuleConfig & _xyo_network_module_model.ModuleConfigFields & _xyo_network_payload_model.SchemaFields & _xyo_network_payload_model.PayloadFields & Omit<_xyo_network_module_model.ArchivingModuleConfig & _xyo_network_module_model.ModuleConfigFields & {
|
|
37
37
|
schema: "network.xyo.blockchain.ethereum.gas.ethers.witness.config";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEthers.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEthersSchema } from '@xyo-network/ethers-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEthersWitness } from './Witness.ts'\n\nexport const EthereumGasEthersPlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasEthersWitness>(\n { required: { [EthereumGasEthersSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return await EthereumGasEthersWitness.create(params)\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasEthersPayload
|
|
1
|
+
{"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEthers.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasEthersSchema } from '@xyo-network/ethers-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasEthersWitness } from './Witness.ts'\n\nexport const EthereumGasEthersPlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasEthersWitness>(\n { required: { [EthereumGasEthersSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return await EthereumGasEthersWitness.create(params)\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport type { EthereumGasEthersPayload } from '@xyo-network/ethers-ethereum-gas-payload-plugin'\nimport { EthereumGasEthersSchema } from '@xyo-network/ethers-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'\nimport type { Provider } from 'ethers'\n\nimport type { EthereumGasEthersWitnessConfig } from './Config.ts'\nimport { getGasFromEthers } from './lib/index.ts'\nimport { EthereumGasEthersWitnessConfigSchema } from './Schema.ts'\n\nexport type EthereumGasEthersWitnessParams = WitnessParams<\n AnyConfigSchema<EthereumGasEthersWitnessConfig>,\n {\n provider?: Provider\n }\n>\n\nexport class EthereumGasEthersWitness<\n TParams extends EthereumGasEthersWitnessParams = EthereumGasEthersWitnessParams,\n> extends AbstractWitness<TParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasEthersWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasEthersWitnessConfigSchema\n\n private _provider?: Provider\n\n protected get provider() {\n this._provider = this._provider ?? this.params?.provider\n return this._provider\n }\n\n protected override async observeHandler(): Promise<Payload[]> {\n const payload = await new PayloadBuilder<EthereumGasEthersPayload>({ schema: EthereumGasEthersSchema })\n .fields(await getGasFromEthers(assertEx(this.provider, () => 'Provider Required')))\n .build()\n return [payload]\n }\n}\n","import type { EthereumGasEthersResponse } from '@xyo-network/ethers-ethereum-gas-payload-plugin'\nimport type { Provider } from 'ethers'\n\nconst formatFeeDataValue = (value: bigint | null) => {\n return value ? Number(value) : null\n}\n\nexport const getGasFromEthers = async (provider: Provider): Promise<EthereumGasEthersResponse> => {\n // https://docs.ethers.io/v5/api/providers/provider/#Provider-getFeeData\n const feeData = await provider.getFeeData()\n const formattedFeeData: EthereumGasEthersResponse = {\n gasPrice: formatFeeDataValue(feeData.gasPrice),\n maxFeePerGas: formatFeeDataValue(feeData.maxFeePerGas),\n maxPriorityFeePerGas: formatFeeDataValue(feeData.maxPriorityFeePerGas),\n timestamp: Date.now(),\n }\n return formattedFeeData\n}\n","export type EthereumGasEthersWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.ethers.witness.config'\nexport const EthereumGasEthersWitnessConfigSchema: EthereumGasEthersWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.ethers.witness.config'\n"],"mappings":";AAAA,SAAS,2BAAAA,gCAA+B;AACxC,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAEhC,SAAS,+BAA+B;AAExC,SAAS,sBAAsB;;;ACF/B,IAAM,qBAAqB,CAAC,UAAyB;AACnD,SAAO,QAAQ,OAAO,KAAK,IAAI;AACjC;AAEO,IAAM,mBAAmB,OAAO,aAA2D;AAEhG,QAAM,UAAU,MAAM,SAAS,WAAW;AAC1C,QAAM,mBAA8C;AAAA,IAClD,UAAU,mBAAmB,QAAQ,QAAQ;AAAA,IAC7C,cAAc,mBAAmB,QAAQ,YAAY;AAAA,IACrD,sBAAsB,mBAAmB,QAAQ,oBAAoB;AAAA,IACrE,WAAW,KAAK,IAAI;AAAA,EACtB;AACA,SAAO;AACT;;;AChBO,IAAM,uCAA6E;;;AFoBnF,IAAM,2BAAN,cAEG,gBAAyB;AAAA,EACjC,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,oCAAoC;AAAA,EAChH,OAAyB,sBAA8B;AAAA,EAE/C;AAAA,EAER,IAAc,WAAW;AACvB,SAAK,YAAY,KAAK,aAAa,KAAK,QAAQ;AAChD,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAyB,iBAAqC;AAC5D,UAAM,UAAU,MAAM,IAAI,eAAyC,EAAE,QAAQ,wBAAwB,CAAC,EACnG,OAAO,MAAM,iBAAiB,SAAS,KAAK,UAAU,MAAM,mBAAmB,CAAC,CAAC,EACjF,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADlCO,IAAM,0BAA0B,MACrC;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,wBAAuB,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EACvE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAO,MAAM,yBAAyB,OAAO,MAAM;AAAA,IACrD;AAAA,EACF;AACF;","names":["EthereumGasEthersSchema","EthereumGasEthersSchema"]}
|
package/package.json
CHANGED
|
@@ -7,25 +7,25 @@
|
|
|
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.
|
|
14
|
-
"@xyo-network/abstract-witness": "^3.0.
|
|
15
|
-
"@xyo-network/ethers-ethereum-gas-payload-plugin": "^3.0.
|
|
16
|
-
"@xyo-network/module-model": "^3.0.
|
|
17
|
-
"@xyo-network/payload-builder": "^3.0.
|
|
18
|
-
"@xyo-network/payload-model": "^3.0.
|
|
19
|
-
"@xyo-network/payloadset-plugin": "^3.0.
|
|
20
|
-
"@xyo-network/witness-model": "^3.0.
|
|
13
|
+
"@xylabs/assert": "^4.0.2",
|
|
14
|
+
"@xyo-network/abstract-witness": "^3.0.3",
|
|
15
|
+
"@xyo-network/ethers-ethereum-gas-payload-plugin": "^3.0.3",
|
|
16
|
+
"@xyo-network/module-model": "^3.0.3",
|
|
17
|
+
"@xyo-network/payload-builder": "^3.0.3",
|
|
18
|
+
"@xyo-network/payload-model": "^3.0.3",
|
|
19
|
+
"@xyo-network/payloadset-plugin": "^3.0.3",
|
|
20
|
+
"@xyo-network/witness-model": "^3.0.3",
|
|
21
21
|
"ethers": "^6.13.2"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@xylabs/jest-helpers": "^4.0.
|
|
25
|
-
"@xylabs/ts-scripts-yarn3": "^4.0.0-rc.
|
|
26
|
-
"@xylabs/tsconfig": "^4.0.0-rc.
|
|
27
|
-
"@xyo-network/payload-wrapper": "^3.0.
|
|
28
|
-
"@xyo-network/witness-blockchain-abstract": "^3.0.
|
|
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
|
+
"@xyo-network/witness-blockchain-abstract": "^3.0.3",
|
|
29
29
|
"jest": "^29.7.0",
|
|
30
30
|
"typescript": "^5.5.4"
|
|
31
31
|
},
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
},
|
|
47
47
|
"repository": {
|
|
48
48
|
"type": "git",
|
|
49
|
-
"url": "https://github.com/XYOracleNetwork/plugins.git"
|
|
49
|
+
"url": "git+https://github.com/XYOracleNetwork/plugins.git"
|
|
50
50
|
},
|
|
51
51
|
"sideEffects": false,
|
|
52
|
-
"version": "3.0.
|
|
52
|
+
"version": "3.0.3",
|
|
53
53
|
"type": "module"
|
|
54
54
|
}
|
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 { EthereumGasEthersWitnessConfigSchema } from './Schema.ts'
|
|
3
|
+
import type { EthereumGasEthersWitnessConfigSchema } from './Schema.ts'
|
|
4
4
|
|
|
5
5
|
export type EthereumGasEthersWitnessConfig = WitnessConfig<{
|
|
6
6
|
schema: EthereumGasEthersWitnessConfigSchema
|
package/src/Witness.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { assertEx } from '@xylabs/assert'
|
|
2
2
|
import { AbstractWitness } from '@xyo-network/abstract-witness'
|
|
3
|
-
import { EthereumGasEthersPayload
|
|
4
|
-
import {
|
|
3
|
+
import type { EthereumGasEthersPayload } from '@xyo-network/ethers-ethereum-gas-payload-plugin'
|
|
4
|
+
import { EthereumGasEthersSchema } from '@xyo-network/ethers-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'
|
|
8
|
-
import { Provider } from 'ethers'
|
|
7
|
+
import type { Payload, Schema } from '@xyo-network/payload-model'
|
|
8
|
+
import type { WitnessParams } from '@xyo-network/witness-model'
|
|
9
|
+
import type { Provider } from 'ethers'
|
|
9
10
|
|
|
10
|
-
import { EthereumGasEthersWitnessConfig } from './Config.ts'
|
|
11
|
+
import type { EthereumGasEthersWitnessConfig } from './Config.ts'
|
|
11
12
|
import { getGasFromEthers } from './lib/index.ts'
|
|
12
13
|
import { EthereumGasEthersWitnessConfigSchema } from './Schema.ts'
|
|
13
14
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EthereumGasEthersResponse } from '@xyo-network/ethers-ethereum-gas-payload-plugin'
|
|
2
|
-
import { Provider } from 'ethers'
|
|
1
|
+
import type { EthereumGasEthersResponse } from '@xyo-network/ethers-ethereum-gas-payload-plugin'
|
|
2
|
+
import type { Provider } from 'ethers'
|
|
3
3
|
|
|
4
4
|
const formatFeeDataValue = (value: bigint | null) => {
|
|
5
5
|
return value ? Number(value) : null
|
package/xy.config.ts
CHANGED