def all_accounts
      all = []
      single_proxy("LIST_ACCOUNTS", {}, nil, true).each do |account|
        all << account
        sub_accounts = single_proxy("GET_SUB_ACCOUNTS_OF_ACCOUNT",
                             {
                                account_id: account["id"],
                                recursive: true,
                             },
                             nil,
                             true)
        all = all.concat(sub_accounts)
      end
      all
    end
def all_accounts
      all = []
      single_proxy("LIST_ACCOUNTS", {}, nil, true).each do |account|
        all << account
        sub_accounts = single_proxy("GET_SUB_ACCOUNTS_OF_ACCOUNT",
                             {
                                account_id: account["id"],
                                recursive: true,
                             },
                             nil,
                             true)
        all = all.concat(sub_accounts)
      end
      all
    end
Helper methods

 Get all accounts including sub accounts