Classes

BottosWalletSDK

Objects

Api : object
Contract : object
Tool : object
Wallet : object

Typedefs

functionCallback : function

This callback is displayed as a global member.

originFetchTemplate : Object

BottosWalletSDK

Kind: global class

new BottosWalletSDK(config)

Represents the BottosWalletSDK.

Param Type Default
config Object
[config.baseUrl] string "http://localhost:8689/v1"
[config.version] number 1
[config.crypto] Object BTCryptTool

bottosWalletSDK.Api

See Api.

Kind: instance property of BottosWalletSDK

bottosWalletSDK.Tool

See Tool.

Kind: instance property of BottosWalletSDK

bottosWalletSDK.Wallet

See Wallet.

Kind: instance property of BottosWalletSDK

bottosWalletSDK.Contract

See Contract.

Kind: instance property of BottosWalletSDK

bottosWalletSDK.setBaseUrl(baseUrl)

Kind: instance method of BottosWalletSDK

Param Type Description
baseUrl string The baseUrl used in request.

Api : object

Kind: global namespace

Api.chain_id

Documented as Api.chain_id

Kind: static property of Api

Api.request(url, params, [method])

Kind: static method of Api

Param Type Default
url string
params Object
[method] string "POST"

Api.getAbi(contract, [callback]) ⇒ Promise.<Object> | undefined

Returns the abi. If callback is undefined, this function will return a promise.

Kind: static method of Api

Param Type Description
contract string The contract name.
[callback] functionCallback The optional callback.

Api.getBlockHeader([callback]) ⇒ Promise.<Object> | undefined

Documented as Api.getBlockHeader.

Kind: static method of Api
Returns: Promise.<Object> | undefined - If callback is undefined, a promise will be returned.

Param Type
[callback] functionCallback

Contract : object

Kind: global namespace

Contract.deployContract(param, senderInfo) ⇒ Promise.<Object>

Deploy a contract.

Kind: static method of Contract

Param Type Default Description
param Object
[param.vm_type] number 1 vm_type, now is 1.
[param.vm_version] number 1 vm_version, now is 1.
param.contract_code Uint8Array \ ArrayBuffer wasm file buffer.
senderInfo Object The sender
senderInfo.account string sender's account
senderInfo.privateKey string \ Uint8Array sender's privateKey

Contract.deployABI(param, senderInfo) ⇒ Promise.<Object>

Deploy an abi.

Kind: static method of Contract

Param Type Description
param Object
param.contract_abi string \ Uint8Array \ ArrayBuffer ABI content or file buffer.
senderInfo Object The sender
senderInfo.account string sender's account
senderInfo.privateKey string \ Uint8Array sender's privateKey

Contract.callContract(originFetchTemplate, privateKey) ⇒ Promise.<Object>

Kind: static method of Contract

Param Type
originFetchTemplate Object
privateKey string \ Uint8Array

Tool : object

Kind: global namespace

Tool.buf2hex(buffer) ⇒ string

Kind: static method of Tool
Returns: string - Hexadecimal string.

Param Type Description
buffer Uint8Array Uint8Array buffer.

Tool.getRequestParams(originFetchTemplate, privateKey) ⇒ Promise.<Object>

Kind: static method of Tool

Param Type Description
originFetchTemplate originFetchTemplate
privateKey string \ Uint8Array Your private key.

Wallet : object

Kind: global namespace

Wallet.createAccountByIntro(params) ⇒ Object

Kind: static method of Wallet
Returns: Object - keystore

Param Type Description
params Object the params required for create keystore
params.account string account
params.password string password
params.privateKey string \ Uint8Array privateKey

Wallet.createKeys() ⇒ Object

Create public and private key pair

Kind: static method of Wallet
Returns: Object - keys

Wallet.createAccountWithIntro(params, referrerInfo) ⇒ Promise.<Object>

register account on chain

Kind: static method of Wallet

Param Type Description
params Object The params
params.account string The new user's account
params.publicKey string \ Uint8Array The publicKey provided by the new user
referrerInfo Object The referrer
referrerInfo.account string referrer's account
referrerInfo.privateKey string \ Uint8Array referrer's privateKey

Wallet.recover(password, keyObject) ⇒ Uint8Array

Kind: static method of Wallet
Returns: Uint8Array - privateKey

Param Type Description
password string password
keyObject Object the keystore

Wallet.getAccountInfo(account_name) ⇒ Promise.<Object>

Kind: static method of Wallet

Param Type
account_name string

Wallet.sendTransaction(params, privateKey) ⇒ Promise.<Object>

Kind: static method of Wallet

Param Type
params Object
params.from string
params.to string
params.value string \ number
privateKey string

Wallet.stake(amount, privateKey) ⇒ Promise.<Object>

Kind: static method of Wallet

Param Type
amount number
privateKey string \ Uint8Array

Wallet.unstake(amount, privateKey) ⇒ Promise.<Object>

Kind: static method of Wallet

Param Type
amount number
privateKey string \ Uint8Array

Wallet.claim(amount, privateKey) ⇒ Promise.<Object>

Kind: static method of Wallet

Param Type
amount number
privateKey string \ Uint8Array

functionCallback : function

This callback is displayed as a global member.

Kind: global typedef

Param Type Description
err * The callback error.
result * The success result.

originFetchTemplate : Object

Kind: global typedef
Properties

Name Type Default Description
[originFetchTemplate.version] number 1 Default value is 1.
originFetchTemplate.sender string Default value is bottos.
[originFetchTemplate.contract] string "bottos" The contract. Default value is bottos.
originFetchTemplate.method string
originFetchTemplate.param Object
[originFetchTemplate.sig_alg] number 1 Default value is 1.

results matching ""

    No results matching ""