Skip to content

Commit

Permalink
🤖 Documentation auto-update
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 17, 2023
1 parent 6c14368 commit b103827
Showing 1 changed file with 35 additions and 8 deletions.
43 changes: 35 additions & 8 deletions packages/ckbtc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Parameters:

### :factory: CkBTCMinterCanister

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L33)
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L35)

#### Methods

Expand All @@ -87,6 +87,7 @@ Parameters:
- [updateBalance](#gear-updatebalance)
- [getWithdrawalAccount](#gear-getwithdrawalaccount)
- [retrieveBtc](#gear-retrievebtc)
- [retrieveBtcWithApproval](#gear-retrievebtcwithapproval)
- [estimateWithdrawalFee](#gear-estimatewithdrawalfee)
- [getMinterInfo](#gear-getminterinfo)

Expand All @@ -96,7 +97,7 @@ Parameters:
| -------- | ------------------------------------------------------------------------ |
| `create` | `(options: CkBTCMinterCanisterOptions<_SERVICE>) => CkBTCMinterCanister` |

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L34)
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L36)

##### :gear: getBtcAddress

Expand All @@ -114,7 +115,7 @@ Parameters:
- `params.owner`: The owner for which the BTC address should be generated. If not provided, the `caller` will be use instead.
- `params.subaccount`: An optional subaccount to compute the address.

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L55)
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L57)

##### :gear: updateBalance

Expand All @@ -132,7 +133,7 @@ Parameters:
- `params.owner`: The owner of the address. If not provided, the `caller` will be use instead.
- `params.subaccount`: An optional subaccount of the address.

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L74)
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L76)

##### :gear: getWithdrawalAccount

Expand All @@ -142,7 +143,7 @@ Returns the account to which the caller should deposit ckBTC before withdrawing
| ---------------------- | ------------------------ |
| `getWithdrawalAccount` | `() => Promise<Account>` |

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L97)
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L99)

##### :gear: retrieveBtc

Expand All @@ -166,7 +167,33 @@ Parameters:
- `params.address`: The bitcoin address.
- `params.amount`: The ckBTC amount.

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L116)
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L118)

##### :gear: retrieveBtcWithApproval

Submits a request to convert ckBTC to BTC after making an ICRC-2 approval.

# Note

The BTC retrieval process is slow. Instead of synchronously waiting for a BTC transaction to settle, this method returns a request ([block_index]) that the caller can use to query the request status.

# Preconditions

The caller allowed the minter's principal to spend its funds using
[icrc2_approve] on the ckBTC ledger.

| Method | Type |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `retrieveBtcWithApproval` | `({ address, amount, fromSubaccount, }: { address: string; amount: bigint; fromSubaccount?: Uint8Array; }) => Promise<RetrieveBtcOk>` |

Parameters:

- `params.address`: The bitcoin address.
- `params.amount`: The ckBTC amount.
- `params.fromSubaccount`: An optional subaccount from which
the ckBTC should be transferred.

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L148)

##### :gear: estimateWithdrawalFee

Expand All @@ -182,7 +209,7 @@ Parameters:
- `params.certified`: query or update call
- `params.amount`: The optional amount for which the fee should be estimated.

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L135)
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L179)

##### :gear: getMinterInfo

Expand All @@ -197,7 +224,7 @@ Parameters:
- `params`: The parameters to get the deposit fee.
- `params.certified`: query or update call

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L149)
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L193)

<!-- TSDOC_END -->

Expand Down

0 comments on commit b103827

Please sign in to comment.