Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions .llms-snapshots/llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11462,14 +11462,14 @@ You have to follow the pace of the Juno release to ensure compatibility. Refer t

---

## id
## canisterSelf

Retrieves the Principal ID of the current Satellite.

This is useful when you want to use functions such as [setDocStore](/docs/reference/functions/typescript/sdk.md#setdocstore) with the caller set as the administrator. Since the code is running on the backend side (inside the container), the Satellite itself is considered the caller and has admin-level permissions.

```
function id(): Principal;
function canisterSelf(): Principal;
```

📦 Import from `@junobuild/functions/ic-cdk`
Expand All @@ -11481,6 +11481,7 @@ function id(): Principal;
#### Notes:

* This function is a JavaScript binding for the Rust function [ic\_cdk::id()](https://docs.rs/ic-cdk/latest/ic_cdk/fn.id.html).
* It was previously named `id()` and is also accessible as `satelliteSelf()`.

---

Expand Down Expand Up @@ -11514,6 +11515,28 @@ function call<T>(params: CallParams): Promise<T | undefined>;

---

## msgCaller

Returns the Principal ID of the caller of the current function.

```
function msgCaller(): Principal;
```

📦 Import from `@junobuild/functions/ic-cdk`

#### Returns:

* `Principal`: The Principal ID of the caller.

#### Notes:

* This function is a JavaScript binding for the Rust function [ic\_cdk::api::msg\_caller()](https://docs.rs/ic-cdk/latest/ic_cdk/api/fn.msg_caller.html).
* In serverless hooks, the caller is the Satellite itself. The end user's Principal can be retrieved from the payload instead.
* This function was previously named `caller()`.

---

## time

Returns the current timestamp in nanoseconds since the Unix epoch.
Expand Down
27 changes: 25 additions & 2 deletions docs/reference/functions/typescript/ic-cdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ You have to follow the pace of the Juno release to ensure compatibility. Refer t

---

## id
## canisterSelf

Retrieves the Principal ID of the current Satellite.

This is useful when you want to use functions such as [setDocStore](./sdk.mdx#setdocstore) with the caller set as the administrator. Since the code is running on the backend side (inside the container), the Satellite itself is considered the caller and has admin-level permissions.

```typescript
function id(): Principal;
function canisterSelf(): Principal;
```

📦 Import from `@junobuild/functions/ic-cdk`
Expand All @@ -47,6 +47,7 @@ function id(): Principal;
#### Notes:

- This function is a JavaScript binding for the Rust function [ic_cdk::id()](https://docs.rs/ic-cdk/latest/ic_cdk/fn.id.html).
- It was previously named `id()` and is also accessible as `satelliteSelf()`.

---

Expand Down Expand Up @@ -80,6 +81,28 @@ function call<T>(params: CallParams): Promise<T | undefined>;

---

## msgCaller

Returns the Principal ID of the caller of the current function.

```typescript
function msgCaller(): Principal;
```

📦 Import from `@junobuild/functions/ic-cdk`

#### Returns:

- `Principal`: The Principal ID of the caller.

#### Notes:

- This function is a JavaScript binding for the Rust function [ic_cdk::api::msg_caller()](https://docs.rs/ic-cdk/latest/ic_cdk/api/fn.msg_caller.html).
- In serverless hooks, the caller is the Satellite itself. The end user's Principal can be retrieved from the payload instead.
- This function was previously named `caller()`.

---

## time

Returns the current timestamp in nanoseconds since the Unix epoch.
Expand Down