diff --git a/packages/onboarding/src/HotspotOnboardingUtil.ts b/packages/onboarding/src/HotspotOnboardingUtil.ts index c7084726..84fcd634 100644 --- a/packages/onboarding/src/HotspotOnboardingUtil.ts +++ b/packages/onboarding/src/HotspotOnboardingUtil.ts @@ -22,7 +22,7 @@ import { } from '@helium/helium-entity-manager-sdk' import * as Currency from '@helium/currency-utils' import { - BONES_IN_HNT, + HNT_AS_BONES, DcProgram, DeviceType, HemProgram, @@ -173,10 +173,10 @@ const getBalance = async (wallet: PublicKey, connection: Connection, mint: Publi const getBalances = async (wallet: PublicKey, connection: Connection) => { const lamports = await connection.getBalance(wallet) - const bones = await getBalance(wallet, connection, HNT_MINT) + const hnt = await getBalance(wallet, connection, HNT_MINT) const dc = await getBalance(wallet, connection, DC_MINT) - return { bones, dc, lamports: new BN(lamports) } + return { hnt, dc, lamports: new BN(lamports) } } const burnHNTForDataCredits = async ({ @@ -330,8 +330,8 @@ export const getAssertData = async ({ const dcInCents = dcNeeded.div(new BN(100000)).mul(new BN(100)) const oraclePriceInCents = await getOraclePriceInCentsFromSolana({ connection, cluster }) - const bonesNeeded = dcInCents.mul(BONES_IN_HNT).divRound(oraclePriceInCents) - hasSufficientHnt = balances.bones.gte(bonesNeeded) + const hntNeeded = dcInCents.mul(HNT_AS_BONES).divRound(oraclePriceInCents) + hasSufficientHnt = balances.hnt.gte(hntNeeded) if (hasSufficientHnt) { const txn = await burnHNTForDataCredits({ diff --git a/packages/onboarding/src/__mocks__/AssertMock.ts b/packages/onboarding/src/__mocks__/AssertMock.ts index 0262f42c..2c134635 100644 --- a/packages/onboarding/src/__mocks__/AssertMock.ts +++ b/packages/onboarding/src/__mocks__/AssertMock.ts @@ -5,7 +5,7 @@ import { AssertData } from '../types' export const getAssertData = async (): Promise => { return { balances: { - bones: new BN(100000000000), + hnt: new BN(100000000000), dc: new BN(1000000000), lamports: new BN(1000000000000), }, diff --git a/packages/onboarding/src/types.ts b/packages/onboarding/src/types.ts index 2e95fe3f..8ae1daf2 100644 --- a/packages/onboarding/src/types.ts +++ b/packages/onboarding/src/types.ts @@ -56,7 +56,7 @@ export type HeightType = 'MSL' | 'AGL' | 'NONE' | 'UNRECOGNIZED' export type NetworkType = 'IOT' | 'MOBILE' export type DeviceType = 'Cbrs' | 'WifiIndoor' | 'WifiOutdoor' | null // null is for IOT devices -export const BONES_IN_HNT = new BN(100000000) +export const HNT_AS_BONES = new BN(100000000) export const TXN_FEE_IN_LAMPORTS = new BN(5000) export type HemProgram = Awaited>