@gangfun/cli 0.18.0 → 0.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/README.zh-CN.md +4 -4
- package/package.json +1 -1
- package/src/discover.js +5 -2
- package/src/fly.js +70 -11
- package/src/index.js +2 -2
- package/src/mcp.js +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Operate [gang.fun](https://gang.fun) from a Binance **Agentic Wallet**. Curve bu
|
|
|
6
6
|
|
|
7
7
|
**One command per action (0.12.0+):** `gang buy` / `sell` / `info` / `status` / `claim` / `mint` / `withdraw` / `release` work on every token: the CLI reads the token's kind and runs the V3, 打新 or V2 / Soft code. `gang v3 …` / `gang fair …` stay as aliases.
|
|
8
8
|
|
|
9
|
-
**持续打新 / continuous mint (0.18.0+):** `gang create --fly` starts a sale on GangFlywheelPad (its own pad, kind 3): shares with a quota per wallet (invites add quota), a pool at the mint price once it fills, and minting that goes on after launch. The unified commands detect these tokens (`kind: "fly"`); `gang fly …` is the alias.
|
|
9
|
+
**持续打新 / continuous mint (0.18.0+):** `gang create --fly` starts a sale on GangFlywheelPad (its own pad, kind 3): shares with a quota per wallet (invites add quota), a pool at the mint price once it fills, and minting that goes on after launch. The unified commands detect these tokens (`kind: "fly"`); `gang fly …` is the alias. Live on BSC mainnet since 2026-10-30 (pad `0x631e66560F4FAE4e486B65349edE48189E48B029`, built in); `--testnet` uses BSC testnet set 2. Rules: `skill/references/fly.md`.
|
|
10
10
|
|
|
11
11
|
**V3 tax tokens and 打新 (0.9.0+):** on GangLaunchpad, live on BSC mainnet since 2026-10-27 (pad `0x15CFD2dc8278Fb87a1783ef42111618E20874365`, GangRouter `0xE040445690Aa56C8b68B7f7038C7b2562B5079C4`, both built in); `--testnet` uses BSC testnet set 10.
|
|
12
12
|
|
|
@@ -75,7 +75,7 @@ gang upload-logo (--file ./avatar.png | --url <image URL>) # → ipfs://<cid>
|
|
|
75
75
|
gang create --name <n> --symbol <s> [--buy-tax 2 --sell-tax 2 [--dividend 0] [--recipient 0x…]] [--logo ./avatar.png | --logo-uri URL] [--website URL] [--twitter @handle] [--description "…"] [--testnet]
|
|
76
76
|
gang create --fair --name <n> --symbol <s> [--raise 15] [--cap 0.5] [--hold 60] [--mint-fee 1] [--exit-fee 1] [--shares 1] [--logo …] [--website URL] [--twitter @handle] [--description "…"] [--testnet]
|
|
77
77
|
# --cap 0.25–1% of supply per wallet (1% → at least 50 wallets), --hold 60–90% (the hold line)
|
|
78
|
-
# 持续打新 (continuous mint, GangFlywheelPad;
|
|
78
|
+
# 持续打新 (continuous mint, GangFlywheelPad; mainnet, --testnet = set 2). --preset j (default: the J template) or
|
|
79
79
|
# steady; every setting can be overridden: --raise 3-50 --quota 5-100 --invite-bonus 0-3 --max-per-tx 1-10 --hold 60-90
|
|
80
80
|
# --mint-fee 1-3 --exit-fee 1-2 --dev-cut 0-10 --buy-pct 0-50 --sell-tax 1-2 --launch-delay 0-300 --window 300-1800
|
|
81
81
|
# --cap-mul 1-2 --post-mint|--no-post-mint --tier flat|standard|linear [--step-pct --step-shares --max-mul] --supply-cap 10-500
|
|
@@ -274,10 +274,10 @@ timed-out `gang_execute`, check `gang_status` / the wallet history instead of ex
|
|
|
274
274
|
| `GANG_UPDATE_URL` | Where that check asks, default `https://registry.npmjs.org/@gangfun/cli/latest`; set an npm mirror's `…/@gangfun/cli/latest` if npmjs is slow or blocked |
|
|
275
275
|
| `GANG_PAD` / `GANG_TESTNET_PAD` | Override the merged GangLaunchpad (mainnet / testnet) behind V3 and 打新 (defaults: mainnet `0x15CF…4365`, testnet set 10 `0xFebF…5BB1`). Old names `GANG_V3_PAD` / `GANG_FAIR_PAD`, `GANG_V3_TESTNET_PAD` / `GANG_FAIR_TESTNET_PAD` still work as aliases |
|
|
276
276
|
| `GANG_TESTNET_RPC_URL` | Testnet RPC, one URL or a comma list (unset: PublicNode, then BNB Chain's testnet nodes); old names `GANG_V3_TESTNET_RPC_URL` / `GANG_FAIR_TESTNET_RPC_URL` still work |
|
|
277
|
-
| `GANG_FLY_PAD` / `GANG_TESTNET_FLY_PAD` | GangFlywheelPad (持续打新). Defaults: mainnet `0x631e…B029` (
|
|
277
|
+
| `GANG_FLY_PAD` / `GANG_TESTNET_FLY_PAD` | GangFlywheelPad (持续打新). Defaults: mainnet `0x631e…B029` (open since 2026-10-30), testnet set 2 `0xD648…951c` |
|
|
278
278
|
| `GANG_BOND` / `GANG_TESTNET_BOND` | GangBond (creator bonds, `gang bond`). Defaults: mainnet `0xe92d…14E4` (since 2026-10-29, CLI 0.16.2+), testnet `0xd6a8…1086` |
|
|
279
279
|
| `GANG_ROUTER` / `GANG_TESTNET_ROUTER` | GangRouter proxy (native-BNB V3 buys / mints, and every PancakeSwap trade of a graduated token); old name `GANG_ROUTER_TESTNET` still works. Defaults: mainnet `0xE040…79C4`, testnet set 10 `0x6bB6…C9F6` |
|
|
280
280
|
|
|
281
281
|
## Version
|
|
282
282
|
|
|
283
|
-
`0.18.
|
|
283
|
+
`0.18.2` · repo [gangfun/cli](https://github.com/gangfun/cli) · published to [npm](https://www.npmjs.com/package/@gangfun/cli) on push to `main`
|
package/README.zh-CN.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
**一个动作一条命令(0.12.0+):** `gang buy` / `sell` / `info` / `status` / `claim` / `mint` / `withdraw` / `release` 对所有币都能用:CLI 先读出这个币的类型,再执行 V3、打新或 V2 / Soft 的逻辑。`gang v3 …` / `gang fair …` 保留为别名。
|
|
8
8
|
|
|
9
|
-
**持续打新(0.18.0+):** `gang create --fly` 在 GangFlywheelPad(单独的发射台,kind 3)上开一场持续打新:按份 mint,每个钱包有额度,邀请可以加额度;打满后按 mint 价开池,开池后还能继续 mint。统一命令会自动识别这类币(`kind: "fly"`),`gang fly …`
|
|
9
|
+
**持续打新(0.18.0+):** `gang create --fly` 在 GangFlywheelPad(单独的发射台,kind 3)上开一场持续打新:按份 mint,每个钱包有额度,邀请可以加额度;打满后按 mint 价开池,开池后还能继续 mint。统一命令会自动识别这类币(`kind: "fly"`),`gang fly …` 是别名。2026-10-30 起在 BSC 主网运行(发射台 `0x631e66560F4FAE4e486B65349edE48189E48B029`,已内置);`--testnet` 走 BSC 测试网第 2 套。规则见 `skill/references/fly.md`。
|
|
10
10
|
|
|
11
11
|
**V3 税收币和打新(0.9.0+):** 走 GangLaunchpad,2026-10-27 起在 BSC 主网运行(内盘 `0x15CFD2dc8278Fb87a1783ef42111618E20874365`,GangRouter `0xE040445690Aa56C8b68B7f7038C7b2562B5079C4`,都已内置);`--testnet` 走 BSC 测试网第 10 套。
|
|
12
12
|
|
|
@@ -86,7 +86,7 @@ gang buyback status|set|set-payee|apply --token 0x… [--pct 0-100] [--to 0x…]
|
|
|
86
86
|
gang create --fair … [--shares <n>] --bond <数量> [--bond-hold …] --bond-days <7-90> # 打新:发币(含 dev 份额)→ 押金
|
|
87
87
|
gang execute --request-id <id>
|
|
88
88
|
gang tx --pending # 在 Binance App 里批准过的交易:按预览时的调用自动找到交易,再按下面这条处理
|
|
89
|
-
# 持续打新(GangFlywheelPad
|
|
89
|
+
# 持续打新(GangFlywheelPad;主网,--testnet 走测试网第 2 套)。--preset j(默认,J 模板)或 steady,每一项都能单独改:
|
|
90
90
|
# --raise 3-50 --quota 5-100 --invite-bonus 0-3 --max-per-tx 1-10 --hold 60-90 --mint-fee 1-3 --exit-fee 1-2 --dev-cut 0-10
|
|
91
91
|
# --buy-pct 0-50 --sell-tax 1-2 --launch-delay 0-300 --window 300-1800 --cap-mul 1-2 --post-mint|--no-post-mint
|
|
92
92
|
# --tier flat|standard|linear [--step-pct --step-shares --max-mul] --supply-cap 10-500
|
|
@@ -238,10 +238,10 @@ Claude Code:`claude mcp add gang -- gang mcp`。同一台机器上 `baw` 要
|
|
|
238
238
|
| `GANG_UPDATE_URL` | 新版本检查查询的地址,默认 `https://registry.npmjs.org/@gangfun/cli/latest`;npmjs 慢或打不开时,可以换成 npm 镜像的 `…/@gangfun/cli/latest` |
|
|
239
239
|
| `GANG_PAD` / `GANG_TESTNET_PAD` | 覆盖合并后的内盘合约 GangLaunchpad(主网 / 测试网),V3 和打新共用(默认:主网 `0x15CF…4365`,测试网第 10 套 `0xFebF…5BB1`)。旧名 `GANG_V3_PAD` / `GANG_FAIR_PAD`、`GANG_V3_TESTNET_PAD` / `GANG_FAIR_TESTNET_PAD` 仍可用(别名) |
|
|
240
240
|
| `GANG_TESTNET_RPC_URL` | 测试网 RPC,可填一个或逗号分隔的多个(不设时先用 PublicNode,再用 BNB Chain 的测试网节点);旧名 `GANG_V3_TESTNET_RPC_URL` / `GANG_FAIR_TESTNET_RPC_URL` 仍可用 |
|
|
241
|
-
| `GANG_FLY_PAD` / `GANG_TESTNET_FLY_PAD` | GangFlywheelPad(持续打新)。默认:主网 `0x631e…B029
|
|
241
|
+
| `GANG_FLY_PAD` / `GANG_TESTNET_FLY_PAD` | GangFlywheelPad(持续打新)。默认:主网 `0x631e…B029`(2026-10-30 起开放),测试网第 2 套 `0xD648…951c` |
|
|
242
242
|
| `GANG_BOND` / `GANG_TESTNET_BOND` | GangBond(押金承诺,`gang bond`)。默认:主网 `0xe92d…14E4`(2026-10-29 起,CLI 0.16.2+),测试网 `0xd6a8…1086` |
|
|
243
243
|
| `GANG_ROUTER` / `GANG_TESTNET_ROUTER` | GangRouter 代理(用原生 BNB 买 V3 / 打新,以及已毕业币的所有外盘买卖);旧名 `GANG_ROUTER_TESTNET` 仍可用。默认:主网 `0xE040…79C4`,测试网第 10 套 `0x6bB6…C9F6` |
|
|
244
244
|
|
|
245
245
|
## 版本
|
|
246
246
|
|
|
247
|
-
`0.18.
|
|
247
|
+
`0.18.2` · [gangfun/cli](https://github.com/gangfun/cli) · push 到 `main` 自动发布到 [npm](https://www.npmjs.com/package/@gangfun/cli)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gangfun/cli",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.2",
|
|
4
4
|
"description": "Gang launchpad CLI for Binance Agentic Wallet agents: create on GangLaunchpad (untaxed or tax tokens), 打新 fair mint, PancakeSwap pool trades, LaunchpadV2 and legacy Soft/U/S trade.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/discover.js
CHANGED
|
@@ -94,7 +94,9 @@ function gangRow(r, quoteUsdOf) {
|
|
|
94
94
|
volume24hUsd: inUsd('volume24hUsd', 'volume24hQuote'), trades24h: num(r.trades24h), trades: num(r.trades),
|
|
95
95
|
holders: r.holders != null ? num(r.holders) : fair ? num(r.participants) : null,
|
|
96
96
|
...(fair && { sharePrice: w(r.sharePrice), sharesLeft: num(r.sharesLeft), minWalletsLeft: num(r.minWalletsLeft) }),
|
|
97
|
-
...(r.track === 'fly' && {
|
|
97
|
+
...(r.track === 'fly' && {
|
|
98
|
+
status: r.status ?? null, postMint: !!r.postMint, mintPaused: !!r.mintPaused, baseQuota: num(r.baseQuota), inviteBonus: num(r.inviteBonus),
|
|
99
|
+
}),
|
|
98
100
|
createdAt: r.createdAt, ageMin: r.createdAt ? Math.floor((now() - r.createdAt) / 60) : null,
|
|
99
101
|
lastTradeAt: r.lastTradeAt || r.lastActivityAt || null, creatorHandle: r.creatorHandle || null, logoUrl: r.logoUrl || null,
|
|
100
102
|
website: r.website && !websiteError(r.website) ? r.website : null,
|
|
@@ -183,7 +185,8 @@ const hint = (t) => {
|
|
|
183
185
|
// mint); a filled sale waits for its launch, a refund-only one only sells back
|
|
184
186
|
if (t.track === 'fly' && t.status === 'filled') return `gang info --token ${t.address}`
|
|
185
187
|
if (t.track === 'fly' && t.status === 'refund') return `gang withdraw --token ${t.address} --all`
|
|
186
|
-
|
|
188
|
+
// launched with post-launch minting paused (the pool too far below its references): the pool, not a mint
|
|
189
|
+
if (t.track === 'fly' && (!t.graduated || (t.postMint && !t.mintPaused))) return `gang mint --token ${t.address} --shares <n>`
|
|
187
190
|
if (t.graduated) return `gang buy --token ${t.address} ${amount}` // the PancakeSwap pool, through GangRouter
|
|
188
191
|
if (t.track === 'fair') return `gang mint --token ${t.address} --shares <n>`
|
|
189
192
|
if (t.track === 'v3') return `gang buy --token ${t.address} ${amount}`
|
package/src/fly.js
CHANGED
|
@@ -82,6 +82,8 @@ export const FLY_HANDLER_ABI = parseAbi([
|
|
|
82
82
|
'function eligibleShare(address token, address user) view returns (uint256)',
|
|
83
83
|
'function owedOf(address token) view returns (uint256)',
|
|
84
84
|
'function release(address token) returns (uint256 amount)',
|
|
85
|
+
'function blockRefOf(address token) view returns (uint32 blockNumber, uint224 price)',
|
|
86
|
+
'function prevBlockStartOf(address token) view returns (uint256)',
|
|
85
87
|
'error ProtectionNotAgent()', 'error ProtectionCapExceeded()', 'error PriceBelowReference()', 'error NothingOwed()',
|
|
86
88
|
'error SellDuringFlashSwap()', 'error OutOfGas()',
|
|
87
89
|
'event Launched(address indexed token, uint256 protectedUntil, address gate, uint256 cap, uint256 launchPrice)',
|
|
@@ -187,7 +189,7 @@ export async function isFlyToken(ctx, token) {
|
|
|
187
189
|
export async function padOpen(ctx) {
|
|
188
190
|
return (await ctx.read(ctx.pad, FLY_PAD_ABI, 'migrator')) !== zeroAddress
|
|
189
191
|
}
|
|
190
|
-
const CLOSED = 'the 持续打新 (continuous mint) pad on BSC mainnet
|
|
192
|
+
const CLOSED = 'the 持续打新 (continuous mint) pad on BSC mainnet takes no creates right now (no migrator set): use --testnet to try it there'
|
|
191
193
|
|
|
192
194
|
const symbolOf = async (ctx, token) => { try { return await ctx.read(token, TOKEN_ABI, 'symbol') } catch { return null } }
|
|
193
195
|
const pct = (bps) => Number(bps) / 100
|
|
@@ -275,10 +277,50 @@ async function poolSide(ctx, token, sale, handler) {
|
|
|
275
277
|
},
|
|
276
278
|
tax: { buyPct: BUY_TAX_PCT, sellPct: pct(sellTaxBps), split: 'the first 1%: holders 50% / platform 25% / creator 25%; sell tax above 1%: holders' },
|
|
277
279
|
supply: { total: formatUnits(supply, 18), max: formatUnits(maxSupply, 18), mintRoom: formatUnits(room, 18) },
|
|
278
|
-
raw: { spot, until: Number(until), gate, cap, sellTaxBps: Number(sellTaxBps), room },
|
|
280
|
+
raw: { spot, blockStart, high, average, until: Number(until), gate, cap, sellTaxBps: Number(sellTaxBps), room },
|
|
279
281
|
}
|
|
280
282
|
}
|
|
281
283
|
|
|
284
|
+
// FlywheelPostLogic: a post-launch mint is refused while the pool is more than 10% below its 30-minute average or its
|
|
285
|
+
// recent high, or when its buyer price is more than 10% above the pool; FlywheelOracle: the previous block start counts
|
|
286
|
+
// for 20 blocks
|
|
287
|
+
const MAX_DROP_BPS = 1_000n, HIGH_GAP_BPS = 1_000n, TWAP_FLOOR_BPS = 100n, PREV_START_BLOCKS = 20n
|
|
288
|
+
const PAUSE_WHY = {
|
|
289
|
+
below_average: 'the pool price is more than 10% below its 30-minute average',
|
|
290
|
+
below_recent_high: 'the pool price is more than 10% below its recent high',
|
|
291
|
+
above_pool: 'a mint would be priced more than 10% above the pool (it dropped in the last blocks)',
|
|
292
|
+
supply_cap: 'the token\'s supply cap leaves no room for a mint',
|
|
293
|
+
}
|
|
294
|
+
const RESUMES = 'minting resumes once the pool price is back within 10% of both its 30-minute average and its recent high (the high decays 0.5% a minute; the average follows the price over 30 minutes)'
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Whether post-launch mints are refused now, by the rules mintPost checks (the wallet's own pace aside): the reads of
|
|
298
|
+
* poolSide plus the handler's previous block start, as of the latest block. → { pausedNow, reason, reasons } where reason
|
|
299
|
+
* is the first rule mintPost would hit.
|
|
300
|
+
*/
|
|
301
|
+
async function mintPause(ctx, token, sale, handler, side) {
|
|
302
|
+
const { spot, blockStart, high, average, room } = side.raw
|
|
303
|
+
const BPS = 10_000n
|
|
304
|
+
const reasons = []
|
|
305
|
+
if (spot * BPS < average * (BPS - MAX_DROP_BPS)) reasons.push('below_average')
|
|
306
|
+
if (spot * BPS < high * (BPS - HIGH_GAP_BPS)) reasons.push('below_recent_high')
|
|
307
|
+
const [bn, [b, bp], packed, one] = await Promise.all([
|
|
308
|
+
ctx.client.getBlockNumber(), ctx.read(handler, FLY_HANDLER_ABI, 'blockRefOf', [token]),
|
|
309
|
+
ctx.read(handler, FLY_HANDLER_ABI, 'prevBlockStartOf', [token]), ctx.read(ctx.pad, FLY_PAD_ABI, 'sharePrice', [token, 1n]),
|
|
310
|
+
])
|
|
311
|
+
const [pb, pp] = BigInt(b) === bn ? [packed >> 224n, packed & ((1n << 224n) - 1n)] : [BigInt(b), bp]
|
|
312
|
+
const prev = bn - pb > PREV_START_BLOCKS ? 0n : pp
|
|
313
|
+
let ref = high > average ? high : average
|
|
314
|
+
if (prev > ref) ref = prev
|
|
315
|
+
const floor = (ref * (BPS - TWAP_FLOOR_BPS)) / BPS
|
|
316
|
+
let price = spot > blockStart ? spot : blockStart
|
|
317
|
+
if (floor > price) price = floor
|
|
318
|
+
if (price * BPS > spot * (BPS + HIGH_GAP_BPS)) reasons.push('above_pool')
|
|
319
|
+
// one share: the buyer's tokens and the liquidity's (at most its price of quote at spot) must fit under the cap
|
|
320
|
+
if (spot > 0n && price > 0n && (one * Q112) / price + (one * Q112) / spot > room) reasons.push('supply_cap')
|
|
321
|
+
return { pausedNow: reasons.length > 0, ...(reasons.length && { reason: reasons[0], reasons, why: PAUSE_WHY[reasons[0]] }) }
|
|
322
|
+
}
|
|
323
|
+
|
|
282
324
|
async function poolReserves(ctx, token, pair) {
|
|
283
325
|
if (!pair) return [0n, 0n]
|
|
284
326
|
const [[r0, r1], t0] = await Promise.all([ctx.read(pair, PAIR_ABI, 'getReserves'), ctx.read(pair, PAIR_ABI, 'token0')])
|
|
@@ -426,8 +468,11 @@ export async function runFly(sub, { opt, flag, out, fail, summarize, resolveLogo
|
|
|
426
468
|
const { raw: _r, ...view } = side
|
|
427
469
|
Object.assign(extra, view)
|
|
428
470
|
if (sale.rules.postMint) {
|
|
429
|
-
const one = await ctx.read(ctx.pad, FLY_PAD_ABI, 'sharePrice', [token, 1n])
|
|
430
|
-
extra.postMint = {
|
|
471
|
+
const [one, pause] = await Promise.all([ctx.read(ctx.pad, FLY_PAD_ABI, 'sharePrice', [token, 1n]), mintPause(ctx, token, sale, handler, side)])
|
|
472
|
+
extra.postMint = {
|
|
473
|
+
sharePriceNow: await units(ctx, sale.quote, one), tierMulNow: Number((one * 100n) / sale.sharePriceRaw) / 100, ...pause,
|
|
474
|
+
...(pause.pausedNow && { resumes: pause.reason === 'supply_cap' ? 'post-launch minting is over: the supply cap is reached' : RESUMES }),
|
|
475
|
+
}
|
|
431
476
|
}
|
|
432
477
|
const [owedTax, swapBack] = await Promise.all([
|
|
433
478
|
ctx.read(handler, FLY_HANDLER_ABI, 'owedOf', [token]),
|
|
@@ -438,7 +483,7 @@ export async function runFly(sub, { opt, flag, out, fail, summarize, resolveLogo
|
|
|
438
483
|
}
|
|
439
484
|
if (owed > 0n) extra.owedDevCut = await units(ctx, sale.quote, owed)
|
|
440
485
|
if (extra.owedDevCut || extra.owedCreatorTax) extra.release = `gang release --token ${token}${net} (anyone; pays the creator)`
|
|
441
|
-
return out({ success: true, chainId, kind: 'fly', ...pub(sale), ...extra, next: nextFor(sale, token, net) })
|
|
486
|
+
return out({ success: true, chainId, kind: 'fly', ...pub(sale), ...extra, next: nextFor(sale, token, net, undefined, extra.postMint) })
|
|
442
487
|
}
|
|
443
488
|
|
|
444
489
|
if (sub === 'status') {
|
|
@@ -490,12 +535,18 @@ export async function runFly(sub, { opt, flag, out, fail, summarize, resolveLogo
|
|
|
490
535
|
} else {
|
|
491
536
|
Object.assign(pos, { reward: 'none', pendingReward: reward.claimable, note: 'did not mint in this sale: the holder reward is only for minters' })
|
|
492
537
|
}
|
|
493
|
-
if (sale.rules.postMint
|
|
494
|
-
const
|
|
495
|
-
pos.
|
|
538
|
+
if (sale.rules.postMint) {
|
|
539
|
+
const pause = await mintPause(ctx, token, sale, handler, side)
|
|
540
|
+
pos.mintPaused = { ...pause, ...(pause.pausedNow && { resumes: pause.reason === 'supply_cap' ? 'post-launch minting is over: the supply cap is reached' : RESUMES }) }
|
|
541
|
+
if (acct.view.quotaLeft > 0) {
|
|
542
|
+
const [acc, paid, fee, tokensOut, ok] = await ctx.read(ctx.pad, FLY_PAD_ABI, 'previewMintPost', [token, who, 1n])
|
|
543
|
+
pos.mintOneShareNow = acc ? { paid: await units(ctx, sale.quote, paid), fee: await units(ctx, sale.quote, fee), tokensOut: formatUnits(tokensOut, 18), ok } : null
|
|
544
|
+
// the sale's rules allow a mint, the wallet's own 30-minute pace does not
|
|
545
|
+
if (acc && !ok && !pause.pausedNow) pos.mintPaused = { pausedNow: true, reason: 'pace', why: 'this wallet\'s recent post-launch mints reach its 30-minute pace (2% of the pool\'s quote side)', resumes: 'the pace decays over 30 minutes' }
|
|
546
|
+
}
|
|
496
547
|
}
|
|
497
548
|
}
|
|
498
|
-
return out({ success: true, chainId, kind: 'fly', wallet: who, sale: pub(sale), position: pos, next: nextFor(sale, token, net, acct.view) })
|
|
549
|
+
return out({ success: true, chainId, kind: 'fly', wallet: who, sale: pub(sale), position: pos, next: nextFor(sale, token, net, acct.view, pos.mintPaused) })
|
|
499
550
|
}
|
|
500
551
|
|
|
501
552
|
if (sub === 'invite') {
|
|
@@ -517,6 +568,12 @@ export async function runFly(sub, { opt, flag, out, fail, summarize, resolveLogo
|
|
|
517
568
|
inviteBonusPerInvite: sale.rules.inviteBonus, invited: acct.view.invited, bonusShares: acct.view.inviteBonusShares,
|
|
518
569
|
quota: acct.view.quota, quotaLeft: acct.view.quotaLeft,
|
|
519
570
|
...(board?.invitees && { invitees: board.invitees }),
|
|
571
|
+
// gang.fun's board counts an invite only while it holds up (so sell-backs can't farm it); the bonus above is the
|
|
572
|
+
// pad's and stays either way. Older servers have no such counts: the output is as before
|
|
573
|
+
...(Number.isFinite(board?.validInvites) && {
|
|
574
|
+
validInvites: board.validInvites, totalInvites: board.totalInvites ?? acct.view.invited,
|
|
575
|
+
validNote: 'gang.fun counts an invite as valid while the invitee still holds pre-launch shares (before the fill), once the sale has filled or launched, or when the invitee first minted after launch; none counts in a refund-only sale. The quota bonus is on chain and stays either way',
|
|
576
|
+
}),
|
|
520
577
|
...(!board && { inviteesNote: `the list of invitees comes from ${API} (/fly/tokens/<token>/invites) once it indexes this pad; the count here is read on chain` }),
|
|
521
578
|
note: 'an invite counts on the invitee\'s first mint in this token (before or after launch), when it passes --ref (gang mint --ref <inviter>) or opens the link; the inviter must have minted here and hold an Agent ID',
|
|
522
579
|
})
|
|
@@ -922,11 +979,13 @@ const cfgView = (c) => ({
|
|
|
922
979
|
...(c.tierMode === 2 && { stepPct: pct(c.stepBps), stepShares: c.stepShares, maxMul: c.maxMulX100 / 100 }), supplyCapMul: c.supplyCapMul,
|
|
923
980
|
})
|
|
924
981
|
|
|
925
|
-
/** The command that acts on the sale next. */
|
|
926
|
-
function nextFor(sale, token, net, acct) {
|
|
982
|
+
/** The command that acts on the sale next. `paused`: mintPause (or the wallet's) after launch. */
|
|
983
|
+
function nextFor(sale, token, net, acct, paused) {
|
|
927
984
|
if (sale.status === 'minting') return `gang mint --token ${token} --shares <n>${net}${acct && !acct.minted ? ' [--ref <inviter>]' : ''}`
|
|
928
985
|
if (sale.status === 'filled') return sale.launchableNow ? `gang fly launch --token ${token}${net}` : `wait until ${sale.launchAt}, then gang fly launch --token ${token}${net}`
|
|
929
986
|
if (sale.status === 'stalled') return `gang fly launch --token ${token}${net} (or gang withdraw to sell back)`
|
|
930
987
|
if (sale.status === 'refund') return `gang withdraw --token ${token} --all${net}`
|
|
988
|
+
if (sale.rules.postMint && paused?.pausedNow) return `gang buy --token ${token} --amount <quote>${net} (post-launch minting is paused: ${paused.why})`
|
|
989
|
+
if (sale.rules.postMint && acct && !acct.quotaLeft) return `gang buy --token ${token} --amount <quote>${net} (this wallet's mint quota is used up)`
|
|
931
990
|
return sale.rules.postMint ? `gang mint --token ${token} --shares <n>${net} (or gang buy in the pool)` : `gang buy --token ${token} --amount <quote>${net}`
|
|
932
991
|
}
|
package/src/index.js
CHANGED
|
@@ -302,8 +302,8 @@ U / S pads) and run that kind's trade. Results of V3 / 打新 / 持续打新 tok
|
|
|
302
302
|
[--sell-tax 1-2] [--launch-delay 0-300] [--window 300-1800] [--cap-mul 1-2] [--post-mint | --no-post-mint]
|
|
303
303
|
[--tier flat|standard|linear [--step-pct 0-10 --step-shares 100-100000 --max-mul 1-10]] [--supply-cap 10-500]
|
|
304
304
|
[--dev-shares <n>] [--quote 0x… --ref-pool 0x…] [--logo …] [--website URL] [--twitter @handle] [--description …]
|
|
305
|
-
a 持续打新 (continuous mint, GangFlywheelPad) sale
|
|
306
|
-
|
|
305
|
+
a 持续打新 (continuous mint, GangFlywheelPad) sale (mainnet; --testnet = BSC testnet
|
|
306
|
+
set 2). 10,000 shares at raise / 10,000 each; a quota per wallet
|
|
307
307
|
(--quota + --invite-bonus per wallet it invites), --max-per-tx per mint, Agent ID
|
|
308
308
|
only. Fills (or the creator opens early at ≥ 30%), launches --launch-delay s later
|
|
309
309
|
(anyone; gang.fun's keeper too) into PancakeSwap at the mint price, then --window s
|
package/src/mcp.js
CHANGED
|
@@ -46,7 +46,7 @@ export const RULES = [
|
|
|
46
46
|
'A gang_execute that timed out or was cancelled on your side keeps running here (the wallet may have sent it): never execute it again or build a new preview for the same trade before checking gang_status or gang_tx with pending: true; then gang_tx (hash, or pending: true) for the result and the note.',
|
|
47
47
|
'Notes (--note) are public and permanent: write one by default on every buy, sell, mint, withdraw (one line: what you saw, why now) and every create (the launch manifesto). Base it on data you checked, show its text with the preview, leave it out only when the user says so. No links. --conf is an honest 0-100.',
|
|
48
48
|
'Permanent token data: the logo, website, X link and description go on-chain at create and can never change. Use only links the user gave; ask once if they have not said. Never host a logo on a temporary file host. Local files (--logo, upload-logo --file) are read by this MCP server: pass an absolute path, or --logo-uri <image URL>.',
|
|
49
|
-
'New tokens go on GangLaunchpad only: create (V3, untaxed unless --buy-tax / --sell-tax) or create --fair (fair mint), or GangFlywheelPad: create --fly (continuous mint
|
|
49
|
+
'New tokens go on GangLaunchpad only: create (V3, untaxed unless --buy-tax / --sell-tax) or create --fair (fair mint), or GangFlywheelPad: create --fly (continuous mint). Never an older pad.',
|
|
50
50
|
'Bonds: before a bond post, tell the user there is no early withdrawal and any sell below the promised holding before settle, anywhere, loses the whole bond. Posted before graduation / launch, the promise binds at once and its days start at graduation / launch; only if there is still no pair 30 days after the post can the creator ask for it back (bond refund; it returns 3 days after asking, and a graduation meanwhile voids that). Relay warning. breakBond (--break-bond) only when the user, told that, still says sell. bond report only when the user asks.',
|
|
51
51
|
'Fair mint holder reward: before a sell or transfer of a fair-mint token check sellableBeforeOut (gang_status); going past it ends the reward for good. confirmOut (--confirm-out) only with the user\'s yes.',
|
|
52
52
|
'Continuous mint (fly): the same hold line, but a wallet that falls below it earns again after its next mint. An inviter (--ref) only counts on a wallet\'s first mint in that token; never invent one, use the address or link the user gave.',
|