mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-26 23:25:49 +00:00
rename MinBidPrice -> BidMin and MaxBidPrice -> BidMax
This commit is contained in:
@@ -1454,7 +1454,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"MinBidPrice",
|
"BidMin",
|
||||||
{
|
{
|
||||||
"nth": 12,
|
"nth": 12,
|
||||||
"isVLEncoded": false,
|
"isVLEncoded": false,
|
||||||
@@ -1464,7 +1464,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"MaxBidPrice",
|
"BidMax",
|
||||||
{
|
{
|
||||||
"nth": 13,
|
"nth": 13,
|
||||||
"isVLEncoded": false,
|
"isVLEncoded": false,
|
||||||
|
|||||||
@@ -32,17 +32,17 @@ export interface AMMBid extends BaseTransaction {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This field represents the minimum price that the bidder wants to pay for the slot.
|
* This field represents the minimum price that the bidder wants to pay for the slot.
|
||||||
* It is specified in units of LPToken. If specified let MinBidPrice be X and let
|
* It is specified in units of LPToken. If specified let BidMin be X and let
|
||||||
* the slot-price computed by price scheduling algorithm be Y, then bidder always pays
|
* the slot-price computed by price scheduling algorithm be Y, then bidder always pays
|
||||||
* the max(X, Y).
|
* the max(X, Y).
|
||||||
*/
|
*/
|
||||||
MinBidPrice?: Amount
|
BidMin?: Amount
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This field represents the maximum price that the bidder wants to pay for the slot.
|
* This field represents the maximum price that the bidder wants to pay for the slot.
|
||||||
* It is specified in units of LPToken.
|
* It is specified in units of LPToken.
|
||||||
*/
|
*/
|
||||||
MaxBidPrice?: Amount
|
BidMax?: Amount
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This field represents an array of XRPL account IDs that are authorized to trade
|
* This field represents an array of XRPL account IDs that are authorized to trade
|
||||||
@@ -61,12 +61,12 @@ export interface AMMBid extends BaseTransaction {
|
|||||||
export function validateAMMBid(tx: Record<string, unknown>): void {
|
export function validateAMMBid(tx: Record<string, unknown>): void {
|
||||||
validateBaseTransaction(tx)
|
validateBaseTransaction(tx)
|
||||||
|
|
||||||
if (tx.MinBidPrice != null && !isAmount(tx.MinBidPrice)) {
|
if (tx.BidMin != null && !isAmount(tx.BidMin)) {
|
||||||
throw new ValidationError('AMMBid: MinBidPrice must be an Amount')
|
throw new ValidationError('AMMBid: BidMin must be an Amount')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tx.MaxBidPrice != null && !isAmount(tx.MaxBidPrice)) {
|
if (tx.BidMax != null && !isAmount(tx.BidMax)) {
|
||||||
throw new ValidationError('AMMBid: MaxBidPrice must be an Amount')
|
throw new ValidationError('AMMBid: BidMax must be an Amount')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tx.AuthAccounts != null) {
|
if (tx.AuthAccounts != null) {
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ describe('AMMBid', function () {
|
|||||||
bid = {
|
bid = {
|
||||||
TransactionType: 'AMMBid',
|
TransactionType: 'AMMBid',
|
||||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||||
MinBidPrice: '5',
|
BidMin: '5',
|
||||||
MaxBidPrice: '10',
|
BidMax: '10',
|
||||||
AuthAccounts: [
|
AuthAccounts: [
|
||||||
{
|
{
|
||||||
AuthAccount: {
|
AuthAccount: {
|
||||||
@@ -45,21 +45,21 @@ describe('AMMBid', function () {
|
|||||||
assert.doesNotThrow(() => validate(bid))
|
assert.doesNotThrow(() => validate(bid))
|
||||||
})
|
})
|
||||||
|
|
||||||
it(`throws w/ MinBidPrice must be an Amount`, function () {
|
it(`throws w/ BidMin must be an Amount`, function () {
|
||||||
bid.MinBidPrice = 5
|
bid.BidMin = 5
|
||||||
assert.throws(
|
assert.throws(
|
||||||
() => validate(bid),
|
() => validate(bid),
|
||||||
ValidationError,
|
ValidationError,
|
||||||
'AMMBid: MinBidPrice must be an Amount',
|
'AMMBid: BidMin must be an Amount',
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it(`throws w/ MaxBidPrice must be an Amount`, function () {
|
it(`throws w/ BidMax must be an Amount`, function () {
|
||||||
bid.MaxBidPrice = 10
|
bid.BidMax = 10
|
||||||
assert.throws(
|
assert.throws(
|
||||||
() => validate(bid),
|
() => validate(bid),
|
||||||
ValidationError,
|
ValidationError,
|
||||||
'AMMBid: MaxBidPrice must be an Amount',
|
'AMMBid: BidMax must be an Amount',
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user