diff --git a/packages/xrpl/HISTORY.md b/packages/xrpl/HISTORY.md index fb5e323224..2c24c47043 100644 --- a/packages/xrpl/HISTORY.md +++ b/packages/xrpl/HISTORY.md @@ -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) diff --git a/packages/xrpl/src/models/common/index.ts b/packages/xrpl/src/models/common/index.ts index cd16b08a49..3a60588f96 100644 --- a/packages/xrpl/src/models/common/index.ts +++ b/packages/xrpl/src/models/common/index.ts @@ -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 diff --git a/packages/xrpl/test/integration/requests/ammInfo.test.ts b/packages/xrpl/test/integration/requests/ammInfo.test.ts index 6f580812a1..eb354a2d0b 100644 --- a/packages/xrpl/test/integration/requests/ammInfo.test.ts +++ b/packages/xrpl/test/integration/requests/ammInfo.test.ts @@ -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', }) diff --git a/packages/xrpl/test/integration/setup.ts b/packages/xrpl/test/integration/setup.ts index 40eb53fbef..ce4af53677 100644 --- a/packages/xrpl/test/integration/setup.ts +++ b/packages/xrpl/test/integration/setup.ts @@ -4,11 +4,12 @@ import { AMMDeposit, AMMDepositFlags, Client, - Currency, + IssuedCurrency, SignerListSet, Wallet, XChainBridge, XChainCreateBridge, + XRP, } from '../../src' import serverUrl from './serverUrl' @@ -24,8 +25,8 @@ export interface TestAMMPool { issuerWallet: Wallet lpWallet: Wallet testWallet: Wallet - asset: Currency - asset2: Currency + asset: XRP + asset2: IssuedCurrency } interface TestBridge { diff --git a/packages/xrpl/test/integration/transactions/ammCreate.test.ts b/packages/xrpl/test/integration/transactions/ammCreate.test.ts index f063101120..c53add91eb 100644 --- a/packages/xrpl/test/integration/transactions/ammCreate.test.ts +++ b/packages/xrpl/test/integration/transactions/ammCreate.test.ts @@ -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', }) diff --git a/packages/xrpl/test/integration/transactions/ammDeposit.test.ts b/packages/xrpl/test/integration/transactions/ammDeposit.test.ts index aa05c535d4..4fdcd72051 100644 --- a/packages/xrpl/test/integration/transactions/ammDeposit.test.ts +++ b/packages/xrpl/test/integration/transactions/ammDeposit.test.ts @@ -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', }, diff --git a/packages/xrpl/test/integration/transactions/ammWithdraw.test.ts b/packages/xrpl/test/integration/transactions/ammWithdraw.test.ts index 7748513202..b244fa0e6d 100644 --- a/packages/xrpl/test/integration/transactions/ammWithdraw.test.ts +++ b/packages/xrpl/test/integration/transactions/ammWithdraw.test.ts @@ -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', }, diff --git a/packages/xrpl/test/integration/utils.ts b/packages/xrpl/test/integration/utils.ts index 6c70328aef..5bc9832409 100644 --- a/packages/xrpl/test/integration/utils.ts +++ b/packages/xrpl/test/integration/utils.ts @@ -14,7 +14,7 @@ import { ECDSA, AccountLinesRequest, IssuedCurrency, - Currency, + XRP, } from '../../src' import { AMMCreate, @@ -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) @@ -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, }