bigshortbets / market-frontend

BigShortBet$ P2P Market is a cutting-edge peer-to-peer marketplace built on the principles of decentralization that allows direct P2P trading on unique & event-based markets. Enjoy ultra-low fees and no swaps. Powered by $BigSB.
https://app.bigsb.io
GNU General Public License v3.0
2 stars 5 forks source link

Add links to orders that forwarding to polkadot explorer #36

Closed Klapeyron closed 3 weeks ago

Klapeyron commented 6 months ago

Each order creation is associated with a block number (available in graphql). Would be great to have an option to jump from order to explorer and show associated transaction sample URL

kacpergumieniuk commented 3 months ago

@Klapeyron

Klapeyron commented 3 months ago

Sample with order:

      {
        "blockHeight": "1059433",
        "id": "13835058055282165321"
      }

https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Ftest-market.bigsb.network#/explorer/query/1059433

Klapeyron commented 2 months ago

@autopilot

codeautopilot[bot] commented 2 months ago

@autopilot

Hi @Klapeyron,

Thanks for providing the sample order data. To implement the feature of linking orders to the Polkadot explorer, you can use the blockHeight from the order data to construct the URL. Here's a quick example of how you can generate the URL dynamically:

const order = {
  blockHeight: "1059433",
  id: "13835058055282165321"
};

const explorerBaseUrl = "https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Ftest-market.bigsb.network#/explorer/query/";
const explorerUrl = `${explorerBaseUrl}${order.blockHeight}`;

console.log(explorerUrl); // Outputs: https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Ftest-market.bigsb.network#/explorer/query/1059433

This will create a link that directs users to the Polkadot explorer for the specific block associated with the order. Let me know if you need further assistance!