Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 931 Bytes

File metadata and controls

26 lines (17 loc) · 931 Bytes

Ruby quickstart

A short "hello world" that authenticates with the Cryptohopper API and prints your account info plus the BTC/USDT price.

Run it

export CRYPTOHOPPER_TOKEN=your-40-char-bearer
bundle install
ruby hello.rb

What it shows

  • How to construct Cryptohopper::Client with a bearer token
  • One authenticated call: ch.user.get
  • One market-data call: ch.exchange.ticker(exchange:, market:)
  • Typed error handling via Cryptohopper::Error

Where to get a token

cryptohopper.com developer dashboard → Create OAuth app → drive the consent flow once. See oauth/ for runnable OAuth examples, or use the cryptohopper CLI (cryptohopper login) which handles the flow for you.

Dependencies

Just one — cryptohopper. Requires Ruby 3.0+.