This package has been deprecated

Author message:

Package no longer supported. It has been migrated to @safe-global/safe-web3-lib. Please, update your dependencies.

@gnosis.pm/safe-web3-lib
TypeScript icon, indicating that this package has built-in type declarations

1.7.1 • Public • Published

Safe Web3 Lib

NPM Version GitHub Release GitHub

Web3.js wrapper that contains some utilities and the Safe contracts types (generated with typechain web3-v1). 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 Web3, create an instance of the Web3Adapter, where signerAddress is the Ethereum account we are connecting and the one who will sign the transactions.

import Web3 from 'web3'
import Web3Adapter from '@gnosis.pm/safe-web3-lib'

const provider = new Web3.providers.HttpProvider('http://localhost:8545')
const web3 = new Web3(provider)
const safeOwner = '0x<address>'

const ethAdapter = new Web3Adapter({
  web3,
  signerAddress: safeOwner
})

In case the ethAdapter instance is only used to execute read-only methods the signerAddress property can be omitted.

const readOnlyEthAdapter = new Web3Adapter({ web3 })

License

This library is released under MIT.

Contributors

Package Sidebar

Install

npm i @gnosis.pm/safe-web3-lib

Weekly Downloads

192

Version

1.7.1

License

MIT

Unpacked Size

201 kB

Total Files

129

Last publish

Collaborators

  • auryn
  • giacomo.licari