@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.
- package/build/entities/baseCurrency.d.ts +1 -0
- package/build/entities/baseCurrency.js +1 -0
- package/build/entities/token.d.ts +0 -2
- package/build/entities/token.js +0 -4
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/package.json +1 -1
- package/src/entities/baseCurrency.ts +3 -0
- package/src/entities/token.ts +0 -5
|
@@ -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
|
|
@@ -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
|
package/build/entities/token.js
CHANGED
|
@@ -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
|
package/build/utils/index.d.ts
CHANGED
package/build/utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -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
|
/**
|
package/src/entities/token.ts
CHANGED
|
@@ -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
|