https://api.donate.gg/api/v2.
1. Decide who the money is for
Let the person choose a beneficiary, or choose one yourself. Either way you end with atype and
an id. Build a beneficiary picker covers the search.
Then create a config for that choice on your server. A config is the thing a donation is made
against.
id, the 32 bytes as 0x hex for an EVM chain, and
idBase58, the same bytes for Solana. Store both. The same beneficiaries and weights always give
the same config, so create it once per choice and reuse the id for every donor: the answer is
201 the first time and 200 after. Configs are permanent, and a donation through a config your
project created pays a 20% fee today. See Concepts.
2. Find the contract on the donor’s chain
GET /v2/chains lists the chains a donation can be made
on, with the contract or program a donation calls on each.
This list changes rarely. The answer says so with
Cache-Control: private, max-age=300: read it
at startup and keep it for minutes, not per request.
3. Tell the donor the fee
A config has no fee on it. Ask for the fee that applies now, for the chain the donor pays on and the address the donation is credited to. The address below is a placeholder nobody holds: send the donor’s wallet.feeBps is in basis points, so 2000 is 20%. The quote is an estimate and is not locked: ask
again just before the donor signs, and if the call fails, say the fee is unavailable. See
Fees.
4. Send the transaction
The transaction names the config id and nothing else about the recipients.- On Solana, call the Donation Relay program. Instructions, accounts and rent are on the Solana page.
- On an EVM chain, call
donateNative,donateTokenordonateTokenWithPermiton thedonationRelay.addressfor that chain. See EVM and Bridged EVM donations.
creditedAddress you quoted the fee for.