Get top x coins

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Created page with "'''$get top x coins''' is a function that returns a list of objects with data about the top specified number of coins by market capitalization. == Parameters == '''Amount:''...")
 
(Example)
 
(2 intermediate revisions by one user not shown)
Line 12: Line 12:
  
 
<pre>
 
<pre>
config defi wallet("your private key")
+
ui console view
log("Top 5 Coins: {$get top x coins("5")}")
+
log object($get top x coins("5"))
 
</pre>
 
</pre>
  
Please replace "your private key" with your actual DeFi wallet's private key.
+
The example command will return a list of yaml objects with data about the top 5 coins by market capitalization.
 
+
Be mindful when you are handling your private key. It's a sensitive piece of data that allows full control over your funds in your DeFi wallet. Therefore, never share this key publicly or with anyone.
+
 
+
The example command will return a list of objects with data about the top 5 coins by market capitalization.
+
 
+
Example Output:
+
 
+
<pre>
+
[
+
  { "id": "bitcoin", "name": "Bitcoin", "price": "$50000" },
+
  { "id": "ethereum", "name": "Ethereum", "price": "$3500" },
+
  { "id": "binancecoin", "name": "Binance Coin", "price": "$500" },
+
  { "id": "tether", "name": "Tether", "price": "$1" },
+
  { "id": "usd-coin", "name": "USD Coin", "price": "$1" }
+
]
+
</pre>
+
 
+
The output for each coin includes the ID, name, and current price. Keep in mind that the price of cryptocurrencies can change rapidly due to their volatile nature.
+

Latest revision as of 01:51, 5 July 2023

$get top x coins is a function that returns a list of objects with data about the top specified number of coins by market capitalization.

[edit] Parameters

Amount: The number of top coins by market capitalization you want to fetch the data for.

[edit] Return Value

This function returns a list of objects. Each object includes data about one of the top coins by market capitalization.

[edit] Example

ui console view
log object($get top x coins("5"))

The example command will return a list of yaml objects with data about the top 5 coins by market capitalization.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox