fix missing uritoken ledger entry

This commit is contained in:
Denis Angell
2023-07-07 17:38:51 +02:00
parent 9cdbd6347b
commit 4dd8ac243f
4 changed files with 101 additions and 28 deletions

View File

@@ -0,0 +1,53 @@
import { Amount } from '../common'
import BaseLedgerEntry from './BaseLedgerEntry'
/**
* The HookState object type contains the
*
* @category Ledger Entries
*/
export default interface HookState extends BaseLedgerEntry {
LedgerEntryType: 'URIToken'
/**
*/
Owner: string
/**
* A hint indicating which page of the sender's owner directory links to this
* object, in case the directory consists of multiple pages.
*/
OwnerNode: string
/**
*/
Issuer: string
/**
*/
URI: string
/**
*/
Digest: string
/**
*/
Amount: Amount
/**
*/
Destination: string
/**
* The identifying hash of the transaction that most recently modified this
* object.
*/
PreviousTxnID: string
/**
* The index of the ledger that contains the transaction that most recently
* modified this object.
*/
PreviousTxnLgrSeq: number
}

View File

@@ -21,6 +21,7 @@ import PayChannel from './PayChannel'
import RippleState, { RippleStateFlags } from './RippleState' import RippleState, { RippleStateFlags } from './RippleState'
import SignerList, { SignerListFlags } from './SignerList' import SignerList, { SignerListFlags } from './SignerList'
import Ticket from './Ticket' import Ticket from './Ticket'
import URIToken from './URIToken'
export { export {
AccountRoot, AccountRoot,
@@ -48,4 +49,5 @@ export {
SignerList, SignerList,
SignerListFlags, SignerListFlags,
Ticket, Ticket,
URIToken,
} }

View File

@@ -8,6 +8,7 @@ import {
RippleState, RippleState,
SignerList, SignerList,
Ticket, Ticket,
URIToken,
} from '../ledger' } from '../ledger'
import { BaseRequest, BaseResponse } from './baseMethod' import { BaseRequest, BaseResponse } from './baseMethod'
@@ -22,6 +23,7 @@ type AccountObjectType =
| 'signer_list' | 'signer_list'
| 'state' | 'state'
| 'ticket' | 'ticket'
| 'uritoken'
/** /**
* The account_objects command returns the raw ledger format for all objects * The account_objects command returns the raw ledger format for all objects
@@ -78,6 +80,7 @@ type AccountObject =
| SignerList | SignerList
| RippleState | RippleState
| Ticket | Ticket
| URIToken
/** /**
* Response expected from an {@link AccountObjectsRequest}. * Response expected from an {@link AccountObjectsRequest}.

View File

@@ -79,6 +79,11 @@ export interface LedgerEntryRequest extends BaseRequest {
} }
| string | string
/**
* The object ID of a transaction emitted by the ledger entry.
*/
emitted_txn?: string
/** /**
* The Escrow object to retrieve. If a string, must be the object ID of the * 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, as hexadecimal. If an object, requires owner and seq sub-fields.
@@ -92,6 +97,36 @@ export interface LedgerEntryRequest extends BaseRequest {
} }
| string | string
/**
* The hash of the Hook object to retrieve.
*/
hook_definition?: string
/**
* The Hook object to retrieve. If a string, must be the object ID of the Hook.
* If an object, requires `account` sub-field.
*/
hook?:
| {
/** The account of the Hook object. */
account: string
}
| string
/**
* Object specifying the HookState object to retrieve. Requires the sub-fields
* `account`, `key`, and `namespace_id` to uniquely specify the HookState entry
* to retrieve.
*/
hook_state?: {
/** The account of the Hook object. */
account: string
/** The key of the state. */
key: string
/** The namespace of the state. */
namespace_id: 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`
@@ -137,40 +172,20 @@ export interface LedgerEntryRequest extends BaseRequest {
ticket_sequence: number ticket_sequence: number
} }
| string | string
/**
* The object ID of a transaction emitted by the ledger entry.
*/
emitted_txn?: string
/** /**
* The hash of the Hook object to retrieve. * The URIToken object to retrieve. If a string, must be the object ID of the
* URIToken, as hexadecimal. If an object, the `issuer` and `uri`
* sub-fields are required to uniquely specify the URIToken entry.
*/ */
hook_definition?: string uritoken?:
/**
* The Hook object to retrieve. If a string, must be the object ID of the Hook.
* If an object, requires `account` sub-field.
*/
hook?:
| { | {
/** The account of the Hook object. */ /** The issuer of the URIToken object. */
account: string issuer: string
/** The URIToken uri string (ascii). */
uri: string
} }
| string | string
/**
* Object specifying the HookState object to retrieve. Requires the sub-fields
* `account`, `key`, and `namespace_id` to uniquely specify the HookState entry
* to retrieve.
*/
hook_state?: {
/** The account of the Hook object. */
account: string
/** The key of the state. */
key: string
/** The namespace of the state. */
namespace_id: string
}
} }
/** /**