@gabox-labs/sdk 0.7.0 → 0.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gabox-labs/sdk",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "description": "The Solana Kit SDK for gabox: generated instruction builders, PDAs, Raydium LaunchLab and CPMM venue accounts, and the pack flow.",
6
6
  "license": "MIT",
@@ -27,7 +27,9 @@ the WSOL account afterwards, so the wallet spends and receives plain SOL; that c
27
27
  WSOL the wallet already held. On any other pool a route provider swaps SOL into the quote token **in
28
28
  the same transaction** as the Gabox instruction, and back after a sale. `createClient` gives mainnet
29
29
  `jupiterRoute()`; devnet has no router, so pass `route: raydiumCpmmRoute(pool)` with a CPMM pool for
30
- the SOL pair. `payWith: 'quote'` and `receive: 'quote'` skip the swap.
30
+ the SOL pair. `payWith: 'quote'` and `receive: 'quote'` skip the swap. Only packs and sales swap: a
31
+ machine's seed is always paid by its creator, in the machine's own quote token, so `createMachine`
32
+ has no `payWith` and the creator must hold `maxSeedQuoteIn` of that token first.
31
33
 
32
34
  ```ts
33
35
  import { buyPack, createClient, getOffer } from '@gabox-labs/sdk';
@@ -53,7 +55,7 @@ For creation use `createMachine` with `name`, `symbol`, `uri`, `maxSeedQuoteIn`
53
55
  `maxSeedNativeDebit`. Metaplex limits the three strings to 32, 10 and 200 UTF-8 bytes. Add
54
56
  `quote: { mint }` and `raise` for a machine priced in another token: `raise` is
55
57
  `total_quote_fund_raising` in that token's base units, and a WSOL pool uses the raise the program
56
- pins instead. Everything else about the launch is pinned. It buys a mandatory seed: enough for a 3x
58
+ pins instead. `seedCostEstimate` says what the seed costs in that token. Everything else about the launch is pinned. It buys a mandatory seed: enough for a 3x
57
59
  top prize on the first pack, or the table's full top prize when that pays less than 3x. A table's
58
60
  top tier can be at most 20x. Pass `extraSeedTokens` to buy more seed in the same trade, and read
59
61
  `seedCostEstimate` for the mandatory, extra and total amounts plus the exact cost.
@@ -31,22 +31,27 @@ Each returns a kit transaction message. Nothing here signs or sends.
31
31
 
32
32
  | Function | Input highlights |
33
33
  | --- | --- |
34
- | `createMachine` | `name`, `symbol`, `uri`, `tiers?`, `quote?`, `raise?`, `payWith?`, `maxSeedQuoteIn`, `maxSeedNativeDebit`, `extraSeedTokens?` |
34
+ | `createMachine` | `name`, `symbol`, `uri`, `tiers?`, `quote?`, `raise?`, `maxSeedQuoteIn`, `maxSeedNativeDebit`, `extraSeedTokens?` |
35
35
  | `buyPack` | `maxQuoteIn`, `minMaximum`, `maxNativeDebit`, `payWith?`, `venue?`, `seq?` |
36
36
  | `fundPrizes` | donate coins the funder already holds into the prize vault |
37
37
  | `sellTokens` | `amount`, `minQuoteOutput`, `maxNativeDebit`, `receive?`, `venue?` |
38
38
  | `retryDraw` / `expireDraw` | permissionless recovery |
39
39
  | `raydium.claimCreatorFee` | `creator`, `quoteMint?`; sweeps every coin that wallet launched against that quote |
40
40
  | `raydium.collectCreatorFee` | `mint`, `creator`; one graduated coin's CPMM creator fee |
41
+ | `raydium.claimPlatformFee` | `feeWallet`, `quoteMint?`; the platform's curve share on that quote, signed by the platform fee wallet |
42
+ | `raydium.harvestLockedFees` | `owner`, `position`, `feeLp?`; one graduated coin's locked-LP fees, signed by the fee NFT holder |
41
43
 
42
44
  On a WSOL pool every builder wraps the SOL its trade needs into the wallet's WSOL account and closes
43
45
  that account afterwards, so the wallet spends and receives plain SOL. Closing unwraps any WSOL the
44
46
  wallet already held.
45
47
 
46
- On any other pool the wallet's quote account is created if missing, and `payWith: 'sol'` (the
47
- default) prepends a swap that turns SOL into the quote token. `receive: 'sol'` appends the reverse
48
- after a sale. `payWith: 'quote'` and `receive: 'quote'` skip the swap. The swap and the Gabox
49
- instruction always share one transaction.
48
+ On any other pool the wallet's quote account is created if missing, and `buyPack`'s `payWith: 'sol'`
49
+ (the default) prepends a swap that turns SOL into the quote token. `receive: 'sol'` appends the
50
+ reverse after a sale. `payWith: 'quote'` and `receive: 'quote'` skip the swap. The swap and the
51
+ Gabox instruction always share one transaction.
52
+
53
+ `createMachine` never swaps. The seed is the creator's own money, in the machine's quote token, so
54
+ the creator must hold at least `maxSeedQuoteIn` of it before the transaction runs.
50
55
 
51
56
  `createMachine` builds one transaction with LaunchLab's `initialize_v2` first and `initialize_pool`
52
57
  second. The mint keypair and the creator both sign. It buys a mandatory seed,
@@ -68,8 +73,9 @@ the VRF request on a pack buy.
68
73
  `createMachine` takes `quote: { mint }` and `raise`. The quote defaults to wrapped SOL, whose raise
69
74
  the program pins per cluster; any other quote needs a `raise` in its own base units, at or above
70
75
  `min_quote_fund_raising` in its config. `seedCostEstimate(client, tiers?, { extraSeedTokens?,
71
- quote?, raise? })` reports the seed cost in the quote token, its decimals and symbol, the raise, and
72
- `solAmount` through the route provider.
76
+ quote?, raise? })` reports the seed cost in the quote token, which is what the creator pays, plus
77
+ its decimals and symbol, the raise, and `solAmount`: what that cost is worth in SOL through the
78
+ route provider, for a display.
73
79
 
74
80
  ## The venue
75
81
 
@@ -82,6 +88,9 @@ quote?, raise? })` reports the seed cost in the quote token, its decimals and sy
82
88
  | `raydium.findCpmmPool(client, { mint, creator, cpswapConfig, quoteMint? })` | the migrated CPMM pool, proved from its own data |
83
89
  | `raydium.fetchCurveSettings(client, quoteConfig)` | the fee rates, the migrate fee and the CPMM fee tier, read from chain |
84
90
  | `raydium.fetchCreatorFees(client, { creator, mint?, quoteMint? })` | `{ quoteMint, curveQuote, cpmmQuote, cpmmTokens }` |
91
+ | `raydium.fetchPlatformFees(client, { quoteMint? })` | `{ quoteMint, curveQuote }`, the platform's LaunchLab vault for that quote |
92
+ | `raydium.fetchLockedPositions(client, owner)` | `LockedPosition[]`: one per fee NFT the wallet holds, with `poolAddress`, `pool`, `claimableLp`, `claimableToken0`, `claimableToken1` |
93
+ | `raydium.lockedFeeLp(lock, pool)` | the LP a locked position may withdraw now, from `lastK`, `lastLp`, the vaults and the LP supply |
85
94
  | `raydium.fetchQuoteConfig(client, mint)` | LaunchLab's global config for a quote, or `null` |
86
95
  | `raydium.isQuoteSupported(client, mint)` | can a machine be priced in this mint? |
87
96
  | `raydium.fetchQuoteAsset(client, mint)` | the config, token program, decimals, symbol and minimum raise |