Extends

ExtensionActions


Constructor

constructor(extension)

Parameter
extension - ScatterExtension


Property

extension

Type: ScatterWrapper
Description: Scatter 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 account.

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 EOS`.

Parameters :

to - String:

Transfer target address.

amount - Number:

How many EOS will be transferred.

memo - String:

Transfer memo.

extra - Unused:

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

Transfer contract based token.

Parameters :

wrapper - ContractWrapper:

A ContractWrapper instance returned by loadContract method.

to - String:

Token transfer target address.

amount - String | Number>

How many tokens will be transferred. You can pass a string with token symbol in it or a number. But if you pass a Number, you must pass the extra parameter and set the symbol field.

extra - TransferTokenExtraInfo:

The token transaction information, such as memo, symbol etc.

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 Scatter.

Returns :

Promise<Result<String, Status>>:

Account string will be set into the data field of Result if Status is SUCCESS.