diff --git a/.gitbook/assets/image-1-.png b/.gitbook/assets/image (1) (1).png similarity index 100% rename from .gitbook/assets/image-1-.png rename to .gitbook/assets/image (1) (1).png diff --git a/.gitbook/assets/image-4-.png b/.gitbook/assets/image (4) (1).png similarity index 100% rename from .gitbook/assets/image-4-.png rename to .gitbook/assets/image (4) (1).png diff --git a/.gitbook/assets/image-3-.png b/.gitbook/assets/image-3-.png deleted file mode 100644 index a8da8f7..0000000 Binary files a/.gitbook/assets/image-3-.png and /dev/null differ diff --git a/.gitbook/assets/image-5- (1).png b/.gitbook/assets/image-5- (1).png deleted file mode 100644 index b53aa19..0000000 Binary files a/.gitbook/assets/image-5- (1).png and /dev/null differ diff --git a/.gitbook/assets/image-5-.png b/.gitbook/assets/image-5-.png deleted file mode 100644 index b53aa19..0000000 Binary files a/.gitbook/assets/image-5-.png and /dev/null differ diff --git a/.gitbook/assets/new-cover_full-1- (1).png b/.gitbook/assets/new-cover_full (2).png similarity index 100% rename from .gitbook/assets/new-cover_full-1- (1).png rename to .gitbook/assets/new-cover_full (2).png diff --git a/.gitbook/assets/new-cover_full-1-.png b/.gitbook/assets/new-cover_full (3).png similarity index 100% rename from .gitbook/assets/new-cover_full-1-.png rename to .gitbook/assets/new-cover_full (3).png diff --git a/.gitbook/assets/new-cover_full (4).png b/.gitbook/assets/new-cover_full (4).png new file mode 100644 index 0000000..a40f3f5 Binary files /dev/null and b/.gitbook/assets/new-cover_full (4).png differ diff --git a/README.md b/README.md index 7d8d925..6bb5534 100644 --- a/README.md +++ b/README.md @@ -10,17 +10,15 @@ description: >- Hey! Glad to see you are interested in integrating with Zerion. We've built an [interface](https://app.zerion.io?utm_medium=docs&utm_source=docs&utm_campaign=api&utm_content=external&utm_term=web) that offers the easiest and simplest way for DeFi investors to manage their portfolio, and we're happy to share the tools that made that possible. Find some options below on how we can work together. If you need some inspiration, check out our [Featured Partners](featured-partners.md) section. -### Integrate Zerion API in your app +## Integrate Zerion API in your app -If you are looking to integrate Zerion's API into your dapp or application, head over to the [Websocket API](websockets/getting-started/) section. There, you will find examples of how to connect to Zerion and fetch information for Ethereum wallet addresses, protocols and tokens. +If you are looking to integrate Zerion's API into your dapp or application, head over to the [Websocket API](websockets/getting-started/) section. There, you will find examples of how to connect to Zerion and fetch information for Ethereum wallet addresses, protocols and tokens. {% page-ref page="websockets/getting-started/" %} -### Integrate your protocol to Zerion - -If you are looking to integrate your protocol to Zerion, navigate to the [DeFi SDK](defi-sdk/defi-sdk.md) section of this documentation. - -### Looking to get your token listed on Zerion? Submit your request [here](https://roadmap.zerion.io/b/token-requests/)! +## Integrate your protocol to Zerion +If you are looking to integrate your protocol to Zerion, navigate to the [DeFi SDK](defi-sdk/defi-sdk.md) section of this documentation. +## Looking to get your token listed on Zerion? Submit your request [here](https://roadmap.zerion.io/b/token-requests/)! diff --git a/defi-sdk/creating-your-adapters/README.md b/defi-sdk/creating-your-adapters/README.md index 7882123..f875982 100644 --- a/defi-sdk/creating-your-adapters/README.md +++ b/defi-sdk/creating-your-adapters/README.md @@ -1,20 +1,18 @@ # Creating your adapters -#### **Great to see that you want your protocol to be integrated with Zerion, and we would love to support you!** +### **Great to see that you want your protocol to be integrated with Zerion, and we would love to support you!** -The fastest way for Zerion app to support your protocol is to create a DeFi SDK adapter. There are two types of adapters in the [DeFi SDK](../defi-sdk.md): read-only adapters and interactive. +The fastest way for Zerion app to support your protocol is to create a DeFi SDK adapter. There are two types of adapters in the [DeFi SDK](../defi-sdk.md): read-only adapters and interactive. -### **Create a read-only adapter** +## **Create a read-only adapter** -Read-only adapters help Zerion track your protocol's data on-chain. By creating a read-only adapter, your protocol token and positions would be visible for all Zerion users. If you just need to integrate tracking of your protocol in Zerion, head over to the guide [here](read-only-adapters.md). +Read-only adapters help Zerion track your protocol's data on-chain. By creating a read-only adapter, your protocol token and positions would be visible for all Zerion users. If you just need to integrate tracking of your protocol in Zerion, head over to the guide [here](read-only-adapters.md). {% page-ref page="read-only-adapters.md" %} -### Create an interactive adapter +## Create an interactive adapter If you want to create a full support for your protocol in Zerion, you might want to create an interactive adapter for the DeFi SDK. Once you implement it and our team enables it on our side, Zerion users will be able to deposit and withdraw money from your protocol. Ready to get your protocol in front of all Zerion users? [Jump right in](interactive-adapters.md). {% page-ref page="interactive-adapters.md" %} - - diff --git a/defi-sdk/creating-your-adapters/interactive-adapters.md b/defi-sdk/creating-your-adapters/interactive-adapters.md index 4415ce7..e3b3521 100644 --- a/defi-sdk/creating-your-adapters/interactive-adapters.md +++ b/defi-sdk/creating-your-adapters/interactive-adapters.md @@ -16,10 +16,10 @@ To create new token adapter, one has to implement [**InteractiveAdapter**](https ```bash function deposit(TokenAmount[] calldata tokenAmounts, bytes calldata data) - external - payable - override - returns (address[] memory tokensToBeWithdrawn) + external + payable + override + returns (address[] memory tokensToBeWithdrawn) ``` `tokenAmounts` — tokens that will be used in the action \(e.g. DAI in case of deposit to Compound\). @@ -72,5 +72,3 @@ Use `npx prettier ./contracts/**/*.sol --write` to fix linter issues. Add tests for interactions it `test/` directory, use Uniswap, Weth, and other required adapters. - - diff --git a/defi-sdk/creating-your-adapters/read-only-adapters.md b/defi-sdk/creating-your-adapters/read-only-adapters.md index 51c969b..a06b67d 100644 --- a/defi-sdk/creating-your-adapters/read-only-adapters.md +++ b/defi-sdk/creating-your-adapters/read-only-adapters.md @@ -1,10 +1,10 @@ # Read-only adapters -### How to add your protocol to DeFi SDK +## How to add your protocol to DeFi SDK Once a protocol is added to **ProtocolAdapterRegistry** contract, it will immediately appear in all the interfaces that use DeFi SDK \(including Zerion\). In order to add protocol to to DeFi SDK one has to implement the following contracts. -#### `ProtocolAdapter` +### `ProtocolAdapter` ```text getBalance(address token, address account) returns (int256) @@ -12,7 +12,7 @@ getBalance(address token, address account) returns (int256) The function has two arguments of `address` type: the first one is token address and the second one is account address. The function MUST return balance of given asset held on the protocol for the given account. -#### `TokenAdapter` +### `TokenAdapter` To create new protocol adapter, one has to implement [TokenAdapter](https://github.com/zeriontech/defi-sdk/blob/master/contracts/adapters/TokenAdapter.sol) interface. @@ -37,11 +37,11 @@ The function has the only argument – token address. The function MUST return a After the adapters are deployed and tested, one can contact Zerion team in order to add the adapters to **AdapterRegistry** contract. -#### Tests +### Tests To get a PR merged, one should write tests for all the functions implemented. Examples may be found in the [repo](https://github.com/zeriontech/defi-sdk/tree/master/test). -#### Migrations scripts +### Migrations scripts In case ProtocolAdapter should work with the short list of tokens, these tokens should be added to the list of supported tokens in ProtocolAdapterRegistry contract. In order to do that, one should add tokens in PR's comments. diff --git a/defi-sdk/defi-sdk.md b/defi-sdk/defi-sdk.md index f8a8ccd..ff3de02 100644 --- a/defi-sdk/defi-sdk.md +++ b/defi-sdk/defi-sdk.md @@ -10,7 +10,7 @@ If you have any questions about DeFi SDK, feel free to reach out to us on our [D ![](../.gitbook/assets/twitter_final.png) -### Features +## Features **💥Query user assets and debt deposited in DeFi protocols like Maker, Aave, dYdX, etc.** @@ -22,5 +22,5 @@ If you have any questions about DeFi SDK, feel free to reach out to us on our [D **✨Interact with multiple DeFi protocols in a unified way** -> See [Router]() contract description. +> See [Router](defi-sdk.md) contract description. diff --git a/featured-partners.md b/featured-partners.md index 7f528b4..7dc25e0 100644 --- a/featured-partners.md +++ b/featured-partners.md @@ -6,13 +6,13 @@ description: Explore how other teams use Zerion's API to power their amazing app ## Rainbow Wallet -[Rainbow](https://rainbow.me/) leverages Zerion's [Websocket API](websockets/getting-started/) to power the most simple non-custodial Ethereum wallet. Rainbow was our very first integration partner, and they have been using Zerion for more than a year now. +[Rainbow](https://rainbow.me/) leverages Zerion's [Websocket API](websockets/getting-started/) to power the most simple non-custodial Ethereum wallet. Rainbow was our very first integration partner, and they have been using Zerion for more than a year now. ![](.gitbook/assets/image.png) -## Stake DAO +## Stake DAO -[Stake DAO](https://stakedao.org/) uses [Zerion's API](websockets/getting-started/) to focus on what they do best: automated investment strategies. +[Stake DAO](https://stakedao.org/) uses [Zerion's API](websockets/getting-started/) to focus on what they do best: automated investment strategies. ![](.gitbook/assets/image%20%284%29.png) @@ -24,11 +24,11 @@ description: Explore how other teams use Zerion's API to power their amazing app ## DeFi Market Cap -[DeFi Market Cap](https://defimarketcap.io/) features the top 100 DeFi tokens by market capitalization. It uses Zerion's [Websocket API](websockets/getting-started/) to fetch the prices and market capitalizations of DeFi assets in real-time. +[DeFi Market Cap](https://defimarketcap.io/) features the top 100 DeFi tokens by market capitalization. It uses Zerion's [Websocket API](websockets/getting-started/) to fetch the prices and market capitalizations of DeFi assets in real-time. ![](.gitbook/assets/image%20%283%29.png) -And many more, including: +And many more, including: * [https://open-orgs.info/](https://open-orgs.info/) * [https://mask.io/](https://mask.io/) diff --git a/websockets/enums.md b/websockets/enums.md index 98f4d22..85e6de4 100644 --- a/websockets/enums.md +++ b/websockets/enums.md @@ -1,171 +1,182 @@ +# Enums -## Structures -### AssetActionType - - "buy" - - "sell" - - "send" - - "receive" - - "borrow" - - "deposit" - - "authorize" - - "withdraw" - - "repay" - - "stake" - - "unstake" - - "claim" - -### TransactionAction - - "Authorize" - - "Trade" - - "Deposit" - - "Withdraw" - - "Borrow" - - "Repay" - - "Liquidate" - - "Enable Borrowing" - - "Open CDP" - - "Close CDP" - - "Transfer CDP" - - "Migrate CDP" - - "Open Trove" - - "Adjust Trove" - - "Close Trove" - - "Open Vault" - - "Close Vault" - - "Transfer Vault" - - "Migrate" - - "Create Exchange" - - "Add Liquidity" - - "Remove Liquidity" - - "Stake" - - "Unstake" - - "Claim Rewards" - - "Register ENS Domain" - - "Renew ENS Domain" - -### GasPriceSource - - "gas-now" - - "eth-gas-station" - -### AssetType - - "aave" - - "aave-uniswap" - - "aave-v2" - - "alpha-homora" - - "alpha-homora-v2" - - "badger-sett" - - "balancer" - - "bancor" - - "bitcoin" - - "bsc" - - "bsc-trash" - - "cream" - - "curve" - - "curve-metapool" - - "compound" - - "dmm" - - "dodo" - - "dodo-v2" - - "enzyme" - - "ethereum" - - "fei" - - "fulcrum" - - "harvest-vault" - - "idle" - - "iearn-curve" - - "iearn-v2" - - "iearn-v3" - - "indexed" - - "keeperdao" - - "maker" - - "melon" - - "mooniswap" - - "mstable" - - "mushroom-vault" - - "nft" - - "one-inch" - - "pickle-jar" - - "piedao-pool" - - "piedao-experipie" - - "polygon" - - "polygon-trash" - - "pool-together" - - "realt" - - "saddle" - - "snowswap" - - "stablecoin" - - "stake-dao" - - "synthetix" - - "sushi" - - "swerve" - - "tokenset" - - "tokenset-v2" - - "trash" - - "uniswap" - - "uniswap-v2" - - "xsushi" - - "yearn-vault" - - "yearn-vault-v2" - - "None" - -### CategoryDisplayType - - "short" - - "detailed" - -### MakerDSSActionType - - "open" - - "deposit" - - "withdraw" - - "borrow" - - "repay" - - "transfer" - - "liquidate" - -### PriceCurrency - - "eth" - - "btc" - - "usd" - - "eur" - - "krw" - - "rub" - - "gbp" - - "aud" - - "cad" - - "inr" - - "jpy" - - "nzd" - - "try" - - "zar" - - "cny" - - "chf" - -### Direction - - "in" - - "out" - - "self" - -### RDBTransactionType - - "send" - - "receive" - - "trade" - - "authorize" - - "execution" - - "deployment" - - "cancel" - - "deposit" - - "withdraw" - - "borrow" - - "repay" - - "stake" - - "unstake" - - "claim" - -### PortfolioFields - - "all" - - "assets" - -### TransactionStatus - - "confirmed" - - "failed" - - "pending" +## AssetActionType + +* "buy" +* "sell" +* "send" +* "receive" +* "borrow" +* "deposit" +* "authorize" +* "withdraw" +* "repay" +* "stake" +* "unstake" +* "claim" + +## TransactionAction + +* "Authorize" +* "Trade" +* "Deposit" +* "Withdraw" +* "Borrow" +* "Repay" +* "Liquidate" +* "Enable Borrowing" +* "Open CDP" +* "Close CDP" +* "Transfer CDP" +* "Migrate CDP" +* "Open Trove" +* "Adjust Trove" +* "Close Trove" +* "Open Vault" +* "Close Vault" +* "Transfer Vault" +* "Migrate" +* "Create Exchange" +* "Add Liquidity" +* "Remove Liquidity" +* "Stake" +* "Unstake" +* "Claim Rewards" +* "Register ENS Domain" +* "Renew ENS Domain" + +## GasPriceSource + +* "gas-now" +* "eth-gas-station" + +## AssetType + +* "aave" +* "aave-uniswap" +* "aave-v2" +* "alpha-homora" +* "alpha-homora-v2" +* "badger-sett" +* "balancer" +* "bancor" +* "bitcoin" +* "bsc" +* "bsc-trash" +* "cream" +* "curve" +* "curve-metapool" +* "compound" +* "dmm" +* "dodo" +* "dodo-v2" +* "enzyme" +* "ethereum" +* "fei" +* "fulcrum" +* "harvest-vault" +* "idle" +* "iearn-curve" +* "iearn-v2" +* "iearn-v3" +* "indexed" +* "keeperdao" +* "maker" +* "melon" +* "mooniswap" +* "mstable" +* "mushroom-vault" +* "nft" +* "one-inch" +* "pickle-jar" +* "piedao-pool" +* "piedao-experipie" +* "polygon" +* "polygon-trash" +* "pool-together" +* "realt" +* "saddle" +* "snowswap" +* "stablecoin" +* "stake-dao" +* "synthetix" +* "sushi" +* "swerve" +* "tokenset" +* "tokenset-v2" +* "trash" +* "uniswap" +* "uniswap-v2" +* "xsushi" +* "yearn-vault" +* "yearn-vault-v2" +* "None" + +## CategoryDisplayType + +* "short" +* "detailed" + +## MakerDSSActionType + +* "open" +* "deposit" +* "withdraw" +* "borrow" +* "repay" +* "transfer" +* "liquidate" + +## PriceCurrency + +* "eth" +* "btc" +* "usd" +* "eur" +* "krw" +* "rub" +* "gbp" +* "aud" +* "cad" +* "inr" +* "jpy" +* "nzd" +* "try" +* "zar" +* "cny" +* "chf" + +## Direction + +* "in" +* "out" +* "self" + +## RDBTransactionType + +* "send" +* "receive" +* "trade" +* "authorize" +* "execution" +* "deployment" +* "cancel" +* "deposit" +* "withdraw" +* "borrow" +* "repay" +* "stake" +* "unstake" +* "claim" + +## PortfolioFields + +* "all" +* "assets" + +## TransactionStatus + +* "confirmed" +* "failed" +* "pending" diff --git a/websockets/getting-started/README.md b/websockets/getting-started/README.md index 34a894c..79d04af 100644 --- a/websockets/getting-started/README.md +++ b/websockets/getting-started/README.md @@ -4,11 +4,9 @@ description: This section will help you get off the ground with integrating Zeri # Quick Start -![](../../.gitbook/assets/new-cover_full%20%281%29.png) +![](../../.gitbook/assets/new-cover_full%20%284%29.png) -Zerion uses WebSockets to power its API. You can use our API both on the backend, as well as on the client-side. First, you need to install the relevant dependencies, and then you will be ready to unleash the full power of our API. +Zerion uses WebSockets to power its API. You can use our API both on the backend, as well as on the client-side. First, you need to install the relevant dependencies, and then you will be ready to unleash the full power of our API. {% page-ref page="installation.md" %} - - diff --git a/websockets/getting-started/example.md b/websockets/getting-started/example.md index 15c2f3a..6fd62ee 100644 --- a/websockets/getting-started/example.md +++ b/websockets/getting-started/example.md @@ -8,7 +8,7 @@ The following example connects to the Zerion Websocket API and fetches the portf {% tabs %} {% tab title="JavaScript" %} -#### 1. Copy and paste the example below to `quickstart.js` +## 1. Copy and paste the example below to `quickstart.js` ```javascript let io = require('socket.io-client') @@ -68,10 +68,9 @@ get(addressSocket, { }).then(response => { console.log(response.payload.portfolio); }); - ``` -#### 2. Run it using `node` +## 2. Run it using `node` ```text node quickstart.js @@ -79,53 +78,128 @@ node quickstart.js {% endtab %} {% tab title="Python" %} -#### 1. Copy and paste the example below to `quickstart.py` +## 1. Copy and paste the example below to `quickstart.py` ```python import asyncio import socketio -URI = "wss://api-v4.zerion.io/" -API_TOKEN = "Demo.ukEVQp6L5vfgxcz4sBke7XvS873GMYHy" -ORIGIN = "http://localhost:3000" -sio = socketio.AsyncClient() -@sio.event -async def connect(): - print("Connected to the Zerion Websocket API!") +URI = 'wss://api-v4.zerion.io/' +API_TOKEN = 'Demo.ukEVQp6L5vfgxcz4sBke7XvS873GMYHy' +ORIGIN = 'http://localhost:3000' + +sio = socketio.AsyncClient(logger=False, engineio_logger=False) + +CONNECTED_TO_SOCKET = False + +ADDRESS_PORTFOLIO = None +ADDRESS_ASSETS = None +ADDRESS_DEPOSITS = None +ADDRESS_LOANS = None +ADDRESS_STAKED_ASSETS = None +ADDRESS_LOCKED_ASSETS = None + @sio.event(namespace='/address') async def connect(): - print("address namespace!") - await sio.emit('subscribe', - { - "scope": ["portfolio"], - "payload": { - "address": "0x7e5ce10826ee167de897d262fcc9976f609ecd2b", - "currency": "usd", - "portfolio_fields": "all" - } - }, namespace='/address') - - -@sio.event -def connect_error(): - print("The connection failed!") - - -async def main(): - await sio.connect(f"{URI}/?api_token={API_TOKEN}", - headers={"Origin": ORIGIN}, - namespaces=['/address'], - transports=['websocket']) + global CONNECTED_TO_SOCKET + print('Connected to /address namespace!') + CONNECTED_TO_SOCKET = True + - await sio.wait() +async def connect_to_socket(): + await sio.connect( + f'{URI}/?api_token={API_TOKEN}', + headers={'Origin': ORIGIN}, + namespaces=['/address'], + transports=['websocket'] + ) + + +@sio.on('received address portfolio', namespace='/address') +def received_address_portfolio(data): + global ADDRESS_PORTFOLIO + print('Address portfolio is received') + ADDRESS_PORTFOLIO = data['payload']['portfolio'] + +@sio.on('received address assets', namespace='/address') +def received_address_assets(data): + global ADDRESS_ASSETS + print('Address assets are received') + ADDRESS_ASSETS = data['payload']['assets'] + +@sio.on('received address deposits', namespace='/address') +def received_address_assets(data): + global ADDRESS_DEPOSITS + print('Address deposits are received') + ADDRESS_DEPOSITS = data['payload']['deposits'] + +@sio.on('received address loans', namespace='/address') +def received_address_assets(data): + global ADDRESS_LOANS + print('Address loans are received') + ADDRESS_LOANS = data['payload']['loans'] + +@sio.on('received address staked-assets', namespace='/address') +def received_address_assets(data): + global ADDRESS_STAKED_ASSETS + print('Address staked assets are received') + ADDRESS_STAKED_ASSETS = data['payload']['staked-assets'] + +@sio.on('received address locked-assets', namespace='/address') +def received_address_assets(data): + global ADDRESS_LOCKED_ASSETS + print('Address locked assets are received') + ADDRESS_LOCKED_ASSETS = data['payload']['locked-assets'] + +def results_ready() -> bool: + requested_entities = ( + ADDRESS_PORTFOLIO, ADDRESS_ASSETS, ADDRESS_DEPOSITS, + ADDRESS_LOANS, ADDRESS_STAKED_ASSETS, ADDRESS_LOCKED_ASSETS + ) + return not any(x is None for x in requested_entities) + +async def main(address: str): + # Initiate the connection with the websocket + await connect_to_socket() + + # Wait until the connection is established + while not CONNECTED_TO_SOCKET: + await asyncio.sleep(0) + + # Request address information + await sio.emit('subscribe', { + 'scope': ['portfolio', 'assets', 'deposits', 'loans', 'staked-assets', 'locked-assets'], + 'payload': { + 'address': address, + 'currency': 'usd', + 'portfolio_fields': 'all' + } + }, namespace='/address') + + # Wait until all information about the address is received + while not results_ready(): + await asyncio.sleep(0) + + print('------') + print( + f'Address {address} has:', + f' - {len(ADDRESS_ASSETS)} assets worth of ${ADDRESS_PORTFOLIO["assets_value"]}', + f' - {len(ADDRESS_DEPOSITS)} deposits worth of ${ADDRESS_PORTFOLIO["deposited_value"]}', + f' - {len(ADDRESS_LOANS)} loans worth of ${ADDRESS_PORTFOLIO["borrowed_value"]}', + f' - {len(ADDRESS_STAKED_ASSETS)} staked assets worth of ${ADDRESS_PORTFOLIO["staked_value"]}', + f' - {len(ADDRESS_LOCKED_ASSETS)} locked assets worth of ${ADDRESS_PORTFOLIO["locked_value"]}', + sep='\n', + ) if __name__ == '__main__': - asyncio.run(main()) + test_address = '0x7e5ce10826ee167de897d262fcc9976f609ecd2b' + loop = asyncio.get_event_loop() + loop.run_until_complete(main(test_address)) ``` -#### 2. Run it using `python` +## 2. Run it using `python` ```bash python3 quickstart.py @@ -133,5 +207,3 @@ python3 quickstart.py {% endtab %} {% endtabs %} - - diff --git a/websockets/getting-started/installation.md b/websockets/getting-started/installation.md index dc8149b..114f767 100644 --- a/websockets/getting-started/installation.md +++ b/websockets/getting-started/installation.md @@ -1,9 +1,9 @@ # Install -Before using the Zerion Websocket API, you need to install relevant dependencies. +Before using the Zerion Websocket API, you need to install relevant dependencies. {% hint style="warning" %} -Please make sure to use [Socket.io v2 client API](https://socket.io/docs/v2/client-api/). +Please make sure to use [Socket.io v2 client API](https://socket.io/docs/v2/client-api/). {% endhint %} {% tabs %} @@ -14,11 +14,9 @@ npm i socket.io-client@2.4.0 {% endtab %} {% tab title="Python" %} -``` +```text pip3 install python-socketio==4.6.1, aiohttp, asyncio ``` {% endtab %} {% endtabs %} - - diff --git a/websockets/models.md b/websockets/models.md index 47362ef..53da880 100644 --- a/websockets/models.md +++ b/websockets/models.md @@ -1,382 +1,468 @@ +# Return Types + +## AddressAsset + +| Name | Type | Optional | +| :--- | :--- | :--- | +| asset | [Asset](models.md#asset) | | +| quantity | str | | + +## AddressBSCAsset + +| Name | Type | Optional | +| :--- | :--- | :--- | +| asset | [CovalentAsset](models.md#covalentasset) | | +| quantity | str | | + +## AddressInfo + +| Name | Type | Optional | +| :--- | :--- | :--- | +| address | str | | +| type | str | | +| proxies | str | yes | +| cdps | int | yes | +| vaults | int | yes | +| aggregated\_at | int | yes | + +## AddressPolygonAsset + +| Name | Type | Optional | +| :--- | :--- | :--- | +| asset | [CovalentAsset](models.md#covalentasset) | | +| quantity | str | | + +## Asset + +| Name | Type | Optional | +| :--- | :--- | :--- | +| asset\_code | str | | +| name | str | | +| symbol | str | | +| decimals | int | | +| type | [AssetType](models.md#assettype) | | +| icon\_url | str | yes | +| price | [Price](models.md#price) | yes | +| is\_displayable | bool | | +| is\_verified | bool | | + +## AssetAction + +| Name | Type | Optional | +| :--- | :--- | :--- | +| id | str | | +| transaction\_hash | str | | +| type | [AssetActionType](models.md#assetactiontype) | | +| value | float | yes | +| quantity | str | | +| price | float | yes | +| datetime | int | | +| asset | [Asset](models.md#asset) | | +| status | [TransactionStatus](models.md#transactionstatus) | | +| direction | [Direction](models.md#direction) | | +| fee | [AssetActionFee](models.md#assetactionfee) | yes | + +## AssetActionAmount + +| Name | Type | Optional | +| :--- | :--- | :--- | +| base | float | | +| currency | float | yes | + +## AssetActionFee + +| Name | Type | Optional | +| :--- | :--- | :--- | +| quantity | str | | +| value | float | | + +## AssetComponent + +| Name | Type | Optional | +| :--- | :--- | :--- | +| asset | [Asset](models.md#asset) | | +| quantity | float | | +| share | float | | +| allocation | float | | + +## AssetDescription + +| Name | Type | Optional | +| :--- | :--- | :--- | +| asset\_code | str | | +| full | str | yes | + +## AssetFullInfo + +| Name | Type | Optional | +| :--- | :--- | :--- | +| asset | [Asset](models.md#asset) | | +| title | str | | +| stats | [AssetFullInfoStats](models.md#assetfullinfostats) | | +| components | str | yes | +| gradient\_color | str | yes | +| explore\_sections | int | yes | +| subtitle | str | yes | +| tagline | str | yes | +| market\_cap | float | yes | +| fully\_diluted\_valuation | float | yes | +| total\_supply | float | yes | +| circulating\_supply | float | yes | +| relative\_changes | str | yes | +| description | str | yes | +| relevant\_resources | [AssetRelevantResource](models.md#assetrelevantresource) | yes | +| tags | str | yes | +| is\_tradable | bool | | + +## AssetFullInfoStats + +| Name | Type | Optional | +| :--- | :--- | :--- | +| asset\_code | str | | +| year\_min | float | yes | +| year\_max | float | yes | +| volume\_24h | float | yes | + +## AssetInfo + +| Name | Type | Optional | +| :--- | :--- | :--- | +| asset | [Asset](models.md#asset) | | +| title | str | | +| gradient\_color | str | yes | +| explore\_sections | int | yes | +| subtitle | str | yes | +| tagline | str | yes | +| market\_cap | float | yes | +| total\_supply | float | yes | +| circulating\_supply | float | yes | +| relative\_changes | str | yes | +| tags | str | yes | + +## AssetRelevantResource + +| Name | Type | Optional | +| :--- | :--- | :--- | +| name | str | | +| url | str | | +| displayable\_name | str | yes | + +## AssetStats + +| Name | Type | Optional | +| :--- | :--- | :--- | +| total\_returned | float | yes | +| total\_returned\_net | float | yes | +| total\_returned\_change | float | yes | +| total\_fee\_spent | float | yes | +| avg\_buy\_price | float | yes | +| avg\_buy\_price\_net | float | yes | +| avg\_sell\_price | float | yes | +| avg\_sell\_price\_net | float | yes | + +## AssetTag + +| Name | Type | Optional | +| :--- | :--- | :--- | +| id | str | | + +## BlockLag + +| Name | Type | Optional | +| :--- | :--- | :--- | +| block\_lag | int | yes | + +## Category + +| Name | Type | Optional | +| :--- | :--- | :--- | +| id | str | | +| title | str | | +| tagline | str | | +| order\_by | str | yes | +| display\_type | [CategoryDisplayType](models.md#categorydisplaytype) | | + +## CompoundAction + +| Name | Type | Optional | +| :--- | :--- | :--- | +| id | str | | +| type | [TransactionAction](models.md#transactionaction) | | +| transaction\_hash | str | | +| status | [TransactionStatus](models.md#transactionstatus) | | +| ctoken | str | yes | +| ctoken\_value | float | yes | +| underlying\_value | float | yes | +| datetime | datetime | | + +## CompoundAsset + +| Name | Type | Optional | +| :--- | :--- | :--- | +| underlying | [Asset](models.md#asset) | | +| underlying\_eth\_price | float | | +| asset | [Asset](models.md#asset) | | +| borrow\_rate | float | yes | +| supply\_rate | float | yes | +| exchange\_rate | float | yes | + +## CompoundDeposit + +| Name | Type | Optional | +| :--- | :--- | :--- | +| asset | [CompoundAsset](models.md#compoundasset) | | +| deposited | float | | +| earned\_interest | float | | +| ctokens | int | | + +## CompoundInfo + +| Name | Type | Optional | +| :--- | :--- | :--- | +| loans | [CompoundLoan](models.md#compoundloan) | yes | +| deposits | [CompoundDeposit](models.md#compounddeposit) | yes | +| total\_debt | float | | +| total\_collateral | float | | + +## CompoundLoan + +| Name | Type | Optional | +| :--- | :--- | :--- | +| asset | [CompoundAsset](models.md#compoundasset) | | +| borrowed | float | | +| accrued\_interest | float | | + +## CovalentAsset + +| Name | Type | Optional | +| :--- | :--- | :--- | +| asset\_code | str | | +| name | str | | +| symbol | str | | +| decimals | int | | +| icon\_url | str | yes | +| value | float | yes | + +## Deposit + +| Name | Type | Optional | +| :--- | :--- | :--- | +| id | str | | +| asset | [Asset](models.md#asset) | | +| deposited | float | | +| value | float | | +| supply\_rate | float | yes | +| section | str | | +| protocol | str | | +| displayed\_on\_chart | bool | | + +## DyDxAccountBalance + +| Name | Type | Optional | +| :--- | :--- | :--- | +| owner | str | | +| account\_number | str | | +| normalized\_balance | float | | +| balance | float | | +| asset | [Asset](models.md#asset) | | + +## ExploreSection + +| Name | Type | Optional | +| :--- | :--- | :--- | +| id | int | | +| title | str | | +| tagline | str | | +| order | int | | +| alias | str | yes | + +## GasPriceInfo + +| Name | Type | Optional | +| :--- | :--- | :--- | +| rapid | int | yes | +| fast | int | yes | +| standard | int | yes | +| slow | int | yes | +| source | [GasPriceSource](models.md#gaspricesource) | | +| datetime | datetime | | + +## LiquityTroveAction + +| Name | Type | Optional | +| :--- | :--- | :--- | +| id | str | | +| trove | int | | +| type | str | | +| transaction\_hash | str | | +| debt\_change | float | yes | +| collateral\_change | float | yes | +| datetime | datetime | | + +## Loan + +| Name | Type | Optional | +| :--- | :--- | :--- | +| id | str | | +| asset | [Asset](models.md#asset) | | +| borrowed | float | | +| value | float | | +| borrow\_rate | float | yes | +| section | str | | +| protocol | str | | +| displayed\_on\_chart | bool | | + +## LockedAsset + +| Name | Type | Optional | +| :--- | :--- | :--- | +| id | str | | +| asset | [Asset](models.md#asset) | | +| locked | float | | +| value | float | | +| section | str | | +| protocol | str | | +| displayed\_on\_chart | bool | | + +## MakerCDP + +| Name | Type | Optional | +| :--- | :--- | :--- | +| id | int | | +| owner | str | | +| debt | float | | +| collateral | float | | + +## MakerCDPAction + +| Name | Type | Optional | +| :--- | :--- | :--- | +| type | str | | +| transaction | str | | +| timestamp | int | | +| dai\_value | float | yes | +| eth\_value | float | yes | +| peth\_value | float | yes | +| owner | str | yes | +| new\_owner | str | yes | + +## MakerVault + +| Name | Type | Optional | +| :--- | :--- | :--- | +| id | int | | +| owner | str | | +| normalized\_debt | float | | +| outstanding\_debt | float | | +| total\_borrowed | float | | +| total\_repaid | float | | +| accrued\_interest | float | | +| collateral | float | | +| collateral\_type | str | | + +## MakerVaultAction + +| Name | Type | Optional | +| :--- | :--- | :--- | +| id | str | | +| vault | int | | +| type | [MakerDSSActionType](models.md#makerdssactiontype) | | +| transaction\_hash | str | | +| normalized\_debt\_change | float | yes | +| debt\_change | float | yes | +| collateral\_change | float | yes | +| owner | str | yes | +| new\_owner | str | yes | +| datetime | datetime | | + +## Portfolio + +| Name | Type | Optional | +| :--- | :--- | :--- | +| assets\_value | float | | +| deposited\_value | float | | +| borrowed\_value | float | | +| locked\_value | float | | +| staked\_value | float | | +| bsc\_assets\_value | float | | +| polygon\_assets\_value | float | | +| total\_value | float | | +| absolute\_change\_24h | float | | +| relative\_change\_24h | float | yes | + +## Price + +| Name | Type | Optional | +| :--- | :--- | :--- | +| value | float | | +| relative\_change\_24h | float | yes | +| changed\_at | int | | + +## PriceStat + +| Name | Type | Optional | +| :--- | :--- | :--- | +| min | float | | +| max | float | | +| relative\_change | float | | + +## StakedAsset + +| Name | Type | Optional | +| :--- | :--- | :--- | +| id | str | | +| asset | [Asset](models.md#asset) | | +| staked | float | | +| value | float | | +| section | str | | +| protocol | str | | +| displayed\_on\_chart | bool | | + +## Tokenlist + +| Name | Type | Optional | +| :--- | :--- | :--- | +| id | str | | +| name | str | | +| icon\_url | str | | +| total\_tokens | int | | +| has\_asset\_code | bool | | + +## Transaction + +| Name | Type | Optional | +| :--- | :--- | :--- | +| id | str | | +| type | [RDBTransactionType](models.md#rdbtransactiontype) | | +| protocol | str | | +| mined\_at | int | | +| block\_number | int | | +| status | [TransactionStatus](models.md#transactionstatus) | | +| hash | str | | +| direction | [Direction](models.md#direction) | yes | +| address\_from | str | yes | +| address\_to | str | yes | +| contract | str | yes | +| nonce | int | yes | +| changes | [TransactionChange](models.md#transactionchange) | yes | +| fee | [TransactionFee](models.md#transactionfee) | yes | +| meta | str | yes | + +## TransactionChange + +| Name | Type | Optional | +| :--- | :--- | :--- | +| asset | [Asset](models.md#asset) | | +| value | int | | +| direction | [Direction](models.md#direction) | | +| address\_from | str | | +| address\_to | str | | +| price | float | yes | + +## TransactionFee + +| Name | Type | Optional | +| :--- | :--- | :--- | +| value | int | | +| price | float | | -## Models -### AddressAsset -| Name | Type | Optional | -| --- | --- | -------- | - | asset | [Asset](#asset) | | - | quantity | str | | -### AddressBSCAsset -| Name | Type | Optional | -| --- | --- | -------- | - | asset | [CovalentAsset](#covalentasset) | | - | quantity | str | | -### AddressInfo -| Name | Type | Optional | -| --- | --- | -------- | - | address | str | | - | type | str | | - | proxies | str | yes | - | cdps | int | yes | - | vaults | int | yes | - | aggregated_at | int | yes | -### AddressPolygonAsset -| Name | Type | Optional | -| --- | --- | -------- | - | asset | [CovalentAsset](#covalentasset) | | - | quantity | str | | -### Asset -| Name | Type | Optional | -| --- | --- | -------- | - | asset_code | str | | - | name | str | | - | symbol | str | | - | decimals | int | | - | type | [AssetType](#assettype) | | - | icon_url | str | yes | - | price | [Price](#price) | yes | - | is_displayable | bool | | - | is_verified | bool | | -### AssetAction -| Name | Type | Optional | -| --- | --- | -------- | - | id | str | | - | transaction_hash | str | | - | type | [AssetActionType](#assetactiontype) | | - | value | float | yes | - | quantity | str | | - | price | float | yes | - | datetime | int | | - | asset | [Asset](#asset) | | - | status | [TransactionStatus](#transactionstatus) | | - | direction | [Direction](#direction) | | - | fee | [AssetActionFee](#assetactionfee) | yes | -### AssetActionAmount -| Name | Type | Optional | -| --- | --- | -------- | - | base | float | | - | currency | float | yes | -### AssetActionFee -| Name | Type | Optional | -| --- | --- | -------- | - | quantity | str | | - | value | float | | -### AssetComponent -| Name | Type | Optional | -| --- | --- | -------- | - | asset | [Asset](#asset) | | - | quantity | float | | - | share | float | | - | allocation | float | | -### AssetDescription -| Name | Type | Optional | -| --- | --- | -------- | - | asset_code | str | | - | full | str | yes | -### AssetFullInfo -| Name | Type | Optional | -| --- | --- | -------- | - | asset | [Asset](#asset) | | - | title | str | | - | stats | [AssetFullInfoStats](#assetfullinfostats) | | - | components | str | yes | - | gradient_color | str | yes | - | explore_sections | int | yes | - | subtitle | str | yes | - | tagline | str | yes | - | market_cap | float | yes | - | fully_diluted_valuation | float | yes | - | total_supply | float | yes | - | circulating_supply | float | yes | - | relative_changes | str | yes | - | description | str | yes | - | relevant_resources | [AssetRelevantResource](#assetrelevantresource) | yes | - | tags | str | yes | - | is_tradable | bool | | -### AssetFullInfoStats -| Name | Type | Optional | -| --- | --- | -------- | - | asset_code | str | | - | year_min | float | yes | - | year_max | float | yes | - | volume_24h | float | yes | -### AssetInfo -| Name | Type | Optional | -| --- | --- | -------- | - | asset | [Asset](#asset) | | - | title | str | | - | gradient_color | str | yes | - | explore_sections | int | yes | - | subtitle | str | yes | - | tagline | str | yes | - | market_cap | float | yes | - | total_supply | float | yes | - | circulating_supply | float | yes | - | relative_changes | str | yes | - | tags | str | yes | -### AssetRelevantResource -| Name | Type | Optional | -| --- | --- | -------- | - | name | str | | - | url | str | | - | displayable_name | str | yes | -### AssetStats -| Name | Type | Optional | -| --- | --- | -------- | - | total_returned | float | yes | - | total_returned_net | float | yes | - | total_returned_change | float | yes | - | total_fee_spent | float | yes | - | avg_buy_price | float | yes | - | avg_buy_price_net | float | yes | - | avg_sell_price | float | yes | - | avg_sell_price_net | float | yes | -### AssetTag -| Name | Type | Optional | -| --- | --- | -------- | - | id | str | | -### BlockLag -| Name | Type | Optional | -| --- | --- | -------- | - | block_lag | int | yes | -### Category -| Name | Type | Optional | -| --- | --- | -------- | - | id | str | | - | title | str | | - | tagline | str | | - | order_by | str | yes | - | display_type | [CategoryDisplayType](#categorydisplaytype) | | -### CompoundAction -| Name | Type | Optional | -| --- | --- | -------- | - | id | str | | - | type | [TransactionAction](#transactionaction) | | - | transaction_hash | str | | - | status | [TransactionStatus](#transactionstatus) | | - | ctoken | str | yes | - | ctoken_value | float | yes | - | underlying_value | float | yes | - | datetime | datetime | | -### CompoundAsset -| Name | Type | Optional | -| --- | --- | -------- | - | underlying | [Asset](#asset) | | - | underlying_eth_price | float | | - | asset | [Asset](#asset) | | - | borrow_rate | float | yes | - | supply_rate | float | yes | - | exchange_rate | float | yes | -### CompoundDeposit -| Name | Type | Optional | -| --- | --- | -------- | - | asset | [CompoundAsset](#compoundasset) | | - | deposited | float | | - | earned_interest | float | | - | ctokens | int | | -### CompoundInfo -| Name | Type | Optional | -| --- | --- | -------- | - | loans | [CompoundLoan](#compoundloan) | yes | - | deposits | [CompoundDeposit](#compounddeposit) | yes | - | total_debt | float | | - | total_collateral | float | | -### CompoundLoan -| Name | Type | Optional | -| --- | --- | -------- | - | asset | [CompoundAsset](#compoundasset) | | - | borrowed | float | | - | accrued_interest | float | | -### CovalentAsset -| Name | Type | Optional | -| --- | --- | -------- | - | asset_code | str | | - | name | str | | - | symbol | str | | - | decimals | int | | - | icon_url | str | yes | - | value | float | yes | -### Deposit -| Name | Type | Optional | -| --- | --- | -------- | - | id | str | | - | asset | [Asset](#asset) | | - | deposited | float | | - | value | float | | - | supply_rate | float | yes | - | section | str | | - | protocol | str | | - | displayed_on_chart | bool | | -### DyDxAccountBalance -| Name | Type | Optional | -| --- | --- | -------- | - | owner | str | | - | account_number | str | | - | normalized_balance | float | | - | balance | float | | - | asset | [Asset](#asset) | | -### ExploreSection -| Name | Type | Optional | -| --- | --- | -------- | - | id | int | | - | title | str | | - | tagline | str | | - | order | int | | - | alias | str | yes | -### GasPriceInfo -| Name | Type | Optional | -| --- | --- | -------- | - | rapid | int | yes | - | fast | int | yes | - | standard | int | yes | - | slow | int | yes | - | source | [GasPriceSource](#gaspricesource) | | - | datetime | datetime | | -### LiquityTroveAction -| Name | Type | Optional | -| --- | --- | -------- | - | id | str | | - | trove | int | | - | type | str | | - | transaction_hash | str | | - | debt_change | float | yes | - | collateral_change | float | yes | - | datetime | datetime | | -### Loan -| Name | Type | Optional | -| --- | --- | -------- | - | id | str | | - | asset | [Asset](#asset) | | - | borrowed | float | | - | value | float | | - | borrow_rate | float | yes | - | section | str | | - | protocol | str | | - | displayed_on_chart | bool | | -### LockedAsset -| Name | Type | Optional | -| --- | --- | -------- | - | id | str | | - | asset | [Asset](#asset) | | - | locked | float | | - | value | float | | - | section | str | | - | protocol | str | | - | displayed_on_chart | bool | | -### MakerCDP -| Name | Type | Optional | -| --- | --- | -------- | - | id | int | | - | owner | str | | - | debt | float | | - | collateral | float | | -### MakerCDPAction -| Name | Type | Optional | -| --- | --- | -------- | - | type | str | | - | transaction | str | | - | timestamp | int | | - | dai_value | float | yes | - | eth_value | float | yes | - | peth_value | float | yes | - | owner | str | yes | - | new_owner | str | yes | -### MakerVault -| Name | Type | Optional | -| --- | --- | -------- | - | id | int | | - | owner | str | | - | normalized_debt | float | | - | outstanding_debt | float | | - | total_borrowed | float | | - | total_repaid | float | | - | accrued_interest | float | | - | collateral | float | | - | collateral_type | str | | -### MakerVaultAction -| Name | Type | Optional | -| --- | --- | -------- | - | id | str | | - | vault | int | | - | type | [MakerDSSActionType](#makerdssactiontype) | | - | transaction_hash | str | | - | normalized_debt_change | float | yes | - | debt_change | float | yes | - | collateral_change | float | yes | - | owner | str | yes | - | new_owner | str | yes | - | datetime | datetime | | -### Portfolio -| Name | Type | Optional | -| --- | --- | -------- | - | assets_value | float | | - | deposited_value | float | | - | borrowed_value | float | | - | locked_value | float | | - | staked_value | float | | - | bsc_assets_value | float | | - | polygon_assets_value | float | | - | total_value | float | | - | absolute_change_24h | float | | - | relative_change_24h | float | yes | -### Price -| Name | Type | Optional | -| --- | --- | -------- | - | value | float | | - | relative_change_24h | float | yes | - | changed_at | int | | -### PriceStat -| Name | Type | Optional | -| --- | --- | -------- | - | min | float | | - | max | float | | - | relative_change | float | | -### StakedAsset -| Name | Type | Optional | -| --- | --- | -------- | - | id | str | | - | asset | [Asset](#asset) | | - | staked | float | | - | value | float | | - | section | str | | - | protocol | str | | - | displayed_on_chart | bool | | -### Tokenlist -| Name | Type | Optional | -| --- | --- | -------- | - | id | str | | - | name | str | | - | icon_url | str | | - | total_tokens | int | | - | has_asset_code | bool | | -### Transaction -| Name | Type | Optional | -| --- | --- | -------- | - | id | str | | - | type | [RDBTransactionType](#rdbtransactiontype) | | - | protocol | str | | - | mined_at | int | | - | block_number | int | | - | status | [TransactionStatus](#transactionstatus) | | - | hash | str | | - | direction | [Direction](#direction) | yes | - | address_from | str | yes | - | address_to | str | yes | - | contract | str | yes | - | nonce | int | yes | - | changes | [TransactionChange](#transactionchange) | yes | - | fee | [TransactionFee](#transactionfee) | yes | - | meta | str | yes | -### TransactionChange -| Name | Type | Optional | -| --- | --- | -------- | - | asset | [Asset](#asset) | | - | value | int | | - | direction | [Direction](#direction) | | - | address_from | str | | - | address_to | str | | - | price | float | yes | -### TransactionFee -| Name | Type | Optional | -| --- | --- | -------- | - | value | int | | - | price | float | | diff --git a/websockets/namespaces/README.md b/websockets/namespaces/README.md index 9e30b79..244f094 100644 --- a/websockets/namespaces/README.md +++ b/websockets/namespaces/README.md @@ -2,4 +2,5 @@ When connecting to a WebSocket, you need to specify a Namespace. In case of Zerion's API, we have logically divided our available data into several namespaces found in this section. -Two most used namespaces are [/address](address.md) and [/assets](assets.md). +Two most used namespaces are [/address](address.md) and [/assets](assets.md). + diff --git a/websockets/namespaces/address.md b/websockets/namespaces/address.md index 7f69c95..3ff9475 100644 --- a/websockets/namespaces/address.md +++ b/websockets/namespaces/address.md @@ -1,20 +1,18 @@ -# (/address) -## Scopes -Here you can find all the scopes available in this particular namespace. +# /address + +## Scopes + +Here you can find all the scopes available in this particular namespace. + {% api-method method="WS" host="wss://api-v4.zerion.io/" path="address" %} -{% api-method-summary %} info {% endapi-method-summary %} +{% api-method-summary %} +info +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["info"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["info"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} @@ -23,13 +21,14 @@ Default: - {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received address info", { @@ -43,52 +42,49 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="address" %} -{% api-method-summary %} assets {% endapi-method-summary %} +{% api-method-summary %} +assets +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["assets"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["assets"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="address" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="addresses" type="list" %} -Default: [] +Default: \[\] {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} -{% api-method-parameter name="asset_codes" type="list" %} -Default: [] + +{% api-method-parameter name="asset\_codes" type="list" %} +Default: \[\] {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received address assets", { @@ -102,53 +98,49 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="address" %} -{% api-method-summary %} portfolio {% endapi-method-summary %} +{% api-method-summary %} +portfolio +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["portfolio"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["portfolio"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="address" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="addresses" type="list" %} -Default: [] +Default: \[\] {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} -{% api-method-parameter name="portfolio_fields" type="enum" %} -**PortfolioFields**: `all, assets`. -Default: assets + +{% api-method-parameter name="portfolio\_fields" type="enum" %} +**PortfolioFields**: `all, assets`. Default: assets {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received address portfolio", { @@ -162,58 +154,57 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="address" %} -{% api-method-summary %} transactions {% endapi-method-summary %} +{% api-method-summary %} +transactions +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["transactions"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["transactions"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="address" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="addresses" type="list" %} -Default: [] +Default: \[\] {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} -{% api-method-parameter name="transactions_limit" type="int" %} + +{% api-method-parameter name="transactions\_limit" type="int" %} Default: 50 {% endapi-method-parameter %} -{% api-method-parameter name="transactions_offset" type="int" %} + +{% api-method-parameter name="transactions\_offset" type="int" %} Default: 0 {% endapi-method-parameter %} -{% api-method-parameter name="transactions_search_query" type="str" %} + +{% api-method-parameter name="transactions\_search\_query" type="str" %} Default: - {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received address transactions", { @@ -227,58 +218,57 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="address" %} -{% api-method-summary %} charts {% endapi-method-summary %} +{% api-method-summary %} +charts +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["charts"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["charts"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="address" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="addresses" type="list" %} -Default: [] +Default: \[\] {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} -{% api-method-parameter name="charts_type" type="str" %} + +{% api-method-parameter name="charts\_type" type="str" %} Default: d {% endapi-method-parameter %} -{% api-method-parameter name="charts_max_assets" type="int" %} + +{% api-method-parameter name="charts\_max\_assets" type="int" %} Default: 0 {% endapi-method-parameter %} -{% api-method-parameter name="charts_min_percentage" type="int" %} + +{% api-method-parameter name="charts\_min\_percentage" type="int" %} Default: 100 {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received address charts", { @@ -292,49 +282,45 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="address" %} -{% api-method-summary %} deposits {% endapi-method-summary %} +{% api-method-summary %} +deposits +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["deposits"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["deposits"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="address" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="addresses" type="list" %} -Default: [] +Default: \[\] {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received address deposits", { @@ -348,49 +334,45 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="address" %} -{% api-method-summary %} loans {% endapi-method-summary %} +{% api-method-summary %} +loans +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["loans"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["loans"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="address" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="addresses" type="list" %} -Default: [] +Default: \[\] {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received address loans", { @@ -404,49 +386,45 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="address" %} -{% api-method-summary %} locked-assets {% endapi-method-summary %} +{% api-method-summary %} +locked-assets +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["locked-assets"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["locked-assets"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="address" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="addresses" type="list" %} -Default: [] +Default: \[\] {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received address locked-assets", { @@ -460,49 +438,45 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="address" %} -{% api-method-summary %} staked-assets {% endapi-method-summary %} +{% api-method-summary %} +staked-assets +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["staked-assets"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["staked-assets"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="address" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="addresses" type="list" %} -Default: [] +Default: \[\] {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received address staked-assets", { @@ -516,49 +490,45 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="address" %} -{% api-method-summary %} bsc-assets {% endapi-method-summary %} +{% api-method-summary %} +bsc-assets +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["bsc-assets"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["bsc-assets"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="address" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="addresses" type="list" %} -Default: [] +Default: \[\] {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received address bsc-assets", { @@ -572,49 +542,45 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="address" %} -{% api-method-summary %} polygon-assets {% endapi-method-summary %} +{% api-method-summary %} +polygon-assets +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["polygon-assets"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["polygon-assets"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="address" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="addresses" type="list" %} -Default: [] +Default: \[\] {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received address polygon-assets", { @@ -628,8 +594,7 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} diff --git a/websockets/namespaces/assets.md b/websockets/namespaces/assets.md index 0e81434..1e882f5 100644 --- a/websockets/namespaces/assets.md +++ b/websockets/namespaces/assets.md @@ -1,39 +1,38 @@ -# (/assets) -## Scopes -Here you can find all the scopes available in this particular namespace. +# /assets + +## Scopes + +Here you can find all the scopes available in this particular namespace. + {% api-method method="WS" host="wss://api-v4.zerion.io/" path="assets" %} -{% api-method-summary %} prices {% endapi-method-summary %} +{% api-method-summary %} +prices +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["prices"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["prices"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} -{% api-method-parameter name="asset_codes" type="list" %} -Default: [] +{% api-method-parameter name="asset\_codes" type="list" %} +Default: \[\] {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received assets prices", { @@ -47,45 +46,41 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="assets" %} -{% api-method-summary %} explore-sections {% endapi-method-summary %} +{% api-method-summary %} +explore-sections +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["explore-sections"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["explore-sections"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} -{% api-method-parameter name="explore_sections" type="list" %} -Default: [] +{% api-method-parameter name="explore\_sections" type="list" %} +Default: \[\] {% endapi-method-parameter %} -{% api-method-parameter name="explore_sections_aliases" type="list" %} -Default: [] + +{% api-method-parameter name="explore\_sections\_aliases" type="list" %} +Default: \[\] {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received assets explore-sections", { @@ -99,64 +94,65 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="assets" %} -{% api-method-summary %} info {% endapi-method-summary %} +{% api-method-summary %} +info +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["info"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["info"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} -{% api-method-parameter name="asset_codes" type="list" %} -Default: [] +{% api-method-parameter name="asset\_codes" type="list" %} +Default: \[\] {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} + {% api-method-parameter name="limit" type="int" %} Default: 10000 {% endapi-method-parameter %} + {% api-method-parameter name="offset" type="int" %} Default: 0 {% endapi-method-parameter %} -{% api-method-parameter name="explore_section" type="str" %} + +{% api-method-parameter name="explore\_section" type="str" %} Default: - {% endapi-method-parameter %} -{% api-method-parameter name="order_by" type="dict" %} + +{% api-method-parameter name="order\_by" type="dict" %} Default: {} {% endapi-method-parameter %} -{% api-method-parameter name="category_id" type="str" %} + +{% api-method-parameter name="category\_id" type="str" %} Default: - {% endapi-method-parameter %} -{% api-method-parameter name="search_query" type="str" %} + +{% api-method-parameter name="search\_query" type="str" %} Default: - {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received assets info", { @@ -170,46 +166,41 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="assets" %} -{% api-method-summary %} full-info {% endapi-method-summary %} +{% api-method-summary %} +full-info +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["full-info"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["full-info"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} -{% api-method-parameter name="asset_code" type="str" %} +{% api-method-parameter name="asset\_code" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received assets full-info", { @@ -223,49 +214,45 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="assets" %} -{% api-method-summary %} charts {% endapi-method-summary %} +{% api-method-summary %} +charts +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["charts"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["charts"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} -{% api-method-parameter name="asset_codes" type="list" %} -Default: [] +{% api-method-parameter name="asset\_codes" type="list" %} +Default: \[\] {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} -{% api-method-parameter name="charts_type" type="str" %} + +{% api-method-parameter name="charts\_type" type="str" %} Default: d {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received assets charts", { @@ -279,42 +266,37 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="assets" %} -{% api-method-summary %} tags {% endapi-method-summary %} +{% api-method-summary %} +tags +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["tags"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["tags"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} -{% api-method-parameter name="tags_group" type="str" %} +{% api-method-parameter name="tags\_group" type="str" %} Default: all {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received assets tags", { @@ -328,49 +310,45 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="assets" %} -{% api-method-summary %} actions {% endapi-method-summary %} +{% api-method-summary %} +actions +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["actions"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["actions"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="address" type="str" %} Default: - {% endapi-method-parameter %} -{% api-method-parameter name="asset_code" type="str" %} + +{% api-method-parameter name="asset\_code" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received assets actions", { @@ -384,52 +362,49 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="assets" %} -{% api-method-summary %} stats {% endapi-method-summary %} +{% api-method-summary %} +stats +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["stats"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["stats"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="address" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="addresses" type="list" %} -Default: [] +Default: \[\] {% endapi-method-parameter %} -{% api-method-parameter name="asset_code" type="str" %} + +{% api-method-parameter name="asset\_code" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received assets stats", { @@ -443,49 +418,45 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="assets" %} -{% api-method-summary %} list {% endapi-method-summary %} +{% api-method-summary %} +list +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["list"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["list"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} -{% api-method-parameter name="asset_codes" type="list" %} -Default: [] +{% api-method-parameter name="asset\_codes" type="list" %} +Default: \[\] {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} -{% api-method-parameter name="order_by" type="dict" %} + +{% api-method-parameter name="order\_by" type="dict" %} Default: {} {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received assets list", { @@ -499,42 +470,37 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="assets" %} -{% api-method-summary %} tokenlists {% endapi-method-summary %} +{% api-method-summary %} +tokenlists +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["tokenlists"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["tokenlists"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} -{% api-method-parameter name="asset_code" type="str" %} +{% api-method-parameter name="asset\_code" type="str" %} Default: - {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received assets tokenlists", { @@ -548,39 +514,31 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="assets" %} -{% api-method-summary %} categories {% endapi-method-summary %} +{% api-method-summary %} +categories +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["categories"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["categories"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} -{% api-method-body-parameters %} -{% endapi-method-body-parameters %} -{% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received assets categories", { @@ -594,8 +552,7 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} diff --git a/websockets/namespaces/block_lag.md b/websockets/namespaces/block_lag.md index 5f0f8c0..824e5ab 100644 --- a/websockets/namespaces/block_lag.md +++ b/websockets/namespaces/block_lag.md @@ -1,32 +1,28 @@ -# (/block_lag) -## Scopes -Here you can find all the scopes available in this particular namespace. -{% api-method method="WS" host="wss://api-v4.zerion.io/" path="block_lag" %} -{% api-method-summary %} block-lag {% endapi-method-summary %} +# /block\_lag + +## Scopes + +Here you can find all the scopes available in this particular namespace. + +{% api-method method="WS" host="wss://api-v4.zerion.io/" path="block\_lag" %} +{% api-method-summary %} +block-lag +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["block-lag"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["block-lag"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} -{% api-method-body-parameters %} -{% endapi-method-body-parameters %} -{% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received block_lag block-lag", { @@ -40,8 +36,7 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} diff --git a/websockets/namespaces/compound.md b/websockets/namespaces/compound.md index d8a4682..9016c19 100644 --- a/websockets/namespaces/compound.md +++ b/websockets/namespaces/compound.md @@ -1,39 +1,38 @@ -# (/compound) -## Scopes -Here you can find all the scopes available in this particular namespace. +# /compound + +## Scopes + +Here you can find all the scopes available in this particular namespace. + {% api-method method="WS" host="wss://api-v4.zerion.io/" path="compound" %} -{% api-method-summary %} info {% endapi-method-summary %} +{% api-method-summary %} +info +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["info"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["info"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="address" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received compound info", { @@ -47,43 +46,37 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="compound" %} -{% api-method-summary %} assets {% endapi-method-summary %} +{% api-method-summary %} +assets +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["assets"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["assets"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received compound assets", { @@ -97,46 +90,41 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="compound" %} -{% api-method-summary %} actions {% endapi-method-summary %} +{% api-method-summary %} +actions +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["actions"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["actions"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="address" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received compound actions", { @@ -150,46 +138,41 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="compound" %} -{% api-method-summary %} deposits {% endapi-method-summary %} +{% api-method-summary %} +deposits +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["deposits"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["deposits"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="address" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received compound deposits", { @@ -203,46 +186,41 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="compound" %} -{% api-method-summary %} loans {% endapi-method-summary %} +{% api-method-summary %} +loans +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["loans"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["loans"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="address" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received compound loans", { @@ -256,8 +234,7 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} diff --git a/websockets/namespaces/dydx.md b/websockets/namespaces/dydx.md index 180c0e7..39ceb36 100644 --- a/websockets/namespaces/dydx.md +++ b/websockets/namespaces/dydx.md @@ -1,39 +1,38 @@ -# (/dydx) -## Scopes -Here you can find all the scopes available in this particular namespace. +# /dydx + +## Scopes + +Here you can find all the scopes available in this particular namespace. + {% api-method method="WS" host="wss://api-v4.zerion.io/" path="dydx" %} -{% api-method-summary %} deposits {% endapi-method-summary %} +{% api-method-summary %} +deposits +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["deposits"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["deposits"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="address" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received dydx deposits", { @@ -47,46 +46,41 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="dydx" %} -{% api-method-summary %} loans {% endapi-method-summary %} +{% api-method-summary %} +loans +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["loans"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["loans"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="address" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received dydx loans", { @@ -100,8 +94,7 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} diff --git a/websockets/namespaces/gas.md b/websockets/namespaces/gas.md index c7bb5d2..4c50e95 100644 --- a/websockets/namespaces/gas.md +++ b/websockets/namespaces/gas.md @@ -1,32 +1,28 @@ -# (/gas) -## Scopes -Here you can find all the scopes available in this particular namespace. +# /gas + +## Scopes + +Here you can find all the scopes available in this particular namespace. + {% api-method method="WS" host="wss://api-v4.zerion.io/" path="gas" %} -{% api-method-summary %} price {% endapi-method-summary %} +{% api-method-summary %} +price +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["price"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["price"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} -{% api-method-body-parameters %} -{% endapi-method-body-parameters %} -{% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received gas price", { @@ -40,8 +36,7 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} diff --git a/websockets/namespaces/maker.md b/websockets/namespaces/maker.md index 3ce5df8..bb66c6b 100644 --- a/websockets/namespaces/maker.md +++ b/websockets/namespaces/maker.md @@ -1,39 +1,38 @@ -# (/maker) -## Scopes -Here you can find all the scopes available in this particular namespace. +# /maker + +## Scopes + +Here you can find all the scopes available in this particular namespace. + {% api-method method="WS" host="wss://api-v4.zerion.io/" path="maker" %} -{% api-method-summary %} cdp {% endapi-method-summary %} +{% api-method-summary %} +cdp +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["cdp"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["cdp"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} -{% api-method-parameter name="cdp_id" type="str" %} +{% api-method-parameter name="cdp\_id" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received maker cdp", { @@ -47,46 +46,41 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="maker" %} -{% api-method-summary %} vault {% endapi-method-summary %} +{% api-method-summary %} +vault +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["vault"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["vault"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} -{% api-method-parameter name="vault_id" type="str" %} +{% api-method-parameter name="vault\_id" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received maker vault", { @@ -100,46 +94,41 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="maker" %} -{% api-method-summary %} cdp-actions {% endapi-method-summary %} +{% api-method-summary %} +cdp-actions +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["cdp-actions"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["cdp-actions"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} -{% api-method-parameter name="cdp_id" type="str" %} +{% api-method-parameter name="cdp\_id" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received maker cdp-actions", { @@ -153,46 +142,41 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %} {% api-method method="WS" host="wss://api-v4.zerion.io/" path="maker" %} -{% api-method-summary %} vault-actions {% endapi-method-summary %} +{% api-method-summary %} +vault-actions +{% endapi-method-summary %} + {% api-method-description %} -Example request -`[ - "get", - { - "scope": ["vault-actions"], - "payload": { - "body parameter": "value" - } - } -]` +Example request `[ "get", { "scope": ["vault-actions"], "payload": { "body parameter": "value" } } ]` {% endapi-method-description %} + {% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} -{% api-method-parameter name="vault_id" type="str" %} +{% api-method-parameter name="vault\_id" type="str" %} Default: - {% endapi-method-parameter %} + {% api-method-parameter name="currency" type="enum" %} -**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. -Default: usd +**PriceCurrency**: `eth, btc, usd, eur, krw, rub, gbp, aud, cad, inr, jpy, nzd, try, zar, cny, chf`. Default: usd {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %} + {% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Successful result. {% endapi-method-response-example-description %} -``` +```text [ "received maker vault-actions", { @@ -206,8 +190,7 @@ Successful result. } } ] - - ``` +``` {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} diff --git a/websockets/websocket-api-overview.md b/websockets/websocket-api-overview.md index b334fa1..685a0c0 100644 --- a/websockets/websocket-api-overview.md +++ b/websockets/websocket-api-overview.md @@ -1,10 +1,11 @@ -# Zerion Websocket API +# API Overview #### This is a socket-based interactive api based on the [Socket.io](https://socket.io) library. + ## Overview -In order to connect, a valid `api_token` query parameter must be specified. -All tokens are restricted by Origin and therefore a valid `HTTP_ORIGIN` header is expected. -Feel free to get started with `http://localhost:3000` as an origin and a Demo Key: `Demo.ukEVQp6L5vfgxcz4sBke7XvS873GMYHy`. + +In order to connect, a valid `api_token` query parameter must be specified. All tokens are restricted by Origin and therefore a valid `HTTP_ORIGIN` header is expected. Feel free to get started with `http://localhost:3000` as an origin and a Demo Key: `Demo.ukEVQp6L5vfgxcz4sBke7XvS873GMYHy`. + ```javascript let io_options = {transports: ['websocket'], query: {api_token: 'YOUR API TOKEN'}}; socket = io('wss://api.zerion.io', io_options); @@ -14,16 +15,15 @@ socket = io('wss://api.zerion.io', io_options); There are three supported types of messages: - - `get` - requests data, returns a single response and does not emit continuous messages - - `subscribe` - returns a single response (the same as `get`) + creates a subscription - - `unsubscribe` - deletes the subscription - +* `get` - requests data, returns a single response and does not emit continuous messages +* `subscribe` - returns a single response \(the same as `get`\) + creates a subscription +* `unsubscribe` - deletes the subscription ### Request Each request has the following structure: -``` +```text [ "{action}", { @@ -36,10 +36,9 @@ Each request has the following structure: ] ``` - ### Response -``` +```text [ "received {namespace} {model}", { @@ -55,10 +54,9 @@ Each request has the following structure: ] ``` - ### Change -``` +```text [ "changed|appended|removed {namespace} {model}", {