跳到主要内容

Claim Creator Fees

If you launched a token, every trade on it earns you a share: what's left of the trading fee after Pons's 30%, plus all of your creator tax. It isn't sent to you automatically - you claim it. Two endpoints, free and keyless.

What's waiting

GET https://api.shrine.trade/rh/api/fees/{wallet}?token={yourToken}
{
"wallet": "0xfc1FFd8b43631Ba04a347FAF930fA1Dc547BFcb2",
"escrow": "0xd3AFEB2a57f70eF218Aa82451c51B2fb0416Ac9e",
"asset": "USDG",
"decimals": 6,
"claimable": "39388954",
"claimableFormatted": "39.388954",
"unswept": "1935146",
"unsweptFormatted": "1.935146",
"total": "41324100",
"totalFormatted": "41.3241",
"hasClaimable": true
}

total is what a claim pays out right now, in the launch's quote asset (asset). claimable is already in Pons's escrow; unswept is still on the token's curve and gets collected as part of the claim. hasClaimable: false means don't bother - you'd only pay gas.

Leave token out to see just the ETH escrow balance.

Claim it

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

Send { "from": "0x…", "token": "0x…" } - your wallet and your launched token - and you get back the transactions that pay everything out to your wallet: one or two, 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/rh/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/rh/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

  • Only the creatorFeeRecipient can claim - your wallet unless you set another at launch. /api/token/{address} shows which.
  • Launches priced in an ERC-20 (USDG, NVDA, …) pay out in that asset. Pass the launched token and the API works out the rest.
  • Launched with buybacks on? Then Pons collects the curve's fees for you on its own schedule, and the claim covers what has arrived in the escrow so far. nothing_to_claim tells you when the rest is still on the curve.
  • These are Pons's fees to you as a creator. Our 0.5% is separate and never touches this escrow.