Tools and analytics data for the BitClout blockchain
NetworkClient
: Used to fetch all transactions given ablockHeight
or an accountpublicKey
StorageClient
: Used to save, read or check that a block has been saved on diskQueryManager
: Combine theNetworkClient
&StorageClient
to provide a higher level API to fetch all blocks fromblockHeight
to the last available one. Persist the result on disk to not fetch the same block again if it's already been fetched.StateManager
: Use the previous Classes to provide higher level API.refresh(completion:)
: To update the locally stored blocks with the newly available onesprintAllTransactionForCreatorCoins(privateKey:)
: To print all the buy/sell that happened to a creator coin, given it's public key. This is printed in csv format where each line isblockHeight,coinsValueChange
.
Tools
: Contains math functions to convert from $BitClout prices to number of coins given the existing coins in circulation and vice versa.
Here is an example of how this can be used:
let stateManager = StateManager()
stateManager.refresh() { error in
guard error == nil else { return }
let creatorKeyToFind = "BC1YLiWgKXYrpTkUZHyCbhfxU1bgJCQGcBvsQvPWuAwiVWnDFsvxudi" // @ludo
stateManager.printAllTransactionForCreatorCoins(privateKey: creatorKeyToFind)
}
In the meantime, feel free to play with this, and contribute back you findings if you think this might help others :)
My profile: @ludo