pass in a PublicKey instead of the string

This commit is contained in:
Tyler Shipe 2021-04-25 13:23:06 -04:00
parent 526236e46f
commit e3986a26a0
3 changed files with 6 additions and 4 deletions

View File

@ -10,6 +10,7 @@ import { ElementTitle } from './styles'
import { InformationCircleIcon } from '@heroicons/react/outline'
import Tooltip from './Tooltip'
import { sleep } from '../utils'
import { PublicKey } from '@solana/web3.js'
const BalancesTable = () => {
const balances = useBalances()
@ -28,7 +29,7 @@ const BalancesTable = () => {
try {
await settleAll(
connection,
programId,
new PublicKey(programId),
mangoGroup,
marginAccount,
markets,

View File

@ -89,7 +89,7 @@ const DepositModal = ({ isOpen, onClose }) => {
} else {
deposit(
connection,
programId,
new PublicKey(programId),
mangoGroup,
marginAccount,
wallet,

View File

@ -18,6 +18,7 @@ import Switch from './Switch'
import Tooltip from './Tooltip'
import { InformationCircleIcon } from '@heroicons/react/outline'
import { Transition } from '@headlessui/react'
import { PublicKey } from '@solana/web3.js'
const WithdrawModal = ({ isOpen, onClose }) => {
const [inputAmount, setInputAmount] = useState('')
@ -105,7 +106,7 @@ const WithdrawModal = ({ isOpen, onClose }) => {
if (!includeBorrow) {
withdraw(
connection,
programId,
new PublicKey(programId),
mangoGroup,
marginAccount,
wallet,
@ -133,7 +134,7 @@ const WithdrawModal = ({ isOpen, onClose }) => {
} else {
borrowAndWithdraw(
connection,
programId,
new PublicKey(programId),
mangoGroup,
marginAccount,
wallet,