@xyo-network/blocknative-ethereum-gas-plugin 5.1.2 → 5.1.4
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 +17 -14
- package/dist/neutral/lib/spec/getGasFromBlocknative.spec.d.ts +0 -2
- package/dist/neutral/lib/spec/getGasFromBlocknative.spec.d.ts.map +0 -1
- package/dist/neutral/spec/Plugin.spec.d.ts +0 -2
- package/dist/neutral/spec/Plugin.spec.d.ts.map +0 -1
- package/dist/neutral/spec/Witness.spec.d.ts +0 -2
- package/dist/neutral/spec/Witness.spec.d.ts.map +0 -1
- package/src/lib/spec/getGasFromBlocknative.spec.ts +0 -46
- package/src/spec/Plugin.spec.ts +0 -19
- package/src/spec/Witness.spec.ts +0 -24
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/blocknative-ethereum-gas-plugin",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.4",
|
|
4
4
|
"description": "Typescript/Javascript Plugins for XYO Platform",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -30,23 +30,26 @@
|
|
|
30
30
|
"types": "dist/neutral/index.d.ts",
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|
|
33
|
-
"src"
|
|
33
|
+
"src",
|
|
34
|
+
"!**/*.bench.*",
|
|
35
|
+
"!**/*.spec.*",
|
|
36
|
+
"!**/*.test.*"
|
|
34
37
|
],
|
|
35
38
|
"dependencies": {
|
|
36
|
-
"@xylabs/axios": "~5.0.
|
|
37
|
-
"@xyo-network/abstract-witness": "~5.1.
|
|
38
|
-
"@xyo-network/blocknative-ethereum-gas-payload-plugin": "~5.1.
|
|
39
|
-
"@xyo-network/module-model": "~5.1.
|
|
40
|
-
"@xyo-network/payload-builder": "~5.1.
|
|
41
|
-
"@xyo-network/payload-model": "~5.1.
|
|
42
|
-
"@xyo-network/payloadset-plugin": "~5.1.
|
|
43
|
-
"@xyo-network/witness-timestamp": "~5.1.
|
|
39
|
+
"@xylabs/axios": "~5.0.33",
|
|
40
|
+
"@xyo-network/abstract-witness": "~5.1.23",
|
|
41
|
+
"@xyo-network/blocknative-ethereum-gas-payload-plugin": "~5.1.4",
|
|
42
|
+
"@xyo-network/module-model": "~5.1.23",
|
|
43
|
+
"@xyo-network/payload-builder": "~5.1.23",
|
|
44
|
+
"@xyo-network/payload-model": "~5.1.23",
|
|
45
|
+
"@xyo-network/payloadset-plugin": "~5.1.23",
|
|
46
|
+
"@xyo-network/witness-timestamp": "~5.1.23"
|
|
44
47
|
},
|
|
45
48
|
"devDependencies": {
|
|
46
|
-
"@xylabs/ts-scripts-yarn3": "~7.
|
|
47
|
-
"@xylabs/tsconfig": "~7.
|
|
48
|
-
"@xylabs/vitest-extended": "~5.0.
|
|
49
|
-
"@xyo-network/payload-wrapper": "~5.1.
|
|
49
|
+
"@xylabs/ts-scripts-yarn3": "~7.2.8",
|
|
50
|
+
"@xylabs/tsconfig": "~7.2.8",
|
|
51
|
+
"@xylabs/vitest-extended": "~5.0.33",
|
|
52
|
+
"@xyo-network/payload-wrapper": "~5.1.23",
|
|
50
53
|
"typescript": "~5.9.2",
|
|
51
54
|
"vitest": "~3.2.4"
|
|
52
55
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getGasFromBlocknative.spec.d.ts","sourceRoot":"","sources":["../../../../src/lib/spec/getGasFromBlocknative.spec.ts"],"names":[],"mappings":"AAEA,OAAO,yBAAyB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Plugin.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Witness.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Witness.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// import { PendingBlockNumber } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'
|
|
2
|
-
|
|
3
|
-
import '@xylabs/vitest-extended'
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
describe, expect,
|
|
7
|
-
test,
|
|
8
|
-
} from 'vitest'
|
|
9
|
-
|
|
10
|
-
import { getGasFromBlocknative } from '../getGasFromBlocknative.ts'
|
|
11
|
-
|
|
12
|
-
describe('getGasFromBlocknative', () => {
|
|
13
|
-
test('returns prices', async () => {
|
|
14
|
-
const result = await getGasFromBlocknative()
|
|
15
|
-
expect(result).toBeObject()
|
|
16
|
-
expect(result?.blockPrices).toBeArrayOfSize(1)
|
|
17
|
-
for (let blockPrice of result.blockPrices) {
|
|
18
|
-
expect(blockPrice.baseFeePerGas).toBeNumber()
|
|
19
|
-
expect(blockPrice.blockNumber).toBeNumber()
|
|
20
|
-
expect(blockPrice.estimatedPrices).toBeArrayOfSize(5)
|
|
21
|
-
for (let estimatedPrice of blockPrice.estimatedPrices) {
|
|
22
|
-
expect(estimatedPrice?.confidence).toBeNumber()
|
|
23
|
-
expect(estimatedPrice?.maxFeePerGas).toBeNumber()
|
|
24
|
-
expect(estimatedPrice?.maxPriorityFeePerGas).toBeNumber()
|
|
25
|
-
expect(estimatedPrice?.price).toBeNumber()
|
|
26
|
-
}
|
|
27
|
-
expect(blockPrice.estimatedTransactionCount).toBeNumber()
|
|
28
|
-
}
|
|
29
|
-
/* expect(result?.estimatedBaseFees).toBeArrayOfSize(5)
|
|
30
|
-
for (let index = 0; index < result?.estimatedBaseFees.length; index++) {
|
|
31
|
-
const blockNumber = `pending+${index + 1}` as PendingBlockNumber
|
|
32
|
-
const pendingBlockInfo = result.estimatedBaseFees?.[index]?.[blockNumber]
|
|
33
|
-
expect(pendingBlockInfo.length).toBeGreaterThan(0)
|
|
34
|
-
const pendingBlock = pendingBlockInfo?.[0]
|
|
35
|
-
expect(pendingBlock).toBeObject()
|
|
36
|
-
expect(pendingBlock?.baseFee).toBeNumber()
|
|
37
|
-
expect(pendingBlock?.confidence).toBeNumber()
|
|
38
|
-
} */
|
|
39
|
-
expect(result?.currentBlockNumber).toBeNumber()
|
|
40
|
-
expect(result?.maxPrice).toBeNumber()
|
|
41
|
-
expect(result?.msSinceLastBlock).toBeNumber()
|
|
42
|
-
expect(result?.network).toEqual('main')
|
|
43
|
-
expect(result?.system).toEqual('ethereum')
|
|
44
|
-
expect(result?.unit).toEqual('gwei')
|
|
45
|
-
})
|
|
46
|
-
})
|
package/src/spec/Plugin.spec.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import '@xylabs/vitest-extended'
|
|
2
|
-
|
|
3
|
-
import { PayloadSetPluginResolver } from '@xyo-network/payloadset-plugin'
|
|
4
|
-
import {
|
|
5
|
-
describe, expect,
|
|
6
|
-
test,
|
|
7
|
-
} from 'vitest'
|
|
8
|
-
|
|
9
|
-
import { EthereumGasBlocknativePlugin } from '../Plugin.ts'
|
|
10
|
-
import { EthereumGasBlocknativeWitness } from '../Witness.ts'
|
|
11
|
-
|
|
12
|
-
describe('EthereumGasBlocknativePlugin', () => {
|
|
13
|
-
test('Add to Resolver', async () => {
|
|
14
|
-
const plugin = EthereumGasBlocknativePlugin()
|
|
15
|
-
const resolver = await new PayloadSetPluginResolver().register(plugin, { config: { schema: EthereumGasBlocknativeWitness.defaultConfigSchema } })
|
|
16
|
-
expect(await resolver.resolve(plugin.set)).toBeObject()
|
|
17
|
-
expect(await resolver.witness(plugin.set)).toBeObject()
|
|
18
|
-
})
|
|
19
|
-
})
|
package/src/spec/Witness.spec.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import '@xylabs/vitest-extended'
|
|
2
|
-
|
|
3
|
-
import { EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'
|
|
4
|
-
import { PayloadWrapper } from '@xyo-network/payload-wrapper'
|
|
5
|
-
import {
|
|
6
|
-
describe, expect,
|
|
7
|
-
it,
|
|
8
|
-
} from 'vitest'
|
|
9
|
-
|
|
10
|
-
import { EthereumGasBlocknativeWitnessConfigSchema } from '../Schema.ts'
|
|
11
|
-
import { EthereumGasBlocknativeWitness } from '../Witness.ts'
|
|
12
|
-
|
|
13
|
-
describe('EthereumGasBlocknativeWitness', () => {
|
|
14
|
-
it('returns observation', async () => {
|
|
15
|
-
const sut = await EthereumGasBlocknativeWitness.create({
|
|
16
|
-
account: 'random',
|
|
17
|
-
config: { schema: EthereumGasBlocknativeWitnessConfigSchema },
|
|
18
|
-
})
|
|
19
|
-
const [actual] = await sut.observe()
|
|
20
|
-
expect(actual.schema).toBe(EthereumGasBlocknativeSchema)
|
|
21
|
-
const answerWrapper = PayloadWrapper.wrap(actual)
|
|
22
|
-
expect(await answerWrapper.getValid()).toBe(true)
|
|
23
|
-
})
|
|
24
|
-
})
|