@gabox-labs/sdk 0.1.1 → 0.6.0

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/CHANGELOG.md CHANGED
@@ -3,7 +3,255 @@
3
3
  All notable changes to `@gabox-labs/sdk`. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
4
4
  and the project uses [Semantic Versioning](https://semver.org/) with the `0.x` rule from `CONTRIBUTING.md`.
5
5
 
6
- ## [Unreleased]
6
+ ## [0.6.0] - 2026-09-18
7
+
8
+ The venue moved from Pump and PumpSwap to Raydium LaunchLab and Raydium CPMM. The program changed
9
+ with it, so the IDL changed: this is a breaking release for every caller. It matches the devnet
10
+ program deployed at slot `500223264`, and a live devnet run exercised the whole life of one coin.
11
+
12
+ ### Changed
13
+
14
+ - **Breaking.** A Gabox coin is now created on Raydium LaunchLab and graduates into a Raydium CPMM
15
+ pool. `createMachine` builds LaunchLab's `initialize_v2` instead of Pump's `create_v2`, with the
16
+ pinned launch shape: 6 decimals, 1,000,000,000 coins, 793,100,000 sold on the curve, 85 SOL raised
17
+ on mainnet or 3 SOL on devnet, migrate into CPMM, no vesting, the CPMM creator fee paid in WSOL.
18
+ The creator picks only the name, the symbol, the URI and the prize table.
19
+ - **Breaking.** Both venues settle in wrapped SOL, and no flow settles in native SOL any more. Every
20
+ builder now creates the wallet's WSOL account, wraps the lamports its trade needs, and closes the
21
+ account afterwards. That close also unwraps any WSOL the wallet already held.
22
+ - **Breaking.** `buyPack` takes `{ mint, purchaser, maxQuoteIn, minMaximum, maxNativeDebit, venue?,
23
+ seq? }`. `maxTotalQuoteDebit` is gone, because there is no Gabox fee to cover.
24
+ - **Breaking.** `createMachine` lost `feeBps`, `quote`, `feeRecipientIndex` and
25
+ `buybackRecipientIndex`. `initialize_pool` takes `(tiers, max_seed_quote_in,
26
+ max_seed_native_debit, extra_seed_tokens)`.
27
+ - **Breaking.** `Pool` lost `tokenProgram`, `quoteTokenProgram` and `feeBps`. Both venues use classic
28
+ SPL Token, and Gabox charges nothing. `Pool` also has a new discriminator, so a pool from the Pump
29
+ build now fails to decode rather than being read with shifted fields.
30
+ - **Breaking.** `PoolCreated`, `PackBought` and `TokensSold` lost every fee field.
31
+ - **Breaking.** `vaultAddress(mint)` and `associatedTokenAddress(owner, mint)` no longer take a token
32
+ program. `fetchVaultBalance(client, mint)` lost its third argument.
33
+ - `PackOffer` lost `feeBps`, `creatorFeeQuote`, `packFeeQuote`, `quoteTokenProgram` and
34
+ `nativeOnPumpCurve`. `quoteAmount` is the whole pack price, the venue's fees included, and `venue`
35
+ is now `'launchlab'` or `'cpmm'`.
36
+ - `createClient({ cluster })` now decides every Raydium address. Mainnet and devnet run different
37
+ Raydium deployments, so nothing Raydium is a module constant any more; `raydiumIds(cluster)` gives
38
+ one cluster's set.
39
+
40
+ ### Added
41
+
42
+ - `src/raydium/`, replacing `src/pump/`, exported as the `raydium` namespace and as
43
+ `@gabox-labs/sdk/raydium`.
44
+ - `raydium.curve`: exact bigint ports of Raydium's own price math, for both venues. `initialCurve`
45
+ reproduces the starting reserves Raydium publishes for the Gabox launch shape, to the base unit.
46
+ - `raydium.claimCreatorFee(client, { creator })` collects the LaunchLab creator fee for every coin a
47
+ wallet launched, and `raydium.collectCreatorFee(client, { mint, creator })` collects one graduated
48
+ coin's CPMM creator fee. Both close the WSOL account, so the creator receives SOL.
49
+ `raydium.fetchCreatorFees` reads what is owed in both places.
50
+ - `raydium.cpmmCreatorFeeShare(cpmm, creator, ammConfig)` derives
51
+ `PDA(["creator_fee_share", creator, amm_config])`. `collect_creator_fee` takes that account after
52
+ the fourteen Raydium's mainnet IDL lists. The IDL snapshot is CPMM 0.2.0 and predates it, while
53
+ the devnet build declares it and stops with `AccountNotEnoughKeys` (3005) without it. Raydium's
54
+ own SDK appends it unconditionally, and a program that does not declare it ignores a trailing
55
+ account, so the SDK sends it on both clusters.
56
+ - `raydium.findCpmmPool`: a migrated CPMM pool does not have to sit at a derived address, so this
57
+ tries the derived one and falls back to a filtered scan. Either way the pool proves itself from its
58
+ own data, including `enable_creator_fee`, which only Raydium's permissioned migration can set.
59
+ - `raydium.getCurveBuyExactInInstruction`: a plain curve buy, which Gabox never makes itself. The
60
+ devnet end-to-end test uses it to buy a curve out and force graduation.
61
+ - `fundWsol` and `unwrapWsol` in `src/tx/wsol.ts`, for a caller building its own transaction.
62
+
63
+ ### Removed
64
+
65
+ - **Breaking.** Everything Pump: `src/pump/`, the `pump` namespace, the `./pump` export,
66
+ `getPumpCreateInstruction`, `resolvePumpQuote`, `fetchPumpSupportedQuoteMints`,
67
+ `assertPumpQuoteSupported`, `venueBuyInstruction`, `venueSellInstruction`, and every `PUMP_*`,
68
+ `AMM_*` and `MAYHEM_*` constant.
69
+ - **Breaking.** `packFee`, `maxTotalQuoteDebitFor`, `share`, `shareCeil`, `PROTOCOL_FEE_BPS`,
70
+ `PROTOCOL_FEE_COLLECTOR`, `MAX_FEE_BPS`, `TOKEN_2022_PROGRAM_ADDRESS` and `DEVNET_USDC_MINT`.
71
+ Gabox charges no fee, and WSOL is the only quote.
72
+ - The `@pump-fun/pump-sdk`, `@pump-fun/pump-swap-sdk`, `@solana/spl-token`, `bn.js` and `buffer`
73
+ dependencies. `@solana/web3.js` moved to a development dependency; only the lookup-table script
74
+ uses it. The public surface is `@solana/kit` and nothing else.
75
+
76
+ ## [0.5.0] - 2026-09-17
77
+
78
+ Program commit `e1666f8`: referrals removed. The IDL changed, so this is a minor bump. 0.4.x buys
79
+ fail against this build.
80
+
81
+ ### Removed
82
+
83
+ - **Breaking.** `bindReferrer`, `fetchReferralLink`, `listReferralLinks`, `linkAddress`,
84
+ `findLinkPda`, `splitPackFee`, `shareFloor`, `REFERRAL_FEE_BPS`, the `ReferralBound` event and
85
+ `BuyPackInput.referralLink`. `buyPack` no longer passes a link or a referrer destination.
86
+ - `PackBought.referrer`, `referralFee*` and `collectorFee*`; the pack fee is reported as
87
+ `protocolFeeQuote` / `protocolFeeNative` again.
88
+
89
+ ### Unchanged
90
+
91
+ - The 70 bps Gabox pack fee (`PROTOCOL_FEE_BPS`, `packFee`, `maxTotalQuoteDebitFor`,
92
+ `PackOffer.packFeeQuote`) stays and goes to `PROTOCOL_FEE_COLLECTOR` in full.
93
+
94
+ ## [0.4.0] - 2026-09-15
95
+
96
+ Program commit `3605925`: the 70 bps Gabox pack fee and instant referral payouts. The IDL changed,
97
+ so this is a minor bump. `buyPack` transactions built with 0.3.x no longer pass the program.
98
+
99
+ ### Added
100
+
101
+ - `bindReferrer(client, { referee, referrer })`: bind a wallet to a referrer once, in a permanent
102
+ `ReferralLink` PDA (`linkAddress(wallet)`, `findLinkPda`). `fetchReferralLink(client, wallet)`
103
+ and `listReferralLinks(client, referrer)` read the links. `ReferralBound` event.
104
+ - `PROTOCOL_FEE_BPS` (70) and `REFERRAL_FEE_BPS` (50); `packFee`, `splitPackFee`, `shareFloor`
105
+ and `maxTotalQuoteDebitFor` in the math module; `PackOffer.packFeeQuote`.
106
+ - `PackBought` carries `collectorFeeQuote`, `collectorFeeNative`, `referrer`, `referralFeeQuote`
107
+ and `referralFeeNative`. Collector plus referral is the whole pack fee.
108
+
109
+ ### Changed
110
+
111
+ - **Breaking.** `buy_pack` charges a 70 bps Gabox pack fee again, on top of the creator fee, in
112
+ the pool's quote asset. `maxTotalQuoteDebit` must cover it; build it with
113
+ `maxTotalQuoteDebitFor(maxQuoteIn, feeBps)`. A referral splits the fee (50 bps to the referrer,
114
+ 20 to the collector); it never changes the total.
115
+ - **Breaking.** `buyPack` passes the collector's quote destination again, the buyer's
116
+ `ReferralLink` PDA on every buy (the program reads it and enforces the referral), and the
117
+ referrer's destination when the link exists. It fetches the link itself; `referralLink: null`
118
+ skips the lookup. It uses the sync generated instruction so nothing is derived behind its back.
119
+ - `sellTokens` still charges nothing.
120
+
121
+ ## [0.3.2] - 2026-09-14
122
+
123
+ ### Fixed
124
+
125
+ - `decodeBondingCurve` reports `WSOL_MINT` for a curve that quotes in plain SOL. Pump stores an
126
+ all-zero key there, and its own SDK treats that value as SOL. Before this fix `resolveVenue`
127
+ compared the pool's WSOL quote against the zero key and threw
128
+ `pool quote So1111… does not match Pump curve quote 1111…` for every SOL machine once its curve
129
+ existed. That broke indexing and pack buys for those machines.
130
+
131
+ ## [0.3.1] - 2026-09-14
132
+
133
+ ### Fixed
134
+
135
+ - The shared devnet lookup table now holds the fixed accounts of a token-quoted machine: the
136
+ USDC mint, Pump's quote-control PDA, the protocol creator vault, and the USDC and WSOL ATAs of
137
+ that vault and of every Pump fee recipient. A USDC create was 1,243 bytes or more and failed in
138
+ `buildMessage`; it is now about 120 bytes smaller. The table grew from 74 to 103 addresses.
139
+ Existing indices did not move.
140
+ - `scripts/deploy-lookup-table.ts` extends the live table instead of creating a new one each run,
141
+ and `--dry-run` prints the plan.
142
+
143
+ ## [0.3.0] - 2026-09-14
144
+
145
+ ### Breaking
146
+
147
+ - Replaced the legacy ABI surface with Gabox-only builders, accounts, events, and generated
148
+ codecs. Legacy pools, markets, referrals, claims, and prize-sale helpers are not supported.
149
+ - `createMachine` now resolves a Pump quote mint, its owning token program, and QuoteControl
150
+ admission from live Pump state. Callers provide only `{ kind: 'sol' }` or `{ kind: 'token', mint }`.
151
+ - Pack buys use separate quote and native debit caps; fee previews now use the program's ceiling
152
+ rounding so `maxTotalQuoteDebit` can safely be built from an offer.
153
+ - The program crate and module are renamed `gabox-v2`/`gabox_v2` -> `gabox`. The program id is
154
+ unchanged. The IDL snapshot moved from `idl/gabox_v2.json` to `idl/gabox.json`.
155
+ - Every generated `V2`-suffixed name lost the suffix: instructions (`initializePoolV2` ->
156
+ `initializePool`, `buyPackV2` -> `buyPack`, `sellTokensV2` -> `sellTokens`), events
157
+ (`PoolCreatedV2` -> `PoolCreated`, `PackBoughtV2` -> `PackBought`, `TokensSoldV2` -> `TokensSold`),
158
+ and their decoders, discriminators, and input types. The error `CoinNotCreatedHere` is now
159
+ `InvalidPumpCreate`.
160
+ - Holder rewards are gone. `initialize_pool` no longer takes an `expectedHolderReward` argument,
161
+ `createMachine`/`getPumpCreateInstruction` no longer take a `holderReward` option, and Gabox's
162
+ Pump `create_v2` builder always sends the standard launch: no trailing holder-reward flag set to
163
+ `true`. The program itself now refuses a `create_v2` with that flag on.
164
+ - The `Pool` account dropped `holderReward`, `seedTokens`, `seedNativeDebit`, and
165
+ `nativeOnPumpCurve`. A pool's curve settles natively in SOL exactly when `pool.quoteMint` equals
166
+ `WSOL_MINT`; there is no separate stored flag any more. `PackOffer.seedTokens` is now derived
167
+ from the live tier table instead of read from the account, and `PackOffer.seedNativeDebit` is
168
+ removed (the account no longer stores it). The `PoolCreated` event still carries `seedTokens` and
169
+ `seedNativeDebit` as a one-time creation record, but lost `holderReward`.
170
+ - Pool account size changed to match the smaller layout. `check:program` and `codegen` read the
171
+ IDL at its new path automatically.
172
+ - `Pool` and `Draw` now use fixed custom discriminators instead of Anchor's default
173
+ name-derived ones, so an account from the previous, shorter layout fails a discriminator check
174
+ instead of being decoded with its fields shifted into the wrong meaning. `fetchPoolByMint`,
175
+ `fetchDraw`, `listPools`, and `listDraws` all read the new discriminators from the generated
176
+ client; nothing in the SDK hard-codes the old bytes.
177
+ - Gabox charges no protocol fee any more. `buyPack` only adds the pool creator's own fee on top of
178
+ the venue spend, and `sellTokens` keeps the full venue proceeds for the seller. The `fee_collector`
179
+ and `fee_collector_quote_destination` accounts are gone from both `buyPack` and `sellTokens`, and
180
+ `sellTokens` also lost its `system_program` account; `buyPack`/`sellTokens` callers that built the
181
+ account list by hand must drop them. The `PackBought` and `TokensSold` events lost
182
+ `protocolFeeQuote` and `protocolFeeNative`. `PROTOCOL_FEE_BPS` is removed and `PackOffer` no
183
+ longer has a `protocolFeeQuote` field.
184
+ - `PROTOCOL_FEE_COLLECTOR` no longer collects a fee. It is now the address every Gabox coin's Pump
185
+ `create_v2` names as the coin creator, so Pump's own per-trade creator fee for the coin pays out
186
+ there. `getPumpCreateInstruction` and `createMachine` no longer take a `creator` or
187
+ `creatorFeeBps` option: the creator is always `PROTOCOL_FEE_COLLECTOR` and its Pump creator fee
188
+ bps is always zero.
189
+ - The error `InvalidFeeCollector` is removed, so the numeric codes of `InvalidPumpCreate`,
190
+ `InvalidQuote`, and `InvalidQuoteAccount` (and any later variant) each shifted down by one. Do
191
+ not hard-code the old numbers.
192
+ - The mandatory seed a pool creation buys now has a minimum instead of always matching the top
193
+ tier exactly: it makes a 3x top prize payable on the first pack, or the table's full top prize
194
+ when that pays less than 3x. `math.seedTokens` carries the rule; `MIN_SEED_MULTIPLIER_BPS`
195
+ (`30_000`) is exported. A jackpot above 3x still shows in full once later packs grow the free
196
+ vault; `math::quote` already caps every prize at what the vault holds. A creator adds more seed
197
+ up front through `extraSeedTokens` (below).
198
+ - `validateTiers` now refuses a ticketed tier's `multiplierBps` above `MAX_MULTIPLIER_BPS`
199
+ (`200_000`, 20x) with `InvalidDistribution`. A table's top tier can be at most 20x; seed beyond
200
+ what a 20x prize needs stays in the vault as backup for the draws after a top-tier hit.
201
+ - `initializePool` (the generated instruction and `createMachine`) takes a new last argument,
202
+ `extraSeedTokens: bigint`, so a creator can buy more seed on top of the mandatory amount in the
203
+ same trade. `createMachine`'s `CreateMachineInput` gained the matching optional
204
+ `extraSeedTokens` (default `0n`, must not be negative), and `maxSeedQuoteIn`/`maxSeedNativeDebit`
205
+ now bound `mandatory + extraSeedTokens` together. `seedCostEstimate` takes the same option and
206
+ now returns `seedTokens` (mandatory), `extraSeedTokens`, and `totalSeedTokens` as separate
207
+ fields, instead of one combined `seedTokens`. `PoolCreated` gained `extraSeedTokens`, right after
208
+ `seedTokens`.
209
+ - `buyPack` (the generated instruction) takes a new writable account, `activity`, right after
210
+ `draw`: the buyer's `WalletActivity` PDA, `init_if_needed`. The generated async builder resolves
211
+ it itself from `purchaser`, so `buyPack` needed no change and existing callers are unaffected.
212
+ The new error `WalletActivityMismatch` is appended after `InvalidQuoteAccount`, so later error
213
+ codes each shifted down by one; do not hard-code the old numbers.
214
+
215
+ ### Added
216
+
217
+ - SOL, Pump-supported token quote, custom QuoteControl quote, and quote-aware seed estimation
218
+ support. The new estimate returns quote base units and resolved quote metadata.
219
+ - Exact Pump and PumpSwap account routing, including quote-aware canonical PumpSwap PDAs.
220
+ - `WalletActivity`: a per-wallet account tracking lifetime `packsBought` and `nativeSpent`
221
+ (SOL-quoted pools only). Read it with `fetchWalletActivity(client, wallet)` (`null` before a
222
+ wallet's first purchase) or `fetchMaybeWalletActivity`/`decodeWalletActivity` from `generated`.
223
+ Its PDA is `findActivityPda({ purchaser })`, also exported as `activityAddress(wallet)`.
224
+
225
+ ### Security
226
+
227
+ - Pool inventory and reservations now use one RPC snapshot, quote admission cannot be supplied by
228
+ Jupiter metadata, and resolved-draw events are bound to the queried draw PDA.
229
+ - Pump SDK dependencies are exact-pinned because their PDA, decoder, and fee-math behavior is in
230
+ the transaction trust boundary.
231
+
232
+ ## [0.2.0] - 2026-09-13
233
+
234
+ ### Breaking
235
+
236
+ - `createMachine` now accepts an optional `tiers` table instead of required `riskProfile` and
237
+ `jackpotBps` inputs. `seedCostEstimate` now takes the same optional table. Both default to
238
+ `DEFAULT_TIERS`, the Gabox app's 20× top-prize table.
239
+ - Removed `jackpotTiers` and `RiskProfile`. Pass an explicit validated eight-row `Tier[]` to use a
240
+ different prize table.
241
+
242
+ ### Security
243
+
244
+ - `expireDraw` is documented and generated from the program revision that only permits expiry of
245
+ an expired `Pending` draw. A `Ready` draw is rejected with `NotPending`, preserving its resolved
246
+ award for normal delivery.
247
+
248
+ ### Changed
249
+
250
+ - Code generation validates the complete program IDL and Pump ABI before replacing generated code
251
+ or committed IDL snapshots. A failed ABI cross-check now leaves the SDK unchanged.
252
+ - The matching devnet program upgrade is verified at slot `497869792`. Its first 586,304 deployed
253
+ bytes match the reviewed SBF SHA-256 `fdbbed4161a9f2f22ce02547dc3e9ec67a22020ab58be9403d04e31464dadf89`;
254
+ its 595,976-byte allocation has only zero padding beyond that build.
7
255
 
8
256
  ## [0.1.1] - 2026-09-11
9
257