@xyo-network/ethers-ethereum-gas-plugin 2.99.3 → 2.99.5
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/Config.d.cts +1 -1
- package/dist/browser/Config.d.mts +1 -1
- package/dist/browser/Config.d.ts +1 -1
- package/dist/browser/Plugin.d.cts +2 -2
- package/dist/browser/Plugin.d.mts +2 -2
- package/dist/browser/Plugin.d.ts +2 -2
- package/dist/browser/Witness.d.cts +1 -1
- package/dist/browser/Witness.d.mts +1 -1
- package/dist/browser/Witness.d.ts +1 -1
- package/dist/browser/index.cjs +28 -15
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +4 -4
- package/dist/browser/index.d.mts +4 -4
- package/dist/browser/index.d.ts +4 -4
- package/dist/browser/{index.js → index.mjs} +31 -16
- package/dist/{node/index.js.map → browser/index.mjs.map} +1 -1
- package/dist/browser/lib/index.d.cts +1 -1
- package/dist/browser/lib/index.d.mts +1 -1
- package/dist/browser/lib/index.d.ts +1 -1
- package/dist/neutral/Config.d.cts +1 -1
- package/dist/neutral/Config.d.mts +1 -1
- package/dist/neutral/Config.d.ts +1 -1
- package/dist/neutral/Plugin.d.cts +2 -2
- package/dist/neutral/Plugin.d.mts +2 -2
- package/dist/neutral/Plugin.d.ts +2 -2
- package/dist/neutral/Witness.d.cts +1 -1
- package/dist/neutral/Witness.d.mts +1 -1
- package/dist/neutral/Witness.d.ts +1 -1
- package/dist/neutral/index.cjs +28 -15
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.d.cts +4 -4
- package/dist/neutral/index.d.mts +4 -4
- package/dist/neutral/index.d.ts +4 -4
- package/dist/neutral/{index.js → index.mjs} +31 -16
- package/dist/{browser/index.js.map → neutral/index.mjs.map} +1 -1
- package/dist/neutral/lib/index.d.cts +1 -1
- package/dist/neutral/lib/index.d.mts +1 -1
- package/dist/neutral/lib/index.d.ts +1 -1
- package/dist/node/Config.d.cts +1 -1
- package/dist/node/Config.d.mts +1 -1
- package/dist/node/Config.d.ts +1 -1
- package/dist/node/Plugin.d.cts +2 -2
- package/dist/node/Plugin.d.mts +2 -2
- package/dist/node/Plugin.d.ts +2 -2
- package/dist/node/Witness.d.cts +1 -1
- package/dist/node/Witness.d.mts +1 -1
- package/dist/node/Witness.d.ts +1 -1
- package/dist/node/index.cjs +34 -17
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +4 -4
- package/dist/node/index.d.mts +4 -4
- package/dist/node/index.d.ts +4 -4
- package/dist/node/index.mjs +80 -0
- package/dist/{neutral/index.js.map → node/index.mjs.map} +1 -1
- package/dist/node/lib/index.d.cts +1 -1
- package/dist/node/lib/index.d.mts +1 -1
- package/dist/node/lib/index.d.ts +1 -1
- package/package.json +19 -20
- package/src/Config.ts +1 -1
- package/src/Plugin.ts +1 -1
- package/src/Witness.ts +3 -3
- package/src/index.ts +4 -4
- package/src/lib/index.ts +1 -1
- package/dist/node/index.js +0 -61
package/package.json
CHANGED
|
@@ -10,25 +10,24 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/plugins/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xylabs/assert": "^3.6.
|
|
14
|
-
"@xyo-network/abstract-witness": "^2.
|
|
15
|
-
"@xyo-network/ethers-ethereum-gas-payload-plugin": "^2.99.
|
|
16
|
-
"@xyo-network/module-model": "^2.
|
|
17
|
-
"@xyo-network/payload-builder": "^2.
|
|
18
|
-
"@xyo-network/payload-model": "^2.
|
|
19
|
-
"@xyo-network/payloadset-plugin": "^2.
|
|
20
|
-
"@xyo-network/witness-model": "^2.
|
|
21
|
-
"ethers": "^6.13.
|
|
13
|
+
"@xylabs/assert": "^3.6.8",
|
|
14
|
+
"@xyo-network/abstract-witness": "^2.111.2",
|
|
15
|
+
"@xyo-network/ethers-ethereum-gas-payload-plugin": "^2.99.5",
|
|
16
|
+
"@xyo-network/module-model": "^2.111.2",
|
|
17
|
+
"@xyo-network/payload-builder": "^2.111.2",
|
|
18
|
+
"@xyo-network/payload-model": "^2.111.2",
|
|
19
|
+
"@xyo-network/payloadset-plugin": "^2.111.2",
|
|
20
|
+
"@xyo-network/witness-model": "^2.111.2",
|
|
21
|
+
"ethers": "^6.13.2"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@xylabs/jest-helpers": "^3.6.
|
|
25
|
-
"@xylabs/ts-scripts-yarn3": "^3.
|
|
26
|
-
"@xylabs/tsconfig": "^3.
|
|
27
|
-
"@xyo-network/
|
|
28
|
-
"@xyo-network/
|
|
29
|
-
"@xyo-network/witness-blockchain-abstract": "^2.110.6",
|
|
24
|
+
"@xylabs/jest-helpers": "^3.6.8",
|
|
25
|
+
"@xylabs/ts-scripts-yarn3": "^3.15.13",
|
|
26
|
+
"@xylabs/tsconfig": "^3.15.13",
|
|
27
|
+
"@xyo-network/payload-wrapper": "^2.111.2",
|
|
28
|
+
"@xyo-network/witness-blockchain-abstract": "^2.111.2",
|
|
30
29
|
"jest": "^29.7.0",
|
|
31
|
-
"typescript": "^5.5.
|
|
30
|
+
"typescript": "^5.5.4"
|
|
32
31
|
},
|
|
33
32
|
"description": "Typescript/Javascript Plugins for XYO Platform",
|
|
34
33
|
"types": "dist/node/index.d.ts",
|
|
@@ -41,7 +40,7 @@
|
|
|
41
40
|
},
|
|
42
41
|
"import": {
|
|
43
42
|
"types": "./dist/browser/index.d.mts",
|
|
44
|
-
"default": "./dist/browser/index.
|
|
43
|
+
"default": "./dist/browser/index.mjs"
|
|
45
44
|
}
|
|
46
45
|
},
|
|
47
46
|
"node": {
|
|
@@ -51,14 +50,14 @@
|
|
|
51
50
|
},
|
|
52
51
|
"import": {
|
|
53
52
|
"types": "./dist/node/index.d.mts",
|
|
54
|
-
"default": "./dist/node/index.
|
|
53
|
+
"default": "./dist/node/index.mjs"
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
56
|
},
|
|
58
57
|
"./package.json": "./package.json"
|
|
59
58
|
},
|
|
60
59
|
"main": "dist/node/index.cjs",
|
|
61
|
-
"module": "dist/node/index.
|
|
60
|
+
"module": "dist/node/index.mjs",
|
|
62
61
|
"homepage": "https://xyo.network",
|
|
63
62
|
"license": "LGPL-3.0-only",
|
|
64
63
|
"publishConfig": {
|
|
@@ -69,6 +68,6 @@
|
|
|
69
68
|
"url": "https://github.com/XYOracleNetwork/plugins.git"
|
|
70
69
|
},
|
|
71
70
|
"sideEffects": false,
|
|
72
|
-
"version": "2.99.
|
|
71
|
+
"version": "2.99.5",
|
|
73
72
|
"type": "module"
|
|
74
73
|
}
|
package/src/Config.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WitnessConfig } from '@xyo-network/witness-model'
|
|
2
2
|
|
|
3
|
-
import { EthereumGasEthersWitnessConfigSchema } from './Schema.
|
|
3
|
+
import { EthereumGasEthersWitnessConfigSchema } from './Schema.ts'
|
|
4
4
|
|
|
5
5
|
export type EthereumGasEthersWitnessConfig = WitnessConfig<{
|
|
6
6
|
schema: EthereumGasEthersWitnessConfigSchema
|
package/src/Plugin.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { EthereumGasEthersSchema } from '@xyo-network/ethers-ethereum-gas-payloa
|
|
|
2
2
|
import { PayloadSetSchema } from '@xyo-network/payload-model'
|
|
3
3
|
import { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'
|
|
4
4
|
|
|
5
|
-
import { EthereumGasEthersWitness } from './Witness.
|
|
5
|
+
import { EthereumGasEthersWitness } from './Witness.ts'
|
|
6
6
|
|
|
7
7
|
export const EthereumGasEthersPlugin = () =>
|
|
8
8
|
createPayloadSetWitnessPlugin<EthereumGasEthersWitness>(
|
package/src/Witness.ts
CHANGED
|
@@ -7,9 +7,9 @@ import { Payload, Schema } from '@xyo-network/payload-model'
|
|
|
7
7
|
import { WitnessParams } from '@xyo-network/witness-model'
|
|
8
8
|
import { Provider } from 'ethers'
|
|
9
9
|
|
|
10
|
-
import { EthereumGasEthersWitnessConfig } from './Config.
|
|
11
|
-
import { getGasFromEthers } from './lib/index.
|
|
12
|
-
import { EthereumGasEthersWitnessConfigSchema } from './Schema.
|
|
10
|
+
import { EthereumGasEthersWitnessConfig } from './Config.ts'
|
|
11
|
+
import { getGasFromEthers } from './lib/index.ts'
|
|
12
|
+
import { EthereumGasEthersWitnessConfigSchema } from './Schema.ts'
|
|
13
13
|
|
|
14
14
|
export type EthereumGasEthersWitnessParams = WitnessParams<
|
|
15
15
|
AnyConfigSchema<EthereumGasEthersWitnessConfig>,
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './Config.
|
|
1
|
+
export * from './Config.ts'
|
|
2
2
|
// eslint-disable-next-line import/no-default-export
|
|
3
|
-
export { EthereumGasEthersPlugin as default, EthereumGasEthersPlugin } from './Plugin.
|
|
4
|
-
export * from './Schema.
|
|
5
|
-
export * from './Witness.
|
|
3
|
+
export { EthereumGasEthersPlugin as default, EthereumGasEthersPlugin } from './Plugin.ts'
|
|
4
|
+
export * from './Schema.ts'
|
|
5
|
+
export * from './Witness.ts'
|
package/src/lib/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './getGasFromEthers.
|
|
1
|
+
export * from './getGasFromEthers.ts'
|
package/dist/node/index.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// src/Plugin.ts
|
|
2
|
-
import { EthereumGasEthersSchema as EthereumGasEthersSchema2 } from "@xyo-network/ethers-ethereum-gas-payload-plugin";
|
|
3
|
-
import { PayloadSetSchema } from "@xyo-network/payload-model";
|
|
4
|
-
import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
|
|
5
|
-
|
|
6
|
-
// src/Witness.ts
|
|
7
|
-
import { assertEx } from "@xylabs/assert";
|
|
8
|
-
import { AbstractWitness } from "@xyo-network/abstract-witness";
|
|
9
|
-
import { EthereumGasEthersSchema } from "@xyo-network/ethers-ethereum-gas-payload-plugin";
|
|
10
|
-
import { PayloadBuilder } from "@xyo-network/payload-builder";
|
|
11
|
-
|
|
12
|
-
// src/lib/getGasFromEthers.ts
|
|
13
|
-
var formatFeeDataValue = (value) => {
|
|
14
|
-
return value ? Number(value) : null;
|
|
15
|
-
};
|
|
16
|
-
var getGasFromEthers = async (provider) => {
|
|
17
|
-
const feeData = await provider.getFeeData();
|
|
18
|
-
const formattedFeeData = {
|
|
19
|
-
gasPrice: formatFeeDataValue(feeData.gasPrice),
|
|
20
|
-
maxFeePerGas: formatFeeDataValue(feeData.maxFeePerGas),
|
|
21
|
-
maxPriorityFeePerGas: formatFeeDataValue(feeData.maxPriorityFeePerGas),
|
|
22
|
-
timestamp: Date.now()
|
|
23
|
-
};
|
|
24
|
-
return formattedFeeData;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
// src/Schema.ts
|
|
28
|
-
var EthereumGasEthersWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.ethers.witness.config";
|
|
29
|
-
|
|
30
|
-
// src/Witness.ts
|
|
31
|
-
var EthereumGasEthersWitness = class extends AbstractWitness {
|
|
32
|
-
static configSchemas = [...super.configSchemas, EthereumGasEthersWitnessConfigSchema];
|
|
33
|
-
static defaultConfigSchema = EthereumGasEthersWitnessConfigSchema;
|
|
34
|
-
_provider;
|
|
35
|
-
get provider() {
|
|
36
|
-
var _a;
|
|
37
|
-
this._provider = this._provider ?? ((_a = this.params) == null ? void 0 : _a.provider);
|
|
38
|
-
return this._provider;
|
|
39
|
-
}
|
|
40
|
-
async observeHandler() {
|
|
41
|
-
const payload = await new PayloadBuilder({ schema: EthereumGasEthersSchema }).fields(await getGasFromEthers(assertEx(this.provider, () => "Provider Required"))).build();
|
|
42
|
-
return [payload];
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
// src/Plugin.ts
|
|
47
|
-
var EthereumGasEthersPlugin = () => createPayloadSetWitnessPlugin(
|
|
48
|
-
{ required: { [EthereumGasEthersSchema2]: 1 }, schema: PayloadSetSchema },
|
|
49
|
-
{
|
|
50
|
-
witness: async (params) => {
|
|
51
|
-
return await EthereumGasEthersWitness.create(params);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
export {
|
|
56
|
-
EthereumGasEthersPlugin,
|
|
57
|
-
EthereumGasEthersWitness,
|
|
58
|
-
EthereumGasEthersWitnessConfigSchema,
|
|
59
|
-
EthereumGasEthersPlugin as default
|
|
60
|
-
};
|
|
61
|
-
//# sourceMappingURL=index.js.map
|