endpoints/contracts
Types
pub type AcceptContractResponse {
AcceptContractResponse(
contract: contract.Contract,
agent: agent.Agent,
)
}
Constructors
-
AcceptContractResponse( contract: contract.Contract, agent: agent.Agent, )
pub type DeliverContractCargoResponse {
DeliverContractCargoResponse(
contract: contract.Contract,
cargo: ship_cargo.ShipCargo,
)
}
Constructors
-
DeliverContractCargoResponse( contract: contract.Contract, cargo: ship_cargo.ShipCargo, )
pub type FulfillContractResponse {
FulfillContractResponse(
contract: contract.Contract,
agent: agent.Agent,
)
}
Constructors
-
FulfillContractResponse( contract: contract.Contract, agent: agent.Agent, )
pub type GetContractResponse {
GetContractResponse(contract: contract.Contract)
}
Constructors
-
GetContractResponse(contract: contract.Contract)
pub type ListContractsResponse {
ListContractsResponse(contracts: List(contract.Contract))
}
Constructors
-
ListContractsResponse(contracts: List(contract.Contract))
Values
pub fn accept_contract(
token: auth.AgentToken,
contract_id: contract_id.ContractId,
) -> Result(AcceptContractResponse, 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(DeliverContractCargoResponse, api.ApiError)
pub fn fulfill_contract(
token: auth.AgentToken,
contract_id: contract_id.ContractId,
) -> Result(FulfillContractResponse, api.ApiError)
pub fn get_contract(
token: auth.AgentToken,
contract_id: contract_id.ContractId,
) -> Result(GetContractResponse, api.ApiError)
pub fn list_contracts(
token: auth.AgentToken,
page: option.Option(Int),
limit: option.Option(Int),
) -> Result(api.PagedData(ListContractsResponse), api.ApiError)
pub const negotiate_contract: fn(auth.AgentToken, String) -> Result(
fleet.NegotiateContractResponse,
api.ApiError,
)