From cf2d1fbe8486214661fd403e42b21b4591230f11 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Tue, 21 Apr 2026 13:18:20 +0200 Subject: [PATCH 1/2] docs: fix your-icrc-ledger-canister-id is principal Signed-off-by: David Dal Busco --- docs/reference/functions/typescript/canisters.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/reference/functions/typescript/canisters.mdx b/docs/reference/functions/typescript/canisters.mdx index 8fc8d9ba..e2502964 100644 --- a/docs/reference/functions/typescript/canisters.mdx +++ b/docs/reference/functions/typescript/canisters.mdx @@ -141,7 +141,7 @@ import { Principal } from "@icp-sdk/core/principal"; export const onExecute = async () => { const ledger = new IcrcLedgerCanister({ - canisterId: "your-icrc-ledger-canister-id" + canisterId: Principal.fromText("your-icrc-ledger-canister-id") }); const balance = await ledger.icrc1BalanceOf({ @@ -188,7 +188,7 @@ import { Principal } from "@icp-sdk/core/principal"; export const onExecute = async () => { const ledger = new IcrcLedgerCanister({ - canisterId: "your-icrc-ledger-canister-id" + canisterId: Principal.fromText("your-icrc-ledger-canister-id") }); const result = await ledger.icrc1Transfer({ @@ -246,7 +246,7 @@ import { Principal } from "@icp-sdk/core/principal"; export const onExecute = async () => { const ledger = new IcrcLedgerCanister({ - canisterId: "your-icrc-ledger-canister-id" + canisterId: Principal.fromText("your-icrc-ledger-canister-id") }); const result = await ledger.icrc2TransferFrom({ @@ -305,7 +305,7 @@ import { Principal } from "@icp-sdk/core/principal"; export const onExecute = async () => { const ledger = new IcrcLedgerCanister({ - canisterId: "your-icrc-ledger-canister-id" + canisterId: Principal.fromText("your-icrc-ledger-canister-id") }); const result = await ledger.icrc2Approve({ From 88b38b935c4e0c6cb7b30cf571ad4e000215b537 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:20:27 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=84=20Update=20LLMs.txt=20snapshot?= =?UTF-8?q?=20for=20PR=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .llms-snapshots/llms-full.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.llms-snapshots/llms-full.txt b/.llms-snapshots/llms-full.txt index fed8e5c1..abd3d708 100644 --- a/.llms-snapshots/llms-full.txt +++ b/.llms-snapshots/llms-full.txt @@ -12658,7 +12658,7 @@ icrc1BalanceOf(params: { account: Account}): Promise #### Example: ``` -import { IcrcLedgerCanister } from "@junobuild/functions/canisters/ledger/icrc";import { Principal } from "@icp-sdk/core/principal";export const onExecute = async () => { const ledger = new IcrcLedgerCanister({ canisterId: "your-icrc-ledger-canister-id" }); const balance = await ledger.icrc1BalanceOf({ account: { owner: Principal.fromText("user-principal") } }); console.log("Balance:", balance);}; +import { IcrcLedgerCanister } from "@junobuild/functions/canisters/ledger/icrc";import { Principal } from "@icp-sdk/core/principal";export const onExecute = async () => { const ledger = new IcrcLedgerCanister({ canisterId: Principal.fromText("your-icrc-ledger-canister-id") }); const balance = await ledger.icrc1BalanceOf({ account: { owner: Principal.fromText("user-principal") } }); console.log("Balance:", balance);}; ``` ### icrc1Transfer @@ -12688,7 +12688,7 @@ icrc1Transfer(params: { args: TransferArgs}): Promise #### Example: ``` -import { IcrcLedgerCanister } from "@junobuild/functions/canisters/ledger/icrc";import { Principal } from "@icp-sdk/core/principal";export const onExecute = async () => { const ledger = new IcrcLedgerCanister({ canisterId: "your-icrc-ledger-canister-id" }); const result = await ledger.icrc1Transfer({ args: { to: { owner: Principal.fromText("recipient-principal") }, amount: 1_000_000n, fee: 10_000n } }); if ("Ok" in result) { console.log("Transfer successful, block index:", result.Ok); } else { console.error("Transfer failed:", result.Err); }}; +import { IcrcLedgerCanister } from "@junobuild/functions/canisters/ledger/icrc";import { Principal } from "@icp-sdk/core/principal";export const onExecute = async () => { const ledger = new IcrcLedgerCanister({ canisterId: Principal.fromText("your-icrc-ledger-canister-id") }); const result = await ledger.icrc1Transfer({ args: { to: { owner: Principal.fromText("recipient-principal") }, amount: 1_000_000n, fee: 10_000n } }); if ("Ok" in result) { console.log("Transfer successful, block index:", result.Ok); } else { console.error("Transfer failed:", result.Err); }}; ``` ### icrc2TransferFrom @@ -12721,7 +12721,7 @@ icrc2TransferFrom(params: { args: TransferFromArgs}): Promise { const ledger = new IcrcLedgerCanister({ canisterId: "your-icrc-ledger-canister-id" }); const result = await ledger.icrc2TransferFrom({ args: { from: { owner: Principal.fromText("source-principal") }, to: { owner: Principal.fromText("destination-principal") }, amount: 500_000n } }); if ("Ok" in result) { console.log("Transfer from successful, block index:", result.Ok); } else { console.error("Transfer from failed:", result.Err); }}; +import { IcrcLedgerCanister } from "@junobuild/functions/canisters/ledger/icrc";import { Principal } from "@icp-sdk/core/principal";export const onExecute = async () => { const ledger = new IcrcLedgerCanister({ canisterId: Principal.fromText("your-icrc-ledger-canister-id") }); const result = await ledger.icrc2TransferFrom({ args: { from: { owner: Principal.fromText("source-principal") }, to: { owner: Principal.fromText("destination-principal") }, amount: 500_000n } }); if ("Ok" in result) { console.log("Transfer from successful, block index:", result.Ok); } else { console.error("Transfer from failed:", result.Err); }}; ``` ### icrc2Approve @@ -12753,7 +12753,7 @@ icrc2Approve(params: { args: ApproveArgs}): Promise #### Example: ``` -import { IcrcLedgerCanister } from "@junobuild/functions/canisters/ledger/icrc";import { Principal } from "@icp-sdk/core/principal";export const onExecute = async () => { const ledger = new IcrcLedgerCanister({ canisterId: "your-icrc-ledger-canister-id" }); const result = await ledger.icrc2Approve({ args: { spender: { owner: Principal.fromText("spender-principal") }, amount: 1_000_000n } }); if ("Ok" in result) { console.log("Approval successful, block index:", result.Ok); } else { console.error("Approval failed:", result.Err); }}; +import { IcrcLedgerCanister } from "@junobuild/functions/canisters/ledger/icrc";import { Principal } from "@icp-sdk/core/principal";export const onExecute = async () => { const ledger = new IcrcLedgerCanister({ canisterId: Principal.fromText("your-icrc-ledger-canister-id") }); const result = await ledger.icrc2Approve({ args: { spender: { owner: Principal.fromText("spender-principal") }, amount: 1_000_000n } }); if ("Ok" in result) { console.log("Approval successful, block index:", result.Ok); } else { console.error("Approval failed:", result.Err); }}; ``` ---