### Start Web Development Environment Source: https://docs.hollaex.com/developers/run-dev-mode.md Run this command in the /web directory to install dependencies and launch the local development server. ```bash npm start ``` -------------------------------- ### Plugin Installation Response Example Source: https://docs.hollaex.com/plugins/installing-plugin.md Example of a successful 200 response body returned after installing a plugin. ```javascript { "name": "hello-exchange", "version": 1, "author": "bitHolla", "enabled": true, "description": "Demo plugin for proof of concept", "bio": "Demo plugin", "public_meta": { ... }, "web_view": null, "updated_at": "2021-03-08T04:06:03.357Z", "created_at": "2021-03-08T04:06:03.357Z", "documentation": null, "logo": null, "icon": null, "url": null, "enabled_admin_view": false ``` -------------------------------- ### Start the exchange server Source: https://docs.hollaex.com/get-started/cli-how-tos/start-exchange.md Initializes the exchange server and applies settings. Run this after the setup process or to restart a stopped server. ```bash hollaex server --start ``` -------------------------------- ### Start the exchange web server Source: https://docs.hollaex.com/get-started/cli-how-tos/start-exchange.md Starts the web interface for the exchange. This must be executed after the web setup procedure is complete. ```bash hollaex web --start ``` -------------------------------- ### Run the CLI installer Source: https://docs.hollaex.com/get-started/on-premise-exchange-setup/installation.md Executes the installation script to set up the HollaEx CLI tool. ```bash bash install.sh ``` -------------------------------- ### Install Plugin Dependencies Source: https://docs.hollaex.com/plugins/develop-plugins/web-view-development/getting-started.md Commands to install dependencies for the main project and the web directory. ```bash npm install cd web/ && npm install ``` -------------------------------- ### Configure and Start Server Source: https://docs.hollaex.com/developers/run-dev-mode.md Commands to navigate the directory, prepare the environment file, and launch the server containers. ```bash cd hollaex-kit/ cd server/ mv tools/hollaex-kit.env.local.example tools/hollaex-kit.env.local docker-compose up docker ps docker exec -it server_hollaex-kit-server_1 /bin/bash ``` -------------------------------- ### Verify HollaEx CLI installation Source: https://docs.hollaex.com/get-started/on-premise-exchange-setup/installation.md Checks the installed versions of the HollaEx CLI and the Kit to ensure successful setup. ```bash hollaex version ``` -------------------------------- ### Setup web server on Kubernetes Source: https://docs.hollaex.com/get-started/run-exchange-on-kubernetes.md Initialize the web server component on the Kubernetes cluster. ```bash hollaex web --setup --kube ``` -------------------------------- ### Full hollacloud.json Configuration Example Source: https://docs.hollaex.com/advanced/customizing-your-frontend-projects-with-hollacloud-json.md A comprehensive example demonstrating SPA fallback, URL normalization, redirects, rewrites, and custom header injection. ```json { "site": { "spa": true }, "lowercaseUrls": true, "trailingSlash": false, "redirects": [ { "source": "/old-blog", "destination": "/blog" }, { "source": "/docs/:path*", "destination": "/help/:path*" }, { "source": "/u/:id", "destination": "/users/:id" }, { "source": "/sale", "destination": "/summer-sale", "statusCode": 302 }, { "source": "/chat", "destination": "https://discord.gg/your-invite" } ], "rewrites": [ { "source": "/app/:path*", "destination": "/index.html" } ], "headers": [ { "source": "/assets/:path*", "headers": [ { "key": "Cache-Control", "value": "public, max-age=86400" } ] }, { "source": "/:path*", "headers": [ { "key": "X-Frame-Options", "value": "DENY" } ] } ] } ``` -------------------------------- ### Initialize Production Environment Source: https://docs.hollaex.com/get-started/on-premise-exchange-setup/use-custom-domain.md Starts the production exchange process via the HollaEx CLI. ```bash hollaex prod ``` -------------------------------- ### Setup exchange on Kubernetes Source: https://docs.hollaex.com/get-started/run-exchange-on-kubernetes.md Initialize the exchange environment on the Kubernetes cluster. ```bash hollaex server --setup --kube ``` -------------------------------- ### Install Homebrew on macOS Source: https://docs.hollaex.com/advanced/hollaex-on-non-linux/hollaex-on-macos.md Execute this command in the Terminal to install the Homebrew package manager. ```bash ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ``` -------------------------------- ### Query documentation via HTTP GET Source: https://docs.hollaex.com/llms.txt Perform a GET request to the documentation index with an ask parameter to receive a direct answer and relevant excerpts. ```http GET https://docs.hollaex.com/master.md?ask=&goal= ``` -------------------------------- ### Initialize Exchange Server Source: https://docs.hollaex.com/get-started/on-premise-exchange-setup/setup.md Run this command to begin the setup process, which includes network selection and account authentication. ```bash hollaex server --setup ``` -------------------------------- ### Start Development Mode Source: https://docs.hollaex.com/plugins/develop-plugins/simple-wallet-example.md Command to launch the exchange in development mode for the specific plugin. ```jsx npm start --plugin=my-simple-wallet ``` -------------------------------- ### Start Development Mode Source: https://docs.hollaex.com/plugins/develop-plugins/web-view-development/basic-tutorial-hello-exchange-plugin-web-view.md Commands to run the development server and the Hollaex kit plugin development mode. ```bash npm start --plugin=hello-exchange ``` ```bash npm run dev:plugin --plugin=hello-exchange ``` -------------------------------- ### Start exchange on Kubernetes Source: https://docs.hollaex.com/get-started/run-exchange-on-kubernetes.md Launch the exchange services within the Kubernetes cluster. ```bash hollaex server --start --kube ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.hollaex.com/how-tos/configure-pair-parameters Perform a GET request to the documentation index to retrieve answers based on a specific question and optional goal. ```http GET https://docs.hollaex.com/how-tos/assets-and-trading-pairs/configure-pair-parameters.md?ask=&goal= ``` -------------------------------- ### Start the plugin in development mode Source: https://docs.hollaex.com/plugins/develop-plugins/development-walkthrough-hello-plugin/web-view.md Execute this command within the hollaex-kit/plugins directory to initiate the plugin compilation process. ```bash npm start --plugin=hello-plugin ``` -------------------------------- ### Install HollaEx Node Library Source: https://docs.hollaex.com/developers/api-guide.md Command to install the required npm package for HollaEx API interaction. ```bash npm install hollaex-node-lib ``` -------------------------------- ### Generated Fees Output Example Source: https://docs.hollaex.com/advanced/the-network-tool-library/getting-more-interesting-orders-with-the-tools/settling-fees.md Example JSON output returned by the getGeneratedFees command showing fee details for USDT and XHT. ```javascript //generated fees for USDT [ { id: 70, transaction_id: '60014cde-aff0-455a-9068-ca0d0f5e6e6a', amount: 0.003312, currency: 'usdt', network_fee: 0.003312, trade_id: 330100, timestamp: '2022-06-27T17:48:17.884Z', exchange_id: 935, user_id: 2228 }, //this is where these fees have gone //generated fees for XHT { id: 71, transaction_id: '78c16133-abba-4e84-a48c-afc29c3f4afc', amount: 0.003, currency: 'xht', network_fee: 0.003, trade_id: 330100, timestamp: '2022-06-27T17:48:17.884Z', exchange_id: 935, user_id: 2228 } ] } ``` -------------------------------- ### POST /plugins Source: https://docs.hollaex.com/plugins/installing-plugin.md Install a new plugin by providing the plugin configuration details in the request body. ```APIDOC ## POST https:///plugins ### Description Install a plugin into the system. ### Method POST ### Endpoint https:///plugins ### Headers - **authorization** (string) - Required - Bearer token ### Request Body - **public_meta** (object) - Optional - Plugin public_meta object - **type** (string) - Optional - Plugin type - **enabled** (boolean) - Optional - Enable/disable the plugin on installation - **name** (string) - Required - Name of plugin - **version** (number) - Required - Plugin version - **script** (string) - Optional - Plugin script - **meta** (object) - Optional - Plugin meta object - **prescript** (object) - Optional - Plugin prescript object. Valid keys: install, run - **postscript** (object) - Optional - Plugin postscript object. Valid keys: run - **icon** (string) - Optional - Plugin icon url - **documentation** (string) - Optional - Plugin markdown documentation - **url** (string) - Optional - Plugin url - **bio** (string) - Optional - Plugin simplified bio - **logo** (string) - Optional - Plugin logo url - **description** (string) - Optional - Plugin long description - **author** (string) - Required - Plugin author - **admin_view** (string) - Optional - Plugin admin_view - **web_view** (string) - Optional - Plugin web_view ### Response #### Success Response (200) - **name** (string) - Name of plugin - **version** (number) - Plugin version - **author** (string) - Plugin author - **enabled** (boolean) - Plugin enabled status - **description** (string) - Plugin description - **bio** (string) - Plugin bio - **public_meta** (object) - Plugin public_meta - **web_view** (string) - Plugin web_view - **updated_at** (string) - Timestamp of update - **created_at** (string) - Timestamp of creation - **documentation** (string) - Plugin documentation - **logo** (string) - Plugin logo - **icon** (string) - Plugin icon - **url** (string) - Plugin url - **enabled_admin_view** (boolean) - Admin view status ``` -------------------------------- ### Kit Configuration Structure Source: https://docs.hollaex.com/plugins/develop-plugins/advanced/advanced-tutorial-using-the-user-meta-field.md Example of how the user meta field appears within the Kit configuration object. ```json // KIT CONFIG { ..., "user_meta": { "trade_count_plugin-latest_trade": { "type": "date-time", "required": false, "description": "Last trade timestamp used for trade-count plugin" } }, ... } ``` -------------------------------- ### Define Plugin Strings Source: https://docs.hollaex.com/plugins/develop-plugins/web-view-development/getting-started.md Example structure for the strings.json file to define localized strings. ```json { "en": { "title": "Hello exchange" } } ``` -------------------------------- ### Example config.json structure Source: https://docs.hollaex.com/plugins/develop-plugins/advanced/config.md A template showing the required fields and object structure for a plugin configuration file. ```json { "name": "Plugin Name", "version": 1, "type": null, "author": "Author", "bio": "Short description shown in admin panel", "description": "Description shown on plugin page", "documentation": null, "logo": null, "icon": null, "url": null, "public_meta": { "public_value": { ... } }, "meta": { "private_value": { ... } }, "prescript": { "install": ["hello-world-npm"], "run": null }, "postscript": { "run": null } } ``` -------------------------------- ### Git Configuration Hint Source: https://docs.hollaex.com/get-started/cli-how-tos/upgrade-exchange.md Example output provided by Git when divergent branches require a reconciliation strategy. ```text hint: You have divergent branches and need to specify how to reconcile them. hint: You can do so by running one of the following commands sometime before hint: your next pull: hint: hint: git config pull.rebase false # merge hint: git config pull.rebase true # rebase hint: git config pull.ff only # fast-forward only hint: hint: You can replace "git config" with "git config --global" to set a default hint: preference for all repositories. You can also pass --rebase, --no-rebase, hint: or --ff-only on the command line to override the configured default per hint: invocation. ``` -------------------------------- ### Fetch Exchange Users with Node.js Source: https://docs.hollaex.com/developers/api-guide.md Example script to initialize the HollaEx client and retrieve a list of exchange users. ```javascript const hollaex = require("hollaex-node-lib"); const client = new hollaex({ apiURL: "", apiKey: "", apiSecret: "", }); const app = async () => { try { const user = await client.getExchangeUsers({ limit: 10 }); console.log(user); } catch (err) { console.log(err.message); } }; app(); ``` -------------------------------- ### Run Plugin Script Source: https://docs.hollaex.com/plugins/develop-plugins/advanced/server-script.md Execute the plugin script within the development environment using the npm start command. ```bash npm start --plugin= ``` -------------------------------- ### Sample API Output Source: https://docs.hollaex.com/developers/api-guide.md Example JSON structure returned by the getExchangeUsers method. ```json { count: 8, data: [ { id: 9, email: 'tester@gmail.com', full_name: '', gender: false, nationality: '', dob: null, phone_number: '', address: [Object], id_data: [Object], bank_account: [], crypto_wallet: {}, verification_level: 1, email_verified: true, otp_enabled: false, activated: true, note: '', username: 'tech', affiliation_code: '8DRYJG', settings: [Object], flagged: false, affiliation_rate: 0, network_id: 400977, discount: 0, meta: {}, created_at: '2023-04-15T08:03:15.981Z', updated_at: '2023-04-15T08:03:33.679Z' }, { ... }, ... ``` -------------------------------- ### GET /plugins/cmc/summary Source: https://docs.hollaex.com/plugins/use-plugins/coinmarketcap-market-data-integration.md Retrieves the summary data for the exchange as required by CoinMarketCap. ```APIDOC ## GET /plugins/cmc/summary ### Description Retrieves the summary data for the exchange as required by CoinMarketCap. ### Method GET ### Endpoint /plugins/cmc/summary ``` -------------------------------- ### Script Execution Output Source: https://docs.hollaex.com/advanced/the-network-tool-library/simple-example-creating-a-user-and-wallet.md Example console output generated by running the user and wallet creation script. Comments within the code block explain the state of the user data at each step. ```javascript //from the initial getUsers command (line 22), the following object is obtained //giving the IDs and all emails of the exchange's users { count: 22, data: [ { id: 161537, email: 'hello2@gmail.com' }, { id: 161535, email: 'hello1@gmail.com' }, //~~ { id: 161045, email: 'test1@email.com' }, { id: 161044, email: 'test@email.com' }, //following the createUser command (line 25) the string we input as a parameter //has now been used to add a new user, we can inspect our list by again getting //using getUsers (line 28) { count: 23, data: [ { id: 161582, email: 'hello4@gmail.com' }, //<-- The newely added user { id: 161537, email: 'hello2@gmail.com' }, //~~ { id: 161045, email: 'test1@email.com' }, { id: 161044, email: 'test@email.com' }, //Using the getUser command (line 37) and supplying the newest user's ID, we can //inspect the deatails of this new user, before the btc address is added { id: 161582, email: 'hello4@gmail.com', balance: { btc_balance: 0, btc_available: 0, //~~ xht_balance: 0, xht_available: 0 }, wallet: [] } //<-- This user currently has no addresses //following the createUserCryptoAddress and requesting it for btc and for this //newest user (line 40) and then again using getUser (line 43) we can now see //the new address created { id: 161582, email: 'hello4@gmail.com', balance: { btc_balance: 0, btc_available: 0, //~~ xht_balance: 0, xht_available: 0 }, wallet: [ { currency: 'btc', address: '3FR4Ab7Gc1LgDWsELSvsgwYVp8AzaMtUsJ', //<-- newly created address network: 'btc', standard: null, is_valid: true, created_at: '2022-05-30T15:26:46.439Z' } ] } ``` -------------------------------- ### GET /plugins/cmc/assets Source: https://docs.hollaex.com/plugins/use-plugins/coinmarketcap-market-data-integration.md Retrieves the list of assets available on the exchange. ```APIDOC ## GET /plugins/cmc/assets ### Description Retrieves the list of assets available on the exchange. ### Method GET ### Endpoint /plugins/cmc/assets ``` -------------------------------- ### Query documentation via HTTP GET Source: https://docs.hollaex.com/get-started/web-setup Perform a request to the documentation index to retrieve answers and relevant excerpts. ```http GET https://docs.hollaex.com/get-started/on-premise-exchange-setup/web-setup.md?ask=&goal= ``` -------------------------------- ### GET /kit Source: https://docs.hollaex.com/how-tos/fiat-controls/developer-controls-client-side-integration.md Retrieves the platform configuration including fiat features, deposit/withdrawal methods, and payment type data. ```APIDOC ## GET /kit ### Description Fetches global platform configuration settings. ### Method GET ### Endpoint /kit ``` -------------------------------- ### Plugin script execution hooks Source: https://docs.hollaex.com/plugins/develop-plugins/development-walkthrough-hello-plugin/configuration.md Configuration for prescript and postscript hooks to manage package installation and execution. ```json { ... "prescript": { "install": ["hello-world-npm"], "run": null }, "postscript": { "run": null } ... } ``` -------------------------------- ### Configure Base Path for Mounted Projects Source: https://docs.hollaex.com/advanced/customizing-your-frontend-projects-with-hollacloud-json.md Define the base path for a project to host it under a specific sub-path. The path must be case-sensitive and start with a forward slash. ```json { "site": { "basePath": "/docs" } } ``` ```json { "site": { "basePath": "/pricing" } } ``` -------------------------------- ### Install specific CLI version Source: https://docs.hollaex.com/get-started/troubleshooting-guide.md Upgrades or downgrades the local HollaEx CLI to a specified version number. ```bash hollaex toolbox --install_cli ``` -------------------------------- ### Wallet Data Response Source: https://docs.hollaex.com/advanced/the-network-tool-library/functions/websocket.md Example of a partial wallet balance update payload. ```json { "topic": "wallet", "action": "partial", "user_id": 1, "data": { "usdt_balance": 1, "usdt_available": 1, "xht_balance": 1, "xht_available": 1, "xmr_balance": 1, "xmr_available": 1, "btc_balance": 1, "btc_available": 1, "eth_balance": 1, "eth_available": 1, ..., "updated_at": "2020-12-15T08:41:24.048Z" }, "time": 1608021684 } ``` -------------------------------- ### Serve web view bundles Source: https://docs.hollaex.com/plugins/develop-plugins/web-view-development/advanced-tutorial-kyc-plugin-web-views.md Run this command in the plugin starter kit web directory to watch and serve bundles. ```bash npm start --plugin=kyc ``` -------------------------------- ### GET /plugins/cobo/create-address Source: https://docs.hollaex.com/plugins/use-plugins/cobo-wallet-custody-integration-waas-2.0.md Requests a deposit address for an authenticated user for a specific currency and network. ```APIDOC ## GET /plugins/cobo/create-address ### Description Requests a deposit address for an authenticated user. If a wallet already exists for the currency and network, the existing address is returned. ### Method GET ### Endpoint /plugins/cobo/create-address ### Parameters #### Query Parameters - **crypto** (string) - Required - The currency symbol. - **network** (string) - Required - The network name. ### Request Example GET https:///plugins/cobo/create-address?crypto=BTC&network=Bitcoin ``` -------------------------------- ### Identity Verification Component Setup Source: https://docs.hollaex.com/plugins/develop-plugins/web-view-development/advanced-tutorial-kyc-plugin-web-views.md Initializes the IdentityVerification component with required imports and Redux Form configuration. ```jsx import React, { Component } from 'react'; import moment from 'moment'; import { reduxForm, SubmissionError } from 'redux-form'; import { requiredWithCustomMessage as required, requiredBoolean, isBefore, } from 'utils'; import { Button, IconTitle, Editable as EditWrapper } from 'hollaex-web-lib'; import { HeaderSection } from 'components/HeaderSection'; import { withKit } from 'components/KitContext'; import { isMobile } from 'react-device-detect'; const FORM_NAME = 'IdentityVerification'; class IdentityVerification extends Component { state = { formFields: {}, }; ``` -------------------------------- ### Retrieve User Balance Source: https://docs.hollaex.com/developers/api-guide.md Example script for a user to retrieve their own account balance using the HollaEx node library. ```javascript const hollaex = require("hollaex-node-lib"); const client = new hollaex({ apiURL: "", apiKey: "", apiSecret: "", }); const app = async () => { try { const balance = await balance.getBalance(); console.log(user); } catch (err) { console.log(err.message); } }; app(); ``` -------------------------------- ### Hello-Plugin API Response Structure Source: https://docs.hollaex.com/plugins/develop-plugins/development-walkthrough-hello-plugin.md The expected JSON response format when calling the GET /plugins/hello-plugin/info endpoint. ```javascript { public_message: 'Hello Plugin!', private_message: 'Hello Plugin...', library_message: 'Hello Plugin NPM', moment_timestamp: exchange_info: {...} } ``` -------------------------------- ### Order Data Responses Source: https://docs.hollaex.com/advanced/the-network-tool-library/functions/websocket.md Examples of order-related WebSocket messages including partial, insert, and update actions. ```json { "topic": "order", "action": "partial", "user_id": 1, "data": [ { "id": "7d3d9545-b7e6-4e7f-84a0-a39efa4cb173", "side": "buy", "symbol": "xht-usdt", "type": "limit", "size": 0.1, "filled": 0, "price": 1, "stop": null, "status": "new", "fee": 0, "fee_coin": "xht", "meta": {}, "fee_structure": { "maker": 0.1, "taker": 0.1 }, "created_at": "2020-11-30T07:45:43.819Z", "created_by": 1 }, ... ], "time": 1608022610 } ``` ```json { "topic": "order", "action": "insert", "user_id": 1, "symbol": "xht-usdt", "data": [ { "id": "7d3d9545-b7e6-4e7f-84a0-a39efa4cb173", "side": "buy", "symbol": "xht-usdt", "type": "limit", "size": 0.1, "filled": 0, "price": 1, "stop": null, "status": "new", "fee": 0, "fee_coin": "xht", "meta": {}, "fee_structure": { "maker": 0.1, "taker": 0.1 }, "created_at": "2020-11-30T07:45:43.819Z", "updated_at": "2020-12-15T08:56:45.066Z", "created_by": 1 }, ... ], "time": 1608022610 } ``` ```json { "topic": "order", "action": "insert", "user_id": 1, "symbol": "xht-usdt", "data": [ { "id": "7d3d9545-b7e6-4e7f-84a0-a39efa4cb173", "side": "buy", "symbol": "xht-usdt", "type": "limit", "size": 0.1, "filled": 0, "price": 1, "stop": null, "status": "new", "fee": 0, "fee_coin": "xht", "meta": {}, "fee_structure": { "maker": 0.1, "taker": 0.1 }, "created_at": "2020-11-30T07:45:43.819Z", "updated_at": "2020-12-15T08:56:45.066Z", "created_by": 1 }, ... ], "time": 1608022610 } ``` -------------------------------- ### Default Kubernetes Ingress Configuration Source: https://docs.hollaex.com/advanced/customize-kubenretes-ingress.md Example Ingress resource definitions for API, plugins, and stream services using the Nginx Ingress controller. ```yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: demo-hollaex-ingress-api namespace: demo-hollaex annotations: kubernetes.io/ingress.class: "nginx" kubernetes.io/tls-acme: "true" cert-manager.io/cluster-issuer: letsencrypt-prod nginx.ingress.kubernetes.io/proxy-body-size: "6m" nginx.ingress.kubernetes.io/server-snippet: | location @maintenance_503 { internal; return 503; } nginx.ingress.kubernetes.io/configuration-snippet: | limit_req zone=api burst=10 nodelay; limit_req_log_level notice; limit_req_status 429; #error_page 403 @maintenance_503; spec: rules: - host: api.testnet.demo-hollaex.io http: paths: - pathType: Prefix path: / backend: service: name: demo-hollaex-server-api port: number: 10010 tls: - secretName: demo-hollaex-tls-cert hosts: - api.testnet.demo-hollaex.io --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: demo-hollaex-ingress-plugins namespace: demo-hollaex annotations: kubernetes.io/ingress.class: "nginx" kubernetes.io/tls-acme: "true" cert-manager.io/cluster-issuer: letsencrypt-prod nginx.ingress.kubernetes.io/server-snippet: | location @maintenance_503 { internal; return 503; } nginx.ingress.kubernetes.io/proxy-body-size: "6m" nginx.ingress.kubernetes.io/configuration-snippet: | #error_page 403 @maintenance_503; spec: rules: - host: api.testnet.demo-hollaex.io http: paths: - pathType: Prefix path: /plugins backend: service: name: demo-hollaex-server-plugins port: number: 10011 tls: - secretName: demo-hollaex-tls-cert hosts: - api.testnet.demo-hollaex.io --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: demo-hollaex-ingress-stream namespace: demo-hollaex annotations: kubernetes.io/ingress.class: "nginx" kubernetes.io/tls-acme: "true" cert-manager.io/cluster-issuer: letsencrypt-prod nginx.ingress.kubernetes.io/server-snippet: | location @maintenance_503 { internal; return 503; } nginx.ingress.kubernetes.io/proxy-body-size: "6m" nginx.org/websocket-services: "demo-hollaex-server-stream" nginx.ingress.kubernetes.io/upstream-hash-by: "$binary_remote_addr" nginx.ingress.kubernetes.io/configuration-snippet: | #error_page 403 @maintenance_503; spec: rules: - host: api.testnet.demo-hollaex.io http: paths: - pathType: Prefix path: /stream backend: service: name: demo-hollaex-server-stream port: number: 10080 tls: - secretName: demo-hollaex-tls-cert hosts: - api.testnet.demo-hollaex.io ``` -------------------------------- ### Initialize hello-plugin Source: https://docs.hollaex.com/plugins/develop-plugins/development-walkthrough-hello-plugin/initialization.md Run the npm command to scaffold the hello-plugin directory with the specified type. ```bash npm run add:plugin --plugin=hello-plugin --type=page ``` -------------------------------- ### Stop the exchange server Source: https://docs.hollaex.com/get-started/cli-how-tos/stop-exchange.md Stops the exchange server that was previously started with the start command. ```bash hollaex server --stop ``` -------------------------------- ### Initialize KYC plugin web view Source: https://docs.hollaex.com/plugins/develop-plugins/web-view-development/advanced-tutorial-kyc-plugin-web-views.md Run these commands in the web directory to initialize the plugin structure. ```bash cd web/ npm run add-plugin --plugin=kyc --type=kyc ``` -------------------------------- ### Sell Order Execution Output Source: https://docs.hollaex.com/advanced/the-network-tool-library/getting-more-interesting-orders-with-the-tools/creating-and-monitoring-a-sell-order.md Example output showing account balances before and after a market sell order, along with the resulting trade history and active order status. ```javascript //Account A before the sell order (line 23) { //~~other coin balances~~ usdt_balance: 14.474006, //initially about 14 XHT usdt_available: 14.474006, xht_balance: 27.994, //initially about 28 XHT xht_available: 27.994, //~~other coin balances~~ } //Here the order is placed, and due to being on the testnet, //is instantly snapped up! //Account A after the sell order's completion (line 39) { //~~other coin balances~~ usdt_balance: 16.573376, //about 2 USDT gained usdt_available: 16.573376, xht_balance: 17.994, //sold 10 XHT xht_available: 17.994, //~~other coin balances~~ } //this is all of Account A's trades listed (line 42) { count: 13, data: [ { side: 'buy', symbol: 'xht-usdt', size: 10, price: 0.3, timestamp: '2022-06-24T21:58:44.990Z', order_id: 'bc6e5053-8453-489e-8804-d2df9069f9c4', fee: 0.003, fee_coin: 'xht' }, { //~~ the previous trades done by A ~~ } ] } //zero open orders as it was fully filled near instantly! (line 45) { count: 0, data: [] } ``` -------------------------------- ### Define plugin-specific libraries in config.json Source: https://docs.hollaex.com/plugins/develop-plugins/advanced/plugin-libraries.md Add required external dependencies to the install array within the prescript object of the plugin configuration file. ```javascript { ... prescript: { install: ['hello-world-npm'] }, ... ``` -------------------------------- ### Initialize KYC Plugin Components Source: https://docs.hollaex.com/plugins/develop-plugins/web-view-development/advanced-tutorial-kyc-plugin-web-views.md Create the necessary directory structure and component files for the KYC plugin. ```bash mkdir src/plugins/kyc/views/home/components touch src/plugins/kyc/views/home/components/Documents.js touch src/plugins/kyc/views/home/components/Identity.js ``` -------------------------------- ### Stop the exchange web server Source: https://docs.hollaex.com/get-started/cli-how-tos/stop-exchange.md Stops the exchange web server that was previously started with the web start command. ```bash hollaex web --stop ``` -------------------------------- ### Initialize the web client Source: https://docs.hollaex.com/get-started/on-premise-exchange-setup/web-setup.md Builds the web client Docker image and performs initialization tasks. ```bash hollaex web --setup ``` -------------------------------- ### Access Kit Context in React Components Source: https://docs.hollaex.com/plugins/develop-plugins/web-view-development/getting-started.md Example of using the withKit higher-order component to subscribe to kit context props. ```jsx import React from "react"; import { withKit } from 'components/KitContext'; const Title = ({ user: { username } = {}, strings: STRINGS, generateId }) => (
{STRINGS.formatString(STRINGS[generateId('hello')], username)}
); const mapContextToProps = ({ user, generateId, strings }) => ( {user, generateId, strings} ); export default withKit(mapContextToProps)(Title); ``` -------------------------------- ### Initialize Verification Component Files Source: https://docs.hollaex.com/plugins/develop-plugins/web-view-development/advanced-tutorial-kyc-plugin-web-views.md Use these shell commands to create the necessary directory structure and files for the KYC verification components. ```bash mkdir src/plugins/kyc/views/verification/components touch src/plugins/kyc/views/verification/components/Documents.js touch src/plugins/kyc/views/verification/components/Identity.js touch src/plugins/kyc/views/verification/components/HeaderSection.js ``` -------------------------------- ### GET /logout Source: https://docs.hollaex.com/developers/build-a-new-front-end-interface.md Logs out the user session. ```APIDOC ## GET /logout ### Description Logs out the current user session. Requires an Authorization header. ### Method GET ### Endpoint /logout ``` -------------------------------- ### GET /plugins/cmc/orderbook Source: https://docs.hollaex.com/plugins/use-plugins/coinmarketcap-market-data-integration.md Retrieves the orderbook data for the exchange. ```APIDOC ## GET /plugins/cmc/orderbook ### Description Retrieves the orderbook data for the exchange. ### Method GET ### Endpoint /plugins/cmc/orderbook ``` -------------------------------- ### GET /plugins/cobo/health Source: https://docs.hollaex.com/plugins/use-plugins/cobo-wallet-custody-integration-waas-2.0.md Checks the health status of the Cobo plugin. ```APIDOC ## GET /plugins/cobo/health ### Description Returns the health status of the Cobo plugin integration. ### Method GET ### Endpoint /plugins/cobo/health ### Request Example GET https:///plugins/cobo/health ``` -------------------------------- ### init Source: https://docs.hollaex.com/advanced/the-network-tool-library/functions.md Initializes the Kit for the HollaEx Network. Requires an activation_code to be passed in the constructor. ```APIDOC ## init ### Description Initialize your Kit for HollaEx Network. Must have passed activation_code in constructor. ### Parameters - **opts** (Object) - Required - Object with additional params - **opts.additionalHeaders** (Object) - Optional - Object containing additional headers to send with request ``` -------------------------------- ### GET /plugins/cmc/trades Source: https://docs.hollaex.com/plugins/use-plugins/coinmarketcap-market-data-integration.md Retrieves recent trade data from the exchange. ```APIDOC ## GET /plugins/cmc/trades ### Description Retrieves recent trade data from the exchange. ### Method GET ### Endpoint /plugins/cmc/trades ``` -------------------------------- ### Build Initial Plugin Source: https://docs.hollaex.com/plugins/develop-plugins/web-view-development/basic-tutorial-hello-exchange-plugin-web-view.md Commands to build the plugin with a default view. ```bash cd .. npm run build --plugin=hello-exchange ``` -------------------------------- ### GET /verify Source: https://docs.hollaex.com/developers/build-a-new-front-end-interface.md Resends the email verification code to the user. ```APIDOC ## GET /verify ### Description Resends the email verification code to the specified email address. ### Method GET ### Endpoint /verify ### Query Parameters - **email** (string) - Required - User email address - **resend** (boolean) - Required - Set to true to trigger resend ``` -------------------------------- ### Initialize Plugin Web View Source: https://docs.hollaex.com/plugins/develop-plugins/web-view-development/basic-tutorial-hello-exchange-plugin-web-view.md Commands to initialize the plugin web view structure. ```bash cd web/ npm run add-plugin --plugin=hello-exchange --type=page ``` -------------------------------- ### Trade Data Response Source: https://docs.hollaex.com/advanced/the-network-tool-library/functions/websocket.md Example of a partial trade update payload. ```json { "topic": "trade", "action": "partial", "symbol": "xht-usdt", "data": [ { "size": 0.012, "price": 300, "side": "buy", "timestamp": "2020-12-15T07:25:28.887Z" }, ... ], "time": 1608015328 } ``` -------------------------------- ### Initialize a new plugin template Source: https://docs.hollaex.com/plugins/develop-plugins/advanced/initialization.md Run this command in the /plugins directory to generate the folder structure for a specific plugin type. ```bash npm run add:plugin --plugin= --type= ``` -------------------------------- ### Orderbook Data Response Source: https://docs.hollaex.com/advanced/the-network-tool-library/functions/websocket.md Example of a partial orderbook update payload. ```json { "topic": "orderbook", "action": "partial", "symbol": "xht-usdt", "data": { "bids": [ [0.1, 0.1], ... ], "asks": [ [1, 1], ... ], "timestamp": "2020-12-15T06:45:27.766Z" }, "time": 1608015328 } ``` -------------------------------- ### GET /plugins/cmc/tickers Source: https://docs.hollaex.com/plugins/use-plugins/coinmarketcap-market-data-integration.md Retrieves ticker information for trading pairs on the exchange. ```APIDOC ## GET /plugins/cmc/tickers ### Description Retrieves ticker information for trading pairs on the exchange. ### Method GET ### Endpoint /plugins/cmc/tickers ``` -------------------------------- ### Initialize Plugin Environment Source: https://docs.hollaex.com/plugins/develop-plugins/simple-wallet-example.md Commands to navigate to the plugins directory and initialize a new page-type plugin. ```jsx cd plugins/ ``` ```jsx npm run add:plugin --plugin=my-simple-wallet --type=page ``` -------------------------------- ### GET /user Source: https://docs.hollaex.com/developers/build-a-new-front-end-interface.md Retrieves the authenticated user's profile data. ```APIDOC ## GET /user ### Description Retrieves user data, wallets, and balances. Requires a valid JWT token in the Authorization header. ### Method GET ### Endpoint /user ### Request Headers - **Authorization** (string) - Required - "Bearer your_jwt_token_from_login" ``` -------------------------------- ### Initialize Database and Activate Exchange Source: https://docs.hollaex.com/developers/run-dev-mode.md Commands to be executed inside the Docker container to set up the database and activate the exchange. ```bash sequelize db:migrate sequelize db:seed:all node tools/dbs/runTriggers.js node tools/dbs/setActivationCode.js ``` -------------------------------- ### Create User and Wallet Script Source: https://docs.hollaex.com/advanced/the-network-tool-library/simple-example-creating-a-user-and-wallet.md This script initializes the network connection, creates a new user, and generates a BTC wallet address for them. Ensure the index file path is correctly configured relative to your script location. ```javascript //using the index file, get access to the functions we will be using throughout //Note: make sure the index file is pointed in the correct relative folder to this //script const Network = require('../index'); const network = new Network({ apiUrl: 'https://api.hollaex.network', apiKey: '', apiSecret: '', activation_code: '', }); //main function for adding user and their address (async () => { try { //initialise the network const init = await network.init(); //check user list before addition of new user console.log(await network.getUsers()) //create new user await network.createUser('hello4@gmail.com') //compare our list with the new user added console.log(await network.getUsers()) //store this list in variable let newUserList = await network.getUsers() //get the newest (first) item in this array let newestUser = newUserList.data[0] //See our new users information before adding a crypto wallet console.log(await network.getUser(newestUser.id)) //create btc address for the newest user await network.createUserCryptoAddress(newestUser.id, 'btc') //compare user data now with a btc wallet address console.log(await network.getUser(newestUser.id)) } catch (err) { console.log(err) } }) (); ``` -------------------------------- ### Apply Web Configuration Source: https://docs.hollaex.com/get-started/on-premise-exchange-setup/use-custom-domain.md Applies the web image configuration using the specified registry and tag. ```bash hollaex web --apply --registry --tag ``` -------------------------------- ### Navigate to plugins directory Source: https://docs.hollaex.com/plugins/develop-plugins/development-walkthrough-hello-plugin/initialization.md Change the current working directory to the plugins folder from the HollaEx root. ```bash cd plugins ``` -------------------------------- ### GET /status Source: https://docs.hollaex.com/plugins/use-plugins/transak-fiat-on-off-ramp.md Returns the user's last 90 days of Transak orders. ```APIDOC ## GET /plugins/transak/status ### Description Returns the user's last 90 days of Transak orders (matched by partnerCustomerId = user.network_id and by the user's wallet addresses). ### Method GET ### Endpoint /plugins/transak/status ``` -------------------------------- ### GET /user Source: https://docs.hollaex.com/how-tos/fiat-controls/developer-controls-client-side-integration.md Retrieves user profile information, including saved bank accounts. ```APIDOC ## GET /user ### Description Fetches user data, including the bank_account list. ### Method GET ### Endpoint /user ``` -------------------------------- ### Initialize hello-plugin script.js Source: https://docs.hollaex.com/plugins/develop-plugins/development-walkthrough-hello-plugin/scripting.md Defines the server-side logic for the hello-plugin, including configuration validation and an Express route for plugin information. ```javascript 'use strict'; const { publicMeta, meta } = this.configValues; const { app, loggerPlugin, toolsLib } = this.pluginLibraries; const helloWorld = require('hello-world-npm'); const moment = require('moment'); const init = async () => { loggerPlugin.info( 'HELLO-PLUGIN PLUGIN initializing...' ); if (!meta.private_message.value) { throw new Error('Configuration value private required'); } }; init() .then(() => { app.get('/plugins/hello-plugin/info', (req, res) => { loggerPlugin.verbose( req.uuid, 'GET /plugins/hello-plugin/info' ); return res.json({ public_message: publicMeta.public_message.value, private_message: meta.private_message.value, library_message: helloWorld(), moment_timestamp: moment().toISOString(), exchange_info: toolsLib.getKitConfig().info }); }); }) .catch((err) => { loggerPlugin.error( 'HELLO-PLUGIN PLUGIN error during initialization', err.message ); }); ``` -------------------------------- ### Fill missing initial configurations Source: https://docs.hollaex.com/get-started/troubleshooting-guide.md Checks for blank initial configuration values and populates them from the local HollaEx Kit settings. ```bash hollaex toolbox --check_config ``` -------------------------------- ### Define the config.json file for hello-plugin Source: https://docs.hollaex.com/plugins/develop-plugins/development-walkthrough-hello-plugin/configuration.md The complete configuration file for the hello-plugin, defining metadata, meta objects, and script hooks. ```json { "name": "hello-plugin", "version": 1, "type": null, "author": "You", "bio": "A short description", "description": "This is a longer description of your first plugin", "documentation": null, "logo": null, "icon": null, "url": null, "public_meta": { "public_message": { "type": "string", "required": false, "description": "I can be seen by anyone!", "value": "Hello, this text is from the plugin!" } }, "meta": { "private_message": { "type": "string", "required": false, "description": "I can only be seen by some!", "value": "Hi, this is the secret text from the plugin!" } }, "prescript": { "install": ["hello-world-npm"], "run": null }, "postscript": { "run": null } } ``` -------------------------------- ### Navigate to the HollaEx Kit directory Source: https://docs.hollaex.com/get-started/on-premise-exchange-setup/installation.md Changes the current working directory to the newly cloned HollaEx Kit folder. ```bash cd hollaex-kit ``` -------------------------------- ### Render Deposit Methods UI Source: https://docs.hollaex.com/how-tos/fiat-controls/developer-controls-client-side-integration.md Iterate through available on-ramp methods to render manual deposit instructions or mount plugin processors. ```js const methods = onramp?.[currency] || {}; Object.entries(methods).forEach(([methodKey, { type, data }]) => { // render a tab; for "manual" show `data` rows, for "plugin" mount the `data` processor }); ``` -------------------------------- ### Configure Site Base Path and SPA Behavior Source: https://docs.hollaex.com/advanced/customizing-your-frontend-projects-with-hollacloud-json.md Define the base path for mounted projects and explicitly enable SPA fallback behavior. ```json { "site": { "basePath": "/docs", "spa": true } } ``` -------------------------------- ### Connect to HollaEx Websocket with Node.js Source: https://docs.hollaex.com/developers/api-guide.md Initialize the HollaEx client with the required wsURL and subscribe to orderbook and trade events. ```javascript const hollaex = require("hollaex-node-lib"); const client = new hollaex({ apiURL: "/api", wsURL: "/stream", apiKey: "", apiSecret: "", }); client.connect(['orderbook', 'trade']); client.ws.on('message', (data) => { data = JSON.parse(data); console.log(data); }); ``` -------------------------------- ### GET /market_pair Source: https://docs.hollaex.com/plugins/use-plugins/transak-fiat-on-off-ramp.md Returns the resolved Transak network and active payment methods for a specific pair and transaction type. ```APIDOC ## GET /plugins/transak/market_pair ### Description Returns the resolved Transak network and the active payment methods (with min/max limits) for that pair and direction. ### Method GET ### Endpoint /plugins/transak/market_pair ### Parameters #### Query Parameters - **pair** (string) - Required - The currency pair in format _ - **transaction_type** (string) - Required - The type of transaction, either 'buy' or 'sell' ``` -------------------------------- ### Create Form.js Component Source: https://docs.hollaex.com/plugins/develop-plugins/web-view-development/basic-tutorial-hello-exchange-plugin-web-view.md Command to create the Form.js file. ```bash touch src/plugins/hello-exchange/views/view/Form.js ``` -------------------------------- ### GET /currencies Source: https://docs.hollaex.com/plugins/use-plugins/transak-fiat-on-off-ramp.md Lists fiat and crypto symbols supported by Transak for your partner account that are also present on the exchange. ```APIDOC ## GET /plugins/transak/currencies ### Description Lists fiat and crypto symbols Transak supports for your partner account and are present on the exchange. Cached for 1 hour. ### Method GET ### Endpoint /plugins/transak/currencies ``` -------------------------------- ### Enter the HollaEx Server Container Source: https://docs.hollaex.com/developers/run-dev-mode.md Access the server container shell to execute plugin-related commands. ```bash docker exec -it server_hollaex-kit-server_1 /bin/bash ``` -------------------------------- ### Restart Server Development Mode Source: https://docs.hollaex.com/developers/run-dev-mode.md Execute this command within the /server directory to resume the server environment. ```bash docker-compose up ``` -------------------------------- ### Backup Database Source: https://docs.hollaex.com/get-started/cli-how-tos/upgrade-exchange.md Command to create a backup of your exchange database. ```bash hollaex toolbox --backup ```