Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added canister_info management canister API #1328

Merged
merged 4 commits into from
Oct 3, 2023
Merged

Conversation

dansteren
Copy link
Contributor

@dansteren dansteren commented Oct 2, 2023

Call it like this:

import { Canister, ic, update } from 'azle';
import {
    CanisterInfoArgs,
    CanisterInfoResult,
    managementCanister
} from 'azle/canisters/management';

export default Canister({
    getCanisterInfo: update(
        [CanisterInfoArgs],
        CanisterInfoResult,
        async (args) => {
            const result = await ic.call(managementCanister.canister_info, {
                args: [
                    {
                        canister_id: args.canister_id,
                        num_requested_changes: args.num_requested_changes
                    }
                ]
            });
            return result;
        }
    )
});

Closes #1281

@dansteren dansteren changed the base branch from main to js_rearchitecture October 2, 2023 19:28
examples/management_canister/src/index.ts Show resolved Hide resolved
src/lib_new/ic.ts Show resolved Hide resolved
canisters/management/canister_management.ts Outdated Show resolved Hide resolved
canisters/management/canister_management.ts Outdated Show resolved Hide resolved
examples/management_canister/src/index.ts Show resolved Hide resolved
@lastmjs
Copy link
Member

lastmjs commented Oct 2, 2023

Also put the license comments

@dansteren dansteren requested a review from lastmjs October 2, 2023 21:14
@lastmjs lastmjs merged commit 11beb1c into js_rearchitecture Oct 3, 2023
67 checks passed
@dansteren dansteren deleted the 1281_new_apis branch October 4, 2023 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Go over all IC Wasm APIs and cdk-rs APIs and make sure we have everything implemented
2 participants