modulepackage
0.3.0
Repository: https://github.com/jalavosus/coinbasepro-go.git
Documentation: pkg.go.dev
# README
coinbasepro-go
Go wrapper around the Coinbase Pro API, using fasthttp for firing off API requests.
Note that this library is a continuing work-in-progress and is provided AS-IS. I take no responsibility for any fiat money or cryptocurrency lost as a result of a malfunction or error in this library.
Installation
go get -u github.com/jalavosus/coinbasepro-go
Usage
The following keys must be set in the environment, either with a .env
file or via another method:
COINBASE_API_KEY
: A Coinbase Pro API keyCOINBASE_API_SECRET
: The alphanumeric secret key provided by Coinbase Pro upon creation of an API key.COINBASE_API_PASSPHRASE
: The passphrase assigned by the API key's creator upon creation.COINBASE_PORTFOLIO_ID
: ID of the portfolio the provided API key is allowed to access.
Assuming those keys are set in the environment, usage is as simple as
package main
import (
"fmt"
"github.com/jalavosus/coinbasepro-go"
)
func main() {
allAccounts := coinbasepro.GetAccounts()
for _, account := range allAccounts {
fmt.Println(account.Currency)
}
}
# Packages
No description provided by the author
# Functions
GetAccount wraps the /accounts/<account-id> API endpoint, returning an Account representing the portfolio account with the passed accountID.
GetAccountFromCurrency attempts to locate an account in the user's portfolio based on its currency.
GetAccountHistory wraps the /accounts/<account-id>/ledger API endpoint, returning an array of ledger entries for the specified account.
GetAccounts wraps the /accounts API endpoint, returning all accounts which the loaded API key has access to.
GetProducts wraps the /products API endpoint, returning an array of Coinbase Pro Product objects.
# Structs
Account represents a Coinbase Pro portfolio account for a given currency.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
LimitOrderParams follows the spec documented at https://docs.pro.coinbase.com/#orders for placing limit orders on Coinbase Pro.
MarketOrderParams follows the spec documented at https://docs.pro.coinbase.com/#orders for placing market orders on Coinbase Pro.
NewOrderParams follows the spec documented at https://docs.pro.coinbase.com/#orders for placing new orders on Coinbase Pro.
Order represents a Coinbase Pro order object.
Product represents a Coinbase Pro product object.
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author