Coinbase (CB)

Install lib and make
/setup
command with code:Libs.Coinbase.setup();
3. Go to Admin Panel and fill Api Key and Secret Api Key:

4. If you need notifications copy Notifications url and fill it on step 2
5. Fill command to be called on notifications if you need it
/create
command:let account_id = "YOU ACCOUNT ID"
// you can see your all accounts in https://www.coinbase.com/accounts/
// just select needed account and copy it ID from url:
// https://www.coinbase.com/accounts/ID
Libs.Coinbase.apiCall({
method: "POST", // method can be GET and POST
path: "accounts/" + account_id + "/addresses",
body: { name: "myAddress" },
onSuccess: "/onApi",
// onError: "/onApiError" // onError command
// background: true // perform api call in background for big timeout limit
// apiKey - if you need custom Api Key
// secretApiKey - if you need custom Api Key
})
In body you can pass all fields from Coinbase api.
/onApi
command:Bot.inspect(options.result)
/onApiError
command:Bot.sendMessage(
"We have error with Coinbase API. Please try later. " +
options.error // error message from Coinbase Api
)
Bot.sendMessage(
options.http_status + " " + JSON.stringify(options.result)
)
if you do not have onError command error will be tracked in Eror Tab.

Last modified 1yr ago