Skip to content

Commit

Permalink
updated API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
IxiAngel committed Apr 1, 2024
1 parent 2b42e90 commit 1d1a4dd
Show file tree
Hide file tree
Showing 65 changed files with 1,163 additions and 358 deletions.
50 changes: 26 additions & 24 deletions _api_docs/core_add_transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Note: If using the `primaryAddress` parameter, the chosen address (public key) m
| primaryAddress | String | No | Specify if the node is using a wallet with multiple keypairs in order to select the keypair (public key) which will be used to sign the transaction. The chosen primary address must be a valid signer for all addresses listed in the `from` field. |
| fee | Number | No | Transaction fee, specified in IxiCash per kB. If no fee parameter is specified, the default (which is also the minimum) 0.00005 IxiCash per kB will be used. |
| autofee | Boolean | No | If specified, the system will automatically deduct the required fee from the first address given in `from`. This parameter is not required if you have included the appropriate fees somewhere in the `from` list, or are not specifying the `from` list at all. |
| wallet | String | No | Base58 Primary Wallet address in case multiple wallets are being used. |

### Output:
- success: transaction details are returned as a JSON object and the error field is set to null:
Expand All @@ -36,35 +37,36 @@ Note: If using the `primaryAddress` parameter, the chosen address (public key) m
| RPC_INVALID_PARAMS | Invalid `from` amounts, or invalid `to` amounts were specified. |
| RPC_VERIFY_ERROR | The transaction does not pass verification - this usually means that no usable `"from"` addresses were present, or there was something wrong with the signing key. |
| RPC_WALLET_INSUFFICIENT_FUNDS | Address or addresses specified have insufficient balance to be used for the transaction. |
| RPC_INTERNAL_ERROR | An unexpected error occured within the node. Please see the node log for details. |
| RPC_INTERNAL_ERROR | An unexpected error occurred within the node. Please see the node log for details. |

### Example:
GET http://localhost:8081/addtransaction?from=1JKZFqQs4yiH6Dq4bfom7xcpL6zG53DrjcY6HD9QJ6cRWmXdq_10000-1PC5kubyLvTmsf16CugqHpBG8B8PK4YjcfSjjLMqbUi8YvkQ_5000&to=153xXfVi1sznPcRqJur8tutgrZecNVYGSzetp47bQvRfNuDix_15000&autofee=true

```
{
"result": {
"id": "15-CoxywacZbqiK1sf84R6nuYyW32u5sDbTqD4VZgpeGChw",
"version": 2,
"blockHeight": "15",
"nonce": "47961",
"signature": "537b1..0c2ce2d7c2",
"pubKey": "1FUryQwQL5bs83yxnf5ywkkBDZjV6XezBz5BmMX5ioCRsRVmj",
"timeStamp": "1547587273",
"type": "0",
"amount": "1000.00000000",
"applied": "0",
"checksum": "0765a87d5393ad8742de1f8a9ce39f2ae1f1a5a6e7bafc066e454c1856661326",
"from": {
"1":"10000.00005000",
"2":"5000.00000000"
},
"to": {
"153xXfVi1sznPcRqJur8tutgrZecNVYGSzetp47bQvRfNuDix": "15000.00000000"
},
"fee": "0.00005000"
},
"error": null,
"id": null
"result": {
"id": "11-284bKK4GvGV9stfEGqu1CP4A9T3tTzrbkUsUd2JestPVE3KDPM5Um7sn3Dfv4",
"version": 7,
"blockHeight": "11",
"nonce": "313950",
"signature": "54b6315260a94dfec4...a166a16472040dae03",
"pubKey": "JHgSS7hbUNnYWsqz8m...wi5i2EPPWjtyTRYRN",
"timestamp": "1711936575",
"type": "0",
"amount": "515000.00000000",
"applied": "0",
"checksum": "c81b2017498e7c838d1d2d960c80e2c18a102959680414dd37ef143bcc777d7796b171d873683f93425a91fd",
"from": {
"1": "515000.01000000"
},
"to": {
"153xXfVi1sznPcRqJur8tutgrZecNVYGSzetp47bQvRfNuDix": "15000.00000000",
"4L5vswa8yS9VKsZzDJ2ry9gWY7KQon5bkvhG1CUuepkwvcy1xQmLsHA9DPmCDbufr": "500000.00000000"
},
"fee": "0.01000000",
"totalAmount": "515000.01000000"
}
"error": null,
"id": null
}
```
34 changes: 34 additions & 0 deletions _api_docs/core_blacklist_peer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Blacklist Peer
type: core
---
## Blacklist Peer
Blacklists peer.

### Method: `blacklistPeer`
### Input parameters:

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| host | String | No | Host address to blacklist. |
| wallet | String | No | Base58 Wallet address of host to blacklist. |


### Errors:

| Error | Description |
| --- | --- |
| RPC_INTERNAL_ERROR | An unknown error occurred in the node. Please check the node log for details. |

### Output:
- a JSON object with "OK" in result field on success.

### Example:
GET http://localhost:8081/blacklistPeer
```
{
"result": "OK",
"error": null,
"id": null
}
```
2 changes: 1 addition & 1 deletion _api_docs/core_block_height.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ None

| Error | Description |
| --- | --- |
| RPC_INTERNAL_ERROR | An unknown error occured in the node. Please check the node log for details. |
| RPC_INTERNAL_ERROR | An unknown error occurred in the node. Please check the node log for details. |

### Output:
- success: number of Ixian blocks since the Genesis block
Expand Down
5 changes: 3 additions & 2 deletions _api_docs/core_calculate_transaction_fee.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Note: If using the `primaryAddress` parameter, the chosen address (public key) m
| from | String | No | List of Base58 encoded sending addresses with their amounts. Amounts are separated by '_' character. Addresses are separated by '-' character (i.e. address1_amount1-address2_amount2). All addresses must belong to the same private key. If no from parameter is specified, it will be automatically generated, where the addresses with least IxiCash will be spent first. |
| primaryAddress | String | No | Specify if the node is using a wallet with multiple keypairs in order to select the keypair (public key) which will be used to sign the transaction. The chosen primary address must be a valid signer for all addresses listed in the `from` field. |
| fee | Number | No | Transaction fee, specified in IxiCash per kB. If no fee parameter is specified, the default (which is also the minimum) 0.00005 IxiCash per kB will be used. |
| wallet | String | No | Base58 Primary Wallet address in case multiple wallets are being used. |

### Output:
- success: required total transaction fee is calculated and returned as a number in result.
Expand All @@ -32,8 +33,8 @@ Note: If using the `primaryAddress` parameter, the chosen address (public key) m
| RPC_INVALID_PARAMS | Invalid `from` amounts, or invalid `to` amounts were specified. |
| RPC_VERIFY_ERROR | The transaction does not pass verification - this usually means that no usable `from` addresses were present, or there was something wrong with the signing key. |
| RPC_WALLET_INSUFFICIENT_FUNDS | Address or addresses specified have insufficient balance to be used for the transaction. |
| RPC_TRANSACTION_ERROR | An error occured while adding the transaction, check the message and log file for details. |
| RPC_INTERNAL_ERROR | An unexpected error occured within the node. Please see the node log for details. |
| RPC_TRANSACTION_ERROR | An error occurred while adding the transaction, check the message and log file for details. |
| RPC_INTERNAL_ERROR | An unexpected error occurred within the node. Please see the node log for details. |

### Example:
GET http://localhost:8081/calculatetransactionfee?from=1JKZFqQs4yiH6Dq4bfom7xcpL6zG53DrjcY6HD9QJ6cRWmXdq_10000-1PC5kubyLvTmsf16CugqHpBG8B8PK4YjcfSjjLMqbUi8YvkQ_5000&to=153xXfVi1sznPcRqJur8tutgrZecNVYGSzetp47bQvRfNuDix_15000
Expand Down
29 changes: 29 additions & 0 deletions _api_docs/core_clear_peer_blacklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Clear Peer Blacklist
type: core
---
## Clear Peer Blacklist
Clears peer blacklist.

### Method: `clearPeerBlacklist`
### Input parameters:
None.

### Errors:

| Error | Description |
| --- | --- |
| RPC_INTERNAL_ERROR | An unknown error occurred in the node. Please check the node log for details. |

### Output:
- a JSON object with "OK" in result field on success.

### Example:
GET http://localhost:8081/clearPeerBlacklist
```
{
"result": "OK",
"error": null,
"id": null
}
```
2 changes: 1 addition & 1 deletion _api_docs/core_clients.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ None

| Error | Description |
| --- | --- |
| RPC_INTERNAL_ERROR | An unknown error occured in the node. Please check the node log for details. |
| RPC_INTERNAL_ERROR | An unknown error occurred in the node. Please check the node log for details. |

### Output:
- success: list of clients JSON-encoded in the result field with the error field set to null
Expand Down
2 changes: 1 addition & 1 deletion _api_docs/core_connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Note: The `to` parameter must include both a host address and a port. The host a
| Error | Description |
| --- | --- |
| RPC_INVALID_PARAMS | The required parameter `"to"` was not supplied. |
| RPC_INTERNAL_ERROR | An unknown error occured in the node. Please check the node log for details. |
| RPC_INTERNAL_ERROR | An unknown error occurred in the node. Please check the node log for details. |

### Output:
- a JSON object containinly only the string "Connecting to node `to`" as the result.
Expand Down
5 changes: 3 additions & 2 deletions _api_docs/core_create_raw_transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Note: If using the `primaryAddress` parameter, the chosen address (public key) m
| primaryAddress | String | No | Specify if the node is using a wallet with multiple keypairs in order to select the keypair (public key) which will be used to sign the transaction. The chosen primary address must be a valid signer for all addresses listed in the `from` field. |
| fee | Number | No | Transaction fee, specified in IxiCash per kB. If no fee parameter is specified, the default (which is also the minimum) 0.00005 IxiCash per kB will be used. |
| autofee | Boolean | No | If specified, the system will automatically deduct the required fee from the first address given in `from`. This parameter is not required if you have included the appropriate fees somewhere in the `from` list, or are not specifying the `from` list at all. |
| wallet | String | No | Base58 Primary Wallet address in case multiple wallets are being used. |
| json | Boolean | No | If specified, the transaction will be returned as a JSON transaction object and not encoded as a hexstring. |

### Output:
Expand All @@ -36,8 +37,8 @@ Note: If using the `primaryAddress` parameter, the chosen address (public key) m
| RPC_INVALID_PARAMS | Invalid `from` amounts, or invalid `to` amounts were specified. |
| RPC_VERIFY_ERROR | The transaction does not pass verification - this usually means that no usable `from` addresses were present, or there was something wrong with the signing key. |
| RPC_WALLET_INSUFFICIENT_FUNDS | Address or addresses specified have insufficient balance to be used for the transaction. |
| RPC_TRANSACTION_ERROR | An error occured while adding the transaction, check the message and log file for details. |
| RPC_INTERNAL_ERROR | An unexpected error occured within the node. Please see the node log for details. |
| RPC_TRANSACTION_ERROR | An error occurred while adding the transaction, check the message and log file for details. |
| RPC_INTERNAL_ERROR | An unexpected error occurred within the node. Please see the node log for details. |

### Example:
GET http://localhost:8081/createrawtransaction?from=1JKZFqQs4yiH6Dq4bfom7xcpL6zG53DrjcY6HD9QJ6cRWmXdq_10000-1PC5kubyLvTmsf16CugqHpBG8B8PK4YjcfSjjLMqbUi8YvkQ_5000&to=153xXfVi1sznPcRqJur8tutgrZecNVYGSzetp47bQvRfNuDix_15000
Expand Down
53 changes: 53 additions & 0 deletions _api_docs/core_extend_name.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: Extend Name Registration
type: core
---
## Extend Name Registration
Extend name registration for a specified amount of time.
### Method: `extendName`
### Input parameters:

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| name | String | Yes | Name to be registered. |
| extensionTime | Number | Yes | Time in block to extend the name for. |

### Errors:

| Error | Description |
| --- | --- |
| RPC_INTERNAL_ERROR | An unknown error occurred in the node. Please check the node log for details. |

### Output:
- a JSON object with the transaction in result field, which extends a name.

### Example:
GET http://localhost:8081/extendname?name=test&extensionTime=864000
```
{
"result": {
"id": "446-iSQxh1KZf5bHADpfg9rFnBQWJksF8jtNbQEGMkvR92rskETRK46cvov29Rko",
"version": 7,
"blockHeight": "446",
"nonce": "93785",
"signature": "5155031ee73...13e3f077009811",
"pubKey": "JHgSS7hbUN...Ywi5i2EPPWjtyTRYRN",
"data": "0341409...02f0d00",
"timestamp": "1711931901",
"type": "4",
"amount": "50000.00000000",
"applied": "0",
"checksum": "7f72ba1ae8b47b3efb5283fbef7256d861d9e8c2fbdf436faedb4042769991500f41ab8b066dd159a4fcaabc",
"from": {
"1": "50000.01000000"
},
"to": {
"125D6XDzTZzQUWsyQZmQZmQZmQZmQZmQZmQZmQZmQZmQb8t25": "50000.00000000"
},
"fee": "0.01000000",
"totalAmount": "50000.01000000"
},
"error": null,
"id": null
}
```
3 changes: 2 additions & 1 deletion _api_docs/core_generate_new_address.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ Note: The required 'nonce' value used to generate a new address is determined au
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| address | String | No | Primary address (key pair) which will be used to generate a new address. |
| wallet | String | No | Base58 Primary Wallet address in case multiple wallets are being used. |


### Errors:

| Error | Description |
| --- | --- |
| RPC_INTERNAL_ERROR | An unknown error occured in the node. Please check the node log for details. |
| RPC_INTERNAL_ERROR | An unknown error occurred in the node. Please check the node log for details. |

### Output:
- success: new address in the result field with the error field set to null
Expand Down
40 changes: 21 additions & 19 deletions _api_docs/core_get_activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Retrieves the activity for the currently loaded wallet with optional filtering o
| type | Number | No | Type of the activity to fetch as a number. See below. |
| orderBy | String | No | Ordering method of requested data. Can be "insertedTimestamp", "timestamp" or "blockheight". Default is "insertedTimestamp". |
| descending | Boolean | No | Ordering direction of requested data, set to "true" for descending order. Default is ascending order. |
| wallet | String | No | Base58 Primary Wallet address in case multiple wallets are being used. |

### Activity Types

Expand All @@ -34,31 +35,32 @@ Retrieves the activity for the currently loaded wallet with optional filtering o

| Error | Description |
| --- | --- |
| RPC_INTERNAL_ERROR | An unknown error occured in the node. Please check the node log for details. |
| RPC_INTERNAL_ERROR | An unknown error occurred in the node. Please check the node log for details. |


### Example:
GET http://localhost:8081/activity

```
{
"result": [
{
"seedHash": "Ac2g5Zh...TMg3p6v",
"wallet": "4qX7Uo...y5V4mHg",
"from": "1ixianinfinimine234234234234234234234234234242HP",
"toList": "||4ixR19HcrGcB...ECc=",
"type": 201,
"data": "c3RrLTIwLTI1...N3Q=",
"value": "0.09990100",
"timestamp": 1562596905,
"status": 2,
"blockHeight": 26,
"txid": "stk-20-25-2EAa...bysa7t",
"id": "Voaz...ftiPk"
}
]
"error": null,
"id": null
"result": [
{
"seedHash": "Ab7Bkj6gj6Bm5WukZVeptezz2oLEhLcBDXehZQ583aEuTdb+n78AQzGqRqZFYZkO",
"wallet": "4iMKArchGjmLsZFsj2tYrBgPjjypvEwquB2pnbEvYAyihSeEi1FN5XBsWru2iKDXK",
"from": "1ixianinfinimine234234234234234234234234234242HP",
"toList": "||4iMKArchGjmLsZFsj2tYrBgPjjypvEwquB2pnbEvYAyihSeEi1FN5XBsWru2iKDXK:/tkU||5DY8ZF2Y1xbB2n7V7c3z8pcAoLAsScAVAiZdcnqBPbLuGHiq9RWamn83hautJvEoy:ZEwj||4C62hPSVNHTXe4aMtgoFYZ3KVCNXmkCr7MmJRprWukvtUSWTsMsm6UaPLqmiVtnh1:7tI/||4L5vswa8yS9VKsZzDJ2ry9gWY7KQon5bkvhG1CUuepkwvcy1xQmLsHA9DPmCDbufr:mDW5AA==",
"type": 201,
"data": "APyudjHAmnhQfZitq5BY8vgA1PboOXgm10RmMaeGWaHiltRiQdXyrWoA4pE9OKTq",
"value": "0.01366526",
"timestamp": 1709254781,
"status": 2,
"blockHeight": 30383,
"txid": "stk-30377-30382-HBEF6nRAb4qudWecJQnopZCfseUGYXp2KKVvpcbCNYZSAmqCTw4cpcqN7aN5",
"id": "EvniSJUZje4PU46HAqybNoQpZ8mKrpUULcY6oniijR3XehRovo9TSw2fBBMG"
},
...
],
"error": null,
"id": null
}
```
62 changes: 62 additions & 0 deletions _api_docs/core_get_presence.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
title: Get Presence
type: core
---
## Get Presence
Returns presence information of the specified wallet.
### Method: `getPresence`
### Input parameters:

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| wallet | String | No | Base58 Primary Wallet address. |


### Errors:

| Error | Description |
| --- | --- |
| RPC_INTERNAL_ERROR | An unknown error occurred in the node. Please check the node log for details. |

### Output:
- a JSON object with the wallet bytes encoded as a hexadecimal string.

### Example:
GET http://localhost:8081/getPresence?wallet=4iMKArchGjmLsZFsj2tYrBgPjjypvEwquB2pnbEvYAyihSeEi1FN5XBsWru2iKDXK
```
{
"result": {
"version": 1,
"wallet": {
"version": 1,
"addressWithChecksum": "Ab7Bkj6gj6Bm5WukZVeptezz2oLEhLcBDXehZQ583aEuTdb+n78AQzGqRqZFYZkO",
"addressNoChecksum": "Ab7Bkj6gj6Bm5WukZVeptezz2oLEhLcBDXehZQ583aEuTdb+n78AQzGqRqZF",
"nonce": null,
"pubKey": null
},
"pubkey": "AQAAAAAAAgAA7Gd0ZN...Wdu7w/us52kDAAAAAQAB",
"metadata": null,
"addresses": [
{
"version": 2,
"device": "aSKhScV0tkOaIq0IjNZyWw==",
"address": "10.23.11.2:10000",
"type": "M",
"nodeVersion": "xdc-0.9.2a",
"lastSeenTime": 1711928565,
"signature": "ynRhobTOXAMys...M5YmAZxzeNF30vLQudLCY="
}
],
"powSolution": {
"blockNum": 271,
"solution": "z6qt1qRGHMwi2w+dX+gWnPHtIJhM4rmDlBqjQ7VjNuiRUzD2OxcHRs6oVzSjSSbEg2LuQghDGUfAPrZ08M8/DA==",
"signingPubKey": "AgAAAAAAAQAAlpmt...AqfHk5HQMAAAABAAE=",
"checksum": "4eNPs8p1lda/BsCCfCeUy9EVs1bZrP9RgH+zWAWSZuF02obk/XhhSHGQRNJVmqs0/mGkqyucT19gIRXCJAAAAA==",
"difficulty": "116843993.98621778",
"bits": 3901456573219758000
}
},
"error": null,
"id": null
}
```
Loading

0 comments on commit 1d1a4dd

Please sign in to comment.