Installation
Just use the API
curl "https://claimr.app/api/wallet/lookup?handle=someuser"If you want local derivation
npm install @solana/web3.jsimport { 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