mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
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:
@@ -1,16 +1,5 @@
|
|||||||
export type LedgerIndex = number | ('validated' | 'closed' | 'current')
|
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 {
|
interface XRP {
|
||||||
currency: 'XRP'
|
currency: 'XRP'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AccountObjectType, LedgerIndex } from '../common'
|
import { LedgerIndex } from '../common'
|
||||||
import {
|
import {
|
||||||
Check,
|
Check,
|
||||||
DepositPreauth,
|
DepositPreauth,
|
||||||
@@ -12,6 +12,17 @@ import {
|
|||||||
|
|
||||||
import { BaseRequest, BaseResponse } from './baseMethod'
|
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
|
* 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
|
* owned by an account. For a higher-level view of an account's trust lines and
|
||||||
@@ -65,8 +76,8 @@ type AccountObject =
|
|||||||
| Offer
|
| Offer
|
||||||
| PayChannel
|
| PayChannel
|
||||||
| SignerList
|
| SignerList
|
||||||
| Ticket
|
|
||||||
| RippleState
|
| RippleState
|
||||||
|
| Ticket
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Response expected from an {@link AccountObjectsRequest}.
|
* Response expected from an {@link AccountObjectsRequest}.
|
||||||
|
|||||||
@@ -46,6 +46,23 @@ export interface LedgerEntryRequest extends BaseRequest {
|
|||||||
*/
|
*/
|
||||||
account_root?: string
|
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
|
* 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
|
* directory, as hexadecimal. If an object, requires either `dir_root` o
|
||||||
@@ -62,6 +79,19 @@ export interface LedgerEntryRequest extends BaseRequest {
|
|||||||
}
|
}
|
||||||
| string
|
| 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
|
* 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`
|
* ID to the Offer. If an object, requires the sub-fields `account` and `seq`
|
||||||
@@ -76,6 +106,9 @@ export interface LedgerEntryRequest extends BaseRequest {
|
|||||||
}
|
}
|
||||||
| string
|
| string
|
||||||
|
|
||||||
|
/** The object ID of a PayChannel object to retrieve. */
|
||||||
|
payment_channel?: string
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Object specifying the RippleState (trust line) object to retrieve. The
|
* Object specifying the RippleState (trust line) object to retrieve. The
|
||||||
* accounts and currency sub-fields are required to uniquely specify the
|
* accounts and currency sub-fields are required to uniquely specify the
|
||||||
@@ -91,39 +124,6 @@ export interface LedgerEntryRequest extends BaseRequest {
|
|||||||
currency: string
|
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
|
* 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`
|
* Ticket, as hexadecimal. If an object, the `owner` and `ticket_sequence`
|
||||||
|
|||||||
Reference in New Issue
Block a user