Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a credential to check is a user has >= a specific number of transactions #371

Merged
merged 17 commits into from
Feb 6, 2024

Conversation

vplasencia
Copy link
Member

@vplasencia vplasencia commented Jan 31, 2024

Description

This PR adds a new provider named blockchain and a new validator named BLOCKCHAIN_TRANSACTIONS with a criteria named minTransactions.

This credential can be used to check if a user has greater than or equal to minTransactions transactions.

There is a new env variable in the api named BLOCKCHAIN_SEPOLIA_RPC_URL. It refers to the sepolia network. If we would like to add a new network, we will only need to add an PRC URL for the network in the api environment variables. Following the structure of BLOCKCHAIN_<NETWORK>_RPC_URL.

The URL for this credential would be:

http://localhost:3001/credentials?group=<group-id>&member=<member-commitment>&provider=blockchain&network=<network-name>&block=<block-number>&redirect_uri=<redirect-url>

The network in the URL should be the same as the one that appears in its RPC URL environment variable inside the api.

The block and the redirect_uri properties are optional.

Related Issue

Closes #369

Does this introduce a breaking change?

  • Yes
  • No

@vplasencia vplasencia marked this pull request as draft January 31, 2024 11:57
@vplasencia vplasencia linked an issue Jan 31, 2024 that may be closed by this pull request
@vplasencia vplasencia requested a review from 0xjei January 31, 2024 12:16
@vplasencia vplasencia marked this pull request as ready for review January 31, 2024 14:44
Copy link
Contributor

@0xjei 0xjei left a comment

Choose a reason for hiding this comment

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

Amazing and thank you for introducing the on-chain providers!

apps/api/src/app/credentials/credentials.service.ts Outdated Show resolved Hide resolved
apps/dashboard/src/api/bandadaAPI.ts Outdated Show resolved Hide resolved
@vplasencia vplasencia merged commit 318b8ef into dev Feb 6, 2024
2 checks passed
@vplasencia vplasencia deleted the feat/transactions-credential branch March 6, 2024 23:06
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.

Checks if user has >= X transactions
2 participants