Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@reservoir0x/relay-ethers-wallet-adapter

Package Overview
Dependencies
Maintainers
0
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reservoir0x/relay-ethers-wallet-adapter

An adapter used to convert an ethersjs signer to an Adapted Wallet for use in the @reservoir0x/relay-sdk

  • 13.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
296
decreased by-13.95%
Maintainers
0
Weekly downloads
 
Created
Source

Adapted Ethers Wallet Adapter

Installation

yarn add @reservoir0x/relay-ethers-wallet-adapter @reservoir0x/relay-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/relay-sdk

Usage

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

import { getClient } from "@reservoir0x/relay-sdk";
import { adaptEthersSigner } from "@reservoir0x/relay-ethers-wallet-adapter";
import { useSigner } from "wagmi";

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

const quote = getClient().actions.getQuote({
  chainId: 7777777,
  toChainId: 8453,
  txs: [{ to: "0x30385bce01da4b415cae1db21d41e9f6eab3ba50", value: "1000000" }],
  wallet: wallet,
});

getClient().actions.execute({
  quote: quote,
  wallet: wallet,
  onProgress: (steps) => {
    console.log(steps);
  },
});

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 AdaptedWallet object and pass this into any of the SDK methods. Here we pass it into the call method along with the other required parameters.

Keywords

FAQs

Package last updated on 31 Oct 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc