Skip to content

Show token decimals in balances in SLP address response #50

@damascene

Description

@damascene

when querying an SLP address we get results in this following format, utxos has the token decimal but it's not available in balances. I
It would be useful to add decimals to balances.

{
	"balance": {
		"utxos": [
			{
				"txid": "fe527eada40bf9dad59cdbe638eab77f88fd5b799d45a9a3858df21b496b5d23",
				"vout": 1,
				"type": "token",
				"tokenType": 1,
				"qty": "110",
				"tokenId": "926894cbf50269b15c97559b9acfc1bd88cd5f20703313ce0ea0683ecdb40911",
				"address": "bitcoincash:qpalh53velv3g5r6khjv4cjdmjnad7pz4cgc9rgr9k",
				"decimals": 2,
				"effectiveQty": "1.1",
				"value": 0.00000546
			}
		],
		"txs": [
			{
				"txid": "97b517652ae9c024a099107afaee5b5c3c31b8fd9504cab6f14ec09bd363b555",
				"height": 745007
			},
		],
		"balances": [
			{
				"tokenId": "926894cbf50269b15c97559b9acfc1bd88cd5f20703313ce0ea0683ecdb40911",
				"qty": "110"
			}
		]
	}
}

query:

curl --request POST \
  --url https://api.fullstack.cash/v5/psf/slp/address/ \
  --header 'Content-Type: application/json' \
  --data '{ "address": "bitcoincash:qpalh53velv3g5r6khjv4cjdmjnad7pz4cgc9rgr9k" }'

parts of response were omitted for shorter example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions