spacetraders_api

Types

pub type AgentRegistered {
  AgentRegistered(
    token: @internal AgentToken,
    agent: agent.Agent,
    faction: faction.Faction,
    contract: contract.Contract,
    ships: List(ship.Ship),
  )
}

Constructors

pub type Announcement {
  Announcement(title: String, body: String)
}

Constructors

  • Announcement(title: String, body: String)
pub type CargoPurchased {
  CargoPurchased(
    cargo: ship_cargo.ShipCargo,
    transaction: market_transaction.MarketTransaction,
    agent: agent.Agent,
  )
}

Constructors

pub type CargoSold {
  CargoSold(
    cargo: ship_cargo.ShipCargo,
    transaction: market_transaction.MarketTransaction,
    agent: agent.Agent,
  )
}

Constructors

pub type CargoTransferred {
  CargoTransferred(
    cargo: ship_cargo.ShipCargo,
    target_cargo: ship_cargo.ShipCargo,
  )
}

Constructors

pub type ChartCreated {
  ChartCreated(
    chart: chart.Chart,
    waypoint: waypoint.Waypoint,
    transaction: chart_transaction.ChartTransaction,
    agent: agent.Agent,
  )
}

Constructors

pub type ChartLeaderboardEntry {
  ChartLeaderboardEntry(
    agent_symbol: agent_symbol.AgentSymbol,
    chart_count: Int,
  )
}

Constructors

pub type ConstructionSiteSupplied {
  ConstructionSiteSupplied(
    construction: construction.Construction,
    cargo: ship_cargo.ShipCargo,
  )
}

Constructors

pub type ContractAccepted {
  ContractAccepted(
    contract: contract.Contract,
    agent: agent.Agent,
  )
}

Constructors

pub type ContractCargoDelivered {
  ContractCargoDelivered(
    contract: contract.Contract,
    cargo: ship_cargo.ShipCargo,
  )
}

Constructors

pub type ContractFulfilled {
  ContractFulfilled(
    contract: contract.Contract,
    agent: agent.Agent,
  )
}

Constructors

pub type CreditLeaderboardEntry {
  CreditLeaderboardEntry(
    agent_symbol: agent_symbol.AgentSymbol,
    credits: Int,
  )
}

Constructors

pub type ErrorCode {
  ErrorCode(code: Int, name: String)
}

Constructors

  • ErrorCode(code: Int, name: String)
pub type FactionReputation {
  FactionReputation(
    symbol: faction_symbol.FactionSymbol,
    reputation: Int,
  )
}

Constructors

pub type Health {
  Health(last_market_update: option.Option(birl.Time))
}

Constructors

pub type Leaderboards {
  Leaderboards(
    most_credits: List(CreditLeaderboardEntry),
    most_submitted_charts: List(ChartLeaderboardEntry),
  )
}

Constructors

pub type Link {
  Link(name: String, url: uri.Uri)
}

Constructors

pub type ResourcesExtracted {
  ResourcesExtracted(
    extraction: extraction.Extraction,
    cooldown: cooldown.Cooldown,
    cargo: ship_cargo.ShipCargo,
    modifiers: List(waypoint_modifier.WaypointModifier),
    events: List(ship_condition_event.ShipConditionEvent),
  )
}

Constructors

pub type ResourcesSiphoned {
  ResourcesSiphoned(
    siphon: siphon.Siphon,
    cooldown: cooldown.Cooldown,
    cargo: ship_cargo.ShipCargo,
    events: List(ship_condition_event.ShipConditionEvent),
  )
}

Constructors

pub type Scan(data) {
  Scan(cooldown: cooldown.Cooldown, data: List(data))
}

Constructors

pub type ServerResets {
  ServerResets(next: birl.Time, frequency: String)
}

Constructors

  • ServerResets(next: birl.Time, frequency: String)
pub type ServerStatus {
  ServerStatus(
    status: String,
    version: String,
    reset_date: birl.Time,
    description: String,
    stats: Stats,
    health: Health,
    leaderboards: Leaderboards,
    server_resets: ServerResets,
    announcements: List(Announcement),
    links: List(Link),
  )
}

Constructors

pub type ShipJumped {
  ShipJumped(
    nav: ship_nav.ShipNav,
    cooldown: cooldown.Cooldown,
    transaction: market_transaction.MarketTransaction,
    agent: agent.Agent,
  )
}

Constructors

pub type ShipModuleInstalled {
  ShipModuleInstalled(
    agent: agent.Agent,
    modules: List(ship_module.ShipModule),
    cargo: ship_cargo.ShipCargo,
    transaction: ship_modification_transaction.ShipModificationTransaction,
  )
}

Constructors

pub type ShipModuleRemoved {
  ShipModuleRemoved(
    agent: agent.Agent,
    modules: List(ship_module.ShipModule),
    cargo: ship_cargo.ShipCargo,
    transaction: ship_modification_transaction.ShipModificationTransaction,
  )
}

Constructors

pub type ShipMountInstalled {
  ShipMountInstalled(
    agent: agent.Agent,
    mounts: List(ship_mount.ShipMount),
    cargo: ship_cargo.ShipCargo,
    transaction: ship_modification_transaction.ShipModificationTransaction,
  )
}

Constructors

pub type ShipMountRemoved {
  ShipMountRemoved(
    agent: agent.Agent,
    mounts: List(ship_mount.ShipMount),
    cargo: ship_cargo.ShipCargo,
    transaction: ship_modification_transaction.ShipModificationTransaction,
  )
}

Constructors

pub type ShipNavPatched {
  ShipNavPatched(
    nav: ship_nav.ShipNav,
    fuel: ship_fuel.ShipFuel,
    events: List(ship_condition_event.ShipConditionEvent),
  )
}

Constructors

pub type ShipNavigated {
  ShipNavigated(
    nav: ship_nav.ShipNav,
    fuel: ship_fuel.ShipFuel,
    events: List(ship_condition_event.ShipConditionEvent),
  )
}

Constructors

pub type ShipPurchased {
  ShipPurchased(
    ship: ship.Ship,
    agent: agent.Agent,
    transaction: shipyard_transaction.ShipyardTransaction,
  )
}

Constructors

pub type ShipRefined {
  ShipRefined(
    cargo: ship_cargo.ShipCargo,
    cooldown: cooldown.Cooldown,
    produced: List(refinement_yield.RefinementYield),
    consumed: List(refinement_yield.RefinementYield),
  )
}

Constructors

pub type ShipRefueled {
  ShipRefueled(
    agent: agent.Agent,
    fuel: ship_fuel.ShipFuel,
    cargo: ship_cargo.ShipCargo,
    transaction: market_transaction.MarketTransaction,
  )
}

Constructors

pub type ShipRepaired {
  ShipRepaired(
    agent: agent.Agent,
    ship: ship.Ship,
    transaction: repair_transaction.RepairTransaction,
  )
}

Constructors

pub type ShipScrapped {
  ShipScrapped(
    agent: agent.Agent,
    transaction: scrap_transaction.ScrapTransaction,
  )
}

Constructors

pub type ShipWarped {
  ShipWarped(
    nav: ship_nav.ShipNav,
    fuel: ship_fuel.ShipFuel,
    events: List(ship_condition_event.ShipConditionEvent),
  )
}

Constructors

pub type Stats {
  Stats(
    accounts: option.Option(Int),
    agents: Int,
    ships: Int,
    systems: Int,
    waypoints: Int,
  )
}

Constructors

  • Stats(
      accounts: option.Option(Int),
      agents: Int,
      ships: Int,
      systems: Int,
      waypoints: Int,
    )
pub type SurveyCreated {
  SurveyCreated(
    cooldown: cooldown.Cooldown,
    surveys: List(survey.Survey),
  )
}

Constructors

Values

pub fn accept_contract(
  token: @internal AgentToken,
  contract_id: contract_id.ContractId,
) -> Result(ContractAccepted, @internal ApiError)
pub fn create_chart(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(ChartCreated, @internal ApiError)
pub fn create_survey(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(SurveyCreated, @internal ApiError)
pub fn deliver_contract_cargo(
  token: @internal AgentToken,
  contract_id: contract_id.ContractId,
  ship_symbol: ship_symbol.ShipSymbol,
  trade_symbol: trade_symbol.TradeSymbol,
  units: Int,
) -> Result(ContractCargoDelivered, @internal ApiError)
pub fn dock_ship(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(ship_nav.ShipNav, @internal ApiError)
pub fn extract_resources(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(ResourcesExtracted, @internal ApiError)
pub fn extract_resources_with_survey(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  survey: survey.Survey,
) -> Result(ResourcesExtracted, @internal ApiError)
pub fn fulfill_contract(
  token: @internal AgentToken,
  contract_id: contract_id.ContractId,
) -> Result(ContractFulfilled, @internal ApiError)
pub fn get_account(
  token: @internal AgentToken,
) -> Result(account.Account, @internal ApiError)
pub fn get_agent(
  token: @internal AgentToken,
) -> Result(agent.Agent, @internal ApiError)
pub fn get_agent_events(
  token: @internal AgentToken,
) -> Result(List(agent_event.AgentEvent), @internal ApiError)
pub fn get_construction_site(
  system_symbol: system_symbol.SystemSymbol,
  waypoint_symbol: waypoint_symbol.WaypointSymbol,
) -> Result(construction.Construction, @internal ApiError)
pub fn get_contract(
  token: @internal AgentToken,
  contract_id: contract_id.ContractId,
) -> Result(contract.Contract, @internal ApiError)
pub fn get_faction(
  symbol: faction_symbol.FactionSymbol,
) -> Result(faction.Faction, @internal ApiError)
pub fn get_jump_gate(
  system_symbol: system_symbol.SystemSymbol,
  waypoint_symbol: waypoint_symbol.WaypointSymbol,
) -> Result(jump_gate.JumpGate, @internal ApiError)
pub fn get_market(
  system_symbol: system_symbol.SystemSymbol,
  waypoint_symbol: waypoint_symbol.WaypointSymbol,
) -> Result(market.Market, @internal ApiError)
pub fn get_my_factions(
  token: @internal AgentToken,
  page: option.Option(Int),
  limit: option.Option(Int),
) -> Result(
  @internal PagedData(List(FactionReputation)),
  @internal ApiError,
)
pub fn get_public_agent(
  agent_symbol: agent_symbol.AgentSymbol,
) -> Result(public_agent.PublicAgent, @internal ApiError)
pub fn get_repair_ship(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(
  repair_transaction.RepairTransaction,
  @internal ApiError,
)
pub fn get_scrap_ship(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(
  scrap_transaction.ScrapTransaction,
  @internal ApiError,
)
pub fn get_server_status(
  ,
) -> Result(ServerStatus, @internal ApiError)
pub fn get_ship(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(ship.Ship, @internal ApiError)
pub fn get_ship_cargo(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(ship_cargo.ShipCargo, @internal ApiError)
pub fn get_ship_cooldown(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(option.Option(cooldown.Cooldown), @internal ApiError)
pub fn get_ship_modules(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(List(ship_module.ShipModule), @internal ApiError)
pub fn get_ship_mounts(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(List(ship_mount.ShipMount), @internal ApiError)
pub fn get_ship_nav(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(ship_nav.ShipNav, @internal ApiError)
pub fn get_shipyard(
  system_symbol: system_symbol.SystemSymbol,
  waypoint_symbol: waypoint_symbol.WaypointSymbol,
) -> Result(shipyard.Shipyard, @internal ApiError)
pub fn get_supply_chain(
  ,
) -> Result(
  dict.Dict(
    trade_symbol.TradeSymbol,
    List(trade_symbol.TradeSymbol),
  ),
  @internal ApiError,
)
pub fn get_system(
  system_symbol: system_symbol.SystemSymbol,
) -> Result(system.System, @internal ApiError)
pub fn get_waypoint(
  system_symbol: system_symbol.SystemSymbol,
  waypoint_symbol: waypoint_symbol.WaypointSymbol,
) -> Result(waypoint.Waypoint, @internal ApiError)
pub fn install_ship_module(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  module_symbol: module_symbol.ModuleSymbol,
) -> Result(ShipModuleInstalled, @internal ApiError)
pub fn install_ship_mount(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  mount_symbol: mount_symbol.MountSymbol,
) -> Result(ShipMountInstalled, @internal ApiError)
pub fn jettison_cargo(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  trade_symbol: trade_symbol.TradeSymbol,
  units: Int,
) -> Result(ship_cargo.ShipCargo, @internal ApiError)
pub fn jump_ship(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  waypoint_symbol: waypoint_symbol.WaypointSymbol,
) -> Result(ShipJumped, @internal ApiError)
pub fn list_contracts(
  token: @internal AgentToken,
  page: option.Option(Int),
  limit: option.Option(Int),
) -> Result(
  @internal PagedData(List(contract.Contract)),
  @internal ApiError,
)
pub fn list_error_codes(
  ,
) -> Result(List(ErrorCode), @internal ApiError)
pub fn list_factions(
  page: option.Option(Int),
  limit: option.Option(Int),
) -> Result(
  @internal PagedData(List(faction.Faction)),
  @internal ApiError,
)
pub fn list_public_agents(
  page: option.Option(Int),
  limit: option.Option(Int),
) -> Result(
  @internal PagedData(List(public_agent.PublicAgent)),
  @internal ApiError,
)
pub fn list_ships(
  token: @internal AgentToken,
  page: option.Option(Int),
  limit: option.Option(Int),
) -> Result(
  @internal PagedData(List(ship.Ship)),
  @internal ApiError,
)
pub fn list_system_waypoints(
  system_symbol: system_symbol.SystemSymbol,
  page: option.Option(Int),
  limit: option.Option(Int),
  type_: option.Option(waypoint_type.WaypointType),
  traits: List(waypoint_trait_symbol.WaypointTraitSymbol),
) -> Result(
  @internal PagedData(List(waypoint.Waypoint)),
  @internal ApiError,
)
pub fn list_systems(
  page: option.Option(Int),
  limit: option.Option(Int),
) -> Result(
  @internal PagedData(List(system.System)),
  @internal ApiError,
)
pub fn navigate_ship(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  waypoint_symbol: waypoint_symbol.WaypointSymbol,
) -> Result(ShipNavigated, @internal ApiError)
pub fn negotiate_contract(
  token: @internal AgentToken,
  ship_symbol: String,
) -> Result(contract.Contract, @internal ApiError)
pub fn orbit_ship(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(ship_nav.ShipNav, @internal ApiError)
pub fn patch_ship_nav(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  flight_mode: ship_nav_flight_mode.ShipNavFlightMode,
) -> Result(ShipNavPatched, @internal ApiError)
pub fn purchase_cargo(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  trade_symbol: trade_symbol.TradeSymbol,
) -> Result(CargoPurchased, @internal ApiError)
pub fn purchase_ship(
  token: @internal AgentToken,
  ship_type: ship_type.ShipType,
  waypoint_symbol: waypoint_symbol.WaypointSymbol,
) -> Result(ShipPurchased, @internal ApiError)
pub fn refine_ship(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  produce: refinement_produce.RefinementProduce,
) -> Result(ShipRefined, @internal ApiError)
pub fn refuel_ship(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  units: option.Option(Int),
  from_cargo: option.Option(Bool),
) -> Result(ShipRefueled, @internal ApiError)
pub fn register_new_agent(
  token: @internal AccountToken,
  agent_symbol: agent_symbol.AgentSymbol,
  faction_symbol: faction_symbol.FactionSymbol,
) -> Result(AgentRegistered, @internal ApiError)
pub fn remove_ship_module(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  module_symbol: module_symbol.ModuleSymbol,
) -> Result(ShipModuleRemoved, @internal ApiError)
pub fn remove_ship_mount(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  mount_symbol: mount_symbol.MountSymbol,
) -> Result(ShipMountRemoved, @internal ApiError)
pub fn repair_ship(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(ShipRepaired, @internal ApiError)
pub fn scan_ships(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(Scan(scanned_ship.ScannedShip), @internal ApiError)
pub fn scan_systems(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(
  Scan(scanned_system.ScannedSystem),
  @internal ApiError,
)
pub fn scan_waypoints(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(
  Scan(scanned_waypoint.ScannedWaypoint),
  @internal ApiError,
)
pub fn scrap_ship(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(ShipScrapped, @internal ApiError)
pub fn sell_cargo(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  trade_symbol: trade_symbol.TradeSymbol,
  units: Int,
) -> Result(CargoSold, @internal ApiError)
pub fn siphon_resources(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(ResourcesSiphoned, @internal ApiError)
pub fn supply_construction_site(
  system_symbol: system_symbol.SystemSymbol,
  waypoint_symbol: waypoint_symbol.WaypointSymbol,
  ship_symbol: ship_symbol.ShipSymbol,
  trade_symbol: trade_symbol.TradeSymbol,
  units: Int,
) -> Result(ConstructionSiteSupplied, @internal ApiError)
pub fn transfer_cargo(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  trade_symbol: trade_symbol.TradeSymbol,
  units: Int,
  target_ship_symbol: ship_symbol.ShipSymbol,
) -> Result(CargoTransferred, @internal ApiError)
pub fn warp_ship(
  token: @internal AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  waypoint_symbol: waypoint_symbol.WaypointSymbol,
) -> Result(ShipWarped, @internal ApiError)
Search Document