@xyo-network/erc1967-witness 5.2.4 → 5.3.2

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": "5.2.4",
3
+ "version": "5.3.2",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -35,22 +35,25 @@
35
35
  "!**/*.spec.*",
36
36
  "!**/*.test.*"
37
37
  ],
38
- "dependencies": {
39
- "@xylabs/assert": "~5.0.49",
40
- "@xylabs/hex": "~5.0.49",
41
- "@xyo-network/open-zeppelin-typechain": "~4.0.11",
42
- "@xyo-network/payload-model": "~5.2.14",
43
- "@xyo-network/witness-evm-abstract": "~5.2.14",
44
- "ethers": "^6.16.0"
45
- },
46
38
  "devDependencies": {
47
- "@xylabs/ts-scripts-yarn3": "~7.2.8",
48
- "@xylabs/tsconfig": "~7.2.8",
49
- "@xylabs/vitest-extended": "~5.0.49",
39
+ "@xylabs/sdk-js": "^5.0.90",
40
+ "@xylabs/ts-scripts-yarn3": "~7.5.10",
41
+ "@xylabs/tsconfig": "~7.5.10",
42
+ "@xylabs/vitest-extended": "~5.0.90",
43
+ "@xyo-network/open-zeppelin-typechain": "~4.1.1",
44
+ "@xyo-network/payload-model": "~5.3.5",
45
+ "@xyo-network/witness-evm-abstract": "~5.3.5",
46
+ "ethers": "^6.16.0",
50
47
  "typescript": "~5.9.3",
51
- "vitest": "~4.0.15"
48
+ "vitest": "~4.1.2",
49
+ "zod": "^4"
50
+ },
51
+ "peerDependencies": {
52
+ "@xylabs/sdk-js": "^5",
53
+ "ethers": "^6",
54
+ "zod": "^4"
52
55
  },
53
56
  "publishConfig": {
54
57
  "access": "public"
55
58
  }
56
- }
59
+ }
package/src/Payload.ts CHANGED
@@ -1,8 +1,8 @@
1
- import type { Payload } from '@xyo-network/payload-model'
1
+ import { asSchema, type Payload } from '@xyo-network/payload-model'
2
2
 
3
3
  import type { Erc1967SlotStatus } from './lib/index.ts'
4
4
 
5
- export const Erc1967StatusSchema = 'network.xyo.erc1967.status'
5
+ export const Erc1967StatusSchema = asSchema('network.xyo.erc1967.status', true)
6
6
  export type Erc1967StatusSchema = typeof Erc1967StatusSchema
7
7
 
8
8
  export type Erc1967Status = Payload<
package/src/Witness.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { assertEx } from '@xylabs/assert'
1
+ import { assertEx } from '@xylabs/sdk-js'
2
2
  import type { Schema } from '@xyo-network/payload-model'
3
- import { isPayloadOfSchemaType } from '@xyo-network/payload-model'
3
+ import { asSchema, isPayloadOfSchemaType } from '@xyo-network/payload-model'
4
4
  import type {
5
5
  EvmAddress,
6
6
  EvmWitnessConfig, EvmWitnessParams,
@@ -11,7 +11,7 @@ import { getErc1967SlotStatus } from './lib/index.ts'
11
11
  import type { Erc1967Status } from './Payload.ts'
12
12
  import { Erc1967StatusSchema } from './Payload.ts'
13
13
 
14
- export const Erc1967WitnessConfigSchema = 'network.xyo.erc1967.witness.config'
14
+ export const Erc1967WitnessConfigSchema = asSchema('network.xyo.erc1967.witness.config', true)
15
15
  export type Erc1967WitnessConfigSchema = typeof Erc1967WitnessConfigSchema
16
16
 
17
17
  export type Erc1967WitnessConfig = EvmWitnessConfig<{ address?: string }, Erc1967WitnessConfigSchema>
@@ -1,7 +1,7 @@
1
- import type { Address, EthAddress } from '@xylabs/hex'
1
+ import type { Address, EthAddress } from '@xylabs/sdk-js'
2
2
  import {
3
3
  asEthAddress, hexFromHexString, isHexZero,
4
- } from '@xylabs/hex'
4
+ } from '@xylabs/sdk-js'
5
5
  import { UpgradeableBeacon__factory } from '@xyo-network/open-zeppelin-typechain'
6
6
  import type { Provider } from 'ethers'
7
7
 
@@ -1,13 +0,0 @@
1
- import type { Payload } from '@xyo-network/payload-model';
2
- import type { Erc1967SlotStatus } from './lib/index.ts';
3
- export declare const Erc1967StatusSchema = "network.xyo.erc1967.status";
4
- export type Erc1967StatusSchema = typeof Erc1967StatusSchema;
5
- export type Erc1967Status = Payload<{
6
- address: string;
7
- beacon?: Erc1967SlotStatus['beacon'];
8
- block: number;
9
- chainId: number;
10
- implementation?: Erc1967SlotStatus['implementation'];
11
- slots?: Erc1967SlotStatus['slots'];
12
- }, Erc1967StatusSchema>;
13
- //# sourceMappingURL=Payload.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../src/Payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAEvD,eAAO,MAAM,mBAAmB,+BAA+B,CAAA;AAC/D,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAA;AAE5D,MAAM,MAAM,aAAa,GAAG,OAAO,CACjC;IACE,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAA;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,cAAc,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAA;IACpD,KAAK,CAAC,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAA;CACnC,EACD,mBAAmB,CACpB,CAAA"}
@@ -1,16 +0,0 @@
1
- import type { Schema } from '@xyo-network/payload-model';
2
- import type { EvmAddress, EvmWitnessConfig, EvmWitnessParams } from '@xyo-network/witness-evm-abstract';
3
- import { AbstractEvmWitness } from '@xyo-network/witness-evm-abstract';
4
- import type { Erc1967Status } from './Payload.ts';
5
- export declare const Erc1967WitnessConfigSchema = "network.xyo.erc1967.witness.config";
6
- export type Erc1967WitnessConfigSchema = typeof Erc1967WitnessConfigSchema;
7
- export type Erc1967WitnessConfig = EvmWitnessConfig<{
8
- address?: string;
9
- }, Erc1967WitnessConfigSchema>;
10
- export type Erc1967WitnessParams = EvmWitnessParams<Erc1967WitnessConfig>;
11
- export declare class Erc1967Witness<TParams extends Erc1967WitnessParams = Erc1967WitnessParams> extends AbstractEvmWitness<TParams, EvmAddress, Erc1967Status> {
12
- static readonly configSchemas: Schema[];
13
- static readonly defaultConfigSchema: Schema;
14
- protected observeHandler(inPayloads?: EvmAddress[]): Promise<Erc1967Status[]>;
15
- }
16
- //# sourceMappingURL=Witness.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAAE,gBAAgB,EACnC,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,kBAAkB,EAAoB,MAAM,mCAAmC,CAAA;AAGxF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAGjD,eAAO,MAAM,0BAA0B,uCAAuC,CAAA;AAC9E,MAAM,MAAM,0BAA0B,GAAG,OAAO,0BAA0B,CAAA;AAE1E,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,0BAA0B,CAAC,CAAA;AAErG,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,CAAC,oBAAoB,CAAC,CAAA;AAEzE,qBAAa,cAAc,CAAC,OAAO,SAAS,oBAAoB,GAAG,oBAAoB,CAAE,SAAQ,kBAAkB,CACjH,OAAO,EACP,UAAU,EACV,aAAa,CACd;IACC,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAuD;IACvG,gBAAyB,mBAAmB,EAAE,MAAM,CAA6B;cAExD,cAAc,CAAC,UAAU,GAAE,UAAU,EAAO,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAoCjG"}
@@ -1,4 +0,0 @@
1
- export * from './lib/index.ts';
2
- export * from './Payload.ts';
3
- export * from './Witness.ts';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA"}
@@ -1,108 +0,0 @@
1
- // src/lib/getErc1967SlotStatus.ts
2
- import {
3
- asEthAddress,
4
- hexFromHexString,
5
- isHexZero
6
- } from "@xylabs/hex";
7
- import { UpgradeableBeacon__factory } from "@xyo-network/open-zeppelin-typechain";
8
- var ERC1967_PROXY_IMPLEMENTATION_STORAGE_SLOT = "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc";
9
- var ERC1967_PROXY_BEACON_STORAGE_SLOT = "0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50";
10
- var ERC1967_PROXY_ADMIN_STORAGE_SLOT = "0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103";
11
- var ERC1967_PROXY_ROLLBACK_STORAGE_SLOT = "0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143";
12
- var readAddressFromSlot = async (provider, address, slot, block) => {
13
- try {
14
- const slotValue = await provider.getStorage(address, slot, block);
15
- return asEthAddress(hexFromHexString(slotValue, { prefix: true }));
16
- } catch {
17
- return;
18
- }
19
- };
20
- var getErc1967SlotStatus = async (provider, address, block) => {
21
- const status = {
22
- address,
23
- implementation: address,
24
- slots: {
25
- admin: await readAddressFromSlot(provider, address, ERC1967_PROXY_ADMIN_STORAGE_SLOT, block),
26
- beacon: await readAddressFromSlot(provider, address, ERC1967_PROXY_BEACON_STORAGE_SLOT, block),
27
- implementation: await readAddressFromSlot(provider, address, ERC1967_PROXY_IMPLEMENTATION_STORAGE_SLOT, block),
28
- rollback: await readAddressFromSlot(provider, address, ERC1967_PROXY_ROLLBACK_STORAGE_SLOT, block)
29
- }
30
- };
31
- if (status.slots.implementation && !isHexZero(status.slots.implementation)) {
32
- status.implementation = `0x${BigInt(status.slots.implementation).toString(16).padStart(40, "0")}`;
33
- } else {
34
- if (status.slots.beacon && !isHexZero(status.slots.beacon)) {
35
- const beacon = UpgradeableBeacon__factory.connect(status.slots.beacon, { provider });
36
- try {
37
- const implementation = await beacon.implementation(block ? { blockTag: block } : {});
38
- if (implementation) {
39
- status.beacon = { implementation };
40
- if (!isHexZero(implementation)) {
41
- status.implementation = implementation;
42
- }
43
- }
44
- } catch (ex) {
45
- const error = ex;
46
- console.log(error.message);
47
- }
48
- }
49
- }
50
- return status;
51
- };
52
-
53
- // src/Payload.ts
54
- var Erc1967StatusSchema = "network.xyo.erc1967.status";
55
-
56
- // src/Witness.ts
57
- import { assertEx } from "@xylabs/assert";
58
- import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
59
- import { AbstractEvmWitness, EvmAddressSchema } from "@xyo-network/witness-evm-abstract";
60
- var Erc1967WitnessConfigSchema = "network.xyo.erc1967.witness.config";
61
- var Erc1967Witness = class extends AbstractEvmWitness {
62
- static configSchemas = [...super.configSchemas, Erc1967WitnessConfigSchema];
63
- static defaultConfigSchema = Erc1967WitnessConfigSchema;
64
- async observeHandler(inPayloads = []) {
65
- await this.started("throw");
66
- await this.getProviders();
67
- try {
68
- const observations = await Promise.all(
69
- inPayloads.filter(isPayloadOfSchemaType(EvmAddressSchema)).map(async ({ address }) => {
70
- const validatedAddress = assertEx(address ?? this.config.address, () => "Missing address").toLowerCase();
71
- const provider = await this.getProvider(true, true);
72
- const block = await provider.getBlockNumber();
73
- const {
74
- beacon,
75
- implementation,
76
- slots
77
- } = await getErc1967SlotStatus(provider, validatedAddress, block);
78
- const observation = {
79
- address: validatedAddress,
80
- beacon,
81
- block,
82
- chainId: Number((await provider.getNetwork()).chainId),
83
- implementation,
84
- schema: Erc1967StatusSchema,
85
- slots
86
- };
87
- return observation;
88
- })
89
- );
90
- return observations;
91
- } catch (ex) {
92
- const error = ex;
93
- console.log(`Error [${this.config.name}]: ${error.message}`);
94
- throw error;
95
- }
96
- }
97
- };
98
- export {
99
- ERC1967_PROXY_ADMIN_STORAGE_SLOT,
100
- ERC1967_PROXY_BEACON_STORAGE_SLOT,
101
- ERC1967_PROXY_IMPLEMENTATION_STORAGE_SLOT,
102
- ERC1967_PROXY_ROLLBACK_STORAGE_SLOT,
103
- Erc1967StatusSchema,
104
- Erc1967Witness,
105
- Erc1967WitnessConfigSchema,
106
- getErc1967SlotStatus
107
- };
108
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/getErc1967SlotStatus.ts","../../src/Payload.ts","../../src/Witness.ts"],"sourcesContent":["import type { Address, EthAddress } from '@xylabs/hex'\nimport {\n asEthAddress, hexFromHexString, isHexZero,\n} from '@xylabs/hex'\nimport { UpgradeableBeacon__factory } from '@xyo-network/open-zeppelin-typechain'\nimport type { Provider } from 'ethers'\n\nexport const ERC1967_PROXY_IMPLEMENTATION_STORAGE_SLOT = '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc' as EthAddress\nexport const ERC1967_PROXY_BEACON_STORAGE_SLOT = '0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50' as EthAddress\nexport const ERC1967_PROXY_ADMIN_STORAGE_SLOT = '0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103' as EthAddress\nexport const ERC1967_PROXY_ROLLBACK_STORAGE_SLOT = '0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143' as EthAddress\n\nexport interface Erc1967DataSlots {\n admin?: EthAddress\n beacon?: EthAddress\n implementation?: EthAddress\n rollback?: EthAddress\n}\n\nexport interface Erc1967SlotStatus {\n address: string\n beacon?: {\n implementation?: Address\n }\n implementation: string\n slots: Erc1967DataSlots\n}\n\nconst readAddressFromSlot = async (provider: Provider, address: string, slot: string, block?: number) => {\n try {\n const slotValue = await provider.getStorage(address, slot, block)\n return asEthAddress(hexFromHexString(slotValue, { prefix: true }))\n } catch {\n return\n }\n}\n\nexport const getErc1967SlotStatus = async (provider: Provider, address: string, block?: number): Promise<Erc1967SlotStatus> => {\n const status: Erc1967SlotStatus = {\n address,\n implementation: address,\n slots: {\n admin: await readAddressFromSlot(provider, address, ERC1967_PROXY_ADMIN_STORAGE_SLOT, block),\n beacon: await readAddressFromSlot(provider, address, ERC1967_PROXY_BEACON_STORAGE_SLOT, block),\n implementation: await readAddressFromSlot(provider, address, ERC1967_PROXY_IMPLEMENTATION_STORAGE_SLOT, block),\n rollback: await readAddressFromSlot(provider, address, ERC1967_PROXY_ROLLBACK_STORAGE_SLOT, block),\n },\n }\n\n if (status.slots.implementation && !isHexZero(status.slots.implementation)) {\n status.implementation = `0x${BigInt(status.slots.implementation as string)\n .toString(16)\n .padStart(40, '0')}` as Address\n } else {\n if (status.slots.beacon && !isHexZero(status.slots.beacon)) {\n const beacon = UpgradeableBeacon__factory.connect(status.slots.beacon as string, { provider })\n try {\n const implementation = (await beacon.implementation(block ? { blockTag: block } : {})) as Address\n if (implementation) {\n status.beacon = { implementation }\n if (!isHexZero(implementation)) {\n status.implementation = implementation\n }\n }\n } catch (ex) {\n const error = ex as Error\n console.log(error.message)\n }\n }\n }\n\n return status\n}\n","import type { Payload } from '@xyo-network/payload-model'\n\nimport type { Erc1967SlotStatus } from './lib/index.ts'\n\nexport const Erc1967StatusSchema = 'network.xyo.erc1967.status'\nexport type Erc1967StatusSchema = typeof Erc1967StatusSchema\n\nexport type Erc1967Status = Payload<\n {\n address: string\n beacon?: Erc1967SlotStatus['beacon']\n block: number\n chainId: number\n implementation?: Erc1967SlotStatus['implementation']\n slots?: Erc1967SlotStatus['slots']\n },\n Erc1967StatusSchema\n>\n","import { assertEx } from '@xylabs/assert'\nimport type { Schema } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\nimport type {\n EvmAddress,\n EvmWitnessConfig, EvmWitnessParams,\n} from '@xyo-network/witness-evm-abstract'\nimport { AbstractEvmWitness, EvmAddressSchema } from '@xyo-network/witness-evm-abstract'\n\nimport { getErc1967SlotStatus } from './lib/index.ts'\nimport type { Erc1967Status } from './Payload.ts'\nimport { Erc1967StatusSchema } from './Payload.ts'\n\nexport const Erc1967WitnessConfigSchema = 'network.xyo.erc1967.witness.config'\nexport type Erc1967WitnessConfigSchema = typeof Erc1967WitnessConfigSchema\n\nexport type Erc1967WitnessConfig = EvmWitnessConfig<{ address?: string }, Erc1967WitnessConfigSchema>\n\nexport type Erc1967WitnessParams = EvmWitnessParams<Erc1967WitnessConfig>\n\nexport class Erc1967Witness<TParams extends Erc1967WitnessParams = Erc1967WitnessParams> extends AbstractEvmWitness<\n TParams,\n EvmAddress,\n Erc1967Status\n> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, Erc1967WitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = Erc1967WitnessConfigSchema\n\n protected override async observeHandler(inPayloads: EvmAddress[] = []): Promise<Erc1967Status[]> {\n await this.started('throw')\n // calling it here to make sure we rests the cache\n await this.getProviders()\n try {\n const observations = await Promise.all(\n inPayloads.filter(isPayloadOfSchemaType<EvmAddress>(EvmAddressSchema)).map(async ({ address }) => {\n const validatedAddress = assertEx(address ?? this.config.address, () => 'Missing address').toLowerCase()\n\n const provider = await this.getProvider(true, true)\n\n const block = await provider.getBlockNumber()\n\n const {\n beacon, implementation, slots,\n } = await getErc1967SlotStatus(provider, validatedAddress, block)\n\n const observation: Erc1967Status = {\n address: validatedAddress,\n beacon,\n block,\n chainId: Number((await provider.getNetwork()).chainId),\n implementation,\n schema: Erc1967StatusSchema,\n slots,\n }\n return observation\n }),\n )\n return observations\n } catch (ex) {\n const error = ex as Error\n console.log(`Error [${this.config.name}]: ${error.message}`)\n throw error\n }\n }\n}\n"],"mappings":";AACA;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AAU,KAAK,OAAO,IAAI,MAAM,MAAM,OAAO,EAAE;AAC3D,YAAM;AAAA,IACR;AAAA,EACF;AACF;","names":[]}
@@ -1,22 +0,0 @@
1
- import type { Address, EthAddress } from '@xylabs/hex';
2
- import type { Provider } from 'ethers';
3
- export declare const ERC1967_PROXY_IMPLEMENTATION_STORAGE_SLOT: EthAddress;
4
- export declare const ERC1967_PROXY_BEACON_STORAGE_SLOT: EthAddress;
5
- export declare const ERC1967_PROXY_ADMIN_STORAGE_SLOT: EthAddress;
6
- export declare const ERC1967_PROXY_ROLLBACK_STORAGE_SLOT: EthAddress;
7
- export interface Erc1967DataSlots {
8
- admin?: EthAddress;
9
- beacon?: EthAddress;
10
- implementation?: EthAddress;
11
- rollback?: EthAddress;
12
- }
13
- export interface Erc1967SlotStatus {
14
- address: string;
15
- beacon?: {
16
- implementation?: Address;
17
- };
18
- implementation: string;
19
- slots: Erc1967DataSlots;
20
- }
21
- export declare const getErc1967SlotStatus: (provider: Provider, address: string, block?: number) => Promise<Erc1967SlotStatus>;
22
- //# sourceMappingURL=getErc1967SlotStatus.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getErc1967SlotStatus.d.ts","sourceRoot":"","sources":["../../../src/lib/getErc1967SlotStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAKtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEtC,eAAO,MAAM,yCAAyC,EAA2E,UAAU,CAAA;AAC3I,eAAO,MAAM,iCAAiC,EAA2E,UAAU,CAAA;AACnI,eAAO,MAAM,gCAAgC,EAA2E,UAAU,CAAA;AAClI,eAAO,MAAM,mCAAmC,EAA2E,UAAU,CAAA;AAErI,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,cAAc,CAAC,EAAE,UAAU,CAAA;IAC3B,QAAQ,CAAC,EAAE,UAAU,CAAA;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE;QACP,cAAc,CAAC,EAAE,OAAO,CAAA;KACzB,CAAA;IACD,cAAc,EAAE,MAAM,CAAA;IACtB,KAAK,EAAE,gBAAgB,CAAA;CACxB;AAWD,eAAO,MAAM,oBAAoB,GAAU,UAAU,QAAQ,EAAE,SAAS,MAAM,EAAE,QAAQ,MAAM,KAAG,OAAO,CAAC,iBAAiB,CAmCzH,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './getErc1967SlotStatus.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA"}