@gnosis.pm/safe-ethers-lib

中文文档
1.7.0发布于 2022/11/23MITTypeScriptCommonJS近 30 天下载 4658

Ethers library adapter to be used by Safe Core SDK

此软件包已被标记为弃用

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

原始使用文档
文档目录6 节
  1. Table of contents
  2. Installation
  3. Build
  4. Initialization
  5. License
  6. Contributors

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 '@gnosis.pm/safe-ethers-lib'

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

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

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

const readOnlyEthAdapter = new EthersAdapter({ ethers })

License

This library is released under MIT.

Contributors

版本与发布记录

@gnosis.pm/safe-ethers-lib 共发布 10 个版本,首次发布于 2022/02/01;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.7.0latest2022/11/233 年前
1.6.12022/09/224 年前
1.6.02022/09/214 年前
1.5.02022/08/314 年前
1.4.02022/08/034 年前
1.3.02022/07/294 年前

关于 @gnosis.pm/safe-ethers-lib 的常见问题

@gnosis.pm/safe-ethers-lib 是什么?

Ethers library adapter to be used by Safe Core SDK注意:该包已被作者标记为弃用——Package no longer supported. It has been migrated to @safe-global/safe-ethers-lib. Please, update your dependencies.

如何安装 @gnosis.pm/safe-ethers-lib?

在项目目录运行 npm install @gnosis.pm/safe-ethers-lib,或使用 pnpm add / yarn add / bun add。

@gnosis.pm/safe-ethers-lib 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@gnosis.pm/safe-ethers-lib 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@gnosis.pm/safe-ethers-lib 可以商用吗?

@gnosis.pm/safe-ethers-lib 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@gnosis.pm/safe-ethers-lib 的下载量有多少?

根据 npm 官方下载统计,@gnosis.pm/safe-ethers-lib 在 2026/10/17 – 2026/11/15 这 30 天内被下载 4,658 次,日均约 155 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@gnosis.pm/safe-ethers-lib 还在维护吗?

最新版本 1.7.0 发布于 2022/11/23(3 年前);至今共发布 10 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/02/01。作者已将其标记为弃用,新项目建议寻找替代方案。