Initiate transactions with signers on the Internet Computer.
Using SignerAgent:
npm i --save @slide-computer/signer-agent
import { SignerAgent } from "@slide-computer/signer-agent";
To get started with the signerAgent, run
const signerAgent = new SignerAgent({
signer,
getPrincipal: () => {
return accounts[0].principal; // For example, make calls as first principal
}
});
The signerAgent can initiate a transaction with
const {transfer} = IcrcLedgerCanister.create({
agent: signerAgent,
canisterId: MY_LEDGER_CANISTER_ID,
});
const blockIndex = await transfer({
to: account,
amount: 100_000_000
});