Types cleanup + more API methods onto new request method (#857)

* major types cleanup, more formatted api methods onto new request method

- getPaymentChannel() now uses this.request()
- getSettings() now uses this.request()
- getLedger() now uses this.request()
- transaction types cleaned up a bit, but still some work left to do
This commit is contained in:
Fred K. Schott
2018-03-14 16:08:57 -07:00
committed by Elliot Lee
parent c175e3f58e
commit 187154a2b0
34 changed files with 520 additions and 442 deletions

View File

@@ -49,7 +49,9 @@ import {
AccountInfoRequest, AccountInfoResponse,
AccountLinesRequest, AccountLinesResponse,
BookOffersRequest, BookOffersResponse,
GatewayBalancesRequest, GatewayBalancesResponse
GatewayBalancesRequest, GatewayBalancesResponse,
LedgerRequest, LedgerResponse,
LedgerEntryRequest, LedgerEntryResponse
} from './common/types/commands'
@@ -154,6 +156,10 @@ class RippleAPI extends EventEmitter {
Promise<BookOffersResponse>
async _request(command: 'gateway_balances', params: GatewayBalancesRequest):
Promise<GatewayBalancesResponse>
async _request(command: 'ledger', params: LedgerRequest):
Promise<LedgerResponse>
async _request(command: 'ledger_entry', params: LedgerEntryRequest):
Promise<LedgerEntryResponse>
async _request(command: string, params: any = {}) {
return this.connection.request({
...params,