diff --git a/src/lib/stable/ic_apis/accept_message.ts b/src/lib/stable/ic_apis/accept_message.ts index 5fcc5d73c8..97b9afc93b 100644 --- a/src/lib/stable/ic_apis/accept_message.ts +++ b/src/lib/stable/ic_apis/accept_message.ts @@ -1,6 +1,3 @@ -// eslint-disable-next-line @typescript-eslint/no-unused-vars -import { inspectMessage } from '../canister_methods/inspect_message'; // Used for links in comments - /** * Accepts an ingress message during message inspection. * diff --git a/src/lib/stable/ic_apis/call.ts b/src/lib/stable/ic_apis/call.ts index 41ebc604ba..1e8ad437b6 100644 --- a/src/lib/stable/ic_apis/call.ts +++ b/src/lib/stable/ic_apis/call.ts @@ -31,7 +31,7 @@ import { idlDecode, idlEncode } from '../execute_with_candid_serde'; * - heartbeat * - timer * - **When called outside of Call Context**: - * - Traps + * - Throws */ export async function call( canisterId: Principal | string, diff --git a/src/lib/stable/ic_apis/chunk.ts b/src/lib/stable/ic_apis/chunk.ts index 60fdbeb5e9..fbc5241285 100644 --- a/src/lib/stable/ic_apis/chunk.ts +++ b/src/lib/stable/ic_apis/chunk.ts @@ -13,9 +13,12 @@ import { id } from './id'; * - See: https://internetcomputer.org/docs/current/developer-docs/smart-contracts/maintain/resource-limits * - **Call Context**: * - update - * - after a cross-canister call (only from updates?) + * - after a cross-canister call + * - after a rejected cross-canister call * - heartbeat * - timer + * - **When called outside of Call Context**: + * - Throws */ export async function chunk(): Promise { if ( diff --git a/src/lib/stable/ic_apis/clear_timer.ts b/src/lib/stable/ic_apis/clear_timer.ts index f4bf3252b6..d7eedea4ec 100644 --- a/src/lib/stable/ic_apis/clear_timer.ts +++ b/src/lib/stable/ic_apis/clear_timer.ts @@ -19,6 +19,8 @@ * - timer * - Note: Assuming same as timer * - Note: Also cleanupCallback + * - **When called outside of Call Context**: + * - No effect */ export function clearTimer(timerId: bigint): void { if ( diff --git a/src/lib/stable/ic_apis/cycles_burn.ts b/src/lib/stable/ic_apis/cycles_burn.ts index 4cd79787f6..ae336c6867 100644 --- a/src/lib/stable/ic_apis/cycles_burn.ts +++ b/src/lib/stable/ic_apis/cycles_burn.ts @@ -16,6 +16,8 @@ * - heartbeat * - timer * - Note: Also cleanupCallback + * - **When called outside of Call Context**: + * - Traps */ export function cyclesBurn(amount: bigint): bigint { if ( diff --git a/src/lib/stable/ic_apis/data_certificate.ts b/src/lib/stable/ic_apis/data_certificate.ts index f67967d8ce..4fb057860e 100644 --- a/src/lib/stable/ic_apis/data_certificate.ts +++ b/src/lib/stable/ic_apis/data_certificate.ts @@ -12,7 +12,6 @@ import { setCertifiedData } from './set_certified_data'; // Used for links in co * @remarks * - Used in conjunction with {@link setCertifiedData} * - Enables query calls to return certified responses - * - Only meaningful during query calls * - **Call Context**: * - query (non-replicated) * - composite query diff --git a/src/lib/stable/ic_apis/msg_cycles_accept.ts b/src/lib/stable/ic_apis/msg_cycles_accept.ts index 251fd77cf1..ab26bc6b5b 100644 --- a/src/lib/stable/ic_apis/msg_cycles_accept.ts +++ b/src/lib/stable/ic_apis/msg_cycles_accept.ts @@ -10,6 +10,8 @@ * - update * - after a cross-canister call * - after a rejected cross-canister call + * - **When called outside of Call Context**: + * - Traps */ export function msgCyclesAccept(maxAmount: bigint): bigint { if ( diff --git a/src/lib/stable/ic_apis/msg_cycles_available.ts b/src/lib/stable/ic_apis/msg_cycles_available.ts index f237280b86..f01005044c 100644 --- a/src/lib/stable/ic_apis/msg_cycles_available.ts +++ b/src/lib/stable/ic_apis/msg_cycles_available.ts @@ -9,6 +9,8 @@ * - update * - after a cross-canister call * - after a rejected cross-canister call + * - **When called outside of Call Context**: + * - Traps */ export function msgCyclesAvailable(): bigint { if ( diff --git a/src/lib/stable/ic_apis/msg_cycles_refunded.ts b/src/lib/stable/ic_apis/msg_cycles_refunded.ts index 70bf97fea2..cac3ee3236 100644 --- a/src/lib/stable/ic_apis/msg_cycles_refunded.ts +++ b/src/lib/stable/ic_apis/msg_cycles_refunded.ts @@ -4,11 +4,12 @@ * @returns The amount of cycles refunded from the last call, or 0n if called outside the IC environment * * @remarks - * - Only meaningful after a cross-canister call * - Refunded cycles are already added to canister balance * - **Call Context**: * - after a cross-canister call * - after a rejected cross-canister call + * - **When called outside of Call Context**: + * - Traps */ export function msgCyclesRefunded(): bigint { if ( diff --git a/src/lib/stable/ic_apis/reject.ts b/src/lib/stable/ic_apis/reject.ts index e267bcd347..a91b0e65c0 100644 --- a/src/lib/stable/ic_apis/reject.ts +++ b/src/lib/stable/ic_apis/reject.ts @@ -14,6 +14,8 @@ * - after a rejected cross-canister call * - after a cross-canister call from a composite query * - after a rejected cross-canister call from a composite query + * - **When called outside of Call Context**: + * - Traps */ export function reject(message: string): void { if ( diff --git a/src/lib/stable/ic_apis/reject_code.ts b/src/lib/stable/ic_apis/reject_code.ts index ef1b35fe3f..c702bd8949 100644 --- a/src/lib/stable/ic_apis/reject_code.ts +++ b/src/lib/stable/ic_apis/reject_code.ts @@ -47,6 +47,8 @@ export const RejectionCode = IDL.Variant({ * - after a rejected cross-canister call * - after a cross-canister call from a composite query * - after a rejected cross-canister call from a composite query + * - **When called outside of Call Context**: + * - Traps */ export function rejectCode(): RejectionCode { if ( diff --git a/src/lib/stable/ic_apis/reply.ts b/src/lib/stable/ic_apis/reply.ts index 3db48943e9..db21c664e6 100644 --- a/src/lib/stable/ic_apis/reply.ts +++ b/src/lib/stable/ic_apis/reply.ts @@ -40,6 +40,8 @@ type ReplyInput = * - after a rejected cross-canister call * - after a cross-canister call from a composite query * - after a rejected cross-canister call from a composite query + * - **When called outside of Call Context**: + * - Throws */ export function reply(input: ReplyInput): void { if ( diff --git a/src/lib/stable/ic_apis/set_certified_data.ts b/src/lib/stable/ic_apis/set_certified_data.ts index 1cfaba8e83..a739580a21 100644 --- a/src/lib/stable/ic_apis/set_certified_data.ts +++ b/src/lib/stable/ic_apis/set_certified_data.ts @@ -19,6 +19,8 @@ import { dataCertificate } from './data_certificate'; // Used for links in comme * - after a rejected cross-canister call * - heartbeat * - timer + * - **When called outside of Call Context**: + * - Traps */ export function setCertifiedData(data: Uint8Array): void { if ( diff --git a/src/lib/stable/ic_apis/set_timer.ts b/src/lib/stable/ic_apis/set_timer.ts index 65a83c7704..3c11ab640e 100644 --- a/src/lib/stable/ic_apis/set_timer.ts +++ b/src/lib/stable/ic_apis/set_timer.ts @@ -23,6 +23,8 @@ import { v4 } from 'uuid'; * - heartbeat * - timer * - Note: Also cleanupCallback + * - **When called outside of Call Context**: + * - Traps */ export function setTimer( delay: bigint, diff --git a/src/lib/stable/ic_apis/set_timer_interval.ts b/src/lib/stable/ic_apis/set_timer_interval.ts index 5904a75161..9ec344144f 100644 --- a/src/lib/stable/ic_apis/set_timer_interval.ts +++ b/src/lib/stable/ic_apis/set_timer_interval.ts @@ -24,6 +24,8 @@ import { v4 } from 'uuid'; * - heartbeat * - timer * - Note: Also cleanupCallback + * - **When called outside of Call Context**: + * - Traps */ export function setTimerInterval( interval: bigint,