Skip to main content

Creator Revenue

If you launched a tax token, every trade on it earns you the tax - and Flap pays it to your wallet by itself. On the curve the tax is charged as part of each trade; after graduation it accumulates in the token and Flap liquidates it into the quote asset and sends it on. There is nothing to claim in the usual sense, but three pots can still be waiting:

  • Pending tax - liquidated but not yet pushed to you. Anyone may trigger the payout.
  • LP fees - once graduated, the beneficiary's share of the PancakeSwap pool's fees.
  • Dividends - if the token pays holders a dividend (a tax token with dividendBps, or any standard token, whose LP fees are the dividend), your own unclaimed share.

Two endpoints, free and keyless. They work for any wallet, not only the creator: a holder claims their dividend the same way.

What's waiting

GET https://api.shrine.trade/bnb/api/fees/{wallet}?token={yourToken}
{
"wallet": "0xF31b8fcD326e0aD7837af0aefed60cC71Db82595",
"token": "0x2f1952E00F6BA7655993120B8c41E5ab511e7777",
"asset": "BNB",
"decimals": 18,
"beneficiary": "0xF31b8fcD326e0aD7837af0aefed60cC71Db82595",
"isBeneficiary": true,
"totalPaid": "27083340900000001",
"totalPaidFormatted": "0.027083340900000001",
"pendingTax": "0",
"pendingTaxFormatted": "0",
"lpFees": "0",
"lpFeesFormatted": "0",
"dividend": "0",
"dividendFormatted": "0",
"claimable": "0",
"claimableFormatted": "0",
"hasClaimable": false
}

totalPaid is what Flap has already sent the beneficiary - automatically, no claim needed. claimable is what a claim from wallet would move right now: the pending tax (if wallet is the beneficiary), the LP fee share and your dividend. hasClaimable: false means don't bother - you'd only pay gas.

Claim it

POST https://api.shrine.trade/bnb/api/claim-fees

Send { "from": "0x…", "token": "0x…" } - your wallet and your launched token - and you get back the transactions that move everything that is waiting: up to three, send them in order.

const { Wallet } = require("ethers");

// ─── change these ─────────────────────────────────────
const PRIVATE_KEY = "0xYOUR_PRIVATE_KEY";
const TOKEN = "0xYOUR_LAUNCHED_TOKEN";
// ──────────────────────────────────────────────────────

async function main() {
const wallet = new Wallet(PRIVATE_KEY); // signs only; no node needed

// 1. Ask shrine.trade to build the claim.
const res = await fetch("https://api.shrine.trade/bnb/api/claim-fees", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ from: wallet.address, token: TOKEN }),
});
const data = await res.json();
if (data.error) throw new Error(`${data.error}: ${data.message}`);
console.log("claiming", data.claimingFormatted, data.asset);

// 2. Sign locally and send, in order - the key never leaves this script.
for (const tx of data.txs) {
const signed = await wallet.signTransaction({
to: tx.to, data: tx.data, value: BigInt(tx.value), gasLimit: BigInt(tx.gas),
maxFeePerGas: BigInt(tx.maxFeePerGas), maxPriorityFeePerGas: BigInt(tx.maxPriorityFeePerGas),
nonce: tx.nonce, chainId: tx.chainId, type: 2,
});
const sent = await (await fetch("https://api.shrine.trade/bnb/api/send", {
method: "POST", headers: { "content-type": "application/json" },
body: JSON.stringify({ signedTx: signed }),
})).json();
if (sent.error) throw new Error(`${sent.error}: ${sent.message}`);
if (sent.status !== "landed") throw new Error(`${tx.description} ${sent.status}: ${sent.explorer}`);
console.log(tx.description + ": " + sent.explorer);
}
}

main();

Save it as claim.js, then:

npm install ethers
node claim.js

Notes

  • The tax goes to the beneficiary - your wallet unless you set another at launch. /api/token/{address} shows which. A dispatch_tax transaction can be sent by anyone; the money still goes to the beneficiary.
  • Launches priced in USD1 or another ERC-20 pay out in that asset. Pass the launched token and the API works out the rest.
  • LP fees exist only after graduation and only for the beneficiary; claim_lp_fees fails with not_beneficiary for anyone else.
  • These are Flap's payments to you as a creator. Flap keeps its protocol fee on curve trades and up to 0.3% of taxed volume - see Fees. Our 0.5% on trades is separate and never touches any of this; creating a token costs you nothing beyond gas.