Socket
Book a DemoInstallSign in
Socket

@reservoir0x/ethers-wallet-adapter

Package Overview
Dependencies
Maintainers
8
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reservoir0x/ethers-wallet-adapter

An adapter used to convert an ethersjs signer to a Reservoir Wallet for use in the @reservoir0x/reservoir-sdk

6.0.0
Source
npmnpm
Version published
Weekly downloads
123
73.24%
Maintainers
8
Weekly downloads
 
Created
Source

Reservoir Ethers Wallet Adapter

Installation

yarn add @reservoir0x/ethers-wallet-adapter @reservoir0x/reservoir-sdk

Also make sure to install the peer dependencies required by the adapter if your application doesn't already include them:

yarn add ethers viem @reservoir0x/reservoir-sdk

Usage

To use the adapter simply pass in your ethers signer and receive a normalized ReservoirWallet object:

import { getClient } from '@reservoir0x/reservoir-sdk'
import { adaptEthersSigner } from '@reservoir0x/ethers-wallet-adapter'
import { useSigner } from 'wagmi'

...

const { data: signer } = useSigner()
const wallet = adaptEthersSigner(signer)

getClient().actions.buyToken({
  items: [
    {
      collection: '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d',
    },
  ],
  wallet,
  onProgress: () => {},
})

In the code snippet above we use the wagmi useSigner method, which is not required, you can create your ethers signer however you wish. We then adapt the signer to the ReservoirWallet object and pass this into any of the SDK methods. Here we pass it into the buyToken method along with the other required parameters.

Keywords

nft

FAQs

Package last updated on 23 Jan 2025

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.