The score-updating process requires a trusted party to initiate a score update for a specific user. This can be done manually through the dashboard, or by any number of integration operators.
On the other hand, if we have score updates that we want users themselves to execute for participating in certain events/IRL attendance, we have XP Claims.
XP Claims are user-serviceable score updates. This means that a claim can be executed by a user directly without the need for backend verification.
XP Claims can be executed by linking to a claim via the Discover website endpoint below
https://discover.xp-protocol.io/xpclaim/<CLAIM ID HERE>
Creating a Claim
A claim can be created via the XP Dashboard or directly from our REST API.
https://dashboard.xp-protocol.io
Below is an example of a call directly to the REST API
import Web3 from'web3';let expireDateUnix =Math.floor(date.getTime() /1000);constsignature=awaitweb3.eth.personal.sign( timestamp,/// in seconds <xpownerwalletaddress> //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: <scoretype>, //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: <xpownerwalletaddress>, }, }; let createClaimResponse = await fetch( "https://api.xp-protocol.io/create-claim", { method: "POST", headers: {"Content-Type":"application/json", }, body: JSON.stringify(claimData), } );
If the call is successful it should response with the following unique identifier.