Skip to content

Commit

Permalink
update API_DOCS.md; #446
Browse files Browse the repository at this point in the history
  • Loading branch information
PropzSaladaz authored Jan 29, 2025
1 parent db66781 commit a1a7069
Showing 1 changed file with 143 additions and 7 deletions.
150 changes: 143 additions & 7 deletions API_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@
> 1. [generateECDSAKey](#generateecdsakey) (TODO - complete)
> 2. [importECDSAKey](#importecdsakey) (TODO - complete & test)
> 3. [getPublicECDSAKey](#getpublicecdsakey)
> 4. [ecdsaSignMessageHash](#ecdsaSignMessageHash)
> 4. [ecdsaSignMessageHash](#ecdsasignmessagehash)
> ##### 2) BLS calls
> 1. [importBLSKeyShare](#importblskeyshare)
> 2. [getBLSPublicKeyShare](#getblspublickeyshare) (TODO - complete description)
> 3. [blsSignMessageHash](#blssignmessagehash)
> 4. [createBLSPrivateKey](#createblsprivatekey) (TODO - complete & test)
> 4. [deleteBlsKey](#deleteblskey)
> 5. [popProve](#popprove) (TODO - add description & parameter description)
> 6. [deleteBlsKey](#deleteblskey)
> ##### 3) DKG calls
> 1. [generateDKGPoly](#generatedkgpoly)
> 2. [isPolyExists](#ispolyexists)
> ##### [4) Common Parameter Descriptions](#common-parameters-descriptions)
> ##### 4) Server calls
> 1. [getServerStatus](#getserverstatus)
> 2. [getServerVersion](#getserverversion)
> ##### [5) Common Parameter Descriptions](#common-parameters-descriptions)
> ---

Expand All @@ -28,12 +32,9 @@
> - calculateAllBLSPublicKeys
> - complaintResponse
> - multG2
> - getServerStatus
> - getServerVersion
> - generateBLSPrivateKey
> - createBLSPrivateKeyV2
> - getDecryptionShares
> - popProve
---

Expand Down Expand Up @@ -62,7 +63,7 @@ curl -X POST --data '{
| **Parameter** | **Type** | **Description** |
|---------------|------------|------------------------------------------|
| `PublicKey` | `String` | Public ECDSA key created |
| `keyName` | `String` | [See ECDSA Key Name](#2-ecdsa-ley-name) |
| `keyName` | `String` | [See ECDSA Key Name](#2-ecdsa-key-name) |
|`encryptedKey` | `String` | TODO |

#### Example Response
Expand Down Expand Up @@ -437,6 +438,55 @@ None
---


## `popProve`

#### Description
TODO

#### Request Parameters
| **Parameter** | **Type** | **Description** | **Example value** |
|---------------|------------|------------------------------------------|--------------|
| `blsKeyName`| `String` | [See BLS Key Name](#1-bls-key-name) | `BLS_KEY:SCHAIN_ID:0:NODE_ID:0:DKG_ID:4` |

#### Example Request
```bash
curl -X POST --data '{
"jsonrpc": "2.0",
"id": 1,
"method": "popProve",
"params": {
"blsKeyName":"BLS_KEY:SCHAIN_ID:0:NODE_ID:0:DKG_ID:4"
}
}' -H 'content-type:application/json;' -v --key ./sgx.key --cert ./sgx.crt https://127.0.0.1:1026 -k
```

#### Return Values
| **Parameter** | **Type** | **Description** |
|---------------|------------|------------------------------------------|
|`popProve` | `String` | TODO |

#### Example Response

```json
{
"id": 1,
"jsonrpc": "2.0",
"result":
{
"errorMessage": "",
"popProve": "7712004107626570830897885890446468859243922502105843477977107344257047197123:21825471235559662680802288068137317483581335125829352970956762476209081500057:12565777799784373616163068232947461672358328512399717157386114163224678064265:3",
"status": 0
}
}
```

---






## `deleteBlsKey`

#### Description
Expand Down Expand Up @@ -576,6 +626,92 @@ curl -X POST --data '{
---


# 4) Server Calls


## `getServerStatus`

#### Description
Returns the current server status.

#### Request Parameters
None

#### Example Request
```bash
curl -X POST --data '{
"jsonrpc": "2.0",
"id": 1,
"method": "getServerStatus",
"params": null
}' -H 'content-type:application/json;' -v --key ./sgx.key --cert ./sgx.crt https://127.0.0.1:1026 -k

```

#### Return Values
| **Parameter** | **Type** | **Description** |
|---------------|------------|------------------------------------------|
|`status` | `Int` | `0` if the server is good. If uknown error, the error is `10000 + line number`. |

#### Example Response

```json
{
"id": 1,
"jsonrpc": "2.0",
"result":
{
"errorMessage": "",
"status": 0
}
}
```

---


## `getServerVersion`

#### Description
Returns the current SgxWallet server version.

#### Request Parameters
None

#### Example Request
```bash
curl -X POST --data '{
"jsonrpc": "2.0",
"id": 1,
"method": "getServerVersion",
"params": null
}' -H 'content-type:application/json;' -v --key ./sgx.key --cert ./sgx.crt https://127.0.0.1:1026 -k

```

#### Return Values
| **Parameter** | **Type** | **Description** |
|---------------|------------|------------------------------------------|
|`version` | `Int` | `0` if the server is good. If uknown error, the error is `10000 + line number`. |

#### Example Response

```json
{
"id": 1,
"jsonrpc": "2.0",
"result":
{
"errorMessage": "",
"status": 0,
"version": "1.9.0"
}
}
```

---



# Common Parameters Descriptions

Expand Down

0 comments on commit a1a7069

Please sign in to comment.