Socket
Book a DemoInstallSign in
Socket

@gnosis.pm/safe-ethers-adapters

Package Overview
Dependencies
Maintainers
4
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gnosis.pm/safe-ethers-adapters

Safe Ethers Adapters

latest
Source
npmnpm
Version
0.1.0-alpha.13
Version published
Weekly downloads
156
39.29%
Maintainers
4
Weekly downloads
 
Created
Source

Safe Ethers Adapters

NPM Version GitHub

Ethers adapter that facilitates the interaction with the Safe Services

Getting Started

The only adapter currently provided is the SafeEthersSigner which implements the Signer interface from Ethers.

The SafeEthersSigner can be used with Ethers Contracts to deploy and interact with them. Each of these interactions will create a Safe transaction that is published to the Safe transaction service.

For this to work it is required to initialize the SafeEthersSigner with an account that is either an owner of the specified Safe or a delegate of one of the owners.

An example for such an account would be the private key of one of the owners that is used with an Ethers Wallet

const signer = new Wallet("some_private_key", ethereumProvider)

It is also necessary to specify a service instance that should be used to publish the Safe transactions. An example for this would be the Mainnet instance of the Safe Transaction Service: https://safe-transaction-mainnet.safe.global/

const service = new SafeService("some_service_url")

A Safe instance must also be created before obtaining the signer. It may be obtained with:

import { ethers } from "ethers"
import Safe from "@gnosis.pm/safe-core-sdk"
import EthersAdapter from "@gnosis.pm/safe-ethers-lib"

const safe = await Safe.create({
  ethAdapter: new EthersAdapter({ ethers, signer }),
  safeAddress: "some_safe_address"
})

Using these components it is possible to create an instance of the SafeEthersSigner

const safeSigner = new SafeEthersSigner(safe, service, provider)

See examples for more information.

Installation

Select correct nvm version:

nvm use

Install the package with yarn or npm:

yarn install
npm install

Build

Build the package with yarn or npm:

yarn build
npm build

License

This library is released under MIT.

Contributors

  • Richard Meisser (rmeissner)
  • Germán Martínez (germartinez)

Keywords

Ethereum

FAQs

Package last updated on 23 Nov 2022

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