Skip to content

Commit 6b662a5

Browse files
authored
Merge branch 'main' into model-cleanup
2 parents 3b25438 + f3f4e44 commit 6b662a5

File tree

10 files changed

+54
-16
lines changed

10 files changed

+54
-16
lines changed

package-lock.json

+38-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/xrpl/HISTORY.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Subscribe to [the **xrpl-announce** mailing list](https://groups.google.com/g/xr
1111
* `OracleSet` transaction accepts hexadecimal string values for `AssetPrice` field
1212
* `TransactionStream` model includes `hash` field in APIv2
1313
* `TransactionStream` model includes `close_time_iso` field only for APIv2
14+
* Adds `MPTCurrency` type
1415

1516
## 4.2.0 (2025-2-13)
1617

packages/xrpl/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "xrpl",
3-
"version": "4.2.0",
3+
"version": "4.2.5",
44
"license": "ISC",
55
"description": "A TypeScript/JavaScript API for interacting with the XRP Ledger in Node.js and the browser",
66
"files": [

packages/xrpl/src/models/common/index.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ export interface IssuedCurrency {
1414
issuer: string
1515
}
1616

17-
export type Currency = IssuedCurrency | XRP
17+
export interface MPTCurrency {
18+
mpt_issuance_id: string
19+
}
20+
21+
export type Currency = IssuedCurrency | MPTCurrency | XRP
1822

1923
export type XRPAmount = string
2024

packages/xrpl/test/integration/requests/ammInfo.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ describe('AMMInfo', function () {
3737
assert.equal(amm.amount, '1250')
3838
assert.deepEqual(amm.amount2, {
3939
currency: asset2.currency,
40-
// @ts-expect-error: asset2.issuer should be defined at this point
4140
issuer: asset2.issuer,
4241
value: '250',
4342
})

packages/xrpl/test/integration/setup.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import {
44
AMMDeposit,
55
AMMDepositFlags,
66
Client,
7-
Currency,
7+
IssuedCurrency,
88
SignerListSet,
99
Wallet,
1010
XChainBridge,
1111
XChainCreateBridge,
12+
XRP,
1213
} from '../../src'
1314

1415
import serverUrl from './serverUrl'
@@ -24,8 +25,8 @@ export interface TestAMMPool {
2425
issuerWallet: Wallet
2526
lpWallet: Wallet
2627
testWallet: Wallet
27-
asset: Currency
28-
asset2: Currency
28+
asset: XRP
29+
asset2: IssuedCurrency
2930
}
3031

3132
interface TestBridge {

packages/xrpl/test/integration/transactions/ammCreate.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ describe('AMMCreate', function () {
3636
assert.equal(amm.amount, '250')
3737
assert.deepEqual(amm.amount2, {
3838
currency: asset2.currency,
39-
// @ts-expect-error: asset2.issuer should be defined at this point
4039
issuer: asset2.issuer,
4140
value: '250',
4241
})

packages/xrpl/test/integration/transactions/ammDeposit.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ describe('AMMDeposit', function () {
102102
Amount: '100',
103103
Amount2: {
104104
currency: asset2.currency,
105-
// @ts-expect-error: asset2.issuer should be defined at this point
106105
issuer: asset2.issuer,
107106
value: '100',
108107
},

packages/xrpl/test/integration/transactions/ammWithdraw.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ describe('AMMWithdraw', function () {
110110
Amount: '50',
111111
Amount2: {
112112
currency: asset2.currency,
113-
// @ts-expect-error: asset2.issuer should be defined at this point
114113
issuer: asset2.issuer,
115114
value: '50',
116115
},

packages/xrpl/test/integration/utils.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
ECDSA,
1515
AccountLinesRequest,
1616
IssuedCurrency,
17-
Currency,
17+
XRP,
1818
} from '../../src'
1919
import {
2020
AMMCreate,
@@ -380,8 +380,8 @@ export async function createAMMPool(
380380
): Promise<{
381381
issuerWallet: Wallet
382382
lpWallet: Wallet
383-
asset: Currency
384-
asset2: Currency
383+
asset: XRP
384+
asset2: IssuedCurrency
385385
}> {
386386
const lpWallet = await generateFundedWallet(client)
387387
const issuerWallet = await generateFundedWallet(client)
@@ -445,8 +445,8 @@ export async function createAMMPool(
445445

446446
await testTransaction(client, ammCreateTx, lpWallet)
447447

448-
const asset: Currency = { currency: 'XRP' }
449-
const asset2: Currency = {
448+
const asset: XRP = { currency: 'XRP' }
449+
const asset2: IssuedCurrency = {
450450
currency: currencyCode,
451451
issuer: issuerWallet.classicAddress,
452452
}

0 commit comments

Comments
 (0)