Socket
Book a DemoInstallSign in
Socket

@tableland/nonce

Package Overview
Dependencies
Maintainers
5
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tableland/nonce

[![License: MIT AND Apache-2.0](https://img.shields.io/badge/License-MIT%20AND%20Apache--2.0-blue.svg)](./LICENSE) [![Version](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Ftablelandnetwork%2Fstudio%2Fmain%2Fpacka

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
5
Created
Source

@tableland/nonce

License: MIT AND Apache-2.0 Version standard-readme compliant

Redis-based EVM wallet nonce manager.

Background

This package is a nonce manager for Ethereum wallets using a Redis store. A nonce manager is required to ensure the backend wallet nonce is in sync with the onchain transactions. For example—with a Vercel web app, if a set of different users send transactions that are sponsored by the backend wallet, the nonce manager will ensure that the transactions are sent with the correct nonce. Without this, Vercel might send transactions out of order, and the transactions will fail.

Install

You can install via npm.

npm install @tableland/nonce

Usage

The example below is shown with ethers v5.

import { Wallet, getDefaultProvider } from "ethers";
import { NonceManager } from "@tableland/nonce";

const privateKey = "59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"; // Your private key
const wallet = new Wallet(privateKey);
const provider = getDefaultProvider("http://127.0.0.1:8545"); // Your RPC URL

// Set up the nonce manager
const signer = new NonceManager(wallet.connect(provider))

Development

See the web package for how the nonce manager is used in the context of Studio.

Contributing

PRs accepted. Studio is still under initial development, so if you are interested in helping out, feel free to connect on Discord: https://tableland.xyz/discord

Small note: If editing the README, please conform to the standard-readme specification.

License

MIT AND Apache-2.0, © 2021-2024 Tableland Network Contributors

FAQs

Package last updated on 18 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts