### Install Dependencies and Run RGB Proxy Server Source: https://github.com/rgb-tools/rgb-proxy-server/blob/master/README.md Commands to install dependencies, run the server in development mode, build for production, and start the production build. ```sh npm install ``` ```sh npm run dev ``` ```sh npm run build ``` ```sh npm run start ``` -------------------------------- ### Start Production Server Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Launches the production server after a build. ```shell npm run start ``` -------------------------------- ### Install Project Dependencies Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Installs all necessary Node.js dependencies for the project. ```shell npm install ``` -------------------------------- ### Install Dependencies Source: https://github.com/rgb-tools/rgb-proxy-server/blob/master/README.md Installs project dependencies using npm. Run this command before other development tasks. ```sh npm run install ``` -------------------------------- ### Run Docker Container (Basic) Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Starts the RGB Proxy Server in a Docker container with ephemeral storage, exposing port 3000. ```shell docker run -d -p 3000:3000 ghcr.io/rgb-tools/rgb-proxy-server ``` -------------------------------- ### Run Development Server Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Starts the development server with hot reloading enabled, typically on port 3000. ```shell npm run dev ``` -------------------------------- ### Override Data Directory via Environment Variable Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Starts the server while specifying a custom directory for persistent data using the `APP_DATA` environment variable. ```shell APP_DATA=/var/data/rgb-proxy-server npm run start ``` -------------------------------- ### Override Port via Environment Variable Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Starts the server on a different port by setting the `PORT` environment variable. ```shell PORT=8080 npm run start ``` -------------------------------- ### Retrieve Server Information Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Use this method to get the server version, RGB HTTP JSON-RPC protocol version, and uptime. Useful for health checks and compatibility verification. ```sh curl -X POST -H 'Content-Type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "server.info"}' \ http://localhost:3000/json-rpc ``` ```json { "jsonrpc": "2.0", "id": 1, "result": { "version": "0.3.0", "protocol_version": "0.2", "uptime": 42 } } ``` -------------------------------- ### Get Consignment Source: https://github.com/rgb-tools/rgb-proxy-server/blob/master/README.md The payee requests the consignment file associated with a given identifier. ```APIDOC ## GET /json-rpc ### Description Retrieves a consignment file from the RGB proxy server. ### Method POST ### Endpoint /json-rpc ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC protocol version. - **id** (string) - Required - Request ID. - **method** (string) - Required - The method name, should be `consignment.get`. - **params** (object) - Required - Parameters for the method. - **recipient_id** (string) - Required - The blinded UTXO identifier. ### Request Example ```sh curl -X POST -H 'Content-Type: application/json' \ -d '{"jsonrpc": "2.0", "id": "2", "method": "consignment.get", "params": {"recipient_id": "blindTest"} }' \ localhost:3000/json-rpc ``` ### Response #### Success Response (200) - **jsonrpc** (string) - JSON-RPC protocol version. - **id** (string) - Request ID. - **result** (object) - The retrieved consignment data. - **consignment** (string) - Base64 encoded consignment data. - **txid** (string) - The transaction ID associated with the consignment. #### Response Example ```json { "jsonrpc": "2.0", "id": "2", "result": {"consignment": "Y29uc2lnbm1lbnQgYmluYXJ5IGRhdGEK", "txid": "527f2b2ebb81c873f128848d7226ecdb7cb4a4025222c54bfec7c358d51b9207"} } ``` ``` -------------------------------- ### Get Acknowledgement Status Source: https://github.com/rgb-tools/rgb-proxy-server/blob/master/README.md The payer requests the acknowledgement status of a previously posted consignment. ```APIDOC ## GET /json-rpc ### Description Retrieves the acknowledgement status of a consignment. ### Method POST ### Endpoint /json-rpc ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC protocol version. - **id** (string) - Required - Request ID. - **method** (string) - Required - The method name, should be `ack.get`. - **params** (object) - Required - Parameters for the method. - **recipient_id** (string) - Required - The blinded UTXO identifier. ### Request Example ```sh curl -X POST -H 'Content-Type: application/json' \ -d '{"jsonrpc": "2.0", "id": "5", "method": "ack.get", "params": {"recipient_id": "blindTest"} }' \ localhost:3000/json-rpc ``` ### Response #### Success Response (200) - **jsonrpc** (string) - JSON-RPC protocol version. - **id** (string) - Request ID. - **result** (boolean | null) - `true` if acknowledged, `false` if rejected, `null` if no acknowledgement has been posted yet. #### Response Example ```json { "jsonrpc": "2.0", "id": "5", "result": true } ``` ``` -------------------------------- ### Build Production Application Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Creates a production-ready build of the application. ```shell npm run build ``` -------------------------------- ### Run Docker Container (Persistent Data) Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Runs the RGB Proxy Server in Docker with persistent data storage. Ensure the host directory is owned by UID/GID 1000. ```shell mkdir -p /data/rgb-proxy-server sudo chown 1000:1000 /data/rgb-proxy-server docker run -d -p 3000:3000 \ -v /data/rgb-proxy-server:/home/node/.rgb-proxy-server \ ghcr.io/rgb-tools/rgb-proxy-server ``` -------------------------------- ### Run Test Suite Source: https://github.com/rgb-tools/rgb-proxy-server/blob/master/README.md Executes the project's test suite using npm. Ensure all tests pass to verify code integrity. ```sh npm run test ``` -------------------------------- ### Run RGB Proxy Server in Docker Source: https://github.com/rgb-tools/rgb-proxy-server/blob/master/README.md Command to run the RGB proxy server using Docker. For data persistence, mount a host path to `/home/node/.rgb-proxy-server` inside the container, ensuring it's owned by user and group `1000`. ```sh docker run -d ghcr.io/rgb-tools/rgb-proxy-server ``` -------------------------------- ### server.info Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Retrieves the server version, the implemented RGB HTTP JSON-RPC protocol version, and the process uptime. This is useful for health checks and verifying compatibility. ```APIDOC ## server.info ### Description Retrieve server version and uptime. ### Method POST ### Endpoint /json-rpc ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC protocol version. - **id** (number or string) - Required - Request ID. - **method** (string) - Required - Must be "server.info". ### Request Example ```json { "jsonrpc": "2.0", "id": 1, "method": "server.info" } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - JSON-RPC protocol version. - **id** (number or string) - Request ID. - **result** (object) - Contains server information. - **version** (string) - Application version. - **protocol_version** (string) - Implemented RGB HTTP JSON-RPC protocol version. - **uptime** (number) - Process uptime in seconds. ### Response Example ```json { "jsonrpc": "2.0", "id": 1, "result": { "version": "0.3.0", "protocol_version": "0.2", "uptime": 42 } } ``` ``` -------------------------------- ### Format Code Source: https://github.com/rgb-tools/rgb-proxy-server/blob/master/README.md Formats the project's code according to predefined style guidelines using npm. This ensures code consistency. ```sh npm run format ``` -------------------------------- ### Post Consignment File to RGB Proxy Server Source: https://github.com/rgb-tools/rgb-proxy-server/blob/master/README.md Use `curl` to send a fake consignment file and its transaction ID to the proxy server. The `recipient_id` should match the blinded UTXO from the invoice. The `file` parameter uploads the consignment. ```sh # let's create a fake consignment file and send it echo "consignment binary data" > consignment.rgb curl -X POST -H 'Content-Type: multipart/form-data' \ -F 'jsonrpc=2.0' -F 'id="1"' -F 'method=consignment.post' \ -F 'params[recipient_id]=blindTest' -F 'params[txid]=527f2b2ebb81c873f128848d7226ecdb7cb4a4025222c54bfec7c358d51b9207' -F 'file=@consignment.rgb' \ localhost:3000/json-rpc ``` -------------------------------- ### Request Consignment File from RGB Proxy Server Source: https://github.com/rgb-tools/rgb-proxy-server/blob/master/README.md Use `curl` to request a consignment file from the proxy server using the `recipient_id` (blinded UTXO). The server returns the consignment as a base64-encoded string. ```sh curl -X POST -H 'Content-Type: application/json' \ -d '{"jsonrpc": "2.0", "id": "2", "method": "consignment.get", "params": {"recipient_id": "blindTest"} }' \ localhost:3000/json-rpc ``` -------------------------------- ### Set Log Level via Environment Variable Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Configures the server's logging verbosity by setting the `LOG_LEVEL` environment variable. ```shell LOG_LEVEL=info npm run start ``` -------------------------------- ### Upload Media/Attachment File Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Uploads an arbitrary media file identified by an `attachment_id`. Returns `true` on the first upload, `false` on duplicates, and errors on conflicting uploads. Ensure the `attachment_id` is provided. ```shell curl -X POST -H 'Content-Type: multipart/form-data' \ -F 'jsonrpc=2.0' \ -F 'id="6"' \ -F 'method=media.post' \ -F 'params[attachment_id]=abc123def456' \ -F 'file=@artwork.png' \ http://localhost:3000/json-rpc ``` -------------------------------- ### Run Linter Source: https://github.com/rgb-tools/rgb-proxy-server/blob/master/README.md Runs the linter to check for code style issues and potential errors using npm. This helps maintain code quality. ```sh npm run lint ``` -------------------------------- ### consignment.post Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Uploads an RGB consignment file. This method is used by the payer and accepts the consignment file, recipient ID, transaction ID, and an optional output index (vout). It stores the file based on its SHA-256 hash. ```APIDOC ## consignment.post ### Description Upload an RGB consignment file. ### Method POST ### Endpoint /json-rpc ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC protocol version. - **id** (number or string) - Required - Request ID. - **method** (string) - Required - Must be "consignment.post". - **params** (object) - Required - Parameters for the consignment post. - **recipient_id** (string) - Required - The payee's recipient ID (e.g., blinded UTXO). - **txid** (string) - Required - The Bitcoin transaction ID. - **vout** (number) - Optional - The output index in the transaction. - **file** (file) - Required - The RGB consignment file (multipart/form-data). ### Request Example ```sh curl -X POST -H 'Content-Type: multipart/form-data' \ -F 'jsonrpc=2.0' \ -F 'id="1"' \ -F 'method=consignment.post' \ -F 'params[recipient_id]=utxob:zlsjuqz2-tH9K...' \ -F 'params[txid]=527f2b2ebb81c873f128848d7226ecdb7cb4a4025222c54bfec7c358d51b9207' \ -F 'params[vout]=0' \ -F 'file=@consignment.rgb' \ http://localhost:3000/json-rpc ``` ### Response #### Success Response (200) - **jsonrpc** (string) - JSON-RPC protocol version. - **id** (number or string) - Request ID. - **result** (boolean) - `true` if the file was uploaded successfully, `false` if the identical file was re-submitted. ### Response Example (first upload) ```json {"jsonrpc":"2.0","id":"1","result":true} ``` ### Response Example (re-submission) ```json {"jsonrpc":"2.0","id":"1","result":false} ``` ### Error Handling - **-101**: Cannot change uploaded file (if a different file is submitted for the same recipient ID). ``` -------------------------------- ### media.post Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Uploads an arbitrary media file (e.g., an NFT image or asset artwork) identified by an `attachment_id`. Returns `true` on first upload, `false` on duplicate, and errors on conflicting uploads. ```APIDOC ## POST /json-rpc ### Description Uploads an arbitrary media file (e.g., an NFT image or asset artwork) identified by an `attachment_id`. Returns `true` on first upload, `false` on duplicate, and errors on conflicting uploads. ### Method POST ### Endpoint /json-rpc ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC protocol version. - **id** (string) - Required - Unique identifier for the request. - **method** (string) - Required - The method name, must be `media.post`. - **params** (object) - Required - Parameters for the method. - **attachment_id** (string) - Required - The unique identifier for the media attachment. - **file** (file) - Required - The media file to upload. ### Request Example ```sh curl -X POST -H 'Content-Type: multipart/form-data' \ -F 'jsonrpc=2.0' \ -F 'id="6"' \ -F 'method=media.post' \ -F 'params[attachment_id]=abc123def456' \ -F 'file=@artwork.png' \ http://localhost:3000/json-rpc ``` ### Response #### Success Response (200) - **jsonrpc** (string) - JSON-RPC protocol version. - **id** (string) - Unique identifier for the request. - **result** (boolean) - `true` on first upload, `false` on duplicate. #### Response Example Response (first upload): ```json { "jsonrpc": "2.0", "id": "6", "result": true } ``` #### Error Response - **code** (integer) - Error code. - **message** (string) - Error message. Example (missing attachment_id): ```json { "jsonrpc": "2.0", "id": "6", "error": {"code": -301, "message": "Missing attachment ID"} } ``` ``` -------------------------------- ### consignment.get Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Downloads an RGB consignment file. This method is used by the payee to retrieve a consignment previously uploaded by the payer using `consignment.post`. It requires the recipient ID and returns the consignment data, transaction ID, and vout. ```APIDOC ## consignment.get ### Description Download an RGB consignment file. ### Method POST ### Endpoint /json-rpc ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC protocol version. - **id** (number or string) - Required - Request ID. - **method** (string) - Required - Must be "consignment.get". - **params** (object) - Required - Parameters for the consignment get. - **recipient_id** (string) - Required - The recipient ID associated with the consignment. ### Request Example ```json { "jsonrpc": "2.0", "id": "2", "method": "consignment.get", "params": {"recipient_id": "utxob:zlsjuqz2-tH9K..."} } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - JSON-RPC protocol version. - **id** (number or string) - Request ID. - **result** (object) - Contains consignment details. - **consignment** (string) - The base64-encoded consignment file content. - **txid** (string) - The Bitcoin transaction ID. - **vout** (number) - The output index in the transaction. ### Response Example ```json { "jsonrpc": "2.0", "id": "2", "result": { "consignment": "Y29uc2lnbm1lbnQgYmluYXJ5IGRhdGEK", "txid": "527f2b2ebb81c873f128848d7226ecdb7cb4a4025222c54bfec7c358d51b9207", "vout": 0 } } ``` ### Error Handling - **-400**: Consignment file not found for the given recipient ID. ``` -------------------------------- ### Download RGB Consignment File Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Called by the payee to retrieve an uploaded consignment file. Requires the recipient ID and returns the consignment as a base64-encoded string, along with the txid and optional vout. Returns error code -400 if no consignment is found for the given recipient ID. ```sh curl -X POST -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": "2", "method": "consignment.get", "params": {"recipient_id": "utxob:zlsjuqz2-tH9K..."} }' \ http://localhost:3000/json-rpc ``` ```json { "jsonrpc": "2.0", "id": "2", "result": { "consignment": "Y29uc2lnbm1lbnQgYmluYXJ5IGRhdGEK", "txid": "527f2b2ebb81c873f128848d7226ecdb7cb4a4025222c54bfec7c358d51b9207", "vout": 0 } } ``` ```bash echo 'Y29uc2lnbm1lbnQgYmluYXJ5IGRhdGEK' | base64 -d ``` ```text consignment binary data ``` ```json {"jsonrpc":"2.0","id":"2","error":{"code":-400,"message":"Consignment file not found"}} ``` -------------------------------- ### Post Consignment Source: https://github.com/rgb-tools/rgb-proxy-server/blob/master/README.md The payer posts a consignment file to the server, using the blinded UTXO as an identifier. ```APIDOC ## POST /json-rpc ### Description Posts a consignment file to the RGB proxy server. ### Method POST ### Endpoint /json-rpc ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC protocol version. - **id** (string) - Required - Request ID. - **method** (string) - Required - The method name, should be `consignment.post`. - **params** (object) - Required - Parameters for the method. - **recipient_id** (string) - Required - The blinded UTXO identifier. - **txid** (string) - Required - The transaction ID associated with the consignment. - **file** (file) - Required - The consignment file to upload. ### Request Example ```sh curl -X POST -H 'Content-Type: multipart/form-data' \ -F 'jsonrpc=2.0' -F 'id="1"' -F 'method=consignment.post' \ -F 'params[recipient_id]=blindTest' -F 'params[txid]=527f2b2ebb81c873f128848d7226ecdb7cb4a4025222c54bfec7c358d51b9207' -F 'file=@consignment.rgb' \ localhost:3000/json-rpc ``` ### Response #### Success Response (200) - **jsonrpc** (string) - JSON-RPC protocol version. - **id** (string) - Request ID. - **result** (boolean) - Indicates if the consignment was posted successfully. #### Response Example ```json { "jsonrpc": "2.0", "id": "1", "result": true } ``` ``` -------------------------------- ### Download Media/Attachment File Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Retrieves a previously uploaded media file by its `attachment_id`. The raw bytes are returned as a base64-encoded string. An error is returned if the attachment ID is not found. ```shell curl -X POST -H 'Content-Type: application/json' \ -d '{ \ "jsonrpc": "2.0", \ "id": "7", \ "method": "media.get", \ "params": {"attachment_id": "abc123def456"} \ }' \ http://localhost:3000/json-rpc ``` ```shell curl -s -X POST -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","id":"7","method":"media.get","params":{"attachment_id":"abc123def456"}}' \ http://localhost:3000/json-rpc \ | jq -r '.result' | base64 -d > artwork.png ``` -------------------------------- ### Fix Lint Issues Source: https://github.com/rgb-tools/rgb-proxy-server/blob/master/README.md Automatically fixes common linting issues found in the code using npm. Run this command to resolve style violations. ```sh npm run lint:fix ``` -------------------------------- ### Request ACK Status from RGB Proxy Server Source: https://github.com/rgb-tools/rgb-proxy-server/blob/master/README.md Use `curl` to request the acknowledgment status for a consignment from the proxy server using the `recipient_id`. The response will be `null` if the payee has not yet called `ack.post`. ```sh curl -X POST -H 'Content-Type: application/json' \ -d '{"jsonrpc": "2.0", "id": "5", "method": "ack.get", "params": {"recipient_id": "blindTest"} }' \ localhost:3000/json-rpc ``` -------------------------------- ### Acknowledge Consignment with ACK Source: https://github.com/rgb-tools/rgb-proxy-server/blob/master/README.md Use `curl` to send an acknowledgment (ACK) for a consignment to the proxy server. Set `ack` to `true` if the consignment is valid. ```sh curl -X POST -H 'Content-Type: application/json' \ -d '{"jsonrpc": "2.0", "id": "3", "method": "ack.post", "params": {"recipient_id": "blindTest", "ack": true} }' \ localhost:3000/json-rpc ``` -------------------------------- ### media.get Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Retrieves a previously uploaded media file by its `attachment_id`, returning the raw bytes as a base64-encoded string. Returns error `-401` if the attachment ID is not found. ```APIDOC ## POST /json-rpc ### Description Retrieves a previously uploaded media file by its `attachment_id`, returning the raw bytes as a base64-encoded string. Returns error `-401` if the attachment ID is not found. ### Method POST ### Endpoint /json-rpc ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC protocol version. - **id** (string) - Required - Unique identifier for the request. - **method** (string) - Required - The method name, must be `media.get`. - **params** (object) - Required - Parameters for the method. - **attachment_id** (string) - Required - The unique identifier for the media attachment. ### Request Example ```json { "jsonrpc": "2.0", "id": "7", "method": "media.get", "params": {"attachment_id": "abc123def456"} } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - JSON-RPC protocol version. - **id** (string) - Unique identifier for the request. - **result** (string) - The raw bytes of the media file, base64-encoded. #### Response Example ```json { "jsonrpc": "2.0", "id": "7", "result": "iVBORw0KGgoAAAANSUhEUgAA..." } ``` #### Error Response - **code** (integer) - Error code. - **message** (string) - Error message. Example (not found): ```json { "jsonrpc": "2.0", "id": "7", "error": {"code": -401, "message": "Media file not found"} } ``` ### Usage Example (Decoding and Saving) ```sh curl -s -X POST -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","id":"7","method":"media.get","params":{"attachment_id":"abc123def456"}}' \ http://localhost:3000/json-rpc \ | jq -r '.result' | base64 -d > artwork.png ``` ``` -------------------------------- ### Send Payee ACK/NACK for Consignment Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Use this method to acknowledge or reject a consignment. The recipient ID must be valid. A `false` value for `ack` indicates a NACK. ```shell curl -X POST -H 'Content-Type: application/json' \ -d '{ \ "jsonrpc": "2.0", \ "id": "4", \ "method": "ack.post", \ "params": {"recipient_id": "utxob:zlsjuqz2-tH9K...", "ack": false} \ }' \ http://localhost:3000/json-rpc ``` -------------------------------- ### Upload RGB Consignment File Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Called by the payer to upload an RGB consignment file. Accepts the file via multipart upload along with recipient ID, txid, and optional vout. Returns true on first upload, false if the file is re-submitted, or an error if a different file is submitted for the same recipient ID. ```sh # Create a sample consignment file echo "consignment binary data" > consignment.rgb curl -X POST -H 'Content-Type: multipart/form-data' \ -F 'jsonrpc=2.0' \ -F 'id="1"' \ -F 'method=consignment.post' \ -F 'params[recipient_id]=utxob:zlsjuqz2-tH9K...' \ -F 'params[txid]=527f2b2ebb81c873f128848d7226ecdb7cb4a4025222c54bfec7c358d51b9207' \ -F 'params[vout]=0' \ -F 'file=@consignment.rgb' \ http://localhost:3000/json-rpc ``` ```json {"jsonrpc":"2.0","id":"1","result":true} ``` ```json {"jsonrpc":"2.0","id":"1","result":false} ``` ```json {"jsonrpc":"2.0","id":"1","error":{"code":-101,"message":"Cannot change uploaded file"}} ``` -------------------------------- ### Post ACK or NACK for Consignment Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Called by the payee after validating a consignment. Pass `"ack": true` to approve or `"ack": false` to reject. The value is immutable; re-submitting the same boolean returns false, while submitting the opposite value returns error -100. ```sh # Payee ACKs the consignment (validation passed) curl -X POST -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": "3", "method": "ack.post", "params": {"recipient_id": "utxob:zlsjuqz2-tH9K...", "ack": true} }' \ http://localhost:3000/json-rpc ``` -------------------------------- ### Acknowledge Consignment with NACK Source: https://github.com/rgb-tools/rgb-proxy-server/blob/master/README.md Use `curl` to send a negative acknowledgment (NACK) for a consignment to the proxy server. Set `ack` to `false` if the consignment is invalid. ```sh curl -X POST -H 'Content-Type: application/json' \ -d '{"jsonrpc": "2.0", "id": "4", "method": "ack.post", "params": {"recipient_id": "blindTest", "ack": false} }' \ localhost:3000/json-rpc ``` -------------------------------- ### Decode Base64 Consignment Data Source: https://github.com/rgb-tools/rgb-proxy-server/blob/master/README.md Decode the base64-encoded consignment data received from the proxy server using the `base64` command. ```sh echo 'Y29uc2lnbm1lbnQgYmluYXJ5IGRhdGEK' | base64 -d ``` -------------------------------- ### ack.post Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Allows the payee to acknowledge or reject a consignment. This method is called by the payee after validating the consignment. ```APIDOC ## POST /json-rpc ### Description Allows the payee to acknowledge or reject a consignment. This method is called by the payee after validating the consignment. ### Method POST ### Endpoint /json-rpc ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC protocol version. - **id** (string) - Required - Unique identifier for the request. - **method** (string) - Required - The method name, must be `ack.post`. - **params** (object) - Required - Parameters for the method. - **recipient_id** (string) - Required - The unique identifier of the consignment recipient. - **ack** (boolean) - Required - `true` to acknowledge, `false` to reject. ### Request Example ```json { "jsonrpc": "2.0", "id": "4", "method": "ack.post", "params": {"recipient_id": "utxob:zlsjuqz2-tH9K...", "ack": false} } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - JSON-RPC protocol version. - **id** (string) - Unique identifier for the request. - **result** (boolean) - `true` if the ACK/NACK was processed successfully. #### Response Example ```json { "jsonrpc": "2.0", "id": "4", "result": true } ``` #### Error Response - **code** (integer) - Error code. - **message** (string) - Error message. Example (attempt to change an already-set ACK): ```json { "jsonrpc": "2.0", "id": "5", "error": {"code": -100, "message": "Cannot change ACK"} } ``` ``` -------------------------------- ### ack.post Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Posts an acknowledgment (ACK) or rejection (NACK) for a consignment. This method is called by the payee after validating the consignment. The ACK/NACK status is immutable once set. ```APIDOC ## ack.post ### Description Post an ACK or NACK for a consignment. ### Method POST ### Endpoint /json-rpc ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC protocol version. - **id** (number or string) - Required - Request ID. - **method** (string) - Required - Must be "ack.post". - **params** (object) - Required - Parameters for the ACK post. - **recipient_id** (string) - Required - The recipient ID associated with the consignment. - **ack** (boolean) - Required - `true` to acknowledge (approve), `false` to reject (NACK). ### Request Example ```json { "jsonrpc": "2.0", "id": "3", "method": "ack.post", "params": {"recipient_id": "utxob:zlsjuqz2-tH9K...", "ack": true} } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - JSON-RPC protocol version. - **id** (number or string) - Request ID. - **result** (boolean) - `true` if the ACK/NACK was set successfully, `false` if the same status was re-submitted. ### Response Example (successful ACK) ```json {"jsonrpc":"2.0","id":"3","result":true} ``` ### Error Handling - **-100**: Cannot change ACK/NACK status if it has already been set to the opposite value. ``` -------------------------------- ### ack.get Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Called by the payer to poll whether the payee has validated the consignment. Returns `true` (ACK), `false` (NACK), or `null` if the payee has not yet called `ack.post`. If the recipient ID is not found at all, error `-400` is returned. ```APIDOC ## POST /json-rpc ### Description Called by the payer to poll whether the payee has validated the consignment. Returns `true` (ACK), `false` (NACK), or `null` if the payee has not yet called `ack.post`. If the recipient ID is not found at all, error `-400` is returned. ### Method POST ### Endpoint /json-rpc ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC protocol version. - **id** (string) - Required - Unique identifier for the request. - **method** (string) - Required - The method name, must be `ack.get`. - **params** (object) - Required - Parameters for the method. - **recipient_id** (string) - Required - The unique identifier of the consignment recipient. ### Request Example ```json { "jsonrpc": "2.0", "id": "5", "method": "ack.get", "params": {"recipient_id": "utxob:zlsjuqz2-tH9K..."} } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - JSON-RPC protocol version. - **id** (string) - Unique identifier for the request. - **result** (boolean | null) - `true` if ACKed, `false` if NACKed, `null` if pending. #### Response Example Response when ACKed: ```json { "jsonrpc": "2.0", "id": "5", "result": true } ``` Response when NACKed: ```json { "jsonrpc": "2.0", "id": "5", "result": false } ``` Response when pending: ```json { "jsonrpc": "2.0", "id": "5", "result": null } ``` #### Error Response - **code** (integer) - Error code. - **message** (string) - Error message. Example (recipient ID not found): ```json { "jsonrpc": "2.0", "id": "5", "error": {"code": -400, "message": "Consignment file not found"} } ``` ``` -------------------------------- ### Acknowledge Consignment Source: https://github.com/rgb-tools/rgb-proxy-server/blob/master/README.md The payee acknowledges or rejects a consignment, informing the payer of its validity. ```APIDOC ## POST /json-rpc ### Description Acknowledges or rejects a consignment file. ### Method POST ### Endpoint /json-rpc ### Parameters #### Request Body - **jsonrpc** (string) - Required - JSON-RPC protocol version. - **id** (string) - Required - Request ID. - **method** (string) - Required - The method name, should be `ack.post`. - **params** (object) - Required - Parameters for the method. - **recipient_id** (string) - Required - The blinded UTXO identifier. - **ack** (boolean) - Required - `true` to acknowledge, `false` to reject. ### Request Example ```sh # Acknowledge curl -X POST -H 'Content-Type: application/json' \ -d '{"jsonrpc": "2.0", "id": "3", "method": "ack.post", "params": {"recipient_id": "blindTest", "ack": true} }' \ localhost:3000/json-rpc # Reject curl -X POST -H 'Content-Type: application/json' \ -d '{"jsonrpc": "2.0", "id": "4", "method": "ack.post", "params": {"recipient_id": "blindTest", "ack": false} }' \ localhost:3000/json-rpc ``` ### Response #### Success Response (200) - **jsonrpc** (string) - JSON-RPC protocol version. - **id** (string) - Request ID. - **result** (boolean) - Indicates if the acknowledgement was posted successfully. #### Response Example ```json { "jsonrpc": "2.0", "id": "3", "result": true } ``` ``` -------------------------------- ### Check Consignment ACK/NACK Status Source: https://context7.com/rgb-tools/rgb-proxy-server/llms.txt Called by the payer to poll the ACK/NACK status of a consignment. Returns `true` for ACK, `false` for NACK, or `null` if pending. An error is returned if the recipient ID is not found. ```shell curl -X POST -H 'Content-Type: application/json' \ -d '{ \ "jsonrpc": "2.0", \ "id": "5", \ "method": "ack.get", \ "params": {"recipient_id": "utxob:zlsjuqz2-tH9K..."} \ }' \ http://localhost:3000/json-rpc ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.