New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@safe-global/safe-ethers-lib

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@safe-global/safe-ethers-lib

Ethers library adapter to be used by Safe Core SDK

1.9.4
latest
Source
npm
Version published
Weekly downloads
6.4K
-11.16%
Maintainers
2
Weekly downloads
 
Created
Source

Safe Ethers Lib

NPM Version GitHub Release GitHub

Ethers.js wrapper that contains some utilities and the Safe contracts types (generated with typechain ethers-v5). It is used to initialize the Safe Core SDK.

Table of contents

Installation

Install the package with yarn or npm:

yarn install
npm install

Build

Build the package with yarn or npm:

yarn build
npm build

Initialization

If the app integrating the SDK is using Ethers v5, create an instance of the EthersAdapter, where signer is the Ethereum account we are connecting and the one who will sign the transactions.

import { ethers } from 'ethers'
import EthersAdapter from '@safe-global/safe-ethers-lib'

const web3Provider = // ...
const provider = new ethers.providers.Web3Provider(web3Provider)
const safeOwner = provider.getSigner(0)

const ethAdapter = new EthersAdapter({
  ethers,
  signerOrProvider: safeOwner
})

Depending on whether the ethAdapter instance is used to sign/execute transactions or just call read-only methods, the signerOrProvider property can be a Signer or a Provider.

License

This library is released under MIT.

Contributors

Keywords

Ethereum

FAQs

Package last updated on 03 Jul 2023

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