Tokens supply format from plugin#1505
Conversation
|
k6 load testing comparison.
Legend: Avg - Average Response Time, Max - Maximum Response Time, 90 - 90th Percentile, 95 - 95th Percentile |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| async getTokenSupply(identifier: string): Promise<EsdtSupply> { | ||
| const { supply, minted, burned, initialMinted } = await this.gatewayService.getEsdtSupply(identifier); | ||
| const esdtSupply = await this.gatewayService.getEsdtSupply(identifier); | ||
| this.pluginService.formatTokenSupply(identifier, esdtSupply); |
There was a problem hiding this comment.
this should not fail if the formatTokenSupply is not defined in the plugin module
There was a problem hiding this comment.
yes, just tested and it works
There was a problem hiding this comment.
Pull Request Overview
This PR integrates plugin-based token supply formatting functionality into the Esdt endpoints.
- Injection and usage of PluginService in EsdtService to format token supply data.
- Addition of PluginModule to EsdtModule's dependency list.
- Introduction of the stub method formatTokenSupply in PluginService for potential supply formatting.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/endpoints/esdt/esdt.service.ts | PluginService injection and usage added for token supply formatting. |
| src/endpoints/esdt/esdt.module.ts | PluginModule added to module dependencies. |
| src/common/plugins/plugin.service.ts | New formatTokenSupply method stub introduced. |
| async getTokenSupply(identifier: string): Promise<EsdtSupply> { | ||
| const { supply, minted, burned, initialMinted } = await this.gatewayService.getEsdtSupply(identifier); | ||
| const esdtSupply = await this.gatewayService.getEsdtSupply(identifier); | ||
| this.pluginService.formatTokenSupply(identifier, esdtSupply); |
There was a problem hiding this comment.
The call to formatTokenSupply does not capture any return value. If the intent is to modify esdtSupply, consider either returning the formatted result or documenting that the method works via side effects.
| this.pluginService.formatTokenSupply(identifier, esdtSupply); | |
| esdtSupply = this.pluginService.formatTokenSupply(identifier, esdtSupply); |
|
|
||
| async processAbout(_about: About): Promise<void> { } | ||
|
|
||
| formatTokenSupply(_identifier: string, _esdtSupply: EsdtSupply) { } |
There was a problem hiding this comment.
The method formatTokenSupply is currently an empty stub. Consider adding a comment or a placeholder implementation (e.g., a NotImplemented error) to clarify its intended behavior.
* Enhance MexTokenService to calculate and store token volumes for base and quote tokens in getAllMexTokensRaw method * extend aws s3 config * update configs * update s3 configs * add support for new NFT events * add maximum process retries * add unit tests * ferch token price from highest liquidity pool * emit also deleteCacheKeys * undo process reries * fix tests * Proposer fix (#1498) * proposer fix * proposer fix * proposer fix * fix getBlock * fixes after review Co-authored-by: bogdan-rosianu <bogdan.rosianu@yahoo.com> * add execution order sorting using miniBlocksDetails from Elasticsearch (#1504) * add execution order sorting using miniBlocksDetails from Elasticsearch * fixes after review * fixes after review * fix userUndelegatedList field (#1507) * fix userUndelegatedList field * use ?? instead of [] to handle undefined case * collections count subType required false fix (#1509) * tokens supply format from plugin (#1505) * fix collection set fields (#1510) * fix collection set fields * fixes after review * add configurable response compression with gzip deflate support + update package json (#1512) * add configurable response compresion * set true compression for testnet env * refactor processNFtCollections method * update package * update version of node * update unit test yaml * getNfts parallel execution * compression flag false by default * improve getSingleNFt * getNftsCollection increase performance * undo last commit * Integrate last sdk nestjs (#1516) * update to latest sdk version * fixes for latest sdk version * add package-lock * fix unit tests * Packages security issues 2 (#1517) * fix packages * add package-lock * add missing packages * remove unneeded package * fix mongo connection * Api 672 add timestampMs field into transaction response (#1518) * Add timestampMs field to Transaction interface and class * update specs * update accounts spec * Add normalizeTimestampMs method for timestamp conversion (#1519) * Enhance account filtering by adding 'withBalance' query option to account endpoints and update ElasticIndexerHelper to support balance filtering. This allows users to filter accounts based on their balance status. (#1521) * add events filtered by order (#1523) * Refactor content type validation in NftMediaService to handle media types correctly by stripping parameters from the content type string. (#1527) * use events index instead of logs (#1514) * use events index instead of logs * configurable migrated indices * added protection for empty fields * fix log address * add transaction get unit tests (#1525) --------- Co-authored-by: cfaur09 <catalinfaurpaul@gmail.com> Co-authored-by: Catalin Faur <52102171+cfaur09@users.noreply.github.com> * fixes after merge + new sdknestjs versions * remove test file * fix tx value parsing * treat missing receiver --------- Co-authored-by: cfaur09 <catalinfaurpaul@gmail.com> Co-authored-by: Gabriel Matei <gabrielvmatei@gmail.com> Co-authored-by: Rebegea Dragos-Alexandru <42241923+dragos-rebegea@users.noreply.github.com> Co-authored-by: Catalin Faur <52102171+cfaur09@users.noreply.github.com> Co-authored-by: Gutica Stefan <123564494+GuticaStefan@users.noreply.github.com>
* Enhance MexTokenService to calculate and store token volumes for base and quote tokens in getAllMexTokensRaw method * extend aws s3 config * update configs * update s3 configs * fix transfers count with relayed txs (#1496) * add support for new NFT events * add maximum process retries * add unit tests * ferch token price from highest liquidity pool * emit also deleteCacheKeys * undo process reries * fix tests * Proposer fix (#1498) * proposer fix * proposer fix * proposer fix * fix getBlock * fixes after review Co-authored-by: bogdan-rosianu <bogdan.rosianu@yahoo.com> * add execution order sorting using miniBlocksDetails from Elasticsearch (#1504) * add execution order sorting using miniBlocksDetails from Elasticsearch * fixes after review * fixes after review * fix userUndelegatedList field (#1507) * fix userUndelegatedList field * use ?? instead of [] to handle undefined case * collections count subType required false fix (#1509) * tokens supply format from plugin (#1505) * fix collection set fields (#1510) * fix collection set fields * fixes after review * add configurable response compression with gzip deflate support + update package json (#1512) * add configurable response compresion * set true compression for testnet env * refactor processNFtCollections method * update package * update version of node * update unit test yaml * getNfts parallel execution * compression flag false by default * improve getSingleNFt * getNftsCollection increase performance * undo last commit * Integrate last sdk nestjs (#1516) * update to latest sdk version * fixes for latest sdk version * add package-lock * fix unit tests * Packages security issues 2 (#1517) * fix packages * add package-lock * add missing packages * remove unneeded package * fix mongo connection * Api 672 add timestampMs field into transaction response (#1518) * Add timestampMs field to Transaction interface and class * update specs * update accounts spec * Add normalizeTimestampMs method for timestamp conversion (#1519) * Enhance account filtering by adding 'withBalance' query option to account endpoints and update ElasticIndexerHelper to support balance filtering. This allows users to filter accounts based on their balance status. (#1521) * add events filtered by order (#1523) * Refactor content type validation in NftMediaService to handle media types correctly by stripping parameters from the content type string. (#1527) * use events index instead of logs (#1514) * use events index instead of logs * configurable migrated indices * added protection for empty fields * fix log address * add transaction get unit tests (#1525) --------- Co-authored-by: cfaur09 <catalinfaurpaul@gmail.com> Co-authored-by: Catalin Faur <52102171+cfaur09@users.noreply.github.com> * fix ESDTTransfer duplicated events (#1526) * use events index instead of logs * configurable migrated indices * added protection for empty fields * fix log address * add transaction get unit tests (#1525) * fix duplicated events --------- Co-authored-by: bogdan-rosianu <bogdan.rosianu@yahoo.com> * update MetaESDT tokens (#1520) * update MetaESDT tokens * update imports * nft collections es improvements (#1530) * ES collections improvements * getNfts improvements * improve bulkProcessTransactions * fixes * fixes * fixes * refactor getSmartContractResultsRaw() * improve nftCollection processing * eslint fix --------- Co-authored-by: cfaur09 <catalinfaurpaul@gmail.com> Co-authored-by: Gabriel Matei <gabrielvmatei@gmail.com> Co-authored-by: bogdan-rosianu <51945539+bogdan-rosianu@users.noreply.github.com> Co-authored-by: bogdan-rosianu <bogdan.rosianu@yahoo.com> Co-authored-by: Catalin Faur <52102171+cfaur09@users.noreply.github.com> Co-authored-by: Gutica Stefan <123564494+GuticaStefan@users.noreply.github.com>
* update andromeda config template enable epoch (#1502) * Merge development into main (#1511) * Enhance MexTokenService to calculate and store token volumes for base and quote tokens in getAllMexTokensRaw method * extend aws s3 config * update configs * update s3 configs * fix transfers count with relayed txs (#1496) * add support for new NFT events * add maximum process retries * add unit tests * ferch token price from highest liquidity pool * emit also deleteCacheKeys * undo process reries * fix tests * Proposer fix (#1498) * proposer fix * proposer fix * proposer fix * fix getBlock * fixes after review Co-authored-by: bogdan-rosianu <bogdan.rosianu@yahoo.com> * add execution order sorting using miniBlocksDetails from Elasticsearch (#1504) * add execution order sorting using miniBlocksDetails from Elasticsearch * fixes after review * fixes after review * fix userUndelegatedList field (#1507) * fix userUndelegatedList field * use ?? instead of [] to handle undefined case * collections count subType required false fix (#1509) * tokens supply format from plugin (#1505) * fix collection set fields (#1510) * fix collection set fields * fixes after review * add configurable response compression with gzip deflate support + update package json (#1512) * add configurable response compresion * set true compression for testnet env * refactor processNFtCollections method * update package * update version of node * update unit test yaml * getNfts parallel execution * compression flag false by default * improve getSingleNFt * getNftsCollection increase performance * undo last commit * Integrate last sdk nestjs (#1516) * update to latest sdk version * fixes for latest sdk version * add package-lock * fix unit tests * Packages security issues 2 (#1517) * fix packages * add package-lock * add missing packages * remove unneeded package * fix mongo connection * Api 672 add timestampMs field into transaction response (#1518) * Add timestampMs field to Transaction interface and class * update specs * update accounts spec * Add normalizeTimestampMs method for timestamp conversion (#1519) * Enhance account filtering by adding 'withBalance' query option to account endpoints and update ElasticIndexerHelper to support balance filtering. This allows users to filter accounts based on their balance status. (#1521) * add events filtered by order (#1523) * Refactor content type validation in NftMediaService to handle media types correctly by stripping parameters from the content type string. (#1527) * use events index instead of logs (#1514) * use events index instead of logs * configurable migrated indices * added protection for empty fields * fix log address * add transaction get unit tests (#1525) --------- Co-authored-by: cfaur09 <catalinfaurpaul@gmail.com> Co-authored-by: Catalin Faur <52102171+cfaur09@users.noreply.github.com> * fix ESDTTransfer duplicated events (#1526) * use events index instead of logs * configurable migrated indices * added protection for empty fields * fix log address * add transaction get unit tests (#1525) * fix duplicated events --------- Co-authored-by: bogdan-rosianu <bogdan.rosianu@yahoo.com> * update MetaESDT tokens (#1520) * update MetaESDT tokens * update imports * nft collections es improvements (#1530) * ES collections improvements * getNfts improvements * improve bulkProcessTransactions * fixes * fixes * fixes * refactor getSmartContractResultsRaw() * improve nftCollection processing * eslint fix --------- Co-authored-by: cfaur09 <catalinfaurpaul@gmail.com> Co-authored-by: Gabriel Matei <gabrielvmatei@gmail.com> Co-authored-by: bogdan-rosianu <51945539+bogdan-rosianu@users.noreply.github.com> Co-authored-by: bogdan-rosianu <bogdan.rosianu@yahoo.com> Co-authored-by: Catalin Faur <52102171+cfaur09@users.noreply.github.com> Co-authored-by: Gutica Stefan <123564494+GuticaStefan@users.noreply.github.com> * merge main to development - fixes after merge * fix lint --------- Co-authored-by: Rebegea Dragos-Alexandru <42241923+dragos-rebegea@users.noreply.github.com> Co-authored-by: cfaur09 <catalinfaurpaul@gmail.com> Co-authored-by: Gabriel Matei <gabrielvmatei@gmail.com> Co-authored-by: Catalin Faur <52102171+cfaur09@users.noreply.github.com> Co-authored-by: Gutica Stefan <123564494+GuticaStefan@users.noreply.github.com>
Reasoning
Proposed Changes
How to test