mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
Add tx info which is only available in requests (#1962)
* Add Response Only info
This commit is contained in:
@@ -66,6 +66,26 @@ export interface SignerEntry {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This information is added to Transactions in request responses, but is not part
|
||||||
|
* of the canonical Transaction information on ledger. These fields are denoted with
|
||||||
|
* lowercase letters to indicate this in the rippled responses.
|
||||||
|
*/
|
||||||
|
export interface ResponseOnlyTxInfo {
|
||||||
|
/**
|
||||||
|
* The date/time when this transaction was included in a validated ledger.
|
||||||
|
*/
|
||||||
|
date?: number
|
||||||
|
/**
|
||||||
|
* An identifying hash value unique to this transaction, as a hex string.
|
||||||
|
*/
|
||||||
|
hash?: string
|
||||||
|
/**
|
||||||
|
* The sequence number of the ledger that included this transaction.
|
||||||
|
*/
|
||||||
|
ledger_index?: number
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* One offer that might be returned from either an {@link NFTBuyOffersRequest}
|
* One offer that might be returned from either an {@link NFTBuyOffersRequest}
|
||||||
* or an {@link NFTSellOffersRequest}.
|
* or an {@link NFTSellOffersRequest}.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { LedgerIndex } from '../common'
|
import { LedgerIndex, ResponseOnlyTxInfo } from '../common'
|
||||||
import { Transaction, TransactionMetadata } from '../transactions'
|
import { Transaction, TransactionMetadata } from '../transactions'
|
||||||
|
|
||||||
import { BaseRequest, BaseResponse } from './baseMethod'
|
import { BaseRequest, BaseResponse } from './baseMethod'
|
||||||
@@ -62,7 +62,7 @@ interface AccountTransaction {
|
|||||||
*/
|
*/
|
||||||
meta: string | TransactionMetadata
|
meta: string | TransactionMetadata
|
||||||
/** JSON object defining the transaction. */
|
/** JSON object defining the transaction. */
|
||||||
tx?: Transaction
|
tx?: Transaction & ResponseOnlyTxInfo
|
||||||
/** Unique hashed String representing the transaction. */
|
/** Unique hashed String representing the transaction. */
|
||||||
tx_blob?: string
|
tx_blob?: string
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { LedgerIndex } from '../common'
|
import { LedgerIndex, ResponseOnlyTxInfo } from '../common'
|
||||||
import { Transaction } from '../transactions'
|
import { Transaction } from '../transactions'
|
||||||
|
|
||||||
import { BaseRequest, BaseResponse } from './baseMethod'
|
import { BaseRequest, BaseResponse } from './baseMethod'
|
||||||
@@ -77,6 +77,6 @@ export interface NoRippleCheckResponse extends BaseResponse {
|
|||||||
* the problems array, and each entry is intended to fix the problem
|
* the problems array, and each entry is intended to fix the problem
|
||||||
* described at the same index into that array.
|
* described at the same index into that array.
|
||||||
*/
|
*/
|
||||||
transactions: Transaction[]
|
transactions: Array<Transaction & ResponseOnlyTxInfo>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
import type { Amount, Currency, Path, StreamType } from '../common'
|
import type {
|
||||||
|
Amount,
|
||||||
|
Currency,
|
||||||
|
Path,
|
||||||
|
StreamType,
|
||||||
|
ResponseOnlyTxInfo,
|
||||||
|
} from '../common'
|
||||||
import { Offer } from '../ledger'
|
import { Offer } from '../ledger'
|
||||||
import { OfferCreate, Transaction } from '../transactions'
|
import { OfferCreate, Transaction } from '../transactions'
|
||||||
import { TransactionMetadata } from '../transactions/metadata'
|
import { TransactionMetadata } from '../transactions/metadata'
|
||||||
@@ -268,17 +274,7 @@ 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 & ResponseOnlyTxInfo
|
||||||
/**
|
|
||||||
* 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
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { LedgerIndex } from '../common'
|
import { LedgerIndex, ResponseOnlyTxInfo } from '../common'
|
||||||
import { Transaction, TransactionMetadata } from '../transactions'
|
import { Transaction, TransactionMetadata } from '../transactions'
|
||||||
|
|
||||||
import { BaseRequest, BaseResponse } from './baseMethod'
|
import { BaseRequest, BaseResponse } from './baseMethod'
|
||||||
@@ -46,6 +46,6 @@ export interface TransactionEntryResponse extends BaseResponse {
|
|||||||
*/
|
*/
|
||||||
metadata: TransactionMetadata
|
metadata: TransactionMetadata
|
||||||
/** JSON representation of the Transaction object. */
|
/** JSON representation of the Transaction object. */
|
||||||
tx_json: Transaction
|
tx_json: Transaction & ResponseOnlyTxInfo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user