Skip to main content
Claims and collections are central to managing interactions and transactions on the IXO blockchain. This guide shows you how to implement common claim operations.

Creating a Collection

Set up a new collection for submitting and evaluating claims.
const response = await CreateCollection(
  "entityDid1234",      // The DID of the entity creating the collection
  "protocolDid1234",    // The DID of the associated protocol
  "paymentsAccount1234" // Account to handle payments
);

Parameters

DID of the entity creating the collection
DID of the protocol under which the collection falls
Account to handle collection-related payments
Transaction signer
CW20 token address for payments

Querying Collections

Retrieve collection data using the IXO Blocksync GraphQL API.
query MyQuery {
  claimCollection(id: "99") {
    id
    startDate
    endDate
    entity
    protocol
    admin
    count
    evaluated
    approved
    rejected
    disputed
    claimSchemaTypesLoaded
    invalidated
    payments
    quota
    state
  }
}
Replace the id field with your specific collection ID to get detailed information about that collection.

Managing Claims

Submitting a Claim

Submit a new claim to an existing collection.
const response = await MsgExecAgentSubmit(
  "claimId1234",        // Unique identifier for the claim
  "collectionId1234",   // Identifier of the collection
  "adminAddress1234"    // Admin address authorizing the claim submission
);

Evaluating a Claim

Assess and evaluate a submitted claim.
const response = await MsgExecAgentEvaluate(
  "claimId1234",        // Unique identifier for the claim
  "collectionId1234",   // Identifier of the collection
  "adminAddress1234"    // Admin address authorizing the claim evaluation
);

Querying Claims

Retrieve detailed information about claims using GraphQL.
query MyQuery {
  claim(claimId: "bafkreihzugslzexyu2c6o6nmtm7vxbsyelo7pzmcppsmqawj2s6blmgojy") {
    schemaType
    claimId
    agentAddress
    agentDid
    collectionId
    paymentsStatus
    submissionDate
    evaluationByClaimId {
      status
      verificationProof
      amount
      evaluationDate
      oracle
      reason
    }
  }
}

Claims Function Reference

Creates a new collection.Parameters: entityDid, protocolDid, paymentsAccount, signer?, cw20Address?
Updates collection state.Parameters: collectionId, adminAddress, signer?
Submits a claim intent.Parameters: claimId, collectionId, adminAddress
Submits a claim.Parameters: claimId, collectionId, adminAddress
Evaluates a claim.Parameters: claimId, collectionId, adminAddress
Grants submission authorization.Parameters: Varies by implementation
Grants evaluation authorization.Parameters: Varies by implementation
Initiates a claim dispute.Parameters: Varies by implementation
Executes payment withdrawal.Parameters: Varies by implementation

Troubleshooting

  • Ensure all DIDs and account addresses are correct
  • Verify payment account details are accurate
  • Check that the protocol DID exists and is valid
  • Check that the claim ID is unique and valid
  • Ensure the admin address has the necessary permissions
  • Verify the collection is in a state that accepts claims
  • Confirm the claim is in a state ready for evaluation
  • Verify the evaluator has the correct authorization
  • Check that the collection is still active and valid
Always verify the status and details of claims and collections through the GraphQL API before performing operations on them.