diff --git a/examples/build-tx-example.ts b/examples/build-tx-example.ts index 8568fa4..5c34a31 100644 --- a/examples/build-tx-example.ts +++ b/examples/build-tx-example.ts @@ -776,7 +776,7 @@ export async function _multiRoutingTxExample( }); } -export async function _cancelV2TxExample( +export function _cancelV2TxExample( lucid: Lucid, adapter: Adapter ): Promise { @@ -1032,7 +1032,7 @@ export async function _zapOutStableExample( }); } -export async function _bulkOrderStableExample( +export function _bulkOrderStableExample( lucid: Lucid, address: string, availableUtxos: Utxo[] diff --git a/src/dao.ts b/src/dao.ts index 45dc91e..2f2c918 100644 --- a/src/dao.ts +++ b/src/dao.ts @@ -41,7 +41,7 @@ export class Dao { * This method builds a transaction with metadata that requests fee changes for a pool. * The transaction must be signed by the pool manager address. */ - async updatePoolFeeTx( + updatePoolFeeTx( options: Omit ): Promise { const { managerAddress, poolLPAsset, newFeeA, newFeeB } = options; diff --git a/src/dex-v2.ts b/src/dex-v2.ts index 27b34c3..c83865b 100644 --- a/src/dex-v2.ts +++ b/src/dex-v2.ts @@ -743,7 +743,7 @@ export class DexV2 { } } - async createBulkOrdersTx({ + createBulkOrdersTx({ sender, orderOptions, expiredOptions, diff --git a/src/syncer/main.ts b/src/syncer/main.ts index f2bfc89..826d33c 100644 --- a/src/syncer/main.ts +++ b/src/syncer/main.ts @@ -33,7 +33,7 @@ async function start(): Promise { } } -async function main(): Promise { +function main(): Promise { return backOff(start, { retry(err, attempt): boolean { console.error(`Fail to run syncer, retry ${attempt}...`, err); diff --git a/src/syncer/repository/postgres-repository.ts b/src/syncer/repository/postgres-repository.ts index d83b9ea..45dacd0 100644 --- a/src/syncer/repository/postgres-repository.ts +++ b/src/syncer/repository/postgres-repository.ts @@ -342,7 +342,7 @@ export class PostgresRepositoryWriter extends PostgresRepositoryWriterInTransact this.prismaClientTx = prismaClient; } - async transaction( + transaction( fn: (repo: PostgresRepositoryWriterInTransaction) => Promise, options: { timeout?: number; maxWait?: number }, ): Promise { @@ -352,4 +352,3 @@ export class PostgresRepositoryWriter extends PostgresRepositoryWriterInTransact ); } } - diff --git a/src/utils/job.ts b/src/utils/job.ts index 2fb8e9d..b85376d 100644 --- a/src/utils/job.ts +++ b/src/utils/job.ts @@ -34,7 +34,7 @@ export async function runRecurringJob({ } } -async function sleep(durationInMs: number): Promise { +function sleep(durationInMs: number): Promise { return new Promise((resolve) => { setTimeout(() => { resolve({ error: false, message: `Slept for ${durationInMs} ms` }); diff --git a/src/utils/lucid.ts b/src/utils/lucid.ts index 017c6f8..320c58e 100644 --- a/src/utils/lucid.ts +++ b/src/utils/lucid.ts @@ -15,16 +15,16 @@ import { NetworkId } from "../types/network"; * @param address Your own address * @returns */ -export async function getBackendBlockfrostLucidInstance( +export function getBackendBlockfrostLucidInstance( networkId: NetworkId, projectId: string, blockfrostUrl: string, address: string, -): Promise { +): Lucid { const provider = new Blockfrost(blockfrostUrl, projectId); const lucid = new Lucid({ provider: provider, - network: networkId === NetworkId.MAINNET ? 'Mainnet' : 'Preprod', + network: networkId === NetworkId.MAINNET ? "Mainnet" : "Preprod", }); lucid.selectReadOnlyWallet({ address: address, @@ -39,11 +39,11 @@ export async function getBackendBlockfrostLucidInstance( * @param address Your own address * @returns */ -export async function getBackendMaestroLucidInstance( +export function getBackendMaestroLucidInstance( network: MaestroSupportedNetworks, apiKey: string, address: string, -): Promise { +): Lucid { const provider = new Maestro({ network: network, apiKey: apiKey,