refactor: alphabetize ledger_entry commands and reorganize account_objects (#2206)

* move AccountObjectType to accountObjects.ts

* alphabetize ledgerEntry

* remove extra account object type
This commit is contained in:
Mayukha Vadari
2023-02-15 12:10:06 -05:00
committed by GitHub
parent 8fe87c0e86
commit b1af321eb0
3 changed files with 46 additions and 46 deletions

View File

@@ -1,16 +1,5 @@
export type LedgerIndex = number | ('validated' | 'closed' | 'current')
export type AccountObjectType =
| 'check'
| 'deposit_preauth'
| 'escrow'
| 'nft_offer'
| 'offer'
| 'payment_channel'
| 'signer_list'
| 'ticket'
| 'state'
interface XRP {
currency: 'XRP'
}

View File

@@ -1,4 +1,4 @@
import { AccountObjectType, LedgerIndex } from '../common'
import { LedgerIndex } from '../common'
import {
Check,
DepositPreauth,
@@ -12,6 +12,17 @@ import {
import { BaseRequest, BaseResponse } from './baseMethod'
type AccountObjectType =
| 'check'
| 'deposit_preauth'
| 'escrow'
| 'nft_offer'
| 'offer'
| 'payment_channel'
| 'signer_list'
| 'state'
| 'ticket'
/**
* The account_objects command returns the raw ledger format for all objects
* owned by an account. For a higher-level view of an account's trust lines and
@@ -65,8 +76,8 @@ type AccountObject =
| Offer
| PayChannel
| SignerList
| Ticket
| RippleState
| Ticket
/**
* Response expected from an {@link AccountObjectsRequest}.

View File

@@ -46,6 +46,23 @@ export interface LedgerEntryRequest extends BaseRequest {
*/
account_root?: string
/** The object ID of a Check object to retrieve. */
check?: string
/**
* Specify a DepositPreauth object to retrieve. If a string, must be the
* object ID of the DepositPreauth object, as hexadecimal. If an object,
* requires owner and authorized sub-fields.
*/
deposit_preauth?:
| {
/** The account that provided the preauthorization. */
owner: string
/** The account that received the preauthorization. */
authorized: string
}
| string
/**
* The DirectoryNode to retrieve. If a string, must be the object ID of the
* directory, as hexadecimal. If an object, requires either `dir_root` o
@@ -62,6 +79,19 @@ export interface LedgerEntryRequest extends BaseRequest {
}
| string
/**
* The Escrow object to retrieve. If a string, must be the object ID of the
* escrow, as hexadecimal. If an object, requires owner and seq sub-fields.
*/
escrow?:
| {
/** The owner (sender) of the Escrow object. */
owner: string
/** Sequence Number of the transaction that created the Escrow object. */
seq: number
}
| string
/**
* The Offer object to retrieve. If a string, interpret as the unique object
* ID to the Offer. If an object, requires the sub-fields `account` and `seq`
@@ -76,6 +106,9 @@ export interface LedgerEntryRequest extends BaseRequest {
}
| string
/** The object ID of a PayChannel object to retrieve. */
payment_channel?: string
/**
* Object specifying the RippleState (trust line) object to retrieve. The
* accounts and currency sub-fields are required to uniquely specify the
@@ -91,39 +124,6 @@ export interface LedgerEntryRequest extends BaseRequest {
currency: string
}
/** The object ID of a Check object to retrieve. */
check?: string
/**
* The Escrow object to retrieve. If a string, must be the object ID of the
* escrow, as hexadecimal. If an object, requires owner and seq sub-fields.
*/
escrow?:
| {
/** The owner (sender) of the Escrow object. */
owner: string
/** Sequence Number of the transaction that created the Escrow object. */
seq: number
}
| string
/** The object ID of a PayChannel object to retrieve. */
payment_channel?: string
/**
* Specify a DepositPreauth object to retrieve. If a string, must be the
* object ID of the DepositPreauth object, as hexadecimal. If an object,
* requires owner and authorized sub-fields.
*/
deposit_preauth?:
| {
/** The account that provided the preauthorization. */
owner: string
/** The account that received the preauthorization. */
authorized: string
}
| string
/**
* The Ticket object to retrieve. If a string, must be the object ID of the
* Ticket, as hexadecimal. If an object, the `owner` and `ticket_sequence`