@etransfer/utils v1.10.1
@etransfer/utils
This package provides common methods about etransfer services.
Including obtaining contracts, operating contracts, formatting amounts, address judgment, etc.
Installation
Using NPM
npm install @etransfer/utils
Using Yarn
yarn add @etransfer/utils
Prerequisites
Package.json Scripts
Script | Description |
---|---|
clean | Uses rm to remove dist/ |
build | Uses tsc to build package and dependent packages |
lint | Uses eslint to lint package |
lint:fix | Uses eslint to check and fix any warnings |
format | Uses prettier to format the code |
How to use
See more Developer Documentation.
import { checkTokenAllowanceAndApprove } from '@etransfer/utils'
// Get the token contract.
const tokenContract = await getTokenContract('node address', 'token contract address');
// Check whether the account balance is sufficient. If not, trigger setting allowance.
const result = await checkTokenAllowanceAndApprove()
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago