Skip to main content

One post tagged with "canisters"

View All Tags

Serverless Canister Calls in TypeScript

Β· One min read

Hey πŸ‘‹

If you like working with ic-js in the frontend...
Say hello to serverless canister functions in TypeScript ⚑️

Write backend logic using the same TypeScript you already love β€” now with:

  • πŸ’« Built-in canister clients for the Internet Computer (ICP, ICRC, CMC, NNS, SNS...)
  • βš™οΈ Full type-safety
  • πŸ”Œ Zero agent setup
  • 🧠 Caller identity handled automatically
  • 🍱 ICP & ICRC transfers from serverless hooks

No Rust required. No backend headaches.


πŸ“š Documentation​

Want to go straight to the point? Checkout the πŸ‘‰ references


Example​

Transfer ICP directly from a Satellite serverless function:

import { IcpLedgerCanister } from "@junobuild/functions/canisters/ledger/icp";

export const onExecute = async () => {
const ledger = new IcpLedgerCanister();

const result = await ledger.transfer({
args: {
to: "destination-account-identifier",
amount: { e8s: 100_000_000n }, // 1 ICP
fee: { e8s: 10_000n },
memo: 0n
}
});
};

And yes - this works inside datastore hooks like onSetDoc and assertSetDoc, fully atomic.

Browse the full working example πŸ‘‰ Making Canister Calls in TypeScript

Cool cool cool?

To infinity and beyond
David