@axis-markets/client 0.9.0 → 0.9.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axis-markets/client",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "AXIS contract and API client",
5
5
  "author": "team@stellar.expert",
6
6
  "license": "MIT",
package/src/api-client.js CHANGED
@@ -248,9 +248,11 @@ export class AxisApiClient {
248
248
  * @typedef {{}} QuotePathStep
249
249
  * @property {string} selling - Selling asset contract id at this hop
250
250
  * @property {string} buying - Buying asset contract id at this hop
251
- * @property {string[]} orders - Maker order IDs matched at this hop
252
- * @property {string} [worstPrice] - Highest price among the matched orders (maker `buying` per `selling`, 18 decimals):
253
- * a trade limit at this price crosses every listed order
251
+ * @property {string[]} orders - Maker order IDs to pass to the contract: the orders the quote fills, followed on a
252
+ * direct route by spare orders the contract reaches only when it passes over one of them (at most 19 in all)
253
+ * @property {string} [worstPrice] - Highest price among the orders the quote fills (maker `buying` per `selling`, 18
254
+ * decimals): a trade limit at this price crosses them all. Spares are priced at or below it, except in a `maxPrice`
255
+ * crossing, where they reach up to `maxPrice`
254
256
  */
255
257
 
256
258
  /**
@@ -325,9 +327,22 @@ export class AxisApiClient {
325
327
  /**
326
328
  * @typedef {{}} ContractInfo - Contract state tracked by the indexer
327
329
  * @property {string} address - AXIS contract address
330
+ * @property {'mainnet'|'testnet'} [network] - Stellar network of the contract
328
331
  * @property {boolean} frozen - Whether trading is blocked by the safety admin
329
332
  * @property {ContractInfoConfig} [config] - Contract configuration
330
333
  * @property {ContractInfoMarket[]} markets - Markets opened by `subsidize`
334
+ * @property {ContractInfoAsset[]} [assets] - Metadata of the market tokens
335
+ */
336
+
337
+ /**
338
+ * @typedef {{}} ContractInfoAsset - Market token metadata (only `contract` until the AXIS API resolves it)
339
+ * @property {string} contract - Token contract address
340
+ * @property {string} [code] - Asset code (token symbol)
341
+ * @property {string} [issuer] - Issuer account of a classic asset, `native` for XLM, absent for a SEP-41 token
342
+ * @property {number} [decimals] - Token decimals
343
+ * @property {string} [name] - Asset name
344
+ * @property {string} [domain] - Home domain of the issuer
345
+ * @property {string} [icon] - Icon URL
331
346
  */
332
347
 
333
348
  /**
package/src/index.d.ts CHANGED
@@ -533,9 +533,9 @@ export interface QuotePathStep {
533
533
  selling: string;
534
534
  /** Buying asset contract id at this hop */
535
535
  buying: string;
536
- /** Maker order IDs matched at this hop */
536
+ /** Maker order IDs to pass to the contract: the orders the quote fills, followed on a direct route by spare orders the contract reaches only when it passes over one of them (at most 19 in all) */
537
537
  orders: string[];
538
- /** Highest price among the matched orders (maker `buying` per `selling`, 18 decimals): a trade limit at this price crosses every listed order */
538
+ /** Highest price among the orders the quote fills (maker `buying` per `selling`, 18 decimals): a trade limit at this price crosses them all. Spares are priced at or below it, except in a `maxPrice` crossing, where they reach up to `maxPrice` */
539
539
  worstPrice?: string;
540
540
  }
541
541
 
@@ -687,16 +687,38 @@ export interface ContractInfoMarket {
687
687
  refreshed: string;
688
688
  }
689
689
 
690
+ /** Market token metadata (only `contract` until the AXIS API resolves it) */
691
+ export interface ContractInfoAsset {
692
+ /** Token contract address */
693
+ contract: string;
694
+ /** Asset code (token symbol) */
695
+ code?: string;
696
+ /** Issuer account of a classic asset, `native` for XLM, absent for a SEP-41 token */
697
+ issuer?: string;
698
+ /** Token decimals */
699
+ decimals?: number;
700
+ /** Asset name */
701
+ name?: string;
702
+ /** Home domain of the issuer */
703
+ domain?: string;
704
+ /** Icon URL */
705
+ icon?: string;
706
+ }
707
+
690
708
  /** Contract state tracked by the indexer */
691
709
  export interface ContractInfo {
692
710
  /** AXIS contract address */
693
711
  address: string;
712
+ /** Stellar network of the contract */
713
+ network?: 'mainnet' | 'testnet';
694
714
  /** Whether trading is blocked by the safety admin */
695
715
  frozen: boolean;
696
716
  /** Contract configuration */
697
717
  config?: ContractInfoConfig;
698
718
  /** Markets opened by `subsidize` */
699
719
  markets: ContractInfoMarket[];
720
+ /** Metadata of the market tokens */
721
+ assets?: ContractInfoAsset[];
700
722
  }
701
723
 
702
724
  export interface OrdersParams {