Almost all modules use an interface to describe the available functions. You can find the interface at the top of the module file.
src/ethereum/utils.jse.g. exports anEthUtilsInterface. All interfaces are describe via JsDoc in the code. So it would be great if you have a look at the interfaces since we want to avoid redundancy of documentation.
DBInterface (src/database/db.js)
Use this to query and write the database. It's an abstraction layer for realm
Available methods:
queryquery the databasewritewrite to the database.
EthUtilsInterface(src/ethereum/utils.js)
Contain's utils for address and private key normalization, transaction signing, private key creation, private key storage and so on.
Available methods:
createPrivateKeyReturn's an Promise that resolves in an private ethereum key (32 bytes in hex encoded)savePrivateKeySave private keyallKeyPairsResolves in an list of ethereum keypairs mapgetPrivateKeyGet an private key by it's addressdeletePrivateKeydecryptPrivateKeysignTxSign an ethereum transactionnormalizeAddressnormalized an etheruem address (e.g. add the hex prefix and so on)normalizePrivateKeynormalize an ethereum private key (will throw when the key is invalid)privateKeyToMnemonicconvert's an ethereum private key to it's mnemonic phrase.mnemonicToPrivateKeyopposite ofprivateKeyToMnemonicmnemonicValidcheck if the mnemonic is valid
NationInterface(src/ethereum/nation.js)
Use this to interact with everything nation related like creation, joining, leaving, indexing and so on.
Available methods:
allreturns all index nationsjoinNationjoin an nationleaveNationleave an nationindexuse this to index all nation's from the blockchain. Just call it once a while to fetch nation's created by other people.saveDraftSave a draft and return's an translation key + nation datasetupdateDraftUpdate a draft and return's transactio key + nation dataset. This can only be called when the nation was not submitted to the blockchain.submitDraftSubmit draft to the blockchain.saveAndSubmitSave and submit and nation dataset.deleteDraftDelete and draft.
WalletInterface(src/ethereum/wallet.js)
Use this to interact with your ethereum wallet.
Available methods:
ethSendWill send ether from a to bethBalanceFetch your eth balanceethSyncSync your ethereum accounts.
ProfileInterface(src/ethereum/profile.js)
Use this to interact with your profile.
Available methods:
hasProfileCheck if an profile is presentsetProfileSet / create an profilegetProfileFetch your profilegetPublicProfileFetch your public profile (it contain's some additional values)
MessagingQueueInterface (src/queue/messaging.js)
addJobAdd's an job to the messaging queue.Add job expect's an instance of
Msg.fetchMessagesFetch the lastxjob's form the queue.