Skip to content

Commit

Permalink
Merge pull request #1134 from demergent-labs/final_documentation
Browse files Browse the repository at this point in the history
Add canister version, is controller, instruction counter documentation
  • Loading branch information
lastmjs authored Jul 28, 2023
2 parents 0e36d23 + 5424612 commit f2dd845
Show file tree
Hide file tree
Showing 167 changed files with 996 additions and 209 deletions.
2 changes: 1 addition & 1 deletion docs/404.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/azle.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/candid.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/canister_lifecycle.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/canisters_overview.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/caveats.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/cross_canister.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/cycles.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/deployment.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/examples.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/hello_world.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/http.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/installation.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/internet_computer_overview.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/management_canister.html

Large diffs are not rendered by default.

76 changes: 61 additions & 15 deletions docs/print.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/query_methods.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/bitcoin.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/accept_message.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/arg_data_raw.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/arg_data_raw_size.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/call.html

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions docs/reference/call_apis/call_apis.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/call_raw.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/call_raw128.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/call_with_payment.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/call_with_payment128.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/caller.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/method_name.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/msg_cycles_accept.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/msg_cycles_accept128.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/msg_cycles_available.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/msg_cycles_available128.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/msg_cycles_refunded.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/msg_cycles_refunded128.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/notify.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/notify_raw.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/reference/call_apis/notify_with_payment_128.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/reference/call_apis/reject.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/reject_code.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/reject_message.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/reply.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/call_apis/reply_raw.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/blob.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/bool.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/candid.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/empty.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/float32.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/float64.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/func.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/int.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/int16.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/int32.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/int64.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/int8.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/nat.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/nat16.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/nat32.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/nat64.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/nat8.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/null.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/opt.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/principal.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/record.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/reserved.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/service.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/text.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/variant.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/candid/vec.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/canister_apis/candid_decode.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/canister_apis/candid_encode.html

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion docs/reference/canister_apis/canister_apis.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/canister_apis/canister_balance.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/reference/canister_apis/canister_balance128.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/reference/canister_apis/canister_id.html

Large diffs are not rendered by default.

212 changes: 212 additions & 0 deletions docs/reference/canister_apis/canister_version.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/reference/canister_apis/data_certificate.html

Large diffs are not rendered by default.

213 changes: 213 additions & 0 deletions docs/reference/canister_apis/instruction_counter.html

Large diffs are not rendered by default.

212 changes: 212 additions & 0 deletions docs/reference/canister_apis/is_controller.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/reference/canister_apis/print.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/canister_apis/set_certified_data.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/canister_apis/time.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/canister_apis/trap.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/canister_methods/canister_methods.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/canister_methods/heartbeat.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/canister_methods/http_request.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/canister_methods/http_request_update.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/canister_methods/init.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/canister_methods/inspect_message.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/canister_methods/post_upgrade.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/canister_methods/pre_upgrade.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/canister_methods/query.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/canister_methods/update.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/environment_variables.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/management_canister/bitcoin_get_utxos.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/management_canister/canister_status.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/management_canister/create_canister.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/management_canister/delete_canister.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/management_canister/deposit_cycles.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/management_canister/ecdsa_public_key.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/management_canister/http_request.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/management_canister/install_code.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/management_canister/raw_rand.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/management_canister/sign_with_ecdsa.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/management_canister/start_canister.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/management_canister/stop_canister.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/management_canister/uninstall_code.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/management_canister/update_settings.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/plugins.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/reference.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/stable_memory/stable64_grow.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/stable_memory/stable64_read.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/stable_memory/stable64_size.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/stable_memory/stable64_write.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/stable_memory/stable_bytes.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/stable_memory/stable_grow.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/stable_memory/stable_memory.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/stable_memory/stable_read.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/stable_memory/stable_size.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/stable_memory/stable_structures.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/stable_memory/stable_write.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/timers/clear_timer.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/timers/set_timer.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/timers/set_timer_interval.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/timers/timers.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/reference/wasm_binary_optimization.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/searchindex.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/stable_structures.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/the_azle_book.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/timers.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/update_methods.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/ic_api/src/ic_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function canisterBalance128(): nat {

// returns the canister's version number
$query;
export function canisterVersion(): nat {
export function canisterVersion(): nat64 {
return ic.canisterVersion();
}

Expand Down
2 changes: 1 addition & 1 deletion the_azle_book/book/404.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion the_azle_book/book/azle.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion the_azle_book/book/candid.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion the_azle_book/book/canisters_overview.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion the_azle_book/book/cross_canister.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion the_azle_book/book/cycles.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion the_azle_book/book/deployment.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion the_azle_book/book/examples.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion the_azle_book/book/http.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion the_azle_book/book/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion the_azle_book/book/installation.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion the_azle_book/book/internet_computer_overview.html

Large diffs are not rendered by default.

76 changes: 61 additions & 15 deletions the_azle_book/book/print.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion the_azle_book/book/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion the_azle_book/book/searchindex.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion the_azle_book/book/timers.html

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion the_azle_book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
- [notify](./reference/call_apis/notify.md)
- [notify raw](./reference/call_apis/notify_raw.md)
- [notify with payment 128](./reference/call_apis/notify_with_payment_128.md)
- [performance counter](./reference/call_apis/performance_counter.md)
- [reject](./reference/call_apis/reject.md)
- [reject code](./reference/call_apis/reject_code.md)
- [reject message](./reference/call_apis/reject_message.md)
Expand Down Expand Up @@ -78,8 +77,12 @@
- [candid encode](./reference/canister_apis/candid_encode.md)
- [canister balance](./reference/canister_apis/canister_balance.md)
- [canister balance 128](./reference/canister_apis/canister_balance128.md)
- [canister version](./reference/canister_apis/canister_version.md)
- [canister id](./reference/canister_apis/canister_id.md)
- [data certificate](./reference/canister_apis/data_certificate.md)
- [instruction counter](./reference/canister_apis/instruction_counter.md)
- [is controller](./reference/canister_apis/is_controller.md)
- [performance counter](./reference/canister_apis/performance_counter.md)
- [print](./reference/canister_apis/print.md)
- [set certified data](./reference/canister_apis/set_certified_data.md)
- [time](./reference/canister_apis/time.md)
Expand Down
3 changes: 1 addition & 2 deletions the_azle_book/src/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ Examples:

```typescript
import {
Alias,
ic,
$init,
match,
Expand All @@ -98,7 +97,7 @@ import {
import decodeUtf8 from 'decode-utf8';
import encodeUtf8 from 'encode-utf8';

type JSON = Alias<string>;
type JSON = string;

let stableStorage = new StableBTreeMap<string, string>(0, 25, 1_000);

Expand Down
1 change: 0 additions & 1 deletion the_azle_book/src/reference/call_apis/call_apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
- [notify](./notify.md)
- [notify raw](./notify_raw.md)
- [notify with payment 128](./notify_with_payment_128.md)
- [performance counter](./performance_counter.md)
- [reject](./reject.md)
- [reject code](./reject_code.md)
- [reject message](./reject_message.md)
Expand Down
4 changes: 4 additions & 0 deletions the_azle_book/src/reference/canister_apis/canister_apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
- [candid encode](./candid_encode.md)
- [canister balance](./canister_balance.md)
- [canister balance 128](./canister_balance128.md)
- [canister version](./canister_version.md)
- [canister id](./canister_id.md)
- [data certificate](./data_certificate.md)
- [instruction counter](./instruction_counter.md)
- [is controller](./is_controller.md)
- [performance counter](./performance_counter.md)
- [print](./print.md)
- [set certified data](./set_certified_data.md)
- [time](./time.md)
Expand Down
17 changes: 17 additions & 0 deletions the_azle_book/src/reference/canister_apis/canister_version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# canister version

This section is a work in progress.

Examples:

- [ic_api](https://github.com/demergent-labs/azle/tree/main/examples/ic_api)

```typescript
import { ic, nat64, $query } from 'azle';

// returns the canister's version number
$query;
export function canisterVersion(): nat64 {
return ic.canisterVersion();
}
```
18 changes: 18 additions & 0 deletions the_azle_book/src/reference/canister_apis/instruction_counter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# instruction counter

This section is a work in progress.

Examples:

- [ic_api](https://github.com/demergent-labs/azle/tree/main/examples/ic_api)

```typescript
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();
}
```
17 changes: 17 additions & 0 deletions the_azle_book/src/reference/canister_apis/is_controller.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# is controller

This section is a work in progress.

Examples:

- [ic_api](https://github.com/demergent-labs/azle/tree/main/examples/ic_api)

```typescript
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);
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Examples:

```typescript
import {
Alias,
nat64,
nat8,
Opt,
Expand All @@ -26,8 +25,8 @@ import {
Vec
} from 'azle';

type Key = Alias<nat8>;
type Value = Alias<string>;
type Key = nat8;
type Value = string;

let map = new StableBTreeMap<Key, Value>(0, 100, 1_000);

Expand Down
5 changes: 2 additions & 3 deletions the_azle_book/src/stable_structures.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Here's an example showing all of the basic `StableBTreeMap` operations:

```typescript
import {
Alias,
nat64,
nat8,
Opt,
Expand All @@ -47,8 +46,8 @@ import {
Vec
} from 'azle';

type Key = Alias<nat8>;
type Value = Alias<string>;
type Key = nat8;
type Value = string;

let map = new StableBTreeMap<Key, Value>(0, 100, 1_000);

Expand Down

0 comments on commit f2dd845

Please sign in to comment.