Repository navigation
feat: 🎸 support the redesigned SubQuery schema - #3
Draft
prashantasdeveloper wants to merge 14 commits into
Draft
prashantasdeveloper wants to merge 14 commits into
prashantasdeveloper wants to merge 14 commits into
Conversation
The SDK's generated middleware types no longer export PortfolioMovementTypeEnum, so the explorer names the two kinds itself.
- Creation stamps come from createdEvent and its block. - Holder counts use Asset.holderCount, which counts identities with a balance or at least one NFT; the nftHolders connection is gone. - Venue ids are zero-padded in the index: pad them for lookups and strip the padding for display. - Account reads primaryAccountId, and a multisig is an account with a MultiSig row, not one that created a multisig.
- Secondary keys are the identity's current SecondaryKey memberships; the reverse relations are claims, venues, assetsOwned and custodiedPortfolios. - Held NFT collections are heldAssets with nftCount above zero, and the assets tab shows that count. - The monthly creation count filters on the creation event's block time. - createdAt is left empty when the creation stamp names an event the index did not store, instead of failing the whole page.
…sactions - Accounts are the fromAccountId/toAccountId relations, and the block, event and extrinsic indexes come from createdEvent. - Instruction and venue ids are shown without the index's zero padding. - Portfolio movements are internal transfers in assetTransactions, filtered by the did/number portfolio id; the portfolioMovements connection is gone.
- NFT holders are assetHolders with nftCount above zero. Their token ids are read from nfts in pages of 100, because a nested connection stops at 100 rows without saying so. - Fungible holders exclude identities whose balance went back to zero. - Extrinsic parameters are the args object; paramsTxt is gone. - Extrinsic block ids are shown without the index's zero padding.
- Legs name their parties by id: fromId/toId, the account ids, and the did/number portfolio ids. - Affirmations are one row per holder, a portfolio or an account, plus one per mediator, Pending until the holder affirms. The affirmations tab shows the holder and the time it affirmed, and an instruction is affirmed by the identities none of whose holdings are still Pending. - An identity's instructions are those with a leg from or to its DID. - Instruction and venue ids are padded for lookups and shown unpadded. - Stamps and instruction events come from createdEvent and updatedEvent.
…leware The snapshot is now the endpoint's standard introspection result, which buildClientSchema and codegen can read, instead of a serialized GraphQLSchema object.
The query service answers concurrent requests one at a time, so 27 parallel pages for a testnet holder of 2,724 tokens took 26 s. Sent as aliases of one request, 25 pages at a time, they take about 1 s.
The schema no longer has the one-to-one reverse field Account.multiSig (read as multiSigs), so the account query asks the multiSigs connection for a row whose own account is this address.
…ication Taken from the testnet endpoint, which serves the final schema without StakingPosition, Validator, AssetPreApproval, EvmAccountMapping, CorporateActionDefaultConfig and the one-to-one reverse fields.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Moves the explorer to the redesigned SubQuery schema. Rows now carry
createdEvent/updatedEventstamps, instruction, venue and block ids are zero-padded, several connections and reverse fields are gone, and nested connections stop at 100 rows without saying so.Schema migration
createdEvent, holder counts fromAsset.holderCount, and venue ids are padded for lookups and shown unpadded. An account readsprimaryAccountId. A multisig is found through themultiSigsconnection, becauseAccount.multiSigis gone.SecondaryKeymemberships. Held NFT collections areheldAssetswithnftCount > 0, and the monthly creation count filters on the creation block's time. When the creation stamp points to an event the index did not store,createdAtis left empty and the page still loads.assetTransactions, sinceportfolioMovementsis gone. Accounts are thefromAccountId/toAccountIdrelations, and the block, event and extrinsic indexes come fromcreatedEvent.assetHolderswithnftCount > 0. Fungible holders whose balance went back to zero are left out. Extrinsic parameters come fromargs(paramsTxtis gone), and block ids are shown unpadded.PortfolioMovementTypeEnumis typed locally, because the SDK's generated types no longer export it.buildClientSchemaand codegen can read.Performance
Fixes found while testing
'Multisig'while the SDK returnsMultiSig. It now uses the SDK'sAccountKeyTypeenum.assetId, which is null on an off-chain leg. That grouping is removed, and the asset lookup skips legs without an asset id.did/undefinedas the party. They now show the DID alone.<ticker> (off-chain).OffChain.Amount / Nft Id, and each row shows its own value.Testing
Ran locally against the testnet and mainnet indexers and checked every page and tab against direct GraphQL queries:
Notes
package.jsonstill pins 30.1.0 and must be bumped once v32 is on npm. Testing used a local v32 build.