Skip to content

Commit

Permalink
Add the checkAddress method
Browse files Browse the repository at this point in the history
  • Loading branch information
owenvoke committed Nov 5, 2018
1 parent 6f35ec4 commit 610ffbf
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Arionum.js
Expand Up @@ -233,6 +233,9 @@ class Arionum {
/**
* Check that a signature is valid against a public key.
*
* @param {string} signature
* @param {string} data
* @param {string} publicKey
* @return Promise
*/
checkSignature (signature, data, publicKey) {
Expand Down Expand Up @@ -301,6 +304,23 @@ class Arionum {
})
}

/**
* Check that an address is valid.
* Optionally validate it against the corresponding public key.
*
* @param {string} address
* @param {string|null} publicKey
* @return Promise
*/
checkAddress (address, publicKey = null) {
return this
.getJson({
q: 'checkAddress',
account: address,
public_key: publicKey
})
}

/**
* @returns void
*/
Expand Down

0 comments on commit 610ffbf

Please sign in to comment.