Class: Wallet

module:stayge-wallet/icon-js/wallet~ Wallet

Class representing a ICON Wallet


new Wallet(privateKey)

Create a ICON Wallet

Parameters:
Name Type Description
privateKey Buffer

private key for wallet

Source:

Methods


<static> create()

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

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

[description]

password String

[description]

Source:
Returns:

[description]

Type
Wallet

<static> fromPrivateKey(privateKeyString)

Factory method to create a wallet from the private key

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

<async> call(to, method, params)

Call SCORE's external function

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

<async> callScoreTx(scoreAddress, scoreMethod, methodParams)

Send a transaction for calling a SCORE'S method

Parameters:
Name Type Description
scoreAddress String
scoreMethod String
methodParams Object
Source:
Returns:

txHash

Type
Promise.<String>

<async> depositFeeSharing(scoreAddress, amt)

deposit to the score for virtual step

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

txHash

Type
Promise.<String>

getAddress()

Get the address of the wallet

Source:
Returns:
Type
Buffer

getAddressString()

Get the address string of the wallet

Source:
Returns:
Type
String

<async> getBalance()

Get balance of the wallet

Source:
Returns:
Type
Promise.<String>

<async> getBlockByHash(height)

Get the block information by hash

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

<async> getBlockByHeight(height)

Get the block information by height

Parameters:
Name Type Description
height Number | String
Source:
Returns:
Type
Promise.<Object>

getEndPoint()

get the endpoint

Source:
Returns:

uri of endpoint

Type
String

<async> getLastBlock()

Get the last block information

Source:
Returns:
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 the public key of the wallet

Source:
Returns:
Type
Buffer

getPublicKeyString()

Get the public key string of the wallet

Source:
Returns:
Type
String

<async> getScoreApi(address)

Get the SCORE's external API list

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

<async> getTotalSupply()

Get total supply of ICX

Source:
Returns:
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)

Get the transaction result with the specified txHash

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

<async> installScore(scoreContent, installParams)

Install a SCORE on the ICON blockchain

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

txHash

Type
Promise.<String>

setEndPoint(name)

set the endpoint

Parameters:
Name Type Description
name String

'mainnet' | 'testnet'

Source:

toKeyStoreObj(password)

Convert the wallet to the keystore object

Parameters:
Name Type Description
password String
Source:
Returns:
Type
Object

<async> transferICX(to, value)

Transfer ICX coins

Parameters:
Name Type Description
to String
value Number
Source:
Returns:

txHash

Type
Promise.<String>

<async> transferMessage(to, msg)

Transafer a message

Parameters:
Name Type Description
to String
msg String
Source:
Returns:

txHash

Type
Promise.<String>

<async> updateScore(scoreAddress, scoreContent, updateParams)

Update the SCORE on the ICON blockchain

Parameters:
Name Type Description
scoreAddress String

address of score

scoreContent String

score contents of hexstring format

updateParams Object

parameter for update

Source:
Returns:
Type
Promise.<String>

<async> withdrawFeeSharing(scoreAddress, amt)

withdraw the deposit for virtual step

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

txHash

Type
Promise.<String>