@slide-computer/signer-agent
TypeScript icon, indicating that this package has built-in type declarations

3.6.4 • Public • Published

@slide-computer/signer-agent

Initiate transactions with signers on the Internet Computer.


Installation

Using SignerAgent:

npm i --save @slide-computer/signer-agent

In the browser:

import { SignerAgent } from "@slide-computer/signer-agent";

To get started with the signerAgent, run

const accounts = await signer.accounts();
const agent = await SignerAgent.create({
  signer,
  account: accounts[0].owner
});

The signerAgent can initiate a transaction with

import {IcrcLedgerCanister} from "@dfinity/ledger-icrc";

const {transfer} = IcrcLedgerCanister.create({
  agent,
  canisterId: MY_LEDGER_CANISTER_ID,
});
const blockIndex = await transfer({
  to: TARGET_ACCOUNT,
  amount: 100_000_000
});

Package Sidebar

Install

npm i @slide-computer/signer-agent

Weekly Downloads

349

Version

3.6.4

License

MIT

Unpacked Size

139 kB

Total Files

34

Last publish

Collaborators

  • sea-snake