LogoLogo
  • General
    • 👋Welcome to Kinto
    • 📔Terminology
    • 📃Litepaper
    • 📄One Pager
    • 🔗Links
    • 🤝Partners and Collaborators
    • ❓FAQ
  • User Guides
    • 🌟Sign Up Walkthrough
    • 🗝️KYC Walkthrough
      • 🔑Synaps Walkthrough
      • 🔑Plaid Walkthrough
    • 📄KYB Walkthrough
    • 🪟Passkeys on Windows Walkthrough
    • Setting up a 1Password Passkey
    • ❔Troubleshooting/Help
    • 💰Kinto Deposits
      • Onramp on Kinto
    • 💸Kinto Withdrawals
      • 🗝️Recover funds from my Passkey address
      • 🎁Wrapping ETH in your Kinto Wallet
      • Offramp on Kinto
    • Swap on Kinto
    • Lending & Borrowing
    • Hyperliquid
      • Fees
      • Deposits
      • Creating Orders
      • Closing an Order
      • Withdrawals
    • Send to other Kinto Wallets
    • Token Sale Participation
    • Full Account Recovery
    • $K Transfer
      • Withdraw $K
      • Send $K on Kinto
      • Deposit $K
      • Swap $K on Kinto
    • Recover Funds from an X Signer
    • $K Lend and Borrow Market
      • Supply USDC to $K Lending Market
      • Withdraw USDC from $K Lending Market
      • Add $K and Borrow USDC
      • Repay USDC and Withdraw $K
  • Security/KYC/AML
    • 🔑Securing Kinto
    • 📃Security One Pager
    • 🔐Security and Risk Management
    • 🛡️Wallet Insurance
    • ⚙️User Owned KYC
    • 🏳️Enabled Countries
    • 🔒Beware of Scams
    • ✅Kinto Validators
    • 🤺Security Council
  • Building on Kinto
    • ℹ️Network Information
    • 🧱Kinto Rollup Architecture
    • ❕Differences with other rollups
    • 🤖Rollup Features
      • ⚙️Create2
      • 🔥Kinto Account Abstraction
      • 🛡️KintoWallet
      • 🪢Musubi - Chain Abstraction
    • 💻Development guide
      • 1️⃣1️⃣ Setup your Deployer EOA
      • 2️⃣2️⃣ Environment setup
      • 3️⃣3️⃣ Creating your Kinto App
    • ⛩️Interacting with your Kinto App
      • 🤖Interacting with contracts
      • 👩‍🏭Create a Web Dapp
    • 📗Smart Contract Reference
      • KintoAppRegistry
      • KintoID
      • KintoWalletFactory
      • Kinto Wallet
      • SponsorPaymaster
      • Kinto EntryPoint
      • KYCViewer
      • Faucet
      • EngenCredits
      • EngenGovernance
    • 🌍Kinto Wallet Web SDK
    • 🏪Running kinto nodes
    • ⚒️Tools
      • ⛈️Node RPC
      • 🏗️Build Tools
      • 🗺️Block Explorer
      • 🐞Debugging and monitoring
      • 🔮Oracle - Pyth
      • Firewall - Venn
    • 🚀ICO Platform
  • Governance
    • 🧠Introduction to the Kinto DAO
    • 📓Kinto Constitution
    • 📃KIP Proposal Template
    • 🌄Engen Proto-Governance
    • ⛩️Kinto Token
      • Information, addresses and links
  • 💧Liquidity Programs
    • 🛠️Mining Program
    • ⚫Engen - Launch Program
    • 🪙K Token Sale
  • Sakura Mining Season
Powered by GitBook
On this page
  • Kinto Wallet SDK
  • Design Principles
  • Installation
  • Usage
  • API
  • Contributing
  • License
  1. Building on Kinto

Kinto Wallet Web SDK

This SDK allows you to create web applications that are connected to Kinto.

PreviousEngenGovernanceNextRunning kinto nodes

Last updated 9 months ago

Kinto Wallet SDK

Kinto Wallet SDK

Link:

Kinto SDK is a JavaScript library that allows applications to connect to the Kinto Wallet. Kinto is an Ethereum Layer 2 (L2) solution designed to provide fast and cost-efficient transactions. This SDK provides methods to connect a Kinto Wallet, send transactions, and create new wallets.

Design Principles

The Kinto SDK has been designed with the following principles in mind:

  • No Dependencies: The SDK is built without external dependencies to minimize its size and maximize security. This ensures that it doesn't rely on any third-party libraries.

  • No UI: The SDK does not provide any user interface components. This allows app developers the flexibility to design their own UI and remain unopinionated about the user experience.

  • No Web3 Packages: The SDK is agnostic to specific Ethereum libraries. You can use any library you prefer, such as viem, ethers, or web3js. The SDK itself doesn't require any of these packages.

Installation

You can install the Kinto SDK via npm:

npm install kinto-web-sdk

Usage

Prerequisites

Before using the Kinto SDK, ensure you have completed the following steps:

Initialization

To use the Kinto SDK, you need to initialize it with your application's address.

import { createKintoSDK } from 'kinto-web-sdk';

const appAddress = 'your-app-address';
const kintoSDK = createKintoSDK(appAddress);

Connecting to Kinto Wallet

To connect to the Kinto Wallet, use the connect method. This method opens a modal for the user to connect their wallet.

kintoSDK.connect()
  .then((accountInfo) => {
    console.log('Connected account info:', accountInfo);
  })
  .catch((error) => {
    console.error('Failed to connect:', error);
  });

Sending Transactions

To send transactions, use the sendTransaction method. This method accepts an array of transaction objects.

const transactions = [
  {
    to: '0xRecipientAddress',
    value: '1000000000000000000', // 1 ETH in wei`
    data: '0x'
  }
];

kintoSDK.sendTransaction(transactions)
  .then((hash) => {
    console.log('Transaction successful, hash:', hash);
  })
  .catch((error) => {
    console.error('Transaction failed:', error);
  });

Creating a New Wallet

kintoSDK.createNewWallet()
  .then(() => {
    console.log('New wallet created successfully');
  })
  .catch((error) => {
    console.error('Failed to create new wallet:', error);
  });

API

KintoSDK

connect()

Starts a connection with a logged-in Kinto Wallet and returns the account information.

Returns: Promise<KintoAccountInfo>

sendTransaction(txs: TxCall[]): Promise

Sends transactions through the Kinto Wallet.

  • txs: An array of transaction objects.

Returns: Promise<void>

createNewWallet(): Promise

Opens a popup for the user to create a new wallet.

Returns: Promise<void>

Types

AppMetadata

export interface AppMetadata {
  parent: `0x${string}`;
  paymasterBalance: number;
  tokenId: number;
  dsaEnabled: boolean;
  rateLimitPeriod: number;
  rateLimitNumber: number;
  gasLimitPeriod: number;
  gasLimitCost: number;
  name: string;
  devEOAs: string[];
  appContracts: string[];
}

KintoAccountInfo

export interface KintoAccountInfo {
  exists: boolean;
  approval?: boolean;
  walletAddress?: `0x${string}`;
  app: AppMetadata;
  appKey?: `0x${string}`;
}

TxCall

export interface TxCall {
  to: `0x${string}`;
  data: `0x${string}`;
  value: bigint;
}

Contributing

License

This project is licensed under the MIT License. See the LICENSE file for details.


Kinto Wallet: You need to have a Kinto wallet. Create an account by visiting .

Developer Account: Create a developer account, deploy a contract, and create the application. Use your main contract address as the app address. Visit to get started.

To create a new wallet, use the createNewWallet method. This method opens a popup for the user to create a new wallet in Kinto website. Alternatively, you can instruct users to visit to create an account.

Contributions are welcome! Please open an issue or submit a pull request on .

For more information about Kinto, visit .

🌍
Kinto Onboarding
Kinto Developers
Kinto
GitHub
docs.kinto.xyz
https://github.com/KintoXYZ/kinto-web-sdk