glupbit

Glupbit — Type-safe Gleam client for the Upbit cryptocurrency exchange API.

Quick Start

import glupbit
import glupbit/quotation/market

// Public client (no auth needed)
let client = glupbit.new()
let assert Ok(pairs) = market.list_all(client)

// Authenticated client from environment variables
let assert Ok(auth_client) = glupbit.new_from_env()

Values

pub fn access_key(key: String) -> auth.AccessKey

Wrap a raw string as an AccessKey.

pub fn credentials(
  ak: auth.AccessKey,
  sk: auth.SecretKey,
) -> auth.Credentials

Bundle credentials from an access key and secret key.

pub fn market(code: String) -> Result(types.Market, Nil)

Parse a market code like "KRW-BTC" into a validated Market.

pub fn new() -> client.PublicClient

Create a public client for quotation (market data) endpoints.

pub fn new_auth(creds: auth.Credentials) -> client.AuthClient

Create an authenticated client for all endpoints.

pub fn new_from_env() -> Result(client.AuthClient, String)

Create an authenticated client from environment variables.

pub fn secret_key(key: String) -> auth.SecretKey

Wrap a raw string as a SecretKey.

pub fn to_public(
  auth_client: client.AuthClient,
) -> client.PublicClient

Downcast an AuthClient to a PublicClient for quotation calls.

Search Document