What happens to a donation
1
The donor's transaction confirms
A donation made on Solana is recorded as a donation. A donation made on an EVM chain is held in
escrow on that chain and recorded as a transfer in progress.
2
It is converted and batched
EVM funds are bridged to Solana as USDC. Solana tokens are swapped to USDC when needed. A batch
waits until it is worth 1 USDC, so a small donation can wait for others to the same config.
3
It is paid out
USDC is distributed on Solana to each beneficiary by weight, with the fee and any tip accounted
for separately. When that transaction is final, the donation is settled.
Which read to use
Show recent donations
GET /v2/charities/{charityId}/donations lists the
donations that reached one charity, and
GET /v2/campaigns/{campaignId}/donations the
donations that reached one campaign. Both are newest first and count a donation whichever config
it came through: the beneficiary’s own page, a coin, or an integration. Both answer rows of the
same shape.
type. The charity and the coin are real. Both rows are
made up: Donate has recorded neither transaction, and the donors’ addresses are placeholders
nobody holds.
A charity that is hidden, disabled or has opted out, and a hidden campaign, answer 404, the same
as an unknown id. A page is shared for a few seconds, so reading faster than every five seconds
shows nothing new.
Statuses of a donation
Statuses of a transfer
These three are coarse on purpose. They come from what Donate has recorded, not from a fresh read
of the chain, so use them to label a row in a feed and for nothing else.
What else to know:
- A transfer keeps its
idwhen it becomes a donation. The row changestypefromtransfertodonationin place, so a list can update the row instead of adding one. - Transfer rows are for the beneficiary’s own page. Funds on their way from another chain to
the charity’s or campaign’s own page on donate.gg appear as
transferrows. A bridged donation through any other config appears once it is a recorded donation. - A beneficiary that is unknown or withheld
answers
404withNOT_FOUND. - A donation is listed for every beneficiary it paid. A donation through a config that splits
three ways is in three feeds, each with its own part in
amountAtomic.
Messages
For the messages donors left on a campaign, useGET /v2/campaigns/{campaignId}/messages.
A charity has the same list at
GET /v2/charities/{charityId}/messages, with the same
item and the same paging. The two differ in what they cover:
A charity that is withheld answers
404 on its message list, and so does a hidden campaign.
Track a transfer from an EVM chain
A donation made on an EVM chain is bridged before it becomes a donation. Two reads report the exact, current state of the bridge.GET /v2/donation-transfers lists the
transfers of the donor’s transaction on the chain they paid on:
GET /v2/donation-transfers/{transferId}
reads one transfer by the transferId of a row in the feed:
items. Both examples are of a made-up transaction, so on production
the list is empty and the read by id answers 404:
- The list takes
chainIdandtransactionHashtogether. Without both it answers400withVALIDATION_ERROR. transferIdandtransactionHashare EVM hashes:0xand 64 hex digits. A Solana donation does not cross chains and has no transfer.- The list has one item for each deposit the transaction made. An empty
itemsmeans the transaction has not been seen yet. It does not mean the deposit failed. A404from the read by id means the same for that id. statusis the exact state.donatedmeans a donation has been recorded and normal settlement continues. Every value, and how a deposit that cannot be delivered is reclaimed withorigin.depositIdafterreclaimAt, is in Bridged EVM donations.- Both reads are fresh on every request. If the chain or the database cannot be read they answer
503withPROVIDER_UNAVAILABLE, never an empty list or a404. Show what you last had and try again.
Track a deposit to a campaign address
A donor who sent tokens to a campaign’s deposit address has no contract call to look up. Use the deposit read in Work with campaigns.Poll, and how often
There are no webhooks. To follow a donation, read again.
Stop polling when the page is hidden, back off when a call fails, and send your API key from your
server so the reads count against your organization’s limit. See Rate limits.