From ba1042f61eb6ccfc12b87ef3bcd277b1267cd150 Mon Sep 17 00:00:00 2001 From: Jordan Last Date: Fri, 28 Jul 2023 13:58:15 -0500 Subject: [PATCH 1/2] add canister version, is controller, instruction counter documentation --- docs/404.html | 2 +- docs/azle.html | 2 +- docs/candid.html | 2 +- docs/canister_lifecycle.html | 2 +- docs/canisters_overview.html | 2 +- docs/caveats.html | 2 +- docs/cross_canister.html | 2 +- docs/cycles.html | 2 +- docs/deployment.html | 2 +- docs/examples.html | 2 +- docs/hello_world.html | 2 +- docs/http.html | 2 +- docs/index.html | 2 +- docs/installation.html | 2 +- docs/internet_computer_overview.html | 2 +- docs/management_canister.html | 2 +- docs/print.html | 76 +++++-- docs/query_methods.html | 2 +- docs/reference/bitcoin.html | 2 +- docs/reference/call_apis/accept_message.html | 2 +- docs/reference/call_apis/arg_data_raw.html | 2 +- .../call_apis/arg_data_raw_size.html | 2 +- docs/reference/call_apis/call.html | 2 +- docs/reference/call_apis/call_apis.html | 3 +- docs/reference/call_apis/call_raw.html | 2 +- docs/reference/call_apis/call_raw128.html | 2 +- .../call_apis/call_with_payment.html | 2 +- .../call_apis/call_with_payment128.html | 2 +- docs/reference/call_apis/caller.html | 2 +- docs/reference/call_apis/method_name.html | 2 +- .../call_apis/msg_cycles_accept.html | 2 +- .../call_apis/msg_cycles_accept128.html | 2 +- .../call_apis/msg_cycles_available.html | 2 +- .../call_apis/msg_cycles_available128.html | 2 +- .../call_apis/msg_cycles_refunded.html | 2 +- .../call_apis/msg_cycles_refunded128.html | 2 +- docs/reference/call_apis/notify.html | 2 +- docs/reference/call_apis/notify_raw.html | 2 +- .../call_apis/notify_with_payment_128.html | 6 +- docs/reference/call_apis/reject.html | 6 +- docs/reference/call_apis/reject_code.html | 2 +- docs/reference/call_apis/reject_message.html | 2 +- docs/reference/call_apis/reply.html | 2 +- docs/reference/call_apis/reply_raw.html | 2 +- docs/reference/candid/blob.html | 2 +- docs/reference/candid/bool.html | 2 +- docs/reference/candid/candid.html | 2 +- docs/reference/candid/empty.html | 2 +- docs/reference/candid/float32.html | 2 +- docs/reference/candid/float64.html | 2 +- docs/reference/candid/func.html | 2 +- docs/reference/candid/int.html | 2 +- docs/reference/candid/int16.html | 2 +- docs/reference/candid/int32.html | 2 +- docs/reference/candid/int64.html | 2 +- docs/reference/candid/int8.html | 2 +- docs/reference/candid/nat.html | 2 +- docs/reference/candid/nat16.html | 2 +- docs/reference/candid/nat32.html | 2 +- docs/reference/candid/nat64.html | 2 +- docs/reference/candid/nat8.html | 2 +- docs/reference/candid/null.html | 2 +- docs/reference/candid/opt.html | 2 +- docs/reference/candid/principal.html | 2 +- docs/reference/candid/record.html | 2 +- docs/reference/candid/reserved.html | 2 +- docs/reference/candid/service.html | 2 +- docs/reference/candid/text.html | 2 +- docs/reference/candid/variant.html | 2 +- docs/reference/candid/vec.html | 2 +- .../canister_apis/candid_decode.html | 2 +- .../canister_apis/candid_encode.html | 2 +- .../canister_apis/canister_apis.html | 6 +- .../canister_apis/canister_balance.html | 2 +- .../canister_apis/canister_balance128.html | 6 +- docs/reference/canister_apis/canister_id.html | 6 +- .../canister_apis/canister_version.html | 212 +++++++++++++++++ .../canister_apis/data_certificate.html | 6 +- .../canister_apis/instruction_counter.html | 213 ++++++++++++++++++ .../canister_apis/is_controller.html | 212 +++++++++++++++++ .../performance_counter.html | 10 +- docs/reference/canister_apis/print.html | 6 +- .../canister_apis/set_certified_data.html | 2 +- docs/reference/canister_apis/time.html | 2 +- docs/reference/canister_apis/trap.html | 2 +- .../canister_methods/canister_methods.html | 2 +- .../reference/canister_methods/heartbeat.html | 2 +- .../canister_methods/http_request.html | 2 +- .../canister_methods/http_request_update.html | 2 +- docs/reference/canister_methods/init.html | 2 +- .../canister_methods/inspect_message.html | 2 +- .../canister_methods/post_upgrade.html | 2 +- .../canister_methods/pre_upgrade.html | 2 +- docs/reference/canister_methods/query.html | 2 +- docs/reference/canister_methods/update.html | 2 +- docs/reference/environment_variables.html | 2 +- .../bitcoin_get_balance.html | 2 +- .../bitcoin_get_current_fee_percentiles.html | 2 +- .../bitcoin_get_utxos.html | 2 +- .../bitcoin_send_transaction.html | 2 +- .../management_canister/canister_status.html | 2 +- .../management_canister/create_canister.html | 2 +- .../management_canister/delete_canister.html | 2 +- .../management_canister/deposit_cycles.html | 2 +- .../management_canister/ecdsa_public_key.html | 2 +- .../management_canister/http_request.html | 2 +- .../management_canister/install_code.html | 2 +- .../management_canister.html | 2 +- ...ovisional_create_canister_with_cycles.html | 2 +- .../provisional_top_up_canister.html | 2 +- .../management_canister/raw_rand.html | 2 +- .../management_canister/sign_with_ecdsa.html | 2 +- .../management_canister/start_canister.html | 2 +- .../management_canister/stop_canister.html | 2 +- .../management_canister/uninstall_code.html | 2 +- .../management_canister/update_settings.html | 2 +- docs/reference/plugins.html | 2 +- docs/reference/reference.html | 2 +- .../stable_memory/stable64_grow.html | 2 +- .../stable_memory/stable64_read.html | 2 +- .../stable_memory/stable64_size.html | 2 +- .../stable_memory/stable64_write.html | 2 +- .../reference/stable_memory/stable_bytes.html | 2 +- docs/reference/stable_memory/stable_grow.html | 2 +- .../stable_memory/stable_memory.html | 2 +- docs/reference/stable_memory/stable_read.html | 2 +- docs/reference/stable_memory/stable_size.html | 2 +- .../stable_memory/stable_structures.html | 2 +- .../reference/stable_memory/stable_write.html | 2 +- docs/reference/timers/clear_timer.html | 2 +- docs/reference/timers/set_timer.html | 2 +- docs/reference/timers/set_timer_interval.html | 2 +- docs/reference/timers/timers.html | 2 +- docs/reference/wasm_binary_optimization.html | 2 +- docs/searchindex.js | 2 +- docs/searchindex.json | 2 +- docs/stable_structures.html | 2 +- docs/the_azle_book.html | 2 +- docs/timers.html | 2 +- docs/update_methods.html | 2 +- examples/ic_api/src/ic_api.ts | 2 +- the_azle_book/book/404.html | 2 +- the_azle_book/book/azle.html | 2 +- the_azle_book/book/candid.html | 2 +- the_azle_book/book/canisters_overview.html | 2 +- the_azle_book/book/cross_canister.html | 2 +- the_azle_book/book/cycles.html | 2 +- the_azle_book/book/deployment.html | 2 +- the_azle_book/book/examples.html | 2 +- the_azle_book/book/http.html | 2 +- the_azle_book/book/index.html | 2 +- the_azle_book/book/installation.html | 2 +- .../book/internet_computer_overview.html | 2 +- the_azle_book/book/print.html | 76 +++++-- the_azle_book/book/searchindex.js | 2 +- the_azle_book/book/searchindex.json | 2 +- the_azle_book/book/timers.html | 2 +- the_azle_book/src/SUMMARY.md | 5 +- .../src/reference/call_apis/call_apis.md | 1 - .../reference/canister_apis/canister_apis.md | 4 + .../canister_apis/canister_version.md | 17 ++ .../canister_apis/instruction_counter.md | 18 ++ .../reference/canister_apis/is_controller.md | 17 ++ .../performance_counter.md | 0 164 files changed, 991 insertions(+), 201 deletions(-) create mode 100644 docs/reference/canister_apis/canister_version.html create mode 100644 docs/reference/canister_apis/instruction_counter.html create mode 100644 docs/reference/canister_apis/is_controller.html rename docs/reference/{call_apis => canister_apis}/performance_counter.html (51%) create mode 100644 the_azle_book/src/reference/canister_apis/canister_version.md create mode 100644 the_azle_book/src/reference/canister_apis/instruction_counter.md create mode 100644 the_azle_book/src/reference/canister_apis/is_controller.md rename the_azle_book/src/reference/{call_apis => canister_apis}/performance_counter.md (100%) diff --git a/docs/404.html b/docs/404.html index f6aa6b761f..88118efd52 100644 --- a/docs/404.html +++ b/docs/404.html @@ -84,7 +84,7 @@ diff --git a/docs/azle.html b/docs/azle.html index 27adfdd790..34ec6c4355 100644 --- a/docs/azle.html +++ b/docs/azle.html @@ -83,7 +83,7 @@ diff --git a/docs/candid.html b/docs/candid.html index 6e98b1b2ca..99e7b27d5a 100644 --- a/docs/candid.html +++ b/docs/candid.html @@ -83,7 +83,7 @@ diff --git a/docs/canister_lifecycle.html b/docs/canister_lifecycle.html index f24756ec9d..9a563450a7 100644 --- a/docs/canister_lifecycle.html +++ b/docs/canister_lifecycle.html @@ -83,7 +83,7 @@ diff --git a/docs/canisters_overview.html b/docs/canisters_overview.html index 7ddd2a854d..2955b24223 100644 --- a/docs/canisters_overview.html +++ b/docs/canisters_overview.html @@ -83,7 +83,7 @@ diff --git a/docs/caveats.html b/docs/caveats.html index c1a5513d6b..feb3e426ad 100644 --- a/docs/caveats.html +++ b/docs/caveats.html @@ -83,7 +83,7 @@ diff --git a/docs/cross_canister.html b/docs/cross_canister.html index cf0d377f2f..c83fb15f22 100644 --- a/docs/cross_canister.html +++ b/docs/cross_canister.html @@ -83,7 +83,7 @@ diff --git a/docs/cycles.html b/docs/cycles.html index 31d9f63ccb..96f858e1d3 100644 --- a/docs/cycles.html +++ b/docs/cycles.html @@ -83,7 +83,7 @@ diff --git a/docs/deployment.html b/docs/deployment.html index c81b023e7a..d085353a37 100644 --- a/docs/deployment.html +++ b/docs/deployment.html @@ -83,7 +83,7 @@ diff --git a/docs/examples.html b/docs/examples.html index 5352c9ff26..013f9448ba 100644 --- a/docs/examples.html +++ b/docs/examples.html @@ -83,7 +83,7 @@ diff --git a/docs/hello_world.html b/docs/hello_world.html index 864f86f919..326f36842a 100644 --- a/docs/hello_world.html +++ b/docs/hello_world.html @@ -83,7 +83,7 @@ diff --git a/docs/http.html b/docs/http.html index 35ea9bac02..fb4eb35e3f 100644 --- a/docs/http.html +++ b/docs/http.html @@ -83,7 +83,7 @@ diff --git a/docs/index.html b/docs/index.html index 8ff8e8754e..bade81dd65 100644 --- a/docs/index.html +++ b/docs/index.html @@ -83,7 +83,7 @@ diff --git a/docs/installation.html b/docs/installation.html index a11a288f64..1fa5d15239 100644 --- a/docs/installation.html +++ b/docs/installation.html @@ -83,7 +83,7 @@ diff --git a/docs/internet_computer_overview.html b/docs/internet_computer_overview.html index 9f96bc4621..881af6860a 100644 --- a/docs/internet_computer_overview.html +++ b/docs/internet_computer_overview.html @@ -83,7 +83,7 @@ diff --git a/docs/management_canister.html b/docs/management_canister.html index f838d2e811..389979a021 100644 --- a/docs/management_canister.html +++ b/docs/management_canister.html @@ -83,7 +83,7 @@ diff --git a/docs/print.html b/docs/print.html index b833977c24..2804712d97 100644 --- a/docs/print.html +++ b/docs/print.html @@ -84,7 +84,7 @@ @@ -2741,7 +2741,6 @@

ckBTC

  • notify
  • notify raw
  • notify with payment 128
  • -
  • performance counter
  • reject
  • reject code
  • reject message
  • @@ -3188,19 +3187,6 @@

    ckBTC

    return cyclesCanister.receiveCycles128().cycles128(1_000_000n).notify(); } -

    performance counter

    -

    This section is a work in progress.

    -

    Examples:

    - -
    import { ic, nat64, $query } from 'azle';
    -
    -$query;
    -export function performanceCounter(): nat64 {
    -    return ic.performanceCounter(0);
    -}
    -

    reject

    This section is a work in progress.

    Examples:

    @@ -4080,8 +4066,12 @@

    ckBTC

  • candid encode
  • canister balance
  • canister balance 128
  • +
  • canister version
  • canister id
  • data certificate
  • +
  • instruction counter
  • +
  • is controller
  • +
  • performance counter
  • print
  • set certified data
  • time
  • @@ -4150,6 +4140,20 @@

    ckBTC

    return ic.canisterBalance128(); } +

    canister version

    +

    This section is a work in progress.

    +

    Examples:

    + +
    import { ic, nat64, $query } from 'azle';
    +
    +// returns the canister's version number
    +$query;
    +export function canisterVersion(): nat64 {
    +    return ic.canisterVersion();
    +}
    +

    canister id

    This section is a work in progress.

    Examples:

    @@ -4182,6 +4186,48 @@

    ckBTC

    return ic.dataCertificate(); } +

    instruction counter

    +

    This section is a work in progress.

    +

    Examples:

    + +
    import { ic, nat64, $query } from 'azle';
    +
    +// Returns the number of instructions that the canister executed since the last
    +// entry point.
    +$query;
    +export function instructionCounter(): nat64 {
    +    return ic.instructionCounter();
    +}
    +
    +

    is controller

    +

    This section is a work in progress.

    +

    Examples:

    + +
    import { ic, Principal, $query } from 'azle';
    +
    +// determines whether the given principal is a controller of the canister
    +$query;
    +export function isController(principal: Principal): boolean {
    +    return ic.isController(principal);
    +}
    +
    +

    performance counter

    +

    This section is a work in progress.

    +

    Examples:

    + +
    import { ic, nat64, $query } from 'azle';
    +
    +$query;
    +export function performanceCounter(): nat64 {
    +    return ic.performanceCounter(0);
    +}
    +

    print

    This section is a work in progress.

    Examples:

    diff --git a/docs/query_methods.html b/docs/query_methods.html index 9abbfff03e..0db9e5a7f4 100644 --- a/docs/query_methods.html +++ b/docs/query_methods.html @@ -83,7 +83,7 @@ diff --git a/docs/reference/bitcoin.html b/docs/reference/bitcoin.html index 74445d0dc0..57d0f341ac 100644 --- a/docs/reference/bitcoin.html +++ b/docs/reference/bitcoin.html @@ -83,7 +83,7 @@ diff --git a/docs/reference/call_apis/accept_message.html b/docs/reference/call_apis/accept_message.html index 6a70d78143..96725a0ec4 100644 --- a/docs/reference/call_apis/accept_message.html +++ b/docs/reference/call_apis/accept_message.html @@ -83,7 +83,7 @@ diff --git a/docs/reference/call_apis/arg_data_raw.html b/docs/reference/call_apis/arg_data_raw.html index 3fa6bdb2cc..e489b26b4d 100644 --- a/docs/reference/call_apis/arg_data_raw.html +++ b/docs/reference/call_apis/arg_data_raw.html @@ -83,7 +83,7 @@ diff --git a/docs/reference/call_apis/arg_data_raw_size.html b/docs/reference/call_apis/arg_data_raw_size.html index 261dd1ead9..a48ffcb729 100644 --- a/docs/reference/call_apis/arg_data_raw_size.html +++ b/docs/reference/call_apis/arg_data_raw_size.html @@ -83,7 +83,7 @@ diff --git a/docs/reference/call_apis/call.html b/docs/reference/call_apis/call.html index 0edf006d19..69e28283cf 100644 --- a/docs/reference/call_apis/call.html +++ b/docs/reference/call_apis/call.html @@ -83,7 +83,7 @@ diff --git a/docs/reference/call_apis/call_apis.html b/docs/reference/call_apis/call_apis.html index 799f010c87..198732360d 100644 --- a/docs/reference/call_apis/call_apis.html +++ b/docs/reference/call_apis/call_apis.html @@ -83,7 +83,7 @@ @@ -165,7 +165,6 @@

    Call APIs

  • notify
  • notify raw
  • notify with payment 128
  • -
  • performance counter
  • reject
  • reject code
  • reject message
  • diff --git a/docs/reference/call_apis/call_raw.html b/docs/reference/call_apis/call_raw.html index 74902f1867..a2c4ad3959 100644 --- a/docs/reference/call_apis/call_raw.html +++ b/docs/reference/call_apis/call_raw.html @@ -83,7 +83,7 @@ diff --git a/docs/reference/call_apis/call_raw128.html b/docs/reference/call_apis/call_raw128.html index 5256b5d30f..951fec3c1f 100644 --- a/docs/reference/call_apis/call_raw128.html +++ b/docs/reference/call_apis/call_raw128.html @@ -83,7 +83,7 @@ diff --git a/docs/reference/call_apis/call_with_payment.html b/docs/reference/call_apis/call_with_payment.html index 61c333ce54..52a4539484 100644 --- a/docs/reference/call_apis/call_with_payment.html +++ b/docs/reference/call_apis/call_with_payment.html @@ -83,7 +83,7 @@ diff --git a/docs/reference/call_apis/call_with_payment128.html b/docs/reference/call_apis/call_with_payment128.html index 8a7d239941..1ae6a025d5 100644 --- a/docs/reference/call_apis/call_with_payment128.html +++ b/docs/reference/call_apis/call_with_payment128.html @@ -83,7 +83,7 @@ diff --git a/docs/reference/call_apis/caller.html b/docs/reference/call_apis/caller.html index 0df0daa81e..ce38b02594 100644 --- a/docs/reference/call_apis/caller.html +++ b/docs/reference/call_apis/caller.html @@ -83,7 +83,7 @@ diff --git a/docs/reference/call_apis/method_name.html b/docs/reference/call_apis/method_name.html index e322529efc..a16cdb951d 100644 --- a/docs/reference/call_apis/method_name.html +++ b/docs/reference/call_apis/method_name.html @@ -83,7 +83,7 @@ diff --git a/docs/reference/call_apis/msg_cycles_accept.html b/docs/reference/call_apis/msg_cycles_accept.html index 4b204d4108..af638c343a 100644 --- a/docs/reference/call_apis/msg_cycles_accept.html +++ b/docs/reference/call_apis/msg_cycles_accept.html @@ -83,7 +83,7 @@ diff --git a/docs/reference/call_apis/msg_cycles_accept128.html b/docs/reference/call_apis/msg_cycles_accept128.html index 2ed58e80bf..598b8af53a 100644 --- a/docs/reference/call_apis/msg_cycles_accept128.html +++ b/docs/reference/call_apis/msg_cycles_accept128.html @@ -83,7 +83,7 @@ diff --git a/docs/reference/call_apis/msg_cycles_available.html b/docs/reference/call_apis/msg_cycles_available.html index af144c4fb0..6a8e4e696d 100644 --- a/docs/reference/call_apis/msg_cycles_available.html +++ b/docs/reference/call_apis/msg_cycles_available.html @@ -83,7 +83,7 @@ diff --git a/docs/reference/call_apis/msg_cycles_available128.html b/docs/reference/call_apis/msg_cycles_available128.html index aee4bd5a85..585b98d437 100644 --- a/docs/reference/call_apis/msg_cycles_available128.html +++ b/docs/reference/call_apis/msg_cycles_available128.html @@ -83,7 +83,7 @@ diff --git a/docs/reference/call_apis/msg_cycles_refunded.html b/docs/reference/call_apis/msg_cycles_refunded.html index 7c78939811..a996a818f2 100644 --- a/docs/reference/call_apis/msg_cycles_refunded.html +++ b/docs/reference/call_apis/msg_cycles_refunded.html @@ -83,7 +83,7 @@ diff --git a/docs/reference/call_apis/msg_cycles_refunded128.html b/docs/reference/call_apis/msg_cycles_refunded128.html index 53524abf80..5d338a14ba 100644 --- a/docs/reference/call_apis/msg_cycles_refunded128.html +++ b/docs/reference/call_apis/msg_cycles_refunded128.html @@ -83,7 +83,7 @@ diff --git a/docs/reference/call_apis/notify.html b/docs/reference/call_apis/notify.html index 9b01f07a03..82081db76c 100644 --- a/docs/reference/call_apis/notify.html +++ b/docs/reference/call_apis/notify.html @@ -83,7 +83,7 @@ diff --git a/docs/reference/call_apis/notify_raw.html b/docs/reference/call_apis/notify_raw.html index 11659a685e..c6303c2f21 100644 --- a/docs/reference/call_apis/notify_raw.html +++ b/docs/reference/call_apis/notify_raw.html @@ -83,7 +83,7 @@ diff --git a/docs/reference/call_apis/notify_with_payment_128.html b/docs/reference/call_apis/notify_with_payment_128.html index 72d02df43d..3cf14125c1 100644 --- a/docs/reference/call_apis/notify_with_payment_128.html +++ b/docs/reference/call_apis/notify_with_payment_128.html @@ -83,7 +83,7 @@ @@ -167,7 +167,7 @@

    - @@ -181,7 +181,7 @@

    - diff --git a/docs/reference/call_apis/reject.html b/docs/reference/call_apis/reject.html index 713dcbdc44..9f49c0fc8c 100644 --- a/docs/reference/call_apis/reject.html +++ b/docs/reference/call_apis/reject.html @@ -83,7 +83,7 @@ @@ -164,7 +164,7 @@

    reject