0.0.4-20190214-1 • Published 5 years ago

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

Weekly downloads
-
License
ISC
Repository
github
Last release
5 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

5 years ago

0.0.4-32

5 years ago

0.0.4-31

5 years ago

0.0.4-30

5 years ago

0.0.4-29

5 years ago

0.0.4-28

5 years ago

0.0.4-27

5 years ago

0.0.4-26

5 years ago

0.0.4-25

5 years ago

0.0.24

5 years ago

0.0.23

5 years ago

0.0.22

5 years ago

0.0.21

5 years ago

0.0.20

5 years ago

0.0.19

5 years ago

0.0.18

5 years ago

0.0.17

5 years ago

0.0.16

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago