xrpl 1.0.0-mpt-beta → 1.0.3-mpt-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/xrpl-latest.js +528 -314
- package/build/xrpl-latest.js.map +1 -1
- package/dist/npm/Wallet/defaultFaucets.d.ts +1 -2
- package/dist/npm/Wallet/defaultFaucets.d.ts.map +1 -1
- package/dist/npm/Wallet/defaultFaucets.js +0 -5
- package/dist/npm/Wallet/defaultFaucets.js.map +1 -1
- package/dist/npm/client/RequestManager.d.ts +5 -4
- package/dist/npm/client/RequestManager.d.ts.map +1 -1
- package/dist/npm/client/RequestManager.js.map +1 -1
- package/dist/npm/client/connection.d.ts +2 -2
- package/dist/npm/client/connection.d.ts.map +1 -1
- package/dist/npm/client/connection.js.map +1 -1
- package/dist/npm/client/index.d.ts +4 -3
- package/dist/npm/client/index.d.ts.map +1 -1
- package/dist/npm/client/index.js +17 -10
- package/dist/npm/client/index.js.map +1 -1
- package/dist/npm/client/partialPayment.d.ts +2 -1
- package/dist/npm/client/partialPayment.d.ts.map +1 -1
- package/dist/npm/client/partialPayment.js +10 -3
- package/dist/npm/client/partialPayment.js.map +1 -1
- package/dist/npm/models/common/index.d.ts +14 -1
- package/dist/npm/models/common/index.d.ts.map +1 -1
- package/dist/npm/models/common/index.js +4 -0
- package/dist/npm/models/common/index.js.map +1 -1
- package/dist/npm/models/ledger/AMM.d.ts +2 -2
- package/dist/npm/models/ledger/AMM.d.ts.map +1 -1
- package/dist/npm/models/ledger/Amendments.d.ts +2 -2
- package/dist/npm/models/ledger/Amendments.d.ts.map +1 -1
- package/dist/npm/models/ledger/BaseLedgerEntry.d.ts +3 -3
- package/dist/npm/models/ledger/BaseLedgerEntry.d.ts.map +1 -1
- package/dist/npm/models/ledger/DirectoryNode.d.ts +2 -2
- package/dist/npm/models/ledger/DirectoryNode.d.ts.map +1 -1
- package/dist/npm/models/ledger/FeeSettings.d.ts +2 -2
- package/dist/npm/models/ledger/FeeSettings.d.ts.map +1 -1
- package/dist/npm/models/ledger/Ledger.d.ts +10 -2
- package/dist/npm/models/ledger/Ledger.d.ts.map +1 -1
- package/dist/npm/models/ledger/LedgerEntry.d.ts +3 -2
- package/dist/npm/models/ledger/LedgerEntry.d.ts.map +1 -1
- package/dist/npm/models/ledger/LedgerHashes.d.ts +2 -2
- package/dist/npm/models/ledger/LedgerHashes.d.ts.map +1 -1
- package/dist/npm/models/ledger/NegativeUNL.d.ts +2 -2
- package/dist/npm/models/ledger/NegativeUNL.d.ts.map +1 -1
- package/dist/npm/models/ledger/Oracle.d.ts +12 -0
- package/dist/npm/models/ledger/Oracle.d.ts.map +1 -0
- package/dist/npm/models/ledger/Oracle.js +3 -0
- package/dist/npm/models/ledger/Oracle.js.map +1 -0
- package/dist/npm/models/ledger/RippleState.d.ts +2 -1
- package/dist/npm/models/ledger/RippleState.d.ts.map +1 -1
- package/dist/npm/models/ledger/RippleState.js +1 -0
- package/dist/npm/models/ledger/RippleState.js.map +1 -1
- package/dist/npm/models/ledger/index.d.ts +3 -2
- package/dist/npm/models/ledger/index.d.ts.map +1 -1
- package/dist/npm/models/ledger/index.js.map +1 -1
- package/dist/npm/models/methods/accountChannels.d.ts +1 -1
- package/dist/npm/models/methods/accountChannels.d.ts.map +1 -1
- package/dist/npm/models/methods/accountInfo.d.ts +17 -4
- package/dist/npm/models/methods/accountInfo.d.ts.map +1 -1
- package/dist/npm/models/methods/accountTx.d.ts +11 -5
- package/dist/npm/models/methods/accountTx.d.ts.map +1 -1
- package/dist/npm/models/methods/getAggregatePrice.d.ts +31 -0
- package/dist/npm/models/methods/getAggregatePrice.d.ts.map +1 -0
- package/dist/npm/models/methods/getAggregatePrice.js +3 -0
- package/dist/npm/models/methods/getAggregatePrice.js.map +1 -0
- package/dist/npm/models/methods/index.d.ts +14 -11
- package/dist/npm/models/methods/index.d.ts.map +1 -1
- package/dist/npm/models/methods/ledger.d.ts +17 -5
- package/dist/npm/models/methods/ledger.d.ts.map +1 -1
- package/dist/npm/models/methods/ledgerEntry.d.ts +5 -0
- package/dist/npm/models/methods/ledgerEntry.d.ts.map +1 -1
- package/dist/npm/models/methods/nftsByIssuer.d.ts +19 -0
- package/dist/npm/models/methods/nftsByIssuer.d.ts.map +1 -0
- package/dist/npm/models/methods/nftsByIssuer.js +3 -0
- package/dist/npm/models/methods/nftsByIssuer.js.map +1 -0
- package/dist/npm/models/methods/submitMultisigned.d.ts +16 -5
- package/dist/npm/models/methods/submitMultisigned.d.ts.map +1 -1
- package/dist/npm/models/methods/tx.d.ts +20 -8
- package/dist/npm/models/methods/tx.d.ts.map +1 -1
- package/dist/npm/models/transactions/AMMDeposit.d.ts +3 -1
- package/dist/npm/models/transactions/AMMDeposit.d.ts.map +1 -1
- package/dist/npm/models/transactions/AMMDeposit.js +1 -0
- package/dist/npm/models/transactions/AMMDeposit.js.map +1 -1
- package/dist/npm/models/transactions/index.d.ts +2 -0
- package/dist/npm/models/transactions/index.d.ts.map +1 -1
- package/dist/npm/models/transactions/index.js.map +1 -1
- package/dist/npm/models/transactions/metadata.d.ts +6 -3
- package/dist/npm/models/transactions/metadata.d.ts.map +1 -1
- package/dist/npm/models/transactions/metadata.js.map +1 -1
- package/dist/npm/models/transactions/oracleDelete.d.ts +7 -0
- package/dist/npm/models/transactions/oracleDelete.d.ts.map +1 -0
- package/dist/npm/models/transactions/oracleDelete.js +10 -0
- package/dist/npm/models/transactions/oracleDelete.js.map +1 -0
- package/dist/npm/models/transactions/oracleSet.d.ts +13 -0
- package/dist/npm/models/transactions/oracleSet.d.ts.map +1 -0
- package/dist/npm/models/transactions/oracleSet.js +59 -0
- package/dist/npm/models/transactions/oracleSet.js.map +1 -0
- package/dist/npm/models/transactions/payment.d.ts +6 -6
- package/dist/npm/models/transactions/payment.d.ts.map +1 -1
- package/dist/npm/models/transactions/payment.js +1 -1
- package/dist/npm/models/transactions/transaction.d.ts +3 -1
- package/dist/npm/models/transactions/transaction.d.ts.map +1 -1
- package/dist/npm/models/transactions/transaction.js +8 -0
- package/dist/npm/models/transactions/transaction.js.map +1 -1
- package/dist/npm/snippets/src/claimPayChannel.js +1 -1
- package/dist/npm/snippets/src/claimPayChannel.js.map +1 -1
- package/dist/npm/snippets/src/sendEscrow.js +1 -1
- package/dist/npm/snippets/src/sendEscrow.js.map +1 -1
- package/dist/npm/snippets/tsconfig.tsbuildinfo +1 -1
- package/dist/npm/src/Wallet/defaultFaucets.d.ts +1 -2
- package/dist/npm/src/Wallet/defaultFaucets.d.ts.map +1 -1
- package/dist/npm/src/Wallet/defaultFaucets.js +0 -5
- package/dist/npm/src/Wallet/defaultFaucets.js.map +1 -1
- package/dist/npm/src/client/RequestManager.d.ts +5 -4
- package/dist/npm/src/client/RequestManager.d.ts.map +1 -1
- package/dist/npm/src/client/RequestManager.js.map +1 -1
- package/dist/npm/src/client/connection.d.ts +2 -2
- package/dist/npm/src/client/connection.d.ts.map +1 -1
- package/dist/npm/src/client/connection.js.map +1 -1
- package/dist/npm/src/client/index.d.ts +4 -3
- package/dist/npm/src/client/index.d.ts.map +1 -1
- package/dist/npm/src/client/index.js +17 -10
- package/dist/npm/src/client/index.js.map +1 -1
- package/dist/npm/src/client/partialPayment.d.ts +2 -1
- package/dist/npm/src/client/partialPayment.d.ts.map +1 -1
- package/dist/npm/src/client/partialPayment.js +10 -3
- package/dist/npm/src/client/partialPayment.js.map +1 -1
- package/dist/npm/src/models/common/index.d.ts +14 -1
- package/dist/npm/src/models/common/index.d.ts.map +1 -1
- package/dist/npm/src/models/common/index.js +4 -0
- package/dist/npm/src/models/common/index.js.map +1 -1
- package/dist/npm/src/models/ledger/AMM.d.ts +2 -2
- package/dist/npm/src/models/ledger/AMM.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/Amendments.d.ts +2 -2
- package/dist/npm/src/models/ledger/Amendments.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/BaseLedgerEntry.d.ts +3 -3
- package/dist/npm/src/models/ledger/BaseLedgerEntry.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/DirectoryNode.d.ts +2 -2
- package/dist/npm/src/models/ledger/DirectoryNode.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/FeeSettings.d.ts +2 -2
- package/dist/npm/src/models/ledger/FeeSettings.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/Ledger.d.ts +10 -2
- package/dist/npm/src/models/ledger/Ledger.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/LedgerEntry.d.ts +3 -2
- package/dist/npm/src/models/ledger/LedgerEntry.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/LedgerHashes.d.ts +2 -2
- package/dist/npm/src/models/ledger/LedgerHashes.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/NegativeUNL.d.ts +2 -2
- package/dist/npm/src/models/ledger/NegativeUNL.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/Oracle.d.ts +12 -0
- package/dist/npm/src/models/ledger/Oracle.d.ts.map +1 -0
- package/dist/npm/src/models/ledger/Oracle.js +3 -0
- package/dist/npm/src/models/ledger/Oracle.js.map +1 -0
- package/dist/npm/src/models/ledger/RippleState.d.ts +2 -1
- package/dist/npm/src/models/ledger/RippleState.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/RippleState.js +1 -0
- package/dist/npm/src/models/ledger/RippleState.js.map +1 -1
- package/dist/npm/src/models/ledger/index.d.ts +3 -2
- package/dist/npm/src/models/ledger/index.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/index.js.map +1 -1
- package/dist/npm/src/models/methods/accountChannels.d.ts +1 -1
- package/dist/npm/src/models/methods/accountChannels.d.ts.map +1 -1
- package/dist/npm/src/models/methods/accountInfo.d.ts +17 -4
- package/dist/npm/src/models/methods/accountInfo.d.ts.map +1 -1
- package/dist/npm/src/models/methods/accountTx.d.ts +11 -5
- package/dist/npm/src/models/methods/accountTx.d.ts.map +1 -1
- package/dist/npm/src/models/methods/getAggregatePrice.d.ts +31 -0
- package/dist/npm/src/models/methods/getAggregatePrice.d.ts.map +1 -0
- package/dist/npm/src/models/methods/getAggregatePrice.js +3 -0
- package/dist/npm/src/models/methods/getAggregatePrice.js.map +1 -0
- package/dist/npm/src/models/methods/index.d.ts +14 -11
- package/dist/npm/src/models/methods/index.d.ts.map +1 -1
- package/dist/npm/src/models/methods/ledger.d.ts +17 -5
- package/dist/npm/src/models/methods/ledger.d.ts.map +1 -1
- package/dist/npm/src/models/methods/ledgerEntry.d.ts +5 -0
- package/dist/npm/src/models/methods/ledgerEntry.d.ts.map +1 -1
- package/dist/npm/src/models/methods/nftsByIssuer.d.ts +19 -0
- package/dist/npm/src/models/methods/nftsByIssuer.d.ts.map +1 -0
- package/dist/npm/src/models/methods/nftsByIssuer.js +3 -0
- package/dist/npm/src/models/methods/nftsByIssuer.js.map +1 -0
- package/dist/npm/src/models/methods/submitMultisigned.d.ts +16 -5
- package/dist/npm/src/models/methods/submitMultisigned.d.ts.map +1 -1
- package/dist/npm/src/models/methods/tx.d.ts +20 -8
- package/dist/npm/src/models/methods/tx.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/AMMDeposit.d.ts +3 -1
- package/dist/npm/src/models/transactions/AMMDeposit.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/AMMDeposit.js +1 -0
- package/dist/npm/src/models/transactions/AMMDeposit.js.map +1 -1
- package/dist/npm/src/models/transactions/index.d.ts +2 -0
- package/dist/npm/src/models/transactions/index.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/index.js.map +1 -1
- package/dist/npm/src/models/transactions/metadata.d.ts +6 -3
- package/dist/npm/src/models/transactions/metadata.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/metadata.js.map +1 -1
- package/dist/npm/src/models/transactions/oracleDelete.d.ts +7 -0
- package/dist/npm/src/models/transactions/oracleDelete.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/oracleDelete.js +10 -0
- package/dist/npm/src/models/transactions/oracleDelete.js.map +1 -0
- package/dist/npm/src/models/transactions/oracleSet.d.ts +13 -0
- package/dist/npm/src/models/transactions/oracleSet.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/oracleSet.js +59 -0
- package/dist/npm/src/models/transactions/oracleSet.js.map +1 -0
- package/dist/npm/src/models/transactions/payment.d.ts +6 -6
- package/dist/npm/src/models/transactions/payment.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/payment.js +1 -1
- package/dist/npm/src/models/transactions/transaction.d.ts +3 -1
- package/dist/npm/src/models/transactions/transaction.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/transaction.js +8 -0
- package/dist/npm/src/models/transactions/transaction.js.map +1 -1
- package/dist/npm/src/sugar/autofill.d.ts +1 -1
- package/dist/npm/src/sugar/autofill.d.ts.map +1 -1
- package/dist/npm/src/sugar/autofill.js +2 -4
- package/dist/npm/src/sugar/autofill.js.map +1 -1
- package/dist/npm/src/sugar/getFeeXrp.d.ts +1 -1
- package/dist/npm/src/sugar/getFeeXrp.d.ts.map +1 -1
- package/dist/npm/src/sugar/getFeeXrp.js +3 -2
- package/dist/npm/src/sugar/getFeeXrp.js.map +1 -1
- package/dist/npm/src/sugar/submit.d.ts.map +1 -1
- package/dist/npm/src/sugar/submit.js.map +1 -1
- package/dist/npm/src/utils/hashes/hashLedger.d.ts +4 -3
- package/dist/npm/src/utils/hashes/hashLedger.d.ts.map +1 -1
- package/dist/npm/src/utils/hashes/hashLedger.js.map +1 -1
- package/dist/npm/src/utils/index.d.ts +2 -1
- package/dist/npm/src/utils/index.d.ts.map +1 -1
- package/dist/npm/src/utils/index.js.map +1 -1
- package/dist/npm/sugar/autofill.d.ts +1 -1
- package/dist/npm/sugar/autofill.d.ts.map +1 -1
- package/dist/npm/sugar/autofill.js +2 -4
- package/dist/npm/sugar/autofill.js.map +1 -1
- package/dist/npm/sugar/getFeeXrp.d.ts +1 -1
- package/dist/npm/sugar/getFeeXrp.d.ts.map +1 -1
- package/dist/npm/sugar/getFeeXrp.js +3 -2
- package/dist/npm/sugar/getFeeXrp.js.map +1 -1
- package/dist/npm/sugar/submit.d.ts.map +1 -1
- package/dist/npm/sugar/submit.js.map +1 -1
- package/dist/npm/utils/hashes/hashLedger.d.ts +4 -3
- package/dist/npm/utils/hashes/hashLedger.d.ts.map +1 -1
- package/dist/npm/utils/hashes/hashLedger.js.map +1 -1
- package/dist/npm/utils/index.d.ts +2 -1
- package/dist/npm/utils/index.d.ts.map +1 -1
- package/dist/npm/utils/index.js.map +1 -1
- package/package.json +5 -5
- package/src/Wallet/defaultFaucets.ts +0 -6
- package/src/client/RequestManager.ts +17 -12
- package/src/client/connection.ts +7 -5
- package/src/client/index.ts +79 -21
- package/src/client/partialPayment.ts +38 -14
- package/src/models/common/index.ts +42 -1
- package/src/models/ledger/AMM.ts +2 -2
- package/src/models/ledger/Amendments.ts +2 -2
- package/src/models/ledger/BaseLedgerEntry.ts +9 -5
- package/src/models/ledger/DirectoryNode.ts +2 -2
- package/src/models/ledger/FeeSettings.ts +4 -2
- package/src/models/ledger/Ledger.ts +40 -8
- package/src/models/ledger/LedgerEntry.ts +3 -0
- package/src/models/ledger/LedgerHashes.ts +2 -4
- package/src/models/ledger/NegativeUNL.ts +2 -2
- package/src/models/ledger/Oracle.ts +43 -0
- package/src/models/ledger/RippleState.ts +2 -0
- package/src/models/ledger/index.ts +4 -1
- package/src/models/methods/accountChannels.ts +64 -1
- package/src/models/methods/accountInfo.ts +58 -12
- package/src/models/methods/accountTx.ts +49 -8
- package/src/models/methods/getAggregatePrice.ts +119 -0
- package/src/models/methods/index.ts +63 -23
- package/src/models/methods/ledger.ts +41 -5
- package/src/models/methods/ledgerEntry.ts +16 -0
- package/src/models/methods/nftsByIssuer.ts +68 -0
- package/src/models/methods/submitMultisigned.ts +48 -16
- package/src/models/methods/tx.ts +74 -22
- package/src/models/transactions/AMMDeposit.ts +2 -0
- package/src/models/transactions/index.ts +2 -0
- package/src/models/transactions/metadata.ts +4 -3
- package/src/models/transactions/oracleDelete.ts +32 -0
- package/src/models/transactions/oracleSet.ts +176 -0
- package/src/models/transactions/payment.ts +6 -6
- package/src/models/transactions/transaction.ts +12 -0
- package/src/sugar/autofill.ts +4 -10
- package/src/sugar/getFeeXrp.ts +6 -3
- package/src/sugar/submit.ts +5 -3
- package/src/utils/hashes/hashLedger.ts +8 -5
- package/src/utils/index.ts +2 -1
@@ -1,4 +1,5 @@
|
|
1
|
-
import {
|
1
|
+
import { APIVersion, DEFAULT_API_VERSION, RIPPLED_API_V1 } from '../common'
|
2
|
+
import { Ledger, LedgerV1, LedgerVersionMap } from '../ledger/Ledger'
|
2
3
|
import { LedgerEntryFilter } from '../ledger/LedgerEntry'
|
3
4
|
import { Transaction, TransactionAndMetadata } from '../transactions'
|
4
5
|
import { TransactionMetadata } from '../transactions/metadata'
|
@@ -207,6 +208,12 @@ export interface LedgerBinary
|
|
207
208
|
transactions?: string[]
|
208
209
|
}
|
209
210
|
|
211
|
+
export interface LedgerBinaryV1
|
212
|
+
extends Omit<Omit<LedgerV1, 'transactions'>, 'accountState'> {
|
213
|
+
accountState?: string[]
|
214
|
+
transactions?: string[]
|
215
|
+
}
|
216
|
+
|
210
217
|
interface LedgerResponseBase {
|
211
218
|
/** Unique identifying hash of the entire ledger. */
|
212
219
|
ledger_hash: string
|
@@ -231,6 +238,11 @@ interface LedgerResponseResult extends LedgerResponseBase {
|
|
231
238
|
ledger: LedgerBinary
|
232
239
|
}
|
233
240
|
|
241
|
+
interface LedgerV1ResponseResult extends LedgerResponseBase {
|
242
|
+
/** The complete header data of this {@link Ledger}. */
|
243
|
+
ledger: LedgerBinaryV1
|
244
|
+
}
|
245
|
+
|
234
246
|
/**
|
235
247
|
* Response expected from a {@link LedgerRequest}.
|
236
248
|
* This is the default request response, triggered when `expand` and `binary` are both false.
|
@@ -241,9 +253,31 @@ export interface LedgerResponse extends BaseResponse {
|
|
241
253
|
result: LedgerResponseResult
|
242
254
|
}
|
243
255
|
|
244
|
-
|
256
|
+
/**
|
257
|
+
* Response expected from a {@link LedgerRequest}.
|
258
|
+
* This is the default request response, triggered when `expand` and `binary` are both false.
|
259
|
+
* This is the response for API version 1.
|
260
|
+
*
|
261
|
+
* @category ResponsesV1
|
262
|
+
*/
|
263
|
+
export interface LedgerV1Response extends BaseResponse {
|
264
|
+
result: LedgerV1ResponseResult
|
265
|
+
}
|
266
|
+
|
267
|
+
/**
|
268
|
+
* Type to map between the API version and the response type.
|
269
|
+
*
|
270
|
+
* @category Responses
|
271
|
+
*/
|
272
|
+
export type LedgerVersionResponseMap<
|
273
|
+
Version extends APIVersion = typeof DEFAULT_API_VERSION,
|
274
|
+
> = Version extends typeof RIPPLED_API_V1 ? LedgerV1Response : LedgerResponse
|
275
|
+
|
276
|
+
interface LedgerResponseExpandedResult<
|
277
|
+
Version extends APIVersion = typeof DEFAULT_API_VERSION,
|
278
|
+
> extends LedgerResponseBase {
|
245
279
|
/** The complete header data of this {@link Ledger}. */
|
246
|
-
ledger:
|
280
|
+
ledger: LedgerVersionMap<Version>
|
247
281
|
}
|
248
282
|
|
249
283
|
/**
|
@@ -254,6 +288,8 @@ interface LedgerResponseExpandedResult extends LedgerResponseBase {
|
|
254
288
|
*
|
255
289
|
* @category Responses
|
256
290
|
*/
|
257
|
-
export interface LedgerResponseExpanded
|
258
|
-
|
291
|
+
export interface LedgerResponseExpanded<
|
292
|
+
Version extends APIVersion = typeof DEFAULT_API_VERSION,
|
293
|
+
> extends BaseResponse {
|
294
|
+
result: LedgerResponseExpandedResult<Version>
|
259
295
|
}
|
@@ -21,6 +21,22 @@ import { BaseRequest, BaseResponse, LookupByLedgerRequest } from './baseMethod'
|
|
21
21
|
*/
|
22
22
|
export interface LedgerEntryRequest extends BaseRequest, LookupByLedgerRequest {
|
23
23
|
command: 'ledger_entry'
|
24
|
+
|
25
|
+
/**
|
26
|
+
* Retrieve a MPTokenIssuance object from the ledger.
|
27
|
+
*/
|
28
|
+
mpt_issuance?: string
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Retrieve a MPToken object from the ledger.
|
32
|
+
*/
|
33
|
+
mptoken?:
|
34
|
+
| {
|
35
|
+
mpt_issuance_id: string
|
36
|
+
account: string
|
37
|
+
}
|
38
|
+
| string
|
39
|
+
|
24
40
|
/**
|
25
41
|
* Retrieve an Automated Market Maker (AMM) object from the ledger.
|
26
42
|
* This is similar to amm_info method, but the ledger_entry version returns only the ledger entry as stored.
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import { NFToken } from '../common'
|
2
|
+
|
3
|
+
import { BaseRequest, BaseResponse, LookupByLedgerRequest } from './baseMethod'
|
4
|
+
|
5
|
+
/**
|
6
|
+
* The nfts_by_issuer method returns a list of NFTokens issued by the account.
|
7
|
+
* The order of the NFTs is not associated with the date the NFTs were minted.
|
8
|
+
* Expects a response in the form of a {@link
|
9
|
+
* NFTsByIssuerResponse}.
|
10
|
+
*
|
11
|
+
* @category Requests
|
12
|
+
*/
|
13
|
+
export interface NFTsByIssuerRequest
|
14
|
+
extends BaseRequest,
|
15
|
+
LookupByLedgerRequest {
|
16
|
+
command: 'nfts_by_issuer'
|
17
|
+
/**
|
18
|
+
* A unique identifier for the account, most commonly the account's address
|
19
|
+
*/
|
20
|
+
issuer: string
|
21
|
+
/**
|
22
|
+
* Value from a previous paginated response. Resume retrieving data where
|
23
|
+
* that response left off. This value is stable even if there is a change in
|
24
|
+
* the server's range of available ledgers.
|
25
|
+
*/
|
26
|
+
marker?: unknown
|
27
|
+
/**
|
28
|
+
* Filter NFTs issued by this issuer that have this taxon.
|
29
|
+
*/
|
30
|
+
nft_taxon?: number
|
31
|
+
/**
|
32
|
+
* Default varies. Limit the number of transactions to retrieve. The server
|
33
|
+
* is not required to honor this value.
|
34
|
+
*/
|
35
|
+
limit?: number
|
36
|
+
}
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Expected response from an {@link NFTsByIssuerRequest}.
|
40
|
+
*
|
41
|
+
* @category Responses
|
42
|
+
*/
|
43
|
+
export interface NFTsByIssuerResponse extends BaseResponse {
|
44
|
+
result: {
|
45
|
+
/**
|
46
|
+
* The unique identifier for the account, most commonly the account's address
|
47
|
+
*/
|
48
|
+
issuer: string
|
49
|
+
/**
|
50
|
+
* A list of NFTs issued by the account.
|
51
|
+
* The order of the NFTs is not associated with the date the NFTs were minted.
|
52
|
+
*/
|
53
|
+
nfts: NFToken[]
|
54
|
+
/**
|
55
|
+
* Server-defined value indicating the response is paginated. Pass this
|
56
|
+
* to the next call to resume where this call left off.
|
57
|
+
*/
|
58
|
+
marker?: unknown
|
59
|
+
/**
|
60
|
+
* The limit value used in the request.
|
61
|
+
*/
|
62
|
+
limit?: number
|
63
|
+
/**
|
64
|
+
* Use to filter NFTs issued by this issuer that have this taxon.
|
65
|
+
*/
|
66
|
+
nft_taxon?: number
|
67
|
+
}
|
68
|
+
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { APIVersion, DEFAULT_API_VERSION, RIPPLED_API_V1 } from '../common'
|
1
2
|
import { Transaction } from '../transactions'
|
2
3
|
|
3
4
|
import { BaseRequest, BaseResponse } from './baseMethod'
|
@@ -24,28 +25,59 @@ export interface SubmitMultisignedRequest extends BaseRequest {
|
|
24
25
|
fail_hard?: boolean
|
25
26
|
}
|
26
27
|
|
28
|
+
/**
|
29
|
+
* Common properties for multisigned transaction responses.
|
30
|
+
*
|
31
|
+
* @category Responses
|
32
|
+
*/
|
33
|
+
interface BaseSubmitMultisignedResult {
|
34
|
+
/**
|
35
|
+
* Code indicating the preliminary result of the transaction, for example.
|
36
|
+
* `tesSUCCESS`.
|
37
|
+
*/
|
38
|
+
engine_result: string
|
39
|
+
/**
|
40
|
+
* Numeric code indicating the preliminary result of the transaction,
|
41
|
+
* directly correlated to `engine_result`.
|
42
|
+
*/
|
43
|
+
engine_result_code: number
|
44
|
+
/** Human-readable explanation of the preliminary transaction result. */
|
45
|
+
engine_result_message: string
|
46
|
+
/** The complete transaction in hex string format. */
|
47
|
+
tx_blob: string
|
48
|
+
/** The complete transaction in JSON format. */
|
49
|
+
tx_json: Transaction
|
50
|
+
}
|
51
|
+
|
27
52
|
/**
|
28
53
|
* Response expected from a {@link SubmitMultisignedRequest}.
|
29
54
|
*
|
30
55
|
* @category Responses
|
31
56
|
*/
|
32
57
|
export interface SubmitMultisignedResponse extends BaseResponse {
|
33
|
-
result: {
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
engine_result_message: string
|
46
|
-
/** The complete transaction in hex string format. */
|
47
|
-
tx_blob: string
|
48
|
-
/** The complete transaction in JSON format. */
|
58
|
+
result: BaseSubmitMultisignedResult & {
|
59
|
+
hash?: string
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
/**
|
64
|
+
* Response expected from a {@link SubmitMultisignedRequest} using api_version 1.
|
65
|
+
*
|
66
|
+
* @category ResponsesV1
|
67
|
+
*/
|
68
|
+
export interface SubmitMultisignedV1Response extends BaseResponse {
|
69
|
+
result: BaseSubmitMultisignedResult & {
|
49
70
|
tx_json: Transaction & { hash?: string }
|
50
71
|
}
|
51
72
|
}
|
73
|
+
|
74
|
+
/**
|
75
|
+
* Type to map between the API version and the response type.
|
76
|
+
*
|
77
|
+
* @category Responses
|
78
|
+
*/
|
79
|
+
export type SubmitMultisignedVersionResponseMap<
|
80
|
+
Version extends APIVersion = typeof DEFAULT_API_VERSION,
|
81
|
+
> = Version extends typeof RIPPLED_API_V1
|
82
|
+
? SubmitMultisignedV1Response
|
83
|
+
: SubmitMultisignedResponse
|
package/src/models/methods/tx.ts
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
import {
|
2
|
+
APIVersion,
|
3
|
+
DEFAULT_API_VERSION,
|
4
|
+
RIPPLED_API_V1,
|
5
|
+
RIPPLED_API_V2,
|
6
|
+
} from '../common'
|
1
7
|
import { Transaction, TransactionMetadata } from '../transactions'
|
2
8
|
import { BaseTransaction } from '../transactions/common'
|
3
9
|
|
@@ -41,6 +47,47 @@ export interface TxRequest extends BaseRequest {
|
|
41
47
|
max_ledger?: number
|
42
48
|
}
|
43
49
|
|
50
|
+
/**
|
51
|
+
* Common properties of transaction responses.
|
52
|
+
*
|
53
|
+
* @category Responses
|
54
|
+
*/
|
55
|
+
interface BaseTxResult<
|
56
|
+
Version extends APIVersion = typeof DEFAULT_API_VERSION,
|
57
|
+
T extends BaseTransaction = Transaction,
|
58
|
+
> {
|
59
|
+
/** The SHA-512 hash of the transaction. */
|
60
|
+
hash: string
|
61
|
+
/**
|
62
|
+
* The Concise Transaction Identifier of the transaction (16-byte hex string)
|
63
|
+
*/
|
64
|
+
ctid?: string
|
65
|
+
/** The ledger index of the ledger that includes this transaction. */
|
66
|
+
ledger_index?: number
|
67
|
+
/** Unique hashed string Transaction metadata blob, which describes the results of the transaction.
|
68
|
+
* Can be undefined if a transaction has not been validated yet. This field is omitted if binary
|
69
|
+
* binary format is not requested. */
|
70
|
+
meta_blob?: Version extends typeof RIPPLED_API_V2
|
71
|
+
? TransactionMetadata<T> | string
|
72
|
+
: never
|
73
|
+
/** Transaction metadata, which describes the results of the transaction.
|
74
|
+
* Can be undefined if a transaction has not been validated yet. */
|
75
|
+
meta?: TransactionMetadata<T> | string
|
76
|
+
/**
|
77
|
+
* If true, this data comes from a validated ledger version; if omitted or.
|
78
|
+
* Set to false, this data is not final.
|
79
|
+
*/
|
80
|
+
validated?: boolean
|
81
|
+
/**
|
82
|
+
* The time the transaction was closed, in seconds since the Ripple Epoch.
|
83
|
+
*/
|
84
|
+
close_time_iso?: string
|
85
|
+
/**
|
86
|
+
* This number measures the number of seconds since the "Ripple Epoch" of January 1, 2000 (00:00 UTC)
|
87
|
+
*/
|
88
|
+
date?: number
|
89
|
+
}
|
90
|
+
|
44
91
|
/**
|
45
92
|
* Response expected from a {@link TxRequest}.
|
46
93
|
*
|
@@ -48,28 +95,7 @@ export interface TxRequest extends BaseRequest {
|
|
48
95
|
*/
|
49
96
|
export interface TxResponse<T extends BaseTransaction = Transaction>
|
50
97
|
extends BaseResponse {
|
51
|
-
result: {
|
52
|
-
/** The SHA-512 hash of the transaction. */
|
53
|
-
hash: string
|
54
|
-
/**
|
55
|
-
* The Concise Transaction Identifier of the transaction (16-byte hex string)
|
56
|
-
*/
|
57
|
-
ctid?: string
|
58
|
-
/** The ledger index of the ledger that includes this transaction. */
|
59
|
-
ledger_index?: number
|
60
|
-
/** Transaction metadata, which describes the results of the transaction.
|
61
|
-
* Can be undefined if a transaction has not been validated yet. */
|
62
|
-
meta?: TransactionMetadata<T> | string
|
63
|
-
/**
|
64
|
-
* If true, this data comes from a validated ledger version; if omitted or.
|
65
|
-
* Set to false, this data is not final.
|
66
|
-
*/
|
67
|
-
validated?: boolean
|
68
|
-
/**
|
69
|
-
* This number measures the number of seconds since the "Ripple Epoch" of January 1, 2000 (00:00 UTC)
|
70
|
-
*/
|
71
|
-
date?: number
|
72
|
-
} & T
|
98
|
+
result: BaseTxResult<typeof RIPPLED_API_V2, T> & { tx_json: T }
|
73
99
|
/**
|
74
100
|
* If true, the server was able to search all of the specified ledger
|
75
101
|
* versions, and the transaction was in none of them. If false, the server did
|
@@ -78,3 +104,29 @@ export interface TxResponse<T extends BaseTransaction = Transaction>
|
|
78
104
|
*/
|
79
105
|
searched_all?: boolean
|
80
106
|
}
|
107
|
+
|
108
|
+
/**
|
109
|
+
* Response expected from a {@link TxRequest} using API version 1.
|
110
|
+
*
|
111
|
+
* @category ResponsesV1
|
112
|
+
*/
|
113
|
+
export interface TxV1Response<T extends BaseTransaction = Transaction>
|
114
|
+
extends BaseResponse {
|
115
|
+
result: BaseTxResult<typeof RIPPLED_API_V1, T> & T
|
116
|
+
/**
|
117
|
+
* If true, the server was able to search all of the specified ledger
|
118
|
+
* versions, and the transaction was in none of them. If false, the server did
|
119
|
+
* not have all of the specified ledger versions available, so it is not sure.
|
120
|
+
* If one of them might contain the transaction.
|
121
|
+
*/
|
122
|
+
searched_all?: boolean
|
123
|
+
}
|
124
|
+
|
125
|
+
/**
|
126
|
+
* Type to map between the API version and the response type.
|
127
|
+
*
|
128
|
+
* @category Responses
|
129
|
+
*/
|
130
|
+
export type TxVersionResponseMap<
|
131
|
+
Version extends APIVersion = typeof DEFAULT_API_VERSION,
|
132
|
+
> = Version extends typeof RIPPLED_API_V1 ? TxV1Response : TxResponse
|
@@ -21,6 +21,7 @@ export enum AMMDepositFlags {
|
|
21
21
|
tfTwoAsset = 0x00100000,
|
22
22
|
tfOneAssetLPToken = 0x00200000,
|
23
23
|
tfLimitLPToken = 0x00400000,
|
24
|
+
tfTwoAssetIfEmpty = 0x00800000,
|
24
25
|
}
|
25
26
|
|
26
27
|
export interface AMMDepositFlagsInterface extends GlobalFlags {
|
@@ -29,6 +30,7 @@ export interface AMMDepositFlagsInterface extends GlobalFlags {
|
|
29
30
|
tfTwoAsset?: boolean
|
30
31
|
tfOneAssetLPToken?: boolean
|
31
32
|
tfLimitLPToken?: boolean
|
33
|
+
tfTwoAssetIfEmpty?: boolean
|
32
34
|
}
|
33
35
|
|
34
36
|
/**
|
@@ -74,6 +74,8 @@ export {
|
|
74
74
|
OfferCreateFlagsInterface,
|
75
75
|
OfferCreate,
|
76
76
|
} from './offerCreate'
|
77
|
+
export { OracleDelete } from './oracleDelete'
|
78
|
+
export { OracleSet } from './oracleSet'
|
77
79
|
export { PaymentFlags, PaymentFlagsInterface, Payment } from './payment'
|
78
80
|
export {
|
79
81
|
PaymentChannelClaimFlags,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Amount } from '../common'
|
1
|
+
import { Amount, MPTAmount } from '../common'
|
2
2
|
|
3
3
|
import { BaseTransaction } from './common'
|
4
4
|
import {
|
@@ -44,6 +44,7 @@ export interface DeletedNode {
|
|
44
44
|
DeletedNode: {
|
45
45
|
LedgerEntryType: string
|
46
46
|
LedgerIndex: string
|
47
|
+
PreviousFields?: { [field: string]: unknown }
|
47
48
|
FinalFields: { [field: string]: unknown }
|
48
49
|
}
|
49
50
|
}
|
@@ -82,9 +83,9 @@ export function isDeletedNode(node: Node): node is DeletedNode {
|
|
82
83
|
|
83
84
|
export interface TransactionMetadataBase {
|
84
85
|
AffectedNodes: Node[]
|
85
|
-
DeliveredAmount?: Amount
|
86
|
+
DeliveredAmount?: Amount | MPTAmount
|
86
87
|
// "unavailable" possible for transactions before 2014-01-20
|
87
|
-
delivered_amount?: Amount | 'unavailable'
|
88
|
+
delivered_amount?: Amount | MPTAmount | 'unavailable'
|
88
89
|
TransactionIndex: number
|
89
90
|
TransactionResult: string
|
90
91
|
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import {
|
2
|
+
BaseTransaction,
|
3
|
+
isNumber,
|
4
|
+
validateBaseTransaction,
|
5
|
+
validateRequiredField,
|
6
|
+
} from './common'
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Delete an Oracle ledger entry.
|
10
|
+
*
|
11
|
+
* @category Transaction Models
|
12
|
+
*/
|
13
|
+
export interface OracleDelete extends BaseTransaction {
|
14
|
+
TransactionType: 'OracleDelete'
|
15
|
+
|
16
|
+
/**
|
17
|
+
* A unique identifier of the price oracle for the Account.
|
18
|
+
*/
|
19
|
+
OracleDocumentID: number
|
20
|
+
}
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Verify the form and type of a OracleDelete at runtime.
|
24
|
+
*
|
25
|
+
* @param tx - A OracleDelete Transaction.
|
26
|
+
* @throws When the OracleDelete is malformed.
|
27
|
+
*/
|
28
|
+
export function validateOracleDelete(tx: Record<string, unknown>): void {
|
29
|
+
validateBaseTransaction(tx)
|
30
|
+
|
31
|
+
validateRequiredField(tx, 'OracleDocumentID', isNumber)
|
32
|
+
}
|
@@ -0,0 +1,176 @@
|
|
1
|
+
import { ValidationError } from '../../errors'
|
2
|
+
import { PriceData } from '../common'
|
3
|
+
|
4
|
+
import {
|
5
|
+
BaseTransaction,
|
6
|
+
isNumber,
|
7
|
+
isString,
|
8
|
+
validateBaseTransaction,
|
9
|
+
validateOptionalField,
|
10
|
+
validateRequiredField,
|
11
|
+
} from './common'
|
12
|
+
|
13
|
+
const PRICE_DATA_SERIES_MAX_LENGTH = 10
|
14
|
+
const SCALE_MAX = 10
|
15
|
+
|
16
|
+
/**
|
17
|
+
* Creates a new Oracle ledger entry or updates the fields of an existing one, using the Oracle ID.
|
18
|
+
*
|
19
|
+
* The oracle provider must complete these steps before submitting this transaction:
|
20
|
+
* 1. Create or own the XRPL account in the Owner field and have enough XRP to meet the reserve and transaction fee requirements.
|
21
|
+
* 2. Publish the XRPL account public key, so it can be used for verification by dApps.
|
22
|
+
* 3. Publish a registry of available price oracles with their unique OracleDocumentID.
|
23
|
+
*
|
24
|
+
* @category Transaction Models
|
25
|
+
*/
|
26
|
+
export interface OracleSet extends BaseTransaction {
|
27
|
+
TransactionType: 'OracleSet'
|
28
|
+
|
29
|
+
/**
|
30
|
+
* A unique identifier of the price oracle for the Account.
|
31
|
+
*/
|
32
|
+
OracleDocumentID: number
|
33
|
+
|
34
|
+
/**
|
35
|
+
* The time the data was last updated, represented as a unix timestamp in seconds.
|
36
|
+
*/
|
37
|
+
LastUpdateTime: number
|
38
|
+
|
39
|
+
/**
|
40
|
+
* An array of up to 10 PriceData objects, each representing the price information
|
41
|
+
* for a token pair. More than five PriceData objects require two owner reserves.
|
42
|
+
*/
|
43
|
+
PriceDataSeries: PriceData[]
|
44
|
+
|
45
|
+
/**
|
46
|
+
* An arbitrary value that identifies an oracle provider, such as Chainlink, Band,
|
47
|
+
* or DIA. This field is a string, up to 256 ASCII hex encoded characters (0x20-0x7E).
|
48
|
+
* This field is required when creating a new Oracle ledger entry, but is optional for updates.
|
49
|
+
*/
|
50
|
+
Provider?: string
|
51
|
+
|
52
|
+
/**
|
53
|
+
* An optional Universal Resource Identifier to reference price data off-chain. This field is limited to 256 bytes.
|
54
|
+
*/
|
55
|
+
URI?: string
|
56
|
+
|
57
|
+
/**
|
58
|
+
* Describes the type of asset, such as "currency", "commodity", or "index". This field is a string, up to 16 ASCII
|
59
|
+
* hex encoded characters (0x20-0x7E). This field is required when creating a new Oracle ledger entry, but is optional
|
60
|
+
* for updates.
|
61
|
+
*/
|
62
|
+
AssetClass?: string
|
63
|
+
}
|
64
|
+
|
65
|
+
/**
|
66
|
+
* Verify the form and type of a OracleSet at runtime.
|
67
|
+
*
|
68
|
+
* @param tx - A OracleSet Transaction.
|
69
|
+
* @throws When the OracleSet is malformed.
|
70
|
+
*/
|
71
|
+
// eslint-disable-next-line max-lines-per-function -- necessary to validate many fields
|
72
|
+
export function validateOracleSet(tx: Record<string, unknown>): void {
|
73
|
+
validateBaseTransaction(tx)
|
74
|
+
|
75
|
+
validateRequiredField(tx, 'OracleDocumentID', isNumber)
|
76
|
+
|
77
|
+
validateRequiredField(tx, 'LastUpdateTime', isNumber)
|
78
|
+
|
79
|
+
validateOptionalField(tx, 'Provider', isString)
|
80
|
+
|
81
|
+
validateOptionalField(tx, 'URI', isString)
|
82
|
+
|
83
|
+
validateOptionalField(tx, 'AssetClass', isString)
|
84
|
+
|
85
|
+
// eslint-disable-next-line max-lines-per-function -- necessary to validate many fields
|
86
|
+
validateRequiredField(tx, 'PriceDataSeries', (value) => {
|
87
|
+
if (!Array.isArray(value)) {
|
88
|
+
throw new ValidationError('OracleSet: PriceDataSeries must be an array')
|
89
|
+
}
|
90
|
+
|
91
|
+
if (value.length > PRICE_DATA_SERIES_MAX_LENGTH) {
|
92
|
+
throw new ValidationError(
|
93
|
+
`OracleSet: PriceDataSeries must have at most ${PRICE_DATA_SERIES_MAX_LENGTH} PriceData objects`,
|
94
|
+
)
|
95
|
+
}
|
96
|
+
|
97
|
+
// TODO: add support for handling inner objects easier (similar to validateRequiredField/validateOptionalField)
|
98
|
+
for (const priceData of value) {
|
99
|
+
if (typeof priceData !== 'object') {
|
100
|
+
throw new ValidationError(
|
101
|
+
'OracleSet: PriceDataSeries must be an array of objects',
|
102
|
+
)
|
103
|
+
}
|
104
|
+
|
105
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- we are validating the type
|
106
|
+
if (priceData.PriceData == null) {
|
107
|
+
throw new ValidationError(
|
108
|
+
'OracleSet: PriceDataSeries must have a `PriceData` object',
|
109
|
+
)
|
110
|
+
}
|
111
|
+
|
112
|
+
// check if priceData only has PriceData
|
113
|
+
if (Object.keys(priceData).length !== 1) {
|
114
|
+
throw new ValidationError(
|
115
|
+
'OracleSet: PriceDataSeries must only have a single PriceData object',
|
116
|
+
)
|
117
|
+
}
|
118
|
+
|
119
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- we are validating the type
|
120
|
+
if (typeof priceData.PriceData.BaseAsset !== 'string') {
|
121
|
+
throw new ValidationError(
|
122
|
+
'OracleSet: PriceDataSeries must have a `BaseAsset` string',
|
123
|
+
)
|
124
|
+
}
|
125
|
+
|
126
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- we are validating the type
|
127
|
+
if (typeof priceData.PriceData.QuoteAsset !== 'string') {
|
128
|
+
throw new ValidationError(
|
129
|
+
'OracleSet: PriceDataSeries must have a `QuoteAsset` string',
|
130
|
+
)
|
131
|
+
}
|
132
|
+
|
133
|
+
// Either AssetPrice and Scale are both present or both excluded
|
134
|
+
if (
|
135
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- we are validating the type
|
136
|
+
(priceData.PriceData.AssetPrice == null) !==
|
137
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- we are validating the type
|
138
|
+
(priceData.PriceData.Scale == null)
|
139
|
+
) {
|
140
|
+
throw new ValidationError(
|
141
|
+
'OracleSet: PriceDataSeries must have both `AssetPrice` and `Scale` if any are present',
|
142
|
+
)
|
143
|
+
}
|
144
|
+
|
145
|
+
if (
|
146
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- we are validating the type
|
147
|
+
'AssetPrice' in priceData.PriceData &&
|
148
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- we are validating the type
|
149
|
+
!isNumber(priceData.PriceData.AssetPrice)
|
150
|
+
) {
|
151
|
+
throw new ValidationError('OracleSet: invalid field AssetPrice')
|
152
|
+
}
|
153
|
+
|
154
|
+
if (
|
155
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- we are validating the type
|
156
|
+
'Scale' in priceData.PriceData &&
|
157
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- we are validating the type
|
158
|
+
!isNumber(priceData.PriceData.Scale)
|
159
|
+
) {
|
160
|
+
throw new ValidationError('OracleSet: invalid field Scale')
|
161
|
+
}
|
162
|
+
|
163
|
+
if (
|
164
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- we are validating the type
|
165
|
+
priceData.PriceData.Scale < 0 ||
|
166
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- we are validating the type
|
167
|
+
priceData.PriceData.Scale > SCALE_MAX
|
168
|
+
) {
|
169
|
+
throw new ValidationError(
|
170
|
+
`OracleSet: Scale must be in range 0-${SCALE_MAX}`,
|
171
|
+
)
|
172
|
+
}
|
173
|
+
}
|
174
|
+
return true
|
175
|
+
})
|
176
|
+
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ValidationError } from '../../errors'
|
2
|
-
import { Amount, Path } from '../common'
|
2
|
+
import { Amount, Path, MPTAmount } from '../common'
|
3
3
|
import { isFlagEnabled } from '../utils'
|
4
4
|
|
5
5
|
import {
|
@@ -26,7 +26,7 @@ export enum PaymentFlags {
|
|
26
26
|
* This is intended to force the transaction to take arbitrage opportunities.
|
27
27
|
* Most clients do not need this.
|
28
28
|
*/
|
29
|
-
|
29
|
+
tfNoRippleDirect = 0x00010000,
|
30
30
|
/**
|
31
31
|
* If the specified Amount cannot be sent without spending more than SendMax,
|
32
32
|
* reduce the received amount instead of failing outright. See Partial.
|
@@ -88,7 +88,7 @@ export interface PaymentFlagsInterface extends GlobalFlags {
|
|
88
88
|
* This is intended to force the transaction to take arbitrage opportunities.
|
89
89
|
* Most clients do not need this.
|
90
90
|
*/
|
91
|
-
|
91
|
+
tfNoRippleDirect?: boolean
|
92
92
|
/**
|
93
93
|
* If the specified Amount cannot be sent without spending more than SendMax,
|
94
94
|
* reduce the received amount instead of failing outright. See Partial.
|
@@ -116,7 +116,7 @@ export interface Payment extends BaseTransaction {
|
|
116
116
|
* names MUST be lower-case. If the tfPartialPayment flag is set, deliver up
|
117
117
|
* to this amount instead.
|
118
118
|
*/
|
119
|
-
Amount: Amount
|
119
|
+
Amount: Amount | MPTAmount
|
120
120
|
/** The unique address of the account receiving the payment. */
|
121
121
|
Destination: Account
|
122
122
|
/**
|
@@ -153,8 +153,8 @@ export interface Payment extends BaseTransaction {
|
|
153
153
|
}
|
154
154
|
|
155
155
|
export interface PaymentMetadata extends TransactionMetadataBase {
|
156
|
-
DeliveredAmount?: Amount
|
157
|
-
delivered_amount?: Amount | 'unavailable'
|
156
|
+
DeliveredAmount?: Amount | MPTAmount
|
157
|
+
delivered_amount?: Amount | MPTAmount | 'unavailable'
|
158
158
|
}
|
159
159
|
|
160
160
|
/**
|