Fetching the proof
Fetch Proof for a given request ID
The section assumes that you know the request ID before fetching the proof.
./Kalypso-tutorial/index.ts
// existing code..
const startBlock = tx!.blocknumber;
const proof = await kalypso.MarketPlace().getProofByAskId(requestId, startBlock);
- requestId: Request ID for which you want to fetch the proof
- startBlock: Block number from which to poll the proof. The ideal value of this can be the block number on which the request was created.
info
Sometimes generating proof takes time. In that case, it is recommended to poll for longer intervals.
.Alternatively Users can listen to below event on proof market place contract and obtain the proof using WebSocket. The proof is emitted alongside an indexed event of the Proof Market Place contract.
event ProofCreated(uint256 indexed askId, bytes proof);