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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@keyban/sdk-base

v0.1.1

Published

Keyban SDK Base provides core functionalities for the MPC wallet solution, supporting web and Node.js apps with TypeScript, custom storage, and Ethereum blockchain integration.

Downloads

333

Readme

Keyban SDK Base

Overview

The Keyban SDK Base provides the core functionality for Keyban's MPC wallet solution, simplifying the development of web and Node.js applications. It offers essential configurations, utilities, and functions that serve as the foundation for creating decentralized wallet experiences.

Key Features

  • TypeScript Support: Fully typed to enhance code quality and development experience.
  • Flexible Storage: Developers can use custom storage solutions, with more options planned in future releases.
  • Blockchain Support: Supports Ethereum Sepolia testnet (Mainnet support to be added in future releases).
  • Bundling: Efficiently bundled using tsup for optimized builds in development and production.

Installation

npm install @keyban/sdk-base

Basic Example

The following example demonstrates how to initialize the SDK, retrieve account information, estimate transaction fees, and perform token transfers.

import { KeybanClient } from '@keyban/sdk-base';

const client = new KeybanClient({
  appId: "your-keyban-app-id",  // Your Keyban application ID
  accessTokenProvider: async () => "user's access token",  // Function to provide the access token
  chain: KeybanChain.Sepolia,  // Sepolia testnet is supported for now
  storage: MyStorage,  // Custom storage solution (more options coming soon)
});

const account = await client.init();

// Fetch native balance
const balance = await account.getBalance();

// Estimate transaction fees and perform a native token transfer
const { maxFees, details } = await account.estimateTransfer("0x...address..");
await account.transfer("0x...address...", 1000n);  // Transfer native tokens

// Retrieve ERC20 token balances
const tokenBalance = await account.getTokenBalances();

// Estimate fees and perform an ERC20 token transfer
const { maxFees: erc20MaxFees, details: erc20Details } = await account.estimateERC20Transfer({
  contractAddress: "0x...",  // ERC20 contract address
  to: "0x...",  // Recipient address
  value: 1000n,  // Amount to transfer
});
await account.transferERC20({
  contractAddress: "0x...",
  to: "0x...",
  value: 1000n,
});

Supported Blockchains

In this initial release, only Ethereum testnets are supported:

  • Sepolia Testnet: KeybanChain.Sepolia

Support for Ethereum Mainnet will be introduced in future releases.

Custom Storage and Signing

Developers can define their own storage and signing strategies. The SDK offers flexibility with the IKeybanStorage interface, enabling integration with custom storage mechanisms. Future releases will bring more built-in storage options.

Documentation

For more detailed API references and advanced features, visit the official Keyban API Reference Portal.