创建代币
PumpFun
StonkFun
发送币的名称、符号和图片。你会拿回创建交易,如果需要,开发者买入也在里面,并且币会得到一个以 pump 结尾的地址。用钱包签名,发出去,完成。图片和详情由我们替你上传;你的密钥永远不离开你的机器。
POST https://sol.shrine.trade/api/create-token
示例
- JavaScript
- Python
import { Keypair, VersionedTransaction } from "@solana/web3.js";
import bs58 from "bs58";
const wallet = Keypair.fromSecretKey(bs58.decode("<your wallet private key, base58>"));
const { tx, mint } = await (await fetch("https://sol.shrine.trade/api/create-token", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
publicKey: wallet.publicKey.toBase58(),
name: "My Coin",
symbol: "MINE",
description: "What it is, in a sentence.",
imageUrl: "https://…/logo.png",
twitter: "https://x.com/…",
initialBuy: 0.5, // 开发者买入,在同一笔交易里
}),
})).json();
const transaction = VersionedTransaction.deserialize(Buffer.from(tx, "base64"));
transaction.sign([wallet]); // mint 的签名已经在位
const sent = await (await fetch("https://sol.shrine.trade/api/send", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ signedTx: Buffer.from(transaction.serialize()).toString("base64") }),
})).json();
console.log(mint, sent.status, `https://solscan.io/tx/${sent.signature}`);
import base64, requests
from solders.keypair import Keypair
from solders.transaction import VersionedTransaction
wallet = Keypair.from_base58_string("<your wallet private key, base58>")
r = requests.post("https://sol.shrine.trade/api/create-token", json={
"publicKey": str(wallet.pubkey()),
"name": "My Coin",
"symbol": "MINE",
"description": "What it is, in a sentence.",
"imageUrl": "https://…/logo.png",
"twitter": "https://x.com/…",
"initialBuy": 0.5, # 开发者买入,在同一笔交易里
}).json()
raw = VersionedTransaction.from_bytes(base64.b64decode(r["tx"]))
mint = Keypair.from_base58_string(r["mintSecretKey"]) # solders 会重建每一个签名
signed = VersionedTransaction(raw.message, [wallet, mint])
sent = requests.post("https://sol.shrine.trade/api/send",
json={"signedTx": base64.b64encode(bytes(signed)).decode()}).json()
print(r["mint"], sent["status"], sent["explorer"])
这会发射一枚真实的币
一旦创建交易上链,就是主网上一枚真实的币,以你的钱包为创建者,且永久如此。请先用一次性钱包试试。
请求
| 字段 | 类型 | 说明 |
|---|---|---|
publicKey | string | 创建者钱包。负责签名、付款,之后领取创建者费用。 |
name | string | 最多 32 字节。 |
symbol | string | 最多 13 字节。 |
imageUrl | string | 币的图片,由 API 抓取(最大 8 MB)。或者用 imageBase64 直接传字节。 |
description | string | 可选。 |
twitter、telegram、website | string | 可选链接。 |
initialBuy | number | 可选的开发者买入,单位 SOL,在同一笔交易里,这样没人能抢跑发射。 |
slippage | number | 百分比,用于开发者买入。默认 10。 |
uri | string | 可选。已经托管了元数据 JSON?传它的地址,替代图片和链接。 |
mint | string | 可选。你自己生成的 mint 密钥对的公钥;此时它也要签名。省略则得到一个以 pump 结尾的地址,tx 中已经替它签好名。 |
creatorFeeAddress | string | 可选。领取创建者交易费份额的钱包。默认为 publicKey。 |
quoteMint | string | 可选。用 USDC 或 pump.fun 自定义计价对列表上的任何 mint 为币计价,替代 SOL。此时 initialBuy 和手续费都以该计价资产计。 |
mayhemMode | boolean | pump.fun 混乱模式。 |
holderReward | boolean | 每笔交易的创建者费用归币的持有者所有,由 pump.fun 发放。永久生效。 |
creatorFeeBps | number | 仅限自定义计价对:币自己的创建者费率,上限为 pump.fun 的上限(目前 300)。 |
priorityFee | number | SOL。 |
jitoTip | number | SOL。 |
响应
{
"tx": "<base64, signed by the mint, waiting for your wallet>",
"mint": "…pump",
"mintSecretKey": "…",
"bondingCurve": "…",
"feeLamports": 1250000,
"signers": ["<wallet>", "<mint>"]
}
当发射和它的开发者买入放不进一笔交易时,响应还会带上 buyTx,即使用同一 blockhash 的开发者买入:先发 tx 再发 buyTx,或者把两者作为一个捆绑包发送。要让其他钱包在发射区块里买入,把创建放在捆绑包的第一笔,并在买入里用 mintRef 引用这枚币;开发者买入加一笔额外买入也能放进一笔多操作交易。
在 StonkFun 上发射
StonkFun 发射以代币化股票、Pre-IPO 股票、货币或 SOL 计价的币。他们的托管流程在这里做了封装:你拿到报价,签一笔支付交易,StonkFun 铸造并上架这枚币。之后交易它就像任何其他币一样走交易端点。
GET /api/stonkfun/pairs列出发射可以用来计价的资产;从中选一个quoteMint。POST /api/stonkfun/launch,带上publicKey、quoteMint、name、symbol、logo(data URL)、mode(standard或reward),以及devBuySol或devBuyPercent。响应携带paymentTransaction、signedQuote和expiresAt。- 在十分钟内签署
paymentTransaction,然后POST /api/stonkfun/launch/submit,内容为{ "signedQuote", "signedTransaction", "logo" };轮询GET /api/stonkfun/launch/{paymentSignature}直到completed。
发射费由 StonkFun 设定(约 0.29 SOL,在 payment.feeSol 中);shrine 在发射上不收任何费用。切勿重复支付:第二次支付就是第二枚币。
试一试
拖入代币图片,填写名称和符号,粘贴钱包私钥,按 Launch。私钥只留在你的浏览器里:在本地签名,只有签好的交易会发给中继。图片和资料会自动上传。这会在主网上发射一个真实的代币。
LimitsFree 1 req/sLite 3 req/sDeveloper 5 req/sSee plans →