Class: Wallet

module:stayge-wallet~ Wallet

Class representing a STAYGE Wallet


new Wallet(baseWallet)

Create a Wallet

Parameters:
Name Type Description
baseWallet Object

underlying wallet object

Source:

Methods


<static> create()

Factory method to create a new wallet with a newly generated private key

Source:
Returns:
Type
Wallet

<static> fromKeyStoreFile(keyStorePath, password)

Factory method to create a wallet from the keystore file

Parameters:
Name Type Description
keyStorePath String
password String
Source:
Returns:
Type
Wallet

<static> fromKeyStoreObj(keyStoreObj, password)

Factory method to create a wallet from the keystore object

Parameters:
Name Type Description
keyStoreObj Object | String
password String
Source:
Returns:
Type
Wallet

<static> fromPrivateKey(privateKeyString)

Factory method to create a wallet from the specified private key

Parameters:
Name Type Description
privateKeyString String
Source:
Returns:
Type
Wallet

act(scoreAddress)

Return ACT score object with the specified score address

Parameters:
Name Type Description
scoreAddress String

address of score

Source:
Returns:

score object of ACT

Type
ACT

<async> call(to, method, params)

Call a smart contract's external function for querying

Parameters:
Name Type Description
to String
method String
params Object
Source:
Returns:
Type
Promise.<String>

<async> callContractTx(contractAddress, contractMethod, methodParams)

Send a transaction for calling a smart contract's method

Parameters:
Name Type Description
contractAddress String
contractMethod String
methodParams Object
Source:
Returns:

hash of transacgtion

Type
Promise.<String>

<async> depositFeeSharing(contractAddress, amt)

deposit for fee sharing

Parameters:
Name Type Description
contractAddress String
amt Number
Source:
Returns:

hash of transaction

Type
Promise.<String>

donation(scoreAddress)

Return Donation score object with the specified score address

Parameters:
Name Type Description
scoreAddress String

address of score

Source:
Returns:

score object of Donation

Type
Donation

getAddress()

Get the wallet address

Source:
Returns:
Type
Buffer

getAddressString()

Get the wallet address string

Source:
Returns:
Type
String

<async> getBalance()

Get balance of the wallet

Source:
Returns:

balance of the wallet owner

Type
Promise.<String>

<async> getBlockByHash(height)

Get block information by hash

Parameters:
Name Type Description
height String

hash of block

Source:
Returns:

block information

Type
Promise.<Object>

<async> getBlockByHeight(height)

Get block information by height

Parameters:
Name Type Description
height Number | String

height of block

Source:
Returns:

block information

Type
Promise.<Object>

<async> getContractApi(address)

Get the smart contract's external API list

Parameters:
Name Type Description
address String
Source:
Returns:
Type
Promise.<Object>

getEndPoint()

get endpoint

Source:
Returns:

endpoint information

Type
String

<async> getLastBlock()

Get a last block information

Source:
Returns:

block information

Type
Promise.<Object>

getPrivateKey()

Get the private key of the wallet

Source:
Returns:
Type
Buffer

getPrivateKeyString()

Get the private key string of the wallet

Source:
Returns:
Type
String

getPublicKey()

Get a public key of the wallet

Source:
Returns:
Type
Buffer

getPublicKeyString()

Get a public key string of the wallet

Source:
Returns:
Type
String

<async> getScoreStatus()

Returns symbol

Source:
Returns:
Type
Promise.<String>

<async> getTotalSupply()

Get total supply of ICX

Source:
Returns:

total supply of underlying network

Type
Promise.<String>

<async> getTransactionByHash(txHash)

Get the transaction information by txHash

Parameters:
Name Type Description
txHash String
Source:
Returns:
Type
Promise.<Object>

<async> getTransactionResult(txHash, timeout)

Get the transaction result requested by transaction hash

Parameters:
Name Type Default Description
txHash String
timeout Number 0

seconds to timeout. if not specified, it will be set to the default value of 0

Source:
Returns:
Type
Promise.<Object>

<async> installContract(contractPath, installParams)

Install a smart contract on the underlying blockchain

Parameters:
Name Type Description
contractPath String
installParams Object
Source:
Returns:

txHash

Type
Promise.<String>

setEndPoint(name)

set endpoint

Parameters:
Name Type Description
name String

'mainnet' | 'testnet'

Source:

stg(scoreAddress)

Return STG score object with the specified score address

Parameters:
Name Type Description
scoreAddress String

address of score

Source:
Returns:

score object of STG

Type
STG

todaysidol(scoreAddress)

Return TodaysIdol score object with the specified score address

Parameters:
Name Type Description
scoreAddress String

address of score

Source:
Returns:

score object of TodaysIdol

Type
ACT

toKeyStoreObj(password)

Convert a wallet to key store object

Parameters:
Name Type Description
password String

password for the wallet

Source:
Returns:
Type
Object

<async> transferCoin(to, value)

Transfer coins

Parameters:
Name Type Description
to String

address of recipient

value Number

value to transfer

Source:
Returns:

hash of transaction

Type
Promise.<String>

<async> transferMessage(to, msg)

Transafer a message

Parameters:
Name Type Description
to String

address of recipent

msg String

message to transfer

Source:
Returns:

hash of transaction

Type
Promise.<String>

<async> updateContract(contractAddress, contractPath, updateParams)

Update the smart contract on the underlying blockchain

Parameters:
Name Type Description
contractAddress type
contractPath type
updateParams type
Source:
Returns:

txHash

Type
Promise.<String>

<async> withdrawFeeSharing(contractAddress, amt)

withdraw the deposit for fee sharing

Parameters:
Name Type Description
contractAddress String
amt Number
Source:
Returns:

hash of transaction

Type
Promise.<String>

wok(scoreAddress)

Return WOK score object with the specified score address

Parameters:
Name Type Description
scoreAddress String

address of score

Source:
Returns:

score object of WOK

Type
WOK