Skip to content

Commit

Permalink
Changing symbol to a getter function
Browse files Browse the repository at this point in the history
  • Loading branch information
ekenigs committed Jul 2, 2024
1 parent 95e52db commit 463af19
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/types/src/asset/ChainAsset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class ChainAsset extends Asset {

readonly min?: bigint;

readonly symbol?: string;
readonly #symbol?: string;

constructor({
address,
Expand All @@ -47,7 +47,7 @@ export class ChainAsset extends Asset {
this.decimals = decimals;
this.ids = ids;
this.min = min ? toBigInt(min, decimals) : undefined;
this.symbol = symbol;
this.#symbol = symbol;
}

static fromAsset(
Expand All @@ -60,6 +60,10 @@ export class ChainAsset extends Asset {
});
}

get symbol(): string {
return this.#symbol || this.originSymbol;
}

getAssetId(): ChainAssetId {
return this.ids?.id ?? this.originSymbol;
}
Expand Down

0 comments on commit 463af19

Please sign in to comment.