Skip to content

add --crypto flag to currencies and rename Type to PriceType#3

Merged
tamnd merged 1 commit into
mainfrom
feat/crypto-flag-and-price-type
Jun 14, 2026
Merged

add --crypto flag to currencies and rename Type to PriceType#3
tamnd merged 1 commit into
mainfrom
feat/crypto-flag-and-price-type

Conversation

@tamnd

@tamnd tamnd commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • currencies --crypto now fetches /v2/currencies/crypto and maps its code/name wire shape into the shared Currency type (fiat uses id/name/min_size)
  • Price.Type renamed to Price.PriceType with JSON tag price_type to match the spec and avoid shadowing Go's reserved word
  • Tests updated for the renamed field; 14 tests pass

Test plan

  • go build ./... passes
  • go test -count=1 ./... — 14 tests pass
  • coinbase spot BTC-USD — returns price_type: spot
  • coinbase buy ETH-USD — returns price_type: buy
  • coinbase rates BTC --to USD,EUR,GBP,JPY — 4 filtered rows
  • coinbase currencies — first row: AED, UAE Dirham
  • coinbase currencies --crypto — first row: BTC, Bitcoin

currencies --crypto now calls /v2/currencies/crypto and maps the
code/name wire shape to Currency (fiat uses id/name/min_size).

Price.Type renamed to PriceType with json tag price_type to match
the spec and avoid confusion with Go's built-in type keyword.
@tamnd tamnd merged commit 4749f38 into main Jun 14, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant