Exchange crypto on coinbase

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Created page with "The '''coinbase exchange''' command allows you to buy or sell coins in the Coinbase market. Before using this command, ensure that you've set up your API and security credent...")
 
 
Line 1: Line 1:
The '''coinbase exchange''' command allows you to buy or sell coins in the Coinbase market.
+
The '''exchange crypto on coinbase''' command allows you to buy or sell coins in the Coinbase market.
  
 
Before using this command, ensure that you've set up your API and security credentials for Coinbase with the '''config coinbase''' command.
 
Before using this command, ensure that you've set up your API and security credentials for Coinbase with the '''config coinbase''' command.
Line 7: Line 7:
 
'''Amount:''' The amount of cryptocurrency to buy or sell.
 
'''Amount:''' The amount of cryptocurrency to buy or sell.
  
'''Market:''' The market in which you want to buy or sell cryptocurrency.
+
'''Market:''' The market in which you want to buy or sell cryptocurrency. This consists of the symbols for two currencies separated by a dash. For example: "BTC-USD"
  
 
'''Buy Or Sell:''' The action you want to perform – either 'Buy' or 'Sell'.
 
'''Buy Or Sell:''' The action you want to perform – either 'Buy' or 'Sell'.
  
'''Transaction Info Variable:''' (optional) A variable that will store information about the transaction. If you do not specify a variable, the transaction information will be stored in a variable named "#txinfo" by default.
+
'''Transaction Info Variable:''' (optional) A variable that will store information about the transaction. Default is '''#txinfo'''.
  
 
== Example ==
 
== Example ==
  
 
<pre>
 
<pre>
 +
ui console view
 
config coinbase("your api key", "your api secret", "your passphrase")
 
config coinbase("your api key", "your api secret", "your passphrase")
coinbase exchange("0.001", "BTC-USD", "Buy", "#btcTransactionInfo")
+
exchange crypto on coinbase("0.001", "BTC-USD", "Buy", "#txinfo")
log("Transaction Info: {#btcTransactionInfo}")
+
log object(#txinfo)
 
</pre>
 
</pre>
  
 
In this script, replace "your api key", "your api secret", and "your passphrase" with your actual API key, API secret, and passphrase respectively.
 
In this script, replace "your api key", "your api secret", and "your passphrase" with your actual API key, API secret, and passphrase respectively.
  
This script will buy 0.001 BTC (Bitcoin) from the BTC-USD market. The transaction information will be stored in a variable named "#btcTransactionInfo".
+
This script will buy 0.001 BTC (Bitcoin) from the BTC-USD market. The transaction information will be stored in a variable named  
 +
'''#txinfo''', which will then be logged to the console.
  
Please remember that your API key, API secret, passphrase and addresses are sensitive information. If you need to show someone your script, ensure to remove these details first.
+
Please remember that your API key, API secret, passphrase and addresses are sensitive information. If you need to show someone your script, be sure to remove these details first.
 
+
After running these commands, your UBot console will provide transaction information, like so:
+
 
+
<blockquote>
+
Transaction Info: {"id": "5f76c330cd53b4644eaef8d4", "status": "pending", "amount": {"amount": "0.001", "currency": "BTC"}, "native amount": {"amount": "11.23", "currency": "USD"}, "description": null, "created at": "2020-10-01T14:52:40Z", "updated at": "2020-10-01T14:52:40Z", "resource": "transaction", "resource path": "/v2/accounts/562ff00eeb35d977059449b2/transactions/5f76c330cd53b4644eaef8d4", "type": "exchange", "instant exchange": false, "details": {"title": "Bought Bitcoin", "subtitle": "Using USD Wallet", "image url": "https://wallet.coinbase.com/images/transaction details 3X.png"}}
+
</blockquote>
+

Latest revision as of 17:36, 4 July 2023

The exchange crypto on coinbase command allows you to buy or sell coins in the Coinbase market.

Before using this command, ensure that you've set up your API and security credentials for Coinbase with the config coinbase command.

[edit] Parameters

Amount: The amount of cryptocurrency to buy or sell.

Market: The market in which you want to buy or sell cryptocurrency. This consists of the symbols for two currencies separated by a dash. For example: "BTC-USD"

Buy Or Sell: The action you want to perform – either 'Buy' or 'Sell'.

Transaction Info Variable: (optional) A variable that will store information about the transaction. Default is #txinfo.

[edit] Example

ui console view
config coinbase("your api key", "your api secret", "your passphrase")
exchange crypto on coinbase("0.001", "BTC-USD", "Buy", "#txinfo")
log object(#txinfo)

In this script, replace "your api key", "your api secret", and "your passphrase" with your actual API key, API secret, and passphrase respectively.

This script will buy 0.001 BTC (Bitcoin) from the BTC-USD market. The transaction information will be stored in a variable named #txinfo, which will then be logged to the console.

Please remember that your API key, API secret, passphrase and addresses are sensitive information. If you need to show someone your script, be sure to remove these details first.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox