diff --git a/pages/api-guides/orders/get-order.mdx b/pages/api-guides/orders/get-order.mdx index e69de29..50fef56 100644 --- a/pages/api-guides/orders/get-order.mdx +++ b/pages/api-guides/orders/get-order.mdx @@ -0,0 +1,203 @@ +--- +title: Individual Order Data +pageTitle: Individual Order Data +description: Retrieve data regarding a single order on the protocol. +--- + +import { Tab, Tabs } from 'nextra-theme-docs' +import { Callout } from "/components/Callout"; +import { DynamicEndpoint, MakerAddress, AssetAddress, QuoteAddress, OfferID } from "/components/DynamicEndpoint.jsx"; + + + Order IDs must be converted to hexadecimals and padded to 64 characters + + such as: 2049126 -> 0x00000000000000000000000000000000000000000000000000000000001f4466 + + +## Get Order + + + + ```graphql copy + { + offer(id:"0x00000000000000000000000000000000000000000000000000000000001f4466") { + # the offer id + id + # the asset the offer is selling + pay_gem + # the amount the offer is selling + pay_amt + # the amount the offer sold + paid_amt + # the asset the offer is buying + buy_gem + # the amount the offer is buying + buy_amt + # th amount the offer bought + bought_amt + # the offer status (boolean: open/closed) + open + # the maker of the offer + maker { id } + # the originator of the offer transaction (can differ from maker) + from { id } + # transaction data + transaction { + # the time the transaction occurred + timestamp + # the block the transaction was in + block_number + # the transaction hash + id + } + } + } + ``` + + + + + ```python copy + import requests + import json + + url = "select network endpoint below" + headers = {'Content-Type': 'application/json'} + + order_id = "input_order_id" + order_id = '0x{:064x}'.format(order_id) + + query = f""" + {{ + offer(id:"{order_id}") {{ + id + pay_gem + pay_amt + paid_amt + buy_gem + buy_amt + bought_amt + open + maker {{ id }} + from {{ id }} + transaction {{ + timestamp + block_number + id + }} + }} + }} + """ + + response = requests.post(url, headers=headers, data=json.dumps({'query': query})) + + data = response.json() + + print(data) + ``` + + + + + + + + ```rust copy + use reqwest::Error; + use serde_json::{json, Value}; + + #[tokio::main] + async fn main() -> Result<(), Error> { + let client = reqwest::Client::new(); + let order_id = format!("0x{:016x}", "input_order_id"); + + let query = format!( + r#" + { + offer(id: "{}" ) { + id + pay_gem + pay_amt + paid_amt + buy_gem + buy_amt + bought_amt + open + maker { id } + from { id } + transaction { + timestamp + block_number + id + } + } + } + "#, + order_id + ); + + let url = "select network endpoint below"; + let res: Value = client.post(url) + .json(&payload) + .send() + .await? + .json() + .await?; + + println!("{:#?}", res); + + Ok(()) + } + ``` + + + + + + + ```typescript copy + import axios, { AxiosResponse } from 'axios'; + + const url = "select network endpoint below"; + const order_id = "input_order_id"; + + let hex = order_id.toString(16); + while (hex.length < 64) { + hex = '0' + hex; + }; + hex = '0x' + hex; + + const query = ` + { + offer(id: "${hex}" ) { + id + pay_gem + pay_amt + paid_amt + buy_gem + buy_amt + bought_amt + open + maker { id } + from { id } + transaction { + timestamp + block_number + id + } + } + } + `; + + axios.post(url, { query }) + .then((response: AxiosResponse) => { + console.log(response.data); + }) + .catch((error) => { + console.error(error); + }); + ``` + + + + \ No newline at end of file diff --git a/pages/protocol/deployments.en.mdx b/pages/protocol/deployments.en.mdx index 84ecdfd..6342e72 100644 --- a/pages/protocol/deployments.en.mdx +++ b/pages/protocol/deployments.en.mdx @@ -18,6 +18,10 @@ Please note that Rubicon utilizes the [transparent upgradeable proxy standard](h | RubiconRouter | [0x7Af14ADc8Aea70f063c7eA3B2C1AD0D7A59C4bFf](https://optimistic.etherscan.io/address/0x7Af14ADc8Aea70f063c7eA3B2C1AD0D7A59C4bFf) | | MarketAidFactory| [0x267D94C6e67e4436EFfE092b08d040cFF36B2DA7](https://optimistic.etherscan.io/address/0x267D94C6e67e4436EFfE092b08d040cFF36B2DA7) | +| Protocol Addresses | Address | +| -------------------- | -------------------------------------------- | +| Protocol Fee Recipient | [0x752748DeaF25cf58b60d4C4209d7F200AeE4Ef14](https://optimistic.etherscan.io/address/0x752748DeaF25cf58b60d4C4209d7F200AeE4Ef14) | + ### Arbitrum | Contract Name | Address | @@ -26,6 +30,10 @@ Please note that Rubicon utilizes the [transparent upgradeable proxy standard](h | RubiconRouter | [0x7b24e6f4dd84674696c2a5809c24154ec6ac7f03](https://arbiscan.io/address/0x7b24e6f4dd84674696c2a5809c24154ec6ac7f03) | | MarketAidFactory| [0x6CB24A263732579EfD56f3E071851e989d78cE75](https://arbiscan.io/address/0x6cb24a263732579efd56f3e071851e989d78ce75) | +| Protocol Addresses | Address | +| -------------------- | -------------------------------------------- | +| Protocol Fee Recipient | [0x752748DeaF25cf58b60d4C4209d7F200AeE4Ef14](https://arbiscan.io/address/0x752748DeaF25cf58b60d4C4209d7F200AeE4Ef14) | + ## Testnet Deployments List of contract addresses on various test networks. Includes addresses for test tokens with a built-in faucet, you can mint these tokens by calling faucet() on the contract or by using the Faucet button in the app. diff --git a/pages/protocol/deployments.mdx b/pages/protocol/deployments.mdx index df233c9..33501ad 100644 --- a/pages/protocol/deployments.mdx +++ b/pages/protocol/deployments.mdx @@ -18,6 +18,10 @@ Please note that Rubicon utilizes the [transparent upgradeable proxy standard](h | RubiconRouter | [0x7Af14ADc8Aea70f063c7eA3B2C1AD0D7A59C4bFf](https://optimistic.etherscan.io/address/0x7Af14ADc8Aea70f063c7eA3B2C1AD0D7A59C4bFf) | | MarketAidFactory| [0x267D94C6e67e4436EFfE092b08d040cFF36B2DA7](https://optimistic.etherscan.io/address/0x267D94C6e67e4436EFfE092b08d040cFF36B2DA7) | +| Protocol Addresses | Address | +| -------------------- | -------------------------------------------- | +| Protocol Fee Recipient | [0x752748DeaF25cf58b60d4C4209d7F200AeE4Ef14](https://optimistic.etherscan.io/address/0x752748DeaF25cf58b60d4C4209d7F200AeE4Ef14) | + ### Arbitrum | Contract Name | Address | @@ -26,6 +30,10 @@ Please note that Rubicon utilizes the [transparent upgradeable proxy standard](h | RubiconRouter | [0x7b24e6f4dd84674696c2a5809c24154ec6ac7f03](https://arbiscan.io/address/0x7b24e6f4dd84674696c2a5809c24154ec6ac7f03) | | MarketAidFactory| [0x6CB24A263732579EfD56f3E071851e989d78cE75](https://arbiscan.io/address/0x6cb24a263732579efd56f3e071851e989d78ce75) | +| Protocol Addresses | Address | +| -------------------- | -------------------------------------------- | +| Protocol Fee Recipient | [0x752748DeaF25cf58b60d4C4209d7F200AeE4Ef14](https://arbiscan.io/address/0x752748DeaF25cf58b60d4C4209d7F200AeE4Ef14) | + ## Testnet Deployments List of contract addresses on various test networks. Includes addresses for test tokens with a built-in faucet, you can mint these tokens by calling faucet() on the contract or by using the Faucet button in the app.