https://github.com/hexonthebeach/posh-mod-gdax
PowerShell Module collection for Coinbase GDAX interaction
https://github.com/hexonthebeach/posh-mod-gdax
gdax-api powershell
Last synced: 6 days ago
JSON representation
PowerShell Module collection for Coinbase GDAX interaction
- Host: GitHub
- URL: https://github.com/hexonthebeach/posh-mod-gdax
- Owner: hexonthebeach
- Created: 2018-05-20T12:31:05.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-04-27T10:07:51.000Z (about 5 years ago)
- Last Synced: 2025-02-26T01:27:37.861Z (over 1 year ago)
- Topics: gdax-api, powershell
- Language: PowerShell
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# POSH-MOD-CBPRO
PowerShell Module collection for Coinbase Pro interaction
## Why
Simplify the interaction with the Coinbase Pro API. Making connecting to it and using it effortless and painless.
## Installation
Clone the project to a directory that can be read by your script.
Any location is fine, but one of these might be useful
Make the modules available to the whole system by putting them here:
``
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
``
Make the modules available for a specific account by putting them here:
``
C:\Users\\Documents\WindowsPowerShell\Modules
``
## How
Use the CBPRO prefix when importing the modules, modules with dependencies on eachother rely on this prefix.
- ``cbpro-api`` handles the API request
- ``cbpro-auth`` provides Credential and authentication methods when nesseccary
- ``cbpro-accounts`` for your Accounts, History and Holds data
- ``cbpro-fills`` works with your recent Fills
- ``cbpro-marketdata`` gets public information like Products Currencies and Time
- ``cbpro-orders`` handles all your Order mutating, creating, listing and cancelling
```
Import-Module cbpro-api.psm1 -Prefix CBPRO -Force
Import-Module cbpro-auth.psm1 -Prefix CBPRO -Force
Import-Module cbpro-accounts.psm1 -Prefix CBPRO -Force
Import-Module cbpro-fills.psm1 -Prefix CBPRO -Force
Import-Module cbpro-marketdata.psm1 -Prefix CBPRO -Force
Import-Module cbpro-orders.psm1 -Prefix CBPRO -Force
# set the environment to use
Set-CBPROEnvironment "sandbox"
# supply credentials
Set-CBPROCredentials -Key 'thekeystring' -Passphrase 'thepassphrasestring' -Secret 'thebase64encodedsecret'
# list your accounts
Get-CBPROAccounts |Format-Table -AutoSize
# get the latest trade to see the current market value
Get-CBPROProductTicker -ProductID 'BTC-EUR' |Format-Table -AutoSize
# sell all your BTC with a Market orders
$btcAccount = $accounts |Where-Object { $_.currency -eq 'BTC' } |Select-Object -First 1
New-CBPROOrder -Side sell -ProductID 'BTC-EUR' -Type market -Size $btcAccount.available -Place
```
CBPRO-API is the shared dependency for the other modules, and CBPRO-AUTH is required when invoking Private endpoints.
The others work independently from eachother.