Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

rsksmart/safe-factory-sdk

Repository files navigation

logo

@rsksmart/safe-factory-sdk

RIF Safe Factory SDK

Coverage Status npm

npm i @rsksmart/safe-factory-sdk

Create a Safe account

It requires that both the GnosisSafeProxyFactory and the GnosisSafe have been deployed.

import { EthersSafeFactory } from '@rsksmart/safe-factory-sdk'

const proxyFactoryAddress = '0x<GnosisSafeProxyFactory address here>'
const safeSingletonAddress = '0x<GnosisSafe address here>'

const ethersSafeFactory = new EthersSafeFactory(
  signer,
  proxyFactoryAddress,
  safeSingletonAddress
)

const safeSdk = await ethersSafeFactory.createSafe({
  owners: ['0x1234...', '0xabcd...', '0x0987...'],
  threshold: 2
})

For the SafeSDK usage, please have a look at the official documentation.

Run for development

Install dependencies:

npm i

Run a local network

npx hardhat node

Tests

Run unit tests with

npx hardhat test

With Coverage:

npm run test:coverage

Lint & formatting

npm run format
npm run lint

Build

npm run build