mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-04 13:05:49 +00:00
update asset pair to use Currency type
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Amount, IssuedCurrency, IssuedCurrencyAmount } from '../common'
|
||||
import { Amount, Currency, IssuedCurrencyAmount } from '../common'
|
||||
|
||||
import { BaseRequest, BaseResponse } from './baseMethod'
|
||||
|
||||
@@ -15,13 +15,13 @@ export interface AMMInfoRequest extends BaseRequest {
|
||||
* Specifies one of the pool assets (XRP or token) of the AMM instance.
|
||||
* Both asset and asset2 must be defined to specify an AMM instance.
|
||||
*/
|
||||
asset?: IssuedCurrency
|
||||
asset: Currency
|
||||
|
||||
/**
|
||||
* Specifies the other pool asset of the AMM instance.
|
||||
* Both asset and asset2 must be defined to specify an AMM instance.
|
||||
*/
|
||||
asset2?: IssuedCurrency
|
||||
asset2: Currency
|
||||
}
|
||||
|
||||
interface AuthAccount {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable complexity -- required for validateAMMBid */
|
||||
import { ValidationError } from '../../errors'
|
||||
import { Amount, IssuedCurrency } from '../common'
|
||||
import { Amount, Currency } from '../common'
|
||||
|
||||
import {
|
||||
BaseTransaction,
|
||||
@@ -29,12 +29,12 @@ export interface AMMBid extends BaseTransaction {
|
||||
/**
|
||||
* Specifies one of the pool assets (XRP or token) of the AMM instance.
|
||||
*/
|
||||
Asset: IssuedCurrency
|
||||
Asset: Currency
|
||||
|
||||
/**
|
||||
* Specifies the other pool asset of the AMM instance.
|
||||
*/
|
||||
Asset2: IssuedCurrency
|
||||
Asset2: Currency
|
||||
|
||||
/**
|
||||
* This field represents the minimum price that the bidder wants to pay for the slot.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable complexity -- required for validateAMMDeposit */
|
||||
import { ValidationError } from '../../errors'
|
||||
import { Amount, IssuedCurrency, IssuedCurrencyAmount } from '../common'
|
||||
import { Amount, Currency, IssuedCurrencyAmount } from '../common'
|
||||
|
||||
import {
|
||||
BaseTransaction,
|
||||
@@ -49,12 +49,12 @@ export interface AMMDeposit extends BaseTransaction {
|
||||
/**
|
||||
* Specifies one of the pool assets (XRP or token) of the AMM instance.
|
||||
*/
|
||||
Asset: IssuedCurrency
|
||||
Asset: Currency
|
||||
|
||||
/**
|
||||
* Specifies the other pool asset of the AMM instance.
|
||||
*/
|
||||
Asset2: IssuedCurrency
|
||||
Asset2: Currency
|
||||
|
||||
/**
|
||||
* Specifies the amount of shares of the AMM instance pools that the trader
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ValidationError } from '../../errors'
|
||||
import { IssuedCurrency } from '../common'
|
||||
import { Currency } from '../common'
|
||||
|
||||
import { AMM_MAX_TRADING_FEE } from './AMMCreate'
|
||||
import { BaseTransaction, isIssue, validateBaseTransaction } from './common'
|
||||
@@ -16,12 +16,12 @@ export interface AMMVote extends BaseTransaction {
|
||||
/**
|
||||
* Specifies one of the pool assets (XRP or token) of the AMM instance.
|
||||
*/
|
||||
Asset: IssuedCurrency
|
||||
Asset: Currency
|
||||
|
||||
/**
|
||||
* Specifies the other pool asset of the AMM instance.
|
||||
*/
|
||||
Asset2: IssuedCurrency
|
||||
Asset2: Currency
|
||||
|
||||
/**
|
||||
* Specifies the fee, in basis point.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable complexity -- required for validateAMMWithdraw */
|
||||
import { ValidationError } from '../../errors'
|
||||
import { Amount, IssuedCurrency, IssuedCurrencyAmount } from '../common'
|
||||
import { Amount, Currency, IssuedCurrencyAmount } from '../common'
|
||||
|
||||
import {
|
||||
BaseTransaction,
|
||||
@@ -54,12 +54,12 @@ export interface AMMWithdraw extends BaseTransaction {
|
||||
/**
|
||||
* Specifies one of the pool assets (XRP or token) of the AMM instance.
|
||||
*/
|
||||
Asset: IssuedCurrency
|
||||
Asset: Currency
|
||||
|
||||
/**
|
||||
* Specifies the other pool asset of the AMM instance.
|
||||
*/
|
||||
Asset2: IssuedCurrency
|
||||
Asset2: Currency
|
||||
|
||||
/**
|
||||
* Specifies the amount of shares of the AMM instance pools that the trader
|
||||
|
||||
@@ -4,13 +4,7 @@
|
||||
import { TRANSACTION_TYPES } from 'ripple-binary-codec'
|
||||
|
||||
import { ValidationError } from '../../errors'
|
||||
import {
|
||||
Amount,
|
||||
IssuedCurrency,
|
||||
IssuedCurrencyAmount,
|
||||
Memo,
|
||||
Signer,
|
||||
} from '../common'
|
||||
import { Amount, Currency, IssuedCurrencyAmount, Memo, Signer } from '../common'
|
||||
import { onlyHasFields } from '../utils'
|
||||
|
||||
const MEMO_SIZE = 3
|
||||
@@ -70,7 +64,7 @@ function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
* @param input - The input to check the form and type of.
|
||||
* @returns Whether the IssuedCurrency is properly formed.
|
||||
*/
|
||||
export function isIssue(input: unknown): input is IssuedCurrency {
|
||||
export function isIssue(input: unknown): input is Currency {
|
||||
return (
|
||||
isRecord(input) &&
|
||||
((Object.keys(input).length === ISSUE_SIZE &&
|
||||
|
||||
Reference in New Issue
Block a user