Skip to content

Commit

Permalink
chore(types): fix minor typescript-eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
drichar committed Oct 5, 2023
1 parent e95f0cc commit e7b21cb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/clients/custom/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DEFAULT_NETWORK, PROVIDER_ID } from '../../constants'
import { debugLog } from '../../utils/debugLog'
import { ICON } from './constants'
import type _algosdk from 'algosdk'
import type { Network } from '../../types/node'
import type { AlgodClientOptions, Network } from '../../types/node'
import type { InitParams } from '../../types/providers'
import type { Metadata, Wallet } from '../../types/wallet'
import type { CustomProvider, CustomWalletClientConstructor } from './types'
Expand Down Expand Up @@ -40,14 +40,15 @@ class CustomWalletClient extends BaseClient {
network = DEFAULT_NETWORK
}: InitParams<PROVIDER_ID.CUSTOM>): Promise<BaseClient | null> {
try {
debugLog(`${PROVIDER_ID.CUSTOM.toUpperCase()} initializing...`)
debugLog(`${PROVIDER_ID.CUSTOM.toUpperCase() as string} initializing...`)

if (!clientOptions) {
throw new Error(`Attempt to create custom wallet with no provider specified.`)
}

const algosdk = algosdkStatic || (await Algod.init(algodOptions)).algosdk
const algodClient = getAlgodClient(algosdk, algodOptions)
const algosdk: typeof _algosdk =
algosdkStatic || (await Algod.init(algodOptions as AlgodClientOptions)).algosdk
const algodClient = getAlgodClient(algosdk, algodOptions as AlgodClientOptions)

try {
return new CustomWalletClient({
Expand All @@ -66,7 +67,7 @@ class CustomWalletClient extends BaseClient {
network
})
} finally {
debugLog(`${PROVIDER_ID.CUSTOM.toUpperCase()} initialized`, '✅')
debugLog(`${PROVIDER_ID.CUSTOM.toUpperCase() as string} initialized`, '✅')
}
} catch (e) {
console.error('Error initializing...', e)
Expand Down

0 comments on commit e7b21cb

Please sign in to comment.