@xyo-network/erc1822-witness 6.1.0 → 7.0.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/dist/neutral/Payload.d.ts +75 -6
- package/dist/neutral/Payload.d.ts.map +1 -1
- package/dist/neutral/Witness.d.ts.map +1 -1
- package/dist/neutral/index.mjs +34 -4
- package/dist/neutral/index.mjs.map +3 -3
- package/dist/neutral/lib/getErc1822SlotStatus.d.ts +13 -8
- package/dist/neutral/lib/getErc1822SlotStatus.d.ts.map +1 -1
- package/package.json +16 -16
|
@@ -1,14 +1,83 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { Erc1822SlotStatus } from './lib/index.ts';
|
|
1
|
+
import * as z from 'zod/mini';
|
|
3
2
|
export declare const Erc1822StatusSchema: "network.xyo.erc1822.status" & {
|
|
4
3
|
readonly __schema: true;
|
|
5
4
|
};
|
|
6
5
|
export type Erc1822StatusSchema = typeof Erc1822StatusSchema;
|
|
7
|
-
export
|
|
6
|
+
export declare const Erc1822StatusZod: z.ZodMiniObject<{
|
|
7
|
+
schema: z.ZodMiniLiteral<"network.xyo.erc1822.status" & {
|
|
8
|
+
readonly __schema: true;
|
|
9
|
+
}>;
|
|
10
|
+
address: z.ZodMiniString<string>;
|
|
11
|
+
block: z.ZodMiniNumber<number>;
|
|
12
|
+
chainId: z.ZodMiniNumber<number>;
|
|
13
|
+
implementation: z.ZodMiniOptional<z.ZodMiniCustom<import("@xylabs/sdk-js").EthAddress, import("@xylabs/sdk-js").EthAddress>>;
|
|
14
|
+
slots: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
15
|
+
implementation: z.ZodMiniOptional<z.ZodMiniCustom<import("@xylabs/sdk-js").EthAddress, import("@xylabs/sdk-js").EthAddress>>;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type Erc1822Status = z.infer<typeof Erc1822StatusZod>;
|
|
19
|
+
export declare const isErc1822Status: <T>(value: T) => value is T & {
|
|
20
|
+
schema: "network.xyo.erc1822.status" & {
|
|
21
|
+
readonly __schema: true;
|
|
22
|
+
};
|
|
8
23
|
address: string;
|
|
9
24
|
block: number;
|
|
10
25
|
chainId: number;
|
|
11
|
-
implementation?:
|
|
12
|
-
slots?:
|
|
13
|
-
|
|
26
|
+
implementation?: import("@xylabs/sdk-js").EthAddress | undefined;
|
|
27
|
+
slots?: {
|
|
28
|
+
implementation?: import("@xylabs/sdk-js").EthAddress | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
};
|
|
31
|
+
export declare const asErc1822Status: {
|
|
32
|
+
<T>(value: T): (T & {
|
|
33
|
+
schema: "network.xyo.erc1822.status" & {
|
|
34
|
+
readonly __schema: true;
|
|
35
|
+
};
|
|
36
|
+
address: string;
|
|
37
|
+
block: number;
|
|
38
|
+
chainId: number;
|
|
39
|
+
implementation?: import("@xylabs/sdk-js").EthAddress | undefined;
|
|
40
|
+
slots?: {
|
|
41
|
+
implementation?: import("@xylabs/sdk-js").EthAddress | undefined;
|
|
42
|
+
} | undefined;
|
|
43
|
+
}) | undefined;
|
|
44
|
+
<T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
|
|
45
|
+
schema: "network.xyo.erc1822.status" & {
|
|
46
|
+
readonly __schema: true;
|
|
47
|
+
};
|
|
48
|
+
address: string;
|
|
49
|
+
block: number;
|
|
50
|
+
chainId: number;
|
|
51
|
+
implementation?: import("@xylabs/sdk-js").EthAddress | undefined;
|
|
52
|
+
slots?: {
|
|
53
|
+
implementation?: import("@xylabs/sdk-js").EthAddress | undefined;
|
|
54
|
+
} | undefined;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export declare const toErc1822Status: {
|
|
58
|
+
<T>(value: T): (T & {
|
|
59
|
+
schema: "network.xyo.erc1822.status" & {
|
|
60
|
+
readonly __schema: true;
|
|
61
|
+
};
|
|
62
|
+
address: string;
|
|
63
|
+
block: number;
|
|
64
|
+
chainId: number;
|
|
65
|
+
implementation?: import("@xylabs/sdk-js").EthAddress | undefined;
|
|
66
|
+
slots?: {
|
|
67
|
+
implementation?: import("@xylabs/sdk-js").EthAddress | undefined;
|
|
68
|
+
} | undefined;
|
|
69
|
+
}) | undefined;
|
|
70
|
+
<T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
|
|
71
|
+
schema: "network.xyo.erc1822.status" & {
|
|
72
|
+
readonly __schema: true;
|
|
73
|
+
};
|
|
74
|
+
address: string;
|
|
75
|
+
block: number;
|
|
76
|
+
chainId: number;
|
|
77
|
+
implementation?: import("@xylabs/sdk-js").EthAddress | undefined;
|
|
78
|
+
slots?: {
|
|
79
|
+
implementation?: import("@xylabs/sdk-js").EthAddress | undefined;
|
|
80
|
+
} | undefined;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
14
83
|
//# sourceMappingURL=Payload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../src/Payload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../src/Payload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAI7B,eAAO,MAAM,mBAAmB;;CAA+C,CAAA;AAC/E,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAA;AAE5D,eAAO,MAAM,gBAAgB;;;;;;;;;;;iBAM3B,CAAA;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE5D,eAAO,MAAM,eAAe;;;;;;;;;;;CAAiC,CAAA;AAC7D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;CAAoD,CAAA;AAChF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;CAAoD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAEjD,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;;CAAuD,CAAA;AAC9F,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;
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAEjD,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;;CAAuD,CAAA;AAC9F,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;CAkCjG"}
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -4,7 +4,14 @@ import {
|
|
|
4
4
|
hexFromHexString,
|
|
5
5
|
isHexZero
|
|
6
6
|
} from "@xylabs/sdk-js";
|
|
7
|
+
import * as z from "zod/mini";
|
|
7
8
|
var ERC1822_PROXY_LOGIC_SLOT = "0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7";
|
|
9
|
+
var Erc1822DataSlotsZod = z.object({ implementation: z.optional(z.custom()) });
|
|
10
|
+
var Erc1822SlotStatusZod = z.object({
|
|
11
|
+
address: z.custom(),
|
|
12
|
+
implementation: z.custom(),
|
|
13
|
+
slots: Erc1822DataSlotsZod
|
|
14
|
+
});
|
|
8
15
|
var readAddressFromSlot = async (provider, address, slot, block) => {
|
|
9
16
|
try {
|
|
10
17
|
const slotValue = await provider.getStorage(address, slot, block);
|
|
@@ -19,15 +26,31 @@ var getErc1822SlotStatus = async (provider, address, block) => {
|
|
|
19
26
|
implementation: address,
|
|
20
27
|
slots: { implementation: await readAddressFromSlot(provider, address, ERC1822_PROXY_LOGIC_SLOT, block) }
|
|
21
28
|
};
|
|
22
|
-
if (status.slots.implementation &&
|
|
29
|
+
if (status.slots.implementation != null && isHexZero(status.slots.implementation) !== true) {
|
|
23
30
|
status.implementation = status.slots.implementation;
|
|
24
31
|
}
|
|
25
32
|
return status;
|
|
26
33
|
};
|
|
27
34
|
|
|
28
35
|
// src/Payload.ts
|
|
29
|
-
import {
|
|
36
|
+
import {
|
|
37
|
+
zodAsFactory,
|
|
38
|
+
zodIsFactory,
|
|
39
|
+
zodToFactory
|
|
40
|
+
} from "@xylabs/sdk-js";
|
|
41
|
+
import { asSchema, PayloadZodOfSchema } from "@xyo-network/sdk-js";
|
|
42
|
+
import * as z2 from "zod/mini";
|
|
30
43
|
var Erc1822StatusSchema = asSchema("network.xyo.erc1822.status", true);
|
|
44
|
+
var Erc1822StatusZod = z2.extend(PayloadZodOfSchema(Erc1822StatusSchema), {
|
|
45
|
+
address: z2.string(),
|
|
46
|
+
block: z2.number(),
|
|
47
|
+
chainId: z2.number(),
|
|
48
|
+
implementation: z2.optional(Erc1822SlotStatusZod.shape.implementation),
|
|
49
|
+
slots: z2.optional(Erc1822SlotStatusZod.shape.slots)
|
|
50
|
+
});
|
|
51
|
+
var isErc1822Status = zodIsFactory(Erc1822StatusZod);
|
|
52
|
+
var asErc1822Status = zodAsFactory(Erc1822StatusZod, "asErc1822Status");
|
|
53
|
+
var toErc1822Status = zodToFactory(Erc1822StatusZod, "toErc1822Status");
|
|
31
54
|
|
|
32
55
|
// src/Witness.ts
|
|
33
56
|
import { asEthAddress as asEthAddress2, assertEx } from "@xylabs/sdk-js";
|
|
@@ -47,10 +70,11 @@ var Erc1822Witness = class extends AbstractEvmWitness {
|
|
|
47
70
|
const provider = await this.getProvider(true, true);
|
|
48
71
|
const block = await provider.getBlockNumber();
|
|
49
72
|
const { implementation, slots } = await getErc1822SlotStatus(provider, validatedAddress, block);
|
|
73
|
+
const network = await provider.getNetwork();
|
|
50
74
|
const observation = {
|
|
51
75
|
address: validatedAddress,
|
|
52
76
|
block,
|
|
53
|
-
chainId: Number(
|
|
77
|
+
chainId: Number(network.chainId),
|
|
54
78
|
implementation,
|
|
55
79
|
schema: Erc1822StatusSchema,
|
|
56
80
|
slots
|
|
@@ -68,9 +92,15 @@ var Erc1822Witness = class extends AbstractEvmWitness {
|
|
|
68
92
|
};
|
|
69
93
|
export {
|
|
70
94
|
ERC1822_PROXY_LOGIC_SLOT,
|
|
95
|
+
Erc1822DataSlotsZod,
|
|
96
|
+
Erc1822SlotStatusZod,
|
|
71
97
|
Erc1822StatusSchema,
|
|
98
|
+
Erc1822StatusZod,
|
|
72
99
|
Erc1822Witness,
|
|
73
100
|
Erc1822WitnessConfigSchema,
|
|
74
|
-
|
|
101
|
+
asErc1822Status,
|
|
102
|
+
getErc1822SlotStatus,
|
|
103
|
+
isErc1822Status,
|
|
104
|
+
toErc1822Status
|
|
75
105
|
};
|
|
76
106
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/lib/getErc1822SlotStatus.ts", "../../src/Payload.ts", "../../src/Witness.ts"],
|
|
4
|
-
"sourcesContent": ["import type { EthAddress } from '@xylabs/sdk-js'\nimport {\n asEthAddress, hexFromHexString, isHexZero,\n} from '@xylabs/sdk-js'\nimport type { Provider } from 'ethers'\n\nexport const ERC1822_PROXY_LOGIC_SLOT = '0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7'\n\nexport
|
|
5
|
-
"mappings": ";AACA;AAAA,EACE;AAAA,EAAc;AAAA,EAAkB;AAAA,OAC3B;
|
|
6
|
-
"names": ["asEthAddress", "asSchema", "asSchema", "asEthAddress"]
|
|
4
|
+
"sourcesContent": ["import type { EthAddress } from '@xylabs/sdk-js'\nimport {\n asEthAddress, hexFromHexString, isHexZero,\n} from '@xylabs/sdk-js'\nimport type { Provider } from 'ethers'\nimport * as z from 'zod/mini'\n\nexport const ERC1822_PROXY_LOGIC_SLOT = '0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7'\n\nexport const Erc1822DataSlotsZod = z.object({ implementation: z.optional(z.custom<EthAddress>()) })\n\nexport type Erc1822DataSlots = z.infer<typeof Erc1822DataSlotsZod>\n\nexport const Erc1822SlotStatusZod = z.object({\n address: z.custom<EthAddress>(),\n implementation: z.custom<EthAddress>(),\n slots: Erc1822DataSlotsZod,\n})\n\nexport type Erc1822SlotStatus = z.infer<typeof Erc1822SlotStatusZod>\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 getErc1822SlotStatus = async (provider: Provider, address: EthAddress, block?: number): Promise<Erc1822SlotStatus> => {\n const status: Erc1822SlotStatus = {\n address,\n implementation: address,\n slots: { implementation: await readAddressFromSlot(provider, address, ERC1822_PROXY_LOGIC_SLOT, block) },\n }\n\n if (status.slots.implementation != null && isHexZero(status.slots.implementation) !== true) {\n status.implementation = status.slots.implementation\n }\n\n return status\n}\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport { asSchema, PayloadZodOfSchema } from '@xyo-network/sdk-js'\nimport * as z from 'zod/mini'\n\nimport { Erc1822SlotStatusZod } from './lib/index.ts'\n\nexport const Erc1822StatusSchema = asSchema('network.xyo.erc1822.status', true)\nexport type Erc1822StatusSchema = typeof Erc1822StatusSchema\n\nexport const Erc1822StatusZod = z.extend(PayloadZodOfSchema(Erc1822StatusSchema), {\n address: z.string(),\n block: z.number(),\n chainId: z.number(),\n implementation: z.optional(Erc1822SlotStatusZod.shape.implementation),\n slots: z.optional(Erc1822SlotStatusZod.shape.slots),\n})\n\nexport type Erc1822Status = z.infer<typeof Erc1822StatusZod>\n\nexport const isErc1822Status = zodIsFactory(Erc1822StatusZod)\nexport const asErc1822Status = zodAsFactory(Erc1822StatusZod, 'asErc1822Status')\nexport const toErc1822Status = zodToFactory(Erc1822StatusZod, 'toErc1822Status')\n", "import { asEthAddress, assertEx } from '@xylabs/sdk-js'\nimport type { Schema } from '@xyo-network/sdk-js'\nimport { asSchema, isPayloadOfSchemaType } from '@xyo-network/sdk-js'\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 { getErc1822SlotStatus } from './lib/index.ts'\nimport type { Erc1822Status } from './Payload.ts'\nimport { Erc1822StatusSchema } from './Payload.ts'\n\nexport const Erc1822WitnessConfigSchema = asSchema('network.xyo.erc1822.witness.config', true)\nexport type Erc1822WitnessConfigSchema = typeof Erc1822WitnessConfigSchema\n\nexport type Erc1822WitnessConfig = EvmWitnessConfig<{ address?: string }, Erc1822WitnessConfigSchema>\n\nexport type Erc1822WitnessParams = EvmWitnessParams<Erc1822WitnessConfig>\n\nexport class Erc1822Witness<TParams extends Erc1822WitnessParams = Erc1822WitnessParams> extends AbstractEvmWitness<\n TParams,\n EvmAddress,\n Erc1822Status\n> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, Erc1822WitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = Erc1822WitnessConfigSchema\n\n protected override async observeHandler(inPayloads: EvmAddress[] = []): Promise<Erc1822Status[]> {\n await this.startedAsync('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 = asEthAddress(assertEx(address ?? this.config.address, () => 'Missing address'), true)\n\n const provider = await this.getProvider(true, true)\n\n const block = await provider.getBlockNumber()\n\n const { implementation, slots } = await getErc1822SlotStatus(provider, validatedAddress, block)\n\n const network = await provider.getNetwork()\n const observation: Erc1822Status = {\n address: validatedAddress,\n block,\n chainId: Number(network.chainId),\n implementation,\n schema: Erc1822StatusSchema,\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"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["z", "asEthAddress", "asSchema", "asSchema", "asEthAddress"]
|
|
7
7
|
}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import type { EthAddress } from '@xylabs/sdk-js';
|
|
2
2
|
import type { Provider } from 'ethers';
|
|
3
|
+
import * as z from 'zod/mini';
|
|
3
4
|
export declare const ERC1822_PROXY_LOGIC_SLOT = "0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7";
|
|
4
|
-
export
|
|
5
|
-
implementation
|
|
6
|
-
}
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
export declare const Erc1822DataSlotsZod: z.ZodMiniObject<{
|
|
6
|
+
implementation: z.ZodMiniOptional<z.ZodMiniCustom<EthAddress, EthAddress>>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export type Erc1822DataSlots = z.infer<typeof Erc1822DataSlotsZod>;
|
|
9
|
+
export declare const Erc1822SlotStatusZod: z.ZodMiniObject<{
|
|
10
|
+
address: z.ZodMiniCustom<EthAddress, EthAddress>;
|
|
11
|
+
implementation: z.ZodMiniCustom<EthAddress, EthAddress>;
|
|
12
|
+
slots: z.ZodMiniObject<{
|
|
13
|
+
implementation: z.ZodMiniOptional<z.ZodMiniCustom<EthAddress, EthAddress>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export type Erc1822SlotStatus = z.infer<typeof Erc1822SlotStatusZod>;
|
|
12
17
|
export declare const getErc1822SlotStatus: (provider: Provider, address: EthAddress, block?: number) => Promise<Erc1822SlotStatus>;
|
|
13
18
|
//# sourceMappingURL=getErc1822SlotStatus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getErc1822SlotStatus.d.ts","sourceRoot":"","sources":["../../../src/lib/getErc1822SlotStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAIhD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"getErc1822SlotStatus.d.ts","sourceRoot":"","sources":["../../../src/lib/getErc1822SlotStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAIhD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAE7B,eAAO,MAAM,wBAAwB,uEAAuE,CAAA;AAE5G,eAAO,MAAM,mBAAmB;;iBAAmE,CAAA;AAEnG,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAElE,eAAO,MAAM,oBAAoB;;;;;;iBAI/B,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAWpE,eAAO,MAAM,oBAAoB,GAAU,UAAU,QAAQ,EAAE,SAAS,UAAU,EAAE,QAAQ,MAAM,KAAG,OAAO,CAAC,iBAAiB,CAY7H,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/erc1822-witness",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Typescript/Javascript Plugins for XYO Platform",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -35,22 +35,22 @@
|
|
|
35
35
|
"@metamask/providers": "^22.1.1",
|
|
36
36
|
"@noble/post-quantum": "~0.6.1",
|
|
37
37
|
"@opentelemetry/api": "^1.9.1",
|
|
38
|
-
"@opentelemetry/sdk-trace-base": "^2.
|
|
38
|
+
"@opentelemetry/sdk-trace-base": "^2.8.0",
|
|
39
39
|
"@scure/base": "^2.2.0",
|
|
40
40
|
"@scure/bip39": "~2.2.0",
|
|
41
|
-
"@xylabs/geo": "^6.1.
|
|
42
|
-
"@xylabs/sdk-js": "^6.1.
|
|
43
|
-
"@xylabs/threads": "^6.1.
|
|
44
|
-
"@xylabs/toolchain": "~8.
|
|
45
|
-
"@xylabs/tsconfig": "~8.
|
|
46
|
-
"@xylabs/vitest-extended": "^6.1.
|
|
47
|
-
"@xyo-network/sdk-js": "^
|
|
48
|
-
"@xyo-network/sdk-protocol-js": "~
|
|
49
|
-
"@xyo-network/witness-evm-abstract": "
|
|
41
|
+
"@xylabs/geo": "^6.1.3",
|
|
42
|
+
"@xylabs/sdk-js": "^6.1.3",
|
|
43
|
+
"@xylabs/threads": "^6.1.3",
|
|
44
|
+
"@xylabs/toolchain": "~8.2.7",
|
|
45
|
+
"@xylabs/tsconfig": "~8.2.7",
|
|
46
|
+
"@xylabs/vitest-extended": "^6.1.3",
|
|
47
|
+
"@xyo-network/sdk-js": "^7.0.0",
|
|
48
|
+
"@xyo-network/sdk-protocol-js": "~7.0",
|
|
49
|
+
"@xyo-network/witness-evm-abstract": "~7.0",
|
|
50
50
|
"ajv": "^8.20.0",
|
|
51
51
|
"async-mutex": "^0.5.0",
|
|
52
52
|
"debug": "~4.4.3",
|
|
53
|
-
"eslint": "^10.
|
|
53
|
+
"eslint": "^10.5.0",
|
|
54
54
|
"ethers": "^6.16.0",
|
|
55
55
|
"hash-wasm": "^4.12.0",
|
|
56
56
|
"idb": "^8.0.3",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"observable-fns": "~0.6.1",
|
|
59
59
|
"typescript": "~6.0.3",
|
|
60
60
|
"vite": "^8.0.16",
|
|
61
|
-
"vitest": "^4.1.
|
|
61
|
+
"vitest": "^4.1.9",
|
|
62
62
|
"webextension-polyfill": "^0.12.0",
|
|
63
63
|
"zod": "^4.4.3"
|
|
64
64
|
},
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
"@xylabs/geo": "^6.0",
|
|
74
74
|
"@xylabs/sdk-js": "^6.0",
|
|
75
75
|
"@xylabs/threads": "^6.0",
|
|
76
|
-
"@xyo-network/sdk-js": "^
|
|
77
|
-
"@xyo-network/sdk-protocol-js": "
|
|
78
|
-
"@xyo-network/witness-evm-abstract": "^
|
|
76
|
+
"@xyo-network/sdk-js": "^7.0",
|
|
77
|
+
"@xyo-network/sdk-protocol-js": "~7.0",
|
|
78
|
+
"@xyo-network/witness-evm-abstract": "^7.0",
|
|
79
79
|
"ajv": "^8.20",
|
|
80
80
|
"async-mutex": "^0.5",
|
|
81
81
|
"debug": "~4.4",
|