diff --git a/packages/xrpl/src/models/transactions/AMMInstanceCreate.ts b/packages/xrpl/src/models/transactions/AMMInstanceCreate.ts index 3ac676b4..dec294e9 100644 --- a/packages/xrpl/src/models/transactions/AMMInstanceCreate.ts +++ b/packages/xrpl/src/models/transactions/AMMInstanceCreate.ts @@ -3,7 +3,7 @@ import { Amount } from '../common' import { BaseTransaction, isAmount, validateBaseTransaction } from './common' -const MAX_TRADING_FEE = 65000 +export const AMM_MAX_TRADING_FEE = 65000 /** * AMMInstanceCreate is used to create AccountRoot and the corresponding @@ -68,9 +68,9 @@ export function validateAMMInstanceCreate(tx: Record): void { throw new ValidationError('AMMInstanceCreate: TradingFee must be a number') } - if (tx.TradingFee > MAX_TRADING_FEE) { + if (tx.TradingFee > AMM_MAX_TRADING_FEE) { throw new ValidationError( - `AMMInstanceCreate: TradingFee must not be greater than ${MAX_TRADING_FEE}`, + `AMMInstanceCreate: TradingFee must not be greater than ${AMM_MAX_TRADING_FEE}`, ) } } diff --git a/packages/xrpl/src/models/transactions/AMMVote.ts b/packages/xrpl/src/models/transactions/AMMVote.ts index e226f041..621ce232 100644 --- a/packages/xrpl/src/models/transactions/AMMVote.ts +++ b/packages/xrpl/src/models/transactions/AMMVote.ts @@ -1,9 +1,8 @@ import { ValidationError } from '../../errors' +import { AMM_MAX_TRADING_FEE } from './AMMInstanceCreate' import { BaseTransaction, validateBaseTransaction } from './common' -const MAX_TRADING_FEE = 65000 - /** * AMMVote is used for submitting a vote for the trading fee of an AMM Instance. * @@ -52,9 +51,9 @@ export function validateAMMVote(tx: Record): void { throw new ValidationError('AMMVote: FeeVal must be a number') } - if (tx.FeeVal > MAX_TRADING_FEE) { + if (tx.FeeVal > AMM_MAX_TRADING_FEE) { throw new ValidationError( - `AMMVote: FeeVal must not be greater than ${MAX_TRADING_FEE}`, + `AMMVote: FeeVal must not be greater than ${AMM_MAX_TRADING_FEE}`, ) } }