API Reference

Completing Claims

// Both address formats work (Ethereum 0x or BitBadges bb-prefixed)
const res = await BitBadgesApi.completeClaim(claimId, address, body);
console.log(res.claimAttemptId);

// Wait ~2 seconds for processing, then check status
const status = await BitBadgesApi.getClaimAttemptStatus(res.claimAttemptId);
console.log(status); // { success: true }

Request Body

{
  _expectedVersion: '0',  // Required: claim.version (use -1 to unsafely skip check β€” not recommended)
  [instanceId]: {          // Per-plugin inputs, keyed by instance ID
    ...pluginInputs
  }
}

Example:

await BitBadgesApi.completeClaim(claimId, 'bb1...', {
    _expectedVersion: '0',
    'password-instance': { password: 'secret123' },
    'codes-instance': { code: 'abc-def-ghi' },
});

Notes

  • _expectedVersion prevents the claim creator from changing criteria without you knowing. Obtain from getClaim().

  • If sign-in is required, you must have proper session authentication.

  • If sign-in is disabled, gate the claim another way (e.g., password only your backend knows).

  • The completeClaim route auto-simulates first. If simulation fails, it returns immediately without queuing.

Simulating Claims

  • Instant (not queued) β€” returns result immediately

  • Same body format as completeClaim

  • Use _specificInstanceIds to simulate only certain plugins:

Verifying Claim Attempts

By Address

  • successCount = number of completions (1 for on-demand, N for standard)

  • Both 0x and bb1 address formats work

By Attempt ID

Obtain claimAttemptId from the completeClaim() response or from a custom plugin.

Polling Pattern

Claims process asynchronously. After calling completeClaim(), poll for the result:

Typical processing time is 1-5 seconds. Claims for the same collection process sequentially; different collections process in parallel.

Fetching Claims

Looking Up Plugins

Get a Single Plugin

Fetch Multiple Plugins

Search Published Plugins

Get Plugin Errors

Useful for debugging failed plugin executions during development.

Deleting Claims

Deletion is a soft-delete β€” the claim is marked with deletedAt and excluded from queries. Existing claim attempt records are preserved for history.

Searching Claims

Only claims with showInSearchResults: true appear in search results.

Last updated