Hi,
Trying to figure out this part of the code, what is the meaning of "[[username]]"? Won't username suffice?
const accounts = await hiveTx.call('condenser_api.get_accounts', [[username]])
Sorry not a JS dev :)
Hi,
Trying to figure out this part of the code, what is the meaning of "[[username]]"? Won't username suffice?
const accounts = await hiveTx.call('condenser_api.get_accounts', [[username]])
Sorry not a JS dev :)
That's not related to JS. The Hive API node wants a call in that format. Check APIs on devportal
Parameters are sent in an array. Here, we have to put another array inside that array because API accepts a list of accounts not a single account.
The above code is equivalent to this curl:
curl -s --data '{"jsonrpc":"2.0", "method":"condenser_api.get_accounts", "params":[["username"]], "id":1}' https://api.hive.blog
Thanks!