Extends¶
Constructor¶
constructor(extension)
Parameter
extension
-CyanoExtension
Property¶
extension¶
Type: CyanoWrapper
Description: Cyano wrapper instance passed by constructor.
Methods¶
loadContract¶
async loacContract(abi, address)
Description
Load smart contract to a ContractWrapper instance.
Parameters :
abi
-Unused
:
address
-String
:Smart contract Address.
Returns :
Promise<Result<ContractWrapper, Status>>
:ContractWrapper instance will be set into the data field of Result if Status is SUCCESS.
transfer¶
async transfer(to, amount, memo, extra)
Description
Transfer ONT or ONG.
Parameters :
to
-String
:Transfer target address.
amount
-Number
:How many ONT or ONG will be transferred.
memo
-Unused
extra
-OriginalAssets
:Transaction extra data, such as gas, gas limit etc.
Returns :
Promise<Result<ContractWrapper, Status>>
:Transaction hash will be set into the data field of Result if Status is SUCCESS.
transferToken¶
async transferToken(wrapper, to, amount, extra)
Description
Transfercontract based token, such as NEP 4 token.
Parameters :
wrapper
-ContractWrapper
:A ContractWrapper instance returned by loadContract method.
to
-String
:Token transfer target address.
amount
-Number
How many tokens will be transferred.
extra
-Unused
Returns :
Promise<Result<ContractWrapper, Status>>
:Transaction hash will be set into the data field of Result if Status is SUCCESS.
getAccount¶
async getAccount()
Description
Get selected account in Cyano.
Returns :
Promise<Result<String, Status>>
:Account string will be set into the data field of Result if Status is SUCCESS.