ic-light SDK v0.0.1

Vanilla JavaScript library for querying ICP Ledgers and Index canisters with automatic batching & loop pagination.

Live Ledger & Index Runner

// Click run to query on-chain balance and transactions using ic-light...
        

Quick Integration

import { IcLightClient, IcLightLedger, IcLightIndex } from './ic-light-lib.js';

const client = new IcLightClient();
const ledger = new IcLightLedger(client);
const index = new IcLightIndex(client);

try {
  const balance = await ledger.getBalance({
    canisterId: 'ryjl3-tyaaa-aaaaa-aaaba-cai',
    account: targetInput
  });

  const txs = await index.getAccountTransactions({
    indexCanisterId: 'qhbym-qaaaa-aaaaa-aaafq-cai',
    owner: targetInput,
    maxResults: 5000 // Auto-paginates seamlessly
  });
} catch (err) {
  console.error(err);
}