Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/xrpl/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Subscribe to [the **xrpl-announce** mailing list](https://groups.google.com/g/xr
* `OracleSet` transaction accepts hexadecimal string values for `AssetPrice` field
* `TransactionStream` model includes `hash` field in APIv2
* `TransactionStream` model includes `close_time_iso` field only for APIv2
* Adds `MPTCurrency` type

## 4.2.0 (2025-2-13)

Expand Down
6 changes: 5 additions & 1 deletion packages/xrpl/src/models/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ export interface IssuedCurrency {
issuer: string
}

export type Currency = IssuedCurrency | XRP
export interface MPTCurrency {
mpt_issuance_id: string
}

export type Currency = IssuedCurrency | MPTCurrency | XRP

export interface IssuedCurrencyAmount extends IssuedCurrency {
value: string
Expand Down
1 change: 0 additions & 1 deletion packages/xrpl/test/integration/requests/ammInfo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ describe('AMMInfo', function () {
assert.equal(amm.amount, '1250')
assert.deepEqual(amm.amount2, {
currency: asset2.currency,
// @ts-expect-error: asset2.issuer should be defined at this point
issuer: asset2.issuer,
value: '250',
})
Expand Down
7 changes: 4 additions & 3 deletions packages/xrpl/test/integration/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import {
AMMDeposit,
AMMDepositFlags,
Client,
Currency,
IssuedCurrency,
SignerListSet,
Wallet,
XChainBridge,
XChainCreateBridge,
XRP,
} from '../../src'

import serverUrl from './serverUrl'
Expand All @@ -24,8 +25,8 @@ export interface TestAMMPool {
issuerWallet: Wallet
lpWallet: Wallet
testWallet: Wallet
asset: Currency
asset2: Currency
asset: XRP
asset2: IssuedCurrency
}

interface TestBridge {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ describe('AMMCreate', function () {
assert.equal(amm.amount, '250')
assert.deepEqual(amm.amount2, {
currency: asset2.currency,
// @ts-expect-error: asset2.issuer should be defined at this point
issuer: asset2.issuer,
value: '250',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ describe('AMMDeposit', function () {
Amount: '100',
Amount2: {
currency: asset2.currency,
// @ts-expect-error: asset2.issuer should be defined at this point
issuer: asset2.issuer,
value: '100',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ describe('AMMWithdraw', function () {
Amount: '50',
Amount2: {
currency: asset2.currency,
// @ts-expect-error: asset2.issuer should be defined at this point
issuer: asset2.issuer,
value: '50',
},
Expand Down
10 changes: 5 additions & 5 deletions packages/xrpl/test/integration/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
ECDSA,
AccountLinesRequest,
IssuedCurrency,
Currency,
XRP,
} from '../../src'
import {
AMMCreate,
Expand Down Expand Up @@ -380,8 +380,8 @@ export async function createAMMPool(
): Promise<{
issuerWallet: Wallet
lpWallet: Wallet
asset: Currency
asset2: Currency
asset: XRP
asset2: IssuedCurrency
}> {
const lpWallet = await generateFundedWallet(client)
const issuerWallet = await generateFundedWallet(client)
Expand Down Expand Up @@ -445,8 +445,8 @@ export async function createAMMPool(

await testTransaction(client, ammCreateTx, lpWallet)

const asset: Currency = { currency: 'XRP' }
const asset2: Currency = {
const asset: XRP = { currency: 'XRP' }
const asset2: IssuedCurrency = {
currency: currencyCode,
issuer: issuerWallet.classicAddress,
}
Expand Down
Loading