fix: add AMM to BaseLedgerEntry and AccountObject types (#2449)

- Add AMM to BaseLedgerEntry and AccountObject types.
- Add amm_account to amm_info request
- Add AMMID to AccountRoot

Co-authored-by: Caleb Kniffen <ckniffen@ripple.com>
This commit is contained in:
Omar Khan
2023-09-07 17:35:15 -04:00
committed by GitHub
parent 8e5aa9df99
commit e52b27e097
5 changed files with 27 additions and 2 deletions

View File

@@ -75,4 +75,12 @@ export default interface AMM extends BaseLedgerEntry {
* type, so this value is always 0.
*/
Flags: 0
/**
* This field is missing on AMM but is present on all other account_object returned objects.
*/
PreviousTxnID: never
/**
* This field is missing on AMM but is present on all other account_object returned objects.
*/
PreviousTxnLgrSeq: never
}

View File

@@ -38,6 +38,12 @@ export default interface AccountRoot extends BaseLedgerEntry {
* `asfAccountTxnID` flag enabled.
*/
AccountTxnID?: string
/**
* The ledger entry ID of the corresponding AMM ledger entry.
* Set during account creation; cannot be modified.
* If present, indicates that this is a special AMM AccountRoot; always omitted on non-AMM accounts.
*/
AMMID?: string
/**
* A domain associated with this account. In JSON, this is the hexadecimal
* for the ASCII representation of the domain.

View File

@@ -3,6 +3,7 @@ import AccountRoot, {
AccountRootFlagsInterface,
} from './AccountRoot'
import Amendments, { Majority, AMENDMENTS_ID } from './Amendments'
import AMM, { VoteSlot } from './AMM'
import Check from './Check'
import DepositPreauth from './DepositPreauth'
import DirectoryNode from './DirectoryNode'
@@ -30,6 +31,7 @@ export {
AccountRootFlagsInterface,
AMENDMENTS_ID,
Amendments,
AMM,
Check,
DepositPreauth,
DirectoryNode,
@@ -55,4 +57,5 @@ export {
SignerList,
SignerListFlags,
Ticket,
VoteSlot,
}

View File

@@ -1,4 +1,5 @@
import {
AMM,
Check,
DepositPreauth,
Escrow,
@@ -12,6 +13,7 @@ import {
import { BaseRequest, BaseResponse, LookupByLedgerRequest } from './baseMethod'
export type AccountObjectType =
| 'amm'
| 'check'
| 'deposit_preauth'
| 'escrow'
@@ -64,6 +66,7 @@ export interface AccountObjectsRequest
* PayChannel, a SignerList, a Ticket, or a RippleState.
*/
export type AccountObject =
| AMM
| Check
| DepositPreauth
| Escrow

View File

@@ -11,15 +11,20 @@ import { BaseRequest, BaseResponse } from './baseMethod'
export interface AMMInfoRequest extends BaseRequest {
command: 'amm_info'
/**
* The address of the AMM Account to look up.
*/
amm_account?: string
/**
* One of the assets of the AMM pool to look up.
*/
asset: Currency
asset?: Currency
/**
* The other asset of the AMM pool.
*/
asset2: Currency
asset2?: Currency
}
/**