Instructions

initialize

Sets up the protocol configuration. Called once at deployment.

Accounts: config, authority (signer), system_program

Arguments: oracle: Pubkey, treasury: Pubkey, fee_bps: u16

Admin-only. Creates the global ClaimrConfig account with the oracle signer, treasury address, and fee rate.

init_user_pda

Initializes the on-chain account for a Twitter user. Idempotent; safe to call multiple times.

Accounts: user_pda, fee_payer (signer), system_program

Arguments: twitter_id: String

Public instruction. The Claimr backend calls this automatically during withdrawals.

withdraw

Transfers funds from a user PDA to a destination address. Requires a valid oracle signature.

Accounts: user_pda, config, destination, treasury, withdraw_record, fee_payer (signer), instructions_sysvar, system_program

Arguments: twitter_id: String, destination: Pubkey, amount: u64 (0 = withdraw all), nonce: u64

The transaction must include an Ed25519Program verification instruction before the withdraw instruction.

Admin Instructions

Instruction
Argument
Description

update_oracle

new_oracle: Pubkey

Update oracle signing key

update_treasury

new_treasury: Pubkey

Update fee recipient address

update_fee

new_fee_bps: u16

Update fee rate (basis points)

Requires protocol authority signature.

Last updated