dogechain-api is an Emacs library for working with the dogechain.info API.
It's not a particularly useful extension on its own, as there are no interactive functions, but can be used to build something more interesting.
The DogeChain API is split into two sections, a simple query API and a JSON api.
The DogeChain simple query API docs can be found here: http://dogechain.info/api/simple
The API functions are mapped as follows:
API Method | Local Function |
---|---|
addressbalance | dogechain-api-get-address-balance |
addresstohash | dogechain-api-address-to-hash |
checkaddress | dogechain-api-valid-address-p |
decode_address | dogechain-api-decode-address |
getblockcount | dogechain-api-get-block-count |
getdifficulty | dogechain-api-get-difficulty |
getreceivedbyaddress | dogechain-api-get-received-by-address |
getsentbyaddress | dogechain-api-get-sent-by-address |
totalbc | dogechain-api-get-total-currency |
Get the total amount ever received, minus the total amount ever sent for address.
(dogechain-api-get-address-balance "DTnt7VZqR5ofHhAxZuDy4m3PhSjKFXpw3e")
=> 12345.6789
Get the public key hash for address.
(dogechain-api-address-to-hash "DTnt7VZqR5ofHhAxZuDy4m3PhSjKFXpw3e")
=> "F8783344AF8532A73DFA97EBDDFCC7527A2C6E5A"
Check address for validity.
(dogechain-api-valid-address-p "DTnt7VZqR5ofHhAxZuDy4m3PhSjKFXpw3e")
=> T
(dogechain-api-valid-address-p "INVALID")
=> NIL
Get the version prefix and hash encoded in address. Returns an association
list containing :version
and :hash
keys.
(dogechain-api-decode-address "DTnt7VZqR5ofHhAxZuDy4m3PhSjKFXpw3e")
=> ((:version . "1e")
(:hash . "F8783344AF8532A73DFA97EBDDFCC7527A2C6E5A"))
Get the current block number.
(dogechain-api-get-block-count)
=> 123456
Get the difficulty of the last solved block.
(dogechain-api-get-difficulty)
=> 123456
Get the total amount ever received by address.
(dogechain-api-get-received-by-address "DTnt7VZqR5ofHhAxZuDy4m3PhSjKFXpw3e")
=> 123456.7890
Get the total amount ever sent by address.
(dogechain-api-get-sent-by-address "DTnt7VZqR5ofHhAxZuDy4m3PhSjKFXpw3e")
=> 123456.7890
Deprecated by the API
Deprecated by the API
Get the total amount of currency ever mined.
(dogechain-api-get-total-currency)
=> 12345678.90
Deprecated by the API
Copyright (C) 2014 Phil Newton
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.