mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
Compare commits
11 Commits
ripple-bin
...
network-id
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a5deee1274 | ||
|
|
294c1cb083 | ||
|
|
69c705874f | ||
|
|
e36912c60a | ||
|
|
3d06185867 | ||
|
|
5d34746f12 | ||
|
|
3d0bec7e89 | ||
|
|
b241779f10 | ||
|
|
c809bd87e4 | ||
|
|
fde954640f | ||
|
|
b2dcce75b0 |
@@ -177,32 +177,33 @@ npm uninstall abbrev -w xrpl
|
||||
|
||||
NOW WE ARE READY TO PUBLISH! No new code changes happen manually now.
|
||||
|
||||
2. Checkout `main` and `git pull`.
|
||||
3. Create a new branch to capture updates that take place during this process. `git checkout -b <BRANCH_NAME>`
|
||||
2. Checkout `main` (or your beta branch) and `git pull`.
|
||||
3. Create a new branch (`git checkout -b <BRANCH_NAME>`) to capture updates that take place during this process.
|
||||
4. Update `HISTORY.md` to reflect release changes.
|
||||
5. Run `npm run docgen` if the docs were modified in this release to update them.
|
||||
5. Run `npm run docgen` if the docs were modified in this release to update them (skip this step for a beta).
|
||||
6. Run `npm run build` to triple check the build still works
|
||||
7. Run `npx lerna version --no-git-tag-version` - This creates a draft PR and release tags for the new version.
|
||||
8. For each changed package, pick what the new version should be. Lerna will bump the versions, commit version bumps to `main`, and create a new git tag for each published package.
|
||||
9. Run `npm i` to update the package-lock with the updated versions
|
||||
10. Create a new PR from this branch into `main` and merge it.
|
||||
11. Checkout `main` and `git pull`
|
||||
12. Run `npx lerna publish from-package --yes` - This will actually publish the packages.
|
||||
13. If it asks for it, enter your [npmjs.com](https://npmjs.com) OTP (one-time password) to complete publication.
|
||||
14. Create a new branch to capture the updated packages from the release (`git checkout -b <BRANCH_NAME>`)
|
||||
15. Make a PR to merge those changes into `main`
|
||||
7. Run `npx lerna version --no-git-tag-version` - This creates a draft PR and bumps the versions of the packages.
|
||||
* For each changed package, pick what the new version should be. Lerna will bump the versions, commit version bumps to `main`, and create a new git tag for each published package.
|
||||
* If publishing a beta, make sure that the versions are all of the form `a.b.c-beta.d`, where `a`, `b`, and `c` are identical to the last normal release except for one, which has been incremented by 1.
|
||||
8. Run `npm i` to update the package-lock with the updated versions
|
||||
9. Create a new PR from this branch into `main` and merge it (you can directly merge into the beta branch for a beta).
|
||||
10. Checkout `main` and `git pull` (you can skip this step for a beta since you already have the latest version of the beta branch).
|
||||
11. Run `npx lerna publish from-package --yes` - This will actually publish the packages.
|
||||
* NOTE: if you're releasing a beta, run `npx lerna publish from-package --dist-tag beta --yes` instead.
|
||||
* If it asks for it, enter your [npmjs.com](https://npmjs.com) OTP (one-time password) to complete publication.
|
||||
12. Create a new branch (`git checkout -b <BRANCH_NAME>`)to capture the updated packages from the release. Merge those changes into `main`. (You can skip this step on a beta release).
|
||||
|
||||
NOW YOU HAVE PUBLISHED! But you're not done; we have to notify people!
|
||||
|
||||
16. Pull the most recent changes to main locally.
|
||||
17. Run `git tag <tagname> -m <tagname>`, where `<tagname>` is the new package and version (e.g. `xrpl@2.1.1`), for each version released.
|
||||
18. Run `git push --follow-tags`, to push the tags to Github.
|
||||
19. On Github, click the "releases" link on the right-hand side of the page.
|
||||
20. Click "Draft a new release"
|
||||
21. Click "Choose a tag", and choose a tag that you just created.
|
||||
22. Edit the name of the release to match the tag (IE \<package\>@\<version\>) and edit the description as you see fit.
|
||||
23. Repeat steps 19-21 for each release.
|
||||
24. Send an email to [xrpl-announce](https://groups.google.com/g/xrpl-announce).
|
||||
13. Pull the most recent changes to main locally.
|
||||
14. Run `git tag <tagname> -m <tagname>`, where `<tagname>` is the new package and version (e.g. `xrpl@2.1.1`), for each version released.
|
||||
15. Run `git push --follow-tags`, to push the tags to Github.
|
||||
16. On Github, click the "releases" link on the right-hand side of the page.
|
||||
17. Click "Draft a new release"
|
||||
18. Click "Choose a tag", and choose a tag that you just created.
|
||||
19. Edit the name of the release to match the tag (IE \<package\>@\<version\>) and edit the description as you see fit.
|
||||
20. Repeat steps 17-19 for each release.
|
||||
21. Send an email to [xrpl-announce](https://groups.google.com/g/xrpl-announce).
|
||||
|
||||
## Mailing Lists
|
||||
|
||||
|
||||
12
package-lock.json
generated
12
package-lock.json
generated
@@ -13447,9 +13447,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "2.8.3",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.3.tgz",
|
||||
"integrity": "sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==",
|
||||
"version": "2.8.4",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz",
|
||||
"integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"prettier": "bin-prettier.js"
|
||||
@@ -27841,9 +27841,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"prettier": {
|
||||
"version": "2.8.3",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.3.tgz",
|
||||
"integrity": "sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==",
|
||||
"version": "2.8.4",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz",
|
||||
"integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==",
|
||||
"dev": true
|
||||
},
|
||||
"prettier-linter-helpers": {
|
||||
|
||||
@@ -321,6 +321,16 @@
|
||||
"type": "UInt16"
|
||||
}
|
||||
],
|
||||
[
|
||||
"NetworkID",
|
||||
{
|
||||
"nth": 1,
|
||||
"isVLEncoded": false,
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
"type": "UInt32"
|
||||
}
|
||||
],
|
||||
[
|
||||
"Flags",
|
||||
{
|
||||
@@ -2176,6 +2186,9 @@
|
||||
"telCAN_NOT_QUEUE_BLOCKED": -389,
|
||||
"telCAN_NOT_QUEUE_FEE": -388,
|
||||
"telCAN_NOT_QUEUE_FULL": -387,
|
||||
"telWRONG_NETWORK": -386,
|
||||
"telREQUIRES_NETWORK_ID": -385,
|
||||
"telNETWORK_ID_MAKES_TX_NON_CANONICAL": -384,
|
||||
|
||||
"temMALFORMED": -299,
|
||||
"temBAD_AMOUNT": -298,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import assert from 'assert'
|
||||
import fixtures from './fixtures/api.json'
|
||||
import * as fixtures from './fixtures/api.json'
|
||||
import * as api from '../src'
|
||||
|
||||
const decodeSeed = api.decodeSeed
|
||||
|
||||
@@ -10,6 +10,7 @@ Subscribe to [the **xrpl-announce** mailing list](https://groups.google.com/g/xr
|
||||
* Improved typescript typing
|
||||
|
||||
### Added
|
||||
- `getNFTokenID` lets you get the NFTokenID after minting an NFT
|
||||
|
||||
|
||||
### Changed
|
||||
@@ -26,6 +27,7 @@ Wallet.fromMmnemonic()
|
||||
|
||||
### Added
|
||||
* Optional custom amount field to `fundWallet`.
|
||||
* Support for `disallowIncoming` account set flags (e.g. `asfDisallowIncomingTrustline`)
|
||||
|
||||
### Changed
|
||||
* Add support for Transaction objects in `verifyTransaction`
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/* eslint-disable max-lines -- Connection is a large file w/ lots of imports/exports */
|
||||
|
||||
import { EventEmitter } from 'events'
|
||||
import { Agent } from 'http'
|
||||
|
||||
|
||||
@@ -116,6 +116,22 @@ export interface AccountRootFlagsInterface {
|
||||
* (It has DepositAuth enabled.)
|
||||
*/
|
||||
lsfDepositAuth?: boolean
|
||||
/**
|
||||
* Disallow incoming NFTOffers from other accounts.
|
||||
*/
|
||||
lsfDisallowIncomingNFTOffer?: boolean
|
||||
/**
|
||||
* Disallow incoming Checks from other accounts.
|
||||
*/
|
||||
lsfDisallowIncomingCheck?: boolean
|
||||
/**
|
||||
* Disallow incoming PayChannels from other accounts.
|
||||
*/
|
||||
lsfDisallowIncomingPayChan?: boolean
|
||||
/**
|
||||
* Disallow incoming Trustlines from other accounts.
|
||||
*/
|
||||
lsfDisallowIncomingTrustline?: boolean
|
||||
}
|
||||
|
||||
export enum AccountRootFlags {
|
||||
@@ -156,4 +172,20 @@ export enum AccountRootFlags {
|
||||
* (It has DepositAuth enabled.)
|
||||
*/
|
||||
lsfDepositAuth = 0x01000000,
|
||||
/**
|
||||
* Disallow incoming NFTOffers from other accounts.
|
||||
*/
|
||||
lsfDisallowIncomingNFTOffer = 0x04000000,
|
||||
/**
|
||||
* Disallow incoming Checks from other accounts.
|
||||
*/
|
||||
lsfDisallowIncomingCheck = 0x08000000,
|
||||
/**
|
||||
* Disallow incoming PayChannels from other accounts.
|
||||
*/
|
||||
lsfDisallowIncomingPayChan = 0x10000000,
|
||||
/**
|
||||
* Disallow incoming Trustlines from other accounts.
|
||||
*/
|
||||
lsfDisallowIncomingTrustline = 0x20000000,
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ export interface AccountNFTsRequest extends BaseRequest {
|
||||
*
|
||||
* @category Responses
|
||||
*/
|
||||
interface AccountNFToken {
|
||||
export interface AccountNFToken {
|
||||
Flags: number
|
||||
Issuer: string
|
||||
NFTokenID: string
|
||||
|
||||
@@ -136,6 +136,10 @@ export interface ServerInfoResponse extends BaseResponse {
|
||||
* overall network's load factor.
|
||||
*/
|
||||
load_factor?: number
|
||||
/**
|
||||
* The network id of the server.
|
||||
*/
|
||||
network_id?: number
|
||||
/**
|
||||
* Current multiplier to the transaction cost based on
|
||||
* load to this server.
|
||||
|
||||
@@ -44,6 +44,15 @@ export enum AccountSetAsfFlags {
|
||||
* Allow another account to mint and burn tokens on behalf of this account.
|
||||
*/
|
||||
asfAuthorizedNFTokenMinter = 10,
|
||||
/** asf 11 is reserved for Hooks amendment */
|
||||
/** Disallow other accounts from creating incoming NFTOffers */
|
||||
asfDisallowIncomingNFTOffer = 12,
|
||||
/** Disallow other accounts from creating incoming Checks */
|
||||
asfDisallowIncomingCheck = 13,
|
||||
/** Disallow other accounts from creating incoming PayChannels */
|
||||
asfDisallowIncomingPayChan = 14,
|
||||
/** Disallow other accounts from creating incoming Trustlines */
|
||||
asfDisallowIncomingTrustline = 15,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -159,6 +159,10 @@ export interface BaseTransaction {
|
||||
* account it says it is from.
|
||||
*/
|
||||
TxnSignature?: string
|
||||
/**
|
||||
* The network id of the transaction.
|
||||
*/
|
||||
NetworkID?: number
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -252,6 +256,9 @@ export function validateBaseTransaction(common: Record<string, unknown>): void {
|
||||
) {
|
||||
throw new ValidationError('BaseTransaction: invalid TxnSignature')
|
||||
}
|
||||
if (common.NetworkID !== undefined && typeof common.NetworkID !== 'number') {
|
||||
throw new ValidationError('BaseTransaction: invalid NetworkID')
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Amount } from '../common'
|
||||
|
||||
interface CreatedNode {
|
||||
export interface CreatedNode {
|
||||
CreatedNode: {
|
||||
LedgerEntryType: string
|
||||
LedgerIndex: string
|
||||
@@ -8,7 +8,7 @@ interface CreatedNode {
|
||||
}
|
||||
}
|
||||
|
||||
interface ModifiedNode {
|
||||
export interface ModifiedNode {
|
||||
ModifiedNode: {
|
||||
LedgerEntryType: string
|
||||
LedgerIndex: string
|
||||
@@ -19,7 +19,7 @@ interface ModifiedNode {
|
||||
}
|
||||
}
|
||||
|
||||
interface DeletedNode {
|
||||
export interface DeletedNode {
|
||||
DeletedNode: {
|
||||
LedgerEntryType: string
|
||||
LedgerIndex: string
|
||||
@@ -29,6 +29,36 @@ interface DeletedNode {
|
||||
|
||||
export type Node = CreatedNode | ModifiedNode | DeletedNode
|
||||
|
||||
/**
|
||||
* A typeguard to check if a node is a CreatedNode.
|
||||
*
|
||||
* @param node - A node from metadata.
|
||||
* @returns whether the given node is a CreatedNode.
|
||||
*/
|
||||
export function isCreatedNode(node: Node): node is CreatedNode {
|
||||
return Object.prototype.hasOwnProperty.call(node, `CreatedNode`)
|
||||
}
|
||||
|
||||
/**
|
||||
* A typeguard to check if a node is a ModifiedNode.
|
||||
*
|
||||
* @param node - A node from metadata.
|
||||
* @returns whether the given node is a ModifiedNode.
|
||||
*/
|
||||
export function isModifiedNode(node: Node): node is ModifiedNode {
|
||||
return Object.prototype.hasOwnProperty.call(node, `ModifiedNode`)
|
||||
}
|
||||
|
||||
/**
|
||||
* A typeguard to check if a node is a DeletedNode.
|
||||
*
|
||||
* @param node - A node from metadata.
|
||||
* @returns whether the given node is a DeletedNode.
|
||||
*/
|
||||
export function isDeletedNode(node: Node): node is DeletedNode {
|
||||
return Object.prototype.hasOwnProperty.call(node, `DeletedNode`)
|
||||
}
|
||||
|
||||
export interface TransactionMetadata {
|
||||
AffectedNodes: Node[]
|
||||
DeliveredAmount?: Amount
|
||||
|
||||
@@ -9,6 +9,7 @@ import { setTransactionFlagsToNumber } from '../models/utils/flags'
|
||||
import { xrpToDrops } from '../utils'
|
||||
|
||||
import getFeeXrp from './getFeeXrp'
|
||||
import getNetworkID from './getNetworkID'
|
||||
|
||||
// Expire unconfirmed transactions after 20 ledger versions, approximately 1 minute, by default
|
||||
const LEDGER_OFFSET = 20
|
||||
@@ -39,8 +40,10 @@ async function autofill<T extends Transaction>(
|
||||
setValidAddresses(tx)
|
||||
|
||||
setTransactionFlagsToNumber(tx)
|
||||
|
||||
const promises: Array<Promise<void>> = []
|
||||
if (tx.NetworkID == null) {
|
||||
promises.push(setNetworkID(this, tx))
|
||||
}
|
||||
if (tx.Sequence == null) {
|
||||
promises.push(setNextValidSequenceNumber(this, tx))
|
||||
}
|
||||
@@ -200,6 +203,12 @@ function scaleValue(value, multiplier): string {
|
||||
return new BigNumber(value).times(multiplier).toString()
|
||||
}
|
||||
|
||||
async function setNetworkID(client: Client, tx: Transaction): Promise<void> {
|
||||
const id = await getNetworkID(client)
|
||||
// eslint-disable-next-line no-param-reassign -- param reassign is safe
|
||||
tx.NetworkID = id
|
||||
}
|
||||
|
||||
async function setLatestValidatedLedgerSequence(
|
||||
client: Client,
|
||||
tx: Transaction,
|
||||
|
||||
22
packages/xrpl/src/sugar/getNetworkID.ts
Normal file
22
packages/xrpl/src/sugar/getNetworkID.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import type { Client } from '..'
|
||||
import { XrplError } from '../errors'
|
||||
|
||||
/**
|
||||
* Returns the network ID of the rippled server.
|
||||
*
|
||||
* @param this - The Client used to connect to the ledger.
|
||||
* @param client
|
||||
* @returns The network id.
|
||||
*/
|
||||
export default async function getNetworkID(client: Client): Promise<number> {
|
||||
const response = await client.request({
|
||||
command: 'server_info',
|
||||
})
|
||||
const networkID = response.result.info.network_id
|
||||
if (networkID == null) {
|
||||
throw new XrplError(
|
||||
'getNetworkID: Could not get network_id from server_info',
|
||||
)
|
||||
}
|
||||
return networkID
|
||||
}
|
||||
85
packages/xrpl/src/utils/getNFTokenID.ts
Normal file
85
packages/xrpl/src/utils/getNFTokenID.ts
Normal file
@@ -0,0 +1,85 @@
|
||||
import flatMap from 'lodash/flatMap'
|
||||
|
||||
import {
|
||||
CreatedNode,
|
||||
isCreatedNode,
|
||||
isModifiedNode,
|
||||
ModifiedNode,
|
||||
TransactionMetadata,
|
||||
} from '../models/transactions/metadata'
|
||||
|
||||
interface NFToken {
|
||||
NFToken: {
|
||||
NFTokenID: string
|
||||
URI: string
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the NFTokenID for an NFT recently minted with NFTokenMint.
|
||||
*
|
||||
* @param meta - Metadata from the response to submitting an NFTokenMint transaction.
|
||||
* @returns The NFTokenID for the minted NFT.
|
||||
* @throws if meta is not TransactionMetadata.
|
||||
*/
|
||||
export default function getNFTokenID(
|
||||
meta: TransactionMetadata,
|
||||
): string | undefined {
|
||||
/* eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Provides a nicer error for js users */
|
||||
if (meta.AffectedNodes === undefined) {
|
||||
throw new TypeError(`Unable to parse the parameter given to getNFTokenID.
|
||||
'meta' must be the metadata from an NFTokenMint transaction. Received ${JSON.stringify(
|
||||
meta,
|
||||
)} instead.`)
|
||||
}
|
||||
|
||||
/*
|
||||
* When a mint results in splitting an existing page,
|
||||
* it results in a created page and a modified node. Sometimes,
|
||||
* the created node needs to be linked to a third page, resulting
|
||||
* in modifying that third page's PreviousPageMin or NextPageMin
|
||||
* field changing, but no NFTs within that page changing. In this
|
||||
* case, there will be no previous NFTs and we need to skip.
|
||||
* However, there will always be NFTs listed in the final fields,
|
||||
* as rippled outputs all fields in final fields even if they were
|
||||
* not changed. Thus why we add the additional condition to check
|
||||
* if the PreviousFields contains NFTokens
|
||||
*/
|
||||
|
||||
const affectedNodes = meta.AffectedNodes.filter((node) => {
|
||||
if (isCreatedNode(node)) {
|
||||
return node.CreatedNode.LedgerEntryType === 'NFTokenPage'
|
||||
}
|
||||
if (isModifiedNode(node)) {
|
||||
return (
|
||||
node.ModifiedNode.LedgerEntryType === 'NFTokenPage' &&
|
||||
Boolean(node.ModifiedNode.PreviousFields?.NFTokens)
|
||||
)
|
||||
}
|
||||
return false
|
||||
})
|
||||
/* eslint-disable @typescript-eslint/consistent-type-assertions -- Necessary for parsing metadata */
|
||||
const previousTokenIDSet = new Set(
|
||||
flatMap(affectedNodes, (node) => {
|
||||
const nftokens = isModifiedNode(node)
|
||||
? (node.ModifiedNode.PreviousFields?.NFTokens as NFToken[])
|
||||
: []
|
||||
return nftokens.map((token) => token.NFToken.NFTokenID)
|
||||
}).filter((id) => Boolean(id)),
|
||||
)
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unnecessary-condition -- Cleaner to read */
|
||||
const finalTokenIDs = flatMap(affectedNodes, (node) =>
|
||||
(
|
||||
(((node as ModifiedNode).ModifiedNode?.FinalFields?.NFTokens ??
|
||||
(node as CreatedNode).CreatedNode?.NewFields?.NFTokens) as NFToken[]) ??
|
||||
[]
|
||||
).map((token) => token.NFToken.NFTokenID),
|
||||
).filter((nftokenID) => Boolean(nftokenID))
|
||||
/* eslint-enable @typescript-eslint/consistent-type-assertions -- Necessary for parsing metadata */
|
||||
/* eslint-enable @typescript-eslint/no-unnecessary-condition -- Cleaner to read */
|
||||
|
||||
const nftokenID = finalTokenIDs.find((id) => !previousTokenIDSet.has(id))
|
||||
|
||||
return nftokenID
|
||||
}
|
||||
@@ -25,6 +25,7 @@ import { Transaction } from '../models/transactions/transaction'
|
||||
import createCrossChainPayment from './createCrossChainPayment'
|
||||
import { deriveKeypair, deriveAddress, deriveXAddress } from './derive'
|
||||
import getBalanceChanges from './getBalanceChanges'
|
||||
import getNFTokenID from './getNFTokenID'
|
||||
import {
|
||||
hashSignedTx,
|
||||
hashTx,
|
||||
@@ -218,6 +219,7 @@ export {
|
||||
encodeForMultiSigning,
|
||||
encodeForSigning,
|
||||
encodeForSigningClaim,
|
||||
getNFTokenID,
|
||||
createCrossChainPayment,
|
||||
parseNFTokenID,
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import { assertRejects } from '../testUtils'
|
||||
const Fee = '10'
|
||||
const Sequence = 1432
|
||||
const LastLedgerSequence = 2908734
|
||||
const NetworkID = 21338
|
||||
|
||||
describe('client.autofill', function () {
|
||||
let testContext: XrplTestContext
|
||||
@@ -35,12 +36,14 @@ describe('client.autofill', function () {
|
||||
Fee,
|
||||
Sequence,
|
||||
LastLedgerSequence,
|
||||
NetworkID,
|
||||
}
|
||||
const txResult = await testContext.client.autofill(tx)
|
||||
|
||||
assert.strictEqual(txResult.Fee, Fee)
|
||||
assert.strictEqual(txResult.Sequence, Sequence)
|
||||
assert.strictEqual(txResult.LastLedgerSequence, LastLedgerSequence)
|
||||
assert.strictEqual(txResult.NetworkID, NetworkID)
|
||||
})
|
||||
|
||||
it('converts Account & Destination X-address to their classic address', async function () {
|
||||
@@ -58,6 +61,10 @@ describe('client.autofill', function () {
|
||||
'server_info',
|
||||
rippled.server_info.normal,
|
||||
)
|
||||
testContext.mockRippled!.addResponse(
|
||||
'server_info',
|
||||
rippled.server_info.normal,
|
||||
)
|
||||
testContext.mockRippled!.addResponse('ledger', rippled.ledger.normal)
|
||||
|
||||
const txResult = await testContext.client.autofill(tx)
|
||||
@@ -76,6 +83,7 @@ describe('client.autofill', function () {
|
||||
Authorize: 'rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo',
|
||||
Fee,
|
||||
LastLedgerSequence,
|
||||
NetworkID,
|
||||
}
|
||||
testContext.mockRippled!.addResponse('account_info', {
|
||||
status: 'success',
|
||||
@@ -101,6 +109,10 @@ describe('client.autofill', function () {
|
||||
'server_info',
|
||||
rippled.server_info.normal,
|
||||
)
|
||||
testContext.mockRippled!.addResponse(
|
||||
'server_info',
|
||||
rippled.server_info.normal,
|
||||
)
|
||||
testContext.mockRippled!.addResponse(
|
||||
'account_objects',
|
||||
rippled.account_objects.normal,
|
||||
@@ -113,6 +125,7 @@ describe('client.autofill', function () {
|
||||
Fee,
|
||||
Sequence,
|
||||
LastLedgerSequence,
|
||||
NetworkID,
|
||||
}
|
||||
|
||||
await assertRejects(testContext.client.autofill(tx), XrplError)
|
||||
@@ -126,6 +139,7 @@ describe('client.autofill', function () {
|
||||
Authorize: 'rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo',
|
||||
Sequence,
|
||||
LastLedgerSequence,
|
||||
NetworkID,
|
||||
}
|
||||
testContext.mockRippled!.addResponse(
|
||||
'server_info',
|
||||
@@ -155,6 +169,10 @@ describe('client.autofill', function () {
|
||||
'server_info',
|
||||
rippled.server_info.normal,
|
||||
)
|
||||
testContext.mockRippled!.addResponse(
|
||||
'server_info',
|
||||
rippled.server_info.normal,
|
||||
)
|
||||
|
||||
const txResult = await testContext.client.autofill(tx)
|
||||
assert.strictEqual(txResult.Fee, '399')
|
||||
@@ -171,6 +189,10 @@ describe('client.autofill', function () {
|
||||
rippled.account_info.normal,
|
||||
)
|
||||
testContext.mockRippled!.addResponse('ledger', rippled.ledger.normal)
|
||||
testContext.mockRippled!.addResponse(
|
||||
'server_info',
|
||||
rippled.server_info.normal,
|
||||
)
|
||||
testContext.mockRippled!.addResponse('server_state', {
|
||||
status: 'success',
|
||||
type: 'response',
|
||||
@@ -214,6 +236,10 @@ describe('client.autofill', function () {
|
||||
'server_info',
|
||||
rippled.server_info.normal,
|
||||
)
|
||||
testContext.mockRippled!.addResponse(
|
||||
'server_info',
|
||||
rippled.server_info.normal,
|
||||
)
|
||||
const txResult = await testContext.client.autofill(tx, 4)
|
||||
|
||||
assert.strictEqual(txResult.Fee, '459')
|
||||
@@ -227,6 +253,7 @@ describe('client.autofill', function () {
|
||||
Authorize: 'rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo',
|
||||
Fee,
|
||||
Sequence,
|
||||
NetworkID,
|
||||
}
|
||||
testContext.mockRippled!.addResponse('ledger', {
|
||||
status: 'success',
|
||||
@@ -272,9 +299,37 @@ describe('client.autofill', function () {
|
||||
},
|
||||
},
|
||||
})
|
||||
testContext.mockRippled!.addResponse(
|
||||
'server_info',
|
||||
rippled.server_info.normal,
|
||||
)
|
||||
const txResult = await testContext.client.autofill(tx)
|
||||
assert.strictEqual(txResult.Fee, '12')
|
||||
assert.strictEqual(txResult.Sequence, 23)
|
||||
assert.strictEqual(txResult.LastLedgerSequence, 9038234)
|
||||
assert.strictEqual(txResult.NetworkID, 21338)
|
||||
})
|
||||
|
||||
it("should autofill NetworkID when it's missing", async function () {
|
||||
const tx: Transaction = {
|
||||
TransactionType: 'DepositPreauth',
|
||||
Account: 'rGWrZyQqhTp9Xu7G5Pkayo7bXjH4k4QYpf',
|
||||
Authorize: 'rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo',
|
||||
Fee,
|
||||
LastLedgerSequence,
|
||||
Sequence,
|
||||
}
|
||||
testContext.mockRippled!.addResponse('server_info', {
|
||||
status: 'success',
|
||||
type: 'response',
|
||||
result: {
|
||||
info: {
|
||||
network_id: 21338,
|
||||
},
|
||||
},
|
||||
})
|
||||
const txResult = await testContext.client.autofill(tx)
|
||||
|
||||
assert.strictEqual(txResult.NetworkID, 21338)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -34,6 +34,7 @@ describe('client.submit', function () {
|
||||
Sequence: 1,
|
||||
Fee: '12',
|
||||
LastLedgerSequence: 12312,
|
||||
NetworkID: 21338,
|
||||
}
|
||||
|
||||
it('should submit an unsigned transaction', async function () {
|
||||
@@ -83,6 +84,7 @@ describe('client.submit', function () {
|
||||
LastLedgerSequence: 12312,
|
||||
Amount: '20000000',
|
||||
Fee: '12',
|
||||
NetworkID: 21338,
|
||||
SigningPubKey:
|
||||
'030E58CDD076E798C84755590AAF6237CA8FAE821070A59F648B517A30DC6F589D',
|
||||
TxnSignature:
|
||||
|
||||
480
packages/xrpl/test/fixtures/rippled/mintNFTMeta.json
vendored
Normal file
480
packages/xrpl/test/fixtures/rippled/mintNFTMeta.json
vendored
Normal file
@@ -0,0 +1,480 @@
|
||||
{
|
||||
"tx": {
|
||||
"Account": "rXMART8usFd5kABXCayoP6ZfB35b4v43t",
|
||||
"Fee": "12",
|
||||
"Flags": 8,
|
||||
"Issuer": "rMhoejpvS8mWfiffy4Zj8H2KbVs1oZCVsP",
|
||||
"LastLedgerSequence": 77781480,
|
||||
"Memos": [
|
||||
{
|
||||
"Memo": {
|
||||
"MemoData": "68747470733A2F2F786D6172742E6172742F766965772D6E66742F38646261376436386533383665363865653636393030373461633965653438323A31363735373034353330383336",
|
||||
"MemoType": "784D6172742D4E46542D6D696E74"
|
||||
}
|
||||
}
|
||||
],
|
||||
"NFTokenTaxon": 5545,
|
||||
"Sequence": 72168792,
|
||||
"SigningPubKey": "ED8BB649713ED492AE35B4B5CA745CCA55ADF8EF4CEDB2CC8BA4E28557E993AD2F",
|
||||
"TransactionType": "NFTokenMint",
|
||||
"TransferFee": 5000,
|
||||
"TxnSignature": "8E4B05FE811BA0DCFE9B4E54B0550D2B934336C09449C2FC14E8F6CFE20069115D18C5930E744220E84C06C145F93F5C291C4CC96D19425C941E2603652B8C02",
|
||||
"URI": "697066733A2F2F626166796265696161736F7073366D6D783772616732743464687833616B3374747432683462647274657279786C373662366C78646E6A7962336D2F6D657461646174612E6A736F6E",
|
||||
"date": 1676330052000,
|
||||
"warnings": [
|
||||
{
|
||||
"id": 1004,
|
||||
"message": "This is a reporting server. The default behavior of a reporting server is to only return validated data. If you are looking for not yet validated data, include \"ledger_index : current\" in your request, which will cause this server to forward the request to a p2p node. If the forward is successful the response will include \"forwarded\" : \"true\""
|
||||
}
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"AffectedNodes": [
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Flags": 0,
|
||||
"NFTokens": [
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB1AD9556900000225",
|
||||
"URI": "697066733A2F2F62616679626569626732726B6B6768616B6B727433696D61656F6D6D65377164747169687A756F713272327875637872776478676565356A7272652F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB1EF9501C0000021A",
|
||||
"URI": "697066733A2F2F62616679626569626A74736F7270637879366465797A666B3233676D6863786E67356C7536746277786E786269627667776575357172356B7A34752F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB1FFCAED5000000E1",
|
||||
"URI": "697066733A2F2F6261667962656962736432653571337674686375777034746868336F6B633673746F676C696D6873746C70347663336564333632796375346978342F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB21D71D900000009E",
|
||||
"URI": "697066733A2F2F6261667962656964736B686B746C646233686F6F637A786A7577766932377835696C637677776278696C33366371366736746362667478653573612F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB22ADCA8600000194",
|
||||
"URI": "697066733A2F2F6261667962656964786336343471776B35626172357036756561376C747A786F3737786B647665616666633435337A66777565646737336B7966752F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB24F382CE000001CC",
|
||||
"URI": "697066733A2F2F62616679626569626A363563346E77737A3773756C773364756D6E776B6F616D6E786770716270656E726D6567356F76657067763233356C687A342F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB25F7188700000093",
|
||||
"URI": "697066733A2F2F626166796265696371767069796C6271616D6371336C636175727A706A696465367468346233376C68346A7766786C65646C63686533756F6179342F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB28A8254800000146",
|
||||
"URI": "697066733A2F2F626166796265696571627072637873686370647865677268686B6C786570666535376970696E6571687137656C706F68326B356E32753571706C792F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB2F794C20000001EE",
|
||||
"URI": "697066733A2F2F626166796265696832656D6A7A616A687337747A6B616C68646B756D363737357678326F76616C33726F6D696368336A3434326A6F3468366166342F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB31BF046800000226",
|
||||
"URI": "697066733A2F2F6261667962656965696E7A787774776B7672666E646E626A7061636D61776E6C7A7564616A726473616777703474676B6F643363756477697337692F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB38BCCC930000009F",
|
||||
"URI": "697066733A2F2F62616679626569636E6678796D66676D70346A6E7365716678617A7633326E65796D697333357769637333336333616B616D72707773323233716D2F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB3B6DE94400000152",
|
||||
"URI": "697066733A2F2F626166796265696435726C676577667762736676683368346C7434756B763267766A7634656B61736778327A766A6D67377166773775737A7576342F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB3BD97DC1000001CD",
|
||||
"URI": "697066733A2F2F62616679626569656A6B677A706C6766616775737564646174326A3335657163756A3762337376356D6C3568613569786676327535747A337170652F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB3F2283CE000000CC",
|
||||
"URI": "697066733A2F2F62616679626569667670746C366B69666C746E3661766F6179663473347A3364796466796B6A666466646A626A76746575696A706B626A336733752F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB3F8E144B00000147",
|
||||
"URI": "697066733A2F2F62616679626569636675336272636F6C6962767171727736703464617772636A6B75737877637436366C6F736C797576636D766C66766D643478692F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB41D3AFB30000017F",
|
||||
"URI": "697066733A2F2F6261667962656967796166656E357877766F346973706E777A3275376E696664687477366C686A376A6E37333334643732366A36656178367377342F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB45F3AAA600000174",
|
||||
"URI": "697066733A2F2F626166796265696774766B3336696F766C68777562326F6B6934747069726670647070337437747171777A6F36746D33706575373478636C3474712F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB465F3F23000001EF",
|
||||
"URI": "697066733A2F2F62616679626569646B37796D37736775747A7A766E70736669796B6A7379733565646568637936707370756C74337137646B696F7A737A376271652F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB47CE1E6500000131",
|
||||
"URI": "697066733A2F2F6261667962656968627A683362786C76716578327163747665616B71656271357066366468637569773779796D6C696E6A346F74327636736937612F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB48A4F76B00000227",
|
||||
"URI": "697066733A2F2F626166796265696179766F6C686F3462777A736D6A69363633337174696975776B71753664726272746877667277626236346B62776174346E76342F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB49A84D20000000EE",
|
||||
"URI": "697066733A2F2F62616679626569633269337535366163646A6764643573733434753674743767656B35796A6D637933766E71676F3265633734686D6D6D676D74612F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB4B82B0EF000000AB",
|
||||
"URI": "697066733A2F2F626166796265696462756637356D67616A6F63336969363465667675786D64356F7236746C3236356E7865623675616A34656232356F35657066652F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB4DC848D7000000E3",
|
||||
"URI": "697066733A2F2F626166796265696169746C677662756774636B37786C6C6934717378683434663467687A6171376B6F6662666135657A6D796A336C7461766877612F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5079949800000196",
|
||||
"URI": "697066733A2F2F62616679626569666F616B736468666A63716575783676766577377078326E34786F6773656E7133377A6176656233696973666E6D64347A6666342F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5253D84700000153",
|
||||
"URI": "697066733A2F2F62616679626569633735366A6F6263786961346776643477717634696E6E766F6C6C75767068676171666161656168353676626C713471343434792F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB52BF2CC0000001CE",
|
||||
"URI": "697066733A2F2F626166796265696268626E6F356664353272717663656A6769656C336B6E796C77727A366A747233767A77336B75656F363674697033716B36356D2F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB542E0F0200000110",
|
||||
"URI": "697066733A2F2F62616679626569666F73776A6B33666775726F6F6F767864326E7372336B676164706768633732366A683672776579776432656E736E74686777792F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5499938F0000018B",
|
||||
"URI": "697066733A2F2F6261667962656961663473797979367A6C6E76716F3664646A326779727A786C6F7779636F6C74746A6777676F33637270373333336E7A676767652F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5C6E313C000000FA",
|
||||
"URI": "697066733A2F2F626166796265696669793734673662767575646A6E757A6661676F6368656E6C6936666E3633616C6C6C717562617A756C7362736F636C636B66342F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5D44EE22000001F0",
|
||||
"URI": "697066733A2F2F62616679626569636171686F6D7A6F36677334656761376D68647A6D6E6F67657274687337776C78777677746B33696B64646E6D7A647273637A6D2F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5F8AA66A00000228",
|
||||
"URI": "697066733A2F2F626166796265696161736F7073366D6D783772616732743464687833616B3374747432683462647274657279786C373662366C78646E6A7962336D2F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB61651529000001E5",
|
||||
"URI": "697066733A2F2F62616679626569637432737174363732766563677232367862776E797A373365657565777A37616D32736869767578376E756232367837326D62342F6D657461646174612E6A736F6E"
|
||||
}
|
||||
}
|
||||
],
|
||||
"NextPageMin": "05BDF50FBDEF54276A1C889252E71B4347C3A0BDE73120BB868538B400000182",
|
||||
"PreviousPageMin": "05BDF50FBDEF54276A1C889252E71B4347C3A0BDE73120BB175153BE0000007C"
|
||||
},
|
||||
"LedgerEntryType": "NFTokenPage",
|
||||
"LedgerIndex": "05BDF50FBDEF54276A1C889252E71B4347C3A0BDE73120BB626863EE000000AC",
|
||||
"PreviousFields": {
|
||||
"NFTokens": [
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB1AD9556900000225",
|
||||
"URI": "697066733A2F2F62616679626569626732726B6B6768616B6B727433696D61656F6D6D65377164747169687A756F713272327875637872776478676565356A7272652F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB1EF9501C0000021A",
|
||||
"URI": "697066733A2F2F62616679626569626A74736F7270637879366465797A666B3233676D6863786E67356C7536746277786E786269627667776575357172356B7A34752F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB1FFCAED5000000E1",
|
||||
"URI": "697066733A2F2F6261667962656962736432653571337674686375777034746868336F6B633673746F676C696D6873746C70347663336564333632796375346978342F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB21D71D900000009E",
|
||||
"URI": "697066733A2F2F6261667962656964736B686B746C646233686F6F637A786A7577766932377835696C637677776278696C33366371366736746362667478653573612F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB22ADCA8600000194",
|
||||
"URI": "697066733A2F2F6261667962656964786336343471776B35626172357036756561376C747A786F3737786B647665616666633435337A66777565646737336B7966752F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB24F382CE000001CC",
|
||||
"URI": "697066733A2F2F62616679626569626A363563346E77737A3773756C773364756D6E776B6F616D6E786770716270656E726D6567356F76657067763233356C687A342F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB25F7188700000093",
|
||||
"URI": "697066733A2F2F626166796265696371767069796C6271616D6371336C636175727A706A696465367468346233376C68346A7766786C65646C63686533756F6179342F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB28A8254800000146",
|
||||
"URI": "697066733A2F2F626166796265696571627072637873686370647865677268686B6C786570666535376970696E6571687137656C706F68326B356E32753571706C792F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB2F794C20000001EE",
|
||||
"URI": "697066733A2F2F626166796265696832656D6A7A616A687337747A6B616C68646B756D363737357678326F76616C33726F6D696368336A3434326A6F3468366166342F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB31BF046800000226",
|
||||
"URI": "697066733A2F2F6261667962656965696E7A787774776B7672666E646E626A7061636D61776E6C7A7564616A726473616777703474676B6F643363756477697337692F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB38BCCC930000009F",
|
||||
"URI": "697066733A2F2F62616679626569636E6678796D66676D70346A6E7365716678617A7633326E65796D697333357769637333336333616B616D72707773323233716D2F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB3B6DE94400000152",
|
||||
"URI": "697066733A2F2F626166796265696435726C676577667762736676683368346C7434756B763267766A7634656B61736778327A766A6D67377166773775737A7576342F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB3BD97DC1000001CD",
|
||||
"URI": "697066733A2F2F62616679626569656A6B677A706C6766616775737564646174326A3335657163756A3762337376356D6C3568613569786676327535747A337170652F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB3F2283CE000000CC",
|
||||
"URI": "697066733A2F2F62616679626569667670746C366B69666C746E3661766F6179663473347A3364796466796B6A666466646A626A76746575696A706B626A336733752F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB3F8E144B00000147",
|
||||
"URI": "697066733A2F2F62616679626569636675336272636F6C6962767171727736703464617772636A6B75737877637436366C6F736C797576636D766C66766D643478692F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB41D3AFB30000017F",
|
||||
"URI": "697066733A2F2F6261667962656967796166656E357877766F346973706E777A3275376E696664687477366C686A376A6E37333334643732366A36656178367377342F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB45F3AAA600000174",
|
||||
"URI": "697066733A2F2F626166796265696774766B3336696F766C68777562326F6B6934747069726670647070337437747171777A6F36746D33706575373478636C3474712F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB465F3F23000001EF",
|
||||
"URI": "697066733A2F2F62616679626569646B37796D37736775747A7A766E70736669796B6A7379733565646568637936707370756C74337137646B696F7A737A376271652F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB47CE1E6500000131",
|
||||
"URI": "697066733A2F2F6261667962656968627A683362786C76716578327163747665616B71656271357066366468637569773779796D6C696E6A346F74327636736937612F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB48A4F76B00000227",
|
||||
"URI": "697066733A2F2F626166796265696179766F6C686F3462777A736D6A69363633337174696975776B71753664726272746877667277626236346B62776174346E76342F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB49A84D20000000EE",
|
||||
"URI": "697066733A2F2F62616679626569633269337535366163646A6764643573733434753674743767656B35796A6D637933766E71676F3265633734686D6D6D676D74612F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB4B82B0EF000000AB",
|
||||
"URI": "697066733A2F2F626166796265696462756637356D67616A6F63336969363465667675786D64356F7236746C3236356E7865623675616A34656232356F35657066652F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB4DC848D7000000E3",
|
||||
"URI": "697066733A2F2F626166796265696169746C677662756774636B37786C6C6934717378683434663467687A6171376B6F6662666135657A6D796A336C7461766877612F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5079949800000196",
|
||||
"URI": "697066733A2F2F62616679626569666F616B736468666A63716575783676766577377078326E34786F6773656E7133377A6176656233696973666E6D64347A6666342F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5253D84700000153",
|
||||
"URI": "697066733A2F2F62616679626569633735366A6F6263786961346776643477717634696E6E766F6C6C75767068676171666161656168353676626C713471343434792F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB52BF2CC0000001CE",
|
||||
"URI": "697066733A2F2F626166796265696268626E6F356664353272717663656A6769656C336B6E796C77727A366A747233767A77336B75656F363674697033716B36356D2F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB542E0F0200000110",
|
||||
"URI": "697066733A2F2F62616679626569666F73776A6B33666775726F6F6F767864326E7372336B676164706768633732366A683672776579776432656E736E74686777792F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5499938F0000018B",
|
||||
"URI": "697066733A2F2F6261667962656961663473797979367A6C6E76716F3664646A326779727A786C6F7779636F6C74746A6777676F33637270373333336E7A676767652F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5C6E313C000000FA",
|
||||
"URI": "697066733A2F2F626166796265696669793734673662767575646A6E757A6661676F6368656E6C6936666E3633616C6C6C717562617A756C7362736F636C636B66342F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5D44EE22000001F0",
|
||||
"URI": "697066733A2F2F62616679626569636171686F6D7A6F36677334656761376D68647A6D6E6F67657274687337776C78777677746B33696B64646E6D7A647273637A6D2F6D657461646174612E6A736F6E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB61651529000001E5",
|
||||
"URI": "697066733A2F2F62616679626569637432737174363732766563677232367862776E797A373365657565777A37616D32736869767578376E756232367837326D62342F6D657461646174612E6A736F6E"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"PreviousTxnID": "C6DDE35463575822835391EAC1E6E03CC7545EFE0144D8D410FB5EA6A9746CE0",
|
||||
"PreviousTxnLgrSeq": 77781454
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Account": "rXMART8usFd5kABXCayoP6ZfB35b4v43t",
|
||||
"Balance": "16344096437",
|
||||
"Domain": "786D6172742E617274",
|
||||
"EmailHash": "D48190C85BE485DEA4CF4A56A8E93772",
|
||||
"Flags": 0,
|
||||
"OwnerCount": 4816,
|
||||
"Sequence": 72168793
|
||||
},
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"LedgerIndex": "141E89D379C6949CA34BCB244DCBB7A6B2889781B157119CCC05ED19DFB676B0",
|
||||
"PreviousFields": {
|
||||
"Balance": "16344096449",
|
||||
"Sequence": 72168792
|
||||
},
|
||||
"PreviousTxnID": "E17B8C46E87FD5FADA045AD19A572661F01DEC6CFB7A24536211EF8999A99C47",
|
||||
"PreviousTxnLgrSeq": 77781459
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Account": "rMhoejpvS8mWfiffy4Zj8H2KbVs1oZCVsP",
|
||||
"Balance": "1471369312",
|
||||
"BurnedNFTokens": 1,
|
||||
"Domain": "706978656C736F66756B69796F2E636F6D",
|
||||
"Flags": 8388608,
|
||||
"MintedNFTokens": 553,
|
||||
"NFTokenMinter": "rXMART8usFd5kABXCayoP6ZfB35b4v43t",
|
||||
"OwnerCount": 19,
|
||||
"Sequence": 77578378
|
||||
},
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"LedgerIndex": "9DA74F431B2F406947558A12C01D4A080CAA5AC3FFA221C444E32A89B56C519A",
|
||||
"PreviousFields": {
|
||||
"MintedNFTokens": 552
|
||||
},
|
||||
"PreviousTxnID": "C6DDE35463575822835391EAC1E6E03CC7545EFE0144D8D410FB5EA6A9746CE0",
|
||||
"PreviousTxnLgrSeq": 77781454
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex": 42,
|
||||
"TransactionResult": "tesSUCCESS"
|
||||
},
|
||||
"hash": "1C57BFD847DBBAB78211229AA9AC8965B8EF705390ABAD8C2E79C98520EE9B10",
|
||||
"ledger_index": 77781462,
|
||||
"date": 1676330052000
|
||||
}
|
||||
348
packages/xrpl/test/fixtures/rippled/mintNFTMeta2.json
vendored
Normal file
348
packages/xrpl/test/fixtures/rippled/mintNFTMeta2.json
vendored
Normal file
@@ -0,0 +1,348 @@
|
||||
{
|
||||
"tx": {
|
||||
"Account": "rJMBXARKGNGTP5428VdksLLEbPYP5dxn9d",
|
||||
"Fee": "5500",
|
||||
"Flags": 8,
|
||||
"LastLedgerSequence": 77804703,
|
||||
"Memos": [
|
||||
{
|
||||
"Memo": {
|
||||
"MemoData": "43726561746564206F6E206E66742E6F6E7872702E636F6D"
|
||||
}
|
||||
}
|
||||
],
|
||||
"NFTokenTaxon": 23935453,
|
||||
"Sequence": 72918661,
|
||||
"SigningPubKey": "021E4C21B87E989C95EBBB228738A3E73F169E6F9CA73CE4FDA5B5827AF34987DF",
|
||||
"TransactionType": "NFTokenMint",
|
||||
"TransferFee": 4700,
|
||||
"TxnSignature": "3045022100E18E831549F5E5E59AFF7D13DB6AF41CAD3E1F0BB447FC48D7007E08A03E82D7022039D279BDDEA2C5BFCD24CB67FF875D1D6058AB7CFC3CD6030A29DF6EC375FE26",
|
||||
"URI": "697066733A2F2F516D594B71784A347779696E38466A6F516A55797363704E7167627568537373646631726F675334353144315161",
|
||||
"date": 1676421542000,
|
||||
"warnings": [
|
||||
{
|
||||
"id": 1004,
|
||||
"message": "This is a reporting server. The default behavior of a reporting server is to only return validated data. If you are looking for not yet validated data, include \"ledger_index : current\" in your request, which will cause this server to forward the request to a p2p node. If the forward is successful the response will include \"forwarded\" : \"true\""
|
||||
}
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"AffectedNodes": [
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Flags": 0,
|
||||
"NFTokens": [
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF32DC40200000218",
|
||||
"URI": "697066733A2F2F516D564D527647464D68635637416D5153375A31535A3753667645546F4A4E4E4C6F68694E67356F647251557242"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF424182F00000303",
|
||||
"URI": "697066733A2F2F516D6167744843744D394D5259343777744B7841744138576E3942726652577A484D48444E74344735344E6D6D45"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF58F04F000000192",
|
||||
"URI": "697066733A2F2F516D644562464C6A5261794D425532383243685731545979526A4E6F6D6A397375645A32323275427379434C4675"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF593075100000245",
|
||||
"URI": "697066733A2F2F516D65384A37335478556A6A4551583651686434317A75536B4A316B4637644A574543424B46534771504B525536"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF5FEABEA000002C0",
|
||||
"URI": "697066733A2F2F516D515175517266675666376D336A54716E6A726A63554B4A5A3439696374536235654D65783979566F6363326B"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF64A555000000346",
|
||||
"URI": "697066733A2F2F516D596445464A39577A4D615375543438423272317A777034717A78506442384155436866584874765141675A71"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF6B5F9ED000003C1",
|
||||
"URI": "697066733A2F2F516D584668746251444D3239443539336A48504C4869554A4B586A776A776D56746F744346616172677A6374694C"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF6D2C66C00000016",
|
||||
"URI": "697066733A2F2F516D6466386D4467535778415A59663133575A746A627464736A6B5A636A355A6564676F4C44576468384B32684B"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF74DCF190000020D",
|
||||
"URI": "697066733A2F2F516D55614877636E6E6B62354357653858336D6E704D7575517A695777774B6545436F42326E6E724B57364D486A"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF7D1B0370000014F",
|
||||
"URI": "697066733A2F2F516D62755332414276576D4B57366D5437736F715346384C766952314C75767263794258574E57675755486F6864"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF844E322000002F8",
|
||||
"URI": "697066733A2F2F516D6234756343754859677635394A5350325A5039767045764E6D7A515071504C323277563874636D33774D4144"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF86F7BFF00000187",
|
||||
"URI": "697066733A2F2F516D614A6B337464574C46513166593436734A707842566446697567326455343478686B516373543336384E4848"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF8AF97BF00000373",
|
||||
"URI": "697066733A2F2F516D54474B6975326A386D683454784A57596F586E3474346A644A4A48467A36764675726B4D554C345571397071"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFA6A50670000033B",
|
||||
"URI": "697066733A2F2F516D54597A6A3262506F616B36593943734272526B735277426D3745574A44686F4577556661324B7A5534757733"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFA766254000003EE",
|
||||
"URI": "697066733A2F2F516D594B71784A347779696E38466A6F516A55797363704E7167627568537373646631726F675334353144315161"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFAD5C4E0000003B6",
|
||||
"URI": "697066733A2F2F516D53774855547A4E585153356E64484E633565566B6359794A73656E5458736F6E6F6779475A54486142554B73"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFC4F7ECA0000017C",
|
||||
"URI": "697066733A2F2F516D656B4E7435595A6F4B6E78764667345745504E694C5042524D324E4B33594837454E43386162535946454A66"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFCCF92B200000368",
|
||||
"URI": "697066733A2F2F516D614E555A3470484B73714439366279526E623746356D6B477279634A576E696B615A566D6239396D396E3745"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFD3B07CF000003E3",
|
||||
"URI": "697066733A2F2F516D55426F325242596F70526A656F4A7134686570366A57663258716E7A344B46366866537754636463564B5052"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFE1EB6E1000002B5",
|
||||
"URI": "697066733A2F2F516D563348623434313776687352637963726470537A757262514E5755394E345443733548345038697A5335686D"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFE8A5B7A00000330",
|
||||
"URI": "697066733A2F2F516D656144416F6D4C596664344D6F586832674B754E3656776B794C36585377426B725155654870445944506A33"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFEF5CFF7000003AB",
|
||||
"URI": "697066733A2F2F516D51783143755371523771653670786F6E6935575938796D5245334E75637A6B50364A7665356434505A573358"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFF48850300000043",
|
||||
"URI": "697066733A2F2F516D5034674D485761396B777174327858733372383772585A6641674B437459626D73746D61754C795448526E75"
|
||||
}
|
||||
}
|
||||
],
|
||||
"PreviousPageMin": "BE4B401B2F62ED35CC67362165AA813CCA06316FCA06316FF2F2C36100000021"
|
||||
},
|
||||
"LedgerEntryType": "NFTokenPage",
|
||||
"LedgerIndex": "BE4B401B2F62ED35CC67362165AA813CCA06316FFFFFFFFFFFFFFFFFFFFFFFFF",
|
||||
"PreviousFields": {
|
||||
"NFTokens": [
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF32DC40200000218",
|
||||
"URI": "697066733A2F2F516D564D527647464D68635637416D5153375A31535A3753667645546F4A4E4E4C6F68694E67356F647251557242"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF424182F00000303",
|
||||
"URI": "697066733A2F2F516D6167744843744D394D5259343777744B7841744138576E3942726652577A484D48444E74344735344E6D6D45"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF58F04F000000192",
|
||||
"URI": "697066733A2F2F516D644562464C6A5261794D425532383243685731545979526A4E6F6D6A397375645A32323275427379434C4675"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF593075100000245",
|
||||
"URI": "697066733A2F2F516D65384A37335478556A6A4551583651686434317A75536B4A316B4637644A574543424B46534771504B525536"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF5FEABEA000002C0",
|
||||
"URI": "697066733A2F2F516D515175517266675666376D336A54716E6A726A63554B4A5A3439696374536235654D65783979566F6363326B"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF64A555000000346",
|
||||
"URI": "697066733A2F2F516D596445464A39577A4D615375543438423272317A777034717A78506442384155436866584874765141675A71"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF6B5F9ED000003C1",
|
||||
"URI": "697066733A2F2F516D584668746251444D3239443539336A48504C4869554A4B586A776A776D56746F744346616172677A6374694C"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF6D2C66C00000016",
|
||||
"URI": "697066733A2F2F516D6466386D4467535778415A59663133575A746A627464736A6B5A636A355A6564676F4C44576468384B32684B"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF74DCF190000020D",
|
||||
"URI": "697066733A2F2F516D55614877636E6E6B62354357653858336D6E704D7575517A695777774B6545436F42326E6E724B57364D486A"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF7D1B0370000014F",
|
||||
"URI": "697066733A2F2F516D62755332414276576D4B57366D5437736F715346384C766952314C75767263794258574E57675755486F6864"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF844E322000002F8",
|
||||
"URI": "697066733A2F2F516D6234756343754859677635394A5350325A5039767045764E6D7A515071504C323277563874636D33774D4144"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF86F7BFF00000187",
|
||||
"URI": "697066733A2F2F516D614A6B337464574C46513166593436734A707842566446697567326455343478686B516373543336384E4848"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FF8AF97BF00000373",
|
||||
"URI": "697066733A2F2F516D54474B6975326A386D683454784A57596F586E3474346A644A4A48467A36764675726B4D554C345571397071"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFA6A50670000033B",
|
||||
"URI": "697066733A2F2F516D54597A6A3262506F616B36593943734272526B735277426D3745574A44686F4577556661324B7A5534757733"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFAD5C4E0000003B6",
|
||||
"URI": "697066733A2F2F516D53774855547A4E585153356E64484E633565566B6359794A73656E5458736F6E6F6779475A54486142554B73"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFC4F7ECA0000017C",
|
||||
"URI": "697066733A2F2F516D656B4E7435595A6F4B6E78764667345745504E694C5042524D324E4B33594837454E43386162535946454A66"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFCCF92B200000368",
|
||||
"URI": "697066733A2F2F516D614E555A3470484B73714439366279526E623746356D6B477279634A576E696B615A566D6239396D396E3745"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFD3B07CF000003E3",
|
||||
"URI": "697066733A2F2F516D55426F325242596F70526A656F4A7134686570366A57663258716E7A344B46366866537754636463564B5052"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFE1EB6E1000002B5",
|
||||
"URI": "697066733A2F2F516D563348623434313776687352637963726470537A757262514E5755394E345443733548345038697A5335686D"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFE8A5B7A00000330",
|
||||
"URI": "697066733A2F2F516D656144416F6D4C596664344D6F586832674B754E3656776B794C36585377426B725155654870445944506A33"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFEF5CFF7000003AB",
|
||||
"URI": "697066733A2F2F516D51783143755371523771653670786F6E6935575938796D5245334E75637A6B50364A7665356434505A573358"
|
||||
}
|
||||
},
|
||||
{
|
||||
"NFToken": {
|
||||
"NFTokenID": "0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFF48850300000043",
|
||||
"URI": "697066733A2F2F516D5034674D485761396B777174327858733372383772585A6641674B437459626D73746D61754C795448526E75"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"PreviousTxnID": "12E8B027A922BDDD80E89005D1E813AA52E6BFC02C72AC490E002A3F3D2448A4",
|
||||
"PreviousTxnLgrSeq": 77803196
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Account": "rJMBXARKGNGTP5428VdksLLEbPYP5dxn9d",
|
||||
"Balance": "509694877",
|
||||
"BurnedNFTokens": 206,
|
||||
"Flags": 0,
|
||||
"MintedNFTokens": 1007,
|
||||
"OwnerCount": 38,
|
||||
"Sequence": 72918662
|
||||
},
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"LedgerIndex": "E3EDB522680D817CCE9CBC714D33EC5F567478D2DB551617A41856456D532AB2",
|
||||
"PreviousFields": {
|
||||
"Balance": "509700377",
|
||||
"MintedNFTokens": 1006,
|
||||
"Sequence": 72918661
|
||||
},
|
||||
"PreviousTxnID": "8E476510367BF294618730C443D2A22D9857B37C407DB7D7C6A5D4D477359033",
|
||||
"PreviousTxnLgrSeq": 77804606
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex": 16,
|
||||
"TransactionResult": "tesSUCCESS"
|
||||
},
|
||||
"hash": "77130966274E7DB385AC262A944AC20178611EE694EE0CA75A32C8760791521F",
|
||||
"ledger_index": 77804695,
|
||||
"date": 1676421542000
|
||||
}
|
||||
@@ -12,6 +12,7 @@
|
||||
"converge_time_s": 2.007,
|
||||
"proposers": 4
|
||||
},
|
||||
"network_id": 21338,
|
||||
"load_factor": 1,
|
||||
"peers": 53,
|
||||
"pubkey_node": "n94wWvFUmaKGYrKUGgpv1DyYgDeXRGdACkNQaSe7zJiy5Znio7UC",
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
import { assert } from 'chai'
|
||||
import _ from 'lodash'
|
||||
import { Client } from 'xrpl'
|
||||
|
||||
import {
|
||||
convertStringToHex,
|
||||
getNFTokenID,
|
||||
NFTokenMint,
|
||||
TransactionMetadata,
|
||||
} from '../../../src'
|
||||
|
||||
// how long before each test case times out
|
||||
const TIMEOUT = 20000
|
||||
|
||||
describe('NFTokenMint', function () {
|
||||
// TODO: Once we update our integration tests to handle NFTs, replace this client with XrplIntegrationTestContext
|
||||
it(
|
||||
'get NFTokenID',
|
||||
async function () {
|
||||
const client = new Client('wss://s.altnet.rippletest.net:51233/')
|
||||
await client.connect()
|
||||
|
||||
const { wallet, balance: _balance } = await client.fundWallet()
|
||||
|
||||
const tx: NFTokenMint = {
|
||||
TransactionType: 'NFTokenMint',
|
||||
Account: wallet.address,
|
||||
URI: convertStringToHex('https://www.google.com'),
|
||||
NFTokenTaxon: 0,
|
||||
}
|
||||
try {
|
||||
const response = await client.submitAndWait(tx, {
|
||||
wallet,
|
||||
})
|
||||
assert.equal(response.type, 'response')
|
||||
assert.equal(
|
||||
(response.result.meta as TransactionMetadata).TransactionResult,
|
||||
'tesSUCCESS',
|
||||
)
|
||||
|
||||
const accountNFTs = await client.request({
|
||||
command: 'account_nfts',
|
||||
account: wallet.address,
|
||||
})
|
||||
|
||||
const nftokenID =
|
||||
getNFTokenID(response.result.meta as TransactionMetadata) ??
|
||||
'undefined'
|
||||
const accountHasNFT = accountNFTs.result.account_nfts.some(
|
||||
(value) => value.NFTokenID === nftokenID,
|
||||
)
|
||||
|
||||
assert.isTrue(
|
||||
accountHasNFT,
|
||||
`Expected to find an NFT with NFTokenID ${nftokenID} in account ${
|
||||
wallet.address
|
||||
} but did not find it.
|
||||
\n\nHere's what was returned from 'account_nfts' for ${
|
||||
wallet.address
|
||||
}: ${JSON.stringify(accountNFTs)}`,
|
||||
)
|
||||
} finally {
|
||||
await client.disconnect()
|
||||
}
|
||||
},
|
||||
TIMEOUT,
|
||||
)
|
||||
})
|
||||
@@ -19,6 +19,7 @@ describe('NFTokenAcceptOffer', function () {
|
||||
NFTokenBuyOffer: NFTOKEN_BUY_OFFER,
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
Fee: '5000000',
|
||||
NetworkID: 21338,
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648,
|
||||
} as any
|
||||
@@ -32,6 +33,7 @@ describe('NFTokenAcceptOffer', function () {
|
||||
NFTokenSellOffer: NFTOKEN_SELL_OFFER,
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
Fee: '5000000',
|
||||
NetworkID: 21338,
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648,
|
||||
} as any
|
||||
@@ -44,6 +46,7 @@ describe('NFTokenAcceptOffer', function () {
|
||||
TransactionType: 'NFTokenAcceptOffer',
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
Fee: '5000000',
|
||||
NetworkID: 21338,
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648,
|
||||
} as any
|
||||
@@ -62,6 +65,7 @@ describe('NFTokenAcceptOffer', function () {
|
||||
NFTokenBuyOffer: NFTOKEN_BUY_OFFER,
|
||||
NFTokenBrokerFee: '1',
|
||||
Fee: '5000000',
|
||||
NetworkID: 21338,
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648,
|
||||
} as any
|
||||
@@ -80,6 +84,7 @@ describe('NFTokenAcceptOffer', function () {
|
||||
NFTokenSellOffer: NFTOKEN_SELL_OFFER,
|
||||
NFTokenBrokerFee: '1',
|
||||
Fee: '5000000',
|
||||
NetworkID: 21338,
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648,
|
||||
} as any
|
||||
@@ -98,6 +103,7 @@ describe('NFTokenAcceptOffer', function () {
|
||||
NFTokenBuyOffer: NFTOKEN_BUY_OFFER,
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
Fee: '5000000',
|
||||
NetworkID: 21338,
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648,
|
||||
} as any
|
||||
@@ -113,6 +119,7 @@ describe('NFTokenAcceptOffer', function () {
|
||||
NFTokenBrokerFee: '1',
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
Fee: '5000000',
|
||||
NetworkID: 21338,
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648,
|
||||
} as any
|
||||
@@ -128,6 +135,7 @@ describe('NFTokenAcceptOffer', function () {
|
||||
NFTokenBuyOffer: NFTOKEN_BUY_OFFER,
|
||||
NFTokenBrokerFee: '0',
|
||||
Fee: '5000000',
|
||||
NetworkID: 21338,
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648,
|
||||
} as any
|
||||
@@ -147,6 +155,7 @@ describe('NFTokenAcceptOffer', function () {
|
||||
NFTokenBuyOffer: NFTOKEN_BUY_OFFER,
|
||||
NFTokenBrokerFee: '-1',
|
||||
Fee: '5000000',
|
||||
NetworkID: 21338,
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648,
|
||||
} as any
|
||||
@@ -166,6 +175,7 @@ describe('NFTokenAcceptOffer', function () {
|
||||
NFTokenBuyOffer: NFTOKEN_BUY_OFFER,
|
||||
NFTokenBrokerFee: 1,
|
||||
Fee: '5000000',
|
||||
NetworkID: 21338,
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648,
|
||||
} as any
|
||||
|
||||
@@ -17,6 +17,7 @@ describe('NFTokenBurn', function () {
|
||||
NFTokenID: TOKEN_ID,
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
Fee: '5000000',
|
||||
NetworkID: 21338,
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648,
|
||||
} as any
|
||||
@@ -29,6 +30,7 @@ describe('NFTokenBurn', function () {
|
||||
TransactionType: 'NFTokenBurn',
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
Fee: '5000000',
|
||||
NetworkID: 21338,
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648,
|
||||
} as any
|
||||
|
||||
@@ -14,6 +14,7 @@ describe('NFTokenCancelOffer', function () {
|
||||
it(`verifies valid NFTokenCancelOffer`, function () {
|
||||
const validNFTokenCancelOffer = {
|
||||
TransactionType: 'NFTokenCancelOffer',
|
||||
NetworkID: 21338,
|
||||
NFTokenOffers: [BUY_OFFER],
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
Fee: '5000000',
|
||||
@@ -28,6 +29,7 @@ describe('NFTokenCancelOffer', function () {
|
||||
const invalid = {
|
||||
TransactionType: 'NFTokenCancelOffer',
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
NetworkID: 21338,
|
||||
Fee: '5000000',
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648,
|
||||
@@ -44,6 +46,7 @@ describe('NFTokenCancelOffer', function () {
|
||||
const invalid = {
|
||||
TransactionType: 'NFTokenCancelOffer',
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
NetworkID: 21338,
|
||||
NFTokenOffers: [],
|
||||
Fee: '5000000',
|
||||
Sequence: 2470665,
|
||||
|
||||
@@ -14,6 +14,7 @@ describe('NFTokenCreateOffer', function () {
|
||||
it(`verifies valid NFTokenCreateOffer buyside`, function () {
|
||||
const validNFTokenCreateOffer = {
|
||||
TransactionType: 'NFTokenCreateOffer',
|
||||
NetworkID: 21338,
|
||||
NFTokenID: NFTOKEN_ID,
|
||||
Amount: '1',
|
||||
Owner: 'r9LqNeG6qHxjeUocjvVki2XR35weJ9mZgQ',
|
||||
@@ -30,6 +31,7 @@ describe('NFTokenCreateOffer', function () {
|
||||
it(`verifies valid NFTokenCreateOffer sellside`, function () {
|
||||
const validNFTokenCreateOffer = {
|
||||
TransactionType: 'NFTokenCreateOffer',
|
||||
NetworkID: 21338,
|
||||
NFTokenID: NFTOKEN_ID,
|
||||
Amount: '1',
|
||||
Flags: NFTokenCreateOfferFlags.tfSellNFToken,
|
||||
@@ -46,6 +48,7 @@ describe('NFTokenCreateOffer', function () {
|
||||
it(`verifies w/ 0 Amount NFTokenCreateOffer sellside`, function () {
|
||||
const validNFTokenCreateOffer = {
|
||||
TransactionType: 'NFTokenCreateOffer',
|
||||
NetworkID: 21338,
|
||||
NFTokenID: NFTOKEN_ID,
|
||||
Amount: '0',
|
||||
Flags: NFTokenCreateOfferFlags.tfSellNFToken,
|
||||
@@ -62,6 +65,7 @@ describe('NFTokenCreateOffer', function () {
|
||||
it(`throws w/ Account === Owner`, function () {
|
||||
const invalid = {
|
||||
TransactionType: 'NFTokenCreateOffer',
|
||||
NetworkID: 21338,
|
||||
NFTokenID: NFTOKEN_ID,
|
||||
Amount: '1',
|
||||
Expiration: 1000,
|
||||
@@ -81,6 +85,7 @@ describe('NFTokenCreateOffer', function () {
|
||||
it(`throws w/ Account === Destination`, function () {
|
||||
const invalid = {
|
||||
TransactionType: 'NFTokenCreateOffer',
|
||||
NetworkID: 21338,
|
||||
NFTokenID: NFTOKEN_ID,
|
||||
Amount: '1',
|
||||
Flags: NFTokenCreateOfferFlags.tfSellNFToken,
|
||||
@@ -101,6 +106,7 @@ describe('NFTokenCreateOffer', function () {
|
||||
it(`throws w/out NFTokenID`, function () {
|
||||
const invalid = {
|
||||
TransactionType: 'NFTokenCreateOffer',
|
||||
NetworkID: 21338,
|
||||
Amount: '1',
|
||||
Owner: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXe',
|
||||
Expiration: 1000,
|
||||
@@ -120,6 +126,7 @@ describe('NFTokenCreateOffer', function () {
|
||||
it(`throws w/ invalid Amount`, function () {
|
||||
const invalid = {
|
||||
TransactionType: 'NFTokenCreateOffer',
|
||||
NetworkID: 21338,
|
||||
NFTokenID: NFTOKEN_ID,
|
||||
Amount: 1,
|
||||
Owner: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXe',
|
||||
@@ -140,6 +147,7 @@ describe('NFTokenCreateOffer', function () {
|
||||
it(`throws w/ missing Amount`, function () {
|
||||
const invalid = {
|
||||
TransactionType: 'NFTokenCreateOffer',
|
||||
NetworkID: 21338,
|
||||
Owner: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXe',
|
||||
Expiration: 1000,
|
||||
NFTokenID: NFTOKEN_ID,
|
||||
@@ -159,6 +167,7 @@ describe('NFTokenCreateOffer', function () {
|
||||
it(`throws w/ Owner for sell offer`, function () {
|
||||
const invalid = {
|
||||
TransactionType: 'NFTokenCreateOffer',
|
||||
NetworkID: 21338,
|
||||
Expiration: 1000,
|
||||
Owner: 'r9LqNeG6qHxjeUocjvVki2XR35weJ9mZgQ',
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
@@ -179,6 +188,7 @@ describe('NFTokenCreateOffer', function () {
|
||||
it(`throws w/out Owner for buy offer`, function () {
|
||||
const invalid = {
|
||||
TransactionType: 'NFTokenCreateOffer',
|
||||
NetworkID: 21338,
|
||||
Expiration: 1000,
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
Amount: '1',
|
||||
@@ -197,6 +207,7 @@ describe('NFTokenCreateOffer', function () {
|
||||
it(`throws w/ 0 Amount for buy offer`, function () {
|
||||
const invalid = {
|
||||
TransactionType: 'NFTokenCreateOffer',
|
||||
NetworkID: 21338,
|
||||
Expiration: 1000,
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
Owner: 'r9LqNeG6qHxjeUocjvVki2XR35weJ9mZgQ',
|
||||
|
||||
@@ -18,6 +18,7 @@ describe('NFTokenMint', function () {
|
||||
TransactionType: 'NFTokenMint',
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
Fee: '5000000',
|
||||
NetworkID: 21338,
|
||||
Sequence: 2470665,
|
||||
Flags: NFTokenMintFlags.tfTransferable,
|
||||
NFTokenTaxon: 0,
|
||||
@@ -34,6 +35,7 @@ describe('NFTokenMint', function () {
|
||||
TransactionType: 'NFTokenMint',
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
Fee: '5000000',
|
||||
NetworkID: 21338,
|
||||
Sequence: 2470665,
|
||||
Flags: NFTokenMintFlags.tfTransferable,
|
||||
Issuer: 'r9LqNeG6qHxjeUocjvVki2XR35weJ9mZgQ',
|
||||
@@ -53,6 +55,7 @@ describe('NFTokenMint', function () {
|
||||
TransactionType: 'NFTokenMint',
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
Fee: '5000000',
|
||||
NetworkID: 21338,
|
||||
Sequence: 2470665,
|
||||
Flags: NFTokenMintFlags.tfTransferable,
|
||||
Issuer: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
@@ -73,6 +76,7 @@ describe('NFTokenMint', function () {
|
||||
TransactionType: 'NFTokenMint',
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
Fee: '5000000',
|
||||
NetworkID: 21338,
|
||||
Sequence: 2470665,
|
||||
Flags: NFTokenMintFlags.tfTransferable,
|
||||
NFTokenTaxon: 0,
|
||||
|
||||
@@ -13,6 +13,7 @@ describe('AccountDelete', function () {
|
||||
const validAccountDelete = {
|
||||
TransactionType: 'AccountDelete',
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
NetworkID: 21338,
|
||||
Destination: 'rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe',
|
||||
DestinationTag: 13,
|
||||
Fee: '5000000',
|
||||
@@ -27,6 +28,7 @@ describe('AccountDelete', function () {
|
||||
const invalidDestination = {
|
||||
TransactionType: 'AccountDelete',
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
NetworkID: 21338,
|
||||
Fee: '5000000',
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648,
|
||||
@@ -49,6 +51,7 @@ describe('AccountDelete', function () {
|
||||
const invalidDestination = {
|
||||
TransactionType: 'AccountDelete',
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
NetworkID: 21338,
|
||||
Destination: 65478965,
|
||||
Fee: '5000000',
|
||||
Sequence: 2470665,
|
||||
@@ -71,6 +74,7 @@ describe('AccountDelete', function () {
|
||||
const invalidDestinationTag = {
|
||||
TransactionType: 'AccountDelete',
|
||||
Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm',
|
||||
NetworkID: 21338,
|
||||
Destination: 'rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe',
|
||||
DestinationTag: 'gvftyujnbv',
|
||||
Fee: '5000000',
|
||||
|
||||
@@ -15,6 +15,7 @@ describe('AccountSet', function () {
|
||||
account = {
|
||||
TransactionType: 'AccountSet',
|
||||
Account: 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn',
|
||||
NetworkID: 21338,
|
||||
Fee: '12',
|
||||
Sequence: 5,
|
||||
Domain: '6578616D706C652E636F6D',
|
||||
@@ -30,7 +31,7 @@ describe('AccountSet', function () {
|
||||
})
|
||||
|
||||
it(`throws w/ invalid SetFlag (out of range)`, function () {
|
||||
account.SetFlag = 12
|
||||
account.SetFlag = 20
|
||||
|
||||
assert.throws(
|
||||
() => validateAccountSet(account),
|
||||
@@ -60,7 +61,7 @@ describe('AccountSet', function () {
|
||||
})
|
||||
|
||||
it(`throws w/ invalid ClearFlag`, function () {
|
||||
account.ClearFlag = 12
|
||||
account.ClearFlag = 20
|
||||
|
||||
assert.throws(
|
||||
() => validateAccountSet(account),
|
||||
|
||||
@@ -13,6 +13,7 @@ describe('BaseTransaction', function () {
|
||||
const txJson = {
|
||||
Account: 'r97KeayHuEsDwyU1yPBVtMLLoQr79QcRFe',
|
||||
TransactionType: 'Payment',
|
||||
NetworkID: 21338,
|
||||
Fee: '12',
|
||||
Sequence: 100,
|
||||
AccountTxnID: 'DEADBEEF',
|
||||
@@ -63,6 +64,7 @@ describe('BaseTransaction', function () {
|
||||
const txJson = {
|
||||
Account: 'r97KeayHuEsDwyU1yPBVtMLLoQr79QcRFe',
|
||||
TransactionType: 'Payment',
|
||||
NetworkID: 21338,
|
||||
}
|
||||
|
||||
assert.doesNotThrow(() => validateBaseTransaction(txJson))
|
||||
@@ -72,6 +74,7 @@ describe('BaseTransaction', function () {
|
||||
const invalidFee = {
|
||||
Account: 'r97KeayHuEsDwyU1yPBVtMLLoQr79QcRFe',
|
||||
TransactionType: 'Payment',
|
||||
NetworkID: 21338,
|
||||
Fee: 1000,
|
||||
} as any
|
||||
|
||||
@@ -86,6 +89,7 @@ describe('BaseTransaction', function () {
|
||||
const invalidSeq = {
|
||||
Account: 'r97KeayHuEsDwyU1yPBVtMLLoQr79QcRFe',
|
||||
TransactionType: 'Payment',
|
||||
NetworkID: 21338,
|
||||
Sequence: '145',
|
||||
} as any
|
||||
|
||||
@@ -100,6 +104,7 @@ describe('BaseTransaction', function () {
|
||||
const invalidID = {
|
||||
Account: 'r97KeayHuEsDwyU1yPBVtMLLoQr79QcRFe',
|
||||
TransactionType: 'Payment',
|
||||
NetworkID: 21338,
|
||||
AccountTxnID: ['WRONG'],
|
||||
} as any
|
||||
|
||||
@@ -114,6 +119,7 @@ describe('BaseTransaction', function () {
|
||||
const invalidLastLedgerSequence = {
|
||||
Account: 'r97KeayHuEsDwyU1yPBVtMLLoQr79QcRFe',
|
||||
TransactionType: 'Payment',
|
||||
NetworkID: 21338,
|
||||
LastLedgerSequence: '1000',
|
||||
} as any
|
||||
|
||||
@@ -128,6 +134,7 @@ describe('BaseTransaction', function () {
|
||||
const invalidSourceTag = {
|
||||
Account: 'r97KeayHuEsDwyU1yPBVtMLLoQr79QcRFe',
|
||||
TransactionType: 'Payment',
|
||||
NetworkID: 21338,
|
||||
SourceTag: ['ARRAY'],
|
||||
} as any
|
||||
|
||||
@@ -142,6 +149,7 @@ describe('BaseTransaction', function () {
|
||||
const invalidSigningPubKey = {
|
||||
Account: 'r97KeayHuEsDwyU1yPBVtMLLoQr79QcRFe',
|
||||
TransactionType: 'Payment',
|
||||
NetworkID: 21338,
|
||||
SigningPubKey: 1000,
|
||||
} as any
|
||||
|
||||
@@ -156,6 +164,7 @@ describe('BaseTransaction', function () {
|
||||
const invalidTicketSequence = {
|
||||
Account: 'r97KeayHuEsDwyU1yPBVtMLLoQr79QcRFe',
|
||||
TransactionType: 'Payment',
|
||||
NetworkID: 21338,
|
||||
TicketSequence: '1000',
|
||||
} as any
|
||||
|
||||
@@ -170,6 +179,7 @@ describe('BaseTransaction', function () {
|
||||
const invalidTxnSignature = {
|
||||
Account: 'r97KeayHuEsDwyU1yPBVtMLLoQr79QcRFe',
|
||||
TransactionType: 'Payment',
|
||||
NetworkID: 21338,
|
||||
TxnSignature: 1000,
|
||||
} as any
|
||||
|
||||
@@ -180,10 +190,25 @@ describe('BaseTransaction', function () {
|
||||
)
|
||||
})
|
||||
|
||||
it(`Handles invalid NetworkID`, function () {
|
||||
const invalidTxnSignature = {
|
||||
Account: 'r97KeayHuEsDwyU1yPBVtMLLoQr79QcRFe',
|
||||
TransactionType: 'Payment',
|
||||
NetworkID: '21338',
|
||||
} as any
|
||||
|
||||
assert.throws(
|
||||
() => validateBaseTransaction(invalidTxnSignature),
|
||||
ValidationError,
|
||||
'BaseTransaction: invalid NetworkID',
|
||||
)
|
||||
})
|
||||
|
||||
it(`Handles invalid Signers`, function () {
|
||||
const invalidSigners = {
|
||||
Account: 'r97KeayHuEsDwyU1yPBVtMLLoQr79QcRFe',
|
||||
TransactionType: 'Payment',
|
||||
NetworkID: 21338,
|
||||
Signers: [],
|
||||
} as any
|
||||
|
||||
@@ -196,6 +221,7 @@ describe('BaseTransaction', function () {
|
||||
const invalidSigners2 = {
|
||||
Account: 'r97KeayHuEsDwyU1yPBVtMLLoQr79QcRFe',
|
||||
TransactionType: 'Payment',
|
||||
NetworkID: 21338,
|
||||
Signers: [
|
||||
{
|
||||
Signer: {
|
||||
@@ -216,6 +242,7 @@ describe('BaseTransaction', function () {
|
||||
const invalidMemo = {
|
||||
Account: 'r97KeayHuEsDwyU1yPBVtMLLoQr79QcRFe',
|
||||
TransactionType: 'Payment',
|
||||
NetworkID: 21338,
|
||||
Memos: [
|
||||
{
|
||||
Memo: {
|
||||
|
||||
@@ -13,6 +13,7 @@ describe('CheckCancel', function () {
|
||||
const validCheckCancel = {
|
||||
Account: 'rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo',
|
||||
TransactionType: 'CheckCancel',
|
||||
NetworkID: 21338,
|
||||
CheckID:
|
||||
'49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0',
|
||||
} as any
|
||||
|
||||
@@ -13,6 +13,7 @@ describe('CheckCash', function () {
|
||||
const validCheckCash = {
|
||||
Account: 'rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy',
|
||||
TransactionType: 'CheckCash',
|
||||
NetworkID: 21338,
|
||||
Amount: '100000000',
|
||||
CheckID:
|
||||
'838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334',
|
||||
@@ -27,6 +28,7 @@ describe('CheckCash', function () {
|
||||
const invalidCheckID = {
|
||||
Account: 'rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy',
|
||||
TransactionType: 'CheckCash',
|
||||
NetworkID: 21338,
|
||||
Amount: '100000000',
|
||||
CheckID: 83876645678567890,
|
||||
} as any
|
||||
@@ -47,6 +49,7 @@ describe('CheckCash', function () {
|
||||
const invalidAmount = {
|
||||
Account: 'rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy',
|
||||
TransactionType: 'CheckCash',
|
||||
NetworkID: 21338,
|
||||
Amount: 100000000,
|
||||
CheckID:
|
||||
'838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334',
|
||||
@@ -68,6 +71,7 @@ describe('CheckCash', function () {
|
||||
const invalidDeliverMin = {
|
||||
Account: 'rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy',
|
||||
TransactionType: 'CheckCash',
|
||||
NetworkID: 21338,
|
||||
Amount: '100000000',
|
||||
DeliverMin: 852156963,
|
||||
CheckID:
|
||||
@@ -90,6 +94,7 @@ describe('CheckCash', function () {
|
||||
const invalidDeliverMin = {
|
||||
Account: 'rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy',
|
||||
TransactionType: 'CheckCash',
|
||||
NetworkID: 21338,
|
||||
DeliverMin: 852156963,
|
||||
CheckID:
|
||||
'838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334',
|
||||
|
||||
@@ -20,6 +20,7 @@ describe('CheckCreate', function () {
|
||||
'6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B',
|
||||
DestinationTag: 1,
|
||||
Fee: '12',
|
||||
NetworkID: 21338,
|
||||
} as any
|
||||
|
||||
assert.doesNotThrow(() => validateCheckCreate(validCheck))
|
||||
@@ -37,6 +38,7 @@ describe('CheckCreate', function () {
|
||||
'6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B',
|
||||
DestinationTag: 1,
|
||||
Fee: '12',
|
||||
NetworkID: 21338,
|
||||
} as any
|
||||
|
||||
assert.throws(
|
||||
@@ -62,6 +64,7 @@ describe('CheckCreate', function () {
|
||||
'6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B',
|
||||
DestinationTag: 1,
|
||||
Fee: '12',
|
||||
NetworkID: 21338,
|
||||
} as any
|
||||
|
||||
assert.throws(
|
||||
@@ -80,6 +83,7 @@ describe('CheckCreate', function () {
|
||||
const invalidDestinationTag = {
|
||||
TransactionType: 'CheckCreate',
|
||||
Account: 'rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo',
|
||||
NetworkID: 21338,
|
||||
Destination: 'rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy',
|
||||
SendMax: '100000000',
|
||||
Expiration: 570113521,
|
||||
@@ -112,6 +116,7 @@ describe('CheckCreate', function () {
|
||||
'6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B',
|
||||
DestinationTag: 1,
|
||||
Fee: '12',
|
||||
NetworkID: 21338,
|
||||
} as any
|
||||
|
||||
assert.throws(
|
||||
@@ -136,6 +141,7 @@ describe('CheckCreate', function () {
|
||||
InvoiceID: 789656963258531,
|
||||
DestinationTag: 1,
|
||||
Fee: '12',
|
||||
NetworkID: 21338,
|
||||
} as any
|
||||
|
||||
assert.throws(
|
||||
|
||||
@@ -15,6 +15,7 @@ describe('DepositPreauth', function () {
|
||||
depositPreauth = {
|
||||
TransactionType: 'DepositPreauth',
|
||||
Account: 'rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo',
|
||||
NetworkID: 21338,
|
||||
} as any
|
||||
})
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ describe('EscrowCancel', function () {
|
||||
Account: 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn',
|
||||
Owner: 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn',
|
||||
OfferSequence: 7,
|
||||
NetworkID: 21338,
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ describe('EscrowCreate', function () {
|
||||
escrow = {
|
||||
Account: 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn',
|
||||
TransactionType: 'EscrowCreate',
|
||||
NetworkID: 21338,
|
||||
Amount: '10000',
|
||||
Destination: 'rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW',
|
||||
CancelAfter: 533257958,
|
||||
|
||||
@@ -15,6 +15,7 @@ describe('EscrowFinish', function () {
|
||||
escrow = {
|
||||
Account: 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn',
|
||||
TransactionType: 'EscrowFinish',
|
||||
NetworkID: 21338,
|
||||
Owner: 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn',
|
||||
OfferSequence: 7,
|
||||
Condition:
|
||||
|
||||
@@ -15,6 +15,7 @@ describe('OfferCancel', function () {
|
||||
offer = {
|
||||
Account: 'rnKiczmiQkZFiDES8THYyLA2pQohC5C6EF',
|
||||
Fee: '10',
|
||||
NetworkID: 21338,
|
||||
LastLedgerSequence: 65477334,
|
||||
OfferSequence: 60797528,
|
||||
Sequence: 60797535,
|
||||
|
||||
@@ -13,6 +13,7 @@ describe('OfferCreate', function () {
|
||||
const offer = {
|
||||
Account: 'r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W',
|
||||
Fee: '10',
|
||||
NetworkID: 21338,
|
||||
Flags: 0,
|
||||
LastLedgerSequence: 65453019,
|
||||
Sequence: 40949322,
|
||||
@@ -37,6 +38,7 @@ describe('OfferCreate', function () {
|
||||
const offer2 = {
|
||||
Account: 'r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W',
|
||||
Fee: '10',
|
||||
NetworkID: 21338,
|
||||
Flags: 0,
|
||||
LastLedgerSequence: 65453019,
|
||||
Sequence: 40949322,
|
||||
@@ -59,6 +61,7 @@ describe('OfferCreate', function () {
|
||||
const offer3 = {
|
||||
Account: 'r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W',
|
||||
Fee: '10',
|
||||
NetworkID: 21338,
|
||||
Flags: 0,
|
||||
LastLedgerSequence: 65453019,
|
||||
Sequence: 40949322,
|
||||
@@ -87,6 +90,7 @@ describe('OfferCreate', function () {
|
||||
const offer = {
|
||||
Account: 'r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W',
|
||||
Fee: '10',
|
||||
NetworkID: 21338,
|
||||
Flags: 0,
|
||||
LastLedgerSequence: 65453019,
|
||||
Sequence: 40949322,
|
||||
@@ -120,6 +124,7 @@ describe('OfferCreate', function () {
|
||||
const offer = {
|
||||
Account: 'r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W',
|
||||
Fee: '10',
|
||||
NetworkID: 21338,
|
||||
Flags: 0,
|
||||
LastLedgerSequence: 65453019,
|
||||
Sequence: 40949322,
|
||||
@@ -153,6 +158,7 @@ describe('OfferCreate', function () {
|
||||
const offer = {
|
||||
Account: 'r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W',
|
||||
Fee: '10',
|
||||
NetworkID: 21338,
|
||||
Flags: 0,
|
||||
LastLedgerSequence: 65453019,
|
||||
Sequence: 40949322,
|
||||
@@ -182,6 +188,7 @@ describe('OfferCreate', function () {
|
||||
const offer = {
|
||||
Account: 'r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W',
|
||||
Fee: '10',
|
||||
NetworkID: 21338,
|
||||
Flags: 0,
|
||||
LastLedgerSequence: 65453019,
|
||||
Sequence: 40949322,
|
||||
|
||||
@@ -19,6 +19,7 @@ describe('Payment', function () {
|
||||
Destination: 'rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy',
|
||||
DestinationTag: 1,
|
||||
Fee: '12',
|
||||
NetworkID: 21338,
|
||||
Flags: 2147483648,
|
||||
LastLedgerSequence: 65953073,
|
||||
Sequence: 65923914,
|
||||
|
||||
@@ -15,6 +15,7 @@ describe('PaymentChannelClaim', function () {
|
||||
channel = {
|
||||
Account: 'rB5Ux4Lv2nRx6eeoAAsZmtctnBQ2LiACnk',
|
||||
TransactionType: 'PaymentChannelClaim',
|
||||
NetworkID: 21338,
|
||||
Channel:
|
||||
'C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198',
|
||||
Balance: '1000000',
|
||||
|
||||
@@ -15,6 +15,7 @@ describe('PaymentChannelCreate', function () {
|
||||
channel = {
|
||||
Account: 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn',
|
||||
TransactionType: 'PaymentChannelCreate',
|
||||
NetworkID: 21338,
|
||||
Amount: '10000',
|
||||
Destination: 'rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW',
|
||||
SettleDelay: 86400,
|
||||
|
||||
@@ -15,6 +15,7 @@ describe('PaymentChannelFund', function () {
|
||||
channel = {
|
||||
Account: 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn',
|
||||
TransactionType: 'PaymentChannelFund',
|
||||
NetworkID: 21338,
|
||||
Channel:
|
||||
'C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198',
|
||||
Amount: '200000',
|
||||
|
||||
@@ -16,6 +16,7 @@ describe('SetRegularKey', function () {
|
||||
TransactionType: 'SetRegularKey',
|
||||
Account: 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn',
|
||||
Fee: '12',
|
||||
NetworkID: 21338,
|
||||
Flags: 0,
|
||||
RegularKey: 'rAR8rR8sUkBoCZFawhkWzY4Y5YoyuznwD',
|
||||
} as any
|
||||
|
||||
@@ -17,6 +17,7 @@ describe('SignerListSet', function () {
|
||||
TransactionType: 'SignerListSet',
|
||||
Account: 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn',
|
||||
Fee: '12',
|
||||
NetworkID: 21338,
|
||||
SignerQuorum: 3,
|
||||
SignerEntries: [
|
||||
{
|
||||
|
||||
@@ -15,6 +15,7 @@ describe('TicketCreate', function () {
|
||||
ticketCreate = {
|
||||
TransactionType: 'TicketCreate',
|
||||
Account: 'rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo',
|
||||
NetworkID: 21338,
|
||||
TicketCount: 150,
|
||||
} as any
|
||||
})
|
||||
|
||||
@@ -15,6 +15,7 @@ describe('TrustSet', function () {
|
||||
trustSet = {
|
||||
TransactionType: 'TrustSet',
|
||||
Account: 'rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo',
|
||||
NetworkID: 21338,
|
||||
LimitAmount: {
|
||||
currency: 'XRP',
|
||||
issuer: 'rcXY84C4g14iFp6taFXjjQGVeHqSCh9RX',
|
||||
|
||||
@@ -50,6 +50,7 @@ describe('Models Utils', function () {
|
||||
const tx: OfferCreate = {
|
||||
Account: 'r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W',
|
||||
Fee: '10',
|
||||
NetworkID: 21338,
|
||||
TakerGets: {
|
||||
currency: 'DSH',
|
||||
issuer: 'rcXY84C4g14iFp6taFXjjQGVeHqSCh9RX',
|
||||
@@ -151,6 +152,7 @@ describe('Models Utils', function () {
|
||||
assert.strictEqual(tx.Flags, 0)
|
||||
})
|
||||
|
||||
// eslint-disable-next-line complexity -- Simpler to list them all out at once.
|
||||
it('parseAccountRootFlags all enabled', function () {
|
||||
const accountRootFlags =
|
||||
AccountRootFlags.lsfDefaultRipple |
|
||||
@@ -161,7 +163,11 @@ describe('Models Utils', function () {
|
||||
AccountRootFlags.lsfNoFreeze |
|
||||
AccountRootFlags.lsfPasswordSpent |
|
||||
AccountRootFlags.lsfRequireAuth |
|
||||
AccountRootFlags.lsfRequireDestTag
|
||||
AccountRootFlags.lsfRequireDestTag |
|
||||
AccountRootFlags.lsfDisallowIncomingNFTOffer |
|
||||
AccountRootFlags.lsfDisallowIncomingCheck |
|
||||
AccountRootFlags.lsfDisallowIncomingPayChan |
|
||||
AccountRootFlags.lsfDisallowIncomingTrustline
|
||||
|
||||
const parsed = parseAccountRootFlags(accountRootFlags)
|
||||
|
||||
@@ -174,7 +180,11 @@ describe('Models Utils', function () {
|
||||
parsed.lsfNoFreeze &&
|
||||
parsed.lsfPasswordSpent &&
|
||||
parsed.lsfRequireAuth &&
|
||||
parsed.lsfRequireDestTag,
|
||||
parsed.lsfRequireDestTag &&
|
||||
parsed.lsfDisallowIncomingNFTOffer &&
|
||||
parsed.lsfDisallowIncomingCheck &&
|
||||
parsed.lsfDisallowIncomingPayChan &&
|
||||
parsed.lsfDisallowIncomingTrustline,
|
||||
)
|
||||
})
|
||||
|
||||
@@ -190,6 +200,10 @@ describe('Models Utils', function () {
|
||||
assert.isUndefined(parsed.lsfPasswordSpent)
|
||||
assert.isUndefined(parsed.lsfRequireAuth)
|
||||
assert.isUndefined(parsed.lsfRequireDestTag)
|
||||
assert.isUndefined(parsed.lsfDisallowIncomingNFTOffer)
|
||||
assert.isUndefined(parsed.lsfDisallowIncomingCheck)
|
||||
assert.isUndefined(parsed.lsfDisallowIncomingPayChan)
|
||||
assert.isUndefined(parsed.lsfDisallowIncomingTrustline)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
28
packages/xrpl/test/utils/getNFTokenID.test.ts
Normal file
28
packages/xrpl/test/utils/getNFTokenID.test.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { getNFTokenID } from '../../src'
|
||||
import * as NFTokenResponse from '../fixtures/rippled/mintNFTMeta.json'
|
||||
import * as NFTokenResponse2 from '../fixtures/rippled/mintNFTMeta2.json'
|
||||
|
||||
describe('parseNFTokenID', function () {
|
||||
it('decode a valid NFTokenID', function () {
|
||||
const result = getNFTokenID(NFTokenResponse.meta)
|
||||
const expectedNFTokenID =
|
||||
'00081388DC1AB4937C899037B2FDFC3CB20F6F64E73120BB5F8AA66A00000228'
|
||||
assert.equal(result, expectedNFTokenID)
|
||||
})
|
||||
|
||||
it('decode a different valid NFTokenID', function () {
|
||||
const result = getNFTokenID(NFTokenResponse2.meta)
|
||||
const expectedNFTokenID =
|
||||
'0008125CBE4B401B2F62ED35CC67362165AA813CCA06316FFA766254000003EE'
|
||||
assert.equal(result, expectedNFTokenID)
|
||||
})
|
||||
|
||||
it('fails with nice error when given raw response instead of meta', function () {
|
||||
assert.throws(() => {
|
||||
// @ts-expect-error - Validating error for javascript users
|
||||
const _ = getNFTokenID(NFTokenResponse)
|
||||
}, /^Unable to parse the parameter given to getNFTokenID.*/u)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user