Skip to content

Commit

Permalink
Merge branch 'staging' into currency-description
Browse files Browse the repository at this point in the history
  • Loading branch information
mvadari authored Aug 1, 2024
2 parents 3853f9d + 7db7962 commit 06da999
Show file tree
Hide file tree
Showing 20 changed files with 304 additions and 290 deletions.
474 changes: 260 additions & 214 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"dotenv": "^16.4.5",
"enzyme": "3.11.0",
"enzyme-adapter-react-17-updated": "^1.0.2",
"esbuild": "^0.19.8",
"esbuild": "^0.23.0",
"events": "^3.3.0",
"express": "^4.18.2",
"i18next": "^23.9.0",
Expand Down Expand Up @@ -91,7 +91,7 @@
"moxios": "^0.4.0",
"nodemon": "^3.0.1",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.3",
"prettier": "^3.3.2",
"react-error-overlay": "6.0.11",
"react-test-renderer": "^17.0.2",
"redux-mock-store": "^1.5.1",
Expand Down
9 changes: 4 additions & 5 deletions src/containers/Amendment/Votes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,10 @@ export const Votes = ({ data, validators }: VotesProps) => {

const getYeas = () =>
validators
.filter(
(validator) =>
data.voted?.validators.some(
(voted) => voted.signing_key === validator.signing_key,
),
.filter((validator) =>
data.voted?.validators.some(
(voted) => voted.signing_key === validator.signing_key,
),
)
.sort(compareValidators)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const parser: TransactionParser<

return {
amount: formatAmount(buyOfferNode.Amount),
tokenID: buyOfferNode.NFTokenID,
tokenID: meta.nftoken_id,
seller: sellOfferNode.Owner,
buyer: buyOfferNode.Owner,
acceptedOfferIDs,
Expand All @@ -51,7 +51,7 @@ export const parser: TransactionParser<
}

const amount = formatAmount(acceptedOfferNode.Amount)
const tokenID = acceptedOfferNode.NFTokenID
const tokenID = meta.nftoken_id
const offerer = acceptedOfferNode.Owner
const accepter = tx.Account
const isSellOffer = determineIsSellOffer(acceptedOfferNode.Flags)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@
}
],
"TransactionIndex": 7,
"TransactionResult": "tesSUCCESS"
"TransactionResult": "tesSUCCESS",
"nftoken_id": "00081B581189F5687DBB7516339D6CCB5593D96622AD82DF08CFDA8600000A17"
},
"hash": "E6CE3C3C554BA01891A9D12E89062C34BBEA6282CF8AA4D9AF8BF7D0E7D26B7D",
"ledger_index": 76208251,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@
}
],
"TransactionIndex": 4,
"TransactionResult": "tesSUCCESS"
"TransactionResult": "tesSUCCESS",
"nftoken_id": "000800006203F49C21D5D6E022CB16DE3538F248662FC73C29ABA6A90000000D"
},
"hash": "21C60F255B29D0034B9EBA2ED1F7523635C61DED1D6BDBCFFD67703C45F7072D",
"ledger_index": 1799495,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,8 @@
}
],
"TransactionIndex": 0,
"TransactionResult": "tesSUCCESS"
"TransactionResult": "tesSUCCESS",
"nftoken_id": "000800006203F49C21D5D6E022CB16DE3538F248662FC73C216B9CBF00000023"
},
"hash": "553922B202932DD500C6E0D6905BA1D8ACC0DF746519DD6AAA724AF70D23F1E6",
"ledger_index": 1889191,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const parser: TransactionParser<
const cancelledOffers = meta.AffectedNodes.filter(
(node: any) => node.DeletedNode?.LedgerEntryType === 'NFTokenOffer',
).map((node: any) => ({
offerID: node.DeletedNode.LedgerIndex,
offerID: meta.offer_id,
amount: formatAmount(node.DeletedNode.FinalFields.Amount),
tokenID: node.DeletedNode.FinalFields.NFTokenID,
offerer: node.DeletedNode.FinalFields.Owner,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
}
],
"TransactionIndex": 2,
"TransactionResult": "tesSUCCESS"
"TransactionResult": "tesSUCCESS",
"offer_id": "35F3D6D99548FA5F5315580FBF8BA6B15CAA2CAE93023D5CE4FDC130602BC5C3"
},
"hash": "AF12B2694896ADE0F93C8C3D09602B242F08C50854A0C600E0E7A2E18586C8C3",
"ledger_index": 1799491,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { NFTokenCreateOffer } from 'xrpl'
import { NFTokenCreateOfferInstructions } from './types'
import { TransactionParser } from '../types'
import { formatAmount } from '../../../../../rippled/lib/txSummary/formatAmount'
import { findNode } from '../../../transactionUtils'

export const parser: TransactionParser<
NFTokenCreateOffer,
Expand All @@ -13,7 +12,7 @@ export const parser: TransactionParser<
const tokenID = tx.NFTokenID
const isSellOffer = ((tx.Flags as number)! & 1) !== 0
const owner = tx.Owner
const offerID = findNode(meta, 'CreatedNode', 'NFTokenOffer')?.LedgerIndex
const offerID = meta.offer_id
const destination = tx.Destination

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
}
],
"TransactionIndex": 0,
"TransactionResult": "tesSUCCESS"
"TransactionResult": "tesSUCCESS",
"offer_id": "3D1C297DA5B831267CCF692F8A023688D6A4BD5AFAE9A746D5C4E0B15D256B29"
},
"hash": "385DC0497AAF8061549A7DC04EB20C2B387A167792796F5806A13E0422125563",
"ledger_index": 1887982,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
}
],
"TransactionIndex": 1,
"TransactionResult": "tesSUCCESS"
"TransactionResult": "tesSUCCESS",
"offer_id": "F660CA62E16B8067649052E8FCE947049FC6EF0D8B42EF7E5819997EC5AE45B6"
},
"hash": "47DCA082AE5920D672B32E63623B799899B91B77D68365711B07376E5ACFC8DB",
"ledger_index": 1799495,
Expand Down
55 changes: 7 additions & 48 deletions src/containers/shared/components/Transaction/NFTokenMint/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,10 @@ import { convertHexToString } from '../../../../../rippled/lib/utils'
export const parser: TransactionParser<NFTokenMint, NFTokenMintInstructions> = (
tx,
meta,
) => {
// 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: any) =>
node.CreatedNode?.LedgerEntryType === 'NFTokenPage' ||
(node.ModifiedNode?.LedgerEntryType === 'NFTokenPage' &&
!!node.ModifiedNode?.PreviousFields.NFTokens),
)

const previousTokenIDSet = new Set(
affectedNodes
.flatMap(
(node: any) =>
node.ModifiedNode?.PreviousFields?.NFTokens?.map(
(token: any) => token.NFToken.NFTokenID,
),
)
.filter((id: any) => id),
)

const finalTokenIDs = affectedNodes
.flatMap(
(node: any) =>
(
node.ModifiedNode?.FinalFields ?? node.CreatedNode?.NewFields
)?.NFTokens?.map((token: any) => token.NFToken.NFTokenID),
)
.filter((id: any) => id)

const tokenID = finalTokenIDs.find((id: any) => !previousTokenIDSet.has(id))

return {
tokenID,
tokenTaxon: tx.NFTokenTaxon,
uri: convertHexToString(tx.URI),
transferFee: tx.TransferFee,
issuer: tx.Issuer,
}
}
) => ({
tokenID: meta.nftoken_id,
tokenTaxon: tx.NFTokenTaxon,
uri: convertHexToString(tx.URI),
transferFee: tx.TransferFee,
issuer: tx.Issuer,
})
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
}
],
"TransactionIndex": 1,
"TransactionResult": "tesSUCCESS"
"TransactionResult": "tesSUCCESS",
"nftoken_id": "0008000085D33F9C5481D3515029C9904D16F0109414D3A00000099A00000000"
},
"hash": "B0AAA46053F2570200CA1E12978EFFBB124374276669CC3F68602A6788182172",
"ledger_index": 5605230,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@
}
],
"TransactionIndex": 0,
"TransactionResult": "tesSUCCESS"
"TransactionResult": "tesSUCCESS",
"nftoken_id": "000800006203F49C21D5D6E022CB16DE3538F248662FC73C535743B40000001A"
},
"hash": "B9A20167DC30985ABD983912F29DE81CB4579FAF9672C9D68BEC5219C19C7E50",
"ledger_index": 1861436,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,8 @@
}
],
"TransactionIndex": 337,
"TransactionResult": "tesSUCCESS"
"TransactionResult": "tesSUCCESS",
"nftoken_id": "000D0000B9BD7D214128A91ECECE5FCFF9BDB0D043567C51CFBEC443000063A7"
},
"hash": "4E0EB5F23D248740CB8FC28D1003CEFE841E21811FE2EA4B195CFE1B0BC54219",
"ledger_index": 6453184,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,8 @@
}
],
"TransactionIndex": 0,
"TransactionResult": "tesSUCCESS"
"TransactionResult": "tesSUCCESS",
"nftoken_id": "0008000085D33F9C5481D3515029C9904D16F0109414D3A0DCBA29BA00000020"
},
"hash": "C4E598099A8B13C5C8D2B8C86385A37B64C2F62BFA1FB87196401BB6ACB67A69",
"ledger_index": 5605289,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
}
],
"TransactionIndex": 0,
"TransactionResult": "tesSUCCESS"
"TransactionResult": "tesSUCCESS",
"nftoken_id": "000861A8A99B4460C2A4CCC90634FD9C7F51940AD9450BE30000099B00000000"
},
"hash": "73629D3E84AC18C06350A9A4A0B2EF15AB52E5A62AECDAB4A0579DEF342FC61F",
"ledger_index": 4997948,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ export const parser = (tx: SetHook, meta: any): SetHookInstructions => {
(node.ModifiedNode?.LedgerEntryType === 'Hook' &&
!!node.ModifiedNode?.PreviousFields?.Hooks),
)
const hashes = affectedNodes.flatMap(
(node: any) =>
(
node.ModifiedNode?.FinalFields ?? node.CreatedNode?.NewFields
)?.Hooks?.map((hook: any) => hook.Hook.HookHash),
const hashes = affectedNodes.flatMap((node: any) =>
(node.ModifiedNode?.FinalFields ?? node.CreatedNode?.NewFields)?.Hooks?.map(
(hook: any) => hook.Hook.HookHash,
),
)
// TODO: there may be bugs here when a `HookHash` is already specified in a hook
// It's difficult to understand what situation that would be in, so this is left here for now
Expand Down
1 change: 1 addition & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="google-site-verification" content="k8jb6KQfitguHqeR97svoRnnsgzvs3a0FliHbESVDk4" />
<meta name="description" content="Discover the XRP Ledger with this open source explorer. Check account balances, transactions, validators, nodes and analyze blockchain activity.">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
Expand Down

0 comments on commit 06da999

Please sign in to comment.