@alcorexchange/alcor-swap-sdk 1.0.13 → 1.0.16

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.
@@ -15,6 +15,7 @@ export declare abstract class BaseCurrency {
15
15
  * The symbol of the currency, i.e. a short textual non-unique identifier
16
16
  */
17
17
  readonly symbol: string;
18
+ readonly id: string;
18
19
  /**
19
20
  * Constructs an instance of the base class `BaseCurrency`.
20
21
  * @param chainId the chain ID on which this currency resides
@@ -21,6 +21,7 @@ class BaseCurrency {
21
21
  this.contract = contract;
22
22
  this.decimals = decimals;
23
23
  this.symbol = symbol;
24
+ this.id = symbol.toLowerCase() + '-' + contract;
24
25
  }
25
26
  }
26
27
  exports.BaseCurrency = BaseCurrency;
@@ -7,11 +7,9 @@ export declare class Token extends BaseCurrency {
7
7
  * @param contract {@link BaseCurrency#contract}
8
8
  * @param decimals {@link BaseCurrency#decimals}
9
9
  * @param symbol {@link BaseCurrency#symbol}
10
- * @param id {@link BaseCurrency#id}
11
10
  */
12
11
  constructor(contract: string, decimals: number, symbol: string);
13
12
  get name(): string;
14
- get id(): string;
15
13
  /**
16
14
  * Returns true if the two tokens are equivalent, i.e. have the same contract and symbol.
17
15
  * @param other other token to compare
@@ -15,7 +15,6 @@ class Token extends baseCurrency_1.BaseCurrency {
15
15
  * @param contract {@link BaseCurrency#contract}
16
16
  * @param decimals {@link BaseCurrency#decimals}
17
17
  * @param symbol {@link BaseCurrency#symbol}
18
- * @param id {@link BaseCurrency#id}
19
18
  */
20
19
  constructor(contract, decimals, symbol) {
21
20
  super(contract, decimals, symbol);
@@ -24,9 +23,6 @@ class Token extends baseCurrency_1.BaseCurrency {
24
23
  console.warn('Token.name is deprecated, use token.id');
25
24
  return this.symbol.toLowerCase() + '-' + this.contract;
26
25
  }
27
- get id() {
28
- return this.symbol.toLowerCase() + '-' + this.contract;
29
- }
30
26
  /**
31
27
  * Returns true if the two tokens are equivalent, i.e. have the same contract and symbol.
32
28
  * @param other other token to compare
@@ -12,3 +12,4 @@ export * from "./tickList";
12
12
  export * from "./priceTickConversions";
13
13
  export * from "./sqrtPriceMath";
14
14
  export * from "./sortedInsert";
15
+ export * from "./computeAllRoutes";
@@ -28,3 +28,4 @@ __exportStar(require("./tickList"), exports);
28
28
  __exportStar(require("./priceTickConversions"), exports);
29
29
  __exportStar(require("./sqrtPriceMath"), exports);
30
30
  __exportStar(require("./sortedInsert"), exports);
31
+ __exportStar(require("./computeAllRoutes"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alcorexchange/alcor-swap-sdk",
3
- "version": "1.0.13",
3
+ "version": "1.0.16",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -18,6 +18,8 @@ export abstract class BaseCurrency {
18
18
  */
19
19
  public readonly symbol: string;
20
20
 
21
+ public readonly id: string;
22
+
21
23
  /**
22
24
  * Constructs an instance of the base class `BaseCurrency`.
23
25
  * @param chainId the chain ID on which this currency resides
@@ -37,6 +39,7 @@ export abstract class BaseCurrency {
37
39
  this.contract = contract;
38
40
  this.decimals = decimals;
39
41
  this.symbol = symbol;
42
+ this.id = symbol.toLowerCase() + '-' + contract
40
43
  }
41
44
 
42
45
  /**
@@ -10,7 +10,6 @@ export class Token extends BaseCurrency {
10
10
  * @param contract {@link BaseCurrency#contract}
11
11
  * @param decimals {@link BaseCurrency#decimals}
12
12
  * @param symbol {@link BaseCurrency#symbol}
13
- * @param id {@link BaseCurrency#id}
14
13
  */
15
14
  public constructor(
16
15
  contract: string,
@@ -25,10 +24,6 @@ export class Token extends BaseCurrency {
25
24
  return this.symbol.toLowerCase() + '-' + this.contract
26
25
  }
27
26
 
28
- public get id(): string {
29
- return this.symbol.toLowerCase() + '-' + this.contract
30
- }
31
-
32
27
  /**
33
28
  * Returns true if the two tokens are equivalent, i.e. have the same contract and symbol.
34
29
  * @param other other token to compare