configId returned by the API is the on-chain routing key.
For EVM chains, see EVM.
How it works
Create a config via the API
Use the Configs endpoint to create a config that defines your charity
beneficiaries and weights. You receive a
configId (32-byte identifier) that routes donations to
the correct destinations on each chain.The Donation Relay program accepts SPL Token and Token-2022 transfers into a per-config, per-mint debouncer account. Donations are accumulated per epoch; the relayer closes epochs and runs distribution (not callable by integrators).
Program ID and IDL
| Item | Value |
|---|---|
| Program ID | RLAYHr9TRFcKB2ubYQhspcnXiaGpaVzNQvHytt47RZu |
| On-chain IDL | Solana Explorer (IDL) |
Mapping configId from the API
The API returns configId as a bytes32 hex string (often with a 0x prefix). For Solana:
donate_v1: pass the 32 bytes as[u8; 32]in the same byte order as the hex literal (left to right after removing0x).donate_pubkey_config_id_v1: the same 32 bytes interpreted as aPubkey(convenient when your stack already usesPublicKeytypes).
Instructions (integrators)
You integrate using one of these two instructions; they share the same account layout and semantics. The only difference is howconfig_id is encoded in the instruction data.
| Instruction | config_id in args | When to use |
|---|---|---|
donate_v1 | [u8; 32] | Matches EVM-style raw bytes from your backend. |
donate_pubkey_config_id_v1 | pubkey (32 bytes) | Same logic, ergonomic for Solana PublicKey / Explorer-style tooling. |
- Transfer
amount(base units ofmint) from the donor’s token account into the debouncer’s vault for the(config_id, mint)pair. - Take
tip_bps(0–10000; basis points on the transferred amount, 10000 = 100%). - Take
message(UTF-8 string; max 255 bytes, not necessarily 255 characters). - Take
credited_to(pubkeycredited for the donation; often the donor’s wallet).
DonationMadeV1Event (see Events).
Account metas (order)
Pass accounts in this order (matches the IDL). Several PDAs useinit_if_needed; the donor (from) pays rent when accounts or ATAs are created.
| # | Account | Notes |
|---|---|---|
| 1 | epoch_tracker | PDA: seeds epoch_tracker_v1 · config_id (32 bytes) · mint. |
| 2 | debouncer | PDA: seeds debouncer_v1 · config_id (32 bytes) · mint. |
| 3 | debouncer_token_account | ATA: debouncer authority, mint, correct token program. |
| 4 | mint | SPL or Token-2022 mint (must pass program mint policy). |
| 5 | from_token_account | Donor’s ATA for mint (authority = from). |
| 6 | from | Donor signer; also payer for init_if_needed. |
| 7 | mint_whitelist | PDA: single seed mint_whitelist_v1 (global whitelist account). |
| 8 | associated_token_program | Associated Token program: ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL. |
| 9 | token_program | SPL Token or Token-2022 program, matching mint and accounts. |
| 10 | system_program | System program. |
| 11 | event_authority | PDA: seed __event_authority (Anchor event CPI). |
| 12 | program | Donation Relay program ID (self). |
config_id in seeds is always the 32-byte config identifier (for donate_pubkey_config_id_v1, the same bytes as the Pubkey argument).
Native SOL
The program usestransfer_checked on SPL-style token accounts. There is no direct native-SOL instruction. To donate SOL, use wrapped SOL (WSOL): ensure the donor has a WSOL associated token account with sufficient balance (wrap SOL first if needed), then call donate_v1 / donate_pubkey_config_id_v1 with the WSOL mint.
Mint policy
Mints must either appear on the on-chain mint whitelist PDA or satisfy strict safety checks (for example, no active mint/freeze authority; Token-2022 extensions such as transfer fee, transfer hook, and others are validated). Unsupported or unsafe mints fail with errors such asInvalidMint.
If you need a mint allowlisted, coordinate with Donate.gg; updating the whitelist is upsert_mint_whitelist_v1 (relayer-only).
Events
After a successful donation, observeDonationMadeV1Event:
| Field | Type | Meaning |
|---|---|---|
daas_event_discriminator | enum | Event family discriminator. |
config_id | [u8; 32] | Config the donation applied to. |
mint | pubkey | Donated mint. |
epoch | u128 | Epoch when the donation was recorded. |
gross_amount | u64 | Total amount transferred in (base units). |
tip | u64 | Tip portion from tip_bps. |
message | string | Donor message. |
credited_to | pubkey | Credited party. |
Relayer-only instructions (do not integrate)
These require the relayer signer and are not for end-user wallets:close_donation_epoch_v1distribute_non_swap_output_mint_v1swap_then_distribute_v1upsert_mint_whitelist_v1