Installation

You probably don't need to install anything. The REST API handles lookups and collection without any dependencies.

Just use the API

curl "https://claimr.app/api/wallet/lookup?handle=someuser"

No auth, no SDK, no setup.

If you want local derivation

For offline use or batch processing, you can derive addresses yourself. Install the Solana SDK:

npm install @solana/web3.js

Then:

import { PublicKey } from '@solana/web3.js';

const CLAIMR_PROGRAM = new PublicKey('3FsU2B8R7sP5ih7w2RoxtJEHfvBVeXtM8WwF6rjMbUrT');

function getClaimrAddress(twitterId: string): PublicKey {
  const [pda] = PublicKey.findProgramAddressSync(
    [Buffer.from('claimr'), Buffer.from(twitterId)],
    CLAIMR_PROGRAM
  );
  return pda;
}

// Pass the numeric Twitter ID, not the handle
getClaimrAddress('44196397');

Reference

Last updated