Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2bdbe20
Feat: Added LinkedIn Analytics implementation
ritikbhatt20 Jun 20, 2024
3444924
Feat: Linkedin Post Impressions
ritikbhatt20 Jun 21, 2024
8c33604
Feat: Added Linkedin Profile views
ritikbhatt20 Jun 21, 2024
c2771a4
🔨
ritikbhatt20 Jun 21, 2024
8cbb36a
Feat: Added Linkedin Followers Int
ritikbhatt20 Jun 21, 2024
1f6578d
Feat: Added linkedin search appearances
ritikbhatt20 Jun 21, 2024
5de7032
Feat: Added Chess Rapid Ratings integration
ritikbhatt20 Jun 23, 2024
b470511
Feat: Added chess Rapid Wins Losses
ritikbhatt20 Jun 23, 2024
12b7bbb
Feat: Added Chess Bullet Wins Loses
ritikbhatt20 Jun 23, 2024
63d6c97
Fix
ritikbhatt20 Jun 23, 2024
67358e4
feat: Added Chess Bullet Ratings
ritikbhatt20 Jun 23, 2024
d1aea7a
Feat: Added Swiggy Last order price integration
ritikbhatt20 Jun 28, 2024
0c6fe81
Feat: Added Zomato Total Orders
ritikbhatt20 Jul 7, 2024
717cbb5
Feat: Added groww account details verification
ritikbhatt20 Jul 9, 2024
48b223b
Feat: Added Groww Available Balance Verification
ritikbhatt20 Jul 24, 2024
6e599d9
Feat: Integrated Groww Credit Score
ritikbhatt20 Jul 24, 2024
1c4cd0c
Feat: Integrated Groww Withdrawable Balance
ritikbhatt20 Jul 24, 2024
b638f49
Feat: Added Groww Ongoing and Closing Balance
ritikbhatt20 Jul 24, 2024
ea3eeae
Feat: Added Stocks Balance Integration
ritikbhatt20 Jul 24, 2024
a23875b
Feat: Added Groww Balance on Hold
ritikbhatt20 Jul 24, 2024
469a9f7
Feat: Added Leetcode Max Streak
ritikbhatt20 Jul 24, 2024
4b7f7c9
feat: Added Human Benchmark Aim trainer
ritikbhatt20 Aug 10, 2024
950c8fd
feat: Added Human Benchmark Chimp test
ritikbhatt20 Aug 18, 2024
484e1e6
feat: Added Human Benchmark Words per minute
ritikbhatt20 Aug 18, 2024
9bdc4b5
feat: Added Human Benchmark Number Memory Score
ritikbhatt20 Aug 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions CRIP/CRIP-HumanBenchmarkNumberMemory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
| proposal | title | description | author | discussions-to | status | type | category | created | requires |
|----------|--------------------------------|--------------------------------------------------------------------|---------------------------|----------------|--------|-------------|----------|------------|----------|
| CRIP-15 | Human Benchmark Number Memory Service | Integration with Human Benchmark to verify Number Memory Test Score | Ritik Bhatt <[email protected]> | | Draft | Integration | CRIP | 2024-08-10 | |

## Title

Human Benchmark Number Memory Service Integration

## Introduction

This proposal outlines the integration of Human Benchmark as a data provider for the Catoff-Reclaim integration project. The focus of this service is on retrieving and processing the Number Memory Test score from Human Benchmark. This service allows users to verify their memory strength by recalling a sequence of numbers on the Catoff platform.

## External APIs Needed

- **Human Benchmark API**: As Human Benchmark does not offer a public API for accessing Number Memory Test scores, this integration will involve data extraction methods from the Human Benchmark app/web.

## Use Cases

1. **User Verification**: Validate the Number Memory Test score on a user's Human Benchmark account.
2. **Challenge Participation**: Enable users to join challenges that require proof of their Number Memory Test score from Human Benchmark.
3. **Memory Test Benchmarking**: Assess users' memory strength based on their Number Memory Test score.

## Data Provider

- **Name**: Human Benchmark Number Memory Test
- **Hash Value**: 0xa8f3d9b7c4e9f8d7c9e7b5c3a8e9d9f7c8e7f9b9d9f8e7c9f7e9f9d8c7f8e7b8

## Code Snippet

Below is a code snippet that demonstrates the key parts of the Human Benchmark Number Memory Test integration. The full implementation should follow the service file template.

**`services/HumanBenchmarkNumberMemoryService.js`**

```javascript
const { ReclaimServiceResponse } = require('../utils/reclaimServiceResponse');

exports.processHumanBenchmarkData = async (proof, providerName) => {
console.log("Proof is: ", proof[0]);

const extractedParameters = JSON.parse(proof[0].claimData.context).extractedParameters;

const lastUpdateTimeStamp = proof[0].claimData.timestampS;
const numberMemoryScore = extractedParameters.numberMemoryScore;

console.log("The Number Memory test score on your Human Benchmark is:", numberMemoryScore);

return new ReclaimServiceResponse(
providerName,
lastUpdateTimeStamp,
'ritikbhatt',
numberMemoryScore,
proof[0]
);
};
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const express = require('express')
const bodyParser = require('body-parser')
const reclaimController = require('./src/controllers/reclaimController')

require('dotenv').config();

const app = express()
app.use(bodyParser.json())

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@reclaimprotocol/js-sdk": "^1.3.6",
"axios": "^1.7.2",
"body-parser": "^1.20.2",
"chess-web-api": "^1.2.0",
"dotenv": "^16.4.5",
"express": "^4.19.2"
},
Expand Down
20 changes: 20 additions & 0 deletions src/services/HumanBenchmarkNumberMemoryService.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const { ReclaimServiceResponse } = require('../utils/reclaimServiceResponse');

exports.processHumanBenchmarkData = async (proof, providerName) => {
console.log("Proof is: ", proof[0]);

const extractedParameters = JSON.parse(proof[0].claimData.context).extractedParameters;

const lastUpdateTimeStamp = proof[0].claimData.timestampS;
const numberMemoryScore = extractedParameters.numberMemoryScore;

console.log("The Number Memory test score on your Human Benchmark is:", numberMemoryScore);

return new ReclaimServiceResponse(
providerName,
lastUpdateTimeStamp,
'ritikbhatt',
numberMemoryScore,
proof[0]
);
};
16 changes: 11 additions & 5 deletions src/services/reclaimService.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const { Reclaim } = require('@reclaimprotocol/js-sdk')
const { RECLAIM_PROVIDER_ID, RECLAIM_APP_ID } = require('../utils/constants')
const { processTwitterData } = require('./twitterService')
const { processGitHubData } = require('./githubService')
const { processHumanBenchmarkData } = require('./HumanBenchmarkNumberMemoryService')

exports.signWithProviderID = async (userId, providerId) => {
const providerName = RECLAIM_PROVIDER_ID[providerId]
Expand All @@ -13,11 +14,11 @@ exports.signWithProviderID = async (userId, providerId) => {
`Sending signature request to Reclaim for userId: ${userId} with providerName: ${providerName}`
)

try {
const reclaimClient = new Reclaim.ProofRequest(reclaimAppID)
await reclaimClient.buildProofRequest(providerId)
try {
const reclaimClient = new Reclaim.ProofRequest('0x6CD4098A85eFa01B3f50C6aac57421d21F4434B2')
await reclaimClient.buildProofRequest('ac8897bd-eb5f-4ce4-9098-7cfd6646b49b')
reclaimClient.setSignature(
await reclaimClient.generateSignature(reclaimAppSecret)
await reclaimClient.generateSignature('0x24fa1484452ae978d432da1372b6a27add09800b384eb1e949c5adff3e816e4f')
)
const { requestUrl: signedUrl } =
await reclaimClient.createVerificationRequest()
Expand All @@ -34,6 +35,7 @@ exports.signWithProviderID = async (userId, providerId) => {
}

const handleReclaimSession = async (userId, reclaimClient, providerName) => {
console.log('Starting session')
await reclaimClient.startSession({
onSuccessCallback: async proof => {
console.log(
Expand All @@ -49,6 +51,9 @@ const handleReclaimSession = async (userId, reclaimClient, providerName) => {
case 'GITHUB_ACCOUNT_VERIFICATION':
processedData = await processGitHubData(proof, providerName)
break
case 'HUMANBENCHMARK_ACCOUNT_VERIFICATION':
processedData = await processHumanBenchmarkData(proof, providerName);
break
default:
throw new Error(`No handler for provider: ${providerName}`)
}
Expand All @@ -65,4 +70,5 @@ const handleReclaimSession = async (userId, reclaimClient, providerName) => {
console.error(`Verification failed for userId: ${userId}`, error)
},
})
}
console.log('Ended session')
}
8 changes: 8 additions & 0 deletions src/utils/constants.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
exports.RECLAIM_PROVIDER_ID = {
twitter: 'TWITTER_ANALYTICS_VIEWS',
github: 'GITHUB_ACCOUNT_VERIFICATION',
humanbenchmark: 'HUMANBENCHMARK_ACCOUNT_VERIFICATION'
}

exports.RECLAIM_APP_ID = {
TWITTER_ANALYTICS_VIEWS: 'your-twitter-app-id',
GITHUB_ACCOUNT_VERIFICATION: 'your-github-app-id',
HUMANBENCHMARK_ACCOUNT_VERIFICATION: 'your-humanbenchmark-app-id'
}

exports.PROVIDER_ID = {
twitter: 'twitter-provider-id',
github: 'github-provider-id',
humanbenchmark: 'humanbenchmark-provider-id'
}