Skip to content

Tokens supply format from plugin#1505

Merged
dragos-rebegea merged 1 commit into
developmentfrom
add-plugin-token-supply-format
Jun 4, 2025
Merged

Tokens supply format from plugin#1505
dragos-rebegea merged 1 commit into
developmentfrom
add-plugin-token-supply-format

Conversation

@bogdan-rosianu
Copy link
Copy Markdown
Contributor

Reasoning

Proposed Changes

How to test

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2025

k6 load testing comparison.
Base Commit Hash: b956bbf
Target Commit Hash: bc1caba

Metric Base Target Diff
AvgMax9095AvgMax9095AvgMax9095
Nodes50.761129.2553.8656.0050.371065.6953.2355.23-0.78% ✅-5.63% ✅-1.17% ✅-1.38% ✅
Pool49.76375.0353.9756.1449.57519.6853.1455.10-0.36% ✅+38.57% 🔴-1.55% ✅-1.85% ✅
Blocks56.331112.3754.6358.3755.671085.3953.5756.59-1.18% ✅-2.43% ✅-1.95% ✅-3.04% ✅
Transactions64.242467.6254.8557.8963.222209.8554.0556.44-1.59% ✅-10.45% ✅-1.46% ✅-2.52% ✅
Tokens50.00573.0054.0056.1949.77584.3453.1755.12-0.47% ✅+1.98% 🔴-1.55% ✅-1.90% ✅
Accounts50.991423.8854.0656.0750.761468.0053.2655.27-0.47% ✅+3.10% 🔴-1.48% ✅-1.43% ✅
Mex49.81445.5754.0256.1548.85126.8753.1354.98-1.91% ✅-71.53% ✅-1.64% ✅-2.09% ✅
Test Run Duration60002.1660004.29

Legend: Avg - Average Response Time, Max - Maximum Response Time, 90 - 90th Percentile, 95 - 95th Percentile
All times are in milliseconds.

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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not fail if the formatTokenSupply is not defined in the plugin module

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, just tested and it works

@dragos-rebegea dragos-rebegea requested a review from Copilot June 3, 2025 14:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link

Copilot AI Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
this.pluginService.formatTokenSupply(identifier, esdtSupply);
esdtSupply = this.pluginService.formatTokenSupply(identifier, esdtSupply);

Copilot uses AI. Check for mistakes.

async processAbout(_about: About): Promise<void> { }

formatTokenSupply(_identifier: string, _esdtSupply: EsdtSupply) { }
Copy link

Copilot AI Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@dragos-rebegea dragos-rebegea merged commit 87a4c5a into development Jun 4, 2025
6 checks passed
@dragos-rebegea dragos-rebegea deleted the add-plugin-token-supply-format branch June 4, 2025 11:56
dragos-rebegea pushed a commit that referenced this pull request Jun 4, 2025
bogdan-rosianu added a commit that referenced this pull request Aug 25, 2025
* 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>
bogdan-rosianu added a commit that referenced this pull request Sep 5, 2025
* 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>
bogdan-rosianu added a commit that referenced this pull request Sep 23, 2025
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants