Network
#
Currency networks listReturns all registered currency networks with high-level information.
#
Request#
Example Request#
ResponseAttribute | Type | JSON Type | Description |
---|---|---|---|
name | string | string | Full name of the currency network |
abbreviation | string | string | Abbreviated name of currency network |
address | address | string - hex-encoded prefixed with "0x" | Contract address of currency network |
#
Example Response#
Currency network detailsReturns detailed information of currency network.
#
Request#
URL ParametersName | Type | Required | Description |
---|---|---|---|
networkAddress | string prefixed with "0x" | YES | Address of currency network |
#
Example Request#
ResponseAttribute | Type | JSON Type | Description |
---|---|---|---|
abbreviation | string | string | Abbreviated name of currency network |
address | address | string - hex-encoded prefixed with "0x" | Contract address of currency network |
decimals | int | number | Decimals specified in currency network |
name | string | string | Full name of the currency network |
numUsers | int | number | Total number of users in currency network |
defaultInterestRate | BigInteger | string | The default interest rate for every user in the network |
interestRateDecimals | int | number | Decimals of the interest rate |
customInterests | bool | bool | Whether custom interest rate can be set by users |
preventMediatorInterests | bool | bool | Whether to prevent mediators from paying interest |
isFrozen | bool | bool | Whether the currency network is frozen |
#
Example Response#
Users list in currency networkReturns a list of user addresses in a currency network.
#
Request#
URL ParametersName | Type | Required | Description |
---|---|---|---|
networkAddress | string | YES | Address of currency network |
#
Example Request#
Responsestring[]
- Array with addresses of users in currency network
#
Example Response#
Trustlines list in currency networkReturns a list of all trustlines in a currency network.
#
Request#
URL ParametersName | Type | Required | Description |
---|---|---|---|
networkAddress | string | YES | Address of currency network |
#
Example Request#
ResponseA list of trustlines with the following attributes:
Attribute | Type | Description |
---|---|---|
counterParty | string | Address of trustline counterparty |
currencyNetwork | string | Address of currency network |
user | string | Address of trustline user |
balance | string | Balance of trustline from point of view of user |
given | string | Creditline given to counterparty |
received | string | Creditline received by counterparty |
leftGiven | string | given - balance |
leftReceived | string | received + balance |
interestRateGiven | string | Interest Rate given to counterparty |
interestRateReceived | string | Interest Rate received from counterparty |
isFrozen | bool | Whether the trustlines is frozen |
id | string | Identifier of trustline |
#
Example Response#
User details in currency networkReturns detailed information of a user in a currency network.
#
Request#
URL ParametersName | Type | Required | Description |
---|---|---|---|
networkAddress | string | YES | Address of currency network |
userAddress | string | YES | Address of user |
#
Example Request#
ResponseAttribute | Type | JSON Type | Description |
---|---|---|---|
balance | BigInteger | string | Sum over balances of all non-frozen trustlines user has in currency network |
frozenBalance | BigInteger | string | Sum over balances of all frozen trustlines user has in currency network |
given | BigInteger | string | Sum of all creditlines given by user in currency network |
received | BigInteger | string | Sum of all creditlines received by user in currency network |
leftGiven | BigInteger | string | given - balance |
leftReceived | BigInteger | string | received + balance |
#
Example Response#
Trustlines of user in currency networkReturns a list of trustlines a user has in a currency network.
#
Request#
URL ParametersName | Type | Required | Description |
---|---|---|---|
networkAddress | string | YES | Address of currency network |
userAddress | string | YES | Address of user |
#
Example Request#
ResponseAttribute | Type | Description |
---|---|---|
counterParty | string | Address of trustline counterparty |
currencyNetwork | string | Address of currency network |
user | string | Address of trustline user |
balance | string | Balance of trustline from point of view of user |
given | string | Creditline given to counterparty |
received | string | Creditline received by counterparty |
leftGiven | string | given - balance |
leftReceived | string | received + balance |
interestRateGiven | string | Interest Rate given to counterparty |
interestRateReceived | string | Interest Rate received from counterparty |
isFrozen | bool | Whether the trustlines is frozen |
id | string | Identifier of trustline |
#
Example Response#
Trustline between users in currency networkReturns a trustline between users A and B in a currency network.
#
Request#
URL ParametersName | Type | Required | Description |
---|---|---|---|
networkAddress | string | YES | Address of currency network |
userAddressA | string | YES | Address of user A |
userAddressB | string | YES | Address of user B |
#
Example Request#
ResponseAttribute | Type | Description |
---|---|---|
counterParty | string | Address of trustline counterparty |
user | string | Address of trustline user |
balance | string | Balance of trustline from point of view of user (A) |
given | string | Creditline given to counterparty |
received | string | Creditline received by counterparty |
leftGiven | string | given - balance |
leftReceived | string | received + balance |
interestRateGiven | string | Interest Rate given to counterparty |
interestRateReceived | string | Interest Rate received from counterparty |
isFrozen | bool | Whether the trustline is forzen |
id | string | Identifier of trustline |
#
Example Response#
Spendable amount and path to any user in currency networkReturns an estimation on the amount user A can spend to any reachable user B in a currency network.
#
Request#
URL ParametersName | Type | Required | Description |
---|---|---|---|
networkAddress | string | YES | Address of currency network |
#
Data ParametersName | Type | Required | Description |
---|---|---|---|
from | string | YES | Address of user who sends transfer |
to | string | YES | Address of user who receives transfer |
maxHops | string | NO | Upper bound for hops in transfer path |
#
Example Request#
ResponseAttribute | Type | Description |
---|---|---|
capacity | string | Estimated capacity of estimated max capacity path |
path | string[] | Addresses of users on max capacity path |
#
Example Response#
Transfer path in currency networkReturns the cheapest path and maximal fees for a transfer.
#
Request#
URL ParametersName | Type | Required | Description |
---|---|---|---|
networkAddress | string | YES | Address of currency network |
#
Data ParametersName | Type | Required | Description |
---|---|---|---|
from | string | YES | Address of user who sends transfer |
to | string | YES | Address of user who receives transfer |
value | string | YES | Transfer amount in smallest unit |
maxFees | string | NO | Upper bound for transfer fees |
maxHops | string | NO | Upper bound for hops in transfer path |
feePayer | string | NO | Either sender or receiver |
#
Example Request#
ResponseAttribute | Type | Description |
---|---|---|
path | string[] | Addresses of users on transfer path |
value | int | Transfer amount in smallest unit |
feePayer | string | Either sender or receiver |
fees | string | Maximal transfer fees |
#
Example Response#
Closing trustline path in currency networkThis endpoint is used in preparation for closing a trustline. It returns the cheapest path, the fees and a value for a payment, which reduces the balance to zero. At the moment this only works for negative balances.
#
Request#
URL ParametersName | Type | Required | Description |
---|---|---|---|
networkAddress | string | YES | Address of currency network |
#
Data ParametersName | Type | Required | Description |
---|---|---|---|
from | string | YES | Address of user who wants to close a trustline |
to | string | YES | Address of user with whom the trustline should be closed |
maxFees | string | NO | Upper bound for transfer fees |
maxHops | string | NO | Upper bound for hops in transfer path |
#
Example Request#
ResponseAttribute | Type | Description |
---|---|---|
path | string[] | Addresses of users on transfer path |
fees | string | Estimated transfer fees |
value | string | Amount to be transferred in smallest unit |
feePayer | string | Either sender or receiver |
#
Example Response#
All events in currency networkReturns a list of event logs in a currency network.
#
Request#
URL ParametersName | Type | Required | Description |
---|---|---|---|
network | string | YES | Address of currency network |
type | string | NO | Either TrustlineUpdate , TrustlineUpdateRequest , TrustlineUpdateCancel or Transfer |
fromBlock | int | NO | Start of block range |
#
Example Request#
ResponseAttribute | Type | Description |
---|---|---|
networkAddress | string | Address of currency network |
blockNumber | string | Number of block |
timestamp | int | UNIX timestamp |
type | string | Either TrustlineUpdate , TrustlineUpdateRequest , TrustlineUpdateCancel or Transfer |
from | string | Address of from user |
to | string | Address of to user |
status | string | sent , pending or confirmed depending on block height |
transactionId | string | Transaction hash |
blockHash | string | Hash of the block containing the event |
logIndex | number | Log index of the event |
Following additional attributes for TrustlineUpdate
and TrustlineUpdateRequest
events:
Attribute | Type | Description |
---|---|---|
given | string | Proposed or accepted amount from -> to |
received | string | Proposed or accepted amount to -> from |
interestRateGiven | string | Proposed or accepted rate of interests from -> to |
interestRateReceived | string | Proposed or accepted rate of interests to -> from |
isFrozen | bool | Proposed or accepted frozen status |
Following additional attributes for Transfer
events:
Attribute | Type | Description |
---|---|---|
amount | string | Transfer amount from -> to |
extraData | string | extraData as specified in the corresponding transfer |
#
Example Response#
Events of a user in currency networkReturns a list of event logs of a user in a currency network. This means all events where the given user address is either from
or to
.
#
Request#
Example Request#
URL ParametersName | Type | Required | Description |
---|---|---|---|
network | string | YES | Address of currency network |
user | string | YES | Address of user |
type | string | NO | Either TrustlineUpdate , TrustlineUpdateRequest , TrustlineUpdateCancel or Transfer |
fromBlock | int | NO | Start of block range |
#
ResponseAttribute | Type | Description |
---|---|---|
networkAddress | string | Address of currency network |
blockNumber | string | Number of block |
timestamp | int | UNIX timestamp |
type | string | Either TrustlineUpdate , TrustlineUpdateRequest , TrustlineUpdateCancel or Transfer |
from | string | Address of from user |
to | string | Address of to user |
status | string | sent , pending or confirmed depending on block height |
transactionId | string | Transaction hash |
blockHash | string | Hash of the block containing the event |
logIndex | number | Log index of the event |
Following additional attributes for TrustlineUpdate
and TrustlineUpdateRequest
events:
Attribute | Type | Description |
---|---|---|
given | string | Proposed or accepted amount from -> to |
received | string | Proposed or accepted amount to -> from |
interestRateGiven | string | Proposed or accepted rate of interests from -> to |
interestRateReceived | string | Proposed or accepted rate of interests to -> from |
isFrozen | bool | Proposed or accepted frozen state |
Following additional attributes for Transfer
events:
Attribute | Type | Description |
---|---|---|
amount | string | Transfer amount from -> to |
extraData | string | extraData as specified in the corresponding transfer |
#
Example Response#
Events of a trustline in currency networkReturns a list of event logs of a trustline in a currency network from the view of user.
#
Request#
Example Request#
URL ParametersName | Type | Required | Description |
---|---|---|---|
network | string | YES | Address of currency network |
user | string | YES | Address of user, one address of the trustline |
counterParty | string | YES | Address of counterParty, other address of the trustline |
type | string | NO | Either TrustlineUpdate , TrustlineUpdateRequest , TrustlineUpdateCancel or BalanceUpdate |
fromBlock | int | NO | Start of block range |
#
ResponseAttribute | Type | Description |
---|---|---|
networkAddress | string | Address of currency network |
blockNumber | string | Number of block |
timestamp | int | UNIX timestamp |
type | string | Either TrustlineUpdate , TrustlineUpdateRequest , TrustlineUpdateCancel or BalanceUpdate |
from | string | Address of from user |
to | string | Address of to user |
status | string | sent , pending or confirmed depending on block height |
transactionId | string | Transaction hash |
Following additional attributes for TrustlineUpdate
and TrustlineUpdateRequest
events:
Attribute | Type | Description |
---|---|---|
given | string | Proposed or accepted amount from -> to |
received | string | Proposed or accepted amount to -> from |
interestRateGiven | string | Proposed or accepted rate of interests from -> to |
interestRateReceived | string | Proposed or accepted rate of interests to -> from |
isFrozen | bool | Proposed or accepted frozen state |
Following additional attributes for BalanceUpdate
:
Attribute | Type | Description |
---|---|---|
amount | string | New balance of trustline from view of from |
#
Example Response#
Accrued interests of userReturns a list of all accrued interests for user.
#
Request#
Example Request#
URL ParametersName | Type | Required | Description |
---|---|---|---|
network | string prefixed with "0x" | YES | Address of currency network |
user | string prefixed with "0x" | YES | Address of concerned user |
startTime | integer | NO | Start of time window to get list for (default: 0) |
endTime | integer | NO | End of time window to get list for (default: now) |
#
ResponseThe response is a list of objects with the following elements:
Attribute | Type | JSON Type | Description |
---|---|---|---|
accruedInterests | string | array | list of accrued interests |
user | address | string | Address of user |
counterparty | address | string | Address of counterparty |
The accuredInterests
is a list with the following elements:
Attribute | Type | JSON Type | Description |
---|---|---|---|
value | BigInteger | string | signed interest accrued viewed from user |
interestRate | integer | integer | interest rate for this accrued interest |
timestamp | integer | integer | timestamp of accrued interest |
#
Example Response#
Accrued interests of trustlineReturns a list of all accrued interests for a trustline in between user and counterparty as seen by user.
#
Request#
Example Request#
URL ParametersName | Type | Required | Description |
---|---|---|---|
network | string prefixed with "0x" | YES | Address of currency network |
user | string prefixed with "0x" | YES | Address of concerned user |
counterparty | string prefixed with "0x" | YES | Address of concerned counterparty |
startTime | integer | NO | Start of time window to get list for (default: 0) |
endTime | integer | NO | End of time window to get list for (default: now) |
#
ResponseThe response is a an objects with the following elements:
Attribute | Type | JSON Type | Description |
---|---|---|---|
accruedInterests | string | array | list of accrued interests |
user | address | string | Address of user |
counterparty | address | string | Address of counterparty |
The accuredInterests
is a list with the following elements:
Attribute | Type | JSON Type | Description |
---|---|---|---|
value | BigInteger | string | signed interest accrued viewed from user |
interestRate | integer | integer | interest rate for this accrued interest |
timestamp | integer | integer | timestamp of accrued interest |
#
Example Response#
Information for transfer in transactionReturns information about all trustline transfer applied by transaction with given hash or identified by block hash and log index.
#
RequestTo get transfer details via transaction hash:
To get transfer details via transfer id:
#
Data ParametersName | Type | Required | Description |
---|---|---|---|
transactionHash | string | No | Hash of transaction responsible for transfer |
blockHash | string | No | Hash of block identifying transfer event |
logIndex | number | No | Log index identifying transfer event |
#
Example RequestTo get transfer details via transaction hash:
To get transfer details via transfer id:
#
Total transferred sum in between users of currency networksReturns the total transferred sum from a user to another user in a currency network in a time window.
#
Request#
Example Request#
URL ParametersName | Type | Required | Description |
---|---|---|---|
network | string prefixed with "0x" | YES | Address of currency network |
sender | string prefixed with "0x" | YES | Address of sender of transfers |
receiver | string prefixed with "0x" | YES | Address of receiver of transfers |
startTime | integer | NO | Start of time window to get list for (default: 0) |
endTime | integer | NO | End of time window to get list for (default: now) |
#
ResponseThe response is a an objects with the following elements:
Attribute | Type | JSON Type | Description |
---|---|---|---|
sender | address | string | Address of sender of transfers |
receiver | address | string | Address of user |
startTime | timestamp | number | start of time window to fetch transfers |
endTime | timestamp | number | end of time window to fetch transfers |
value | BigInteger | string | Total value sent in between users |