Skip to content

Commit

Permalink
update: improve types usage
Browse files Browse the repository at this point in the history
  • Loading branch information
clostao committed Jan 23, 2025
1 parent 458e71b commit f5444e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/auto-drive/src/api/connection.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NetworkId } from '@autonomys/auto-utils'
import { getNetworkUrl } from './networks'
import { getNetworkUrl, networks } from './networks'

export interface AutoDriveApi {
sendRequest: (
Expand All @@ -22,7 +22,7 @@ type ConnectionOptions =
provider?: AuthProvider
apiKey?: string
url?: null
network: NetworkId
network: keyof typeof networks
}
| {
provider?: AuthProvider
Expand Down
4 changes: 2 additions & 2 deletions packages/auto-drive/src/api/networks.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { NetworkId } from '@autonomys/auto-utils'

export const networks: Partial<Record<NetworkId, string>> = {
export const networks = {
[NetworkId.TAURUS]: 'https://demo.auto-drive.autonomys.xyz/api',
}
} satisfies Partial<Record<NetworkId, string>>

export const getNetworkUrl = (networkId: NetworkId) => {
if (!networks[networkId]) {
Expand Down

0 comments on commit f5444e1

Please sign in to comment.