@xyo-network/ethers-ethereum-gas-plugin 2.85.0 → 2.85.2
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/Plugin.d.cts +0 -2
- package/dist/browser/Plugin.d.cts.map +1 -1
- package/dist/browser/Plugin.d.mts +0 -2
- package/dist/browser/Plugin.d.mts.map +1 -1
- package/dist/browser/Plugin.d.ts +0 -2
- package/dist/browser/Plugin.d.ts.map +1 -1
- package/dist/browser/index.cjs +1 -4
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +1 -3
- package/dist/browser/index.d.cts.map +1 -1
- package/dist/browser/index.d.mts +1 -3
- package/dist/browser/index.d.mts.map +1 -1
- package/dist/browser/index.d.ts +1 -3
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +1 -4
- package/dist/browser/index.js.map +1 -1
- package/dist/node/Plugin.d.cts +0 -2
- package/dist/node/Plugin.d.cts.map +1 -1
- package/dist/node/Plugin.d.mts +0 -2
- package/dist/node/Plugin.d.mts.map +1 -1
- package/dist/node/Plugin.d.ts +0 -2
- package/dist/node/Plugin.d.ts.map +1 -1
- package/dist/node/index.cjs +1 -4
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +1 -3
- package/dist/node/index.d.cts.map +1 -1
- package/dist/node/index.d.mts +1 -3
- package/dist/node/index.d.mts.map +1 -1
- package/dist/node/index.d.ts +1 -3
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +1 -4
- package/dist/node/index.js.map +1 -1
- package/package.json +14 -14
- package/src/index.ts +1 -7
|
@@ -2,7 +2,6 @@ import { EthereumGasEthersWitness } from './Witness';
|
|
|
2
2
|
export declare const EthereumGasEthersPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<EthereumGasEthersWitness<import("@xyo-network/object").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random" | undefined;
|
|
4
4
|
config: import("@xyo-network/payload-model").SchemaFields & object & Omit<{
|
|
5
|
-
accountPath?: string | undefined;
|
|
6
5
|
readonly archivist?: string | undefined;
|
|
7
6
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
8
7
|
readonly name?: string | undefined;
|
|
@@ -19,7 +18,6 @@ export declare const EthereumGasEthersPlugin: () => import("@xyo-network/payload
|
|
|
19
18
|
readonly storeQueries?: boolean | undefined;
|
|
20
19
|
readonly timestamp?: boolean | undefined;
|
|
21
20
|
} & import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/payload-model").SchemaFields & object & {
|
|
22
|
-
accountPath?: string | undefined;
|
|
23
21
|
readonly archivist?: string | undefined;
|
|
24
22
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
25
23
|
readonly name?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
|
|
@@ -2,7 +2,6 @@ import { EthereumGasEthersWitness } from './Witness';
|
|
|
2
2
|
export declare const EthereumGasEthersPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<EthereumGasEthersWitness<import("@xyo-network/object").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random" | undefined;
|
|
4
4
|
config: import("@xyo-network/payload-model").SchemaFields & object & Omit<{
|
|
5
|
-
accountPath?: string | undefined;
|
|
6
5
|
readonly archivist?: string | undefined;
|
|
7
6
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
8
7
|
readonly name?: string | undefined;
|
|
@@ -19,7 +18,6 @@ export declare const EthereumGasEthersPlugin: () => import("@xyo-network/payload
|
|
|
19
18
|
readonly storeQueries?: boolean | undefined;
|
|
20
19
|
readonly timestamp?: boolean | undefined;
|
|
21
20
|
} & import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/payload-model").SchemaFields & object & {
|
|
22
|
-
accountPath?: string | undefined;
|
|
23
21
|
readonly archivist?: string | undefined;
|
|
24
22
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
25
23
|
readonly name?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
|
package/dist/browser/Plugin.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { EthereumGasEthersWitness } from './Witness';
|
|
|
2
2
|
export declare const EthereumGasEthersPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<EthereumGasEthersWitness<import("@xyo-network/object").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random" | undefined;
|
|
4
4
|
config: import("@xyo-network/payload-model").SchemaFields & object & Omit<{
|
|
5
|
-
accountPath?: string | undefined;
|
|
6
5
|
readonly archivist?: string | undefined;
|
|
7
6
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
8
7
|
readonly name?: string | undefined;
|
|
@@ -19,7 +18,6 @@ export declare const EthereumGasEthersPlugin: () => import("@xyo-network/payload
|
|
|
19
18
|
readonly storeQueries?: boolean | undefined;
|
|
20
19
|
readonly timestamp?: boolean | undefined;
|
|
21
20
|
} & import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/payload-model").SchemaFields & object & {
|
|
22
|
-
accountPath?: string | undefined;
|
|
23
21
|
readonly archivist?: string | undefined;
|
|
24
22
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
25
23
|
readonly name?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
|
package/dist/browser/index.cjs
CHANGED
|
@@ -23,7 +23,7 @@ __export(src_exports, {
|
|
|
23
23
|
EthereumGasEthersPlugin: () => EthereumGasEthersPlugin,
|
|
24
24
|
EthereumGasEthersWitness: () => EthereumGasEthersWitness,
|
|
25
25
|
EthereumGasEthersWitnessConfigSchema: () => EthereumGasEthersWitnessConfigSchema,
|
|
26
|
-
default: () =>
|
|
26
|
+
default: () => EthereumGasEthersPlugin
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(src_exports);
|
|
29
29
|
|
|
@@ -78,7 +78,4 @@ var EthereumGasEthersPlugin = () => (0, import_payloadset_plugin.createPayloadSe
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
);
|
|
81
|
-
|
|
82
|
-
// src/index.ts
|
|
83
|
-
var src_default = EthereumGasEthersPlugin;
|
|
84
81
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEthers.ts","../../src/Schema.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEthers.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config'\nexport { EthereumGasEthersPlugin as default, EthereumGasEthersPlugin } from './Plugin'\nexport * from './Schema'\nexport * from './Witness'\n","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'\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, EthereumGasEthersSchema } from '@xyo-network/ethers-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'\nimport { Provider } from 'ethers'\n\nimport { EthereumGasEthersWitnessConfig } from './Config'\nimport { getGasFromEthers } from './lib'\nimport { EthereumGasEthersWitnessConfigSchema } from './Schema'\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 configSchemas = [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 { EthereumGasEthersResponse } from '@xyo-network/ethers-ethereum-gas-payload-plugin'\nimport { 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 }\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,6CAAwC;AACxC,2BAAiC;AACjC,+BAA8C;;;ACF9C,oBAAyB;AACzB,8BAAgC;AAChC,gDAAkE;AAElE,6BAA+B;;;ACD/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,EACvE;AACA,SAAO;AACT;;;ACfO,IAAM,uCAA6E;;;AFmBnF,IAAM,2BAAN,cAEG,wCAAyB;AAAA,EACjC,OAAgB,gBAAgB,CAAC,oCAAoC;AAAA,EAE7D;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,sCAAyC,EAAE,QAAQ,kEAAwB,CAAC,EACnG,OAAO,MAAM,qBAAiB,wBAAS,KAAK,UAAU,mBAAmB,CAAC,CAAC,EAC3E,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADhCO,IAAM,0BAA0B,UACrC;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,kEAAuB,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EACvE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAO,MAAM,yBAAyB,OAAO,MAAM;AAAA,IACrD;AAAA,EACF;AACF;","names":["import_ethers_ethereum_gas_payload_plugin"]}
|
package/dist/browser/index.d.cts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { EthereumGasEthersPlugin } from './Plugin';
|
|
2
1
|
export * from './Config';
|
|
2
|
+
export { EthereumGasEthersPlugin as default, EthereumGasEthersPlugin } from './Plugin';
|
|
3
3
|
export * from './Schema';
|
|
4
4
|
export * from './Witness';
|
|
5
|
-
export { EthereumGasEthersPlugin };
|
|
6
|
-
export default EthereumGasEthersPlugin;
|
|
7
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AACtF,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
|
package/dist/browser/index.d.mts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { EthereumGasEthersPlugin } from './Plugin';
|
|
2
1
|
export * from './Config';
|
|
2
|
+
export { EthereumGasEthersPlugin as default, EthereumGasEthersPlugin } from './Plugin';
|
|
3
3
|
export * from './Schema';
|
|
4
4
|
export * from './Witness';
|
|
5
|
-
export { EthereumGasEthersPlugin };
|
|
6
|
-
export default EthereumGasEthersPlugin;
|
|
7
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AACtF,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { EthereumGasEthersPlugin } from './Plugin';
|
|
2
1
|
export * from './Config';
|
|
2
|
+
export { EthereumGasEthersPlugin as default, EthereumGasEthersPlugin } from './Plugin';
|
|
3
3
|
export * from './Schema';
|
|
4
4
|
export * from './Witness';
|
|
5
|
-
export { EthereumGasEthersPlugin };
|
|
6
|
-
export default EthereumGasEthersPlugin;
|
|
7
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AACtF,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
|
package/dist/browser/index.js
CHANGED
|
@@ -49,13 +49,10 @@ var EthereumGasEthersPlugin = () => createPayloadSetWitnessPlugin(
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
|
-
|
|
53
|
-
// src/index.ts
|
|
54
|
-
var src_default = EthereumGasEthersPlugin;
|
|
55
52
|
export {
|
|
56
53
|
EthereumGasEthersPlugin,
|
|
57
54
|
EthereumGasEthersWitness,
|
|
58
55
|
EthereumGasEthersWitnessConfigSchema,
|
|
59
|
-
|
|
56
|
+
EthereumGasEthersPlugin as default
|
|
60
57
|
};
|
|
61
58
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEthers.ts","../../src/Schema.ts"
|
|
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'\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, EthereumGasEthersSchema } from '@xyo-network/ethers-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'\nimport { Provider } from 'ethers'\n\nimport { EthereumGasEthersWitnessConfig } from './Config'\nimport { getGasFromEthers } from './lib'\nimport { EthereumGasEthersWitnessConfigSchema } from './Schema'\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 configSchemas = [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 { EthereumGasEthersResponse } from '@xyo-network/ethers-ethereum-gas-payload-plugin'\nimport { 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 }\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;AAChC,SAAmC,+BAA+B;AAElE,SAAS,sBAAsB;;;ACD/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,EACvE;AACA,SAAO;AACT;;;ACfO,IAAM,uCAA6E;;;AFmBnF,IAAM,2BAAN,cAEG,gBAAyB;AAAA,EACjC,OAAgB,gBAAgB,CAAC,oCAAoC;AAAA,EAE7D;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,mBAAmB,CAAC,CAAC,EAC3E,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADhCO,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/dist/node/Plugin.d.cts
CHANGED
|
@@ -2,7 +2,6 @@ import { EthereumGasEthersWitness } from './Witness';
|
|
|
2
2
|
export declare const EthereumGasEthersPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<EthereumGasEthersWitness<import("@xyo-network/object").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random" | undefined;
|
|
4
4
|
config: import("@xyo-network/payload-model").SchemaFields & object & Omit<{
|
|
5
|
-
accountPath?: string | undefined;
|
|
6
5
|
readonly archivist?: string | undefined;
|
|
7
6
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
8
7
|
readonly name?: string | undefined;
|
|
@@ -19,7 +18,6 @@ export declare const EthereumGasEthersPlugin: () => import("@xyo-network/payload
|
|
|
19
18
|
readonly storeQueries?: boolean | undefined;
|
|
20
19
|
readonly timestamp?: boolean | undefined;
|
|
21
20
|
} & import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/payload-model").SchemaFields & object & {
|
|
22
|
-
accountPath?: string | undefined;
|
|
23
21
|
readonly archivist?: string | undefined;
|
|
24
22
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
25
23
|
readonly name?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
|
package/dist/node/Plugin.d.mts
CHANGED
|
@@ -2,7 +2,6 @@ import { EthereumGasEthersWitness } from './Witness';
|
|
|
2
2
|
export declare const EthereumGasEthersPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<EthereumGasEthersWitness<import("@xyo-network/object").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random" | undefined;
|
|
4
4
|
config: import("@xyo-network/payload-model").SchemaFields & object & Omit<{
|
|
5
|
-
accountPath?: string | undefined;
|
|
6
5
|
readonly archivist?: string | undefined;
|
|
7
6
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
8
7
|
readonly name?: string | undefined;
|
|
@@ -19,7 +18,6 @@ export declare const EthereumGasEthersPlugin: () => import("@xyo-network/payload
|
|
|
19
18
|
readonly storeQueries?: boolean | undefined;
|
|
20
19
|
readonly timestamp?: boolean | undefined;
|
|
21
20
|
} & import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/payload-model").SchemaFields & object & {
|
|
22
|
-
accountPath?: string | undefined;
|
|
23
21
|
readonly archivist?: string | undefined;
|
|
24
22
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
25
23
|
readonly name?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
|
package/dist/node/Plugin.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { EthereumGasEthersWitness } from './Witness';
|
|
|
2
2
|
export declare const EthereumGasEthersPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<EthereumGasEthersWitness<import("@xyo-network/object").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random" | undefined;
|
|
4
4
|
config: import("@xyo-network/payload-model").SchemaFields & object & Omit<{
|
|
5
|
-
accountPath?: string | undefined;
|
|
6
5
|
readonly archivist?: string | undefined;
|
|
7
6
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
8
7
|
readonly name?: string | undefined;
|
|
@@ -19,7 +18,6 @@ export declare const EthereumGasEthersPlugin: () => import("@xyo-network/payload
|
|
|
19
18
|
readonly storeQueries?: boolean | undefined;
|
|
20
19
|
readonly timestamp?: boolean | undefined;
|
|
21
20
|
} & import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/payload-model").SchemaFields & object & {
|
|
22
|
-
accountPath?: string | undefined;
|
|
23
21
|
readonly archivist?: string | undefined;
|
|
24
22
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
25
23
|
readonly name?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
|
package/dist/node/index.cjs
CHANGED
|
@@ -23,7 +23,7 @@ __export(src_exports, {
|
|
|
23
23
|
EthereumGasEthersPlugin: () => EthereumGasEthersPlugin,
|
|
24
24
|
EthereumGasEthersWitness: () => EthereumGasEthersWitness,
|
|
25
25
|
EthereumGasEthersWitnessConfigSchema: () => EthereumGasEthersWitnessConfigSchema,
|
|
26
|
-
default: () =>
|
|
26
|
+
default: () => EthereumGasEthersPlugin
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(src_exports);
|
|
29
29
|
|
|
@@ -79,9 +79,6 @@ var EthereumGasEthersPlugin = () => (0, import_payloadset_plugin.createPayloadSe
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
|
-
|
|
83
|
-
// src/index.ts
|
|
84
|
-
var src_default = EthereumGasEthersPlugin;
|
|
85
82
|
// Annotate the CommonJS export names for ESM import in node:
|
|
86
83
|
0 && (module.exports = {
|
|
87
84
|
EthereumGasEthersPlugin,
|
package/dist/node/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEthers.ts","../../src/Schema.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromEthers.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config'\nexport { EthereumGasEthersPlugin as default, EthereumGasEthersPlugin } from './Plugin'\nexport * from './Schema'\nexport * from './Witness'\n","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'\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, EthereumGasEthersSchema } from '@xyo-network/ethers-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'\nimport { Provider } from 'ethers'\n\nimport { EthereumGasEthersWitnessConfig } from './Config'\nimport { getGasFromEthers } from './lib'\nimport { EthereumGasEthersWitnessConfigSchema } from './Schema'\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 configSchemas = [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 { EthereumGasEthersResponse } from '@xyo-network/ethers-ethereum-gas-payload-plugin'\nimport { 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 }\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,6CAAwC;AACxC,2BAAiC;AACjC,+BAA8C;;;ACF9C,oBAAyB;AACzB,8BAAgC;AAChC,gDAAkE;AAElE,6BAA+B;;;ACD/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,EACvE;AACA,SAAO;AACT;;;ACfO,IAAM,uCAA6E;;;AFmBnF,IAAM,2BAAN,cAEG,wCAAyB;AAAA,EACjC,OAAgB,gBAAgB,CAAC,oCAAoC;AAAA,EAE7D;AAAA,EAER,IAAc,WAAW;AA3B3B;AA4BI,SAAK,YAAY,KAAK,eAAa,UAAK,WAAL,mBAAa;AAChD,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAyB,iBAAqC;AAC5D,UAAM,UAAU,MAAM,IAAI,sCAAyC,EAAE,QAAQ,kEAAwB,CAAC,EACnG,OAAO,MAAM,qBAAiB,wBAAS,KAAK,UAAU,mBAAmB,CAAC,CAAC,EAC3E,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADhCO,IAAM,0BAA0B,UACrC;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,kEAAuB,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EACvE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAO,MAAM,yBAAyB,OAAO,MAAM;AAAA,IACrD;AAAA,EACF;AACF;","names":["import_ethers_ethereum_gas_payload_plugin"]}
|
package/dist/node/index.d.cts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { EthereumGasEthersPlugin } from './Plugin';
|
|
2
1
|
export * from './Config';
|
|
2
|
+
export { EthereumGasEthersPlugin as default, EthereumGasEthersPlugin } from './Plugin';
|
|
3
3
|
export * from './Schema';
|
|
4
4
|
export * from './Witness';
|
|
5
|
-
export { EthereumGasEthersPlugin };
|
|
6
|
-
export default EthereumGasEthersPlugin;
|
|
7
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AACtF,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { EthereumGasEthersPlugin } from './Plugin';
|
|
2
1
|
export * from './Config';
|
|
2
|
+
export { EthereumGasEthersPlugin as default, EthereumGasEthersPlugin } from './Plugin';
|
|
3
3
|
export * from './Schema';
|
|
4
4
|
export * from './Witness';
|
|
5
|
-
export { EthereumGasEthersPlugin };
|
|
6
|
-
export default EthereumGasEthersPlugin;
|
|
7
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AACtF,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { EthereumGasEthersPlugin } from './Plugin';
|
|
2
1
|
export * from './Config';
|
|
2
|
+
export { EthereumGasEthersPlugin as default, EthereumGasEthersPlugin } from './Plugin';
|
|
3
3
|
export * from './Schema';
|
|
4
4
|
export * from './Witness';
|
|
5
|
-
export { EthereumGasEthersPlugin };
|
|
6
|
-
export default EthereumGasEthersPlugin;
|
|
7
5
|
//# sourceMappingURL=index.d.ts.map
|
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,OAAO,EAAE,uBAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AACtF,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
|
package/dist/node/index.js
CHANGED
|
@@ -50,13 +50,10 @@ var EthereumGasEthersPlugin = () => createPayloadSetWitnessPlugin(
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
|
-
|
|
54
|
-
// src/index.ts
|
|
55
|
-
var src_default = EthereumGasEthersPlugin;
|
|
56
53
|
export {
|
|
57
54
|
EthereumGasEthersPlugin,
|
|
58
55
|
EthereumGasEthersWitness,
|
|
59
56
|
EthereumGasEthersWitnessConfigSchema,
|
|
60
|
-
|
|
57
|
+
EthereumGasEthersPlugin as default
|
|
61
58
|
};
|
|
62
59
|
//# 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/getGasFromEthers.ts","../../src/Schema.ts"
|
|
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'\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, EthereumGasEthersSchema } from '@xyo-network/ethers-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'\nimport { Provider } from 'ethers'\n\nimport { EthereumGasEthersWitnessConfig } from './Config'\nimport { getGasFromEthers } from './lib'\nimport { EthereumGasEthersWitnessConfigSchema } from './Schema'\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 configSchemas = [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 { EthereumGasEthersResponse } from '@xyo-network/ethers-ethereum-gas-payload-plugin'\nimport { 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 }\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;AAChC,SAAmC,+BAA+B;AAElE,SAAS,sBAAsB;;;ACD/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,EACvE;AACA,SAAO;AACT;;;ACfO,IAAM,uCAA6E;;;AFmBnF,IAAM,2BAAN,cAEG,gBAAyB;AAAA,EACjC,OAAgB,gBAAgB,CAAC,oCAAoC;AAAA,EAE7D;AAAA,EAER,IAAc,WAAW;AA3B3B;AA4BI,SAAK,YAAY,KAAK,eAAa,UAAK,WAAL,mBAAa;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,mBAAmB,CAAC,CAAC,EAC3E,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADhCO,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
|
@@ -10,23 +10,23 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/plugins/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xylabs/assert": "^2.13.
|
|
14
|
-
"@xyo-network/abstract-witness": "^2.85.
|
|
15
|
-
"@xyo-network/ethers-ethereum-gas-payload-plugin": "~2.85.
|
|
16
|
-
"@xyo-network/module-model": "^2.85.
|
|
17
|
-
"@xyo-network/payload-builder": "^2.85.
|
|
18
|
-
"@xyo-network/payload-model": "^2.85.
|
|
19
|
-
"@xyo-network/payloadset-plugin": "^2.85.
|
|
20
|
-
"@xyo-network/witness-model": "^2.85.
|
|
21
|
-
"ethers": "^6.9.
|
|
13
|
+
"@xylabs/assert": "^2.13.23",
|
|
14
|
+
"@xyo-network/abstract-witness": "^2.85.8",
|
|
15
|
+
"@xyo-network/ethers-ethereum-gas-payload-plugin": "~2.85.2",
|
|
16
|
+
"@xyo-network/module-model": "^2.85.8",
|
|
17
|
+
"@xyo-network/payload-builder": "^2.85.8",
|
|
18
|
+
"@xyo-network/payload-model": "^2.85.8",
|
|
19
|
+
"@xyo-network/payloadset-plugin": "^2.85.8",
|
|
20
|
+
"@xyo-network/witness-model": "^2.85.8",
|
|
21
|
+
"ethers": "^6.9.2"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@xylabs/jest-helpers": "^2.13.
|
|
24
|
+
"@xylabs/jest-helpers": "^2.13.23",
|
|
25
25
|
"@xylabs/ts-scripts-yarn3": "^3.2.25",
|
|
26
26
|
"@xylabs/tsconfig": "^3.2.25",
|
|
27
|
-
"@xyo-network/account": "^2.85.
|
|
28
|
-
"@xyo-network/payload-wrapper": "^2.85.
|
|
29
|
-
"@xyo-network/witness-blockchain-abstract": "^2.85.
|
|
27
|
+
"@xyo-network/account": "^2.85.8",
|
|
28
|
+
"@xyo-network/payload-wrapper": "^2.85.8",
|
|
29
|
+
"@xyo-network/witness-blockchain-abstract": "^2.85.8",
|
|
30
30
|
"jest": "^29.7.0",
|
|
31
31
|
"typescript": "^5.3.3"
|
|
32
32
|
},
|
|
@@ -69,6 +69,6 @@
|
|
|
69
69
|
"url": "https://github.com/XYOracleNetwork/plugins.git"
|
|
70
70
|
},
|
|
71
71
|
"sideEffects": false,
|
|
72
|
-
"version": "2.85.
|
|
72
|
+
"version": "2.85.2",
|
|
73
73
|
"type": "module"
|
|
74
74
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import { EthereumGasEthersPlugin } from './Plugin'
|
|
2
|
-
|
|
3
1
|
export * from './Config'
|
|
2
|
+
export { EthereumGasEthersPlugin as default, EthereumGasEthersPlugin } from './Plugin'
|
|
4
3
|
export * from './Schema'
|
|
5
4
|
export * from './Witness'
|
|
6
|
-
|
|
7
|
-
export { EthereumGasEthersPlugin }
|
|
8
|
-
|
|
9
|
-
// eslint-disable-next-line import/no-default-export
|
|
10
|
-
export default EthereumGasEthersPlugin
|