diff --git a/packages/voter-stake-registry-hooks/src/hooks/useExtendPosition.ts b/packages/voter-stake-registry-hooks/src/hooks/useExtendPosition.ts index 7904d7a04..0444d0293 100644 --- a/packages/voter-stake-registry-hooks/src/hooks/useExtendPosition.ts +++ b/packages/voter-stake-registry-hooks/src/hooks/useExtendPosition.ts @@ -1,6 +1,7 @@ import { Program } from "@coral-xyz/anchor"; import { PROGRAM_ID, daoKey, init } from "@helium/helium-sub-daos-sdk"; import { sendInstructions } from "@helium/spl-utils"; +import { init as initVsr } from "@helium/voter-stake-registry-sdk"; import { PublicKey, TransactionInstruction } from "@solana/web3.js"; import { useAsyncCallback } from "react-async-hook"; import { useHeliumVsrState } from "../contexts/heliumVsrContext"; @@ -22,6 +23,7 @@ export const useExtendPosition = () => { const idl = await Program.fetchIdl(programId, provider); const hsdProgram = await init(provider as any, programId, idl); + const vsrProgram = await initVsr(provider as any); const mint = position.votingMint.mint; if (loading) return; @@ -48,7 +50,7 @@ export const useExtendPosition = () => { ); } else { instructions.push( - await hsdProgram.methods + await vsrProgram.methods .resetLockupV0({ kind: position.lockup.kind, periods: lockupPeriodsInDays, diff --git a/packages/voter-stake-registry-hooks/src/hooks/useFlipPositionLockupKind.ts b/packages/voter-stake-registry-hooks/src/hooks/useFlipPositionLockupKind.ts index 668a25d5b..0970265b3 100644 --- a/packages/voter-stake-registry-hooks/src/hooks/useFlipPositionLockupKind.ts +++ b/packages/voter-stake-registry-hooks/src/hooks/useFlipPositionLockupKind.ts @@ -30,11 +30,7 @@ export const useFlipPositionLockupKind = () => { const idl = await Program.fetchIdl(programId, provider); const hsdProgram = await init(provider as any, programId, idl); const vsrProgram = await initVsr(provider as any); - - const registrar = await vsrProgram.account.registrar.fetch( - position.registrar - ); - const mint = registrar.votingMints[position.votingMintConfigIdx].mint; + const mint = position.votingMint.mint; if (loading) return; @@ -72,7 +68,7 @@ export const useFlipPositionLockupKind = () => { ); } else { instructions.push( - await hsdProgram.methods + await vsrProgram.methods .resetLockupV0({ kind, periods: positionLockupPeriodInDays, diff --git a/packages/voter-stake-registry-hooks/src/hooks/useTransferPosition.ts b/packages/voter-stake-registry-hooks/src/hooks/useTransferPosition.ts index 4c38bf140..59183e07b 100644 --- a/packages/voter-stake-registry-hooks/src/hooks/useTransferPosition.ts +++ b/packages/voter-stake-registry-hooks/src/hooks/useTransferPosition.ts @@ -30,12 +30,7 @@ export const useTransferPosition = () => { const idl = await Program.fetchIdl(programId, provider); const hsdProgram = await init(provider as any, programId, idl); const vsrProgram = await initVsr(provider as any); - - const registrar = await vsrProgram.account.registrar.fetch( - sourcePosition.registrar - ); - const mint = - registrar.votingMints[sourcePosition.votingMintConfigIdx].mint; + const mint = sourcePosition.votingMint.mint; if (loading) return;