mango-token-sale/hooks/usePool.tsx

23 lines
679 B
TypeScript
Raw Permalink Normal View History

2021-07-07 04:16:54 -07:00
import moment from 'moment'
import useWalletStore from '../stores/useWalletStore'
export default function usePool() {
const pool = useWalletStore((s) => s.pool)
2021-07-07 04:37:12 -07:00
2021-07-27 16:51:57 -07:00
const startIdo = pool ? moment.unix(pool.startIdoTs.toNumber()) : undefined
2021-07-07 04:16:54 -07:00
const endIdo = pool ? moment.unix(pool.endIdoTs.toNumber()) : undefined
const endDeposits = pool
? moment.unix(pool.endDepositsTs.toNumber())
: undefined
/*
2021-07-27 16:51:57 -07:00
// override for announcement
const unixTs = 1628553600
const startIdo = moment.unix(unixTs)
const endDeposits = moment.unix(unixTs).add(1, 'days')
const endIdo = moment.unix(unixTs).add(2, 'days')
*/
2021-07-07 04:31:48 -07:00
2021-07-07 04:16:54 -07:00
return { pool, startIdo, endIdo, endDeposits }
}