new STG(wallet, scoreAddress)
Create a STG
Parameters:
Name | Type | Description |
---|---|---|
wallet |
Wallet | |
scoreAddress |
String | contract address of STG |
- Source:
Methods
-
<async> allowance(owner, spender)
-
Returns allowance of the spender for the owner balance
Parameters:
Name Type Description owner
String address of the owner
spender
String address of the spender
- Source:
Returns:
- Type
- Promise.<Number>
-
<async> approve(spender, value)
-
Approve spender to transfer the specified STG from the owner's balance
Parameters:
Name Type Description spender
String address of the spender
value
Number STG amount to approve
- Source:
Returns:
txHash
- Type
- Promise.<String>
-
<async> balanceOf(owner)
-
Returns balance of STG for the specified owner
Parameters:
Name Type Description owner
String address of owner
- Source:
Returns:
- Type
- Promise.<Number>
-
<async> burn(amount)
-
Burn tokens
Parameters:
Name Type Description amount
Number amount to burn
- Source:
Returns:
txHash
- Type
- Promise.<String>
-
<async> decAllowance(spender, value)
-
Decrease allowance of the spender for the owner's balance
Parameters:
Name Type Description spender
String address of the spender
value
Number STG amount to decrease
- Source:
Returns:
txHash
- Type
- Promise.<String>
-
<async> decimals()
-
Returns decimals
- Source:
Returns:
- Type
- Promise.<Number>
-
<async> incAllowance(spender, value)
-
Increase allowance of the spender for the owner's balance
Parameters:
Name Type Description spender
String address of the spender
value
Number STG amount to increase
- Source:
Returns:
txHash
- Type
- Promise.<String>
-
<async> mint(amount)
-
Mint tokens and allocate to the contract owner
Parameters:
Name Type Description amount
Number amount to mint
- Source:
Returns:
txHash
- Type
- Promise.<String>
-
<async> name()
-
Returns name
- Source:
Returns:
- Type
- Promise.<String>
-
<async> pause()
-
Pause contract to disable it's functionalities
- Source:
Returns:
txHash
- Type
- Promise.<String>
-
<async> paused()
-
Returns whether the contract is paused or not
- Source:
Returns:
true: paused, false: unpaused
- Type
- Promise.<Bool>
-
<async> setBlacklist(account, flag)
-
set/unset blacklist
Parameters:
Name Type Description account
String address to be set/unset as blacklist
flag
Bool true:set, false:unset
- Source:
Returns:
txHash
- Type
- Promise.<String>
-
<async> setWhitelist(account, flag)
-
set/unset whitelist
Parameters:
Name Type Description account
String address to be set/unset as whitelist
flag
Bool true:set, false:unset
- Source:
Returns:
txHash
- Type
- Promise.<String>
-
<async> symbol()
-
Returns symbol
- Source:
Returns:
- Type
- Promise.<String>
-
<async> totalSupply()
-
Returns total supply
- Source:
Returns:
- Type
- Promise.<Number>
-
<async> transfer(to, value, data)
-
Transfer STG to the specified recipient
Parameters:
Name Type Description to
String address of the recipient
value
Number the amount to transfer
data
String optional
- Source:
Returns:
txHash
- Type
- Promise.<String>
-
<async> transferFrom(from, to, value)
-
Tranfer STG from sender to recipient
Only the amount of allowance from sender can be tranferredParameters:
Name Type Description from
String address of the sender
to
String address of the recipient
value
Number STG amount to transfer
- Source:
Returns:
txHash
- Type
- Promise.<String>
-
<async> unpause()
-
Unpause contract to enable it's functionalities
- Source:
Returns:
txHash
- Type
- Promise.<String>