diff --git a/canister_ids.json b/canister_ids.json
index f4f66bc1c..7030ae77f 100644
--- a/canister_ids.json
+++ b/canister_ids.json
@@ -1,7 +1,4 @@
{
- "counter": {
- "ic": "teog5-mqaaa-aaaab-qaija-cai"
- },
"docs": {
"ic": "erxue-5aaaa-aaaab-qaagq-cai"
}
diff --git a/dfx.json b/dfx.json
index 55956830e..0995803d2 100644
--- a/dfx.json
+++ b/dfx.json
@@ -3,10 +3,6 @@
"docs": {
"type": "assets",
"source": ["docs/generated"]
- },
- "counter": {
- "type": "motoko",
- "main": "e2e/node/canisters/counter.mo"
}
}
}
diff --git a/docs/generated/changelog.html b/docs/generated/changelog.html
index 491c78ecd..35e9de864 100644
--- a/docs/generated/changelog.html
+++ b/docs/generated/changelog.html
@@ -12,6 +12,7 @@
Agent-JS Changelog
Version x.x.x
+ - feat: adds subnet metrics decoding to canisterStatus for `/subnet` path
-
chore: replaces use of localhost with 127.0.0.1 for better node 18 support. Also swaps
Jest for vitest, runs mitm against mainnet, and updates some packages
diff --git a/e2e/node/basic/canisterStatus.test.ts b/e2e/node/basic/canisterStatus.test.ts
index 10d36cee3..21dc0d00c 100644
--- a/e2e/node/basic/canisterStatus.test.ts
+++ b/e2e/node/basic/canisterStatus.test.ts
@@ -24,6 +24,7 @@ describe('canister status', () => {
const counterObj = await (await counter)();
const agent = new HttpAgent({
host: `http://127.0.0.1:${process.env.REPLICA_PORT ?? 4943}`,
+ verifyQuerySignatures: false,
});
const shouldThrow = async () => {
// eslint-disable-next-line no-useless-catch
diff --git a/e2e/node/basic/counter.test.ts b/e2e/node/basic/counter.test.ts
index 2ceb9b01d..bb346c412 100644
--- a/e2e/node/basic/counter.test.ts
+++ b/e2e/node/basic/counter.test.ts
@@ -9,7 +9,7 @@ describe('counter', () => {
} catch (error) {
console.error(error);
}
- });
+ }, 40000);
it('should submit distinct requests with nonce by default', async () => {
const { actor: counter } = await counterCanister();
const values = await Promise.all(new Array(4).fill(undefined).map(() => counter.inc_read()));
@@ -20,7 +20,7 @@ describe('counter', () => {
// Sets of unique results should be the same length
expect(set1.size).toBe(values.length);
expect(set2.size).toEqual(values2.length);
- });
+ }, 40000);
it('should submit duplicate requests if nonce is disabled', async () => {
const { actor: counter } = await noncelessCanister();
const values = await Promise.all(new Array(4).fill(undefined).map(() => counter.inc_read()));
@@ -29,15 +29,16 @@ describe('counter', () => {
const set2 = new Set(values2);
expect(set1.size < values.length || set2.size < values2.length).toBe(true);
- });
+ }, 40000);
it('should increment', async () => {
const { actor: counter } = await noncelessCanister();
+
expect(Number(await counter.read())).toEqual(0);
await counter.inc();
expect(Number(await counter.read())).toEqual(1);
await counter.inc();
expect(Number(await counter.read())).toEqual(2);
- });
+ }, 40000);
});
describe('retrytimes', () => {
it('should retry after a failure', async () => {
@@ -63,5 +64,5 @@ describe('retrytimes', () => {
} catch (error) {
console.error(error);
}
- });
+ }, 40000);
});
diff --git a/e2e/node/basic/mainnet.test.ts b/e2e/node/basic/mainnet.test.ts
index b2ff8dd6d..8d6118534 100644
--- a/e2e/node/basic/mainnet.test.ts
+++ b/e2e/node/basic/mainnet.test.ts
@@ -4,7 +4,6 @@ import { Ed25519KeyIdentity } from '@dfinity/identity';
import { Principal } from '@dfinity/principal';
import { describe, it, expect, vi } from 'vitest';
import { makeAgent } from '../utils/agent';
-import { createActor, canisterId } from '../canisters/declarations/counter';
const createWhoamiActor = async (identity: Identity) => {
const canisterId = 'ivcos-eqaaa-aaaab-qablq-cai';
@@ -114,12 +113,3 @@ describe('certified query', () => {
`);
});
});
-
-describe('call', async () => {
- it('should make update calls against mainnet', async () => {
- const counter = createActor(canisterId, { agentOptions: { host: 'https://ic0.app' } });
- await counter.reset();
- await counter.inc();
- expect(await counter.read()).toEqual(1n);
- }, 100_000);
-});
diff --git a/e2e/node/canisters/counter.mo b/e2e/node/canisters/counter.mo
index f325b8f1a..11cdf2be5 100644
--- a/e2e/node/canisters/counter.mo
+++ b/e2e/node/canisters/counter.mo
@@ -1,33 +1,28 @@
actor Counter {
- var cell : Nat = 0;
-
- public func greet(name : Text) : async Text {
- return "Hello, " # name # "!";
- };
-
- public query func queryGreet(name : Text) : async Text {
- return "Hello, " # name # "!";
- };
-
- public func inc() : async () {
- cell += 1;
- };
-
- public query func read() : async Nat {
- cell;
- };
-
- public func inc_read() : async Nat {
- cell += 1;
- cell;
- };
-
- public func write(n : Nat) : async () {
- cell := n;
- };
-
- public func reset() : async () {
- cell := 0;
- };
-
-};
+ var cell : Nat = 0;
+
+ public func greet(name : Text) : async Text {
+ return "Hello, " # name # "!";
+ };
+
+ public query func queryGreet(name : Text) : async Text {
+ return "Hello, " # name # "!";
+ };
+
+ public func inc() : async () {
+ cell += 1;
+ };
+
+ public query func read() : async Nat {
+ cell
+ };
+
+ public func inc_read() : async Nat {
+ cell += 1;
+ cell
+ };
+
+ public func write(n: Nat) : async () {
+ cell := n;
+ };
+}
diff --git a/e2e/node/canisters/counter.ts b/e2e/node/canisters/counter.ts
index 933802fc2..e022d62e8 100644
--- a/e2e/node/canisters/counter.ts
+++ b/e2e/node/canisters/counter.ts
@@ -11,17 +11,6 @@ let cache: {
actor: any;
} | null = null;
-const idl: IDL.InterfaceFactory = ({ IDL }) => {
- return IDL.Service({
- inc: IDL.Func([], [], []),
- inc_read: IDL.Func([], [IDL.Nat], []),
- read: IDL.Func([], [IDL.Nat], ['query']),
- greet: IDL.Func([IDL.Text], [IDL.Text], []),
- reset: IDL.Func([], [], []),
- queryGreet: IDL.Func([IDL.Text], [IDL.Text], ['query']),
- });
-};
-
/**
* Create a counter Actor + canisterId
*/
@@ -35,6 +24,15 @@ export default async function (): Promise<{
const canisterId = await Actor.createCanister({ agent: await agent });
await Actor.install({ module }, { canisterId, agent: await agent });
+ const idl: IDL.InterfaceFactory = ({ IDL }) => {
+ return IDL.Service({
+ inc: IDL.Func([], [], []),
+ inc_read: IDL.Func([], [IDL.Nat], []),
+ read: IDL.Func([], [IDL.Nat], ['query']),
+ greet: IDL.Func([IDL.Text], [IDL.Text], []),
+ queryGreet: IDL.Func([IDL.Text], [IDL.Text], ['query']),
+ });
+ };
cache = {
canisterId,
@@ -42,7 +40,7 @@ export default async function (): Promise<{
actor: Actor.createActor(idl, { canisterId, agent: await agent }) as any,
};
}
- await cache.actor.reset();
+
return cache;
}
/**
@@ -61,13 +59,20 @@ export async function noncelessCanister(): Promise<{
const canisterId = await Actor.createCanister({ agent: disableNonceAgent });
await Actor.install({ module }, { canisterId, agent: disableNonceAgent });
- const actor = Actor.createActor(idl, { canisterId, agent: disableNonceAgent }) as any;
+ const idl: IDL.InterfaceFactory = ({ IDL }) => {
+ return IDL.Service({
+ inc: IDL.Func([], [], []),
+ inc_read: IDL.Func([], [IDL.Nat], []),
+ read: IDL.Func([], [IDL.Nat], ['query']),
+ greet: IDL.Func([IDL.Text], [IDL.Text], []),
+ queryGreet: IDL.Func([IDL.Text], [IDL.Text], ['query']),
+ });
+ };
- await actor.reset();
return {
canisterId,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
- actor: actor,
+ actor: Actor.createActor(idl, { canisterId, agent: await disableNonceAgent }) as any,
};
}
@@ -86,7 +91,14 @@ export const createActor = async (options?: HttpAgentOptions) => {
const canisterId = await Actor.createCanister({ agent });
await Actor.install({ module }, { canisterId, agent });
- const actor = Actor.createActor(idl, { canisterId, agent }) as any;
- await actor.reset();
- return actor;
+ const idl: IDL.InterfaceFactory = ({ IDL }) => {
+ return IDL.Service({
+ inc: IDL.Func([], [], []),
+ inc_read: IDL.Func([], [IDL.Nat], []),
+ read: IDL.Func([], [IDL.Nat], ['query']),
+ greet: IDL.Func([IDL.Text], [IDL.Text], []),
+ queryGreet: IDL.Func([IDL.Text], [IDL.Text], ['query']),
+ });
+ };
+ return Actor.createActor(idl, { canisterId, agent }) as any;
};
diff --git a/e2e/node/canisters/counter.wasm b/e2e/node/canisters/counter.wasm
index 138725b5a..6836e205a 100644
Binary files a/e2e/node/canisters/counter.wasm and b/e2e/node/canisters/counter.wasm differ
diff --git a/e2e/node/canisters/declarations/counter/counter.did b/e2e/node/canisters/declarations/counter/counter.did
index 07791c406..6bddc58e9 100644
--- a/e2e/node/canisters/declarations/counter/counter.did
+++ b/e2e/node/canisters/declarations/counter/counter.did
@@ -4,6 +4,5 @@ service : {
inc_read: () -> (nat);
queryGreet: (text) -> (text) query;
read: () -> (nat) query;
- reset: () -> ();
write: (nat) -> ();
}
diff --git a/e2e/node/canisters/declarations/counter/counter.did.d.ts b/e2e/node/canisters/declarations/counter/counter.did.d.ts
index 84d5cb218..601b20f38 100644
--- a/e2e/node/canisters/declarations/counter/counter.did.d.ts
+++ b/e2e/node/canisters/declarations/counter/counter.did.d.ts
@@ -7,6 +7,5 @@ export interface _SERVICE {
inc_read: ActorMethod<[], bigint>;
queryGreet: ActorMethod<[string], string>;
read: ActorMethod<[], bigint>;
- reset: ActorMethod<[], undefined>;
write: ActorMethod<[bigint], undefined>;
}
diff --git a/e2e/node/canisters/declarations/counter/counter.did.js b/e2e/node/canisters/declarations/counter/counter.did.js
index 1eb17d1f7..553ad25d9 100644
--- a/e2e/node/canisters/declarations/counter/counter.did.js
+++ b/e2e/node/canisters/declarations/counter/counter.did.js
@@ -5,7 +5,6 @@ export const idlFactory = ({ IDL }) => {
inc_read: IDL.Func([], [IDL.Nat], []),
queryGreet: IDL.Func([IDL.Text], [IDL.Text], ['query']),
read: IDL.Func([], [IDL.Nat], ['query']),
- reset: IDL.Func([], [], []),
write: IDL.Func([IDL.Nat], [], []),
});
};
diff --git a/e2e/node/canisters/declarations/counter/index.ts b/e2e/node/canisters/declarations/counter/index.ts
index 8f8b52888..700142ab0 100644
--- a/e2e/node/canisters/declarations/counter/index.ts
+++ b/e2e/node/canisters/declarations/counter/index.ts
@@ -1,4 +1,4 @@
-import { Actor, ActorConfig, HttpAgent, HttpAgentOptions } from '@dfinity/agent';
+import { Actor, HttpAgent } from '@dfinity/agent';
// Imports and re-exports candid interface
import { idlFactory } from './counter.did.js';
@@ -9,12 +9,9 @@ export { idlFactory } from './counter.did.js';
* process.env.CANISTER_ID_
* beginning in dfx 0.15.0
*/
-export const canisterId = 'teog5-mqaaa-aaaab-qaija-cai';
+export const canisterId = process.env.CANISTER_ID_COUNTER || process.env.COUNTER_CANISTER_ID;
-export const createActor = (
- canisterId,
- options: { agentOptions?: HttpAgentOptions; actorOptions?: ActorConfig; agent?: HttpAgent } = {},
-) => {
+export const createActor = (canisterId, options = {}) => {
const agent = options.agent || new HttpAgent({ ...options.agentOptions });
if (options.agent && options.agentOptions) {
diff --git a/e2e/node/package.json b/e2e/node/package.json
index bed665529..36055d949 100644
--- a/e2e/node/package.json
+++ b/e2e/node/package.json
@@ -2,7 +2,6 @@
"private": true,
"name": "@do-not-publish/ic-node-e2e-tests",
"version": "0.19.3",
- "type": "module",
"scripts": {
"ci": "npm run e2e",
"e2e": "vitest",
diff --git a/e2e/node/tsconfig.json b/e2e/node/tsconfig.json
index aa844cb52..eb0694373 100644
--- a/e2e/node/tsconfig.json
+++ b/e2e/node/tsconfig.json
@@ -4,7 +4,7 @@
"incremental": true,
"target": "ESNext",
"module": "ESNext",
- "lib": ["ESNext"],
+ "lib": ["ES2023"],
"declaration": true,
"sourceMap": true,
"tsBuildInfoFile": "./build_info.json",
diff --git a/e2e/node/utils/agent.ts b/e2e/node/utils/agent.ts
index deceb1879..dd8aacd6c 100644
--- a/e2e/node/utils/agent.ts
+++ b/e2e/node/utils/agent.ts
@@ -14,11 +14,11 @@ export const makeAgent = async (options?: HttpAgentOptions) => {
const agent = new HttpAgent({
host: `http://127.0.0.1:${process.env.REPLICA_PORT ?? 4943}`,
fetch: global.fetch ?? fetch,
+ verifyQuerySignatures: false,
...options,
});
try {
await agent.fetchRootKey();
- await agent.syncTime();
} catch (_) {
//
}
diff --git a/e2e/node/vitest.config.ts b/e2e/node/vitest.config.ts
index 267d4b79f..285af81da 100644
--- a/e2e/node/vitest.config.ts
+++ b/e2e/node/vitest.config.ts
@@ -4,6 +4,5 @@ export default defineConfig({
test: {
setupFiles: ['./test-setup.ts'],
testTimeout: 100_000,
- threads: false,
},
});
diff --git a/package-lock.json b/package-lock.json
index fc362d9b0..800f58be2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8,6 +8,9 @@
"name": "@dfinity/agent-monorepo",
"version": "0.19.3",
"license": "Apache-2.0",
+ "dependencies": {
+ "vitest": "^0.34.6"
+ },
"devDependencies": {
"@jest/types": "28.1.3",
"@size-limit/preset-small-lib": "^8.2.6",
@@ -1965,7 +1968,7 @@
},
"node_modules/@jridgewell/set-array": {
"version": "1.1.2",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"engines": {
"node": ">=6.0.0"
@@ -1973,7 +1976,7 @@
},
"node_modules/@jridgewell/source-map": {
"version": "0.3.2",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"@jridgewell/gen-mapping": "^0.3.0",
@@ -1982,7 +1985,7 @@
},
"node_modules/@jridgewell/source-map/node_modules/@jridgewell/gen-mapping": {
"version": "0.3.2",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"@jridgewell/set-array": "^1.0.1",
@@ -2002,7 +2005,7 @@
"version": "0.3.20",
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz",
"integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==",
- "dev": true,
+ "devOptional": true,
"dependencies": {
"@jridgewell/resolve-uri": "^3.1.0",
"@jridgewell/sourcemap-codec": "^1.4.14"
@@ -4241,7 +4244,7 @@
},
"node_modules/@tootallnate/once": {
"version": "2.0.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"engines": {
"node": ">= 10"
@@ -4379,14 +4382,12 @@
"node_modules/@types/chai": {
"version": "4.3.9",
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.9.tgz",
- "integrity": "sha512-69TtiDzu0bcmKQv3yg1Zx409/Kd7r0b5F1PfpYJfSHzLGtB53547V4u+9iqKYsTu/O2ai6KTb0TInNpvuQ3qmg==",
- "dev": true
+ "integrity": "sha512-69TtiDzu0bcmKQv3yg1Zx409/Kd7r0b5F1PfpYJfSHzLGtB53547V4u+9iqKYsTu/O2ai6KTb0TInNpvuQ3qmg=="
},
"node_modules/@types/chai-subset": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.4.tgz",
"integrity": "sha512-CCWNXrJYSUIojZ1149ksLl3AN9cmZ5djf+yUoVVV+NuYrtydItQVlL2ZDqyC6M6O9LWRnVf8yYDxbXHO2TfQZg==",
- "dev": true,
"dependencies": {
"@types/chai": "*"
}
@@ -4870,7 +4871,6 @@
"version": "0.34.6",
"resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.34.6.tgz",
"integrity": "sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw==",
- "dev": true,
"dependencies": {
"@vitest/spy": "0.34.6",
"@vitest/utils": "0.34.6",
@@ -4884,7 +4884,6 @@
"version": "0.34.6",
"resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.34.6.tgz",
"integrity": "sha512-1CUQgtJSLF47NnhN+F9X2ycxUP0kLHQ/JWvNHbeBfwW8CzEGgeskzNnHDyv1ieKTltuR6sdIHV+nmR6kPxQqzQ==",
- "dev": true,
"dependencies": {
"@vitest/utils": "0.34.6",
"p-limit": "^4.0.0",
@@ -4898,7 +4897,6 @@
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz",
"integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==",
- "dev": true,
"dependencies": {
"yocto-queue": "^1.0.0"
},
@@ -4913,7 +4911,6 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz",
"integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==",
- "dev": true,
"engines": {
"node": ">=12.20"
},
@@ -4925,7 +4922,6 @@
"version": "0.34.6",
"resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.34.6.tgz",
"integrity": "sha512-B3OZqYn6k4VaN011D+ve+AA4whM4QkcwcrwaKwAbyyvS/NB1hCWjFIBQxAQQSQir9/RtyAAGuq+4RJmbn2dH4w==",
- "dev": true,
"dependencies": {
"magic-string": "^0.30.1",
"pathe": "^1.1.1",
@@ -4939,7 +4935,6 @@
"version": "29.6.3",
"resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz",
"integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==",
- "dev": true,
"dependencies": {
"@sinclair/typebox": "^0.27.8"
},
@@ -4950,14 +4945,12 @@
"node_modules/@vitest/snapshot/node_modules/@sinclair/typebox": {
"version": "0.27.8",
"resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz",
- "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==",
- "dev": true
+ "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA=="
},
"node_modules/@vitest/snapshot/node_modules/ansi-styles": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz",
"integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==",
- "dev": true,
"engines": {
"node": ">=10"
},
@@ -4969,7 +4962,6 @@
"version": "29.7.0",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz",
"integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==",
- "dev": true,
"dependencies": {
"@jest/schemas": "^29.6.3",
"ansi-styles": "^5.0.0",
@@ -4983,7 +4975,6 @@
"version": "0.34.6",
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.34.6.tgz",
"integrity": "sha512-xaCvneSaeBw/cz8ySmF7ZwGvL0lBjfvqc1LpQ/vcdHEvpLn3Ff1vAvjw+CoGn0802l++5L/pxb7whwcWAw+DUQ==",
- "dev": true,
"dependencies": {
"tinyspy": "^2.1.1"
},
@@ -4995,7 +4986,6 @@
"version": "0.34.6",
"resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.6.tgz",
"integrity": "sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==",
- "dev": true,
"dependencies": {
"diff-sequences": "^29.4.3",
"loupe": "^2.3.6",
@@ -5009,7 +4999,6 @@
"version": "29.6.3",
"resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz",
"integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==",
- "dev": true,
"dependencies": {
"@sinclair/typebox": "^0.27.8"
},
@@ -5020,14 +5009,12 @@
"node_modules/@vitest/utils/node_modules/@sinclair/typebox": {
"version": "0.27.8",
"resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz",
- "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==",
- "dev": true
+ "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA=="
},
"node_modules/@vitest/utils/node_modules/ansi-styles": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz",
"integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==",
- "dev": true,
"engines": {
"node": ">=10"
},
@@ -5039,7 +5026,6 @@
"version": "29.6.3",
"resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz",
"integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==",
- "dev": true,
"engines": {
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
}
@@ -5048,7 +5034,6 @@
"version": "29.7.0",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz",
"integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==",
- "dev": true,
"dependencies": {
"@jest/schemas": "^29.6.3",
"ansi-styles": "^5.0.0",
@@ -5265,7 +5250,7 @@
},
"node_modules/abab": {
"version": "2.0.6",
- "dev": true,
+ "devOptional": true,
"license": "BSD-3-Clause"
},
"node_modules/abortcontroller-polyfill": {
@@ -5298,7 +5283,7 @@
},
"node_modules/acorn-globals": {
"version": "6.0.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"acorn": "^7.1.1",
@@ -5307,7 +5292,7 @@
},
"node_modules/acorn-globals/node_modules/acorn": {
"version": "7.4.1",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"bin": {
"acorn": "bin/acorn"
@@ -5334,7 +5319,7 @@
},
"node_modules/acorn-walk": {
"version": "7.2.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"engines": {
"node": ">=0.4.0"
@@ -5342,7 +5327,7 @@
},
"node_modules/agent-base": {
"version": "6.0.2",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"debug": "4"
@@ -5621,7 +5606,6 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
"integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==",
- "dev": true,
"engines": {
"node": "*"
}
@@ -5675,7 +5659,7 @@
},
"node_modules/asynckit": {
"version": "0.4.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT"
},
"node_modules/at-least-node": {
@@ -6163,7 +6147,7 @@
},
"node_modules/browser-process-hrtime": {
"version": "1.0.0",
- "dev": true,
+ "devOptional": true,
"license": "BSD-2-Clause"
},
"node_modules/browserslist": {
@@ -6262,7 +6246,7 @@
},
"node_modules/buffer-from": {
"version": "1.1.2",
- "dev": true,
+ "devOptional": true,
"license": "MIT"
},
"node_modules/builtin-modules": {
@@ -6293,7 +6277,6 @@
"version": "6.7.14",
"resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz",
"integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==",
- "dev": true,
"engines": {
"node": ">=8"
}
@@ -6380,7 +6363,6 @@
"version": "4.3.10",
"resolved": "https://registry.npmjs.org/chai/-/chai-4.3.10.tgz",
"integrity": "sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==",
- "dev": true,
"dependencies": {
"assertion-error": "^1.1.0",
"check-error": "^1.0.3",
@@ -6432,7 +6414,6 @@
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz",
"integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==",
- "dev": true,
"dependencies": {
"get-func-name": "^2.0.2"
},
@@ -6740,7 +6721,7 @@
},
"node_modules/combined-stream": {
"version": "1.0.8",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"delayed-stream": "~1.0.0"
@@ -7155,12 +7136,12 @@
},
"node_modules/cssom": {
"version": "0.5.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT"
},
"node_modules/cssstyle": {
"version": "2.3.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"cssom": "~0.3.6"
@@ -7171,7 +7152,7 @@
},
"node_modules/cssstyle/node_modules/cssom": {
"version": "0.3.8",
- "dev": true,
+ "devOptional": true,
"license": "MIT"
},
"node_modules/culvert": {
@@ -7504,7 +7485,7 @@
},
"node_modules/data-urls": {
"version": "3.0.2",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"abab": "^2.0.6",
@@ -7517,7 +7498,7 @@
},
"node_modules/data-urls/node_modules/whatwg-url": {
"version": "11.0.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"tr46": "^3.0.0",
@@ -7565,7 +7546,6 @@
},
"node_modules/debug": {
"version": "4.3.4",
- "dev": true,
"license": "MIT",
"dependencies": {
"ms": "2.1.2"
@@ -7581,7 +7561,7 @@
},
"node_modules/decimal.js": {
"version": "10.4.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT"
},
"node_modules/dedent": {
@@ -7593,7 +7573,6 @@
"version": "4.1.3",
"resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz",
"integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==",
- "dev": true,
"dependencies": {
"type-detect": "^4.0.0"
},
@@ -7664,7 +7643,7 @@
},
"node_modules/delayed-stream": {
"version": "1.0.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"engines": {
"node": ">=0.4.0"
@@ -7810,7 +7789,7 @@
},
"node_modules/domexception": {
"version": "4.0.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"webidl-conversions": "^7.0.0"
@@ -8551,7 +8530,7 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz",
"integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==",
- "dev": true,
+ "devOptional": true,
"dependencies": {
"esprima": "^4.0.1",
"estraverse": "^5.2.0",
@@ -8570,7 +8549,7 @@
},
"node_modules/escodegen/node_modules/estraverse": {
"version": "5.3.0",
- "dev": true,
+ "devOptional": true,
"license": "BSD-2-Clause",
"engines": {
"node": ">=4.0"
@@ -8886,7 +8865,7 @@
},
"node_modules/esprima": {
"version": "4.0.1",
- "dev": true,
+ "devOptional": true,
"license": "BSD-2-Clause",
"bin": {
"esparse": "bin/esparse.js",
@@ -8944,7 +8923,7 @@
},
"node_modules/esutils": {
"version": "2.0.3",
- "dev": true,
+ "devOptional": true,
"license": "BSD-2-Clause",
"engines": {
"node": ">=0.10.0"
@@ -9449,7 +9428,7 @@
},
"node_modules/form-data": {
"version": "4.0.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"asynckit": "^0.4.0",
@@ -9516,7 +9495,6 @@
},
"node_modules/fsevents": {
"version": "2.3.2",
- "dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -9581,7 +9559,6 @@
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz",
"integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==",
- "dev": true,
"engines": {
"node": "*"
}
@@ -9956,7 +9933,7 @@
},
"node_modules/html-encoding-sniffer": {
"version": "3.0.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"whatwg-encoding": "^2.0.0"
@@ -10129,7 +10106,7 @@
},
"node_modules/http-proxy-agent": {
"version": "5.0.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"@tootallnate/once": "2",
@@ -10179,7 +10156,7 @@
},
"node_modules/https-proxy-agent": {
"version": "5.0.1",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"agent-base": "6",
@@ -10213,7 +10190,7 @@
},
"node_modules/iconv-lite": {
"version": "0.6.3",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"safer-buffer": ">= 2.1.2 < 3.0.0"
@@ -10638,7 +10615,7 @@
},
"node_modules/is-potential-custom-element-name": {
"version": "1.0.1",
- "dev": true,
+ "devOptional": true,
"license": "MIT"
},
"node_modules/is-promise": {
@@ -12482,7 +12459,7 @@
},
"node_modules/jsdom": {
"version": "19.0.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"abab": "^2.0.5",
@@ -12583,7 +12560,6 @@
},
"node_modules/jsonc-parser": {
"version": "3.2.0",
- "dev": true,
"license": "MIT"
},
"node_modules/jsonfile": {
@@ -12742,7 +12718,6 @@
"version": "0.4.3",
"resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz",
"integrity": "sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==",
- "dev": true,
"engines": {
"node": ">=14"
},
@@ -12985,7 +12960,6 @@
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz",
"integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==",
- "dev": true,
"dependencies": {
"get-func-name": "^2.0.1"
}
@@ -13026,7 +13000,6 @@
"version": "0.30.5",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz",
"integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==",
- "dev": true,
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.4.15"
},
@@ -13182,7 +13155,7 @@
},
"node_modules/mime-db": {
"version": "1.52.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"engines": {
"node": ">= 0.6"
@@ -13190,7 +13163,7 @@
},
"node_modules/mime-types": {
"version": "2.1.35",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"mime-db": "1.52.0"
@@ -13250,7 +13223,6 @@
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.2.tgz",
"integrity": "sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==",
- "dev": true,
"dependencies": {
"acorn": "^8.10.0",
"pathe": "^1.1.1",
@@ -13274,7 +13246,6 @@
},
"node_modules/ms": {
"version": "2.1.2",
- "dev": true,
"license": "MIT"
},
"node_modules/msgpackr": {
@@ -13346,7 +13317,6 @@
"version": "3.3.6",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",
- "dev": true,
"funding": [
{
"type": "github",
@@ -13607,7 +13577,7 @@
},
"node_modules/nwsapi": {
"version": "2.2.2",
- "dev": true,
+ "devOptional": true,
"license": "MIT"
},
"node_modules/object-inspect": {
@@ -14038,7 +14008,7 @@
},
"node_modules/parse5": {
"version": "6.0.1",
- "dev": true,
+ "devOptional": true,
"license": "MIT"
},
"node_modules/parseurl": {
@@ -14125,14 +14095,12 @@
"node_modules/pathe": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz",
- "integrity": "sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==",
- "dev": true
+ "integrity": "sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q=="
},
"node_modules/pathval": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz",
"integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==",
- "dev": true,
"engines": {
"node": "*"
}
@@ -14165,7 +14133,6 @@
},
"node_modules/picocolors": {
"version": "1.0.0",
- "dev": true,
"license": "ISC"
},
"node_modules/picomatch": {
@@ -14303,7 +14270,6 @@
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz",
"integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==",
- "dev": true,
"dependencies": {
"jsonc-parser": "^3.2.0",
"mlly": "^1.2.0",
@@ -14593,7 +14559,6 @@
"version": "8.4.31",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz",
"integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==",
- "dev": true,
"funding": [
{
"type": "opencollective",
@@ -15055,7 +15020,7 @@
},
"node_modules/psl": {
"version": "1.9.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT"
},
"node_modules/pump": {
@@ -15069,7 +15034,7 @@
},
"node_modules/punycode": {
"version": "2.1.1",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"engines": {
"node": ">=6"
@@ -15113,7 +15078,7 @@
},
"node_modules/querystringify": {
"version": "2.2.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT"
},
"node_modules/queue-microtask": {
@@ -15182,7 +15147,6 @@
},
"node_modules/react-is": {
"version": "18.2.0",
- "dev": true,
"license": "MIT"
},
"node_modules/react-refresh": {
@@ -15396,7 +15360,7 @@
},
"node_modules/requires-port": {
"version": "1.0.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT"
},
"node_modules/resolve": {
@@ -15519,7 +15483,6 @@
"version": "3.29.4",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz",
"integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==",
- "dev": true,
"bin": {
"rollup": "dist/bin/rollup"
},
@@ -15592,7 +15555,7 @@
},
"node_modules/safer-buffer": {
"version": "2.1.2",
- "dev": true,
+ "devOptional": true,
"license": "MIT"
},
"node_modules/sax": {
@@ -15602,7 +15565,7 @@
},
"node_modules/saxes": {
"version": "5.0.1",
- "dev": true,
+ "devOptional": true,
"license": "ISC",
"dependencies": {
"xmlchars": "^2.2.0"
@@ -15882,8 +15845,7 @@
"node_modules/siginfo": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz",
- "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==",
- "dev": true
+ "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g=="
},
"node_modules/signal-exit": {
"version": "3.0.7",
@@ -16059,7 +16021,7 @@
},
"node_modules/source-map": {
"version": "0.6.1",
- "dev": true,
+ "devOptional": true,
"license": "BSD-3-Clause",
"engines": {
"node": ">=0.10.0"
@@ -16067,7 +16029,6 @@
},
"node_modules/source-map-js": {
"version": "1.0.2",
- "dev": true,
"license": "BSD-3-Clause",
"engines": {
"node": ">=0.10.0"
@@ -16204,8 +16165,7 @@
"node_modules/stackback": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",
- "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==",
- "dev": true
+ "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw=="
},
"node_modules/statuses": {
"version": "2.0.1",
@@ -16218,8 +16178,7 @@
"node_modules/std-env": {
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/std-env/-/std-env-3.4.3.tgz",
- "integrity": "sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q==",
- "dev": true
+ "integrity": "sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q=="
},
"node_modules/stream": {
"version": "0.0.2",
@@ -16356,7 +16315,6 @@
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz",
"integrity": "sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==",
- "dev": true,
"dependencies": {
"acorn": "^8.10.0"
},
@@ -16530,7 +16488,7 @@
},
"node_modules/symbol-tree": {
"version": "3.2.4",
- "dev": true,
+ "devOptional": true,
"license": "MIT"
},
"node_modules/systeminformation": {
@@ -16596,7 +16554,7 @@
},
"node_modules/terser": {
"version": "5.15.0",
- "dev": true,
+ "devOptional": true,
"license": "BSD-2-Clause",
"dependencies": {
"@jridgewell/source-map": "^0.3.2",
@@ -16681,7 +16639,7 @@
},
"node_modules/terser/node_modules/source-map-support": {
"version": "0.5.21",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"buffer-from": "^1.0.0",
@@ -16744,14 +16702,12 @@
"node_modules/tinybench": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.5.1.tgz",
- "integrity": "sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==",
- "dev": true
+ "integrity": "sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg=="
},
"node_modules/tinypool": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.7.0.tgz",
"integrity": "sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww==",
- "dev": true,
"engines": {
"node": ">=14.0.0"
}
@@ -16760,7 +16716,6 @@
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.0.tgz",
"integrity": "sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg==",
- "dev": true,
"engines": {
"node": ">=14.0.0"
}
@@ -16813,7 +16768,7 @@
"version": "4.1.3",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz",
"integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==",
- "dev": true,
+ "devOptional": true,
"dependencies": {
"psl": "^1.1.33",
"punycode": "^2.1.1",
@@ -16826,7 +16781,7 @@
},
"node_modules/tr46": {
"version": "3.0.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"punycode": "^2.1.1"
@@ -17114,7 +17069,6 @@
},
"node_modules/type-detect": {
"version": "4.0.8",
- "dev": true,
"license": "MIT",
"engines": {
"node": ">=4"
@@ -17249,8 +17203,7 @@
"node_modules/ufo": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.1.tgz",
- "integrity": "sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==",
- "dev": true
+ "integrity": "sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw=="
},
"node_modules/unbox-primitive": {
"version": "1.0.2",
@@ -17268,7 +17221,7 @@
},
"node_modules/universalify": {
"version": "0.2.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"engines": {
"node": ">= 4.0.0"
@@ -17334,7 +17287,7 @@
},
"node_modules/url-parse": {
"version": "1.5.10",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"querystringify": "^2.1.1",
@@ -17440,7 +17393,6 @@
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/vite/-/vite-4.5.0.tgz",
"integrity": "sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==",
- "dev": true,
"dependencies": {
"esbuild": "^0.18.10",
"postcss": "^8.4.27",
@@ -17495,7 +17447,6 @@
"version": "0.34.6",
"resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.34.6.tgz",
"integrity": "sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==",
- "dev": true,
"dependencies": {
"cac": "^6.7.14",
"debug": "^4.3.4",
@@ -17521,7 +17472,6 @@
"cpu": [
"arm"
],
- "dev": true,
"optional": true,
"os": [
"android"
@@ -17537,7 +17487,6 @@
"cpu": [
"arm64"
],
- "dev": true,
"optional": true,
"os": [
"android"
@@ -17553,7 +17502,6 @@
"cpu": [
"x64"
],
- "dev": true,
"optional": true,
"os": [
"android"
@@ -17569,7 +17517,6 @@
"cpu": [
"arm64"
],
- "dev": true,
"optional": true,
"os": [
"darwin"
@@ -17585,7 +17532,6 @@
"cpu": [
"x64"
],
- "dev": true,
"optional": true,
"os": [
"darwin"
@@ -17601,7 +17547,6 @@
"cpu": [
"arm64"
],
- "dev": true,
"optional": true,
"os": [
"freebsd"
@@ -17617,7 +17562,6 @@
"cpu": [
"x64"
],
- "dev": true,
"optional": true,
"os": [
"freebsd"
@@ -17633,7 +17577,6 @@
"cpu": [
"arm"
],
- "dev": true,
"optional": true,
"os": [
"linux"
@@ -17649,7 +17592,6 @@
"cpu": [
"arm64"
],
- "dev": true,
"optional": true,
"os": [
"linux"
@@ -17665,7 +17607,6 @@
"cpu": [
"ia32"
],
- "dev": true,
"optional": true,
"os": [
"linux"
@@ -17681,7 +17622,6 @@
"cpu": [
"loong64"
],
- "dev": true,
"optional": true,
"os": [
"linux"
@@ -17697,7 +17637,6 @@
"cpu": [
"mips64el"
],
- "dev": true,
"optional": true,
"os": [
"linux"
@@ -17713,7 +17652,6 @@
"cpu": [
"ppc64"
],
- "dev": true,
"optional": true,
"os": [
"linux"
@@ -17729,7 +17667,6 @@
"cpu": [
"riscv64"
],
- "dev": true,
"optional": true,
"os": [
"linux"
@@ -17745,7 +17682,6 @@
"cpu": [
"s390x"
],
- "dev": true,
"optional": true,
"os": [
"linux"
@@ -17761,7 +17697,6 @@
"cpu": [
"x64"
],
- "dev": true,
"optional": true,
"os": [
"linux"
@@ -17777,7 +17712,6 @@
"cpu": [
"x64"
],
- "dev": true,
"optional": true,
"os": [
"netbsd"
@@ -17793,7 +17727,6 @@
"cpu": [
"x64"
],
- "dev": true,
"optional": true,
"os": [
"openbsd"
@@ -17809,7 +17742,6 @@
"cpu": [
"x64"
],
- "dev": true,
"optional": true,
"os": [
"sunos"
@@ -17825,7 +17757,6 @@
"cpu": [
"arm64"
],
- "dev": true,
"optional": true,
"os": [
"win32"
@@ -17841,7 +17772,6 @@
"cpu": [
"ia32"
],
- "dev": true,
"optional": true,
"os": [
"win32"
@@ -17857,7 +17787,6 @@
"cpu": [
"x64"
],
- "dev": true,
"optional": true,
"os": [
"win32"
@@ -17870,7 +17799,6 @@
"version": "0.18.20",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz",
"integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==",
- "dev": true,
"hasInstallScript": true,
"bin": {
"esbuild": "bin/esbuild"
@@ -17907,7 +17835,6 @@
"version": "0.34.6",
"resolved": "https://registry.npmjs.org/vitest/-/vitest-0.34.6.tgz",
"integrity": "sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q==",
- "dev": true,
"dependencies": {
"@types/chai": "^4.3.5",
"@types/chai-subset": "^1.3.3",
@@ -17984,7 +17911,6 @@
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
- "dev": true,
"engines": {
"node": ">=0.4.0"
}
@@ -18025,7 +17951,7 @@
},
"node_modules/w3c-hr-time": {
"version": "1.0.2",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"browser-process-hrtime": "^1.0.0"
@@ -18033,7 +17959,7 @@
},
"node_modules/w3c-xmlserializer": {
"version": "3.0.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"xml-name-validator": "^4.0.0"
@@ -18107,7 +18033,7 @@
},
"node_modules/webidl-conversions": {
"version": "7.0.0",
- "dev": true,
+ "devOptional": true,
"license": "BSD-2-Clause",
"engines": {
"node": ">=12"
@@ -18430,7 +18356,7 @@
},
"node_modules/whatwg-encoding": {
"version": "2.0.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"iconv-lite": "0.6.3"
@@ -18445,7 +18371,7 @@
},
"node_modules/whatwg-mimetype": {
"version": "3.0.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"engines": {
"node": ">=12"
@@ -18453,7 +18379,7 @@
},
"node_modules/whatwg-url": {
"version": "10.0.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"tr46": "^3.0.0",
@@ -18515,7 +18441,6 @@
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz",
"integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==",
- "dev": true,
"dependencies": {
"siginfo": "^2.0.0",
"stackback": "0.0.2"
@@ -18621,7 +18546,7 @@
},
"node_modules/ws": {
"version": "8.8.1",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"engines": {
"node": ">=10.0.0"
@@ -18641,7 +18566,7 @@
},
"node_modules/xml-name-validator": {
"version": "4.0.0",
- "dev": true,
+ "devOptional": true,
"license": "Apache-2.0",
"engines": {
"node": ">=12"
@@ -18649,7 +18574,7 @@
},
"node_modules/xmlchars": {
"version": "2.2.0",
- "dev": true,
+ "devOptional": true,
"license": "MIT"
},
"node_modules/xxhash-wasm": {
diff --git a/packages/agent/src/agent/http/call.test.ts b/packages/agent/src/agent/http/call.test.ts
new file mode 100644
index 000000000..9eb1d9f59
--- /dev/null
+++ b/packages/agent/src/agent/http/call.test.ts
@@ -0,0 +1,49 @@
+import { Actor } from '../../actor';
+import { AnonymousIdentity } from '../../auth';
+import { Call } from './call';
+import { IDL } from '@dfinity/candid';
+import { HttpAgent } from '.';
+import { Principal } from '@dfinity/principal';
+
+const setup = () =>
+ new Call({
+ identity: new AnonymousIdentity(),
+ canisterId: 'ivcos-eqaaa-aaaab-qablq-cai',
+ callArgs: {
+ arg: new ArrayBuffer(0),
+ methodName: 'whoami',
+ },
+ maxTries: 3,
+ fetchConfig: {
+ body: new ArrayBuffer(0),
+ method: 'POST',
+ headers: {},
+ fetch,
+ host: 'https://icp-api.io',
+ },
+ });
+
+jest.setTimeout(30000);
+test('makes a call', async () => {
+ jest.useRealTimers();
+ const call = setup();
+ expect(call).toBeInstanceOf(Call);
+ const { response, requestId } = await call.request();
+ expect(response).toBeTruthy();
+});
+
+test('actor', async () => {
+ const actor = Actor.createActor(
+ () => {
+ return IDL.Service({
+ whoami: IDL.Func([], [IDL.Principal], ['query']),
+ });
+ },
+ {
+ agent: new HttpAgent({ host: 'https://icp-api.io' }),
+ canisterId: 'ivcos-eqaaa-aaaab-qablq-cai',
+ },
+ ) as Actor & { whoami: () => Promise };
+ const whoami = await actor.whoami();
+ expect(whoami.toText()).toBe('2vxsx-fae');
+});
diff --git a/packages/agent/src/agent/http/call.ts b/packages/agent/src/agent/http/call.ts
new file mode 100644
index 000000000..c55fc0458
--- /dev/null
+++ b/packages/agent/src/agent/http/call.ts
@@ -0,0 +1,247 @@
+import { Principal } from '@dfinity/principal';
+import { Identity } from '../../auth';
+import { Expiry, httpHeadersTransform } from './transforms';
+import {
+ CallRequest,
+ Endpoint,
+ HttpAgentRequest,
+ HttpAgentRequestTransformFn,
+ HttpHeaderField,
+ SubmitRequestType,
+} from './types';
+
+import * as cbor from '../../cbor';
+import { SubmitResponse } from '../api';
+import { AgentError } from '../../errors';
+import { RequestId, requestIdOf } from '../../request_id';
+
+const DEFAULT_INGRESS_EXPIRY_DELTA_IN_MSECS = 5 * 60 * 1000;
+
+export type CallOptions = {
+ canisterId: Principal | string;
+ callArgs: {
+ methodName: string;
+ arg: ArrayBuffer;
+ effectiveCanisterId?: Principal | string;
+ };
+ maxTries: number;
+ identity: Identity | Promise;
+ fetchConfig: FetchConfig;
+ callOptions?: Record;
+ credentials?: string;
+};
+
+export type CallResponse = {
+ response: {
+ ok: boolean;
+ status: number;
+ statusText: string;
+ body: {
+ error_code?: string | undefined;
+ reject_code: number;
+ reject_message: string;
+ } | null;
+ headers: HttpHeaderField[];
+ };
+ requestId: RequestId;
+};
+
+export type FetchConfig = {
+ body: ArrayBuffer;
+ method: string;
+ headers: Record;
+ fetch: typeof fetch;
+ host: string;
+};
+
+class AgentCallError extends AgentError {
+ constructor(message: string) {
+ super(message);
+ }
+}
+
+/**
+ * Call is a wrapper around a call to a canister.
+ * It manages the state of the call and provides
+ * methods for retrying the call.
+ */
+export class Call {
+ #options: CallOptions;
+ #tries = 0;
+ #maxTries = 3;
+ #timeDiffMsecs = 0;
+ #pipeline: HttpAgentRequestTransformFn[] = [];
+ #lastError?: AgentCallError;
+
+ constructor(options: CallOptions) {
+ this.#options = options;
+ }
+
+ get options() {
+ return this.#options;
+ }
+
+ get tries() {
+ return this.#tries;
+ }
+
+ get maxTries() {
+ return this.#maxTries;
+ }
+
+ public async request(): Promise {
+ this.#tries; //?
+ while (this.#tries < this.#maxTries) {
+ try {
+ return await this.#try();
+ } catch (e) {
+ console.log(e);
+ }
+ }
+ throw new AgentCallError('Max tries reached');
+ }
+
+ async #exponentialBackoff(cb: () => Promise): Promise {
+ const delay = 2 ** this.#tries * 100;
+ delay;
+ // await new Promise(resolve => setTimeout(resolve, delay));
+ return await cb();
+ }
+
+ async #try(): Promise {
+ if (this.#tries >= this.#maxTries) {
+ if (this.#lastError) {
+ throw this.#lastError;
+ }
+ throw new AgentCallError('Max tries reached');
+ }
+ this.#tries++;
+
+ const { canisterId, identity, callArgs, credentials, fetchConfig, callOptions } = this.#options;
+
+ const id = await identity;
+
+ const canister = Principal.from(canisterId);
+ const ecid = callArgs.effectiveCanisterId
+ ? Principal.from(callArgs.effectiveCanisterId)
+ : canister;
+
+ const sender: Principal = id.getPrincipal() || Principal.anonymous();
+
+ const ingress_expiry = new Expiry(
+ DEFAULT_INGRESS_EXPIRY_DELTA_IN_MSECS,
+ BigInt(this.#timeDiffMsecs),
+ );
+
+ const submit: CallRequest = {
+ request_type: SubmitRequestType.Call,
+ canister_id: canister,
+ method_name: callArgs.methodName,
+ arg: callArgs.arg,
+ sender,
+ ingress_expiry,
+ };
+
+ let transformedRequest = await this.#transform({
+ request: {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/cbor',
+ ...(credentials ? { Authorization: 'Basic ' + btoa(credentials) } : {}),
+ },
+ },
+ endpoint: Endpoint.Call,
+ body: submit,
+ });
+
+ transformedRequest = (await id.transformRequest(transformedRequest)) as HttpAgentRequest;
+
+ const body = cbor.encode(transformedRequest.body);
+
+ const { host } = fetchConfig;
+
+ return fetch('' + new URL(`/api/v2/canister/${ecid.toText()}/call`, host), {
+ ...callOptions,
+ ...transformedRequest.request,
+ body,
+ } as RequestInit)
+ .then(async response => {
+ if (response.status === 401) {
+ console.log(response.status, response.statusText);
+ throw new Error('Unauthorized');
+ }
+
+ if (response.status === 404) {
+ console.log(response.status, response.statusText);
+ throw new Error('Canister not found');
+ }
+
+ if (!response.ok) {
+ this.#lastError = new AgentCallError(
+ `Server returned an error:\n` +
+ ` Code: ${response.status} (${response.statusText})\n` +
+ ` Body: ${await response.clone().text()}\n`,
+ );
+
+ const responseText = await response.clone().text();
+
+ // Handle time drift errors
+ if (responseText.includes('Specified ingress_expiry')) {
+ const errorParts = responseText.split(': ');
+ errorParts;
+ const minExpiry = new Date(errorParts[2].split(',')[0].trim()); //?
+ const maxExpiry = new Date(errorParts[3].split(',')[0].trim()); //?
+ const providedExpiry = new Date(errorParts[4].trim()); //?
+
+ const result = {
+ minimum: minExpiry,
+ maximum: maxExpiry,
+ provided: providedExpiry,
+ };
+
+ console.log(
+ 'HttpAgent has detected a disagreement about time with the replica. Retrying with adjusted expiry.',
+ result,
+ );
+ // Adjust the time difference to account for the time it took to make the request.
+ this.#timeDiffMsecs = maxExpiry.getTime() - Date.now() - 1000;
+ console.log('Adjusted time difference to', this.#timeDiffMsecs, 'milliseconds.');
+ }
+ }
+
+ const responseBuffer = await response.arrayBuffer();
+ const responseBody = (
+ response.status === 200 && responseBuffer.byteLength > 0
+ ? cbor.decode(responseBuffer)
+ : null
+ ) as SubmitResponse['response']['body'];
+
+ const requestId = requestIdOf(submit);
+
+ return {
+ response: {
+ ok: response.ok,
+ status: response.status,
+ statusText: response.statusText,
+ body: responseBody,
+ headers: httpHeadersTransform(response.headers),
+ },
+ requestId,
+ };
+ })
+ .catch(e => {
+ console.log(e);
+ throw e;
+ });
+ }
+
+ #transform = async (request: HttpAgentRequest): Promise => {
+ let p = Promise.resolve(request);
+
+ for (const fn of this.#pipeline) {
+ p = p.then(r => fn(r).then(r2 => r2 || r));
+ }
+
+ return p;
+ };
+}
diff --git a/packages/agent/src/agent/http/index.ts b/packages/agent/src/agent/http/index.ts
index 486fa2fd3..b0d0cdfca 100644
--- a/packages/agent/src/agent/http/index.ts
+++ b/packages/agent/src/agent/http/index.ts
@@ -45,8 +45,6 @@ export enum RequestStatusResponseStatus {
// Default delta for ingress expiry is 5 minutes.
const DEFAULT_INGRESS_EXPIRY_DELTA_IN_MSECS = 5 * 60 * 1000;
-const MILLIS_PER_SECOND = 1000;
-
// Root public key for the IC, encoded as hex
const IC_ROOT_KEY =
'308182301d060d2b0601040182dc7c0503010201060c2b0601040182dc7c05030201036100814' +
@@ -370,30 +368,7 @@ export class HttpAgent implements Agent {
let response: Response;
try {
response = await request();
- } catch (error: unknown) {
- const errorResponse = (error as AgentHTTPResponseError).message;
- if (errorResponse.startsWith('Specified ingress_expiry')) {
- const errorParts = errorResponse.split(': ');
- errorParts;
- const minExpiry = new Date(errorParts[2].split(',')[0].trim()); //?
- const maxExpiry = new Date(errorParts[3].split(',')[0].trim()); //?
- const providedExpiry = new Date(errorParts[4].trim()); //?
-
- const result = {
- minimum: minExpiry,
- maximum: maxExpiry,
- provided: providedExpiry,
- };
-
- console.log(
- 'HttpAgent has detected a disagreement about time with the replica. Retrying with adjusted expiry.',
- result,
- );
- this._timeDiffMsecs = maxExpiry.getTime() - 1 * MILLIS_PER_SECOND;
- return await this._requestAndRetry(request, tries);
- } else {
- console.log('Error parsing the response.');
- }
+ } catch (error) {
if (this._retryTimes > tries) {
console.warn(
`Caught exception while attempting to make request:\n` +
diff --git a/packages/agent/src/certificate.test.ts b/packages/agent/src/certificate.test.ts
index 44bd5e0a0..e2f68bcb6 100644
--- a/packages/agent/src/certificate.test.ts
+++ b/packages/agent/src/certificate.test.ts
@@ -274,6 +274,15 @@ describe('node keys', () => {
const nodeKeys = cert.cache_node_keys();
expect(nodeKeys).toMatchInlineSnapshot(`
Object {
+ "metrics": Object {
+ "canister_state_bytes": 10007399447n,
+ "consumed_cycles_total": Object {
+ "current": 15136490391288n,
+ "deleted": 0n,
+ },
+ "num_canisters": 451n,
+ "update_transactions_total": 222360n,
+ },
"nodeKeys": Array [
"302a300506032b65700321005b0bdf0329932ab0a78fa7192ad76cf37d67eb2024739774d3b67da7799ebc9c",
"302a300506032b65700321009776d25542873dafb8099303d1fca8e4aa344e73cf5a3d7df5b40f9c8ed5a085",
diff --git a/packages/agent/src/certificate.ts b/packages/agent/src/certificate.ts
index 3682c9b9b..a02076963 100644
--- a/packages/agent/src/certificate.ts
+++ b/packages/agent/src/certificate.ts
@@ -49,6 +49,15 @@ export type SubnetStatus = {
// Principal as a string
subnetId: string;
nodeKeys: string[];
+ metrics?: {
+ num_canisters: bigint;
+ canister_state_bytes: bigint;
+ consumed_cycles_total: {
+ current: bigint;
+ deleted: bigint;
+ };
+ update_transactions_total: bigint;
+ };
};
/**
@@ -164,6 +173,8 @@ export interface CreateCertificateOptions {
maxAgeInMinutes?: number;
}
+type MetricsResult = number | bigint | Map | undefined;
+
export class Certificate {
private readonly cert: Cert;
#nodeKeys: string[] = [];
@@ -216,6 +227,12 @@ export class Certificate {
return this.lookup([label]);
}
+ #toBigInt(n: MetricsResult): bigint {
+ if (typeof n === 'undefined') return BigInt(0);
+ if (typeof n === 'bigint') return n;
+ return BigInt(Number(n));
+ }
+
public cache_node_keys(root_key?: Uint8Array): SubnetStatus {
const tree = this.cert.tree;
let delegation = this.cert.delegation;
@@ -248,10 +265,47 @@ export class Certificate {
}
});
- return {
+ const metricsTree = lookup_path(
+ ['subnet', delegation?.subnet_id as ArrayBuffer, 'metrics'],
+ tree,
+ );
+ let metrics: SubnetStatus['metrics'] | undefined = undefined;
+ if (metricsTree) {
+ const decoded = cbor.decode(metricsTree as ArrayBuffer) as Map<
+ number,
+ Map
+ >;
+
+ // Cbor may decode values as either number or bigint. For consistency, we convert all numbers to bigint
+ const num_canisters = this.#toBigInt(decoded.get(0));
+ const canister_state_bytes = this.#toBigInt(decoded.get(1));
+ const current_consumed_cycles = this.#toBigInt(
+ (decoded.get(2) as Map).get(0),
+ );
+ const deleted_consumed_cycles = this.#toBigInt(
+ (decoded.get(2) as Map).get(1),
+ );
+ const update_transactions_total = this.#toBigInt(decoded.get(3));
+
+ metrics = {
+ num_canisters: num_canisters,
+ canister_state_bytes: canister_state_bytes,
+ consumed_cycles_total: {
+ current: current_consumed_cycles,
+ deleted: deleted_consumed_cycles,
+ },
+ update_transactions_total: update_transactions_total,
+ };
+ }
+
+ const result: SubnetStatus = {
subnetId: Principal.fromUint8Array(new Uint8Array(delegation.subnet_id)).toText(),
nodeKeys: this.#nodeKeys,
};
+ if (metrics) {
+ result.metrics = metrics;
+ }
+ return result;
}
private async verify(): Promise {