Sense API

Sense allows other applications or users to use Pastel's state-of-the-art Duplication Detection service by paying a negligible fee.

Process

  1. Navigate to /openapi/sense/upload to upload the image and get image_id and estimated_fee

  2. You'll need to burn 20% of the estimated_fee to start sense register task. Send 20% of the estimated burn fee (rounded up) to the burn address PtpasteLBurnAddressXXXXXXXXXXbJ5ndd (so if the estimated burn fee is 100 PSL, send 20). Note the response transaction id.

  3. Call /openapi/sense/start/<<image_id>> to start sense register task. Use the transaction id and your pastelid. Expect a task_id in response.

  4. Call /openapi/sense/start/<<task_id>>/state: connect with this Websocket to monitor the status of Sense register task. This will, over time, allow you to see the state of the supernodes as they process it. When this yields "Task Completed" your art has been processed by the blockchain!

  5. Use /openapi/sense/<<task_id>>/history` to see task status history and details because websocket mentioned in (4) will only remain active until the registration process is active.

  6. Use /openapi/sense/download?pid=<<pastel_id>>&txid=<<tx_id>> to download the duplication detection results for the provided image. tx_id is the RegistrationTXID or reg_txid you'll see in response of (4) and (5).

Last updated