@xyo-network/blocknative-ethereum-gas-plugin 2.47.9 → 2.48.0

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/package.json CHANGED
@@ -10,13 +10,13 @@
10
10
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
11
11
  },
12
12
  "dependencies": {
13
- "@xyo-network/axios": "^2.47.9",
14
- "@xyo-network/blocknative-ethereum-gas-payload-plugin": "^2.47.9",
15
- "@xyo-network/module": "^2.47.9",
16
- "@xyo-network/payload-builder": "^2.47.9",
17
- "@xyo-network/payload-model": "^2.47.9",
18
- "@xyo-network/payloadset-plugin": "^2.47.9",
19
- "@xyo-network/witness": "^2.47.9"
13
+ "@xyo-network/axios": "^2.48.0",
14
+ "@xyo-network/blocknative-ethereum-gas-payload-plugin": "^2.48.0",
15
+ "@xyo-network/module": "^2.48.0",
16
+ "@xyo-network/payload-builder": "^2.48.0",
17
+ "@xyo-network/payload-model": "^2.48.0",
18
+ "@xyo-network/payloadset-plugin": "^2.48.0",
19
+ "@xyo-network/witness": "^2.48.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@xylabs/ts-scripts-yarn3": "^2.15.0",
@@ -56,5 +56,5 @@
56
56
  },
57
57
  "sideEffects": false,
58
58
  "types": "dist/types/index.d.ts",
59
- "version": "2.47.9"
59
+ "version": "2.48.0"
60
60
  }
@@ -1,39 +0,0 @@
1
- import { PendingBlockNumber } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'
2
-
3
- import { getGasFromBlocknative } from './getGasFromBlocknative'
4
-
5
- describe('getGasFromBlocknative', () => {
6
- test('returns prices', async () => {
7
- const result = await getGasFromBlocknative()
8
- expect(result).toBeObject()
9
- expect(result?.blockPrices).toBeArrayOfSize(1)
10
- result.blockPrices.map((blockPrice) => {
11
- expect(blockPrice.baseFeePerGas).toBeNumber()
12
- expect(blockPrice.blockNumber).toBeNumber()
13
- expect(blockPrice.estimatedPrices).toBeArrayOfSize(5)
14
- blockPrice.estimatedPrices.map((estimatedPrice) => {
15
- expect(estimatedPrice?.confidence).toBeNumber()
16
- expect(estimatedPrice?.maxFeePerGas).toBeNumber()
17
- expect(estimatedPrice?.maxPriorityFeePerGas).toBeNumber()
18
- expect(estimatedPrice?.price).toBeNumber()
19
- })
20
- expect(blockPrice.estimatedTransactionCount).toBeNumber()
21
- })
22
- expect(result?.estimatedBaseFees).toBeArrayOfSize(5)
23
- for (let index = 0; index < result?.estimatedBaseFees.length; index++) {
24
- const blockNumber = `pending+${index + 1}` as PendingBlockNumber
25
- const pendingBlockInfo = result.estimatedBaseFees?.[index]?.[blockNumber]
26
- expect(pendingBlockInfo).toBeArrayOfSize(1)
27
- const pendingBlock = pendingBlockInfo?.[0]
28
- expect(pendingBlock).toBeObject()
29
- expect(pendingBlock?.baseFee).toBeNumber()
30
- expect(pendingBlock?.confidence).toBeNumber()
31
- }
32
- expect(result?.currentBlockNumber).toBeNumber()
33
- expect(result?.maxPrice).toBeNumber()
34
- expect(result?.msSinceLastBlock).toBeNumber()
35
- expect(result?.network).toEqual('main')
36
- expect(result?.system).toEqual('ethereum')
37
- expect(result?.unit).toEqual('gwei')
38
- })
39
- })
@@ -1,18 +0,0 @@
1
- import { XyoEthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'
2
- import { PayloadSetPluginResolver } from '@xyo-network/payloadset-plugin'
3
-
4
- import { XyoEthereumGasBlocknativePlugin } from '../Plugin'
5
- import { XyoEthereumGasBlocknativeWitness } from '../Witness'
6
-
7
- describe('XyoEthereumGasBlocknativePlugin', () => {
8
- test('Add to Resolver', () => {
9
- const plugin = XyoEthereumGasBlocknativePlugin()
10
- const resolver = new PayloadSetPluginResolver().register(plugin, {
11
- witness: {
12
- config: { schema: XyoEthereumGasBlocknativeWitness.configSchema },
13
- },
14
- })
15
- expect(resolver.resolve(plugin.set)).toBeObject()
16
- expect(resolver.witness(XyoEthereumGasBlocknativeSchema)).toBeObject()
17
- })
18
- })
@@ -1,20 +0,0 @@
1
- import { XyoEthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'
2
- import { PayloadWrapper } from '@xyo-network/payload-wrapper'
3
-
4
- import { XyoEthereumGasBlocknativeWitnessConfigSchema } from '../Schema'
5
- import { XyoEthereumGasBlocknativeWitness } from '../Witness'
6
-
7
- describe('XyoEthereumGasBlocknativeWitness', () => {
8
- it('returns observation', async () => {
9
- const sut = await XyoEthereumGasBlocknativeWitness.create({
10
- config: {
11
- schema: XyoEthereumGasBlocknativeWitnessConfigSchema,
12
- },
13
- })
14
- const [actual] = await sut.observe()
15
- expect(actual.timestamp).toBeNumber()
16
- expect(actual.schema).toBe(XyoEthereumGasBlocknativeSchema)
17
- const answerWrapper = new PayloadWrapper(actual)
18
- expect(answerWrapper.valid).toBe(true)
19
- })
20
- })