Skip to content

Commit

Permalink
1 proposal support (#369)
Browse files Browse the repository at this point in the history
# Motivation

Add `CreateServiceNervousSystem` <-> `RawCreateServiceNervousSystem`
transformations.

Required for [nns-dapp
pr](dfinity/nns-dapp#2753).

# Changes

- add all related transform functions

# Tests

- Manually compared that after `RawCreateServiceNervousSystem to
CreateServiceNervousSystem` transformation all fields and values match.

# Screenshot

| Before | After |
|--------|--------|
|
![image](https://github.com/dfinity/ic-js/assets/98811342/86b2c867-82ab-4ae2-925e-1c331311dd97)
<br>
![image](https://github.com/dfinity/ic-js/assets/98811342/748b6f6d-fe0a-42fd-b27d-db02a0f5eb0b)
|
![image](https://github.com/dfinity/nns-dapp/assets/98811342/2dad9709-9a37-4408-99ce-de2c5b22d1ec)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
mstrasinskis and github-actions[bot] authored Jun 30, 2023
1 parent 8f9e466 commit 545db81
Show file tree
Hide file tree
Showing 5 changed files with 745 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
{
"name": "@dfinity/nns",
"path": "./packages/nns/dist/index.js",
"limit": "30 kB",
"limit": "32 kB",
"ignore": [
"@dfinity/agent",
"@dfinity/candid",
Expand Down
81 changes: 72 additions & 9 deletions packages/ic-management/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,30 +57,93 @@ const { status, memory_size, ...rest } = await canisterStatus(YOUR_CANISTER_ID);
#### Methods

- [create](#gear-create)
- [canisterStatus](#gear-canisterstatus)
- [createCanister](#gear-createcanister)
- [updateSettings](#gear-updatesettings)
- [installCode](#gear-installcode)
- [uninstallCode](#gear-uninstallcode)
- [startCanister](#gear-startcanister)
- [stopCanister](#gear-stopcanister)
- [canisterStatus](#gear-canisterstatus)
- [canisterInfo](#gear-canisterinfo)
- [deleteCanister](#gear-deletecanister)

##### :gear: create

| Method | Type |
| -------- | ---------------------------------------------------------------- |
| `create` | `(options: ICManagementCanisterOptions) => ICManagementCanister` |

##### :gear: canisterStatus
##### :gear: createCanister

Returns canister details (memory size, status, etc.)
Create a new canister

| Method | Type |
| ---------------- | ------------------------------------------------------------ |
| `canisterStatus` | `(canisterId: Principal) => Promise<CanisterStatusResponse>` |
| Method | Type |
| ---------------- | ------------------------------------------------------------------------------------ |
| `createCanister` | `({ settings, senderCanisterVerion, }?: CreateCanisterParams) => Promise<Principal>` |

##### :gear: updateSettings

Update canister settings

| Method | Type |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `updateSettings` | `({ canisterId, settings: { controllers, freezingThreshold, memoryAllocation, computeAllocation, }, }: UpdateSettingsParams) => Promise<void>` |
| Method | Type |
| ---------------- | ------------------------------------------------------------------------------------------ |
| `updateSettings` | `({ canisterId, senderCanisterVerion, settings, }: UpdateSettingsParams) => Promise<void>` |

##### :gear: installCode

Install code to a canister

| Method | Type |
| ------------- | ---------------------------------------------------------------------------------------------------- |
| `installCode` | `({ mode, canisterId, wasmModule, arg, senderCanisterVerion, }: InstallCodeParams) => Promise<void>` |

##### :gear: uninstallCode

Uninstall code from a canister

| Method | Type |
| --------------- | ------------------------------------------------------------------------------- |
| `uninstallCode` | `({ canisterId, senderCanisterVerion, }: UninstallCodeParams) => Promise<void>` |

##### :gear: startCanister

Start a canister

| Method | Type |
| --------------- | ------------------------------------------ |
| `startCanister` | `(canisterId: Principal) => Promise<void>` |

##### :gear: stopCanister

Stop a canister

| Method | Type |
| -------------- | ------------------------------------------ |
| `stopCanister` | `(canisterId: Principal) => Promise<void>` |

##### :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: [] | [...]; }>` |

##### :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; }>` |

##### :gear: deleteCanister

Deletes a canister

| Method | Type |
| ---------------- | ------------------------------------------ |
| `deleteCanister` | `(canisterId: Principal) => Promise<void>` |

<!-- TSDOC_END -->

Expand Down
Loading

0 comments on commit 545db81

Please sign in to comment.