npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@canton-network/core-provider-ledger

v1.12.2

Published

A Splice Provider implementation for direct ledger access.

Downloads

296,214

Readme

@canton-network/core-provider-ledger

Provider for direct Canton JSON Ledger API access. Implements @canton-network/core-splice-provider with a single RPC-style method, ledgerApi, backed by @canton-network/core-ledger-client over HTTP.

Works in Node.js and the browser. Typical use cases:

  • Pass an instance into @canton-network/wallet-sdk via SDK.create({ ledgerProvider }) (or let the SDK construct one from ledgerClientUrl + auth).
  • Call ledgerApi directly from tooling, scripts, or services that already have ledger credentials.

If you are building a Canton dApp that talks to a wallet, prefer @canton-network/dapp-sdk (and @canton-network/core-provider-dapp) instead.

Published on npm under Apache-2.0.

Install

npm install @canton-network/core-provider-ledger

Overview

flowchart LR
    App["App / Wallet SDK"] --> LP["LedgerProvider"]
    LP -->|"ledgerApi"| HTTP["HTTP"]
    HTTP --> LAPI["JSON Ledger API"]
  • Method: ledgerApi only — params encode resource, requestMethod, and optional body / path / query
  • Transport: HTTP (required by the Canton JSON Ledger API)
  • Auth: any AccessTokenProvider from @canton-network/core-wallet-auth (static token, client credentials, self-signed, …)

Usage

import { LedgerProvider } from '@canton-network/core-provider-ledger'
import type { AccessTokenProvider } from '@canton-network/core-wallet-auth'

const accessTokenProvider: AccessTokenProvider = {
    getAccessToken: async () => 'jwt...',
    getAuthContext: async () => ({
        userId: 'alice',
        accessToken: 'jwt...',
    }),
}

const provider = new LedgerProvider({
    baseUrl: 'https://ledger-api.example.com',
    accessTokenProvider,
})

const version = await provider.request({
    method: 'ledgerApi',
    params: {
        resource: '/v2/version',
        requestMethod: 'get',
    },
})

Types

Due to some type inference limitations, the return type of request collapses to unknown. In order to aid the compiler, you can supply an optional type argument corresponding to the operation you are using on the ledgerApi. Afterwards, the response is cleanly typed:

import { LedgerProvider, Ops } from '@canton-network/core-provider-ledger'

const party = await provider.request<Ops.PostV2Parties>({
    method: 'ledgerApi',
    params: {
        resource: '/v2/parties',
        requestMethod: 'post',
        body: {
            partyHint: 'my-party',
        },
    },
})

console.log(party.partyDetails?.party)

Operation types are generated from the Ledger OpenAPI into a provider-oriented union (see the typing notes in core/splice-provider).

Request data

Depending on the operation, supply one or more of:


provider.request({
    method: 'ledgerApi',
    params: {
        ...,
        body?: {
            // usually for POST requests (JSON object body)
        },
        path?: {
            // `path` arguments, usually for GET requests (i.e., `/v2/parties/{party-id}`)
            "party-id": "some-party-id"
        },
        query?: {
            // `query` params, usually for GET requests (i.e., `/v2/...?param=data`)
            "param": "data"
        }
    }
})

Let the operation type guide which fields are required.

Related

| Package | Role | | ------------------------------------------------------------ | -------------------------------------------- | | @canton-network/core-splice-provider | Provider interface and AbstractProvider | | @canton-network/core-provider-dapp | CIP-103 Sync / Async wallet providers | | @canton-network/core-ledger-client | Underlying JSON LAPI client | | @canton-network/core-wallet-auth | AccessTokenProvider implementations | | @canton-network/wallet-sdk | Higher-level wallet tooling on ledger access |