0.0.4-20190214-1 • Published 6 years ago

@jeansoon/mxw-api v0.0.4-20190214-1

Weekly downloads
-
License
ISC
Repository
github
Last release
6 years ago

mxw : object

MXW SDK module

Kind: global namespace
Version: 0.1

mxw.events : object

Events

Kind: static namespace of mxw

events~onTx(fnc)

Set the new transaction handler.

Kind: inner method of events

ParamTypeDescription
fncfunctionFunction that will be called on every new transaction (format: (data) => {})

events~onBlock(fnc)

Set the new block handler.

Kind: inner method of events

ParamTypeDescription
fncfunctionFunction that will be called on every new block (format: (data) => {})

events~removeHandler(type)

Removes a certain handler

Kind: inner method of events

ParamTypeDescription
typestringHandler type ('tx''block')

mxw.main : object

Main

Kind: static namespace of mxw

main~balance(address) ⇒ Promise

Returns the balance of the given address.

Kind: inner method of main
Returns: Promise - balance - Wallet balance

ParamTypeDescription
addressstringAddress of the wallet

main~transfer(privateKey, address) ⇒ Promise

Transfer tokens from one address to another.

Kind: inner method of main
Returns: Promise - tx - Transaction result
Params: number amount - Amount of tokens

ParamTypeDescription
privateKeystringPrivate key of the wallet from which we're transfering tokens
addressstringAddress of the wallet to which we're transfering tokens

main~signTransfer(privateKey, address) ⇒ Promise

Signs a transfer transaction without relaying it.

Kind: inner method of main
Returns: Promise - tx - Transaction signature
Params: number amount - Amount of tokens

ParamTypeDescription
privateKeystringPrivate key of the wallet from which we're transfering tokens
addressstringAddress of the wallet to which we're transfering tokens

mxw.util : object

Utilities

Kind: static namespace of mxw

util~getAddressByPrivateKey(privateKey) ⇒ string

Returns wallet address.

Kind: inner method of util
Returns: string - address - Wallet address

ParamTypeDescription
privateKeystringWallet's private key

util~getAddressByPublicKey(publicKey) ⇒ string

Returns wallet address.

Kind: inner method of util
Returns: string - address - Wallet address

ParamTypeDescription
publicKeystringWallet's public key

util~generateKeyPair() ⇒ object

Generates a new private/public key pair and a wallet address.

Kind: inner method of util
Returns: object - keyPair - Generated keypair

util~getAddressFromPublicKeyByteArray(byteArray) ⇒ string

Returns wallet address.

Kind: inner method of util
Returns: string - address - Wallet address

ParamTypeDescription
byteArrayBufferWallet's public key as a byte array

util~decodeTx(encoded) ⇒ object

Decodes a tendermint transaction.

Kind: inner method of util
Returns: object - tx - Decoded transaction

ParamTypeDescription
encodedstringBase64 encoded transaction

util~getSha256(str) ⇒ string

Get SHA256 hash of a given string.

Kind: inner method of util
Returns: string - hash - Hashed string

ParamTypeDescription
strstringArbitrary string

util~getBlock(height) ⇒ Promise

Get a block at given height.

Kind: inner method of util
Returns: Promise - block - Block data

ParamTypeDescription
heightnumberBlock height

util~getTx(hash) ⇒ Promise

Get a single transaction by hash.

Kind: inner method of util
Returns: Promise - tx - Transaction data

ParamTypeDescription
hashstringTransaction hash

util~getTxs(address) ⇒ Promise

Get transactions by wallet address.

Kind: inner method of util
Returns: Promise - txs - Transactions

ParamTypeDescription
addressstringWallet address

mxw.alias : object

Aliasing module

Kind: static namespace of mxw

alias~setAlias(privateKey, alias) ⇒ Promise

Set an alias.

Kind: inner method of alias
Returns: Promise - tx - Transaction result

ParamTypeDescription
privateKeystringWallet's private key
aliasstringAn alias

alias~removeAlias(privateKey, alias) ⇒ Promise

Remove an alias.

Kind: inner method of alias
Returns: Promise - tx - Transaction result

ParamTypeDescription
privateKeystringWallet's private key
aliasstringAn alias

alias~getAliasByAddress(address) ⇒ Promise

Gets alias for a given address

Kind: inner method of alias
Returns: Promise - alias - Alias

ParamTypeDescription
addressstringAddress of a wallet

alias~getAddressByAlias(alias) ⇒ Promise

Gets the address of an alias

Kind: inner method of alias
Returns: Promise - address - Wallet address

ParamTypeDescription
aliasstringAn alias

mxw.kyc : object

KYC module

Kind: static namespace of mxw

kyc~requestWhitelist(privateKey, whitelistAddress) ⇒ Promise

Allows users to request whitelisting from the mock KYC service.

Kind: inner method of kyc
Returns: Promise - tx - Transaction result

ParamTypeDescription
privateKeystringPrivate key of the KYC provider
whitelistAddressstringAddress that we're whitelisting

kyc~isWhitelisted(address) ⇒ Promise

Checks if the wallet address is whitelisted.

Kind: inner method of kyc
Returns: Promise - whitelist - Boolean

ParamTypeDescription
addressstringAddress of a wallet

mxw.faucet : object

Faucet module

Kind: static namespace of mxw

faucet~requestCoins(privateKey, address) ⇒ Promise

Allows users to request coins from the faucet if they have less than 100 MXW.

Kind: inner method of faucet
Returns: Promise - tx - Transaction result

ParamTypeDescription
privateKeystringPrivate key of the wallet that's requesting tokens
addressstringAddress of the wallet that's receiving tokens (optional)

mxw.this.setBackend(be)

Set the backend.

Kind: static method of mxw

ParamTypeDescription
bestringName of the backend ('lotion''cosmos')
0.0.4-20190214-1

6 years ago

0.0.4-32

6 years ago

0.0.4-31

6 years ago

0.0.4-30

6 years ago

0.0.4-29

6 years ago

0.0.4-28

6 years ago

0.0.4-27

6 years ago

0.0.4-26

6 years ago

0.0.4-25

6 years ago

0.0.24

6 years ago

0.0.23

6 years ago

0.0.22

6 years ago

0.0.21

6 years ago

0.0.20

6 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago