endpoints/contracts
Types
pub type ContractAccepted {
ContractAccepted(
contract: contract.Contract,
agent: agent.Agent,
)
}
Constructors
-
ContractAccepted(contract: contract.Contract, agent: agent.Agent)
pub type ContractCargoDelivered {
ContractCargoDelivered(
contract: contract.Contract,
cargo: ship_cargo.ShipCargo,
)
}
Constructors
-
ContractCargoDelivered( contract: contract.Contract, cargo: ship_cargo.ShipCargo, )
pub type ContractFulfilled {
ContractFulfilled(
contract: contract.Contract,
agent: agent.Agent,
)
}
Constructors
-
ContractFulfilled( contract: contract.Contract, agent: agent.Agent, )
Values
pub fn accept_contract(
token: auth.AgentToken,
contract_id: contract_id.ContractId,
) -> Result(ContractAccepted, api.ApiError)
pub fn deliver_contract_cargo(
token: auth.AgentToken,
contract_id: contract_id.ContractId,
ship_symbol: ship_symbol.ShipSymbol,
trade_symbol: trade_symbol.TradeSymbol,
units: Int,
) -> Result(ContractCargoDelivered, api.ApiError)
pub fn fulfill_contract(
token: auth.AgentToken,
contract_id: contract_id.ContractId,
) -> Result(ContractFulfilled, api.ApiError)
pub fn get_contract(
token: auth.AgentToken,
contract_id: contract_id.ContractId,
) -> Result(contract.Contract, api.ApiError)
pub fn list_contracts(
token: auth.AgentToken,
page: option.Option(Int),
limit: option.Option(Int),
) -> Result(api.PagedData(List(contract.Contract)), api.ApiError)
pub const negotiate_contract: fn(auth.AgentToken, String) -> Result(
contract.Contract,
api.ApiError,
)