Skip to content

Commit

Permalink
Create getFees() method
Browse files Browse the repository at this point in the history
  • Loading branch information
bathord committed Apr 11, 2024
1 parent 1a1c405 commit 37c4360
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/providers/turbos/turbos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ export class TurbosSingleton extends EventEmitter implements IPoolProvider<Turbo
* @throws {Error} If the fee for the specified tick spacing is undefined.
*/
public async getFeeObject(tickSpacing: number): Promise<Contract.Fee> {
const fees = await this.turbosSdk.contract.getFees();
const fees = await this.getFees();
const fee = fees.find((feeObject) => feeObject.tickSpacing === tickSpacing);

if (fee === undefined) {
Expand All @@ -568,6 +568,15 @@ export class TurbosSingleton extends EventEmitter implements IPoolProvider<Turbo
return fee;
}

/**
* Retrieves the fees associated with the contract.
*
* @return {Promise<Contract.Fee[]>} A promise that resolves to an array of fee objects.
*/
public async getFees(): Promise<Contract.Fee[]> {
return await this.turbosSdk.contract.getFees();
}

/**
* Retrieves the global liquidity tick range for the specified tick spacing.
*
Expand Down

0 comments on commit 37c4360

Please sign in to comment.