Skip to content

Commit 0331f30

Browse files
docs: AUR installation/pkgbuild, cleanup (#27)
* docs: AUR installation, cleanup Signed-off-by: Kainoa Kanter <[email protected]> * fix(docs): heading level for homebrew Signed-off-by: Kainoa Kanter <[email protected]> * add PKGBUILD * Add maintainer comment for Di Mei --------- Signed-off-by: Kainoa Kanter <[email protected]>
1 parent 8dc4b89 commit 0331f30

File tree

2 files changed

+74
-7
lines changed

2 files changed

+74
-7
lines changed

PKGBUILD

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Maintainer: Di Mei <[email protected]>
2+
# Maintainer: Kainoa Kanter <[email protected]>
3+
4+
_pkgname=cdpcurl
5+
pkgname="$_pkgname-git"
6+
pkgver=r12.g8dc4b89
7+
pkgrel=2
8+
pkgdesc='CLI for the Coinbase Developer Platform (CDP)'
9+
url='https://github.com/coinbase/cdpcurl'
10+
arch=('aarch64' 'i686' 'x86_64')
11+
license=('custom:none')
12+
depends=('glibc')
13+
makedepends=('git' 'go')
14+
provides=("$_pkgname")
15+
source=("$_pkgname::git+$url")
16+
sha256sums=('SKIP')
17+
18+
pkgver() {
19+
cd "${srcdir}/${_pkgname}" || exit
20+
printf "r%s.g%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
21+
}
22+
23+
prepare() {
24+
cd "$_pkgname"
25+
go mod download
26+
}
27+
28+
build() {
29+
export CGO_CPPFLAGS="${CPPFLAGS}"
30+
export CGO_CFLAGS="${CFLAGS}"
31+
export CGO_CXXFLAGS="${CXXFLAGS}"
32+
export CGO_LDFLAGS="${LDFLAGS}"
33+
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
34+
cd "$_pkgname"
35+
go build
36+
}
37+
38+
check() {
39+
export CGO_CPPFLAGS="${CPPFLAGS}"
40+
export CGO_CFLAGS="${CFLAGS}"
41+
export CGO_CXXFLAGS="${CXXFLAGS}"
42+
export CGO_LDFLAGS="${LDFLAGS}"
43+
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
44+
cd "$_pkgname"
45+
go test ./...
46+
}
47+
48+
package() {
49+
cd "$_pkgname"
50+
install -Dv cdpcurl -t "$pkgdir/usr/bin/"
51+
}

README.md

+23-7
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,41 @@
22

33
`cdpcurl` is a tool that allows you to make HTTP requests to the Coinbase API with your CDP (Coinbase Developer Platform) API key. It is a wrapper around curl that automatically adds the necessary headers to authenticate your requests.
44

5-
## Installation via Homebrew
6-
```
5+
## Installation
6+
7+
### Homebrew
8+
9+
```bash
710
brew tap coinbase/cdpcurl
811
brew install cdpcurl
912
```
1013

11-
## Installation via Go
12-
`go install github.com/coinbase/cdpcurl@latest`
14+
### AUR
15+
16+
```bash
17+
yay -S cdpcurl-git
18+
```
19+
20+
### Go
21+
22+
```bash
23+
go install github.com/coinbase/cdpcurl@latest
24+
```
1325

1426
## Example Usage
27+
1528
### Get account balance of BTC with Sign In With Coinbase API
16-
```
29+
```bash
1730
cdpcurl -k ~/Downloads/cdp_api_key.json 'https://api.coinbase.com/v2/accounts/BTC'
1831
```
32+
1933
### Get the latest price of BTC with Advanced Trading API
20-
```
34+
```bash
2135
cdpcurl -k ~/Downloads/cdp_api_key.json 'https://api.coinbase.com/api/v3/brokerage/products/BTC-USDC'
2236
```
37+
2338
### Create a wallet on Base Sepolia with Platform API
24-
```
39+
40+
```bash
2541
cdpcurl -k ~/Downloads/cdp_api_key.json -X POST -d '{"wallet": {"network_id": "base-sepolia"}}' 'https://api.developer.coinbase.com/platform/v1/wallets'
2642
```

0 commit comments

Comments
 (0)