Skip to content

Commit

Permalink
Add missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
ChewingGlass committed Aug 10, 2023
1 parent 844a9a1 commit ed6fbcf
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/hooks/useKeyToAsset.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {
mobileInfoKey,
rewardableEntityConfigKey,
} from '@helium/helium-entity-manager-sdk'
import { useAnchorAccount } from '@helium/helium-react-hooks'
import { HeliumEntityManager } from '@helium/idls/lib/types/helium_entity_manager'
import { MOBILE_SUB_DAO_KEY } from '@utils/constants'

const type = 'keyToAssetV0'

export const useKeyToAsset = (entityKey: string | undefined) => {
const [mobileConfigKey] = rewardableEntityConfigKey(
MOBILE_SUB_DAO_KEY,
'MOBILE',
)
const [mobileInfo] = mobileInfoKey(mobileConfigKey, entityKey || '')

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
return useAnchorAccount<HeliumEntityManager, type>(mobileInfo, type)
}

0 comments on commit ed6fbcf

Please sign in to comment.