-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from defactor-com/feat/api-docs
Created api docs first version
- Loading branch information
Showing
20 changed files
with
330 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"label": "API", | ||
"position": 1, | ||
"link": { | ||
"type": "generated-index", | ||
"description": "Discover the power of Defactor’s API. Our robust and user-friendly API allows you to integrate Defactor into your own applications and services. With detailed documentation and code examples, we help you get started quickly. Explore our guides and resources to make the most of Defactor’s API." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
sidebar_position: 8 | ||
--- | ||
|
||
# Add Kyc Wallet | ||
|
||
**Endpoint**: `/addKycWallet` | ||
|
||
**HTTP Method**: `POST` | ||
|
||
**Params**: | ||
``` json | ||
{ | ||
"id": "id", | ||
"wallet": "0xd198...ce351", | ||
"signature": "signature" | ||
} | ||
``` | ||
|
||
## Description | ||
|
||
This endpoint allows you to add a KYC (Know Your Customer) wallet. | ||
|
||
## Response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
sidebar_position: 6 | ||
--- | ||
|
||
# Circulating Supply | ||
|
||
**Endpoint**: `/circulatingSupply` | ||
|
||
**HTTP Method**: `GET` | ||
|
||
## Description | ||
|
||
This endpoint makes an HTTP GET request to retrieve the circulating supply. The request does not include a request body. | ||
|
||
## Response | ||
|
||
Upon the last execution, the server responded with a status code of 200 and the circulating supply value of 111083061.0. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
sidebar_position: 4 | ||
--- | ||
|
||
# Get Kyc | ||
|
||
**Endpoint**: `/getKyc` | ||
|
||
**HTTP Method**: `GET` | ||
|
||
**Params**: `wallet=0xd198...ce351` | ||
|
||
## Description | ||
|
||
This endpoint makes an HTTP GET request to retrieve Know Your Customer (KYC) information for a specific wallet. The wallet parameter in the query string should be provided to specify the wallet for which the KYC information is being requested. | ||
|
||
## Response | ||
|
||
Upon a successful execution, the endpoint returns a status code of 200 along with an empty JSON response. | ||
|
||
``` json | ||
{ | ||
"wallet": "" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
sidebar_position: 3 | ||
--- | ||
|
||
# Get Proposal Details | ||
|
||
**Endpoint**: `/getProposalDetails/{proposalID}` | ||
|
||
**HTTP Method**: `GET` | ||
|
||
## Description | ||
|
||
This endpoint retrieves the details of a specific proposal identified by its unique ID. | ||
The request does not require a request body. | ||
|
||
## Response | ||
|
||
The response will have a status code of 200 and will include the details of the proposal in the following format: | ||
|
||
``` json | ||
{ | ||
"proposal": { | ||
"id": "", | ||
"index": 0, | ||
"title": "", | ||
"description": "", | ||
"closedDate": "", | ||
"votesFor": 0, | ||
"votesAgainst": 0, | ||
"status": "" | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
sidebar_position: 9 | ||
--- | ||
|
||
# Initiate Upload | ||
|
||
**Endpoint**: `/initiateUpload` | ||
|
||
**HTTP Method**: `POST` | ||
|
||
**Params**: | ||
``` json | ||
{ | ||
"format": "mp3" | ||
} | ||
``` | ||
|
||
## Description | ||
|
||
This endpoint initiates an upload process by sending an HTTP POST request to the specified URL. | ||
The request should include a payload in raw format with a "format" parameter. | ||
|
||
## Response | ||
|
||
Upon successful execution, the response will have a status code of 200 and will include a "url" parameter indicating the location for the upload. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
sidebar_position: 10 | ||
--- | ||
|
||
# Insert Pool | ||
|
||
**Endpoint**: `/insertPool` | ||
|
||
**HTTP Method**: `POST` | ||
|
||
**Params**: | ||
``` json | ||
{ | ||
"poolId": "", | ||
"name": "", | ||
"description": "", | ||
"image": "", | ||
"website": "", | ||
"twitter": "", | ||
"collateralTokens": [], | ||
"chain": "" | ||
} | ||
``` | ||
|
||
## Description | ||
|
||
The request should include a payload in the raw request body type with parameters such as poolId, name, description, image, website, twitter, collateralTokens, and chain. | ||
|
||
## Response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
sidebar_position: 10 | ||
--- | ||
|
||
# Insert User Vote | ||
|
||
**Endpoint**: `/insertUserVote` | ||
|
||
**HTTP Method**: `POST` | ||
|
||
**Params**: | ||
``` json | ||
{ | ||
"votingId": "64ad3c1fc1d8dec244b69b9f", | ||
"wallet": "0xd198...ce351", | ||
"chain": "Ethereum", | ||
"vote": true, | ||
"signature": "signature", | ||
"signedTimestamp": 100000000 | ||
} | ||
``` | ||
|
||
## Description | ||
|
||
This endpoint allows you to insert a user's vote. | ||
|
||
## Response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
sidebar_position: 5 | ||
--- | ||
|
||
# List Pools | ||
|
||
**Endpoint**: `/listPools` | ||
|
||
**HTTP Method**: `GET` | ||
|
||
**Params**: | ||
- `poolIds=pool id` | ||
- `chain=Ethereum` | ||
|
||
## Description | ||
|
||
This endpoint makes an HTTP GET request to fetch a list of pools based on the provided pool IDs and chain. The request should include the query parameters "poolIds" and "chain" to specify the pool IDs and the blockchain network, respectively. | ||
The request body for this endpoint is undefined and should be left empty. | ||
|
||
## Response | ||
|
||
The response to this request will have a status code of 200, and it will return an empty array "[]" containing the list of pools that match the specified pool IDs and chain. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# List Proposals | ||
|
||
**Endpoint**: `/listProposals` | ||
|
||
**HTTP Method**: `GET` | ||
|
||
## Description | ||
|
||
This endpoint makes an HTTP GET request to retrieve a list of proposals. The request does not contain a request body. | ||
|
||
## Response | ||
|
||
The response returns a status code of 200 along with an array of objects, each representing a proposal. Each proposal object includes the following properties: | ||
|
||
- id (string): The unique identifier of the proposal. | ||
- index (number): The index of the proposal. | ||
- title (string): The title of the proposal. | ||
- description (string): The description of the proposal. | ||
- closedDate (string): The date when the proposal was closed. | ||
- votesFor (number): The number of votes in favor of the proposal. | ||
- votesAgainst (number): The number of votes against the proposal. | ||
- status (string): The status of the proposal. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
# List Votes | ||
|
||
**Endpoint**: `/listVotes/{proposalID}` | ||
|
||
**HTTP Method**: `GET` | ||
|
||
## Description | ||
|
||
This endpoint makes an HTTP GET request to retrieve a list of votes associated with the provided ID. The request does not include a request body. | ||
|
||
## Response | ||
|
||
The response to the last execution of this request had a status code of 200, and it returned a JSON object containing an array of "votes" along with a "count" of the total number of votes. | ||
|
||
The "votes" array includes objects with properties such as "_id", "voting", "wallet", "chain", "vote", "signature", "signedTimestamp", "createdAt", "updatedAt", "__v", and "value". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
sidebar_position: 7 | ||
--- | ||
|
||
# Start Kyc | ||
|
||
**Endpoint**: `/startKyc` | ||
|
||
**HTTP Method**: `POST` | ||
|
||
**Params**: | ||
``` json | ||
{ | ||
"wallet": "0xd198...ce351" | ||
} | ||
``` | ||
|
||
## Description | ||
|
||
This endpoint is used to initiate the KYC (Know Your Customer) process. | ||
|
||
## Response |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.