Page MenuHomePhabricator

[Chronik-client] Add token minter to the .token() API response
AbandonedPublic

Authored by emack on Jul 31 2023, 06:11.

Details

Reviewers
bytesofman
Fabien
tobias_ruck
Group Reviewers
Restricted Project
Summary

T3236

Chronik-client's .token() API currently does not return the token minter address. This diff derives the minter address from the specific genesis tx output which transferred the initial token supply to the minter at the point of genesis.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Branch
tokenMinterHash
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 24628
Build 48853: Build Diff
Build 48852: arc lint + arc unit

Event Timeline

emack requested review of this revision.Jul 31 2023, 06:11

what's the use case for this ?

what's the use case for this ?

This is needed when executing SLP-based airdrop campaigns where XEC is pro-rata distributed to holders of a particular token. In this context the token minter should always be excluded from the pro-rata token balance calculations otherwise their typically significant holding of the token supply will skew the pro-rata distribution across genuine token holders. Currently, the token minter address is manually derived similar to above so I felt it made sense to have it returned as part of the overall token object via chronik-client.

It's also useful for slp token explorers which displays all the relevant info of the token, which should include the token minter. Its use will eventually extend to non-type1 tokens such as NFTs where the creator is an integral part of the metadata.

This doesn't have to be in the client library though, it can be in the code for the airdrop.

This slows down everyone that just wants to have token ticker / token name / token decimals.

This doesn't have to be in the client library though, it can be in the code for the airdrop.

This slows down everyone that just wants to have token ticker / token name / token decimals.

yea fair enough, the additional tx() call is rather expensive