From cd895f21d046324dcd53c52207fc8221d127d46d Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Tue, 2 Apr 2024 12:56:09 +0200 Subject: [PATCH 1/3] docs: display breaking changes first in changelog (#601) # Motivation For consistency reasons, in CHANGELOG: - Move "Breaking changes" as first chapter of the next release. - Inline entries. Signed-off-by: David Dal Busco --- CHANGELOG.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eff74f06..ecdc3c1d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,22 +1,19 @@ # 2024.xx.yy-hhmmZ +# Breaking changes + +- Protocol buffers for hardware wallet transactions are no longer supported. Internet Computer Ledger app 2.4.9 or later is now required. +- GovernanceCanister.listNeurons no longer throws an error when called with `certified: false` for hardware wallet transactions. + ## Features - ICP transactions, as provided by the Index canister, have been extended to include their block timestamp information. -- When no fee is specified when making an ICP transaction, use the mandatory fee - of 10000 e8s (0.0001 ICP) instead of fetching the fee from the network. +- When no fee is specified when making an ICP transaction, use the mandatory fee of 10000 e8s (0.0001 ICP) instead of fetching the fee from the network. - Remove hardware wallet specific code paths from `@dfinity/ledger-icp`. - Remove hardware wallet specific options from LedgerCanister. - Remove dependency on `@dfinity/nns-proto` from `@dfinity/ledger-icp`. - Remove hardware wallet specific code and `@dfinity/nns-proto` dependency from `@dfinity/nns`. -# Breaking changes - -- Protocol buffers for hardware wallet transactions are no longer supported. - Internet Computer Ledger app 2.4.9 or later is now required. -- GovernanceCanister.listNeurons no longer throws an error when called with - `certified: false` for hardware wallet transactions. - # 2024.03.25-1430Z ## Overview From cf81af43ce56c1eaa0468bde1d6ed7a4f3e669f5 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Tue, 2 Apr 2024 14:24:56 +0200 Subject: [PATCH 2/3] build: upgrade didc v0.3.7 (#603) # Motivation I've been using didc v0.3.7 for some time and I'm tired of having to switch tools just for this repository. Therefore, this PR bumps didc to v0.3.7. Compared to v0.3.5, didc v0.3.7 generates nicer service interfaces. Interfaces which are for example useful when one install a canister in JS as they can import the `init` types. # Changes - bump didc v0.3.7 in GitHub Actions - set min required version to 0.3.7 --- .github/workflows/checks.yml | 2 +- .github/workflows/update-ic.yml | 2 +- CHANGELOG.md | 4 ++++ scripts/compile-idl-js | 6 +++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 014bc6543..b171c79cc 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -53,7 +53,7 @@ jobs: - name: Install didc run: | mkdir -p .bin - curl -L https://github.com/dfinity/candid/releases/download/2023-09-27/didc-linux64 > .bin/didc + curl -L https://github.com/dfinity/candid/releases/download/2024-02-27/didc-linux64 > .bin/didc chmod +x .bin/didc - name: Add didc to the PATH run: echo "${PWD}/.bin" >> $GITHUB_PATH diff --git a/.github/workflows/update-ic.yml b/.github/workflows/update-ic.yml index ef1319d67..21dd4a2cd 100644 --- a/.github/workflows/update-ic.yml +++ b/.github/workflows/update-ic.yml @@ -44,7 +44,7 @@ jobs: # Gets didc echo "$PATH" | tr : "\n" mkdir -p "$HOME/.local/bin" - curl -Lf https://github.com/dfinity/candid/releases/download/2023-09-27/didc-linux64 | install -m 755 /dev/stdin "$HOME/.local/bin/didc" + curl -Lf https://github.com/dfinity/candid/releases/download/2024-02-27/didc-linux64 | install -m 755 /dev/stdin "$HOME/.local/bin/didc" # Gets prettier in a minute npm ci # Gets candid diff --git a/CHANGELOG.md b/CHANGELOG.md index ecdc3c1d8..ca124d546 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ - Remove dependency on `@dfinity/nns-proto` from `@dfinity/ledger-icp`. - Remove hardware wallet specific code and `@dfinity/nns-proto` dependency from `@dfinity/nns`. +## Build + +- Upgrade `didc` to `0.3.7` that converts candid files into JS and TS. + # 2024.03.25-1430Z ## Overview diff --git a/scripts/compile-idl-js b/scripts/compile-idl-js index e7e990818..6f5c9a93b 100755 --- a/scripts/compile-idl-js +++ b/scripts/compile-idl-js @@ -4,10 +4,10 @@ set -euo pipefail -if [ "$(didc --version)" != "didc 0.3.5" ]; then +if [ "$(didc --version)" != "didc 0.3.7" ]; then { - echo "didc version 0.3.5 is required. To install it on Mac:" - echo "curl -Lf https://github.com/dfinity/candid/releases/download/2023-09-27/didc-macos -o install_didc" + echo "didc version 0.3.7 is required. To install it on Mac:" + echo "curl -Lf https://github.com/dfinity/candid/releases/download/2024-02-27/didc-macos -o install_didc" echo "install -m 755 install_didc /$HOME/.local/bin/didc" } >&2 exit 1 From 64dd2e19b8bd030e71c9db12ca15b5e7fba55cd6 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Tue, 2 Apr 2024 14:27:36 +0200 Subject: [PATCH 3/3] build: generate did files with didc v0.3.7 (#604) # Motivation Didc was bumped to v0.3.7 in PR #603. This PR generates the TS/JS files with it. # Changes - new services' interfaces generated by v0.3.7 --- packages/ckbtc/candid/minter.d.ts | 3 +++ packages/cketh/candid/minter.d.ts | 3 +++ packages/cmc/candid/cmc.d.ts | 3 +++ packages/ic-management/candid/ic-management.d.ts | 3 +++ packages/ledger-icp/candid/index.d.ts | 3 +++ packages/ledger-icp/candid/ledger.d.ts | 3 +++ packages/ledger-icrc/candid/icrc_index-ng.d.ts | 3 +++ packages/ledger-icrc/candid/icrc_index.d.ts | 3 +++ packages/ledger-icrc/candid/icrc_ledger.d.ts | 3 +++ packages/nns/candid/genesis_token.d.ts | 3 +++ packages/nns/candid/governance.d.ts | 3 +++ packages/nns/candid/governance_test.d.ts | 3 +++ packages/nns/candid/sns_wasm.d.ts | 3 +++ packages/sns/candid/sns_governance.d.ts | 3 +++ packages/sns/candid/sns_governance_test.d.ts | 3 +++ packages/sns/candid/sns_root.d.ts | 3 +++ packages/sns/candid/sns_swap.d.ts | 3 +++ 17 files changed, 51 insertions(+) diff --git a/packages/ckbtc/candid/minter.d.ts b/packages/ckbtc/candid/minter.d.ts index 5b19d6e98..c29c7b125 100644 --- a/packages/ckbtc/candid/minter.d.ts +++ b/packages/ckbtc/candid/minter.d.ts @@ -1,4 +1,5 @@ import type { ActorMethod } from "@dfinity/agent"; +import type { IDL } from "@dfinity/candid"; import type { Principal } from "@dfinity/principal"; export interface Account { @@ -304,3 +305,5 @@ export interface _SERVICE { { Ok: Array } | { Err: UpdateBalanceError } >; } +export declare const idlFactory: IDL.InterfaceFactory; +export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[]; diff --git a/packages/cketh/candid/minter.d.ts b/packages/cketh/candid/minter.d.ts index c97e53e7b..d2b44d203 100644 --- a/packages/cketh/candid/minter.d.ts +++ b/packages/cketh/candid/minter.d.ts @@ -1,4 +1,5 @@ import type { ActorMethod } from "@dfinity/agent"; +import type { IDL } from "@dfinity/candid"; import type { Principal } from "@dfinity/principal"; export interface AddCkErc20Token { @@ -237,3 +238,5 @@ export interface _SERVICE { { Ok: RetrieveEthRequest } | { Err: WithdrawalError } >; } +export declare const idlFactory: IDL.InterfaceFactory; +export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[]; diff --git a/packages/cmc/candid/cmc.d.ts b/packages/cmc/candid/cmc.d.ts index bd45c44f9..0d58843f6 100644 --- a/packages/cmc/candid/cmc.d.ts +++ b/packages/cmc/candid/cmc.d.ts @@ -1,4 +1,5 @@ import type { ActorMethod } from "@dfinity/agent"; +import type { IDL } from "@dfinity/candid"; import type { Principal } from "@dfinity/principal"; export type AccountIdentifier = string; @@ -114,3 +115,5 @@ export interface _SERVICE { >; notify_top_up: ActorMethod<[NotifyTopUpArg], NotifyTopUpResult>; } +export declare const idlFactory: IDL.InterfaceFactory; +export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[]; diff --git a/packages/ic-management/candid/ic-management.d.ts b/packages/ic-management/candid/ic-management.d.ts index 1c1e5529b..e0d269134 100644 --- a/packages/ic-management/candid/ic-management.d.ts +++ b/packages/ic-management/candid/ic-management.d.ts @@ -1,4 +1,5 @@ import type { ActorMethod } from "@dfinity/agent"; +import type { IDL } from "@dfinity/candid"; import type { Principal } from "@dfinity/principal"; export type bitcoin_address = string; @@ -313,3 +314,5 @@ export interface _SERVICE { update_settings: ActorMethod<[update_settings_args], undefined>; upload_chunk: ActorMethod<[upload_chunk_args], upload_chunk_result>; } +export declare const idlFactory: IDL.InterfaceFactory; +export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[]; diff --git a/packages/ledger-icp/candid/index.d.ts b/packages/ledger-icp/candid/index.d.ts index 8dbefb65e..b653cc564 100644 --- a/packages/ledger-icp/candid/index.d.ts +++ b/packages/ledger-icp/candid/index.d.ts @@ -1,4 +1,5 @@ import type { ActorMethod } from "@dfinity/agent"; +import type { IDL } from "@dfinity/candid"; import type { Principal } from "@dfinity/principal"; export interface Account { @@ -110,3 +111,5 @@ export interface _SERVICE { ledger_id: ActorMethod<[], Principal>; status: ActorMethod<[], Status>; } +export declare const idlFactory: IDL.InterfaceFactory; +export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[]; diff --git a/packages/ledger-icp/candid/ledger.d.ts b/packages/ledger-icp/candid/ledger.d.ts index 4cd0772b5..356d3c265 100644 --- a/packages/ledger-icp/candid/ledger.d.ts +++ b/packages/ledger-icp/candid/ledger.d.ts @@ -1,4 +1,5 @@ import type { ActorMethod } from "@dfinity/agent"; +import type { IDL } from "@dfinity/candid"; import type { Principal } from "@dfinity/principal"; export interface Account { @@ -298,3 +299,5 @@ export interface _SERVICE { transfer: ActorMethod<[TransferArgs], TransferResult>; transfer_fee: ActorMethod<[TransferFeeArg], TransferFee>; } +export declare const idlFactory: IDL.InterfaceFactory; +export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[]; diff --git a/packages/ledger-icrc/candid/icrc_index-ng.d.ts b/packages/ledger-icrc/candid/icrc_index-ng.d.ts index bcbc04fd3..76a272194 100644 --- a/packages/ledger-icrc/candid/icrc_index-ng.d.ts +++ b/packages/ledger-icrc/candid/icrc_index-ng.d.ts @@ -1,4 +1,5 @@ import type { ActorMethod } from "@dfinity/agent"; +import type { IDL } from "@dfinity/candid"; import type { Principal } from "@dfinity/principal"; export interface Account { @@ -115,3 +116,5 @@ export interface _SERVICE { list_subaccounts: ActorMethod<[ListSubaccountsArgs], Array>; status: ActorMethod<[], Status>; } +export declare const idlFactory: IDL.InterfaceFactory; +export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[]; diff --git a/packages/ledger-icrc/candid/icrc_index.d.ts b/packages/ledger-icrc/candid/icrc_index.d.ts index 33e4d9038..e054269fd 100644 --- a/packages/ledger-icrc/candid/icrc_index.d.ts +++ b/packages/ledger-icrc/candid/icrc_index.d.ts @@ -1,4 +1,5 @@ import type { ActorMethod } from "@dfinity/agent"; +import type { IDL } from "@dfinity/candid"; import type { Principal } from "@dfinity/principal"; export interface Account { @@ -81,3 +82,5 @@ export interface _SERVICE { ledger_id: ActorMethod<[], Principal>; list_subaccounts: ActorMethod<[ListSubaccountsArgs], Array>; } +export declare const idlFactory: IDL.InterfaceFactory; +export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[]; diff --git a/packages/ledger-icrc/candid/icrc_ledger.d.ts b/packages/ledger-icrc/candid/icrc_ledger.d.ts index ab0f2347b..f812acd46 100644 --- a/packages/ledger-icrc/candid/icrc_ledger.d.ts +++ b/packages/ledger-icrc/candid/icrc_ledger.d.ts @@ -1,4 +1,5 @@ import type { ActorMethod } from "@dfinity/agent"; +import type { IDL } from "@dfinity/candid"; import type { Principal } from "@dfinity/principal"; export interface Account { @@ -267,3 +268,5 @@ export interface _SERVICE { icrc2_approve: ActorMethod<[ApproveArgs], ApproveResult>; icrc2_transfer_from: ActorMethod<[TransferFromArgs], TransferFromResult>; } +export declare const idlFactory: IDL.InterfaceFactory; +export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[]; diff --git a/packages/nns/candid/genesis_token.d.ts b/packages/nns/candid/genesis_token.d.ts index 7f18ded4b..ac5aa02e4 100644 --- a/packages/nns/candid/genesis_token.d.ts +++ b/packages/nns/candid/genesis_token.d.ts @@ -1,4 +1,5 @@ import type { ActorMethod } from "@dfinity/agent"; +import type { IDL } from "@dfinity/candid"; import type { Principal } from "@dfinity/principal"; export interface AccountState { @@ -33,3 +34,5 @@ export interface _SERVICE { len: ActorMethod<[], number>; total: ActorMethod<[], number>; } +export declare const idlFactory: IDL.InterfaceFactory; +export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[]; diff --git a/packages/nns/candid/governance.d.ts b/packages/nns/candid/governance.d.ts index 0f8410375..a49023267 100644 --- a/packages/nns/candid/governance.d.ts +++ b/packages/nns/candid/governance.d.ts @@ -1,4 +1,5 @@ import type { ActorMethod } from "@dfinity/agent"; +import type { IDL } from "@dfinity/candid"; import type { Principal } from "@dfinity/principal"; export interface AccountIdentifier { @@ -791,3 +792,5 @@ export interface _SERVICE { transfer_gtc_neuron: ActorMethod<[NeuronId, NeuronId], Result>; update_node_provider: ActorMethod<[UpdateNodeProvider], Result>; } +export declare const idlFactory: IDL.InterfaceFactory; +export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[]; diff --git a/packages/nns/candid/governance_test.d.ts b/packages/nns/candid/governance_test.d.ts index 893182fec..c0b58b109 100644 --- a/packages/nns/candid/governance_test.d.ts +++ b/packages/nns/candid/governance_test.d.ts @@ -1,4 +1,5 @@ import type { ActorMethod } from "@dfinity/agent"; +import type { IDL } from "@dfinity/candid"; import type { Principal } from "@dfinity/principal"; export interface AccountIdentifier { @@ -792,3 +793,5 @@ export interface _SERVICE { update_neuron: ActorMethod<[Neuron], [] | [GovernanceError]>; update_node_provider: ActorMethod<[UpdateNodeProvider], Result>; } +export declare const idlFactory: IDL.InterfaceFactory; +export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[]; diff --git a/packages/nns/candid/sns_wasm.d.ts b/packages/nns/candid/sns_wasm.d.ts index 0a84318a3..498ba1fc2 100644 --- a/packages/nns/candid/sns_wasm.d.ts +++ b/packages/nns/candid/sns_wasm.d.ts @@ -1,4 +1,5 @@ import type { ActorMethod } from "@dfinity/agent"; +import type { IDL } from "@dfinity/candid"; import type { Principal } from "@dfinity/principal"; export interface AddWasmRequest { @@ -288,3 +289,5 @@ export interface _SERVICE { UpdateSnsSubnetListResponse >; } +export declare const idlFactory: IDL.InterfaceFactory; +export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[]; diff --git a/packages/sns/candid/sns_governance.d.ts b/packages/sns/candid/sns_governance.d.ts index f8b444723..d4d0f9d5c 100644 --- a/packages/sns/candid/sns_governance.d.ts +++ b/packages/sns/candid/sns_governance.d.ts @@ -1,4 +1,5 @@ import type { ActorMethod } from "@dfinity/agent"; +import type { IDL } from "@dfinity/candid"; import type { Principal } from "@dfinity/principal"; export interface Account { @@ -552,3 +553,5 @@ export interface _SERVICE { manage_neuron: ActorMethod<[ManageNeuron], ManageNeuronResponse>; set_mode: ActorMethod<[SetMode], {}>; } +export declare const idlFactory: IDL.InterfaceFactory; +export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[]; diff --git a/packages/sns/candid/sns_governance_test.d.ts b/packages/sns/candid/sns_governance_test.d.ts index ee32ce169..a2137b5c9 100644 --- a/packages/sns/candid/sns_governance_test.d.ts +++ b/packages/sns/candid/sns_governance_test.d.ts @@ -1,4 +1,5 @@ import type { ActorMethod } from "@dfinity/agent"; +import type { IDL } from "@dfinity/candid"; import type { Principal } from "@dfinity/principal"; export interface Account { @@ -566,3 +567,5 @@ export interface _SERVICE { set_mode: ActorMethod<[SetMode], {}>; update_neuron: ActorMethod<[Neuron], [] | [GovernanceError]>; } +export declare const idlFactory: IDL.InterfaceFactory; +export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[]; diff --git a/packages/sns/candid/sns_root.d.ts b/packages/sns/candid/sns_root.d.ts index a10744dc8..711a9ecd1 100644 --- a/packages/sns/candid/sns_root.d.ts +++ b/packages/sns/candid/sns_root.d.ts @@ -1,4 +1,5 @@ import type { ActorMethod } from "@dfinity/agent"; +import type { IDL } from "@dfinity/candid"; import type { Principal } from "@dfinity/principal"; export interface CanisterCallError { @@ -118,3 +119,5 @@ export interface _SERVICE { SetDappControllersResponse >; } +export declare const idlFactory: IDL.InterfaceFactory; +export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[]; diff --git a/packages/sns/candid/sns_swap.d.ts b/packages/sns/candid/sns_swap.d.ts index a1fb94b71..c12f173eb 100644 --- a/packages/sns/candid/sns_swap.d.ts +++ b/packages/sns/candid/sns_swap.d.ts @@ -1,4 +1,5 @@ import type { ActorMethod } from "@dfinity/agent"; +import type { IDL } from "@dfinity/candid"; import type { Principal } from "@dfinity/principal"; export interface BuyerState { @@ -395,3 +396,5 @@ export interface _SERVICE { >; restore_dapp_controllers: ActorMethod<[{}], SetDappControllersCallResult>; } +export declare const idlFactory: IDL.InterfaceFactory; +export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];