创作者收益
如果你发了一个税币,每笔交易的税都归你,而且 Flap 会自己打到你的钱包。在曲线上,税是每笔交易的一部分;毕业后,税先在代币里累积,Flap 把它清算成计价资产再发出去。通常意义上没有什么需要"领取",但仍有三处可能有钱在等:
- 待付的税:已清算但还没推给你。任何人都可以触发支付。
- LP 费用:毕业后,受益人在 PancakeSwap 池子费用里的份额。
- 分红:如果代币给持有者分红,你自己未领取的那份。
两个接口,免费,无需密钥。普通币(不带税)只有 LP 费用份额。
有什么在等
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 是 Flap 已经自动打给受益人的部分,不需要领取。claimable 是此刻从 wallet 发起领取会移动的金额:待付的税(如果 wallet 是受益人)、LP 费用份额和你的分红。hasClaimable: false 就别费事了,只会白花 Gas。
领取
POST https://api.shrine.trade/bnb/api/claim-fees
发送 { "from": "0x…", "token": "0x…" }(你的钱包和你发的代币),返回把所有等待中的钱移动到位的交易:最多三笔,按顺序发送。
- JavaScript
- Python
const { Wallet } = require("ethers");
// ─── 改这些 ─────────────────────────────────────────
const PRIVATE_KEY = "0xYOUR_PRIVATE_KEY";
const TOKEN = "0xYOUR_LAUNCHED_TOKEN";
// ──────────────────────────────────────────────────────
async function main() {
const wallet = new Wallet(PRIVATE_KEY); // 只用来签名,不连任何节点
// 1. 让 shrine.trade 构建领取交易。
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("正在领取", 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();
保存为 claim.js,然后:
npm install ethers
node claim.js
import requests
from eth_account import Account
# ─── 改这些 ─────────────────────────────────────────
PRIVATE_KEY = "0xYOUR_PRIVATE_KEY"
TOKEN = "0xYOUR_LAUNCHED_TOKEN"
# ──────────────────────────────────────────────────────
account = Account.from_key(PRIVATE_KEY) # 只用来签名,不连任何节点
# 1. 让 shrine.trade 构建领取交易。
data = requests.post(
"https://api.shrine.trade/bnb/api/claim-fees",
json={"from": account.address, "token": TOKEN},
).json()
if "error" in data:
raise SystemExit(f"{data['error']}: {data['message']}")
print("正在领取", data["claimingFormatted"], data["asset"])
# 2. 本地签名,把签好的交易交给 API 广播:私钥不会离开这个脚本,
# 你也不需要自己的 RPC。
for tx in data["txs"]:
signed = Account.sign_transaction(
{
"to": tx["to"],
"data": tx["data"],
"value": int(tx["value"]),
"gas": tx["gas"],
"maxFeePerGas": int(tx["maxFeePerGas"]),
"maxPriorityFeePerGas": int(tx["maxPriorityFeePerGas"]),
"nonce": tx["nonce"],
"chainId": tx["chainId"],
},
account.key,
)
sent = requests.post("https://api.shrine.trade/bnb/api/send", json={"signedTx": "0x" + signed.raw_transaction.hex().removeprefix("0x")}).json()
if "error" in sent:
raise SystemExit(f"{sent['error']}: {sent['message']}")
if sent["status"] != "landed":
raise SystemExit(f"{tx['description']} {sent['status']}: {sent['explorer']}")
print(tx["description"] + ":", sent["explorer"])
保存为 claim.py,然后:
pip install eth-account requests
python claim.py
注意
- 税打给
beneficiary:默认是你的钱包,除非发射时另设。/api/token/{address}能看到是谁。dispatch_tax交易任何人都可以发,钱仍然到受益人那里。 - 以 USD1 或其他 ERC-20 计价的发射以该资产支付。传入你发的代币,API 处理其余部分。
- LP 费用只在毕业后存在,且只属于受益人;其他人发
claim_lp_fees会得到not_beneficiary。 - 这些是 Flap 给你这个创作者的支付。Flap 保留内盘交易的协议费和最多 0.3% 的征税交易量,见 费用。我们对交易收的 0.5% 与此无关;创建代币除 Gas 外不花你一分钱。