Add missing fields to TxSubscription and Tx requests (#1893)

* Update: Add hash and date type to TxSubscription and Tx responses.

The base transaction interface has been updated to include a hash type.

   * Every signed transaction has a unique "hash" that identifies it. 
   * The transaction hash can be used as a "proof of payment" to verify the final status.

Co-authored-by: interc0der <86900618+interc0der@users.noreply.github.com>
Co-authored-by: Elliot Lee <github.public@intelliot.com>
This commit is contained in:
Jackson Mills
2022-01-07 10:50:26 -08:00
committed by GitHub
parent 7041a0bbd3
commit 803ea6d2cb
2 changed files with 26 additions and 2 deletions

View File

@@ -268,7 +268,17 @@ export interface TransactionStream extends BaseStream {
*/ */
meta?: TransactionMetadata meta?: TransactionMetadata
/** The definition of the transaction in JSON format. */ /** The definition of the transaction in JSON format. */
transaction: Transaction transaction: Transaction & {
/**
* This number measures the number of seconds since the "Ripple Epoch" of January 1, 2000 (00:00 UTC)
*/
date?: number
/**
* Every signed transaction has a unique "hash" that identifies it.
* The transaction hash can be used to look up its final status, which may serve as a "proof of payment"
*/
hash?: string
}
/** /**
* If true, this transaction is included in a validated ledger and its * If true, this transaction is included in a validated ledger and its
* outcome is final. Responses from the transaction stream should always be * outcome is final. Responses from the transaction stream should always be
@@ -336,7 +346,17 @@ export interface OrderBookStream extends BaseStream {
ledger_hash?: string ledger_hash?: string
ledger_index?: number ledger_index?: number
meta: TransactionMetadata meta: TransactionMetadata
transaction: Transaction | ModifiedOfferCreateTransaction transaction: (Transaction | ModifiedOfferCreateTransaction) & {
/**
* This number measures the number of seconds since the "Ripple Epoch" of January 1, 2000 (00:00 UTC)
*/
date?: number
/**
* Every signed transaction has a unique "hash" that identifies it.
* The transaction hash can be used to look up its final status, which may serve as a "proof of payment"
*/
hash?: string
}
validated: boolean validated: boolean
} }

View File

@@ -51,6 +51,10 @@ export interface TxResponse extends BaseResponse {
* Set to false, this data is not final. * Set to false, this data is not final.
*/ */
validated?: boolean validated?: boolean
/**
* This number measures the number of seconds since the "Ripple Epoch" of January 1, 2000 (00:00 UTC)
*/
date?: number
} & Transaction } & Transaction
/** /**
* If true, the server was able to search all of the specified ledger * If true, the server was able to search all of the specified ledger