diff --git a/packages/xrpl/HISTORY.md b/packages/xrpl/HISTORY.md index 976c49c1..cd35e6b8 100644 --- a/packages/xrpl/HISTORY.md +++ b/packages/xrpl/HISTORY.md @@ -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) diff --git a/packages/xrpl/src/models/ledger/FeeSettings.ts b/packages/xrpl/src/models/ledger/FeeSettings.ts index 1fad6409..c853fea7 100644 --- a/packages/xrpl/src/models/ledger/FeeSettings.ts +++ b/packages/xrpl/src/models/ledger/FeeSettings.ts @@ -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 diff --git a/packages/xrpl/src/models/ledger/index.ts b/packages/xrpl/src/models/ledger/index.ts index 66e19aec..227e657e 100644 --- a/packages/xrpl/src/models/ledger/index.ts +++ b/packages/xrpl/src/models/ledger/index.ts @@ -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,