add main action buttons below balances

This commit is contained in:
Tyler Shipe 2021-06-05 12:14:34 -04:00
parent 9e5a844f5d
commit eac4adc18f
17 changed files with 100 additions and 820 deletions

View File

@ -69,7 +69,7 @@ const AccountsModal: FunctionComponent<AccountsModalProps> = ({
const accountEquity = acc
.computeValue(selectedMangoGroup, prices)
.toFixed(2)
let leverage = accountEquity
const leverage = accountEquity
? (1 / (acc.getCollateralRatio(selectedMangoGroup, prices) - 1)).toFixed(
2
)
@ -125,7 +125,7 @@ const AccountsModal: FunctionComponent<AccountsModalProps> = ({
Select a Margin Account
</RadioGroup.Label>
<div className="space-y-2">
{marginAccounts.map((account, i) => (
{marginAccounts.map((account) => (
<RadioGroup.Option
key={account.publicKey.toString()}
value={account}

View File

@ -120,7 +120,8 @@ const AlertsModal: FunctionComponent<AlertsModalProps> = ({
const handleCloseModal = () => {
set((s) => {
(s.success = ''), (s.tgCode = null)
s.success = ''
s.tgCode = null
})
resetForm()
onClose()

View File

@ -11,7 +11,7 @@ import {
displayDepositsForMarginAccount,
} from '../utils/index'
import useConnection from '../hooks/useConnection'
import { borrowAndWithdraw, withdraw } from '../utils/mango'
import { borrowAndWithdraw } from '../utils/mango'
import Loading from './Loading'
import Slider from './Slider'
import Button, { LinkButton } from './Button'
@ -50,7 +50,6 @@ const BorrowModal: FunctionComponent<BorrowModalProps> = ({
const [invalidAmountMessage, setInvalidAmountMessage] = useState('')
const [maxAmount, setMaxAmount] = useState(0)
const [submitting, setSubmitting] = useState(false)
const [includeBorrow, setIncludeBorrow] = useState(false)
const [simulation, setSimulation] = useState(null)
const [showSimulation, setShowSimulation] = useState(false)
const [sliderPercentage, setSliderPercentage] = useState(0)
@ -135,7 +134,6 @@ const BorrowModal: FunctionComponent<BorrowModalProps> = ({
leverage,
})
}, [
includeBorrow,
inputAmount,
prices,
tokenIndex,
@ -150,62 +148,33 @@ const BorrowModal: FunctionComponent<BorrowModalProps> = ({
const wallet = useMangoStore.getState().wallet.current
if (!marginAccount || !mangoGroup) return
if (!includeBorrow) {
withdraw(
connection,
new PublicKey(programId),
mangoGroup,
marginAccount,
wallet,
new PublicKey(symbols[borrowTokenSymbol]),
Number(inputAmount)
)
.then((_transSig: string) => {
setSubmitting(false)
actions.fetchMangoGroup()
actions.fetchMarginAccounts()
actions.fetchWalletBalances()
onClose()
borrowAndWithdraw(
connection,
new PublicKey(programId),
mangoGroup,
marginAccount,
wallet,
new PublicKey(symbols[borrowTokenSymbol]),
Number(inputAmount)
)
.then((_transSig: string) => {
setSubmitting(false)
actions.fetchMangoGroup()
actions.fetchMarginAccounts()
actions.fetchWalletBalances()
onClose()
})
.catch((err) => {
setSubmitting(false)
console.warn('Error borrowing and withdrawing:', err)
notify({
message: 'Could not perform borrow and withdraw',
description: `${err}`,
txid: err.txid,
type: 'error',
})
.catch((err) => {
setSubmitting(false)
console.warn('Error withdrawing:', err)
notify({
message: 'Could not perform borrow and withdraw',
txid: err.txid,
type: 'error',
})
onClose()
})
} else {
borrowAndWithdraw(
connection,
new PublicKey(programId),
mangoGroup,
marginAccount,
wallet,
new PublicKey(symbols[borrowTokenSymbol]),
Number(inputAmount)
)
.then((_transSig: string) => {
setSubmitting(false)
actions.fetchMangoGroup()
actions.fetchMarginAccounts()
actions.fetchWalletBalances()
onClose()
})
.catch((err) => {
setSubmitting(false)
console.warn('Error borrowing and withdrawing:', err)
notify({
message: 'Could not perform borrow and withdraw',
description: `${err}`,
txid: err.txid,
type: 'error',
})
onClose()
})
}
onClose()
})
}
const handleSetSelectedAsset = (symbol) => {
@ -471,7 +440,9 @@ const BorrowModal: FunctionComponent<BorrowModalProps> = ({
</div>
) : null}
<div className="bg-th-bkg-1 p-4 rounded-lg text-th-fgd-1 text-center">
<div className="text-th-fgd-3 pb-1">You're about to withdraw</div>
<div className="text-th-fgd-3 pb-1">
You&apos;re about to withdraw
</div>
<div className="flex items-center justify-center">
<div className="font-semibold relative text-xl">
{inputAmount}

View File

@ -189,6 +189,24 @@ export default function MarginBalances() {
</tbody>
</table>
) : null}
<div className={`flex justify-center items-center mt-4`}>
<Button
onClick={() => setShowDepositModal(true)}
className="w-1/2"
disabled={!connected || loadingMarginAccount}
>
<span>Deposit</span>
</Button>
<Button
onClick={() => setShowWithdrawModal(true)}
className="ml-4 w-1/2"
disabled={
!connected || !selectedMarginAccount || loadingMarginAccount
}
>
<span>Withdraw</span>
</Button>
</div>
</FloatingElement>
{showDepositModal && (
<DepositModal isOpen={showDepositModal} onClose={handleCloseDeposit} />

View File

@ -64,16 +64,17 @@ export default function MarginInfo() {
(s) => s.selectedMarginAccount.current
)
const selectedMangoGroup = useMangoStore((s) => s.selectedMangoGroup.current)
const [mAccountInfo, setMAccountInfo] = useState<
| {
label: string
value: string
unit: string
desc: string
currency: string
}[]
| null
>(null)
const [mAccountInfo, setMAccountInfo] =
useState<
| {
label: string
value: string
unit: string
desc: string
currency: string
}[]
| null
>(null)
const [openAlertModal, setOpenAlertModal] = useState(false)
const tradeHistory = useTradeHistory()
const tradeHistoryLength = useMemo(() => tradeHistory.length, [tradeHistory])
@ -124,8 +125,7 @@ export default function MarginInfo() {
value: calculatePNL(tradeHistory, prices, selectedMangoGroup),
unit: '',
currency: '$',
desc:
'Total PNL reflects trades placed after March 15th 2021 04:00 AM UTC. Visit the Learn link in the top menu for more information.',
desc: 'Total PNL reflects trades placed after March 15th 2021 04:00 AM UTC. Visit the Learn link in the top menu for more information.',
},
{
// TODO: Get collaterization ratio
@ -141,8 +141,7 @@ export default function MarginInfo() {
value: (selectedMangoGroup.maintCollRatio * 100).toFixed(0),
unit: '%',
currency: '',
desc:
'The collateral ratio you must maintain to not get liquidated',
desc: 'The collateral ratio you must maintain to not get liquidated',
},
{
label: 'Initial Collateral Ratio',

View File

@ -94,7 +94,7 @@ export default function TradeForm() {
}
const onSetBaseSize = (baseSize: number | '') => {
const {price} = useMangoStore.getState().tradeForm
const { price } = useMangoStore.getState().tradeForm
setBaseSize(baseSize)
if (!baseSize) {
setQuoteSize('')

View File

@ -24,13 +24,13 @@ export const defaultLayouts = {
{ i: 'orderbook', x: 6, y: 0, w: 3, h: 17 },
{ i: 'tradeForm', x: 9, y: 0, w: 3, h: 12 },
{ i: 'marketTrades', x: 6, y: 1, w: 3, h: 13 },
{ i: 'balanceInfo', x: 9, y: 1, w: 3, h: 13 },
{ i: 'balanceInfo', x: 9, y: 1, w: 3, h: 15 },
{ i: 'userInfo', x: 0, y: 2, w: 9, h: 17 },
{ i: 'marginInfo', x: 9, y: 2, w: 3, h: 13 },
],
lg: [
{ i: 'tvChart', x: 0, y: 0, w: 8, h: 26, minW: 2 },
{ i: 'balanceInfo', x: 8, y: 0, w: 4, h: 13, minW: 2 },
{ i: 'balanceInfo', x: 8, y: 0, w: 4, h: 15, minW: 2 },
{ i: 'marginInfo', x: 8, y: 1, w: 4, h: 13, minW: 2 },
{ i: 'orderbook', x: 0, y: 2, w: 4, h: 17, minW: 2 },
{ i: 'tradeForm', x: 4, y: 2, w: 4, h: 17, minW: 3 },
@ -39,7 +39,7 @@ export const defaultLayouts = {
],
md: [
{ i: 'tvChart', x: 0, y: 0, w: 8, h: 26, minW: 2 },
{ i: 'balanceInfo', x: 8, y: 0, w: 4, h: 13, minW: 2 },
{ i: 'balanceInfo', x: 8, y: 0, w: 4, h: 15, minW: 2 },
{ i: 'marginInfo', x: 8, y: 1, w: 4, h: 13, minW: 2 },
{ i: 'orderbook', x: 0, y: 2, w: 4, h: 17, minW: 2 },
{ i: 'tradeForm', x: 4, y: 2, w: 4, h: 17, minW: 3 },
@ -48,7 +48,7 @@ export const defaultLayouts = {
],
sm: [
{ i: 'tvChart', x: 0, y: 0, w: 12, h: 25, minW: 6 },
{ i: 'balanceInfo', x: 0, y: 1, w: 6, h: 13, minW: 2 },
{ i: 'balanceInfo', x: 0, y: 1, w: 6, h: 15, minW: 2 },
{ i: 'marginInfo', x: 6, y: 1, w: 6, h: 13, minW: 2 },
{ i: 'tradeForm', x: 0, y: 2, w: 12, h: 13, minW: 3 },
{ i: 'orderbook', x: 0, y: 3, w: 6, h: 17, minW: 3 },
@ -57,7 +57,7 @@ export const defaultLayouts = {
],
xs: [
{ i: 'tvChart', x: 0, y: 0, w: 0, h: 0, minW: 6 },
{ i: 'balanceInfo', x: 0, y: 1, w: 6, h: 13, minW: 2 },
{ i: 'balanceInfo', x: 0, y: 1, w: 6, h: 15, minW: 2 },
{ i: 'marginInfo', x: 0, y: 2, w: 6, h: 13, minW: 2 },
{ i: 'tradeForm', x: 0, y: 3, w: 12, h: 13, minW: 3 },
{ i: 'orderbook', x: 0, y: 4, w: 6, h: 17, minW: 3 },
@ -66,7 +66,7 @@ export const defaultLayouts = {
],
}
export const GRID_LAYOUT_KEY = 'mangoSavedLayouts-1.0'
export const GRID_LAYOUT_KEY = 'mangoSavedLayouts-2.0'
const TradePageGrid = () => {
const { uiLocked } = useMangoStore((s) => s.settings)

View File

@ -63,8 +63,10 @@ const TVChartContainer = () => {
datafeed: new (window as any).Datafeeds.UDFCompatibleDatafeed(
defaultProps.datafeedUrl
),
interval: defaultProps.interval as ChartingLibraryWidgetOptions['interval'],
container_id: defaultProps.containerId as ChartingLibraryWidgetOptions['container_id'],
interval:
defaultProps.interval as ChartingLibraryWidgetOptions['interval'],
container_id:
defaultProps.containerId as ChartingLibraryWidgetOptions['container_id'],
library_path: defaultProps.libraryPath as string,
locale: 'en',
disabled_features: [

View File

@ -7,7 +7,7 @@ import { useBalances } from '../../hooks/useBalances'
import { notify } from '../../utils/notifications'
import { sleep } from '../../utils'
import { PublicKey } from '@solana/web3.js'
import { floorToDecimal, tokenPrecision } from '../../utils/index'
import { tokenPrecision } from '../../utils/index'
import { settleBorrow } from '../../utils/mango'
import BorrowModal from '../BorrowModal'
import Button from '../Button'

View File

@ -1,10 +1,10 @@
import { useState } from 'react'
import TradeHistoryTable from '../TradeHistoryTable'
const historyViews = ['Trades', 'Deposits', 'Withdrawals', 'Liquidations']
// const historyViews = ['Trades', 'Deposits', 'Withdrawals', 'Liquidations']
export default function AccountHistory() {
const [view, setView] = useState('Trades')
const [view] = useState('Trades')
return (
<>
<div className="flex items-center justify-between pb-3.5 sm:pt-1">

View File

@ -1,54 +1,6 @@
import { useState } from 'react'
import { useOpenOrders } from '../../hooks/useOpenOrders'
import { cancelOrderAndSettle } from '../../utils/mango'
import Button from '../Button'
import Loading from '../Loading'
import { PublicKey } from '@solana/web3.js'
import useConnection from '../../hooks/useConnection'
import useMangoStore from '../../stores/useMangoStore'
import { notify } from '../../utils/notifications'
import { Table, Thead, Tbody, Tr, Th, Td } from 'react-super-responsive-table'
import SideBadge from '../SideBadge'
import OpenOrdersTable from '../OpenOrdersTable'
const AccountOrders = () => {
const openOrders = useOpenOrders()
const [cancelId, setCancelId] = useState(null)
const { connection, programId } = useConnection()
const actions = useMangoStore((s) => s.actions)
const handleCancelOrder = async (order) => {
const wallet = useMangoStore.getState().wallet.current
const selectedMangoGroup =
useMangoStore.getState().selectedMangoGroup.current
const selectedMarginAccount =
useMangoStore.getState().selectedMarginAccount.current
setCancelId(order?.orderId)
try {
if (!selectedMangoGroup || !selectedMarginAccount) return
await cancelOrderAndSettle(
connection,
new PublicKey(programId),
selectedMangoGroup,
selectedMarginAccount,
wallet,
order.market,
order
)
actions.fetchMarginAccounts()
} catch (e) {
notify({
message: 'Error cancelling order',
description: e.message,
txid: e.txid,
type: 'error',
})
return
} finally {
setCancelId(null)
}
}
return (
<>
<div className="pb-3.5 sm:pt-1 text-th-fgd-1 text-lg">Open Orders</div>

View File

@ -5,13 +5,16 @@ import useMangoStore from '../stores/useMangoStore'
const useConnection = () => {
const setMangoStore = useMangoStore((s) => s.set)
const { cluster, current: connection, endpoint } = useMangoStore(
(s) => s.connection
)
const sendConnection = useMemo(() => new Connection(endpoint, 'recent'), [
const {
cluster,
current: connection,
endpoint,
])
} = useMangoStore((s) => s.connection)
const sendConnection = useMemo(
() => new Connection(endpoint, 'recent'),
[endpoint]
)
useEffect(() => {
if (connection && endpoint === connection['_rpcEndpoint']) return

View File

@ -4,7 +4,7 @@ export const useSortableData = (items, config = null) => {
const [sortConfig, setSortConfig] = useState(config)
const sortedItems = useMemo(() => {
let sortableItems = items ? [...items] : []
const sortableItems = items ? [...items] : []
if (sortConfig !== null) {
sortableItems.sort((a, b) => {
if (!isNaN(a[sortConfig.key])) {

View File

@ -1,661 +0,0 @@
{
"header": {
"reportVersion": 1,
"event": "Allocation failed - JavaScript heap out of memory",
"trigger": "FatalError",
"filename": "report.20210602.231048.64561.0.001.json",
"dumpEventTime": "2021-06-02T23:10:48Z",
"dumpEventTimeStamp": "1622639448044",
"processId": 64561,
"cwd": "/Users/samluke/Desktop/Projects/mango/v3/mango-ui-v2",
"commandLine": [
"node",
"/Users/samluke/Desktop/Projects/mango/v3/mango-ui-v2/node_modules/.bin/next",
"dev"
],
"nodejsVersion": "v12.14.0",
"wordSize": 64,
"arch": "x64",
"platform": "darwin",
"componentVersions": {
"node": "12.14.0",
"v8": "7.7.299.13-node.16",
"uv": "1.33.1",
"zlib": "1.2.11",
"brotli": "1.0.7",
"ares": "1.15.0",
"modules": "72",
"nghttp2": "1.39.2",
"napi": "5",
"llhttp": "1.1.4",
"http_parser": "2.8.0",
"openssl": "1.1.1d",
"cldr": "35.1",
"icu": "64.2",
"tz": "2019c",
"unicode": "12.1"
},
"release": {
"name": "node",
"lts": "Erbium",
"headersUrl": "https://nodejs.org/download/release/v12.14.0/node-v12.14.0-headers.tar.gz",
"sourceUrl": "https://nodejs.org/download/release/v12.14.0/node-v12.14.0.tar.gz"
},
"osName": "Darwin",
"osRelease": "16.4.0",
"osVersion": "Darwin Kernel Version 16.4.0: Thu Dec 22 22:53:21 PST 2016; root:xnu-3789.41.3~3/RELEASE_X86_64",
"osMachine": "x86_64",
"cpus": [
{
"model": "Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz",
"speed": 2700,
"user": 91006670,
"nice": 0,
"sys": 68670550,
"idle": 289634560,
"irq": 0
},
{
"model": "Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz",
"speed": 2700,
"user": 59652590,
"nice": 0,
"sys": 23759920,
"idle": 365882090,
"irq": 0
},
{
"model": "Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz",
"speed": 2700,
"user": 89189830,
"nice": 0,
"sys": 48334440,
"idle": 311770570,
"irq": 0
},
{
"model": "Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz",
"speed": 2700,
"user": 61353640,
"nice": 0,
"sys": 24618750,
"idle": 363322020,
"irq": 0
}
],
"networkInterfaces": [
{
"name": "lo0",
"internal": true,
"mac": "00:00:00:00:00:00",
"address": "127.0.0.1",
"netmask": "255.0.0.0",
"family": "IPv4"
},
{
"name": "lo0",
"internal": true,
"mac": "00:00:00:00:00:00",
"address": "::1",
"netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
"family": "IPv6",
"scopeid": 0
},
{
"name": "lo0",
"internal": true,
"mac": "00:00:00:00:00:00",
"address": "fe80::1",
"netmask": "ffff:ffff:ffff:ffff::",
"family": "IPv6",
"scopeid": 1
},
{
"name": "en0",
"internal": false,
"mac": "d0:a6:37:ec:7f:ad",
"address": "fe80::181c:d777:5cef:a110",
"netmask": "ffff:ffff:ffff:ffff::",
"family": "IPv6",
"scopeid": 4
},
{
"name": "en0",
"internal": false,
"mac": "d0:a6:37:ec:7f:ad",
"address": "192.168.1.104",
"netmask": "255.255.255.0",
"family": "IPv4"
},
{
"name": "awdl0",
"internal": false,
"mac": "f6:d2:ae:16:b8:ba",
"address": "fe80::f4d2:aeff:fe16:b8ba",
"netmask": "ffff:ffff:ffff:ffff::",
"family": "IPv6",
"scopeid": 9
},
{
"name": "utun0",
"internal": false,
"mac": "00:00:00:00:00:00",
"address": "fe80::e2b9:f89c:9a5c:241b",
"netmask": "ffff:ffff:ffff:ffff::",
"family": "IPv6",
"scopeid": 10
}
],
"host": "Sams-MacBook-Pro.local"
},
"javascriptStack": {
"message": "No stack.",
"stack": [
"Unavailable."
]
},
"nativeStack": [
{
"pc": "0x000000010014db86",
"symbol": "report::TriggerNodeReport(v8::Isolate*, node::Environment*, char const*, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, v8::Local<v8::String>) [/Users/samluke/.nvm/versions/node/v12.14.0/bin/node]"
},
{
"pc": "0x000000010007eb13",
"symbol": "node::OnFatalError(char const*, char const*) [/Users/samluke/.nvm/versions/node/v12.14.0/bin/node]"
},
{
"pc": "0x0000000100176337",
"symbol": "v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/Users/samluke/.nvm/versions/node/v12.14.0/bin/node]"
},
{
"pc": "0x00000001001762d3",
"symbol": "v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/samluke/.nvm/versions/node/v12.14.0/bin/node]"
},
{
"pc": "0x00000001002fa485",
"symbol": "v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/Users/samluke/.nvm/versions/node/v12.14.0/bin/node]"
},
{
"pc": "0x00000001002fbb54",
"symbol": "v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/Users/samluke/.nvm/versions/node/v12.14.0/bin/node]"
},
{
"pc": "0x00000001002f8a27",
"symbol": "v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/Users/samluke/.nvm/versions/node/v12.14.0/bin/node]"
},
{
"pc": "0x00000001002f6a0d",
"symbol": "v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/samluke/.nvm/versions/node/v12.14.0/bin/node]"
},
{
"pc": "0x0000000100302124",
"symbol": "v8::internal::Heap::AllocateRawWithLightRetry(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/Users/samluke/.nvm/versions/node/v12.14.0/bin/node]"
},
{
"pc": "0x000000010030219f",
"symbol": "v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/Users/samluke/.nvm/versions/node/v12.14.0/bin/node]"
},
{
"pc": "0x00000001002ced97",
"symbol": "v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType) [/Users/samluke/.nvm/versions/node/v12.14.0/bin/node]"
},
{
"pc": "0x00000001005f83e5",
"symbol": "v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/Users/samluke/.nvm/versions/node/v12.14.0/bin/node]"
},
{
"pc": "0x0000000100930c99",
"symbol": "Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/Users/samluke/.nvm/versions/node/v12.14.0/bin/node]"
},
{
"pc": "0x000034df0a3ca47f",
"symbol": ""
},
{
"pc": "0x00000001008aa97c",
"symbol": "Builtins_ArgumentsAdaptorTrampoline [/Users/samluke/.nvm/versions/node/v12.14.0/bin/node]"
},
{
"pc": "0x00000001008b12e4",
"symbol": "Builtins_InterpreterEntryTrampoline [/Users/samluke/.nvm/versions/node/v12.14.0/bin/node]"
},
{
"pc": "0x00000001008b12e4",
"symbol": "Builtins_InterpreterEntryTrampoline [/Users/samluke/.nvm/versions/node/v12.14.0/bin/node]"
},
{
"pc": "0x00000001008aa97c",
"symbol": "Builtins_ArgumentsAdaptorTrampoline [/Users/samluke/.nvm/versions/node/v12.14.0/bin/node]"
},
{
"pc": "0x0000000100943908",
"symbol": "Builtins_ArrayForEach [/Users/samluke/.nvm/versions/node/v12.14.0/bin/node]"
},
{
"pc": "0x00000001008b12e4",
"symbol": "Builtins_InterpreterEntryTrampoline [/Users/samluke/.nvm/versions/node/v12.14.0/bin/node]"
}
],
"javascriptHeap": {
"totalMemory": 2150522880,
"totalCommittedMemory": 2148776200,
"usedMemory": 2136440104,
"availableMemory": 50232728,
"memoryLimit": 2197815296,
"heapSpaces": {
"read_only_space": {
"memorySize": 262144,
"committedMemory": 32568,
"capacity": 261872,
"used": 32296,
"available": 229576
},
"new_space": {
"memorySize": 2097152,
"committedMemory": 1069536,
"capacity": 1047488,
"used": 19968,
"available": 1027520
},
"old_space": {
"memorySize": 394375168,
"committedMemory": 394201344,
"capacity": 387202864,
"used": 386567136,
"available": 635728
},
"code_space": {
"memorySize": 4620288,
"committedMemory": 4466240,
"capacity": 3824672,
"used": 3824672,
"available": 0
},
"map_space": {
"memorySize": 6819840,
"committedMemory": 6658224,
"capacity": 4320400,
"used": 4320400,
"available": 0
},
"large_object_space": {
"memorySize": 1741152256,
"committedMemory": 1741152256,
"capacity": 1740577872,
"used": 1740577872,
"available": 0
},
"code_large_object_space": {
"memorySize": 1196032,
"committedMemory": 1196032,
"capacity": 1097760,
"used": 1097760,
"available": 0
},
"new_large_object_space": {
"memorySize": 0,
"committedMemory": 0,
"capacity": 1047488,
"used": 0,
"available": 1047488
}
}
},
"resourceUsage": {
"userCpuSeconds": 805.165,
"kernelCpuSeconds": 198.771,
"cpuConsumptionPercent": 1.70023,
"maxRss": 736058408960,
"pageFaults": {
"IORequired": 2846,
"IONotRequired": 21268316
},
"fsActivity": {
"reads": 39477,
"writes": 6047
}
},
"libuv": [
],
"environmentVariables": {
"npm_package_devDependencies_lint_staged": "^10.0.10",
"npm_package_devDependencies_identity_obj_proxy": "^3.0.0",
"npm_package_devDependencies_prettier": "^2.0.2",
"TERM_PROGRAM": "Apple_Terminal",
"NODE": "/Users/samluke/.nvm/versions/node/v12.14.0/bin/node",
"npm_config_version_git_tag": "true",
"npm_package_devDependencies_typescript": "^4.1.3",
"NVM_CD_FLAGS": "",
"npm_package_dependencies_react_grid_layout": "^1.2.4",
"npm_package_devDependencies_jest": "^26.6.3",
"TERM": "xterm-256color",
"SHELL": "/bin/bash",
"npm_package_dependencies__emotion_styled": "^11.1.5",
"npm_package_dependencies__project_serum_serum": "^0.13.20",
"TMPDIR": "/var/folders/4s/95t514691qd938qmf1cxcj8m0000gn/T/",
"npm_config_init_license": "MIT",
"npm_package_scripts_lint": "eslint . --ext ts --ext tsx --ext js --quiet",
"CONDA_SHLVL": "1",
"Apple_PubSub_Socket_Render": "/private/tmp/com.apple.launchd.ealgMWYqCt/Render",
"CONDA_PROMPT_MODIFIER": "(base) ",
"TERM_PROGRAM_VERSION": "388",
"npm_package_scripts_dev": "next dev",
"npm_package_husky_hooks_pre_push": "",
"TERM_SESSION_ID": "DC2550B6-7F01-4BE8-B540-87BAA015E047",
"npm_config_registry": "https://registry.yarnpkg.com",
"npm_package_dependencies__headlessui_react": "^1.2.0",
"npm_package_dependencies__project_serum_sol_wallet_adapter": "^0.1.8",
"npm_package_dependencies__tippyjs_react": "^4.2.5",
"npm_package_dependencies_react_dom": "^17.0.1",
"npm_package_lint_staged_____ts_tsx__1": "yarn format",
"npm_package_dependencies_dayjs": "^1.10.4",
"npm_package_readmeFilename": "README.md",
"npm_config_python": "/usr/bin/python",
"npm_package_lint_staged_____ts_tsx__0": "yarn lint",
"npm_package_devDependencies__testing_library_react": "^11.2.5",
"npm_package_description": "Uses:",
"NVM_DIR": "/Users/samluke/.nvm",
"USER": "samluke",
"npm_package_license": "MIT",
"npm_package_devDependencies__types_react": "^17.0.1",
"npm_package_dependencies_bs58": "^4.0.1",
"npm_package_devDependencies__emotion_babel_plugin": "^11.2.0",
"npm_package_dependencies__solana_web3_js": "^0.90.5",
"CONDA_EXE": "/opt/anaconda3/bin/conda",
"npm_package_devDependencies__babel_core": "^7.13.10",
"npm_package_devDependencies_babel_jest": "^26.6.3",
"npm_package_dependencies_zustand": "^3.3.3",
"SSH_AUTH_SOCK": "/private/tmp/com.apple.launchd.ShYHBkXDSQ/Listeners",
"npm_package_devDependencies__types_jest": "^26.0.20",
"npm_package_devDependencies_babel_plugin_styled_components": "^1.12.0",
"npm_package_devDependencies_eslint": "^7.19.0",
"npm_package_devDependencies_postcss": "^8.2.8",
"__CF_USER_TEXT_ENCODING": "0x1F5:0x0:0xF",
"npm_package_husky_hooks_pre_commit": "lint-staged",
"npm_package_dependencies_buffer_layout": "^1.2.0",
"npm_package_dependencies_rc_slider": "^9.7.2",
"npm_package_devDependencies__typescript_eslint_eslint_plugin": "^4.14.2",
"npm_execpath": "/usr/local/Cellar/yarn/1.6.0/libexec/bin/yarn.js",
"npm_package_author_name": "@erikdstock",
"npm_package_dependencies_react_cool_dimensions": "^2.0.1",
"npm_package_scripts_type_check": "tsc --pretty --noEmit",
"npm_package_devDependencies__svgr_webpack": "^5.5.0",
"npm_package_devDependencies_twin_macro": "^2.4.1",
"_CE_CONDA": "",
"npm_package_dependencies__blockworks_foundation_mango_client": "https://github.com/blockworks-foundation/mango-client-ts#5_tokens",
"npm_package_devDependencies__typescript_eslint_parser": "^4.14.2",
"npm_package_dependencies_immer": "^9.0.1",
"npm_config_argv": "{\"remain\":[],\"cooked\":[\"run\",\"dev\"],\"original\":[\"dev\"]}",
"PATH": "/Users/samluke/Desktop/Projects/mango/v3/mango-ui-v2/node_modules/.bin:/Users/samluke/.config/yarn/link/node_modules/.bin:/Users/samluke/Desktop/Projects/mango/v3/mango-ui-v2/node_modules/.bin:/Users/samluke/.config/yarn/link/node_modules/.bin:/Users/samluke/.nvm/versions/node/v12.14.0/libexec/lib/node_modules/npm/bin/node-gyp-bin:/Users/samluke/.nvm/versions/node/v12.14.0/lib/node_modules/npm/bin/node-gyp-bin:/Users/samluke/.nvm/versions/node/v12.14.0/bin/node_modules/npm/bin/node-gyp-bin:/opt/anaconda3/bin:/opt/anaconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/Users/samluke/mongodb-macos-x86_64-4.2.3/bin:/Users/samluke/.nvm/versions/node/v12.14.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
"npm_package_dependencies_react_super_responsive_table": "^5.2.0",
"npm_package_devDependencies_babel_plugin_macros": "^3.1.0",
"_": "/Users/samluke/Desktop/Projects/mango/v3/mango-ui-v2/node_modules/.bin/next",
"npm_package_devDependencies__next_bundle_analyzer": "^10.1.3",
"CONDA_PREFIX": "/opt/anaconda3",
"npm_package_devDependencies_tailwindcss": "^2.1.2",
"PWD": "/Users/samluke/desktop/projects/mango/v3/mango-ui-v2",
"npm_package_devDependencies_eslint_plugin_react_hooks": "^4.2.0",
"npm_lifecycle_event": "dev",
"npm_package_name": "with-typescript-eslint-jest",
"npm_package_dependencies_immutable_tuple": "^0.4.10",
"LANG": "en_AU.UTF-8",
"npm_package_dependencies_react_phone_input_2": "^2.14.0",
"npm_package_scripts_build": "next build",
"npm_package_scripts_start": "next start",
"XPC_FLAGS": "0x0",
"npm_package_dependencies_next": "^10.1.3",
"npm_package_devDependencies_eslint_config_prettier": "^7.2.0",
"npm_package_version": "1.0.0",
"npm_package_dependencies__emotion_react": "^11.1.5",
"_CE_M": "",
"XPC_SERVICE_NAME": "0",
"npm_package_babelMacros_twin_preset": "styled-components",
"HOME": "/Users/samluke",
"SHLVL": "2",
"npm_package_scripts_test": "jest",
"npm_package_dependencies_postcss_preset_env": "^6.7.0",
"npm_config_strict_ssl": "true",
"npm_config_save_prefix": "^",
"npm_config_version_git_message": "v%s",
"npm_package_devDependencies_husky": "^4.2.3",
"npm_package_dependencies_bn_js": "^5.2.0",
"NPM_CONFIG_PYTHON": "/usr/bin/python",
"npm_package_dependencies__heroicons_react": "^1.0.0",
"npm_package_scripts_format": "prettier --check .",
"YARN_WRAP_OUTPUT": "false",
"CONDA_PYTHON_EXE": "/opt/anaconda3/bin/python",
"LOGNAME": "samluke",
"npm_package_devDependencies_react_is": "^17.0.2",
"npm_lifecycle_script": "next dev",
"PREFIX": "/usr/local",
"npm_package_dependencies_react": "^17.0.1",
"CONDA_DEFAULT_ENV": "base",
"NVM_BIN": "/Users/samluke/.nvm/versions/node/v12.14.0/bin",
"npm_config_user_agent": "yarn/1.6.0 npm/? node/v12.14.0 darwin x64",
"npm_config_ignore_scripts": "",
"npm_config_version_git_sign": "",
"npm_package_devDependencies_jest_watch_typeahead": "^0.6.1",
"npm_package_dependencies_babel_plugin_import": "^1.13.3",
"npm_package_dependencies_recharts": "^2.0.9",
"npm_package_devDependencies__types_node": "^14.14.25",
"npm_config_ignore_optional": "",
"npm_config_init_version": "1.0.0",
"SECURITYSESSIONID": "186a6",
"npm_package_scripts_test_all": "yarn lint && yarn type-check && yarn test",
"npm_config_version_tag_prefix": "v",
"npm_package_dependencies_next_themes": "^0.0.14",
"npm_package_dependencies_react_portal": "^4.2.1",
"npm_package_devDependencies_eslint_plugin_react": "^7.19.0",
"npm_node_execpath": "/Users/samluke/.nvm/versions/node/v12.14.0/bin/node",
"NODE_ENV": "development",
"TRACE_ID": "525e9cbb0be52e77"
},
"userLimits": {
"core_file_size_blocks": {
"soft": 0,
"hard": "unlimited"
},
"data_seg_size_kbytes": {
"soft": "unlimited",
"hard": "unlimited"
},
"file_size_blocks": {
"soft": "unlimited",
"hard": "unlimited"
},
"max_locked_memory_bytes": {
"soft": "unlimited",
"hard": "unlimited"
},
"max_memory_size_kbytes": {
"soft": "unlimited",
"hard": "unlimited"
},
"open_files": {
"soft": 10240,
"hard": "unlimited"
},
"stack_size_bytes": {
"soft": 8388608,
"hard": 67104768
},
"cpu_time_seconds": {
"soft": "unlimited",
"hard": "unlimited"
},
"max_user_processes": {
"soft": 709,
"hard": 1064
},
"virtual_memory_kbytes": {
"soft": "unlimited",
"hard": "unlimited"
}
},
"sharedObjects": [
"/Users/samluke/.nvm/versions/node/v12.14.0/bin/node",
"/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation",
"/usr/lib/libSystem.B.dylib",
"/usr/lib/libc++.1.dylib",
"/usr/lib/libDiagnosticMessagesClient.dylib",
"/usr/lib/libicucore.A.dylib",
"/usr/lib/libobjc.A.dylib",
"/usr/lib/libz.1.dylib",
"/usr/lib/system/libcache.dylib",
"/usr/lib/system/libcommonCrypto.dylib",
"/usr/lib/system/libcompiler_rt.dylib",
"/usr/lib/system/libcopyfile.dylib",
"/usr/lib/system/libcorecrypto.dylib",
"/usr/lib/system/libdispatch.dylib",
"/usr/lib/system/libdyld.dylib",
"/usr/lib/system/libkeymgr.dylib",
"/usr/lib/system/liblaunch.dylib",
"/usr/lib/system/libmacho.dylib",
"/usr/lib/system/libquarantine.dylib",
"/usr/lib/system/libremovefile.dylib",
"/usr/lib/system/libsystem_asl.dylib",
"/usr/lib/system/libsystem_blocks.dylib",
"/usr/lib/system/libsystem_c.dylib",
"/usr/lib/system/libsystem_configuration.dylib",
"/usr/lib/system/libsystem_coreservices.dylib",
"/usr/lib/system/libsystem_coretls.dylib",
"/usr/lib/system/libsystem_dnssd.dylib",
"/usr/lib/system/libsystem_info.dylib",
"/usr/lib/system/libsystem_kernel.dylib",
"/usr/lib/system/libsystem_m.dylib",
"/usr/lib/system/libsystem_malloc.dylib",
"/usr/lib/system/libsystem_network.dylib",
"/usr/lib/system/libsystem_networkextension.dylib",
"/usr/lib/system/libsystem_notify.dylib",
"/usr/lib/system/libsystem_platform.dylib",
"/usr/lib/system/libsystem_pthread.dylib",
"/usr/lib/system/libsystem_sandbox.dylib",
"/usr/lib/system/libsystem_secinit.dylib",
"/usr/lib/system/libsystem_symptoms.dylib",
"/usr/lib/system/libsystem_trace.dylib",
"/usr/lib/system/libunwind.dylib",
"/usr/lib/system/libxpc.dylib",
"/usr/lib/libauto.dylib",
"/usr/lib/libc++abi.dylib",
"/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices",
"/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics",
"/System/Library/Frameworks/CoreText.framework/Versions/A/CoreText",
"/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO",
"/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS",
"/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync",
"/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices",
"/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices",
"/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis",
"/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore",
"/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD",
"/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis",
"/System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork",
"/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit",
"/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate",
"/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation",
"/usr/lib/libbsm.0.dylib",
"/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration",
"/System/Library/Frameworks/Security.framework/Versions/A/Security",
"/usr/lib/libsqlite3.dylib",
"/usr/lib/libxml2.2.dylib",
"/usr/lib/libnetwork.dylib",
"/usr/lib/libenergytrace.dylib",
"/usr/lib/system/libkxld.dylib",
"/usr/lib/libpcap.A.dylib",
"/usr/lib/libcoretls.dylib",
"/usr/lib/libcoretls_cfhelpers.dylib",
"/usr/lib/libxar.1.dylib",
"/usr/lib/libpam.2.dylib",
"/usr/lib/libOpenScriptingUtil.dylib",
"/usr/lib/libbz2.1.0.dylib",
"/usr/lib/liblzma.5.dylib",
"/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage",
"/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib",
"/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib",
"/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib",
"/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib",
"/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib",
"/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib",
"/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib",
"/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib",
"/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib",
"/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents",
"/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore",
"/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata",
"/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices",
"/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit",
"/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE",
"/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices",
"/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices",
"/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList",
"/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration",
"/System/Library/Frameworks/NetFS.framework/Versions/A/NetFS",
"/System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth",
"/System/Library/PrivateFrameworks/login.framework/Versions/A/Frameworks/loginsupport.framework/Versions/A/loginsupport",
"/usr/lib/libarchive.2.dylib",
"/usr/lib/liblangid.dylib",
"/usr/lib/libCRFSuite.dylib",
"/System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC",
"/usr/lib/libmecabra.dylib",
"/System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling",
"/usr/lib/libmarisa.dylib",
"/usr/lib/libChineseTokenizer.dylib",
"/usr/lib/libcmph.dylib",
"/usr/lib/libiconv.2.dylib",
"/System/Library/Frameworks/CoreData.framework/Versions/A/CoreData",
"/System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji",
"/usr/lib/libcompression.dylib",
"/System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory",
"/System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement",
"/usr/lib/libxslt.1.dylib",
"/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontParser.dylib",
"/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib",
"/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib",
"/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib",
"/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib",
"/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib",
"/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib",
"/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib",
"/System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG",
"/System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface",
"/System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport",
"/usr/lib/libcups.2.dylib",
"/System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos",
"/System/Library/Frameworks/GSS.framework/Versions/A/GSS",
"/usr/lib/libresolv.9.dylib",
"/System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal",
"/usr/lib/libheimdal-asn1.dylib",
"/System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory",
"/System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth",
"/System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation",
"/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio",
"/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox",
"/System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight",
"/System/Library/Frameworks/Metal.framework/Versions/A/Metal",
"/System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay",
"/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore",
"/System/Library/PrivateFrameworks/GPUCompiler.framework/libmetal_timestamp.dylib",
"/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreFSCache.dylib",
"/System/Library/PrivateFrameworks/IOAccelerator.framework/Versions/A/IOAccelerator",
"/System/Library/PrivateFrameworks/IOPresentment.framework/Versions/A/IOPresentment",
"/System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage",
"/System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo",
"/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL",
"/usr/lib/libFosl_dynamic.dylib",
"/System/Library/PrivateFrameworks/MetalPerformanceShaders.framework/Versions/A/MetalPerformanceShaders",
"/System/Library/PrivateFrameworks/FaceCore.framework/Versions/A/FaceCore",
"/System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL",
"/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib",
"/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib",
"/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib",
"/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib",
"/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib",
"/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib",
"/Users/samluke/Desktop/Projects/mango/v3/mango-ui-v2/node_modules/fsevents/fsevents.node",
"/Users/samluke/Desktop/Projects/mango/v3/mango-ui-v2/node_modules/bufferutil/prebuilds/darwin-x64/node.napi.node",
"/Users/samluke/Desktop/Projects/mango/v3/mango-ui-v2/node_modules/utf-8-validate/prebuilds/darwin-x64/node.napi.node",
"/Users/samluke/Desktop/Projects/mango/v3/mango-ui-v2/node_modules/secp256k1/prebuilds/darwin-x64/node.napi.node",
"/Users/samluke/Desktop/Projects/mango/v3/mango-ui-v2/node_modules/keccak/prebuilds/darwin-x64/node.napi.node"
]
}

View File

@ -211,8 +211,8 @@ export const copyToClipboard = (copyThis) => {
// Truncate decimals without rounding
export const trimDecimals = (n, digits) => {
var step = Math.pow(10, digits || 0)
var temp = Math.trunc(step * n)
const step = Math.pow(10, digits || 0)
const temp = Math.trunc(step * n)
return temp / step
}

View File

@ -17,11 +17,11 @@ import assert from 'assert'
import { struct } from 'superstruct'
class TransactionError extends Error {
public txid: string;
constructor (message: string, txid?: string) {
super(message);
this.txid = txid;
}
public txid: string
constructor(message: string, txid?: string) {
super(message)
this.txid = txid
}
}
export const getUnixTs = () => {
@ -168,15 +168,9 @@ export async function sendSignedTransaction({
}
}
}
throw new TransactionError(
JSON.stringify(simulateResult.err),
txid
)
throw new TransactionError(JSON.stringify(simulateResult.err), txid)
}
throw new TransactionError(
'Transaction failed',
txid
)
throw new TransactionError('Transaction failed', txid)
} finally {
done = true
}

View File

@ -25,7 +25,8 @@ interface PhantomProvider {
export class PhantomWalletAdapter
extends EventEmitter
implements WalletAdapter {
implements WalletAdapter
{
constructor() {
super()
this.connect = this.connect.bind(this)