ARCx
Search…
🧠
API
A brief guide on how to use our endpoints.

Getting started

Integrating scores into your own dApp requires no sign-ups nor registrations. We provide open APIs to encourage the use of scores (i.e. address reputation) across the DeFi ecosystem.
​
If you'd like to create and integrate your own score, we'd love to help you with that ! Contact us on discord​
​
Here's the step-by-step for developers to integrate scores into their smart contracts:

1. Get your Score Proof

First, you'll need to fetch a specific score of a specific user. Let's say the score you want to fetch is arcx.loyalty and the wallet address is 0x123...456. You would then simply make the following API call using the language/framework of your choosing:
1
https://api.arcx.money/scores/0x123...456/arcx.loyalty
Copied!
This will return your score containing a Merkle proof. We'll refer to this object as the Score Proof. Here's an example of what that looks like.

2. Send your Score Proof to a smart contract

With your Score Proof, you now have everything you need and can call a smart contract. Simply include this proof into a your on-chain call to verify it in solidity/smart contracts. If there is a metadata field in your Score Proof, simply drop it (it is not needed on-chain).

3. Verify your Score Proof

Once the proof is in smart-contract code, simply verify it using our contracts to ensure its integrity. Once verified, you can add your own rules and logic.

4. Custom Score logic

Now that your score is verified, the fun begins! You can write any smart-contract logic based on the value of the score. Here's some examples of what problems can now be solved.
​
For further questions, explanations or examples, come chat with us on discord.

Scores endpoints

GET /scores/:address

Get all the scores of a specific address. This will include all the scores in our system for this address, even those that the address does not yet have.
When an address does not have a score, its score will be null.
Example:
1
https://api.arcx.money/scores/0x123...456
Copied!
Response:
1
[
2
{
3
"account": "0x123...456",
4
"protocol": "0x611...000",
5
"score": "100",
6
"merkleProof": [
7
"0x111...111",
8
"0x222...222",
9
"0x333...333",
10
...,
11
],
12
"metadata": {
13
...
14
},
15
},
16
{
17
"account": "0x123...456",
18
"protocol": "0x622...000",
19
"score": "500",
20
"merkleProof": [
21
"0xaaa...aaa",
22
"0xbbb...bbb",
23
"0xccc...ccc",
24
...,
25
],
26
"metadata": {
27
...
28
},
29
},
30
{
31
"account": "0x123...456",
32
"protocol": "0x633...000",
33
"score": null,
34
"merkleProof": [],
35
},
36
{
37
...
38
}
39
]
Copied!

GET /scores/:address/:score - (Score Proof)

A more precise option from the previous /scores/:address endpoint. Most effective method of obtaining the required Score Proof for on-chain use.​
Example:
1
https://api.arcx.money/scores/0x123...456/arcx.loyalty
Copied!
Response:
1
{
2
"account": "0x123...456",
3
"protocol": "0x611...000",
4
"score": "175",
5
"merkleProof": [
6
"0x111...111",
7
"0x222...222",
8
"0x333...333",
9
...,
10
],
11
"metadata": {
12
...
13
},
14
}
Copied!

Passports endpoints

GET /passports

List all the addresses who have claimed their Passport alongside the date they claimed.
Example:
1
https://api.arcx.money/passports
Copied!
Response:
1
[
2
{
3
"address": "0x111...111",
4
"date_claimed": 1641184343323
5
},
6
{
7
"address": "0x222...222",
8
"date_claimed": 1641136874287
9
},
10
{
11
"address": "0x333...333",
12
"date_claimed": 1641132310215
13
},
14
{
15
"address": "0x444...444",
16
"date_claimed": 1641137470422
17
},
18
...
19
]
Copied!
​

Help

If you have any questions or suggestions, we'd love your input in our Discord. Happy building! γƒŽ
​