Claims
XP Claims
https://discover.xp-protocol.io/xpclaim/<CLAIM ID HERE>
Creating a Claim
import Web3 from 'web3';
let expireDateUnix = Math.floor(date.getTime() / 1000);
const signature = await web3.eth.personal.sign(
timestamp,/// in seconds
<xp owner wallet address> //This wallet must be an owner of the XP Instance
);
let claimData = {
claimData: {
xpProjectId: <projectId>,
description: <claimDescription>,
name: <claimName>,
points: <points>,
updateIdFormat: "singleUse",//only supports singleUse on v1
xpAction: <action-name>,//name the action that will be fired when triggered.
xpExpire: expireDateUnix.toString(),//unix time in seconds of expiration
xpScoreType: <score type>, //what scoretype to attribute points to
discoverable: <boolean>, // allow people to be able to discover this via discover app,
},
verification: {
signature,
message: timestamp,//timestamp must match signature
address: <xp owner wallet address>,
},
};
let createClaimResponse = await fetch(
"https://api.xp-protocol.io/create-claim",
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(claimData),
}
);
Querying Claims By Project ID
Query A Single Claim
Last updated
Was this helpful?

