Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
calebtuttle committed May 4, 2024
1 parent 8c908b3 commit a925e7f
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,36 @@ We plan to support more chains in the future. If you would like to use Holonym o
- **GET** `/attestation/attestor`
- **GET** `/attestation/sbts/gov-id`

### **GET** `/residence/country/us/<network>?user=<user-address>`
### **GET** `/sybil-resistance/<credential-type>/<network>?user=<user-address>&action-id=<action-id>`

Get whether the user resides in the US.
Get whether the user has registered for the given action-id.

For the `/residence/country/<country-code>` endpoints, `<country-code>` will be a 2-letter country code following the [ISO 3166 standard](https://www.iso.org/iso-3166-country-codes.html). Holonym currently only supports queries for US residency.
When a user "registers", they are establishing that the given blockchain address is a unique person for the action ID. See the section [Sybil resistance](#sybil-resistance) for more information about how action IDs can be used.

If `credential-type` is `gov-id`, this endpoint uses the government ID Holonym smart contract to check whether the user is unique. If `credential-type` is `phone`, this endpoint uses the phone number Holonym smart contract to check whether the user is unique.

See the following documentation [How to get user's proofs](https://holonym.gitbook.io/holonym-alpha/usage/how-to-stop-sybil-attacks-using-holonym#how-to-get-the-proof) for how to use action IDs.

- Parameters

| name | description | type | in | required |
| --------- | ------------------------------- | ------ | ----- | -------- |
| `network` | 'optimism' or 'optimism-goerli' | string | path | true |
| `user` | User's blockchain address | string | query | true |
| name | description | type | in | required |
| ----------------- | --------------------------------- | ------ | ----- | -------- |
| `credential-type` | 'gov-id', 'epassport', or 'phone' | string | path | true |
| `network` | 'optimism' or 'optimism-goerli' | string | path | true |
| `user` | User's blockchain address | string | query | true |
| `action-id` | Action ID | string | query | true |

- Example

```JavaScript
const resp = await fetch('https://api.holonym.io/residence/country/us/optimism?user=0x0000000000000000000000000000000000000000');
const { result: isUSResident } = await resp.json();
const resp = await fetch('https://api.holonym.io/sybil-resistance/gov-id/optimism?action-id=123456789&user=0x0000000000000000000000000000000000000000');
const { result: isUnique } = await resp.json();
```

- Responses

- 200

Result if user resides in the US.

```JSON
{
"result": true,
Expand All @@ -55,44 +59,40 @@ For the `/residence/country/<country-code>` endpoints, `<country-code>` will be

- 200

Result if user has not submitted a valid proof that they reside in the US.
Result if user has not submitted a valid proof.

```JSON
{
"result": false,
}
```

### **GET** `/sybil-resistance/<credential-type>/<network>?user=<user-address>&action-id=<action-id>`

Get whether the user has registered for the given action-id.

When a user "registers", they are establishing that the given blockchain address is a unique person for the action ID. See the section [Sybil resistance](#sybil-resistance) for more information about how action IDs can be used.
### **GET** `/residence/country/us/<network>?user=<user-address>`

If `credential-type` is `gov-id`, this endpoint uses the government ID Holonym smart contract to check whether the user is unique. If `credential-type` is `phone`, this endpoint uses the phone number Holonym smart contract to check whether the user is unique.
Get whether the user resides in the US.

See the following documentation [How to get user's proofs](https://holonym.gitbook.io/holonym-alpha/usage/how-to-stop-sybil-attacks-using-holonym#how-to-get-the-proof) for how to use action IDs.
For the `/residence/country/<country-code>` endpoints, `<country-code>` will be a 2-letter country code following the [ISO 3166 standard](https://www.iso.org/iso-3166-country-codes.html). Holonym currently only supports queries for US residency.

- Parameters

| name | description | type | in | required |
| ----------------- | --------------------------------- | ------ | ----- | -------- |
| `credential-type` | 'gov-id', 'epassport', or 'phone' | string | path | true |
| `network` | 'optimism' or 'optimism-goerli' | string | path | true |
| `user` | User's blockchain address | string | query | true |
| `action-id` | Action ID | string | query | true |
| name | description | type | in | required |
| --------- | ------------------------------- | ------ | ----- | -------- |
| `network` | 'optimism' or 'optimism-goerli' | string | path | true |
| `user` | User's blockchain address | string | query | true |

- Example

```JavaScript
const resp = await fetch('https://api.holonym.io/sybil-resistance/gov-id/optimism?action-id=123456789&user=0x0000000000000000000000000000000000000000');
const { result: isUnique } = await resp.json();
const resp = await fetch('https://api.holonym.io/residence/country/us/optimism?user=0x0000000000000000000000000000000000000000');
const { result: isUSResident } = await resp.json();
```

- Responses

- 200

Result if user resides in the US.

```JSON
{
"result": true,
Expand All @@ -101,7 +101,7 @@ See the following documentation [How to get user's proofs](https://holonym.gitbo

- 200

Result if user has not submitted a valid proof.
Result if user has not submitted a valid proof that they reside in the US.

```JSON
{
Expand Down

0 comments on commit a925e7f

Please sign in to comment.