gleam-spacetraders-sdk/src/models/siphon_yield.gleam
Lily Rose cc8edbed02
Some checks are pending
test / test (push) Waiting to run
Add functioning sdk
2025-06-17 01:43:06 +10:00

12 lines
367 B
Gleam

import gleam/dynamic/decode.{type Decoder}
import models/trade_symbol.{type TradeSymbol}
pub type SiphonYield {
SiphonYield(symbol: TradeSymbol, units: Int)
}
pub fn decoder() -> Decoder(SiphonYield) {
use symbol <- decode.field("symbol", trade_symbol.decoder())
use units <- decode.field("units", decode.int)
decode.success(SiphonYield(symbol:, units:))
}