Package Exports
- @servrox/safe-ethers-lib-shimmer
- @servrox/safe-ethers-lib-shimmer/dist/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@servrox/safe-ethers-lib-shimmer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Safe Ethers Lib
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 installBuild
Build the package with yarn or npm:
yarn build
npm buildInitialization
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
- Germán Martínez (germartinez)