Skip to content

Commit

Permalink
refactor: rename optional param of getBalance (#704)
Browse files Browse the repository at this point in the history
# Motivation

As discussed in #701, let's rename `min_confirmations` parameter of
`getBalance` in ckBTC library to `minConfirmations`.

# Changes

- Parameter and mapping updated accordingly.
  • Loading branch information
AntonioVentilii-DFINITY authored Aug 27, 2024
1 parent 79675d0 commit 0dd5c19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/ckbtc/src/bitcoin.canister.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ describe("BitcoinCanister", () => {
describe("bitcoinGetBalance", () => {
const params: Omit<GetBalanceParams, "certified"> = {
network: "testnet",
min_confirmations: 2,
minConfirmations: 2,
address: bitcoinAddressMock,
};

Expand Down
6 changes: 3 additions & 3 deletions packages/ckbtc/src/types/bitcoin.params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ export type GetBalanceParams = Omit<
"network" | "min_confirmations"
> & {
network: BitcoinNetwork;
min_confirmations?: number;
minConfirmations?: number;
} & QueryParams;

export const toGetBalanceParams = ({
network,
min_confirmations,
minConfirmations,
...rest
}: GetBalanceParams): get_balance_request => ({
min_confirmations: toNullable(min_confirmations),
min_confirmations: toNullable(minConfirmations),
network: mapBitcoinNetwork(network),
...rest,
});

0 comments on commit 0dd5c19

Please sign in to comment.