Skip to content

Commit

Permalink
Merge branch 'main' into feat/expose-converters
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpeterparker authored Sep 10, 2024
2 parents 0b75797 + 1b43ed0 commit d2e538e
Show file tree
Hide file tree
Showing 39 changed files with 35 additions and 320 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Next

## Breaking changes

- Removed deprecated `OpenSnsTokenSwap`, `SetSnsTokenSwapOpenTimeWindow`, and `SetDefaultFollowees` from `ProposalActionRequest`.

## Features

- Add support for `icrc21_canister_call_consent_message` to `@dfinity/ledger-icp` and `@dfinity/ledger-icrc`.
- Add support for `"regtest"` in `BitcoinNetwork`.

# 2024.09.02-0830Z

Expand Down
4 changes: 2 additions & 2 deletions packages/ckbtc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ Parameters:

##### :gear: getUtxosQuery

Given a `get_utxos_request`, which must specify a Bitcoin address and a Bitcoin network (`mainnet` or `testnet`), the function returns all unspent transaction outputs (UTXOs) associated with the provided address in the specified Bitcoin network based on the current view of the Bitcoin blockchain available to the Bitcoin component.
Given a `get_utxos_request`, which must specify a Bitcoin address and a Bitcoin network (`mainnet`, `testnet` or `regtest`), the function returns all unspent transaction outputs (UTXOs) associated with the provided address in the specified Bitcoin network based on the current view of the Bitcoin blockchain available to the Bitcoin component.

⚠️ Note that this method does not support certified calls because only canisters are allowed to get UTXOs via update calls.

Expand All @@ -312,7 +312,7 @@ Parameters:

##### :gear: getBalanceQuery

Given a `get_balance_request`, which must specify a Bitcoin address and a Bitcoin network (`mainnet` or `testnet`), the function returns the current balance of this address in `Satoshi` (10^8 Satoshi = 1 Bitcoin) in the specified Bitcoin network.
Given a `get_balance_request`, which must specify a Bitcoin address and a Bitcoin network (`mainnet`, `testnet` or `regtest`), the function returns the current balance of this address in `Satoshi` (10^8 Satoshi = 1 Bitcoin) in the specified Bitcoin network.

⚠️ Note that this method does not support certified calls because only canisters are allowed to get Bitcoin balance via update calls.

Expand Down
2 changes: 1 addition & 1 deletion packages/ckbtc/candid/minter.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 35bfcad (2024-08-29 tags: release-2024-08-29_01-30-base) 'rs/bitcoin/ckbtc/minter/ckbtc_minter.did' by import-candid
// Generated from IC repo commit 843e71b (2024-08-14 tags: release-2024-09-06_01-30-canister-snapshots) 'rs/bitcoin/ckbtc/minter/ckbtc_minter.did' by import-candid
// Represents an account on the ckBTC ledger.
type Account = record { owner : principal; subaccount : opt blob };

Expand Down
4 changes: 2 additions & 2 deletions packages/ckbtc/src/bitcoin.canister.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class BitcoinCanister extends Canister<BitcoinService> {
}

/**
* Given a `get_utxos_request`, which must specify a Bitcoin address and a Bitcoin network (`mainnet` or `testnet`), the function returns all unspent transaction outputs (UTXOs) associated with the provided address in the specified Bitcoin network based on the current view of the Bitcoin blockchain available to the Bitcoin component.
* Given a `get_utxos_request`, which must specify a Bitcoin address and a Bitcoin network (`mainnet`, `testnet` or `regtest`), the function returns all unspent transaction outputs (UTXOs) associated with the provided address in the specified Bitcoin network based on the current view of the Bitcoin blockchain available to the Bitcoin component.
*
* ⚠️ Note that this method does not support certified calls because only canisters are allowed to get UTXOs via update calls.
*
Expand All @@ -49,7 +49,7 @@ export class BitcoinCanister extends Canister<BitcoinService> {
};

/**
* Given a `get_balance_request`, which must specify a Bitcoin address and a Bitcoin network (`mainnet` or `testnet`), the function returns the current balance of this address in `Satoshi` (10^8 Satoshi = 1 Bitcoin) in the specified Bitcoin network.
* Given a `get_balance_request`, which must specify a Bitcoin address and a Bitcoin network (`mainnet`, `testnet` or `regtest`), the function returns the current balance of this address in `Satoshi` (10^8 Satoshi = 1 Bitcoin) in the specified Bitcoin network.
*
* ⚠️ Note that this method does not support certified calls because only canisters are allowed to get Bitcoin balance via update calls.
*
Expand Down
11 changes: 7 additions & 4 deletions packages/ckbtc/src/types/bitcoin.params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ import type {
network,
} from "../../candid/bitcoin";

export type BitcoinNetwork = "testnet" | "mainnet";
export type BitcoinNetwork = "testnet" | "mainnet" | "regtest";

const mapBitcoinNetwork = (network: BitcoinNetwork): network =>
network === "testnet" ? { testnet: null } : { mainnet: null };
const mapBitcoinNetwork: Record<BitcoinNetwork, network> = {
mainnet: { mainnet: null },
testnet: { testnet: null },
regtest: { regtest: null },
};

export type GetUtxosParams = Omit<get_utxos_request, "network" | "filter"> & {
network: BitcoinNetwork;
Expand Down Expand Up @@ -45,6 +48,6 @@ export const toGetBalanceParams = ({
...rest
}: GetBalanceParams): get_balance_request => ({
min_confirmations: toNullable(minConfirmations),
network: mapBitcoinNetwork(network),
network: mapBitcoinNetwork[network],
...rest,
});
2 changes: 1 addition & 1 deletion packages/cketh/candid/minter.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 35bfcad (2024-08-29 tags: release-2024-08-29_01-30-base) 'rs/ethereum/cketh/minter/cketh_minter.did' by import-candid
// Generated from IC repo commit 843e71b (2024-08-14 tags: release-2024-09-06_01-30-canister-snapshots) 'rs/ethereum/cketh/minter/cketh_minter.did' by import-candid
type EthereumNetwork = variant {
// The public Ethereum mainnet.
Mainnet;
Expand Down
2 changes: 1 addition & 1 deletion packages/cketh/candid/orchestrator.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 35bfcad (2024-08-29 tags: release-2024-08-29_01-30-base) 'rs/ethereum/ledger-suite-orchestrator/ledger_suite_orchestrator.did' by import-candid
// Generated from IC repo commit 843e71b (2024-08-14 tags: release-2024-09-06_01-30-canister-snapshots) 'rs/ethereum/ledger-suite-orchestrator/ledger_suite_orchestrator.did' by import-candid
type OrchestratorArg = variant {
UpgradeArg : UpgradeArg;
InitArg : InitArg;
Expand Down
2 changes: 1 addition & 1 deletion packages/cmc/candid/cmc.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 35bfcad (2024-08-29 tags: release-2024-08-29_01-30-base) 'rs/nns/cmc/cmc.did' by import-candid
// Generated from IC repo commit 843e71b (2024-08-14 tags: release-2024-09-06_01-30-canister-snapshots) 'rs/nns/cmc/cmc.did' by import-candid
type Cycles = nat;
type BlockIndex = nat64;
type log_visibility = variant {
Expand Down
32 changes: 0 additions & 32 deletions packages/ic-management/candid/ic-management.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ export const idlFactory = ({ IDL }) => {
});
const satoshi = IDL.Nat64;
const bitcoin_get_balance_result = satoshi;
const bitcoin_get_balance_query_args = IDL.Record({
'network' : bitcoin_network,
'address' : bitcoin_address,
'min_confirmations' : IDL.Opt(IDL.Nat32),
});
const bitcoin_get_balance_query_result = satoshi;
const bitcoin_block_height = IDL.Nat32;
const bitcoin_get_block_headers_args = IDL.Record({
'start_height' : bitcoin_block_height,
Expand Down Expand Up @@ -62,22 +56,6 @@ export const idlFactory = ({ IDL }) => {
'tip_block_hash' : bitcoin_block_hash,
'utxos' : IDL.Vec(utxo),
});
const bitcoin_get_utxos_query_args = IDL.Record({
'network' : bitcoin_network,
'filter' : IDL.Opt(
IDL.Variant({
'page' : IDL.Vec(IDL.Nat8),
'min_confirmations' : IDL.Nat32,
})
),
'address' : bitcoin_address,
});
const bitcoin_get_utxos_query_result = IDL.Record({
'next_page' : IDL.Opt(IDL.Vec(IDL.Nat8)),
'tip_height' : bitcoin_block_height,
'tip_block_hash' : bitcoin_block_hash,
'utxos' : IDL.Vec(utxo),
});
const bitcoin_send_transaction_args = IDL.Record({
'transaction' : IDL.Vec(IDL.Nat8),
'network' : bitcoin_network,
Expand Down Expand Up @@ -340,11 +318,6 @@ export const idlFactory = ({ IDL }) => {
[bitcoin_get_balance_result],
[],
),
'bitcoin_get_balance_query' : IDL.Func(
[bitcoin_get_balance_query_args],
[bitcoin_get_balance_query_result],
[],
),
'bitcoin_get_block_headers' : IDL.Func(
[bitcoin_get_block_headers_args],
[bitcoin_get_block_headers_result],
Expand All @@ -360,11 +333,6 @@ export const idlFactory = ({ IDL }) => {
[bitcoin_get_utxos_result],
[],
),
'bitcoin_get_utxos_query' : IDL.Func(
[bitcoin_get_utxos_query_args],
[bitcoin_get_utxos_query_result],
[],
),
'bitcoin_send_transaction' : IDL.Func(
[bitcoin_send_transaction_args],
[],
Expand Down
27 changes: 0 additions & 27 deletions packages/ic-management/candid/ic-management.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ export interface bitcoin_get_balance_args {
address: bitcoin_address;
min_confirmations: [] | [number];
}
export interface bitcoin_get_balance_query_args {
network: bitcoin_network;
address: bitcoin_address;
min_confirmations: [] | [number];
}
export type bitcoin_get_balance_query_result = satoshi;
export type bitcoin_get_balance_result = satoshi;
export interface bitcoin_get_block_headers_args {
start_height: bitcoin_block_height;
Expand All @@ -40,19 +34,6 @@ export interface bitcoin_get_utxos_args {
| [{ page: Uint8Array | number[] } | { min_confirmations: number }];
address: bitcoin_address;
}
export interface bitcoin_get_utxos_query_args {
network: bitcoin_network;
filter:
| []
| [{ page: Uint8Array | number[] } | { min_confirmations: number }];
address: bitcoin_address;
}
export interface bitcoin_get_utxos_query_result {
next_page: [] | [Uint8Array | number[]];
tip_height: bitcoin_block_height;
tip_block_hash: bitcoin_block_hash;
utxos: Array<utxo>;
}
export interface bitcoin_get_utxos_result {
next_page: [] | [Uint8Array | number[]];
tip_height: bitcoin_block_height;
Expand Down Expand Up @@ -322,10 +303,6 @@ export interface _SERVICE {
[bitcoin_get_balance_args],
bitcoin_get_balance_result
>;
bitcoin_get_balance_query: ActorMethod<
[bitcoin_get_balance_query_args],
bitcoin_get_balance_query_result
>;
bitcoin_get_block_headers: ActorMethod<
[bitcoin_get_block_headers_args],
bitcoin_get_block_headers_result
Expand All @@ -338,10 +315,6 @@ export interface _SERVICE {
[bitcoin_get_utxos_args],
bitcoin_get_utxos_result
>;
bitcoin_get_utxos_query: ActorMethod<
[bitcoin_get_utxos_query_args],
bitcoin_get_utxos_query_result
>;
bitcoin_send_transaction: ActorMethod<
[bitcoin_send_transaction_args],
undefined
Expand Down
28 changes: 1 addition & 27 deletions packages/ic-management/candid/ic-management.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from dfinity/interface-spec commit 0a50e0c1eac44dbc0c02116ff110096a17c4c022 for file 'spec/_attachments/ic.did'
// Generated from dfinity/interface-spec commit 45a23a737ec37cb8c9b098e377af857b4b55abda for file 'spec/_attachments/ic.did'
type canister_id = principal;
type wasm_module = blob;

Expand Down Expand Up @@ -126,22 +126,6 @@ type bitcoin_get_utxos_result = record {
next_page : opt blob;
};

type bitcoin_get_utxos_query_args = record {
address : bitcoin_address;
network : bitcoin_network;
filter : opt variant {
min_confirmations : nat32;
page : blob;
};
};

type bitcoin_get_utxos_query_result = record {
utxos : vec utxo;
tip_block_hash : bitcoin_block_hash;
tip_height : bitcoin_block_height;
next_page : opt blob;
};

type bitcoin_get_balance_args = record {
address : bitcoin_address;
network : bitcoin_network;
Expand All @@ -150,14 +134,6 @@ type bitcoin_get_balance_args = record {

type bitcoin_get_balance_result = satoshi;

type bitcoin_get_balance_query_args = record {
address : bitcoin_address;
network : bitcoin_network;
min_confirmations : opt nat32;
};

type bitcoin_get_balance_query_result = satoshi;

type bitcoin_get_current_fee_percentiles_args = record {
network : bitcoin_network;
};
Expand Down Expand Up @@ -425,9 +401,7 @@ service ic : {

// bitcoin interface
bitcoin_get_balance : (bitcoin_get_balance_args) -> (bitcoin_get_balance_result);
bitcoin_get_balance_query : (bitcoin_get_balance_query_args) -> (bitcoin_get_balance_query_result) query;
bitcoin_get_utxos : (bitcoin_get_utxos_args) -> (bitcoin_get_utxos_result);
bitcoin_get_utxos_query : (bitcoin_get_utxos_query_args) -> (bitcoin_get_utxos_query_result) query;
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);
Expand Down
32 changes: 0 additions & 32 deletions packages/ic-management/candid/ic-management.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ export const idlFactory = ({ IDL }) => {
});
const satoshi = IDL.Nat64;
const bitcoin_get_balance_result = satoshi;
const bitcoin_get_balance_query_args = IDL.Record({
'network' : bitcoin_network,
'address' : bitcoin_address,
'min_confirmations' : IDL.Opt(IDL.Nat32),
});
const bitcoin_get_balance_query_result = satoshi;
const bitcoin_block_height = IDL.Nat32;
const bitcoin_get_block_headers_args = IDL.Record({
'start_height' : bitcoin_block_height,
Expand Down Expand Up @@ -62,22 +56,6 @@ export const idlFactory = ({ IDL }) => {
'tip_block_hash' : bitcoin_block_hash,
'utxos' : IDL.Vec(utxo),
});
const bitcoin_get_utxos_query_args = IDL.Record({
'network' : bitcoin_network,
'filter' : IDL.Opt(
IDL.Variant({
'page' : IDL.Vec(IDL.Nat8),
'min_confirmations' : IDL.Nat32,
})
),
'address' : bitcoin_address,
});
const bitcoin_get_utxos_query_result = IDL.Record({
'next_page' : IDL.Opt(IDL.Vec(IDL.Nat8)),
'tip_height' : bitcoin_block_height,
'tip_block_hash' : bitcoin_block_hash,
'utxos' : IDL.Vec(utxo),
});
const bitcoin_send_transaction_args = IDL.Record({
'transaction' : IDL.Vec(IDL.Nat8),
'network' : bitcoin_network,
Expand Down Expand Up @@ -340,11 +318,6 @@ export const idlFactory = ({ IDL }) => {
[bitcoin_get_balance_result],
[],
),
'bitcoin_get_balance_query' : IDL.Func(
[bitcoin_get_balance_query_args],
[bitcoin_get_balance_query_result],
['query'],
),
'bitcoin_get_block_headers' : IDL.Func(
[bitcoin_get_block_headers_args],
[bitcoin_get_block_headers_result],
Expand All @@ -360,11 +333,6 @@ export const idlFactory = ({ IDL }) => {
[bitcoin_get_utxos_result],
[],
),
'bitcoin_get_utxos_query' : IDL.Func(
[bitcoin_get_utxos_query_args],
[bitcoin_get_utxos_query_result],
['query'],
),
'bitcoin_send_transaction' : IDL.Func(
[bitcoin_send_transaction_args],
[],
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icp/candid/index.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 35bfcad (2024-08-29 tags: release-2024-08-29_01-30-base) 'rs/rosetta-api/icp_ledger/index/index.did' by import-candid
// Generated from IC repo commit 843e71b (2024-08-14 tags: release-2024-09-06_01-30-canister-snapshots) 'rs/rosetta-api/icp_ledger/index/index.did' by import-candid
type Account = record { owner : principal; subaccount : opt vec nat8 };
type GetAccountIdentifierTransactionsArgs = record {
max_results : nat64;
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icp/candid/ledger.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 35bfcad (2024-08-29 tags: release-2024-08-29_01-30-base) 'rs/rosetta-api/icp_ledger/ledger.did' by import-candid
// Generated from IC repo commit 843e71b (2024-08-14 tags: release-2024-09-06_01-30-canister-snapshots) 'rs/rosetta-api/icp_ledger/ledger.did' by import-candid
// This is the official Ledger interface that is guaranteed to be backward compatible.

// Amount of tokens, measured in 10^-8 of a token.
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icrc/candid/icrc_index-ng.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 35bfcad (2024-08-29 tags: release-2024-08-29_01-30-base) 'rs/rosetta-api/icrc1/index-ng/index-ng.did' by import-candid
// Generated from IC repo commit 843e71b (2024-08-14 tags: release-2024-09-06_01-30-canister-snapshots) 'rs/rosetta-api/icrc1/index-ng/index-ng.did' by import-candid
type Tokens = nat;

type InitArg = record {
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icrc/candid/icrc_index.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 35bfcad (2024-08-29 tags: release-2024-08-29_01-30-base) 'rs/rosetta-api/icrc1/index/index.did' by import-candid
// Generated from IC repo commit 843e71b (2024-08-14 tags: release-2024-09-06_01-30-canister-snapshots) 'rs/rosetta-api/icrc1/index/index.did' by import-candid
type TxId = nat;

type Account = record { owner : principal; subaccount : opt blob };
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icrc/candid/icrc_ledger.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 35bfcad (2024-08-29 tags: release-2024-08-29_01-30-base) 'rs/rosetta-api/icrc1/ledger/ledger.did' by import-candid
// Generated from IC repo commit 843e71b (2024-08-14 tags: release-2024-09-06_01-30-canister-snapshots) 'rs/rosetta-api/icrc1/ledger/ledger.did' by import-candid
type BlockIndex = nat;
type Subaccount = blob;
// Number of nanoseconds since the UNIX epoch in UTC timezone.
Expand Down
2 changes: 1 addition & 1 deletion packages/nns/candid/genesis_token.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 35bfcad (2024-08-29 tags: release-2024-08-29_01-30-base) 'rs/nns/gtc/canister/gtc.did' by import-candid
// Generated from IC repo commit 843e71b (2024-08-14 tags: release-2024-09-06_01-30-canister-snapshots) 'rs/nns/gtc/canister/gtc.did' by import-candid
type AccountState = record {
authenticated_principal_id : opt principal;
successfully_transferred_neurons : vec TransferredNeuron;
Expand Down
6 changes: 0 additions & 6 deletions packages/nns/candid/governance.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ export const idlFactory = ({ IDL }) => {
});
const NeuronsFundNeuronPortion = IDL.Record({
'controller' : IDL.Opt(IDL.Principal),
'hotkey_principal' : IDL.Opt(IDL.Principal),
'hotkeys' : IDL.Vec(IDL.Principal),
'is_capped' : IDL.Opt(IDL.Bool),
'maturity_equivalent_icp_e8s' : IDL.Opt(IDL.Nat64),
Expand Down Expand Up @@ -770,9 +769,6 @@ export const idlFactory = ({ IDL }) => {
'CreateServiceNervousSystem' : CreateServiceNervousSystem,
'ExecuteNnsFunction' : ExecuteNnsFunction,
'RewardNodeProvider' : RewardNodeProvider,
'OpenSnsTokenSwap' : OpenSnsTokenSwap,
'SetSnsTokenSwapOpenTimeWindow' : SetSnsTokenSwapOpenTimeWindow,
'SetDefaultFollowees' : SetDefaultFollowees,
'RewardNodeProviders' : RewardNodeProviders,
'ManageNetworkEconomics' : NetworkEconomics,
'ApproveGenesisKyc' : Principals,
Expand Down Expand Up @@ -873,7 +869,6 @@ export const idlFactory = ({ IDL }) => {
});
const NeuronsFundNeuron = IDL.Record({
'controller' : IDL.Opt(IDL.Principal),
'hotkey_principal' : IDL.Opt(IDL.Text),
'hotkeys' : IDL.Opt(Principals),
'is_capped' : IDL.Opt(IDL.Bool),
'nns_neuron_id' : IDL.Opt(IDL.Nat64),
Expand Down Expand Up @@ -1454,7 +1449,6 @@ export const init = ({ IDL }) => {
});
const NeuronsFundNeuronPortion = IDL.Record({
'controller' : IDL.Opt(IDL.Principal),
'hotkey_principal' : IDL.Opt(IDL.Principal),
'hotkeys' : IDL.Vec(IDL.Principal),
'is_capped' : IDL.Opt(IDL.Bool),
'maturity_equivalent_icp_e8s' : IDL.Opt(IDL.Nat64),
Expand Down
Loading

0 comments on commit d2e538e

Please sign in to comment.