A set of JavaScript utils which allow you to control a BitClout account programmatically.
This is not sponsored, supported, or affiliated with the developers of the BitClout social network.
- This is still experimental -- this is still very much in an 'alpha' stage
- No guarantee is made for this API to work as expected 100% of the time
- No guarantee is made for work to always continue on this API (although I hope work continues for a while!)
npm install bitclout
This is running on the back of Taiko, a great little Node.js framework for controlling a browser programmatically.
Basically, it very crudely clicks and interacts with the BitClout website, based on commands.
-
It's MIT licensed
-
It can be completely free to use, but by default you pay a very small fee
-
If you want to use this fully for free, turn off the "nice" feature in the code:
const { CloutNav } = require('bitclout'); let nav = new CloutNav; // Turn the nice feature off nav.options.nice.on = false
-
If the nice feature is turned on, you send a little bit of BitClout when you run commands. For more details about what the nice feature does, see "I want to be nice" later in the readme
-
-
The BitClout website changes very frequently. If functionality stops, please ping the contributors or raise an issue.
Everything is async, pretty much. Then and catch to your heart's content.
const { CloutNav } = require('bitclout');
// Create a nav instance
let nav = new CloutNav;
MY_SEED_PHRASE = 'some words which allow you access to your account'
let info = {}
nav.open(
// Open a browser window
).then(
// Then, login
() => nav.login(MY_SEED_PHRASE)
).then(
// Then, check your portfolio
() => nav.portfolio()
).then(
portfolio => {
// Store the portfolio in global object 'info', then buy some creator coin
info.portfolio = portfolio;
nav.buy('maebeam', 0.1);
}
).then(
// Check your portfolio after by logging to console
() => nav.portfolio()
).then(console.log)
If you find any issues or bugs, please ping a contributor or raise an issue on GitLab.
If you want to help out, please feel free to:
- drop me a message on GitLab
- drop me a message on BitClout (although I might be a little bit slow to respond!)
Well, that's great! By default, this package assumes you're a lovely person:
-
By default, the
CloutNav
class sends0.0001
BitClout to the original package author for every 10 BitClout-related commands you make (a follow, a buy, a sell). -
To turn off the nice feature, set
options.nice.on
to false on yourCloutNav
instance:const { CloutNav } = require('bitclout'); let nav = new CloutNav; // Turn the nice feature off nav.options.nice.on = false
-
To change the amount you send, set
options.nice.fee
on yourCloutNav
instance:const { CloutNav } = require('bitclout'); let nav = new CloutNav; // Turn the nice feature down nav.options.nice.fee = 0.000001
-
To change how often the fee is paid, set
options.nice.every
on yourCloutNav
instance. If the value is10
(the default), you send the fee after 10 commands.So, the amount you send per command is
fee/every
. Tweak every if you want to improve performance by only sending the fee every once in a while.const { CloutNav } = require('bitclout'); nav = new CloutNav; // Pay the fee much less frequently nav.options.nice.every = 100
- login
- logout
- CloutNav
- nice
- balance
- portfolio
- bitcoinAddress
- open
- close
- sendBitClout
- buy
- sell
- Profile
- follow
- profile
Login to the BitClout website.
parent
phrase
string Seed phrase.
Logout of the BitClout website.
parent
Class for browser-based navigation.
Use methods to perform simple operations on the BitClout website.
options
Send a little bit of BitClout to the author (if you're feeling nice) :)
The nice settings are set on CloudNav.prototype.options.nice.
parent
Check BitClout balance of logged in user.
parent
Returns Number Amount of BitClout.
Check creator coin portfolio of logged in user.
parent
Returns Object The portfolio. Keys are usernames (each as a string), values are holdings (number of creator coin, as a float). The values are only accurate to 4 decimal places (0.0001 BTCLT).
Check Bitcoin address of logged in user.
parent
Returns string Bitcoin address.
Open a browser window.
Uses Taiko (Chromium). You can have a maximum of 1 window open.
If successful, CloudNav.prototype.status.browser is set to true.
parent
Close a browser window.
Uses Taiko (Chromium).
If successful, CloudNav.prototype.status.browser is set to false.
parent
Send BitClout to a user.
Buy creator coins.
parent
username
string Username corresponding to the coin.amount
number Amount of Bitclout to use for the purchase.
Sell creator coins.
parent
username
string Username corresponding to the coin.amount
number Amount of creator coin to sell.
Type: Object
username
string Username.text
string Headline text field on profile.numFollowers
number Number of followers.price
number Coin price, in USD.publicKey
string User public key.
Follow/unfollow a user.
parent
username
string Username to follow/unfollow.
Returns boolean After running this function, true if following, false if not.
Extract metadata from profile.
parent
username
string Username to extract metadata from.
Returns Profile Profile object.