feat(types): Update FeeSettings and add id (#2357)

Adds the new fields for `XRPFees` amendment and id for the `FeeSettings`
singleton ledger entry.

Closes #2219
This commit is contained in:
Caleb Kniffen
2023-06-29 16:27:00 -05:00
committed by GitHub
parent 70500dcc15
commit 23256aed5d
3 changed files with 49 additions and 18 deletions

View File

@@ -13,6 +13,8 @@ Subscribe to [the **xrpl-announce** mailing list](https://groups.google.com/g/xr
* Add type for NFToken object that is stored on a `NFTokenPage`.
* Add type for `account_info`'s `account_flags` property.
* Add types for `EnableAmendment`, `SetFee`, and `UNLModify` transactions.
* Add the new fields for `XRPFees` amendment and id for the `FeeSettings`
* Add `FeeSettings` singleton ledger entry id.
## 2.8.0 (2023-06-13)

View File

@@ -1,17 +1,10 @@
import BaseLedgerEntry from './BaseLedgerEntry'
/**
* The FeeSettings object type contains the current base transaction cost and
* reserve amounts as determined by fee voting.
*
* @category Ledger Entries
*/
export default interface FeeSettings extends BaseLedgerEntry {
LedgerEntryType: 'FeeSettings'
/**
* The transaction cost of the "reference transaction" in drops of XRP as
* hexadecimal.
*/
export const FEE_SETTINGS_ID =
'4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A651'
export interface FeeSettingsPreAmendmentFields {
/** The transaction cost of the "reference transaction" in drops of XRP as hexadecimal. */
BaseFee: string
/** The BaseFee translated into "fee units". */
ReferenceFeeUnits: number
@@ -19,9 +12,38 @@ export default interface FeeSettings extends BaseLedgerEntry {
ReserveBase: number
/** The incremental owner reserve for owning objects, as drops of XRP. */
ReserveIncrement: number
/**
* A bit-map of boolean flags for this object. No flags are defined for this
* type.
*/
Flags: number
}
export interface FeeSettingsPostAmendmentFields {
/** The transaction cost of the "reference transaction" in drops of XRP as hexadecimal. */
BaseFeeDrops: string
/** The base reserve for an account in the XRP Ledger, as drops of XRP. */
ReserveBaseDrops: string
/** The incremental owner reserve for owning objects, as drops of XRP. */
ReserveIncrementDrops: string
}
export interface FeeSettingsBase extends BaseLedgerEntry {
LedgerEntryType: 'FeeSettings'
/**
* A bit-map of boolean flags for this object. No flags are defined for this type.
*/
Flags: 0
}
/**
* The FeeSettings object type contains the current base transaction cost and
* reserve amounts as determined by fee voting.
*
* The fields will be based on the status of the `XRPFees` amendment.
* - Before: {@link FeeSettingsPreAmendmentFields}
* - After: {@link FeeSettingsPostAmendmentFields}
*
* @interface
*
* @category Ledger Entries
*/
type FeeSettings = FeeSettingsBase &
(FeeSettingsPreAmendmentFields | FeeSettingsPostAmendmentFields)
export default FeeSettings

View File

@@ -7,7 +7,11 @@ import Check from './Check'
import DepositPreauth from './DepositPreauth'
import DirectoryNode from './DirectoryNode'
import Escrow from './Escrow'
import FeeSettings from './FeeSettings'
import FeeSettings, {
FeeSettingsPreAmendmentFields,
FeeSettingsPostAmendmentFields,
FEE_SETTINGS_ID,
} from './FeeSettings'
import Ledger from './Ledger'
import LedgerEntry from './LedgerEntry'
import LedgerHashes from './LedgerHashes'
@@ -29,7 +33,10 @@ export {
DepositPreauth,
DirectoryNode,
Escrow,
FEE_SETTINGS_ID,
FeeSettings,
FeeSettingsPreAmendmentFields,
FeeSettingsPostAmendmentFields,
Ledger,
LedgerEntry,
LedgerHashes,