@argent/smartwallet-utils

Utilities for smart-contract wallets

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@argent/smartwallet-utils
0.0.122 years ago3 years agoMinified + gzip package size for @argent/smartwallet-utils in KB

Readme

smartwallet-utils

Installation

npm install @argent/smartwallet-utils

Usage

Create an instance of SmartWalletUtils
const swu = new SmartWalletUtils(web3Provider, address);
const walletHelper = await swu.getWalletHelper();

Check if a message signature is valid
const isValid = await walletHelper.isValidSignature(hexMessage, signature);

Trigger an Approve ERC20 tokens and call contract in one single transaction, if supported by the wallet
if (walletHelper.supportApproveAndCall) {
    const txHash = await walletHelper.approveAndCall(erc20Contract, amount, spender, contract, data, gasLimit);
}

License

Released under MIT