diff options
author | Julien Dessaux | 2024-04-05 00:42:30 +0200 |
---|---|---|
committer | Julien Dessaux | 2024-04-07 23:01:52 +0200 |
commit | 234770b611df32178382b557df396db220070a7f (patch) | |
tree | 8c768846716eaf892ff75abe84d0f5c00e8519ff /nodejs/lib/errors.ts | |
parent | [node] Fixed basic procurement trading loop (diff) | |
download | spacetraders-234770b611df32178382b557df396db220070a7f.tar.gz spacetraders-234770b611df32178382b557df396db220070a7f.tar.bz2 spacetraders-234770b611df32178382b557df396db220070a7f.zip |
[node] Big Ships lib refactoring
Diffstat (limited to '')
-rw-r--r-- | nodejs/lib/errors.ts | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/nodejs/lib/errors.ts b/nodejs/lib/errors.ts new file mode 100644 index 0000000..f9dca89 --- /dev/null +++ b/nodejs/lib/errors.ts @@ -0,0 +1,35 @@ +import { Cooldown } from './types.ts'; + +export type MarketTradeVolumeError = { + waypointSymbol: string; + tradeSymbol: string; + units: number; + tradeVolume: number; +}; + +export type RateLimitError = { + type: string; + retryAfter: number; + limitBurst: number; + limitPerSecond: number; + remaining: number; + reset: Date; +}; + +export type ShipIsCurrentlyInTransitError = { + arrival: Date; + departureSymbol: string; + departureTime: Date; + destinationSymbol: string; + secondsToArrival: number; +}; + +export type ShipIsStillOnCooldownError = { + cooldown: Cooldown; +}; + +export type ShipRequiresMoreFuelForNavigationError = { + fuelAvailable: number; + fuelRequired: number; + shipSymbol: string; +}; |