Skip to content

Commit

Permalink
chore: merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpeterparker committed Jul 3, 2023
2 parents 0c083d6 + fbad3ac commit 0c42086
Show file tree
Hide file tree
Showing 10 changed files with 94 additions and 443 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.18.0 (wip)
# 0.18.0 (2023-07-03)

## Release

Expand All @@ -19,6 +19,13 @@
## Features

- add a new utils function `decodePayment` to the `@dfinity/ledger` library. Useful to decode payment through QR code that contains target address and amount
- add provisional create canister with cycles method
- `CreateServiceNervousSystem` <-> `RawCreateServiceNervousSystem` transformations for Nns proposal
- decode payment code (early support and not yet specified. see ICRC-22)

## Build

- bump `semver`

# 0.17.2 (2023-06-21)

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dfinity/ic-js",
"version": "0.17.2",
"version": "0.18.0",
"description": "A collection of library for interfacing with the Internet Computer.",
"license": "Apache-2.0",
"workspaces": [
Expand Down
26 changes: 9 additions & 17 deletions packages/ckbtc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,17 @@ Parameters:
- `params`: The Bitcoin address and network to parse
- `params.network`: Optional. Default BtcNetwork is Mainnet

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/utils/btc.utils.ts#L194)

### :factory: CkBTCMinterCanister

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

`public`

Parameters:

- `id`
- `service`
- `certifiedService`

#### Methods

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

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

##### :gear: getBtcAddress

Returns a BTC address for a given account.
Expand All @@ -114,8 +118,6 @@ 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)

##### :gear: updateBalance

Notify the minter about the bitcoin transfer.
Expand All @@ -132,8 +134,6 @@ 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)

##### :gear: getWithdrawalAccount

Returns the account to which the caller should deposit ckBTC before withdrawing BTC using the [retrieveBtc] endpoint.
Expand All @@ -142,8 +142,6 @@ 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)

##### :gear: retrieveBtc

Submits a request to convert ckBTC to BTC.
Expand All @@ -166,8 +164,6 @@ 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)

##### :gear: estimateWithdrawalFee

Returns an estimation of the user's fee (in Satoshi) for a retrieve_btc request based on the current status of the Bitcoin network and the fee related to the minter.
Expand All @@ -182,8 +178,6 @@ 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)

##### :gear: getMinterInfo

Returns internal minter parameters such as the minimal amount to retrieve BTC, minimal number of confirmations or KYT fee.
Expand All @@ -197,8 +191,6 @@ 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)

<!-- TSDOC_END -->

## Resources
Expand Down
10 changes: 0 additions & 10 deletions packages/cmc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ const rate = await getIcpToCyclesConversionRate();

### :factory: CMCCanister

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

#### Methods

- [create](#gear-create)
Expand All @@ -70,8 +68,6 @@ const rate = await getIcpToCyclesConversionRate();
| -------- | ---------------------------------------------- |
| `create` | `(options: CMCCanisterOptions) => CMCCanister` |

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

##### :gear: getIcpToCyclesConversionRate

Returns conversion rate of ICP to Cycles
Expand All @@ -80,8 +76,6 @@ Returns conversion rate of ICP to Cycles
| ------------------------------ | ----------------------- |
| `getIcpToCyclesConversionRate` | `() => Promise<bigint>` |

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

##### :gear: notifyCreateCanister

Notifies Cycles Minting Canister of the creation of a new canister.
Expand All @@ -91,8 +85,6 @@ It returns the new canister principal.
| ---------------------- | ---------------------------------------------------------- |
| `notifyCreateCanister` | `(request: NotifyCreateCanisterArg) => Promise<Principal>` |

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

##### :gear: notifyTopUp

Notifies Cycles Minting Canister of new cycles being added to canister.
Expand All @@ -102,6 +94,4 @@ It returns the new Cycles of the canister.
| ------------- | ---------------------------------------------- |
| `notifyTopUp` | `(request: NotifyTopUpArg) => Promise<bigint>` |

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

<!-- TSDOC_END -->
36 changes: 6 additions & 30 deletions packages/ic-management/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ const { status, memory_size, ...rest } = await canisterStatus(YOUR_CANISTER_ID);

### :factory: ICManagementCanister

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

#### Methods

- [create](#gear-create)
Expand All @@ -76,8 +74,6 @@ const { status, memory_size, ...rest } = await canisterStatus(YOUR_CANISTER_ID);
| -------- | ---------------------------------------------------------------- |
| `create` | `(options: ICManagementCanisterOptions) => ICManagementCanister` |

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

##### :gear: createCanister

Create a new canister
Expand All @@ -86,8 +82,6 @@ Create a new canister
| ---------------- | ------------------------------------------------------------------------------------ |
| `createCanister` | `({ settings, senderCanisterVerion, }?: CreateCanisterParams) => Promise<Principal>` |

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

##### :gear: updateSettings

Update canister settings
Expand All @@ -96,8 +90,6 @@ Update canister settings
| ---------------- | ------------------------------------------------------------------------------------------ |
| `updateSettings` | `({ canisterId, senderCanisterVerion, settings, }: UpdateSettingsParams) => Promise<void>` |

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

##### :gear: installCode

Install code to a canister
Expand All @@ -106,8 +98,6 @@ Install code to a canister
| ------------- | ---------------------------------------------------------------------------------------------------- |
| `installCode` | `({ mode, canisterId, wasmModule, arg, senderCanisterVerion, }: InstallCodeParams) => Promise<void>` |

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

##### :gear: uninstallCode

Uninstall code from a canister
Expand All @@ -116,8 +106,6 @@ Uninstall code from a canister
| --------------- | ------------------------------------------------------------------------------- |
| `uninstallCode` | `({ canisterId, senderCanisterVerion, }: UninstallCodeParams) => Promise<void>` |

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

##### :gear: startCanister

Start a canister
Expand All @@ -126,8 +114,6 @@ Start a canister
| --------------- | ------------------------------------------ |
| `startCanister` | `(canisterId: Principal) => Promise<void>` |

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

##### :gear: stopCanister

Stop a canister
Expand All @@ -136,27 +122,21 @@ Stop a canister
| -------------- | ------------------------------------------ |
| `stopCanister` | `(canisterId: Principal) => Promise<void>` |

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

##### :gear: canisterStatus

Get canister details (memory size, status, etc.)

| Method | Type |
| ---------------- | --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `canisterStatus` | `(canisterId: Principal) => Promise<{ status: { stopped: null; } or { stopping: null; } | { running: null; }; memory_size: bigint; cycles: bigint; settings: definite_canister_settings; idle_cycles_burned_per_day: bigint; module_hash: [] | [...]; }>` |

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L149)
| Method | Type |
| ---------------- | ---------------------------------------------------------------------------------- |
| `canisterStatus` | `(canisterId: Principal) => Promise<ServiceResponse<_SERVICE, "canister_status">>` |

##### :gear: canisterInfo

Get canister info (controllers, module hash, changes, etc.)

| Method | Type |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `canisterInfo` | `({ canisterId, numRequestChanges, }: CanisterInfoParams) => Promise<{ controllers: Principal[]; module_hash: [] or [Uint8Array]; recent_changes: change[]; total_num_changes: bigint; }>` |

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L162)
| Method | Type |
| -------------- | ----------------------------------------------------------------------------------------------------------------- |
| `canisterInfo` | `({ canisterId, numRequestChanges, }: CanisterInfoParams) => Promise<ServiceResponse<_SERVICE, "canister_info">>` |

##### :gear: deleteCanister

Expand All @@ -166,8 +146,6 @@ Deletes a canister
| ---------------- | ------------------------------------------ |
| `deleteCanister` | `(canisterId: Principal) => Promise<void>` |

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

##### :gear: provisionalCreateCanisterWithCycles

Creates a canister. Only available on development instances.
Expand All @@ -176,8 +154,6 @@ Creates a canister. Only available on development instances.
| ------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `provisionalCreateCanisterWithCycles` | `({ settings, amount, canisterId, }?: ProvisionalCreateCanisterWithCyclesParams) => Promise<Principal>` |

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

<!-- TSDOC_END -->

## Resources
Expand Down
Loading

0 comments on commit 0c42086

Please sign in to comment.