From a925e7f3dfc826ea50bae73c8ea456e67b6ecd26 Mon Sep 17 00:00:00 2001 From: Caleb Tuttle <1calebtuttle@gmail.com> Date: Sat, 4 May 2024 11:08:20 -0400 Subject: [PATCH] update readme --- README.md | 56 +++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index bb49f5d..083f06b 100644 --- a/README.md +++ b/README.md @@ -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/?user=` +### **GET** `/sybil-resistance//?user=&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/` endpoints, `` 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, @@ -55,7 +59,7 @@ For the `/residence/country/` endpoints, `` 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 { @@ -63,36 +67,32 @@ For the `/residence/country/` endpoints, `` will be } ``` -### **GET** `/sybil-resistance//?user=&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/?user=` -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/` endpoints, `` 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, @@ -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 {