using CxxWrap
using CxxWrap.CxxWrapCore: SafeCFunction
using BenchmarkTools

using Emporos
using Emporos.IBKR
using Emporos.IBKR: IBKRCore

const account = "U6403725"

function main()
    ib = IB(port=7496)
    ib() do
        IBKRCore.reqManagedAccounts(ib.client)
        IBKRCore.reqAccountSummary(ib.client, 1, "All", "TotalCashValue")
        sleep(1)
        IBKRCore.reqAccountSummary(ib.client, 1, "All", "TotalCashValue")
        IBKRCore.reqAccountSummary(ib.client, 1, "All", "TotalCashValue")
        sleep(5)
        IBKRCore.reqAccountSummary(ib.client, 1, "All", "TotalCashValue")
    end
    @info "DONE main"
end

main()
