Skip to content

Commit d677e0e

Browse files
committed
Add nftGroupId prop to graphs collection
1 parent 9861dc2 commit d677e0e

File tree

6 files changed

+8
-19
lines changed

6 files changed

+8
-19
lines changed

config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ export class Config {
3535
name_testnet: process.env.db_name ? process.env.db_name + "_test" : 'slpdb_test',
3636
url: process.env.db_url ? process.env.db_url : 'mongodb://127.0.0.1:27017',
3737
confirmed_schema_version: 2,
38-
token_schema_version: 78,
38+
token_schema_version: 79,
3939
lazy_loading: process.env.lazy_loading ? Number.parseInt(process.env.lazy_loading) : 0,
4040
index: {
4141
tokens: {
4242
keys: [ 'tokenDetails.tokenIdHex', 'tokenDetails.name', 'tokenDetails.symbol', 'tokenStats.qty_token_circulating_supply', 'tokenStats.qty_token_burned', 'tokenStats.qty_token_minted' ],
4343
fulltext: [ 'tokenDetails.name', 'tokenDetails.symbol' ]
4444
},
4545
graphs: {
46-
keys: [ 'tokenDetails.tokenIdHex', 'graphTxn.txid', 'graphTxn.outputs.spendTxid'],
46+
keys: [ 'tokenDetails.tokenIdHex', 'tokenDetails.nftGroupIdHex', 'graphTxn.txid', 'graphTxn.outputs.spendTxid'],
4747
fulltext: [ ]
4848
},
4949
confirmed: {

graphmap.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ export class GraphMap extends Map<string, GraphTxn> {
173173
_pruneHeight: g.prevPruneHeight
174174
}
175175
};
176+
if (g.details.versionType === SlpVersionType.TokenVersionType1_NFT_Child) {
177+
dbo.tokenDetails.nftGroupIdHex = tg._nftParentId!
178+
}
176179
itemsToUpdate.push(dbo);
177180
}
178181
});

interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export interface TokenPruneStateDbo {
5656
export interface GraphTxnDbo {
5757
tokenDetails: {
5858
tokenIdHex: string;
59+
nftGroupIdHex?: string;
5960
};
6061
graphTxn: GraphTxnDetailsDbo;
6162
}

migrations/20200501221221-add_slp_metadata_indexes.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "slpdb",
3-
"version": "1.0.0-rc10",
3+
"version": "1.0.0-rc11",
44
"description": "Indexer for the Simple Ledger Protocol with real-time validation notifications.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)