@xyo-network/erc1967-witness 4.2.0 → 5.0.1

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/erc1967-witness",
3
- "version": "4.2.0",
3
+ "version": "5.0.1",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -28,20 +28,24 @@
28
28
  },
29
29
  "module": "dist/neutral/index.mjs",
30
30
  "types": "dist/neutral/index.d.ts",
31
+ "files": [
32
+ "dist",
33
+ "src"
34
+ ],
31
35
  "dependencies": {
32
- "@xylabs/assert": "^4.15.1",
33
- "@xylabs/hex": "^4.15.1",
34
- "@xyo-network/open-zeppelin-typechain": "^3.5.4",
35
- "@xyo-network/payload-model": "^4.3.0",
36
- "@xyo-network/witness-evm-abstract": "^4.3.0",
37
- "ethers": "^6.15.0"
36
+ "@xylabs/assert": "~5.0.7",
37
+ "@xylabs/hex": "~5.0.7",
38
+ "@xyo-network/open-zeppelin-typechain": "~4.0.0",
39
+ "@xyo-network/payload-model": "~5.0.2",
40
+ "@xyo-network/witness-evm-abstract": "~5.0.2",
41
+ "ethers": "~6.15.0"
38
42
  },
39
43
  "devDependencies": {
40
- "@xylabs/ts-scripts-yarn3": "^7.0.1",
41
- "@xylabs/tsconfig": "^7.0.1",
42
- "@xylabs/vitest-extended": "^4.15.1",
43
- "typescript": "^5.8.3",
44
- "vitest": "^3.2.4"
44
+ "@xylabs/ts-scripts-yarn3": "~7.1.0",
45
+ "@xylabs/tsconfig": "~7.1.0",
46
+ "@xylabs/vitest-extended": "~5.0.7",
47
+ "typescript": "~5.9.2",
48
+ "vitest": "~3.2.4"
45
49
  },
46
50
  "publishConfig": {
47
51
  "access": "public"
@@ -0,0 +1,36 @@
1
+ import '@xylabs/vitest-extended'
2
+
3
+ import { EvmAddressSchema, getProvidersFromEnv } from '@xyo-network/witness-evm-abstract'
4
+ import {
5
+ describe, expect,
6
+ it,
7
+ } from 'vitest'
8
+
9
+ import { Erc1967Witness, Erc1967WitnessConfigSchema } from '../Witness.ts'
10
+
11
+ describe.skipIf(!process.env.INFURA_PROJECT_ID)('CryptoWalletNftWitness', () => {
12
+ it('get code from contract (no proxy)', async () => {
13
+ const address = '0x55296f69f40ea6d20e478533c15a6b08b654e758' // XYO ERC20
14
+ const witness = await Erc1967Witness.create({
15
+ account: 'random',
16
+ config: { schema: Erc1967WitnessConfigSchema },
17
+ providers: getProvidersFromEnv,
18
+ })
19
+ const observation = await witness.observe([{ address, schema: EvmAddressSchema }])
20
+ expect(observation[0].address).toBe(address)
21
+ expect(observation[0].slots).toBeObject()
22
+ expect(observation[0].implementation).toBeString()
23
+ })
24
+ it('get code from contract (proxy)', async () => {
25
+ const address = '0x33FD426905F149f8376e227d0C9D3340AaD17aF1' // The Memes NFT
26
+ const witness = await Erc1967Witness.create({
27
+ account: 'random',
28
+ config: { schema: Erc1967WitnessConfigSchema },
29
+ providers: getProvidersFromEnv,
30
+ })
31
+ const observation = await witness.observe([{ address, schema: EvmAddressSchema }])
32
+ expect(observation[0].address).toBe(address.toLowerCase())
33
+ expect(observation[0].slots).toBeObject()
34
+ expect(observation[0].implementation).toBe('0x142fd5b9d67721efda3a5e2e9be47a96c9b724a4')
35
+ })
36
+ })
package/typedoc.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "$schema": "https://typedoc.org/schema.json",
3
- "entryPoints": ["./src/index.ts"],
4
- "tsconfig": "./tsconfig.typedoc.json"
5
- }
package/xy.config.ts DELETED
@@ -1,10 +0,0 @@
1
- import type { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
2
- const config: XyTsupConfig = {
3
- compile: {
4
- browser: {},
5
- node: {},
6
- neutral: { src: true },
7
- },
8
- }
9
-
10
- export default config