@aurigami/sdk 1.8.4 → 1.8.5
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/dist/entities/tokenAmount.d.ts +3 -2
- package/dist/sdk.cjs.development.js +7 -3
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +7 -3
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/entities/tokenAmount.ts +7 -3
package/package.json
CHANGED
|
@@ -16,12 +16,16 @@ export class TokenAmount {
|
|
|
16
16
|
this.token = token;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
public formattedAmount(): string {
|
|
19
|
+
public formattedAmount(decimal?: number, fmt?: BigNumber.Format): string {
|
|
20
|
+
if (decimal && fmt) {
|
|
21
|
+
return new BigNumber(this.rawAmnt).div(decimalFactor(decimal)).toFormat(decimal, fmt);
|
|
22
|
+
}
|
|
23
|
+
|
|
20
24
|
return new BigNumber(this.rawAmnt).div(decimalFactor(this.token.decimals)).toString();
|
|
21
25
|
}
|
|
22
26
|
|
|
23
|
-
public formattedAmountWithSymbol(): string {
|
|
24
|
-
return `${this.formattedAmount()} ${getSymbol(this.token.address)}`;
|
|
27
|
+
public formattedAmountWithSymbol(decimal?: number, fmt?: BigNumber.Format): string {
|
|
28
|
+
return `${this.formattedAmount(decimal, fmt)} ${getSymbol(this.token.address)}`;
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
public rawAmount(): string {
|