### HTTP GET Request Example Source: https://docs.tenbinlabs.xyz/solution-overview/minting-and-redemption/order-validation Demonstrates how to query documentation dynamically by making an HTTP GET request to the current page URL with an 'ask' query parameter. This is useful for retrieving specific information not explicitly present or for clarification. ```http GET https://docs.tenbinlabs.xyz/solution-overview/minting-and-redemption/order-validation.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/orders Perform an HTTP GET request on the current page URL with the `ask` query parameter to dynamically query documentation. The question should be specific and self-contained. ```HTTP GET https://docs.tenbinlabs.xyz/api-documentation-and-sdks/orders.md?ask= ``` -------------------------------- ### Query Documentation with GET Request Source: https://docs.tenbinlabs.xyz/product/what-is-a-tenbin-asset To get more information not present on the current page, perform an HTTP GET request to the current page URL with the `ask` query parameter. The question should be specific and self-contained. ```http GET https://docs.tenbinlabs.xyz/product/what-is-a-tenbin-asset.md?ask= ``` -------------------------------- ### Query Documentation with HTTP GET Source: https://docs.tenbinlabs.xyz/product Perform an HTTP GET request to the current page URL with the `ask` query parameter to dynamically query the documentation. The question should be specific and self-contained. Use this when the answer is not explicitly present or for clarification. ```http GET https://docs.tenbinlabs.xyz/product.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/contract-addresses-and-api-urls To get information not explicitly on the page, make an HTTP GET request to the current URL with an 'ask' query parameter. The question should be specific and self-contained. ```http GET https://docs.tenbinlabs.xyz/api-documentation-and-sdks/contract-addresses-and-api-urls.md?ask= ``` -------------------------------- ### Query Documentation with GET Request Source: https://docs.tenbinlabs.xyz/hedging-and-risk/key-risks/liquidity-risk Perform an HTTP GET request to the current page URL with the `ask` query parameter to dynamically query documentation. Use this when information is not explicitly present, for clarification, or to retrieve related sections. ```http GET https://docs.tenbinlabs.xyz/hedging-and-risk/key-risks/liquidity-risk.md?ask= ``` -------------------------------- ### Querying Documentation Dynamically Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/websocket To get additional information not explicitly present on the page, perform an HTTP GET request with the `ask` query parameter. The question should be specific and self-contained. ```http GET https://docs.tenbinlabs.xyz/api-documentation-and-sdks/websocket.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.tenbinlabs.xyz/solution-overview/staking Perform an HTTP GET request to the current page URL with the 'ask' query parameter to dynamically query the documentation. The question should be specific and in natural language. ```http GET https://docs.tenbinlabs.xyz/solution-overview/staking.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.tenbinlabs.xyz/hedging-and-risk/hedging-system/external-dependencies Perform an HTTP GET request to query the documentation dynamically. Include a specific, self-contained question in natural language as the 'ask' query parameter. ```http GET https://docs.tenbinlabs.xyz/hedging-and-risk/hedging-system/external-dependencies.md?ask= ``` -------------------------------- ### Query Documentation with HTTP GET Source: https://docs.tenbinlabs.xyz/solution-overview/later-governance Use this method to retrieve information not explicitly present on the page, to ask clarifying questions, or to get related documentation. The question should be specific and self-contained. ```http GET https://docs.tenbinlabs.xyz/solution-overview/later-governance.md?ask= ``` -------------------------------- ### Query Documentation Dynamically with HTTP GET Source: https://docs.tenbinlabs.xyz/resources/later-faq Use this method to retrieve information not explicitly present on the page, to ask for clarification, or to get related documentation sections. The question should be specific and self-contained. ```http GET https://docs.tenbinlabs.xyz/resources/later-faq.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/models Perform an HTTP GET request with the 'ask' query parameter to retrieve specific information from the documentation. Use this for clarifications or additional context not explicitly present on the page. ```http GET https://docs.tenbinlabs.xyz/api-documentation-and-sdks/models.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.tenbinlabs.xyz/custody-and-partners/later-curators To get more information not directly on the page, perform an HTTP GET request to the current page URL with the 'ask' query parameter. The question should be specific and in natural language. ```http GET https://docs.tenbinlabs.xyz/custody-and-partners/later-curators.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/overview To get specific information not found on the page, make an HTTP GET request to the current page URL with an 'ask' query parameter. The question should be clear and self-contained. ```http GET https://docs.tenbinlabs.xyz/api-documentation-and-sdks/overview.md?ask= ``` -------------------------------- ### Query Documentation with 'ask' Parameter Source: https://docs.tenbinlabs.xyz/hedging-and-risk/key-risks/smart-contract-risk Perform an HTTP GET request to query documentation dynamically. Use the 'ask' query parameter with a specific, self-contained question in natural language. ```http GET https://docs.tenbinlabs.xyz/hedging-and-risk/key-risks/smart-contract-risk.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks Perform an HTTP GET request to query the documentation dynamically. Use the 'ask' query parameter with a specific, self-contained question in natural language. The response includes a direct answer and relevant excerpts. ```http GET https://docs.tenbinlabs.xyz/api-documentation-and-sdks.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/order-flows Perform an HTTP GET request to query the documentation dynamically using the `ask` query parameter. Use this when the answer is not explicitly present, you need clarification, or want to retrieve related documentation sections. ```HTTP GET https://docs.tenbinlabs.xyz/api-documentation-and-sdks/order-flows.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.tenbinlabs.xyz/resources/later-glossary Perform an HTTP GET request to query documentation dynamically. Use the 'ask' query parameter with a specific, self-contained question in natural language. ```http GET https://docs.tenbinlabs.xyz/resources/later-glossary.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.tenbinlabs.xyz/resources/general-disclosure Perform an HTTP GET request on the current page URL with the 'ask' query parameter to retrieve specific information. The question should be specific, self-contained, and in natural language. Use this for clarification or additional context. ```http GET https://docs.tenbinlabs.xyz/resources/general-disclosure.md?ask= ``` -------------------------------- ### GET /deployment OpenAPI Specification Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/orders This OpenAPI 3.1.0 specification defines the GET /deployment endpoint, which returns deployment contract addresses and the domain separator. It includes details on request parameters, response schemas for success (DeploymentApiResult) and error (ErrorResponseDoc). ```json {"openapi":"3.1.0","info":{"title":"Order Service API","version":"0.1.0"},"tags":[{"name":"orders","description":"Order lifecycle endpoints"}],"paths":{"/deployment":{"get":{"tags":["orders"],"description":"Returns deployment contract addresses and domain separator.","operationId":"doc_get_deployment_info","responses":{"200":{"description":"Deployment info","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentApiResult"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDoc"}}}}}}}},"components":{"schemas":{"DeploymentApiResult":{"type":"object","description":"Deployment API result","required":["controller","domain_separator","collateral","token","staked_token"],"properties":{"collateral":{"type":"string","description":"Address of the collateral"},"controller":{"type":"string","description":"Controller address"},"domain_separator":{"type":"string","description":"Domain separator"},"staked_token":{"type":"string","description":"Address of the staked asset token (for staked-asset redemption redeems)"},"token":{"type":"string","description":"Address of the asset token"}}},"ErrorResponseDoc":{"type":"object","required":["status","error"],"properties":{"error":{"type":"string"},"status":{"type":"integer","format":"int32","minimum":0}}}}}} ``` -------------------------------- ### Get Deployment Info Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/orders Returns deployment contract addresses and domain separator. ```APIDOC ## GET /deployment ### Description Returns deployment contract addresses and domain separator. ### Method GET ### Endpoint /deployment ### Response #### Success Response (200) - **controller** (string) - Controller address - **domain_separator** (string) - Domain separator - **collateral** (string) - Address of the collateral - **token** (string) - Address of the asset token - **staked_token** (string) - Address of the staked asset token (for staked-asset redemption redeems) #### Response Example { "controller": "string", "domain_separator": "string", "collateral": "string", "token": "string", "staked_token": "string" } ``` -------------------------------- ### Querying Documentation Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/models You can query this documentation dynamically by performing an HTTP GET request with the `ask` query parameter. ```APIDOC GET https://docs.tenbinlabs.xyz/api-documentation-and-sdks/models.md?ask= ### Parameters #### Query Parameters - **ask** (string) - Required - Your specific question about the documentation. ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.tenbinlabs.xyz/solution-overview/later-reserve-funds Perform an HTTP GET request on the current page URL with the `ask` query parameter to retrieve additional information not directly available on the page. The question should be specific and self-contained. ```HTTP GET https://docs.tenbinlabs.xyz/solution-overview/later-reserve-funds.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.tenbinlabs.xyz/solution-overview/minting-and-redemption/off-market-hours Perform an HTTP GET request with the 'ask' query parameter to retrieve specific information not explicitly present on the page. The question should be self-contained and in natural language. ```HTTP GET https://docs.tenbinlabs.xyz/solution-overview/minting-and-redemption/off-market-hours.md?ask= ``` -------------------------------- ### Get Pending Orders Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/orders Retrieves a list of pending orders for the authenticated signer. Requires specific authentication headers including EVM address, timestamp, and signature. ```json { "openapi": "3.1.0", "info": { "title": "Order Service API", "version": "0.1.0" }, "tags": [ { "name": "orders", "description": "Order lifecycle endpoints" } ], "paths": { "/orders/pending": { "get": { "tags": [ "orders" ], "operationId": "doc_get_pending_orders", "parameters": [ { "name": "X-Auth-Address", "in": "header", "description": "Signer EVM address", "required": true, "schema": { "type": "string" } }, { "name": "X-Auth-Timestamp", "in": "header", "description": "Unix timestamp in seconds", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "X-Auth-Signature", "in": "header", "description": "EIP-191 personal_sign signature of `{METHOD}{PATH}{TIMESTAMP}`", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Pending orders for authenticated signer", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ApiOrder" } } } } }, "401": { "description": "Authentication failed" } } } } }, "components": { "schemas": { "ApiOrder": { "type": "object", "description": "Order response returned from API endpoints\n\nThis type represents an order as exposed through the REST API\n\nIt excludes internal implementation details like the recovered signer\nand database creation timestamp from certain contexts", "required": [ "id", "order_type", "order_status", "nonce", "expiry", "payer", "recipient", "collateral_token", "collateral_amount", "order_token", "asset_amount", "execution_type" ], "properties": { "asset_amount": { "type": "string", "description": "Asset amount" }, "collateral_amount": { "type": "string", "description": "Collateral amount" }, "collateral_token": { "type": "string", "description": "Collateral token address" }, "error": { "type": [ "string", "null" ], "description": "Error reason (populated when order_status is Failed)" }, "execution_type": { "$ref": "#/components/schemas/ExecutionType", "description": "Execution type (standard or cosigned)" }, "expiry": { "type": "integer", "format": "int64", "description": "Expiry timestamp" }, "id": { "type": "string", "format": "uuid", "description": "Order UUID" }, "nonce": { "type": "string", "description": "Unique nonce per payer" }, "order_status": { "$ref": "#/components/schemas/OrderStatus", "description": "Current status" }, "order_token": { "type": "string", "description": "Asset token address (regular asset or staked asset for staked-asset redemption redeems)" }, "order_type": { "$ref": "#/components/schemas/OrderType", "description": "Type of order (Mint or Redeem)" }, "payer": { "type": "string", "description": "Payer address" }, "recipient": { "type": "string", "description": "Recipient address" }, "tx_hash": { "type": "string", "description": "Transaction hash (only present for fulfilled orders)" } } }, "ExecutionType": { "type": "string", "description": "Whether an order is standard (platform-executed) or cosigned (user-executed)", "enum": [ "Standard", "Cosigned" ] }, "OrderStatus": { "type": "string", "description": "Status of the order in the processing", "enum": [ "Pending", "Processing", "Cancelled", "Expired", "Fulfilled", "NotExecutedByUser", "Failed" ] }, "OrderType": { "type": "string", "description": "Type of the user order", "enum": [ "Mint", "Redeem" ] } } } } ``` -------------------------------- ### Get Order Approval Data Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/orders Returns co-sign approval data for a cosigned order. This is a fallback for clients that did not receive an inline approval from POST /order (e.g., on timeout). ```APIDOC ## GET /order/{id}/approval ### Description Returns co-sign approval data for a cosigned order. Fallback for clients that did not receive an inline approval from POST /order (e.g. on timeout). ### Method GET ### Endpoint /order/{id}/approval ### Parameters #### Path Parameters - **id** (string) - Required - Order ID #### Response #### Success Response (200) - **approval_expiry** (string) - Approval expiry (as U256 for on-chain compat) - **approval_signature** (string) - Minter approval signature - **context** (object) - Order context data - **order_hash** (string) - Hash of the order - **share_price** (string) - Share price order parameter - **is_curated** (boolean) - Whether order curates collateral #### Response Example { "approval_expiry": "string", "approval_signature": "string", "context": { "order_hash": "string", "share_price": "string", "is_curated": true } } #### Error Response (404) Approval not yet available ``` -------------------------------- ### QuoteRequest Object Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/models Represents a request to get a quote for an order. It includes details about the side of the quote (mint/redeem), the size, the token type, and optional execution details like type and expiry. ```APIDOC ## QuoteRequest Object ### Description Represents a request to get a quote for an order. It includes details about the side of the quote (mint/redeem), the size, the token type, and optional execution details like type and expiry. ### Properties - **side** (OrderType) - Required - Side of the quote (mint/redeem). - **size** (string) - Required - Size of quote — interpreted as token amount or USDC collateral depending on `input`. - **token_type** (TokenType) - Required - Which token the caller is quoting against. Required (no default) — pricing uses this to decide whether the staked-asset redemption fee applies. - **execution_type** (ExecutionType) - Optional - Execution type (standard or cosigned/user-executed). - **expiry** (integer) - Optional - Order expiry timestamp in Unix seconds (required for cosigned/user-executed quotes). ``` -------------------------------- ### Get Pending Orders Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/orders Retrieves a list of pending orders for an authenticated signer. ```APIDOC ## GET /orders/pending ### Description Returns pending orders for the authenticated signer. ### Method GET ### Endpoint /orders/pending ### Parameters #### Header Parameters - **X-Auth-Address** (string) - Required - Signer EVM address - **X-Auth-Timestamp** (integer) - Required - Unix timestamp in seconds - **X-Auth-Signature** (string) - Required - EIP-191 personal_sign signature of `{METHOD}{PATH}{TIMESTAMP}` #### Response #### Success Response (200) - **id** (string) - Order UUID - **order_type** (string) - Type of order (Mint or Redeem) - **order_status** (string) - Current status of the order - **nonce** (string) - Unique nonce per payer - **expiry** (integer) - Expiry timestamp - **payer** (string) - Payer address - **recipient** (string) - Recipient address - **collateral_token** (string) - Collateral token address - **collateral_amount** (string) - Collateral amount - **order_token** (string) - Asset token address - **asset_amount** (string) - Asset amount - **execution_type** (string) - Execution type (standard or cosigned) - **error** (string | null) - Error reason (populated when order_status is Failed) - **tx_hash** (string) - Transaction hash (only present for fulfilled orders) #### Response Example [ { "id": "string (uuid)", "order_type": "Mint | Redeem", "order_status": "Pending | Processing | Cancelled | Expired | Fulfilled | NotExecutedByUser | Failed", "nonce": "string", "expiry": 0, "payer": "string", "recipient": "string", "collateral_token": "string", "collateral_amount": "string", "order_token": "string", "asset_amount": "string", "execution_type": "Standard | Cosigned", "error": null, "tx_hash": null } ] #### Error Response (401) Authentication failed ``` -------------------------------- ### Get Order by ID Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/orders Retrieves the details of a specific order using its unique identifier. ```APIDOC ## GET /order/{id} ### Description Retrieves the details of a specific order using its unique identifier. ### Method GET ### Endpoint /order/{id} ### Parameters #### Path Parameters - **id** (string) - Required - Order ID ### Response #### Success Response (200) - **ApiOrder** - Order found #### Response Example { "example": "{\"id\": \"a1b2c3d4-e5f6-7890-1234-567890abcdef\", \"order_type\": \"Mint\", \"order_status\": \"Fulfilled\", \"nonce\": \"0x1234567890abcdef\", \"expiry\": 1678886400, \"payer\": \"0xPayerAddress\", \"recipient\": \"0xRecipientAddress\", \"collateral_token\": \"0xCollateralTokenAddress\", \"collateral_amount\": \"1000000000000000000\", \"order_token\": \"0xOrderTokenAddress\", \"asset_amount\": \"500000000000000000\", \"execution_type\": \"Standard\", \"tx_hash\": \"0xtransactionhash\"}" ``` -------------------------------- ### Create Order Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/orders Creates a new order with the specified details. Requires order hash, share price, and curation status. ```APIDOC ## POST /order ### Description Creates a new order. ### Method POST ### Endpoint /order ### Parameters #### Request Body - **order_hash** (string) - Required - Hash of the order - **share_price** (string) - Required - Share price order parameter - **is_curated** (boolean) - Required - Whether order curates collateral ### Response #### Success Response (200) - **status** (integer) - HTTP status code - **error** (string) - Error message if any ``` -------------------------------- ### CosignApprovalContext Object Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/models Context data required for cosign approval. ```APIDOC ## CosignApprovalContext Object ### Description Context data required for cosign approval. ### Properties - **order_hash** (string) - Required - Hash of the order - **share_price** (string) - Required - Share price order parameter - **is_curated** (boolean) - Required - Whether order curates collateral ``` -------------------------------- ### DeploymentApiResult Object Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/models Result object for deployment-related API calls. ```APIDOC ## DeploymentApiResult Object ### Description Deployment API result. ### Properties - **controller** (string) - Required - Controller address - **domain_separator** (string) - Required - Domain separator - **collateral** (string) - Required - Address of the collateral - **token** (string) - Required - Address of the asset token - **staked_token** (string) - Required - Address of the staked asset token (for staked-asset redemption redeems) ``` -------------------------------- ### Get Order Approval Data Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/orders Retrieves co-sign approval data for a cosigned order. This serves as a fallback for clients that did not receive an inline approval from a previous POST /order request, such as in cases of timeout. ```json { "openapi": "3.1.0", "info": { "title": "Order Service API", "version": "0.1.0" }, "tags": [ { "name": "orders", "description": "Order lifecycle endpoints" } ], "paths": { "/order/{id}/approval": { "get": { "tags": [ "orders" ], "description": "Returns co-sign approval data for a cosigned order. Fallback for clients that did not receive an inline approval from POST /order (e.g. on timeout).", "operationId": "doc_get_order_approval", "parameters": [ { "name": "id", "in": "path", "description": "Order ID", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Co-sign approval data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CosignApprovalData" } } } }, "404": { "description": "Approval not yet available" } } } } }, "components": { "schemas": { "CosignApprovalData": { "type": "object", "description": "Approval data signed by the execution engine", "required": [ "context", "approval_expiry", "approval_signature" ], "properties": { "approval_expiry": { "type": "string", "description": "Approval expiry (as U256 for on-chain compat)" }, "approval_signature": { "type": "string", "description": "Minter approval signature" }, "context": { "$ref": "#/components/schemas/CosignApprovalContext", "description": "Order context data" } } }, "CosignApprovalContext": { "type": "object", "required": [ "order_hash", "share_price", "is_curated" ], "properties": { "is_curated": { "type": "boolean", "description": "Whether order curates collateral" }, "order_hash": { "type": "string", "description": "Hash of the order" }, "share_price": { "type": "string", "description": "Share price order parameter" } } } } } } ``` -------------------------------- ### User WebSocket Endpoint Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/websocket This endpoint allows users to establish a WebSocket connection for real-time communication. After the connection is upgraded, clients should send messages conforming to the `UserWsClientMessage` schema and will receive messages conforming to the `UserWsServerMessage` schema. ```APIDOC ## GET /stream ### Description User WebSocket endpoint. After upgrade, send `UserWsClientMessage` and receive `UserWsServerMessage` JSON frames. ### Method GET ### Endpoint /stream ### Responses #### Success Response (101) - **description**: Switching Protocols ``` -------------------------------- ### CosignApprovalContext Model Definition Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/models Defines the context required for cosign approval, including the order hash, share price, and whether the order is curated. ```json {"openapi":"3.1.0","info":{"title":"Order Service API","version":"0.1.0"},"components":{"schemas":{"CosignApprovalContext":{"type":"object","required":["order_hash","share_price","is_curated"],"properties":{"is_curated":{"type":"boolean","description":"Whether order curates collateral"},"order_hash":{"type":"string","description":"Hash of the order"},"share_price":{"type":"string","description":"Share price order parameter"}}}}}} ``` -------------------------------- ### Order Object Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/models Represents a detailed order, including details for minting or redeeming assets, collateral, expiry, and signatures. ```APIDOC ## Order Represents a detailed order, including details for minting or redeeming assets, collateral, expiry, and signatures. ### Properties - **order_type** (OrderType) - Required - Type of the user order (Mint or Redeem). - **nonce** (string) - Required - Nonce for the order. - **expiry** (integer, int64) - Required - Expiration timestamp. - **payer** (string) - Required - Spender for this order. - **recipient** (string) - Required - Recipient of minted/redeemed tokens. - **collateral_token** (string) - Required - Collateral asset (e.g. USDT). - **collateral_amount** (string) - Required - Collateral amount. - **order_token** (string) - Required - Asset token address. - **asset_amount** (string) - Required - Minted token amount. - **signature** (string) - Required - Signature for order. - **signature_type** (SignatureType) - Optional - Signature scheme used to sign the order. - **signer** (string) - Optional - Signer of the order. - **execution_type** (ExecutionType) - Optional - Whether this is a standard or co-signed order. - **order_status** (OrderStatus) - Optional - Order status (pending by default). - **created** (string) - Optional - Timestamp when the order was created. - **id** (string, uuid) - Optional - ID of the order. - **error** (string | null) - Optional - Error reason. - **tx_hash** (string | null) - Optional - Transaction hash when order is fulfilled. ``` -------------------------------- ### UserWsClientMessage Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/models Represents a message sent from a WebSocket client to the Order Service. It can encapsulate various actions like submitting an order, getting a challenge for subscription, subscribing, cancelling an order, requesting a quote, or sending a heartbeat ping. ```APIDOC ## UserWsClientMessage Represents a message sent from a WebSocket client to the Order Service. It can encapsulate various actions like submitting an order, getting a challenge for subscription, subscribing, cancelling an order, requesting a quote, or sending a heartbeat ping. ### Types - **SubmitOrder**: For submitting a new order. - **GetChallenge**: For initiating a subscription flow. - **Subscribe**: For subscribing with signature. - **CancelOrder**: For cancelling an existing order. - **QuoteRequest**: For requesting a quote (unauthenticated). - **Ping**: For sending a heartbeat ping. ``` -------------------------------- ### Order Struct Definition Source: https://docs.tenbinlabs.xyz/solution-overview/minting-and-redemption Defines the structure of an order for minting or redemption, including order type, nonces, expiry, payer, recipient, collateral details, and asset details. ```solidity struct Order { OrderType order_type; // Order type (MINT or REDEEM) uint256 nonce; // Payer unique nonce uint256 expiry; // Order expiration timestamp address payer; // Account to transfer tokens from address recipient; // Account to receive tokens address collateral_token; // Collateral used for this order uint256 collateral_amount; // Amount of collateral tokens address order_token; // Specify AssetToken or StakedAsset uint256 asset_amount; // Amount of asset tokens } ``` -------------------------------- ### Order Struct Definition Source: https://docs.tenbinlabs.xyz/solution-overview/minting-and-redemption/order-validation Defines the structure of an order, including its type, nonce, expiry, payer, recipient, collateral details, and asset details. This struct is fundamental for representing and processing orders. ```solidity struct Order { OrderType order_type; // Order type (MINT or REDEEM) uint256 nonce; // Payer unique nonce uint256 expiry; // Order expiration timestamp address payer; // Account to transfer tokens from address recipient; // Account to receive tokens address collateral_token; // Collateral used for this order uint256 collateral_amount; // Amount of collateral tokens address order_token; // Specify AssetToken or StakedAsset uint256 asset_amount; // Amount of asset tokens } ``` -------------------------------- ### POST /quote Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/quotes Requests a price quote for an order. It's important to match quote parameters with intended order submission, especially for cosigned orders where fees scale with expiry. ```APIDOC ## POST /quote ### Description Requests a price quote for an order. For cosigned orders, the embedded fee scales with the specified expiry. Ensure quote parameters align with your intended order submission. ### Method POST ### Endpoint /quote ### Parameters #### Request Body - **side** (OrderType) - Required - Side of the quote (mint/redeem). - **size** (string) - Required - Size of quote, interpreted as token amount or USDC collateral depending on `input`. - **token_type** (TokenType) - Required - Specifies which token the caller is quoting against. Pricing uses this to determine if the staked-asset redemption fee applies. - **execution_type** (ExecutionType) - Optional - Execution type (standard or cosigned/user-executed). - **expiry** (integer) - Optional - Order expiry timestamp in Unix seconds (required for cosigned/user-executed quotes). - **input** (QuoteInput) - Optional - How to interpret `size` (defaults to Token). ### Response #### Success Response (200) - **id** (string) - ID of the response (used for diagnostics). - **status** (QuoteResponseStatus) - Status indicating whether a quote was computed. - **order_type** (OrderType) - Side of the order (mint/redeem) (present if status is Ok). - **token** (string) - Token amount (present if status is Ok). - **usd_price** (string) - USD price (present if status is Ok). - **usdc_collateral** (string) - USDC collateral required for mint/redeem (present if status is Ok). #### Error Response (408, 500) - **status** (integer) - HTTP status code. - **error** (string) - Error message. ``` -------------------------------- ### DeploymentApiResult Model Definition Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/models Defines the result of a deployment API call, including addresses for the controller, collateral, token, and staked token, along with the domain separator. ```json {"openapi":"3.1.0","info":{"title":"Order Service API","version":"0.1.0"},"components":{"schemas":{"DeploymentApiResult":{"type":"object","description":"Deployment API result","required":["controller","domain_separator","collateral","token","staked_token"],"properties":{"collateral":{"type":"string","description":"Address of the collateral"},"controller":{"type":"string","description":"Controller address"},"domain_separator":{"type":"string","description":"Domain separator"},"staked_token":{"type":"string","description":"Address of the staked asset token (for staked-asset redemption redeems)"},"token":{"type":"string","description":"Address of the asset token"}}}}}} ``` -------------------------------- ### Simplified Futures Pricing Formula Source: https://docs.tenbinlabs.xyz/hedging-and-risk/peg-mechanism/hedge-premium-and-discount This formula approximates futures pricing based on spot price, net financing costs, and time to expiry. Use this to understand the theoretical relationship between futures and spot prices. ```plaintext F ≈ S × (1 + carry × T) ``` -------------------------------- ### Order Object Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/models Represents an order for minting or redeeming assets. It includes details about the order type, participants, assets, and signature. ```APIDOC ## Order Object ### Description Represents an order for minting or redeeming assets. It includes details about the order type, participants, assets, and signature. ### Properties - **order_type** (OrderType) - Required - Type of the order (Mint or Redeem). - **nonce** (string) - Required - Nonce for the order. - **expiry** (integer, int64) - Required - Expiration timestamp for the order. - **payer** (string) - Required - The address paying for the order. - **recipient** (string) - Required - The address receiving the assets. - **collateral_token** (string) - Required - The address of the collateral token. - **collateral_amount** (string) - Required - The amount of collateral. - **order_token** (string) - Required - The address of the asset token. - **asset_amount** (string) - Required - The amount of the asset. - **signature** (string) - Required - The signature for the order. - **execution_type** (ExecutionType) - Optional - Whether the order is standard or co-signed. - **signer** (string) - Optional - The address that signed the order. - **signature_type** (SignatureType) - Optional - The signature scheme used. - **id** (string, uuid) - Optional - The ID of the order (ignored for insert). - **created** (string) - Optional - Timestamp when the order was created (ignored for insert). - **order_status** (OrderStatus) - Optional - The current status of the order. - **error** (string | null) - Optional - Reason for failure if the order status is 'Failed'. ``` -------------------------------- ### CosignApprovalData Object Source: https://docs.tenbinlabs.xyz/api-documentation-and-sdks/models Approval data signed by the execution engine for cosigned orders. ```APIDOC ## CosignApprovalData Object ### Description Approval data signed by the execution engine. ### Properties - **context** (CosignApprovalContext) - Required - Order context data - **approval_expiry** (string) - Required - Approval expiry (as U256 for on-chain compat) - **approval_signature** (string) - Required - Minter approval signature ```