Metal X
API DocsMetal XWebAuth WalletLoan Protocol
  • DEX
    • What is Metal X?
      • Trading Interface
      • Trading on Metal X DEX
      • DEX fees and discounts
      • Referral program
      • Metal X FAQ
  • Developers DEX
    • Smart Contract
      • Contract Address
      • Tables
      • Actions
    • Contract Mappings
      • Order Types
      • Fill Types
      • Order Status
      • Order Side
      • Status codes for markets
      • Common Errors
    • Examples
      • Installation + Initialization
      • Submit DEX Order
      • Cancel DEX Order
      • Order Lifecycle
    • Audit
    • Oracles
  • Swap, Pools & Farms
    • What is Metal X Swap?
      • Trading Interface
      • Swap fees and discounts
      • Liquidity Pools
      • Farming
      • Metal X Swap FAQ
  • Developers Swap
    • Tables
      • Actions
      • Contracts
      • Audit
  • XPR Network
    • XPR Network & Ecosystem
  • dex bot
    • About
    • Installation
  • Support
    • Guides
Powered by GitBook
On this page
  1. Developers DEX
  2. Examples

Order Lifecycle

Belos is the script to fetch order lifecyle using ordinal order id

const fetch = require('node-fetch');

// for testnet use "https://dex.api.testnet.metalx.com/dex"
const url = "https://dex.api.mainnet.metalx.com/dex"

async function main() {
    // Replace accordingly
    const ORDINAL_ID = "81321dc485b5dd8053c4b7d0c90273ce72645b4127524d1745aebe8b4f795e21"

    const path = "/v1/orders/lifecycle"
    const response = await fetch(`${url}${path}?ordinal_order_id=${ORDINAL_ID}`);
    
    const data = await response.json()
    console.dir(data, { depth: null })
}
main()
import requests

# Supply ordinal order id
ORDINALID = '7c58750548702a4a8dc30aebe21fb1885923b7db42dbe81239f5a64e672b82d7'
url = f"https://dex.api.mainnet.metalx.com/dex/v1/orders/lifecycle?ordinal_order_id={ORDINALID}"

headers = {"accept": "application/json"}

response = requests.get(url, headers=headers)

print(response.json())
PreviousCancel DEX OrderNextAudit

Last updated 1 year ago