@trinaryex/sdk 3.7.0 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/DESIGN.md CHANGED
@@ -261,6 +261,14 @@ client.market.assembliesEnriched({ assemblyIds }): Promise<AssemblyEnriched[]> /
261
261
  client.market.solarSystemNames({ solarSystemIds }): Promise<SolarSystemName[]> // batch ≤200
262
262
  client.account.owners({ balanceManagerIds }): Promise<BalanceManagerOwner[]> // batch ≤200: player:/ou: tagged
263
263
 
264
+ // spatial — the star map (Universe | Solar Systems); no account or signer
265
+ client.spatial.system(nameOrId): Promise<SolarSystem> // coords + constellation + region
266
+ client.spatial.systems({ solarSystemIds | solarSystemNames }): Promise<BatchSystems> // max 100, ids XOR names
267
+ client.spatial.nearbySystems({ solarSystem, radiusLy, limit? }): Promise<NearbySystems> // origin excluded
268
+ client.spatial.systemsNearCoordinates({ x, y, z, radiusLy, limit? }): Promise<CoordinateSearch>
269
+ client.spatial.autocompleteSystems(query, opts?): Promise<AutocompleteSystems> // prefix index, ids only
270
+ client.spatial.stats(): Promise<SpatialStats> // star-map coverage
271
+
264
272
  // order status (#14) — epoch-ms before/after paging
265
273
  client.orders.openOrders(params?): Promise<OpenOrdersPage>
266
274
  client.orders.fills(params?): Promise<FillsPage>
package/README.md CHANGED
@@ -208,6 +208,7 @@ explainMoveAbort(rawError) // "No liquidity available (EEmptyOrderbook)" | null
208
208
  | `market` | `discover` · `hub` · `itemsAtHub` · `resolvePool` · `orderbook` · `poolMetadata` |
209
209
  | `market` (locations) | `hubLocations` · `itemLocations` · `nearbyHubs` · `nearbyHubsBySystem` · `hubsEnriched` · `assemblyOwners` · `assembliesEnriched` · `solarSystemNames` |
210
210
  | `orders` | `limit` · `market` · `cancel` · `cancelAll` · `modify` · `openOrders` · `fills` · `trades` |
211
+ | `spatial` | `system` · `systems` · `nearbySystems` · `systemsNearCoordinates` · `autocompleteSystems` · `stats` |
211
212
  | helpers | `aggregateLevels` · `midPrice` · `spread` · `depth` · `vwap` · `estimateMarketBuyCost` · `iterateDiscovery/Fills/Trades` · `untilIndexed` · `explainMoveAbort` · `toBase` / `fromBase` |
212
213
 
213
214
  Runnable examples live in [`examples/`](./examples).
@@ -1,5 +1,5 @@
1
1
  import { IndexerClient } from './queries';
2
- import { AssemblyEnriched, AssemblyOwner, BalanceManagerOwner, BalancesAtHubParams, DiscoveryFilters, DiscoveryResult, FillsPage, FillsParams, HistoryPageParams, HubEnriched, HubItemOrderbook, HubItemsPage, HubLocationFilters, HubLocationPage, ItemSearchPage, InventoryBalances, LocationPageParams, NearbyHub, NearbyHubsParams, NearbyHubsBySystemParams, OpenOrdersPage, PackageIds, PoolMetadata, ReadOnlyClientConfig, SolarSystemName, Sweepable, TradeHubDetail, TradesPage, TradesParams } from './types';
2
+ import { AssemblyEnriched, AssemblyOwner, AutocompleteSystems, BalanceManagerOwner, BatchSystems, BatchSystemsParams, CoordinateSearch, CoordinateSearchParams, BalancesAtHubParams, DiscoveryFilters, DiscoveryResult, FillsPage, FillsParams, HistoryPageParams, HubEnriched, HubItemOrderbook, HubItemsPage, HubLocationFilters, HubLocationPage, ItemSearchPage, InventoryBalances, LocationPageParams, NearbyHub, NearbyHubsParams, NearbyHubsBySystemParams, NearbySystems, NearbySystemsParams, OpenOrdersPage, PackageIds, PoolMetadata, ReadOnlyClientConfig, SolarSystem, SolarSystemName, SpatialStats, Sweepable, TradeHubDetail, TradesPage, TradesParams } from './types';
3
3
  export declare class ReadOnlyClient {
4
4
  readonly ids: PackageIds;
5
5
  readonly indexer: IndexerClient;
@@ -38,6 +38,14 @@ export declare class ReadOnlyClient {
38
38
  accountOwners(params: {
39
39
  balanceManagerIds: string[];
40
40
  }): Promise<BalanceManagerOwner[]>;
41
+ spatialSystem(solarSystem: string): Promise<SolarSystem>;
42
+ spatialSystems(params: BatchSystemsParams): Promise<BatchSystems>;
43
+ spatialNearbySystems(params: NearbySystemsParams): Promise<NearbySystems>;
44
+ spatialSystemsNearCoordinates(params: CoordinateSearchParams): Promise<CoordinateSearch>;
45
+ spatialAutocompleteSystems(query: string, opts?: {
46
+ limit?: number;
47
+ }): Promise<AutocompleteSystems>;
48
+ spatialStats(): Promise<SpatialStats>;
41
49
  balancesAtHub(params: BalancesAtHubParams & {
42
50
  balanceManagerId?: string;
43
51
  }): Promise<InventoryBalances>;
@@ -1,7 +1,7 @@
1
1
  import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
2
2
  import { ClientWithCoreApi } from '@mysten/sui/client';
3
3
  import { IndexerClient } from './queries';
4
- import { AssemblyEnriched, AssemblyOwner, BalanceManagerOwner, BalancesAtHubParams, CancelAllOrdersParams, CancelOrderParams, ClaimSettledParams, CurrencyBalances, DepositCurrencyParams, DepositItemsParams, DiscoveryFilters, DiscoveryResult, EnsureAccountResult, FillsPage, FillsParams, HistoryPageParams, HubEnriched, HubItemOrderbook, HubItemsPage, HubLocationFilters, HubLocationPage, ItemSearchPage, InventoryBalances, LimitOrderParams, LocationPageParams, MarketOrderParams, ModifyOrderParams, NearbyHub, NearbyHubsParams, NearbyHubsBySystemParams, OpenOrdersPage, PackageIds, PoolMetadata, SolarSystemName, Sweepable, TradeHubDetail, TradesPage, TradesParams, TradingAccount, TransactionExecutor, TriexClientConfig, TxResult, WithdrawCurrencyParams, WithdrawItemsParams } from './types';
4
+ import { AssemblyEnriched, AssemblyOwner, AutocompleteSystems, BalanceManagerOwner, BatchSystems, BatchSystemsParams, CoordinateSearch, CoordinateSearchParams, BalancesAtHubParams, CancelAllOrdersParams, CancelOrderParams, ClaimSettledParams, CurrencyBalances, DepositCurrencyParams, DepositItemsParams, DiscoveryFilters, DiscoveryResult, EnsureAccountResult, FillsPage, FillsParams, HistoryPageParams, HubEnriched, HubItemOrderbook, HubItemsPage, HubLocationFilters, HubLocationPage, ItemSearchPage, InventoryBalances, LimitOrderParams, LocationPageParams, MarketOrderParams, ModifyOrderParams, NearbyHub, NearbyHubsParams, NearbyHubsBySystemParams, NearbySystems, NearbySystemsParams, OpenOrdersPage, PackageIds, PoolMetadata, SolarSystem, SolarSystemName, SpatialStats, Sweepable, TradeHubDetail, TradesPage, TradesParams, TradingAccount, TransactionExecutor, TriexClientConfig, TxResult, WithdrawCurrencyParams, WithdrawItemsParams } from './types';
5
5
  export declare class TriexClient {
6
6
  readonly suiClient: ClientWithCoreApi;
7
7
  readonly ids: PackageIds;
@@ -13,6 +13,7 @@ export declare class TriexClient {
13
13
  readonly balances: BalancesApi;
14
14
  readonly market: MarketApi;
15
15
  readonly orders: OrdersApi;
16
+ readonly spatial: SpatialApi;
16
17
  constructor(config: TriexClientConfig);
17
18
  requireExecutor(): TransactionExecutor;
18
19
  requireAddress(override?: string): string;
@@ -84,6 +85,18 @@ declare class MarketApi {
84
85
  solarSystemIds: number[];
85
86
  }): Promise<SolarSystemName[]>;
86
87
  }
88
+ declare class SpatialApi {
89
+ private readonly c;
90
+ constructor(c: TriexClient);
91
+ system(solarSystem: string): Promise<SolarSystem>;
92
+ systems(params: BatchSystemsParams): Promise<BatchSystems>;
93
+ nearbySystems(params: NearbySystemsParams): Promise<NearbySystems>;
94
+ systemsNearCoordinates(params: CoordinateSearchParams): Promise<CoordinateSearch>;
95
+ autocompleteSystems(query: string, opts?: {
96
+ limit?: number;
97
+ }): Promise<AutocompleteSystems>;
98
+ stats(): Promise<SpatialStats>;
99
+ }
87
100
  declare class OrdersApi {
88
101
  private readonly c;
89
102
  constructor(c: TriexClient);
@@ -100,4 +113,4 @@ declare class OrdersApi {
100
113
  private depositQuoteDeficit;
101
114
  private beginCancelTx;
102
115
  }
103
- export type { AccountApi, BalancesApi, MarketApi, OrdersApi };
116
+ export type { AccountApi, BalancesApi, MarketApi, OrdersApi, SpatialApi };
package/dist/errors.d.ts CHANGED
@@ -12,6 +12,7 @@ export declare enum TriexError {
12
12
  BalanceManagerNotFound = "TRIEX_BALANCE_MANAGER_NOT_FOUND",
13
13
  PoolNotFound = "TRIEX_POOL_NOT_FOUND",
14
14
  HubNotFound = "TRIEX_HUB_NOT_FOUND",
15
+ SolarSystemNotFound = "TRIEX_SOLAR_SYSTEM_NOT_FOUND",
15
16
  CharacterNotFound = "TRIEX_CHARACTER_NOT_FOUND",
16
17
  TransactionFailed = "TRIEX_TRANSACTION_FAILED",
17
18
  Timeout = "TRIEX_TIMEOUT",
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { TriexClient } from './TriexClient';
2
- export type { AccountApi, BalancesApi, MarketApi, OrdersApi, } from './TriexClient';
2
+ export type { AccountApi, BalancesApi, MarketApi, OrdersApi, SpatialApi, } from './TriexClient';
3
3
  export { ReadOnlyClient } from './ReadOnlyClient';
4
4
  export { TriexError, TriexClientError, explainMoveAbort } from './errors';
5
5
  export { DEFAULT_INDEXER_URL, CLOCK_ID, STILLNESS_PACKAGE_IDS, NETWORK_PRESETS, resolvePackageIds, } from './config';
@@ -15,5 +15,5 @@ export type { BookLevel } from './book';
15
15
  export { iterateDiscovery, iterateFills, iterateTrades } from './paging';
16
16
  export type { IterateOptions } from './paging';
17
17
  export { untilIndexed } from './wait';
18
- export type { TriexNetwork, PackageIds, TriexClientConfig, ReadOnlyClientConfig, TransactionExecutor, ObjectChange, TxResult, OrderSide, TradingAccount, CurrencyBalances, AssetBalance, InventoryBalances, TradeHubDetail, HubVaultInfo, HubLocation, HubLocationPage, HubLocationFilters, LocationPageParams, NearbyHub, NearbyHubsParams, NearbyHubsBySystemParams, HubEnriched, AssemblyOwner, AssemblyEnriched, BalanceManagerOwner, SolarSystemName, HubItem, HubItemsPage, ItemRecipe, ItemRecipeComponent, ItemSearchPage, ItemSearchResult, CollectionHub, Orderbook, HubItemOrderbook, HubItemMarket, OrderbookOrder, PoolMetadata, DiscoveryOrder, DiscoveryResult, DiscoveryFilters, OpenOrder, OpenOrdersPage, Fill, FillsPage, Trade, TradesPage, BalancesAtHubParams, HistoryPageParams, FillsParams, TradesParams, Sweepable, SweepablePool, SweepableItem, EnsureAccountResult, DepositCurrencyParams, DepositItemsParams, WithdrawCurrencyParams, WithdrawItemsParams, LimitOrderParams, MarketOrderParams, CancelOrderParams, CancelAllOrdersParams, ModifyOrderParams, ClaimSettledParams, } from './types';
18
+ export type { TriexNetwork, PackageIds, TriexClientConfig, ReadOnlyClientConfig, TransactionExecutor, ObjectChange, TxResult, OrderSide, TradingAccount, CurrencyBalances, AssetBalance, InventoryBalances, TradeHubDetail, HubVaultInfo, HubLocation, HubLocationPage, HubLocationFilters, LocationPageParams, NearbyHub, NearbyHubsParams, NearbyHubsBySystemParams, HubEnriched, AssemblyOwner, AssemblyEnriched, BalanceManagerOwner, SolarSystemName, Coordinates, SolarSystem, SolarSystemSuggestion, NearbySystem, NearbySystems, NearbySystemsParams, BatchSystems, BatchSystemsParams, CoordinateSearch, CoordinateSearchParams, AutocompleteSystems, SpatialStats, HubItem, HubItemsPage, ItemRecipe, ItemRecipeComponent, ItemSearchPage, ItemSearchResult, CollectionHub, Orderbook, HubItemOrderbook, HubItemMarket, OrderbookOrder, PoolMetadata, DiscoveryOrder, DiscoveryResult, DiscoveryFilters, OpenOrder, OpenOrdersPage, Fill, FillsPage, Trade, TradesPage, BalancesAtHubParams, HistoryPageParams, FillsParams, TradesParams, Sweepable, SweepablePool, SweepableItem, EnsureAccountResult, DepositCurrencyParams, DepositItemsParams, WithdrawCurrencyParams, WithdrawItemsParams, LimitOrderParams, MarketOrderParams, CancelOrderParams, CancelAllOrdersParams, ModifyOrderParams, ClaimSettledParams, } from './types';
19
19
  export type { OwnedItemReceipt, CharacterInfo, SsuOwnerInfo, ObjectRef, } from './onchain';