Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show token decimals in balances in SLP address response #50

Open
damascene opened this issue Jun 30, 2022 · 0 comments
Open

Show token decimals in balances in SLP address response #50

damascene opened this issue Jun 30, 2022 · 0 comments

Comments

@damascene
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant