diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 86ce5517..5ab233db 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] +## [2.1.3] - 2024-10-23 + ### Added - feat: allow for setting HttpAgent ingress expiry using `ingressExpiryInMinutes` option @@ -57,6 +59,8 @@ AgentError: Call failed: - docs: clarifies meaning of `effectiveCanisterId` in `CallOptions` ### Changed + +- feat: adds management canister support for canister snapshots - feat: replaces hdkey and bip32 implementations with `@scure/bip39` and `@scure/bip32` due to vulnerability and lack of maintenance for `elliptic` - chore: bumps dev dependency versions to remove warnings - chore: addresses eslint errors uncovered by bumping eslint version @@ -239,8 +243,8 @@ const result = await management.bitcoin_get_balance_query({ ### Added * feat: uses expirable map for subnet keys in `agent-js`, with a timeout of 1 hour -* **feat!: node signature verification** -This feature includes additional changes in support of testing and releasing the feature: +* **feat!: node signature verification** +This feature includes additional changes in support of testing and releasing the feature: * Mainnet e2e tests for queries and calls * published counter canister * New `HttpAgent` option - `verifyQuerySignatures`. Defaults to true, but allows you to opt out of verification. Useful for testing against older replica versions @@ -372,7 +376,7 @@ Changes default stored key for `auth-client` to use ECDSAKey* Also updates the * _Breaking change:_ Moves `Secp256k1KeyIdentity` to its own package. `@dfinity/identity-secp256k1` * _Breaking change:_ Deprecates `@dfinity/authentication`. If you relied on the `isDelegationValid` check, it has been moved to `@dfinity/identity` - + * Deprecates `@dfinity/identity-ledgerhq`. Use `@zondax/ledger-icp` instead. * chore: links assets docs in index * chore: sets up new size-limit job for packages, in preparation for CI @@ -465,9 +469,9 @@ Changes default stored key for `auth-client` to use ECDSAKey* Also updates the ### Changed * Adds a default callback to the `IdleManager` that will refresh the page after clearing the storage -* Adds a new utility method, `canisterStatus`, to `agent-js`. Canister status now allows you to query paths from the canister certificate with a simple interface, using the API from the[interface specification](https://internetcomputer.org/docs/current/references/ic-interface-spec#state-tree-canister-information) +* Adds a new utility method, `canisterStatus`, to `agent-js`. Canister status now allows you to query paths from the canister certificate with a simple interface, using the API from the[interface specification](https://internetcomputer.org/docs/current/references/ic-interface-spec#state-tree-canister-information) Comes with nicely configured options for - + `time`, `controllers`, `subnet`, `module_hash`, `candid`. Additionally, has a utility for reading custom MetaData set using [ic-wasm](https://github.com/dfinity/ic-wasm), as well as generic custom paths in the format of ArrayBuffers. * updates to package.json files for metadata in npm @@ -487,9 +491,9 @@ Changes default stored key for `auth-client` to use ECDSAKey* Also updates the * Versioning tool now sets patch version to 0 for minor version updates, or patch and minor versions to 0 for major version updates * Removes jest-expect-message, which was making test error messages less useful * `HttpAgent` now generates a nonce to ensure that calls are unique by default. If you want to opt out or provide your own nonce logic, you can now pass an option of `disableNonce: true`during the agent initialization. - + If you are currently using `agent.addTransform(makeNonceTransform())` , please note that you should remove that logic, or add the `disableNonce` option to your agent when upgrading. - + ## [0.10.3] @@ -504,13 +508,13 @@ Changes default stored key for `auth-client` to use ECDSAKey* Also updates the ### Changed * Security enhancement - adds a rewrite for urls to subdomains of - + `\*.ic0.app/api` - + to - + `ic0.app/api` - + * Improves error messages for when `HttpAgent` cannot infer `fetch` implementation ## [0.10.1] diff --git a/e2e/node/package.json b/e2e/node/package.json index 80dcb46f..631b45d5 100644 --- a/e2e/node/package.json +++ b/e2e/node/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@do-not-publish/ic-node-e2e-tests", - "version": "2.1.2", + "version": "2.1.3", "type": "module", "scripts": { "ci": "npm run e2e", @@ -16,10 +16,10 @@ "test": "" }, "dependencies": { - "@dfinity/agent": "^2.1.2", - "@dfinity/assets": "^2.1.2", - "@dfinity/identity": "^2.1.2", - "@dfinity/principal": "^2.1.2", + "@dfinity/agent": "^2.1.3", + "@dfinity/assets": "^2.1.3", + "@dfinity/identity": "^2.1.3", + "@dfinity/principal": "^2.1.3", "whatwg-fetch": "^3.6.2" }, "devDependencies": { diff --git a/package-lock.json b/package-lock.json index 3c987086..c409dbd1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dfinity/agent-monorepo", - "version": "2.1.2", + "version": "2.1.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dfinity/agent-monorepo", - "version": "2.1.2", + "version": "2.1.3", "license": "Apache-2.0", "devDependencies": { "@jest/types": "^29.6.3", @@ -63,12 +63,12 @@ }, "e2e/node": { "name": "@do-not-publish/ic-node-e2e-tests", - "version": "2.1.2", + "version": "2.1.3", "dependencies": { - "@dfinity/agent": "^2.1.2", - "@dfinity/assets": "^2.1.2", - "@dfinity/identity": "^2.1.2", - "@dfinity/principal": "^2.1.2", + "@dfinity/agent": "^2.1.3", + "@dfinity/assets": "^2.1.3", + "@dfinity/identity": "^2.1.3", + "@dfinity/principal": "^2.1.3", "whatwg-fetch": "^3.6.2" }, "devDependencies": { @@ -17386,7 +17386,7 @@ }, "packages/agent": { "name": "@dfinity/agent", - "version": "2.1.2", + "version": "2.1.3", "license": "Apache-2.0", "dependencies": { "@noble/curves": "^1.4.0", @@ -17412,8 +17412,8 @@ "whatwg-fetch": "^3.0.0" }, "peerDependencies": { - "@dfinity/candid": "^2.1.2", - "@dfinity/principal": "^2.1.2" + "@dfinity/candid": "^2.1.3", + "@dfinity/principal": "^2.1.3" } }, "packages/agent/node_modules/@typescript-eslint/eslint-plugin": { @@ -17732,7 +17732,7 @@ }, "packages/assets": { "name": "@dfinity/assets", - "version": "2.1.2", + "version": "2.1.3", "license": "Apache-2.0", "dependencies": { "base64-arraybuffer": "^1.0.2", @@ -17752,8 +17752,8 @@ "typedoc": "^0.22.11" }, "peerDependencies": { - "@dfinity/agent": "^2.1.2", - "@dfinity/principal": "^2.1.2", + "@dfinity/agent": "^2.1.3", + "@dfinity/principal": "^2.1.3", "@noble/hashes": "^1.3.1" } }, @@ -18058,7 +18058,7 @@ }, "packages/auth-client": { "name": "@dfinity/auth-client", - "version": "2.1.2", + "version": "2.1.3", "license": "Apache-2.0", "dependencies": { "idb": "^7.0.2" @@ -18081,9 +18081,9 @@ "whatwg-fetch": "^3.0.0" }, "peerDependencies": { - "@dfinity/agent": "^2.1.2", - "@dfinity/identity": "^2.1.2", - "@dfinity/principal": "^2.1.2" + "@dfinity/agent": "^2.1.3", + "@dfinity/identity": "^2.1.3", + "@dfinity/principal": "^2.1.3" } }, "packages/auth-client/node_modules/@typescript-eslint/eslint-plugin": { @@ -18380,7 +18380,7 @@ }, "packages/candid": { "name": "@dfinity/candid", - "version": "2.1.2", + "version": "2.1.3", "license": "Apache-2.0", "devDependencies": { "@types/jest": "^29.5.5", @@ -18398,7 +18398,7 @@ "whatwg-fetch": "^3.0.0" }, "peerDependencies": { - "@dfinity/principal": "^2.1.2" + "@dfinity/principal": "^2.1.3" } }, "packages/candid/node_modules/@typescript-eslint/eslint-plugin": { @@ -18709,7 +18709,7 @@ }, "packages/identity": { "name": "@dfinity/identity", - "version": "2.1.2", + "version": "2.1.3", "license": "Apache-2.0", "dependencies": { "@noble/curves": "^1.2.0", @@ -18730,17 +18730,17 @@ "whatwg-fetch": "^3.0.0" }, "peerDependencies": { - "@dfinity/agent": "^2.1.2", - "@dfinity/principal": "^2.1.2", + "@dfinity/agent": "^2.1.3", + "@dfinity/principal": "^2.1.3", "@peculiar/webcrypto": "^1.4.0" } }, "packages/identity-secp256k1": { "name": "@dfinity/identity-secp256k1", - "version": "2.1.2", + "version": "2.1.3", "license": "Apache-2.0", "dependencies": { - "@dfinity/agent": "^2.1.2", + "@dfinity/agent": "^2.1.3", "@noble/curves": "^1.4.0", "@noble/hashes": "^1.3.1", "@scure/bip32": "^1.4.0", @@ -19043,7 +19043,7 @@ }, "packages/principal": { "name": "@dfinity/principal", - "version": "2.1.2", + "version": "2.1.3", "license": "Apache-2.0", "dependencies": { "@noble/hashes": "^1.3.1" @@ -19403,14 +19403,14 @@ }, "packages/use-auth-client": { "name": "@dfinity/use-auth-client", - "version": "2.1.2", + "version": "2.1.3", "license": "Apache-2.0", "dependencies": { - "@dfinity/agent": "^2.1.2", - "@dfinity/auth-client": "^2.1.2", - "@dfinity/candid": "^2.1.2", - "@dfinity/identity": "^2.1.2", - "@dfinity/principal": "^2.1.2", + "@dfinity/agent": "^2.1.3", + "@dfinity/auth-client": "^2.1.3", + "@dfinity/candid": "^2.1.3", + "@dfinity/identity": "^2.1.3", + "@dfinity/principal": "^2.1.3", "react": ">16.8" }, "devDependencies": { diff --git a/package.json b/package.json index 491f2915..3edac69c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dfinity/agent-monorepo", - "version": "2.1.2", + "version": "2.1.3", "private": true, "description": "Use an Agent to interact with the Internet Computer from your JavaScript program.", "workspaces": { diff --git a/packages/agent/package.json b/packages/agent/package.json index 4d1ad392..8d3bff39 100644 --- a/packages/agent/package.json +++ b/packages/agent/package.json @@ -1,6 +1,6 @@ { "name": "@dfinity/agent", - "version": "2.1.2", + "version": "2.1.3", "author": "DFINITY Stiftung ", "license": "Apache-2.0", "description": "JavaScript and TypeScript library to interact with the Internet Computer", @@ -47,8 +47,8 @@ "test:coverage": "jest --collectCoverage" }, "peerDependencies": { - "@dfinity/candid": "^2.1.2", - "@dfinity/principal": "^2.1.2" + "@dfinity/candid": "^2.1.3", + "@dfinity/principal": "^2.1.3" }, "dependencies": { "@noble/curves": "^1.4.0", diff --git a/packages/agent/src/canisters/management.did b/packages/agent/src/canisters/management.did index d3acb2af..0fecfa23 100644 --- a/packages/agent/src/canisters/management.did +++ b/packages/agent/src/canisters/management.did @@ -1,5 +1,6 @@ type canister_id = principal; type wasm_module = blob; +type snapshot_id = blob; type log_visibility = variant { controllers; @@ -45,6 +46,11 @@ type change_details = variant { mode : variant { install; reinstall; upgrade }; module_hash : blob; }; + load_snapshot : record { + canister_version : nat64; + snapshot_id : snapshot_id; + taken_at_timestamp : nat64; + }; controllers_change : record { controllers : vec principal; }; @@ -90,7 +96,13 @@ type bitcoin_network = variant { type bitcoin_address = text; -type block_hash = blob; +type bitcoin_block_hash = blob; + +type bitcoin_block_header = blob; + +type millisatoshi_per_byte = nat64; + +type bitcoin_block_height = nat32; type outpoint = record { txid : blob; @@ -112,14 +124,10 @@ type bitcoin_get_utxos_args = record { }; }; -type bitcoin_get_current_fee_percentiles_args = record { - network : bitcoin_network; -}; - type bitcoin_get_utxos_result = record { utxos : vec utxo; - tip_block_hash : block_hash; - tip_height : nat32; + tip_block_hash : bitcoin_block_hash; + tip_height : bitcoin_block_height; next_page : opt blob; }; @@ -129,12 +137,29 @@ type bitcoin_get_balance_args = record { min_confirmations : opt nat32; }; +type bitcoin_get_balance_result = satoshi; + +type bitcoin_get_current_fee_percentiles_args = record { + network : bitcoin_network; +}; + +type bitcoin_get_current_fee_percentiles_result = vec millisatoshi_per_byte; + type bitcoin_send_transaction_args = record { transaction : blob; network : bitcoin_network; }; -type millisatoshi_per_byte = nat64; +type bitcoin_get_block_headers_args = record { + start_height : bitcoin_block_height; + end_height : opt bitcoin_block_height; + network : bitcoin_network; +}; + +type bitcoin_get_block_headers_result = record { + tip_height : bitcoin_block_height; + block_headers : vec bitcoin_block_header; +}; type node_metrics = record { node_id : principal; @@ -339,9 +364,35 @@ type stored_chunks_result = vec chunk_hash; type upload_chunk_result = chunk_hash; -type bitcoin_get_balance_result = satoshi; +type snapshot = record { + id : snapshot_id; + taken_at_timestamp : nat64; + total_size : nat64; +}; -type bitcoin_get_current_fee_percentiles_result = vec millisatoshi_per_byte; +type take_canister_snapshot_args = record { + canister_id : canister_id; + replace_snapshot : opt snapshot_id; +}; + +type take_canister_snapshot_result = snapshot; + +type load_canister_snapshot_args = record { + canister_id : canister_id; + snapshot_id : snapshot_id; + sender_canister_version : opt nat64; +}; + +type list_canister_snapshots_args = record { + canister_id : canister_id; +}; + +type list_canister_snapshots_result = vec snapshot; + +type delete_canister_snapshot_args = record { + canister_id : canister_id; + snapshot_id : snapshot_id; +}; type fetch_canister_logs_args = record { canister_id : canister_id; @@ -385,11 +436,10 @@ service ic : { // bitcoin interface bitcoin_get_balance : (bitcoin_get_balance_args) -> (bitcoin_get_balance_result); - bitcoin_get_utxos : (bitcoin_get_utxos_args) -> (bitcoin_get_utxos_result); - bitcoin_send_transaction : (bitcoin_send_transaction_args) -> (); bitcoin_get_current_fee_percentiles : (bitcoin_get_current_fee_percentiles_args) -> (bitcoin_get_current_fee_percentiles_result); + bitcoin_get_block_headers : (bitcoin_get_block_headers_args) -> (bitcoin_get_block_headers_result); // metrics interface node_metrics_history : (node_metrics_history_args) -> (node_metrics_history_result); @@ -398,6 +448,12 @@ service ic : { provisional_create_canister_with_cycles : (provisional_create_canister_with_cycles_args) -> (provisional_create_canister_with_cycles_result); provisional_top_up_canister : (provisional_top_up_canister_args) -> (); + // Canister snapshots + take_canister_snapshot : (take_canister_snapshot_args) -> (take_canister_snapshot_result); + load_canister_snapshot : (load_canister_snapshot_args) -> (); + list_canister_snapshots : (list_canister_snapshots_args) -> (list_canister_snapshots_result); + delete_canister_snapshot : (delete_canister_snapshot_args) -> (); + // canister logging fetch_canister_logs : (fetch_canister_logs_args) -> (fetch_canister_logs_result) query; }; diff --git a/packages/agent/src/canisters/management_idl.ts b/packages/agent/src/canisters/management_idl.ts index 07f15d1d..41e27dea 100644 --- a/packages/agent/src/canisters/management_idl.ts +++ b/packages/agent/src/canisters/management_idl.ts @@ -18,6 +18,17 @@ export default ({ IDL }) => { }); const satoshi = IDL.Nat64; const bitcoin_get_balance_result = satoshi; + const bitcoin_block_height = IDL.Nat32; + const bitcoin_get_block_headers_args = IDL.Record({ + start_height: bitcoin_block_height, + end_height: IDL.Opt(bitcoin_block_height), + network: bitcoin_network, + }); + const bitcoin_block_header = IDL.Vec(IDL.Nat8); + const bitcoin_get_block_headers_result = IDL.Record({ + tip_height: bitcoin_block_height, + block_headers: IDL.Vec(bitcoin_block_header), + }); const bitcoin_get_current_fee_percentiles_args = IDL.Record({ network: bitcoin_network, }); @@ -33,7 +44,7 @@ export default ({ IDL }) => { ), address: bitcoin_address, }); - const block_hash = IDL.Vec(IDL.Nat8); + const bitcoin_block_hash = IDL.Vec(IDL.Nat8); const outpoint = IDL.Record({ txid: IDL.Vec(IDL.Nat8), vout: IDL.Nat32, @@ -45,8 +56,8 @@ export default ({ IDL }) => { }); const bitcoin_get_utxos_result = IDL.Record({ next_page: IDL.Opt(IDL.Vec(IDL.Nat8)), - tip_height: IDL.Nat32, - tip_block_hash: block_hash, + tip_height: bitcoin_block_height, + tip_block_hash: bitcoin_block_hash, utxos: IDL.Vec(utxo), }); const bitcoin_send_transaction_args = IDL.Record({ @@ -65,6 +76,7 @@ export default ({ IDL }) => { canister_id: IDL.Principal, }), }); + const snapshot_id = IDL.Vec(IDL.Nat8); const change_details = IDL.Variant({ creation: IDL.Record({ controllers: IDL.Vec(IDL.Principal) }), code_deployment: IDL.Record({ @@ -75,6 +87,11 @@ export default ({ IDL }) => { }), module_hash: IDL.Vec(IDL.Nat8), }), + load_snapshot: IDL.Record({ + canister_version: IDL.Nat64, + taken_at_timestamp: IDL.Nat64, + snapshot_id: snapshot_id, + }), controllers_change: IDL.Record({ controllers: IDL.Vec(IDL.Principal), }), @@ -141,6 +158,10 @@ export default ({ IDL }) => { }); const create_canister_result = IDL.Record({ canister_id: canister_id }); const delete_canister_args = IDL.Record({ canister_id: canister_id }); + const delete_canister_snapshot_args = IDL.Record({ + canister_id: canister_id, + snapshot_id: snapshot_id, + }); const deposit_cycles_args = IDL.Record({ canister_id: canister_id }); const ecdsa_curve = IDL.Variant({ secp256k1: IDL.Null }); const ecdsa_public_key_args = IDL.Record({ @@ -221,6 +242,20 @@ export default ({ IDL }) => { canister_id: canister_id, sender_canister_version: IDL.Opt(IDL.Nat64), }); + const list_canister_snapshots_args = IDL.Record({ + canister_id: canister_id, + }); + const snapshot = IDL.Record({ + id: snapshot_id, + total_size: IDL.Nat64, + taken_at_timestamp: IDL.Nat64, + }); + const list_canister_snapshots_result = IDL.Vec(snapshot); + const load_canister_snapshot_args = IDL.Record({ + canister_id: canister_id, + sender_canister_version: IDL.Opt(IDL.Nat64), + snapshot_id: snapshot_id, + }); const node_metrics_history_args = IDL.Record({ start_at_timestamp_nanos: IDL.Nat64, subnet_id: IDL.Principal, @@ -289,6 +324,11 @@ export default ({ IDL }) => { const stop_canister_args = IDL.Record({ canister_id: canister_id }); const stored_chunks_args = IDL.Record({ canister_id: canister_id }); const stored_chunks_result = IDL.Vec(chunk_hash); + const take_canister_snapshot_args = IDL.Record({ + replace_snapshot: IDL.Opt(snapshot_id), + canister_id: canister_id, + }); + const take_canister_snapshot_result = snapshot; const uninstall_code_args = IDL.Record({ canister_id: canister_id, sender_canister_version: IDL.Opt(IDL.Nat64), @@ -305,6 +345,11 @@ export default ({ IDL }) => { const upload_chunk_result = chunk_hash; return IDL.Service({ bitcoin_get_balance: IDL.Func([bitcoin_get_balance_args], [bitcoin_get_balance_result], []), + bitcoin_get_block_headers: IDL.Func( + [bitcoin_get_block_headers_args], + [bitcoin_get_block_headers_result], + [], + ), bitcoin_get_current_fee_percentiles: IDL.Func( [bitcoin_get_current_fee_percentiles_args], [bitcoin_get_current_fee_percentiles_result], @@ -317,6 +362,7 @@ export default ({ IDL }) => { clear_chunk_store: IDL.Func([clear_chunk_store_args], [], []), create_canister: IDL.Func([create_canister_args], [create_canister_result], []), delete_canister: IDL.Func([delete_canister_args], [], []), + delete_canister_snapshot: IDL.Func([delete_canister_snapshot_args], [], []), deposit_cycles: IDL.Func([deposit_cycles_args], [], []), ecdsa_public_key: IDL.Func([ecdsa_public_key_args], [ecdsa_public_key_result], []), fetch_canister_logs: IDL.Func( @@ -327,6 +373,12 @@ export default ({ IDL }) => { http_request: IDL.Func([http_request_args], [http_request_result], []), install_chunked_code: IDL.Func([install_chunked_code_args], [], []), install_code: IDL.Func([install_code_args], [], []), + list_canister_snapshots: IDL.Func( + [list_canister_snapshots_args], + [list_canister_snapshots_result], + [], + ), + load_canister_snapshot: IDL.Func([load_canister_snapshot_args], [], []), node_metrics_history: IDL.Func([node_metrics_history_args], [node_metrics_history_result], []), provisional_create_canister_with_cycles: IDL.Func( [provisional_create_canister_with_cycles_args], @@ -341,6 +393,11 @@ export default ({ IDL }) => { start_canister: IDL.Func([start_canister_args], [], []), stop_canister: IDL.Func([stop_canister_args], [], []), stored_chunks: IDL.Func([stored_chunks_args], [stored_chunks_result], []), + take_canister_snapshot: IDL.Func( + [take_canister_snapshot_args], + [take_canister_snapshot_result], + [], + ), uninstall_code: IDL.Func([uninstall_code_args], [], []), update_settings: IDL.Func([update_settings_args], [], []), upload_chunk: IDL.Func([upload_chunk_args], [upload_chunk_result], []), diff --git a/packages/agent/src/canisters/management_service.ts b/packages/agent/src/canisters/management_service.ts index fa4ed243..3b239fed 100644 --- a/packages/agent/src/canisters/management_service.ts +++ b/packages/agent/src/canisters/management_service.ts @@ -10,12 +10,24 @@ import type { ActorMethod } from '@dfinity/agent'; import type { IDL } from '@dfinity/candid'; export type bitcoin_address = string; +export type bitcoin_block_hash = Uint8Array | number[]; +export type bitcoin_block_header = Uint8Array | number[]; +export type bitcoin_block_height = number; export interface bitcoin_get_balance_args { network: bitcoin_network; address: bitcoin_address; min_confirmations: [] | [number]; } export type bitcoin_get_balance_result = satoshi; +export interface bitcoin_get_block_headers_args { + start_height: bitcoin_block_height; + end_height: [] | [bitcoin_block_height]; + network: bitcoin_network; +} +export interface bitcoin_get_block_headers_result { + tip_height: bitcoin_block_height; + block_headers: Array; +} export interface bitcoin_get_current_fee_percentiles_args { network: bitcoin_network; } @@ -27,8 +39,8 @@ export interface bitcoin_get_utxos_args { } export interface bitcoin_get_utxos_result { next_page: [] | [Uint8Array | number[]]; - tip_height: number; - tip_block_hash: block_hash; + tip_height: bitcoin_block_height; + tip_block_hash: bitcoin_block_hash; utxos: Array; } export type bitcoin_network = { mainnet: null } | { testnet: null }; @@ -36,7 +48,6 @@ export interface bitcoin_send_transaction_args { transaction: Uint8Array | number[]; network: bitcoin_network; } -export type block_hash = Uint8Array | number[]; export type canister_id = Principal; export interface canister_info_args { canister_id: canister_id; @@ -109,6 +120,13 @@ export type change_details = module_hash: Uint8Array | number[]; }; } + | { + load_snapshot: { + canister_version: bigint; + taken_at_timestamp: bigint; + snapshot_id: snapshot_id; + }; + } | { controllers_change: { controllers: Array } } | { code_uninstall: null }; export type change_origin = @@ -144,6 +162,10 @@ export interface definite_canister_settings { export interface delete_canister_args { canister_id: canister_id; } +export interface delete_canister_snapshot_args { + canister_id: canister_id; + snapshot_id: snapshot_id; +} export interface deposit_cycles_args { canister_id: canister_id; } @@ -196,6 +218,15 @@ export interface install_code_args { canister_id: canister_id; sender_canister_version: [] | [bigint]; } +export interface list_canister_snapshots_args { + canister_id: canister_id; +} +export type list_canister_snapshots_result = Array; +export interface load_canister_snapshot_args { + canister_id: canister_id; + sender_canister_version: [] | [bigint]; + snapshot_id: snapshot_id; +} export type log_visibility = { controllers: null } | { public: null }; export type millisatoshi_per_byte = bigint; export interface node_metrics { @@ -256,6 +287,12 @@ export interface sign_with_schnorr_args { export interface sign_with_schnorr_result { signature: Uint8Array | number[]; } +export interface snapshot { + id: snapshot_id; + total_size: bigint; + taken_at_timestamp: bigint; +} +export type snapshot_id = Uint8Array | number[]; export interface start_canister_args { canister_id: canister_id; } @@ -266,6 +303,11 @@ export interface stored_chunks_args { canister_id: canister_id; } export type stored_chunks_result = Array; +export interface take_canister_snapshot_args { + replace_snapshot: [] | [snapshot_id]; + canister_id: canister_id; +} +export type take_canister_snapshot_result = snapshot; export interface uninstall_code_args { canister_id: canister_id; sender_canister_version: [] | [bigint]; @@ -288,6 +330,10 @@ export interface utxo { export type wasm_module = Uint8Array | number[]; export default interface _SERVICE { bitcoin_get_balance: ActorMethod<[bitcoin_get_balance_args], bitcoin_get_balance_result>; + bitcoin_get_block_headers: ActorMethod< + [bitcoin_get_block_headers_args], + bitcoin_get_block_headers_result + >; bitcoin_get_current_fee_percentiles: ActorMethod< [bitcoin_get_current_fee_percentiles_args], bitcoin_get_current_fee_percentiles_result @@ -299,12 +345,18 @@ export default interface _SERVICE { clear_chunk_store: ActorMethod<[clear_chunk_store_args], undefined>; create_canister: ActorMethod<[create_canister_args], create_canister_result>; delete_canister: ActorMethod<[delete_canister_args], undefined>; + delete_canister_snapshot: ActorMethod<[delete_canister_snapshot_args], undefined>; deposit_cycles: ActorMethod<[deposit_cycles_args], undefined>; ecdsa_public_key: ActorMethod<[ecdsa_public_key_args], ecdsa_public_key_result>; fetch_canister_logs: ActorMethod<[fetch_canister_logs_args], fetch_canister_logs_result>; http_request: ActorMethod<[http_request_args], http_request_result>; install_chunked_code: ActorMethod<[install_chunked_code_args], undefined>; install_code: ActorMethod<[install_code_args], undefined>; + list_canister_snapshots: ActorMethod< + [list_canister_snapshots_args], + list_canister_snapshots_result + >; + load_canister_snapshot: ActorMethod<[load_canister_snapshot_args], undefined>; node_metrics_history: ActorMethod<[node_metrics_history_args], node_metrics_history_result>; provisional_create_canister_with_cycles: ActorMethod< [provisional_create_canister_with_cycles_args], @@ -318,6 +370,7 @@ export default interface _SERVICE { start_canister: ActorMethod<[start_canister_args], undefined>; stop_canister: ActorMethod<[stop_canister_args], undefined>; stored_chunks: ActorMethod<[stored_chunks_args], stored_chunks_result>; + take_canister_snapshot: ActorMethod<[take_canister_snapshot_args], take_canister_snapshot_result>; uninstall_code: ActorMethod<[uninstall_code_args], undefined>; update_settings: ActorMethod<[update_settings_args], undefined>; upload_chunk: ActorMethod<[upload_chunk_args], upload_chunk_result>; diff --git a/packages/assets/package.json b/packages/assets/package.json index db4b4fc4..9a0b2e43 100644 --- a/packages/assets/package.json +++ b/packages/assets/package.json @@ -1,6 +1,6 @@ { "name": "@dfinity/assets", - "version": "2.1.2", + "version": "2.1.3", "author": "DFINITY Stiftung ", "license": "Apache-2.0", "description": "JavaScript and TypeScript library to manage assets on the Internet Computer", @@ -49,8 +49,8 @@ "test:coverage": "jest --collectCoverage" }, "peerDependencies": { - "@dfinity/agent": "^2.1.2", - "@dfinity/principal": "^2.1.2", + "@dfinity/agent": "^2.1.3", + "@dfinity/principal": "^2.1.3", "@noble/hashes": "^1.3.1" }, "dependencies": { diff --git a/packages/auth-client/package.json b/packages/auth-client/package.json index 53f8a0aa..5ae5ec4c 100755 --- a/packages/auth-client/package.json +++ b/packages/auth-client/package.json @@ -1,6 +1,6 @@ { "name": "@dfinity/auth-client", - "version": "2.1.2", + "version": "2.1.3", "author": "DFINITY Stiftung ", "license": "Apache-2.0", "description": "JavaScript and TypeScript library to provide a simple integration with an IC Internet Identity", @@ -46,9 +46,9 @@ "test:coverage": "jest --collectCoverage" }, "peerDependencies": { - "@dfinity/agent": "^2.1.2", - "@dfinity/identity": "^2.1.2", - "@dfinity/principal": "^2.1.2" + "@dfinity/agent": "^2.1.3", + "@dfinity/identity": "^2.1.3", + "@dfinity/principal": "^2.1.3" }, "dependencies": { "idb": "^7.0.2" diff --git a/packages/candid/package.json b/packages/candid/package.json index 7aa54110..5f5c6071 100644 --- a/packages/candid/package.json +++ b/packages/candid/package.json @@ -1,6 +1,6 @@ { "name": "@dfinity/candid", - "version": "2.1.2", + "version": "2.1.3", "author": "DFINITY Stiftung ", "license": "Apache-2.0", "description": "JavaScript and TypeScript library to work with candid interfaces", @@ -48,7 +48,7 @@ "test:coverage": "jest --collectCoverage" }, "peerDependencies": { - "@dfinity/principal": "^2.1.2" + "@dfinity/principal": "^2.1.3" }, "devDependencies": { "@types/jest": "^29.5.5", diff --git a/packages/identity-secp256k1/package.json b/packages/identity-secp256k1/package.json index 4cd15c6c..ee2c171e 100644 --- a/packages/identity-secp256k1/package.json +++ b/packages/identity-secp256k1/package.json @@ -1,6 +1,6 @@ { "name": "@dfinity/identity-secp256k1", - "version": "2.1.2", + "version": "2.1.3", "author": "DFINITY Stiftung ", "license": "Apache-2.0", "description": "JavaScript and TypeScript library to manage Secp256k1KeyIdentities for use with the Internet Computer", @@ -14,7 +14,7 @@ "test:coverage": "jest --collectCoverage" }, "dependencies": { - "@dfinity/agent": "^2.1.2", + "@dfinity/agent": "^2.1.3", "@noble/curves": "^1.4.0", "@noble/hashes": "^1.3.1", "@scure/bip32": "^1.4.0", diff --git a/packages/identity/package.json b/packages/identity/package.json index b611a687..0a05f352 100644 --- a/packages/identity/package.json +++ b/packages/identity/package.json @@ -1,6 +1,6 @@ { "name": "@dfinity/identity", - "version": "2.1.2", + "version": "2.1.3", "author": "DFINITY Stiftung ", "license": "Apache-2.0", "description": "JavaScript and TypeScript library to manage identity with the Internet Computer", @@ -45,8 +45,8 @@ "test:coverage": "jest --collectCoverage" }, "peerDependencies": { - "@dfinity/agent": "^2.1.2", - "@dfinity/principal": "^2.1.2", + "@dfinity/agent": "^2.1.3", + "@dfinity/principal": "^2.1.3", "@peculiar/webcrypto": "^1.4.0" }, "dependencies": { diff --git a/packages/principal/package.json b/packages/principal/package.json index fb9aa52a..2bc26573 100644 --- a/packages/principal/package.json +++ b/packages/principal/package.json @@ -1,6 +1,6 @@ { "name": "@dfinity/principal", - "version": "2.1.2", + "version": "2.1.3", "author": "DFINITY Stiftung ", "license": "Apache-2.0", "description": "JavaScript and TypeScript library to work with Internet Computer principals", diff --git a/packages/use-auth-client/package.json b/packages/use-auth-client/package.json index 9c3d4e5f..2e2443f4 100644 --- a/packages/use-auth-client/package.json +++ b/packages/use-auth-client/package.json @@ -1,6 +1,6 @@ { "name": "@dfinity/use-auth-client", - "version": "2.1.2", + "version": "2.1.3", "description": "React hooks for using the auth client", "main": "./lib/cjs/index.js", "module": "./lib/esm/index.js", @@ -41,11 +41,11 @@ "directory": "packages/use-auth-client" }, "dependencies": { - "@dfinity/agent": "^2.1.2", - "@dfinity/auth-client": "^2.1.2", - "@dfinity/candid": "^2.1.2", - "@dfinity/identity": "^2.1.2", - "@dfinity/principal": "^2.1.2", + "@dfinity/agent": "^2.1.3", + "@dfinity/auth-client": "^2.1.3", + "@dfinity/candid": "^2.1.3", + "@dfinity/identity": "^2.1.3", + "@dfinity/principal": "^2.1.3", "react": ">16.8" }, "devDependencies": {