Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
60 lines (48 sloc) 1.91 KB

@zapjs/zaptoken

This repository provides an interface tothe Zap ERC20 token contract. This package enables a Zap holder to check their balance, transfer Zap to other accounts, and delegate transfers (approvals) to other accounts and smart contracts.

Prerequisites

- Nodejs and npm>=6.1.11
- Typescript

Usage

Using ZapToken package for ERC20 methods with Zap Token
npm install --save `@zapjs/zaptoken`
import {ZaopToken} from '@zapjs/zaptoken';

let myZapToken = new ZapToken();

Custom configuration

let myZapToken = new ZapToken({networkId,networkProvider,coordinator})

get Zap balance of an addrss

const balance = await myZapToken.balanceOf(address);

Approve Zap Token to an address

await myZapToken.approve({from,to,amount,gas})
//note : from address has to be in web3.eth.accounts

Send Zap Token to an address

await myZapToken.send({from,to,amount,gas})
//note : from address has to be in web3.eth.accounts

See more Usages of each packages :

Built With