@xyo-network/evm-events-witness 5.1.3 → 5.1.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/evm-events-witness",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.5",
|
|
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/assert": "~5.0.
|
|
37
|
-
"@xylabs/exists": "~5.0.
|
|
38
|
-
"@xylabs/hex": "~5.0.
|
|
39
|
-
"@xyo-network/payload-model": "~5.1.
|
|
40
|
-
"@xyo-network/witness-evm-abstract": "~5.1.
|
|
39
|
+
"@xylabs/assert": "~5.0.37",
|
|
40
|
+
"@xylabs/exists": "~5.0.37",
|
|
41
|
+
"@xylabs/hex": "~5.0.37",
|
|
42
|
+
"@xyo-network/payload-model": "~5.1.23",
|
|
43
|
+
"@xyo-network/witness-evm-abstract": "~5.1.23",
|
|
41
44
|
"ethers": "~6.15.0"
|
|
42
45
|
},
|
|
43
46
|
"devDependencies": {
|
|
44
|
-
"@xylabs/ts-scripts-yarn3": "~7.
|
|
45
|
-
"@xylabs/tsconfig": "~7.
|
|
46
|
-
"@xylabs/vitest-extended": "~5.0.
|
|
47
|
-
"@xyo-network/open-zeppelin-typechain": "~4.0.
|
|
48
|
-
"typescript": "~5.9.
|
|
49
|
-
"vitest": "~
|
|
47
|
+
"@xylabs/ts-scripts-yarn3": "~7.2.8",
|
|
48
|
+
"@xylabs/tsconfig": "~7.2.8",
|
|
49
|
+
"@xylabs/vitest-extended": "~5.0.37",
|
|
50
|
+
"@xyo-network/open-zeppelin-typechain": "~4.0.10",
|
|
51
|
+
"typescript": "~5.9.3",
|
|
52
|
+
"vitest": "~4.0.10"
|
|
50
53
|
},
|
|
51
54
|
"publishConfig": {
|
|
52
55
|
"access": "public"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Witness.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Witness.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
|
package/src/spec/Witness.spec.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import '@xylabs/vitest-extended'
|
|
2
|
-
|
|
3
|
-
import { ERC1155__factory } from '@xyo-network/open-zeppelin-typechain'
|
|
4
|
-
import type { Payload } from '@xyo-network/payload-model'
|
|
5
|
-
import { isPayloadOfSchemaType } from '@xyo-network/payload-model'
|
|
6
|
-
import { getProvidersFromEnv } from '@xyo-network/witness-evm-abstract'
|
|
7
|
-
import {
|
|
8
|
-
describe, expect,
|
|
9
|
-
it,
|
|
10
|
-
} from 'vitest'
|
|
11
|
-
|
|
12
|
-
import { EvmEventsWitnessConfigSchema } from '../model.ts'
|
|
13
|
-
import type { EvmEvent, EvmEvents } from '../Payload.ts'
|
|
14
|
-
import { EvmEventSchema, EvmEventsSchema } from '../Payload.ts'
|
|
15
|
-
import { EvmEventsWitness } from '../Witness.ts'
|
|
16
|
-
|
|
17
|
-
const validateObservation = (observation: Payload[]) => {
|
|
18
|
-
const results = observation.filter(isPayloadOfSchemaType<EvmEvent>(EvmEventSchema))
|
|
19
|
-
expect(results.length).toBeGreaterThan(0)
|
|
20
|
-
expect(observation.length).toEqual(results.length)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
describe.skipIf(!process.env.INFURA_PROJECT_ID).skip('EvmEventsWitness', () => {
|
|
24
|
-
const address = '0x6811f2f20c42f42656a3c8623ad5e9461b83f719' // ParallelPlanetFall
|
|
25
|
-
const eventName = 'TransferSingle'
|
|
26
|
-
describe('observe', () => {
|
|
27
|
-
describe('with no address or chainId in query', () => {
|
|
28
|
-
it('uses values from config', async () => {
|
|
29
|
-
const witness = await EvmEventsWitness.create({
|
|
30
|
-
account: 'random',
|
|
31
|
-
config: {
|
|
32
|
-
abi: ERC1155__factory.abi, fromBlock: 19_180_000, schema: EvmEventsWitnessConfigSchema,
|
|
33
|
-
},
|
|
34
|
-
providers: getProvidersFromEnv,
|
|
35
|
-
})
|
|
36
|
-
const call: EvmEvents = {
|
|
37
|
-
address, eventName, schema: EvmEventsSchema,
|
|
38
|
-
}
|
|
39
|
-
const observation = await witness.observe([call])
|
|
40
|
-
validateObservation(observation)
|
|
41
|
-
}, 20_000)
|
|
42
|
-
})
|
|
43
|
-
})
|
|
44
|
-
})
|