1.4.0 • Published 8 months ago

antier-gnosis-safe v1.4.0

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago

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

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

1.4.0

8 months ago

1.3.4

11 months ago

1.3.3

11 months ago

1.3.2

11 months ago

1.3.1

11 months ago

1.2.15

11 months ago

1.2.14

11 months ago

1.2.13

11 months ago

1.2.12

11 months ago

1.2.11

11 months ago

1.2.10

11 months ago

1.2.9

11 months ago

1.2.8

11 months ago

1.2.7

11 months ago

1.2.6

11 months ago

1.2.5

11 months ago

1.2.4

11 months ago

1.2.3

11 months ago

1.2.2

11 months ago

1.2.1

11 months ago

1.2.0

11 months ago

1.1.9

11 months ago

1.1.8

11 months ago

1.1.7

11 months ago

1.1.6

11 months ago

1.1.5

11 months ago

1.1.4

11 months ago

1.1.3

11 months ago

1.1.2

11 months ago

1.1.1

11 months ago

1.1.0

11 months ago

1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago