Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deployments: relevant addresses #52 #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
203 changes: 203 additions & 0 deletions pages/api-guides/orders/get-order.mdx
Original file line number Diff line number Diff line change
@@ -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";

<Callout type="warning" emoji="⚠️">
Order IDs must be converted to hexadecimals and padded to 64 characters

such as: 2049126 -> 0x00000000000000000000000000000000000000000000000000000000001f4466
</Callout>

## Get Order

<Tabs items={['GraphQL', 'Python', 'Rust', 'Typescript']}>
<Tab>
```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
}
}
}
```
</Tab>
<Tab>
<OfferID>
<DynamicEndpoint>
```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)
```
</DynamicEndpoint>
</OfferID>
</Tab>

<Tab>
<OfferID>
<DynamicEndpoint>
```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(())
}
```
</DynamicEndpoint>
</OfferID>
</Tab>
<Tab>
<OfferID>
<DynamicEndpoint>
```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<any>) => {
console.log(response.data);
})
.catch((error) => {
console.error(error);
});
```
</DynamicEndpoint>
</OfferID>
</Tab>
</Tabs>
8 changes: 8 additions & 0 deletions pages/protocol/deployments.en.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions pages/protocol/deployments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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.
Expand Down