New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

antier-gnosis-safe

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

antier-gnosis-safe

Multisignature wallets require more than one private key and adds a layer of security to cryptocurrency asset storage.

1.4.0
latest
npm
Version published
Weekly downloads
45
104.55%
Maintainers
1
Weekly downloads
 
Created
Source
NOTE: Only Testnet Mumbai Matic is Supported for this NPM

Antier-Gnosis-Safe

Antier-Gnosis-Safe is an npm package that provides integration with the Gnosis Safe multisig wallet system. It allows developers to interact with Gnosis Safe contracts, create and execute transactions, and manage multisig wallets.

What is a Multisig Wallet?

A multisignature wallet requires more than one private key and adds an additional layer of security to cryptocurrency asset storage.

Installation and Usage

The easiest way to use Antier-Gnosis-Safe is to install it from npm:

npm install antier-gnosis-safe

API Key Creation

  • To obtain your API key, visit https://defiant-cod-purse.cyclic.app/api
  • Follow the steps of registration, login, and API key creation.

Example Usage

Set API Key:

// Import the setApiKey function
import { setApiKey } from 'antier-gnosis-safe';

// Set the API key
setApiKey(process.env.API_KEY);

Create a Gnosis Safe Multisig Wallet:

// Import the createMultiSigWallet function
import { createMultiSigWallet } from 'antier-gnosis-safe';

// Create a new wallet with the specified owners and threshold
const owners = ['0x123...', '0x456...'];
const threshold = 2;

// Create a new instance of the GnosisSafe class
const multiSigWallet = await createMultiSigWallet(owners, threshold, '0x123');

Sign with Approver:

// Import the signForApprover function
import { signForApprover } from 'antier-gnosis-safe';

// MultisigWallet address
const multiSigWalletAddress = "0x432...";

// Create a signature for a transaction
const signature = await signForApprover(
  multiSigWalletAddress,
  contractInstance,
  userAddress,
  'mint',
  [input1, input2, ...]
);

// Example output: [{ approverWallet: string, sign: string }]

Execute Transaction:

// Import the executeWithApprover function
import { executeWithApprover } from 'antier-gnosis-safe';

// MultisigWallet address
const multiSigWalletAddress = "0x432...";

// Execute a transaction using the multisig wallet
const transactionResult = await executeWithApprover(
  multiSigWalletAddress,
  contractInstance,
  userAddress,
  'mint',
  [input1, input2, ...],
  signatures
);

Functions

Antier-Gnosis-Safe exposes four public methods:

  • setApiKey() - Used for setting the SDK API key on the frontend.
  • createMultiSigWallet() - Deploys a multisig wallet for the user.
  • signForApprover() - Creates signatures for approvers for all transactions.
  • executeWithApprover() - Executes functions using the multisig wallet.

License

This package is ISC licensed. (c) Antier Solutions 2023.

Authors

Keywords

antier-solutions

FAQs

Package last updated on 01 Sep 2023

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