getAccountInfo - Dogecoin

Returns balance and transaction data for an address, extended public key, or descriptor over WebSocket. This is the WebSocket form of the REST api/v2/address endpoint.

Parameters

ParameterTypeRequiredDescription
descriptorstringYesAddress, extended public key, or descriptor to query
detailsstringNoDetail level: basic, txids, txslight, or txs. Default txids
pageintegerNo1-based page index for transaction history
pageSizeintegerNoHistory items per page
fromintegerNoFirst block height to include
tointegerNoLast block height to include
gapintegerNoDerivation gap limit for xpub queries

Message

bashwscat -c wss://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>

# then send:
{
    "id": "getblock.io",
    "method": "getAccountInfo",
    "params": {
        "descriptor": "DRv9o4XUK1DhNiuKPadPwkQNkPgtcniBFF",
        "details": "txids",
        "page": 1,
        "pageSize": 1000
    }
}

Response

json{
    "id": "getblock.io",
    "data": {
        "page": 1,
        "totalPages": 27,
        "itemsOnPage": 1000,
        "address": "DRv9o4XUK1DhNiuKPadPwkQNkPgtcniBFF",
        "balance": "1105234012375840",
        "totalReceived": "1631025972011211333",
        "totalSent": "1629920737998835493",
        "unconfirmedBalance": "0",
        "unconfirmedTxs": 0,
        "txs": 26270,
        "txids": [
            "4c5519699240ed1f23e1ec46ea4bc85f019982f6ef48afdb7698054230a4b76e",
            "8d99a37f27d702b35bcc74dfea0d1a006a67c20571e1de660a30defc16316c8f"
        ]
    }
}

Response Fields

FieldTypeDescription
addressstringThe queried address or descriptor
balancestringConfirmed balance in koinu
totalReceivedstringTotal received in koinu
totalSentstringTotal sent in koinu
unconfirmedBalancestringUnconfirmed balance in koinu
unconfirmedTxsintegerNumber of unconfirmed transactions
txsintegerNumber of confirmed transactions
txidsarrayTransaction ids, present when details is txids

Amounts are in koinu at 1e-8 DOGE and run to sixteen digits on active accounts. Parse them with a 64-bit integer or a decimal type; a 32-bit integer or a JavaScript Number used carelessly will lose precision.

Use Cases

  • Balance Display: Show the confirmed and unconfirmed balance of an account
  • History Pages: Page through an account's transactions
  • Wallet Loading: Read a whole xpub wallet in one call
  • Reconciliation: Compare indexed totals against local bookkeeping

Error Handling

ErrorMessageDescription
errorInvalid addressThe descriptor is malformed
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect