@floorlaunchpad/sdk 0.4.1 → 0.7.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.
Files changed (125) hide show
  1. package/CHANGELOG.md +219 -18
  2. package/README.md +0 -2
  3. package/dist/abi/evm-event-names.js +7 -0
  4. package/dist/abi/evm.gen.js +6 -0
  5. package/dist/abi/functions.gen.js +49 -1
  6. package/dist/abi/solana.gen.js +5 -0
  7. package/dist/config/generated.js +77 -0
  8. package/dist/errors.js +2 -2
  9. package/dist/events/types.gen.js +1 -1
  10. package/dist/evm/chains.js +32 -24
  11. package/dist/evm/floor/calls.js +5 -0
  12. package/dist/evm/router.js +1 -25
  13. package/dist/evm/squid.js +3 -3
  14. package/dist/generated/interface.gen.js +48 -43
  15. package/dist/index.js +1 -0
  16. package/dist/indexer/bodies.js +137 -2
  17. package/dist/indexer/client.js +10 -1
  18. package/dist/indexer/contract.js +65 -6
  19. package/dist/indexer/paths.js +34 -7
  20. package/dist/indexer/read.js +12 -3
  21. package/dist/indexer/stream.js +2 -2
  22. package/dist/math/v2/book.js +40 -7
  23. package/dist/math/v2/create.js +1 -1
  24. package/dist/math/v2/fees.js +30 -4
  25. package/dist/math/v2/milestones.js +1 -1
  26. package/dist/math/v2/receipt.js +3 -3
  27. package/dist/math/v2/relay.js +201 -1
  28. package/dist/math/v2/rows.js +17 -0
  29. package/dist/math/v2/split.js +60 -15
  30. package/dist/math/v2/team.js +14 -1
  31. package/dist/math/v2/trade.js +16 -8
  32. package/dist/solana/floor/accounts.js +30 -3
  33. package/dist/solana/floor/events.js +6 -0
  34. package/dist/solana/floor/instructions.js +23 -1
  35. package/dist/solana/floor/program.js +3 -0
  36. package/dist/ton/addresses.js +36 -0
  37. package/dist/ton/book-check.js +23 -0
  38. package/dist/ton/book.js +119 -0
  39. package/dist/ton/cell.js +542 -0
  40. package/dist/ton/consts.generated.js +17 -0
  41. package/dist/ton/content.js +83 -0
  42. package/dist/ton/gas.js +198 -0
  43. package/dist/ton/governance.js +401 -0
  44. package/dist/ton/index.js +18 -0
  45. package/dist/ton/messages.js +340 -0
  46. package/dist/ton/ops.js +37 -0
  47. package/dist/ton/price.js +51 -0
  48. package/dist/ton/quote-entry.js +116 -0
  49. package/dist/ton/quote.js +25 -0
  50. package/dist/ton/reader.js +378 -0
  51. package/dist/ton/types.js +43 -0
  52. package/dist/ton/wallet.js +26 -0
  53. package/dist/v2/events.js +2 -0
  54. package/dist/v2/evm.js +8 -1
  55. package/dist/v2/layouts.js +7 -1
  56. package/dist/v2/router.js +2 -2
  57. package/dist/v2/solana.js +1 -1
  58. package/dist/v2/solanaSettle.js +2 -0
  59. package/dist/v2/tx/evm.js +15 -1
  60. package/docs/aggregator.md +0 -22
  61. package/docs/bot.md +0 -8
  62. package/docs/cursor-pages.md +9 -5
  63. package/docs/frontend.md +0 -2
  64. package/docs/ton.md +107 -0
  65. package/docs/wallet.md +0 -2
  66. package/examples/floor-line.html +1 -1
  67. package/package.json +6 -1
  68. package/src/abi/evm-event-names.ts +7 -0
  69. package/src/abi/evm.gen.ts +6 -0
  70. package/src/abi/functions.gen.ts +49 -1
  71. package/src/abi/solana.gen.ts +5 -0
  72. package/src/config/generated.ts +77 -0
  73. package/src/errors.ts +2 -2
  74. package/src/events/types.gen.ts +57 -1
  75. package/src/evm/chains.ts +34 -28
  76. package/src/evm/floor/calls.ts +5 -0
  77. package/src/evm/router.ts +1 -26
  78. package/src/evm/squid.ts +3 -3
  79. package/src/generated/interface.gen.ts +48 -43
  80. package/src/index.ts +1 -0
  81. package/src/indexer/bodies.ts +144 -2
  82. package/src/indexer/client.ts +17 -4
  83. package/src/indexer/contract.ts +66 -7
  84. package/src/indexer/paths.ts +62 -7
  85. package/src/indexer/read.ts +14 -5
  86. package/src/indexer/stream.ts +4 -4
  87. package/src/math/v2/book.ts +42 -7
  88. package/src/math/v2/create.ts +1 -1
  89. package/src/math/v2/fees.ts +30 -4
  90. package/src/math/v2/milestones.ts +1 -1
  91. package/src/math/v2/receipt.ts +7 -3
  92. package/src/math/v2/relay.ts +208 -1
  93. package/src/math/v2/rows.ts +17 -0
  94. package/src/math/v2/split.ts +70 -16
  95. package/src/math/v2/team.ts +14 -1
  96. package/src/math/v2/trade.ts +16 -8
  97. package/src/solana/floor/accounts.ts +30 -3
  98. package/src/solana/floor/events.ts +6 -0
  99. package/src/solana/floor/instructions.ts +23 -1
  100. package/src/solana/floor/program.ts +3 -0
  101. package/src/ton/addresses.ts +38 -0
  102. package/src/ton/book-check.ts +24 -0
  103. package/src/ton/book.ts +136 -0
  104. package/src/ton/cell.ts +547 -0
  105. package/src/ton/consts.generated.ts +17 -0
  106. package/src/ton/content.ts +97 -0
  107. package/src/ton/gas.ts +209 -0
  108. package/src/ton/governance.ts +452 -0
  109. package/src/ton/index.ts +18 -0
  110. package/src/ton/messages.ts +343 -0
  111. package/src/ton/ops.ts +37 -0
  112. package/src/ton/price.ts +54 -0
  113. package/src/ton/quote-entry.ts +138 -0
  114. package/src/ton/quote.ts +67 -0
  115. package/src/ton/reader.ts +420 -0
  116. package/src/ton/types.ts +201 -0
  117. package/src/ton/wallet.ts +30 -0
  118. package/src/v2/events.ts +3 -1
  119. package/src/v2/evm.ts +10 -1
  120. package/src/v2/layouts.ts +7 -1
  121. package/src/v2/router.ts +2 -2
  122. package/src/v2/solana.ts +1 -1
  123. package/src/v2/solanaSettle.ts +2 -0
  124. package/src/v2/tx/evm.ts +15 -1
  125. package/src/v2/types.ts +14 -1
@@ -10,10 +10,15 @@ before cursor pages existed (`launches/<id>/trades`, `wallets/<w>/trades`, `laun
10
10
  holds each route's default and maximum. A `limit` above the maximum is a 400 (`limit must be 1..500`, with the route's
11
11
  own bounds), never a silent clamp.
12
12
 
13
- The wallet routes `positions`, `locks`, `claims`, `roles` and `referrals/<w>/people` answer a page only when one is asked
14
- (`limit`, or a non-empty `cursor`). The inbox answers a page when `before` is present, and an empty `before` asks the
13
+ The wallet routes `positions`, `position-totals`, `locks`, `claims`, `roles` and `referrals/<w>/people` answer a page only
14
+ when one is asked (`limit`, or a non-empty `cursor`). The inbox answers a page when `before` is present, and an empty `before` asks the
15
15
  newest page. Asked with none of these, each route answers its whole list in one body.
16
16
 
17
+ `wallets/<w>/position-totals?launch=<id>` answers that launch's one row (a wallet that never traded it gets a row of
18
+ zeros) and `next` null; it takes no page keys. `referrals/<w>/people?person=<a>,<b>,…` answers only the rows of those
19
+ referred wallets (1 to `PEOPLE_PERSON_MAX`, 8, distinct), with no `next`; a person not among the wallet's people is
20
+ absent. `person` never goes with `limit` or `cursor`.
21
+
17
22
  ## Defaults
18
23
 
19
24
  | route | reader | cursor key | `limit` default | `limit` maximum |
@@ -21,9 +26,8 @@ newest page. Asked with none of these, each route answers its whole list in one
21
26
  | `launches` | `readLaunches` | `cursor` | `LAUNCHES_PAGE_DEFAULT` (100) | `LAUNCHES_PAGE_MAX` (1,000) |
22
27
  | `search?q=` | `readLaunchSearch` | `cursor` | `SEARCH_PAGE_DEFAULT` (12) | `SEARCH_PAGE_MAX` (100) |
23
28
  | `wallets/<w>/positions`, `locks`, `claims`, `roles/<w>`, `referrals/<w>/people` | `readPositions`, `readWalletLocks`, `readClaimHistory`, `readRoles`, `readPeople` | `cursor` | `WALLET_PAGE_DEFAULT` (100) | `WALLET_PAGE_MAX` (500) |
29
+ | `wallets/<w>/position-totals` | `readPositionTotals` | `cursor` | `POSITION_TOTALS_PAGE_MAX` (100) | `POSITION_TOTALS_PAGE_MAX` (100) |
24
30
  | `wallets/<w>/inbox` | `readInbox` | `before` | `INBOX_PAGE_DEFAULT` (100) | `INBOX_PAGE_MAX` (500) |
25
- | `launch-lists` (up to 16 quotes) | `readLaunchLists` | `cursors`, one per quote (`"-"` = its first page) | 100 per list | `limit` × quotes ≤ 1,000 rows |
26
- | `candles/many` (up to 40 launches) | `readCandlesMany` | `before` | 1,000 candles per launch | `limit` × ids ≤ 40,000 candles |
27
31
 
28
32
  No request answers every launch: a bare `launches` is one page of 100. The list body also carries `cursors` (the cursor
29
33
  after each row) and `keys` (each row's ranked key); `launches` takes a `preset` filter.
@@ -44,7 +48,7 @@ client treats it as opaque: it passes back the `next` the indexer served, and bo
44
48
  | route | order | `next` positions the page after |
45
49
  |---|---|---|
46
50
  | `wallets/<w>/inbox` (`before`), `wallets/<w>/claims` | newest first | the last row (block, txnIndex, eventIndex) |
47
- | `wallets/<w>/positions`, `wallets/<w>/locks`, `roles/<w>` | launch create order | the last launch (createdBlock, id) |
51
+ | `wallets/<w>/positions`, `wallets/<w>/position-totals`, `wallets/<w>/locks`, `roles/<w>` | launch create order | the last launch (createdBlock, id) |
48
52
  | `referrals/<w>/people` | referred wallet ascending | the last wallet |
49
53
  | `launches`, `search` | the asked sort | the last row's key and tie (`cursors[i]` per row on the list) |
50
54
 
package/docs/frontend.md CHANGED
@@ -24,8 +24,6 @@ Use the routing functions in [docs/aggregator.md](aggregator.md). For a single l
24
24
 
25
25
  - Route modules in `src/route` and `src/v2/route.ts` contain no host names, so a strict content security policy does not trip on them. Anything that talks to a hosted service is in `route-jupiter.ts` and is opt-in.
26
26
  - Keep the quote fresh: re-quote when the user changes the amount and just before they sign.
27
- - A buy paid in another coin goes through the chain's FloorZap: take its address from the zap row's `zap` (`FLOOR_ZAP_ADDRESSES`, `@floorlaunchpad/sdk/evm/chains`) and its swap from `zapSwapData`; [aggregator.md](aggregator.md) has the details.
28
- - The create page's preset menu on EVM: `readPresetMenuEvmV2` (`@floorlaunchpad/sdk/v2/presetRowEvm`) reads the rows through one Multicall3 `aggregate3` per 100 ids. Pass `{ multicall }` for another Multicall3 address, or `{ multicall: null }` on a chain without one (one call per id). A row that fails throws; the menu never has a gap.
29
27
  - Chain choice happens once, at the edge. Past that point the same quote and build calls work on both chains.
30
28
 
31
29
  See also: [README](../README.md), [wallet guide](wallet.md).
package/docs/ton.md ADDED
@@ -0,0 +1,107 @@
1
+ # FLOOR on TON
2
+
3
+ > TON is not deployed yet: the module ships in `@floorlaunchpad/sdk` 0.6.0 and 0.7.0, switched off: the TON chain row stays off until a mainnet factory is live.
4
+
5
+ `@floorlaunchpad/sdk/ton` builds the messages a wallet sends to the FLOOR program on TON and reads what the program answers.
6
+ It holds no key, sends nothing and opens no connection of its own: you give it a read function (`TonRpc`) and a wallet.
7
+ Amounts are in nanoGRAM (GRAM has 9 decimals).
8
+
9
+ ## Build a trade
10
+
11
+ A trade is a `TonTx`: `{ family: "ton", messages }`, each message with a destination, a value in nanoGRAM, a body cell and a
12
+ `bounce` flag. Build the chain once (`tonChainOf()` uses the built-in mainnet constants; see "Built-in constants"), then build the message:
13
+
14
+ ```ts
15
+ import { tonChainOf, launchAddress, buildBuyGram, simBuy } from "@floorlaunchpad/sdk/ton";
16
+
17
+ const chain = tonChainOf(); // mainnet, from the SDK's own constants
18
+ const launch = launchAddress(chain, launchId); // needs the launch init code, see below
19
+ const quote = await simBuy(rpc, launch, 1_000_000_000n, BigInt(nowSeconds));
20
+ const tx = buildBuyGram({ launch, money: 1_000_000_000n, minTokens: quote.tokens * 99n / 100n, deadline: nowSeconds + 300, recipient: myAddress });
21
+ ```
22
+
23
+ `simBuy` and `simSell` run the program's own `get` methods on the launch: they are the quote path. There is no second
24
+ price formula in the SDK for TON. A builder refuses bad input (a zero amount, a deadline in the past) with a `RangeError`
25
+ before it makes a message.
26
+
27
+ `tonChainOf` can derive the wallet, account and trader addresses. It cannot derive a launch address, because the launch
28
+ init code is not in the book: `launchAddress` throws `launch init code not supplied` rather than guess. Pass the launch
29
+ address you read from the factory, or supply the code.
30
+
31
+ ## Send it
32
+
33
+ `tonConnectRequest` turns a `TonTx` into the request a TON Connect wallet takes:
34
+
35
+ ```ts
36
+ import { tonConnectRequest } from "@floorlaunchpad/sdk/ton";
37
+
38
+ const request = tonConnectRequest(tx, { nowS: Math.floor(Date.now() / 1000) });
39
+ await tonConnectUi.sendTransaction(request);
40
+ ```
41
+
42
+ Each message maps to `{ address, amount, payload, stateInit? }`: the address with its bounce flag, the value as a decimal
43
+ string, the body and any state init as base64. `validUntil` is `nowS` plus `validForS` (default 300, at most 600). A
44
+ request carries 1 to `maxMessages` messages (default 4); more is a `RangeError`. The function is pure.
45
+
46
+ ## Read the result
47
+
48
+ A message that reaches the chain can still be refused by the program. Ask the indexer, by the wallet and the message's
49
+ query id:
50
+
51
+ ```ts
52
+ import { readTonOutcome } from "@floorlaunchpad/sdk";
53
+
54
+ const outcome = await readTonOutcome(get, walletAddress, queryId);
55
+ ```
56
+
57
+ The answer says whether the message landed, was refused (with the program's error) or is not seen yet. Treat "not seen yet"
58
+ as pending, never as failed. Use a fresh `queryId` for each message.
59
+
60
+ ## Built-in constants
61
+
62
+ The SDK carries TON mainnet's factory and timelock addresses and the three small init codes (wallet, account, trader) as
63
+ constants in a generated module (`TON_MAINNET`, `TON_INIT_CODES_BASE64`, `TON_PINNED_CODE_HASHES`). `tonChainOf()` with no
64
+ argument builds the mainnet chain from them: no file to fetch. The module is written by `node sdk/scripts/gen-ton-consts.mjs`
65
+ from the pinned codes (`ton/contracts/codes.mjs`) and the deploy output (`sdk/scripts/ton-mainnet-deploy.json`); `--check`
66
+ fails while the committed module differs. Mainnet is not deployed yet, so `TON_MAINNET.factory` and `.timelock` are `null`
67
+ (`placeholder: true`) and `tonChainOf()` throws `TonBookError` until the deploy output is filled in and the generator re-run.
68
+
69
+ ## The book file (another network or deployment)
70
+
71
+ For a testnet or any other deployment, pass a book: a small JSON file for one network:
72
+
73
+ ```json
74
+ {
75
+ "chain": "ton", "network": "mainnet", "globalId": -239,
76
+ "factory": "0:<64 hex>", "timelock": "0:<64 hex>",
77
+ "codeHashes": { "factory": "…", "timelock": "…", "launch": "…", "wallet": "…", "account": "…", "trader": "…" },
78
+ "familyInit": { "launch": "…", "account": "…", "trader": "…" },
79
+ "codes": { "wallet": "<base64 BoC>", "account": "<base64 BoC>", "trader": "<base64 BoC>" },
80
+ "readAt": "<ISO 8601 time>", "deploySeqno": 123456
81
+ }
82
+ ```
83
+
84
+ ```ts
85
+ import { parseTonBook, tonChainOf } from "@floorlaunchpad/sdk/ton";
86
+ const chain = tonChainOf(parseTonBook(JSON.parse(bookFileText), { file: "ton-testnet.json" }));
87
+ ```
88
+
89
+ `network` is `mainnet` with `globalId` -239, or `testnet` with -3. `familyInit` and `deploySeqno` are optional; other keys
90
+ are ignored. `parseTonBook` checks every field and the three code cells against their hashes and the pinned code, and throws
91
+ `TonBookError` (`ton book <file>: <field>: <what>`) on the first fault. A book that parses derives addresses identical to
92
+ the chain's. `checkTonBookOnChain(rpc, book)` compares the book with the chain and returns a list of mismatches (empty means
93
+ consistent); run it from your own machine, not in a page.
94
+
95
+ ## Gas
96
+
97
+ Every builder has a default value that covers the program's gas and forwarding on the current network prices. The claim
98
+ costs are priced in `gas.ts` from a `TonGasConfig` (basechain prices); the default is the mainnet config, and you can pass
99
+ a live one. Unused value comes back as a refund. A message that carries too little value is refused by the program, so
100
+ raise the value rather than lower it.
101
+
102
+ ## What the SDK does not do
103
+
104
+ - It does not sign and it does not send. `tonConnectRequest` is the end of its work.
105
+ - It has no decoder for the book's cells beyond what `parseTonBook` checks, and no reader for the factory's internals.
106
+ - It has no price formula for TON: `simBuy` and `simSell` are the quote path.
107
+ - It does not guess an address it cannot derive: it throws.
package/docs/wallet.md CHANGED
@@ -30,8 +30,6 @@ import { decodeErrorV2 } from "@floorlaunchpad/sdk/v2/evm";
30
30
  const name = decodeErrorV2(revertData); // the custom error's name, or null
31
31
  ```
32
32
 
33
- `decodeEvmProgramError` (`@floorlaunchpad/sdk/errors`) returns the same name with the module and code, and also knows five errors from the contracts' math libraries that the ABI does not list: `PriceOrder()`, `ZeroLiquidity()`, `SqrtRange()`, `Zero()` and `VaultShareOutOfRange()`.
34
-
35
33
  Show the name and your own plain wording for it. The SDK gives you the identifier, not a sentence.
36
34
 
37
35
  ## Claim
@@ -238,7 +238,7 @@ const floor = floorOf(BigInt(event.sqrtF), quoteDecimals);</script>
238
238
  &lt;/div&gt;</script>
239
239
 
240
240
  <script>
241
- const DATA = /*DATA*/{"run":"A simulated launch with a USDC quote at $1: 74 buys and 8 sells","quoteDecimals":6,"series":[{"i":0,"price":0.01,"floor":null,"graduated":false,"side":"open"},{"i":1,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":2,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":3,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":4,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":5,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":6,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":7,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":8,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":9,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":10,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":11,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":12,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":13,"price":0.01022274,"floor":0.01,"graduated":true,"side":"buy"},{"i":14,"price":0.01045981,"floor":0.01000702,"graduated":true,"side":"buy"},{"i":15,"price":0.01069961,"floor":0.01001356,"graduated":true,"side":"buy"},{"i":16,"price":0.01092692,"floor":0.01001968,"graduated":true,"side":"buy"},{"i":17,"price":0.01110845,"floor":0.01002545,"graduated":true,"side":"buy"},{"i":18,"price":0.0112915,"floor":0.0100309,"graduated":true,"side":"buy"},{"i":19,"price":0.01147605,"floor":0.01003607,"graduated":true,"side":"buy"},{"i":20,"price":0.0116621,"floor":0.01004098,"graduated":true,"side":"buy"},{"i":21,"price":0.01184832,"floor":0.01004568,"graduated":true,"side":"buy"},{"i":22,"price":0.0119884,"floor":0.01005016,"graduated":true,"side":"buy"},{"i":23,"price":0.01212932,"floor":0.01005447,"graduated":true,"side":"buy"},{"i":24,"price":0.01227106,"floor":0.0100586,"graduated":true,"side":"buy"},{"i":25,"price":0.01284634,"floor":0.01007293,"graduated":true,"side":"buy"},{"i":26,"price":0.01329322,"floor":0.01008562,"graduated":true,"side":"buy"},{"i":27,"price":0.01373598,"floor":0.01030198,"graduated":true,"side":"buy"},{"i":28,"price":0.01414542,"floor":0.01060907,"graduated":true,"side":"buy"},{"i":29,"price":0.01448348,"floor":0.01086261,"graduated":true,"side":"buy"},{"i":30,"price":0.01482555,"floor":0.01111917,"graduated":true,"side":"buy"},{"i":31,"price":0.01517165,"floor":0.01137874,"graduated":true,"side":"buy"},{"i":32,"price":0.01545607,"floor":0.01159206,"graduated":true,"side":"buy"},{"i":33,"price":0.0157178,"floor":0.01178835,"graduated":true,"side":"buy"},{"i":34,"price":0.01598174,"floor":0.01198631,"graduated":true,"side":"buy"},{"i":35,"price":0.01624789,"floor":0.01218592,"graduated":true,"side":"buy"},{"i":36,"price":0.01651626,"floor":0.0123872,"graduated":true,"side":"buy"},{"i":37,"price":0.01674282,"floor":0.01255712,"graduated":true,"side":"buy"},{"i":38,"price":0.01694468,"floor":0.01270851,"graduated":true,"side":"buy"},{"i":39,"price":0.01714776,"floor":0.01286082,"graduated":true,"side":"buy"},{"i":40,"price":0.01735205,"floor":0.01301404,"graduated":true,"side":"buy"},{"i":41,"price":0.01755756,"floor":0.01316817,"graduated":true,"side":"buy"},{"i":42,"price":0.01776429,"floor":0.01332322,"graduated":true,"side":"buy"},{"i":43,"price":0.01797224,"floor":0.01347918,"graduated":true,"side":"buy"},{"i":44,"price":0.01815632,"floor":0.01361724,"graduated":true,"side":"buy"},{"i":45,"price":0.01831214,"floor":0.01373411,"graduated":true,"side":"buy"},{"i":46,"price":0.01846863,"floor":0.01385147,"graduated":true,"side":"buy"},{"i":47,"price":0.0186258,"floor":0.01396935,"graduated":true,"side":"buy"},{"i":48,"price":0.01878363,"floor":0.01408772,"graduated":true,"side":"buy"},{"i":49,"price":0.01859303,"floor":0.01408772,"graduated":true,"side":"sell"},{"i":50,"price":0.01841113,"floor":0.01408772,"graduated":true,"side":"sell"},{"i":51,"price":0.01823746,"floor":0.01408772,"graduated":true,"side":"sell"},{"i":52,"price":0.01806707,"floor":0.01408772,"graduated":true,"side":"sell"},{"i":53,"price":0.01853992,"floor":0.01408772,"graduated":true,"side":"buy"},{"i":54,"price":0.01901433,"floor":0.01426075,"graduated":true,"side":"buy"},{"i":55,"price":0.01949479,"floor":0.0146211,"graduated":true,"side":"buy"},{"i":56,"price":0.01990367,"floor":0.01492776,"graduated":true,"side":"buy"},{"i":57,"price":0.02026771,"floor":0.01520078,"graduated":true,"side":"buy"},{"i":58,"price":0.02063506,"floor":0.0154763,"graduated":true,"side":"buy"},{"i":59,"price":0.02100574,"floor":0.0157543,"graduated":true,"side":"buy"},{"i":60,"price":0.02137974,"floor":0.0160348,"graduated":true,"side":"buy"},{"i":61,"price":0.02166974,"floor":0.01625231,"graduated":true,"side":"buy"},{"i":62,"price":0.02195119,"floor":0.01646339,"graduated":true,"side":"buy"},{"i":63,"price":0.02223446,"floor":0.01667585,"graduated":true,"side":"buy"},{"i":64,"price":0.02251957,"floor":0.01688968,"graduated":true,"side":"buy"},{"i":65,"price":0.0228065,"floor":0.01710487,"graduated":true,"side":"buy"},{"i":66,"price":0.02309526,"floor":0.01732144,"graduated":true,"side":"buy"},{"i":67,"price":0.02336672,"floor":0.01752504,"graduated":true,"side":"buy"},{"i":68,"price":0.02358335,"floor":0.01768751,"graduated":true,"side":"buy"},{"i":69,"price":0.02346715,"floor":0.01768751,"graduated":true,"side":"sell"},{"i":70,"price":0.02335372,"floor":0.01768751,"graduated":true,"side":"sell"},{"i":71,"price":0.02321907,"floor":0.01768751,"graduated":true,"side":"sell"},{"i":72,"price":0.02307369,"floor":0.01768751,"graduated":true,"side":"sell"},{"i":73,"price":0.02335063,"floor":0.01768751,"graduated":true,"side":"buy"},{"i":74,"price":0.02356718,"floor":0.01768751,"graduated":true,"side":"buy"},{"i":75,"price":0.02378474,"floor":0.01783855,"graduated":true,"side":"buy"},{"i":76,"price":0.02400331,"floor":0.01800248,"graduated":true,"side":"buy"},{"i":77,"price":0.02422288,"floor":0.01816716,"graduated":true,"side":"buy"},{"i":78,"price":0.02444346,"floor":0.0183326,"graduated":true,"side":"buy"},{"i":79,"price":0.02466505,"floor":0.01849879,"graduated":true,"side":"buy"},{"i":80,"price":0.02488764,"floor":0.01866573,"graduated":true,"side":"buy"},{"i":81,"price":0.02511124,"floor":0.01883343,"graduated":true,"side":"buy"},{"i":82,"price":0.02533585,"floor":0.01900189,"graduated":true,"side":"buy"}]}/*END*/;
241
+ const DATA = /*DATA*/{"run":"A simulated launch with a USDC quote at $1: 74 buys and 8 sells","quoteDecimals":6,"series":[{"i":0,"price":0.01,"floor":null,"graduated":false,"side":"open"},{"i":1,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":2,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":3,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":4,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":5,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":6,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":7,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":8,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":9,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":10,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":11,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":12,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":13,"price":0.01022274,"floor":0.01,"graduated":true,"side":"buy"},{"i":14,"price":0.01045981,"floor":0.01000702,"graduated":true,"side":"buy"},{"i":15,"price":0.01069961,"floor":0.01001356,"graduated":true,"side":"buy"},{"i":16,"price":0.01092692,"floor":0.01001968,"graduated":true,"side":"buy"},{"i":17,"price":0.01110845,"floor":0.01002545,"graduated":true,"side":"buy"},{"i":18,"price":0.0112915,"floor":0.0100309,"graduated":true,"side":"buy"},{"i":19,"price":0.01147605,"floor":0.01003607,"graduated":true,"side":"buy"},{"i":20,"price":0.0116621,"floor":0.01004098,"graduated":true,"side":"buy"},{"i":21,"price":0.01184832,"floor":0.01004568,"graduated":true,"side":"buy"},{"i":22,"price":0.0119884,"floor":0.01005016,"graduated":true,"side":"buy"},{"i":23,"price":0.01212932,"floor":0.01005447,"graduated":true,"side":"buy"},{"i":24,"price":0.01227106,"floor":0.0100586,"graduated":true,"side":"buy"},{"i":25,"price":0.01284634,"floor":0.01007293,"graduated":true,"side":"buy"},{"i":26,"price":0.01329322,"floor":0.01008562,"graduated":true,"side":"buy"},{"i":27,"price":0.01373598,"floor":0.01030198,"graduated":true,"side":"buy"},{"i":28,"price":0.01414542,"floor":0.01060907,"graduated":true,"side":"buy"},{"i":29,"price":0.01448348,"floor":0.01086261,"graduated":true,"side":"buy"},{"i":30,"price":0.01482555,"floor":0.01111917,"graduated":true,"side":"buy"},{"i":31,"price":0.01517165,"floor":0.01137874,"graduated":true,"side":"buy"},{"i":32,"price":0.01545607,"floor":0.01159206,"graduated":true,"side":"buy"},{"i":33,"price":0.0157178,"floor":0.01178835,"graduated":true,"side":"buy"},{"i":34,"price":0.01598174,"floor":0.01198631,"graduated":true,"side":"buy"},{"i":35,"price":0.01624789,"floor":0.01218592,"graduated":true,"side":"buy"},{"i":36,"price":0.01651626,"floor":0.0123872,"graduated":true,"side":"buy"},{"i":37,"price":0.01674282,"floor":0.01255712,"graduated":true,"side":"buy"},{"i":38,"price":0.01694468,"floor":0.01270851,"graduated":true,"side":"buy"},{"i":39,"price":0.01714776,"floor":0.01286082,"graduated":true,"side":"buy"},{"i":40,"price":0.01735205,"floor":0.01301404,"graduated":true,"side":"buy"},{"i":41,"price":0.01755756,"floor":0.01316817,"graduated":true,"side":"buy"},{"i":42,"price":0.01776429,"floor":0.01332322,"graduated":true,"side":"buy"},{"i":43,"price":0.01797224,"floor":0.01347918,"graduated":true,"side":"buy"},{"i":44,"price":0.01815632,"floor":0.01361724,"graduated":true,"side":"buy"},{"i":45,"price":0.01831214,"floor":0.01373411,"graduated":true,"side":"buy"},{"i":46,"price":0.01846863,"floor":0.01385147,"graduated":true,"side":"buy"},{"i":47,"price":0.0186258,"floor":0.01396935,"graduated":true,"side":"buy"},{"i":48,"price":0.01878363,"floor":0.01408772,"graduated":true,"side":"buy"},{"i":49,"price":0.01859303,"floor":0.01408772,"graduated":true,"side":"sell"},{"i":50,"price":0.01830951,"floor":0.01408772,"graduated":true,"side":"sell"},{"i":51,"price":0.01718636,"floor":0.01408772,"graduated":true,"side":"sell"},{"i":52,"price":0.01619404,"floor":0.01408772,"graduated":true,"side":"sell"},{"i":53,"price":0.01855915,"floor":0.01408772,"graduated":true,"side":"buy"},{"i":54,"price":0.01903381,"floor":0.01427536,"graduated":true,"side":"buy"},{"i":55,"price":0.01951452,"floor":0.01463589,"graduated":true,"side":"buy"},{"i":56,"price":0.01991845,"floor":0.01493884,"graduated":true,"side":"buy"},{"i":57,"price":0.02028262,"floor":0.01521197,"graduated":true,"side":"buy"},{"i":58,"price":0.02065011,"floor":0.01548759,"graduated":true,"side":"buy"},{"i":59,"price":0.02102093,"floor":0.01576569,"graduated":true,"side":"buy"},{"i":60,"price":0.02139506,"floor":0.0160463,"graduated":true,"side":"buy"},{"i":61,"price":0.02168119,"floor":0.01626089,"graduated":true,"side":"buy"},{"i":62,"price":0.02196271,"floor":0.01647203,"graduated":true,"side":"buy"},{"i":63,"price":0.02224606,"floor":0.01668454,"graduated":true,"side":"buy"},{"i":64,"price":0.02253123,"floor":0.01689842,"graduated":true,"side":"buy"},{"i":65,"price":0.02281824,"floor":0.01711368,"graduated":true,"side":"buy"},{"i":66,"price":0.02310707,"floor":0.01733031,"graduated":true,"side":"buy"},{"i":67,"price":0.02337554,"floor":0.01753165,"graduated":true,"side":"buy"},{"i":68,"price":0.02359221,"floor":0.01769416,"graduated":true,"side":"buy"},{"i":69,"price":0.02347579,"floor":0.01769416,"graduated":true,"side":"sell"},{"i":70,"price":0.02334103,"floor":0.01769416,"graduated":true,"side":"sell"},{"i":71,"price":0.02185754,"floor":0.01769416,"graduated":true,"side":"sell"},{"i":72,"price":0.02053252,"floor":0.01769416,"graduated":true,"side":"sell"},{"i":73,"price":0.02337134,"floor":0.01769416,"graduated":true,"side":"buy"},{"i":74,"price":0.02358799,"floor":0.01769416,"graduated":true,"side":"buy"},{"i":75,"price":0.02380564,"floor":0.01785423,"graduated":true,"side":"buy"},{"i":76,"price":0.02402431,"floor":0.01801823,"graduated":true,"side":"buy"},{"i":77,"price":0.02424398,"floor":0.01818298,"graduated":true,"side":"buy"},{"i":78,"price":0.02446465,"floor":0.01834849,"graduated":true,"side":"buy"},{"i":79,"price":0.02468634,"floor":0.01851475,"graduated":true,"side":"buy"},{"i":80,"price":0.02490903,"floor":0.01868177,"graduated":true,"side":"buy"},{"i":81,"price":0.02513272,"floor":0.01884954,"graduated":true,"side":"buy"},{"i":82,"price":0.02535743,"floor":0.01901807,"graduated":true,"side":"buy"}]}/*END*/;
242
242
  const SUPPLY = 1e9; // a FLOOR launch mints 1B tokens; market cap = price x total supply
243
243
  const pts = DATA.series;
244
244
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floorlaunchpad/sdk",
3
- "version": "0.4.1",
3
+ "version": "0.7.0",
4
4
  "description": "The FLOOR Program in TypeScript: the math, the quoter, decoders, PDAs and instruction builders for Solana and EVM",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -186,6 +186,11 @@
186
186
  "import": "./dist/indexer/stream.js",
187
187
  "default": "./dist/indexer/stream.js"
188
188
  },
189
+ "./ton": {
190
+ "types": "./src/ton/index.ts",
191
+ "import": "./dist/ton/index.js",
192
+ "default": "./dist/ton/index.js"
193
+ },
189
194
  "./evm/balances": {
190
195
  "types": "./src/evm/balances.ts",
191
196
  "import": "./dist/evm/balances.js",
@@ -4,9 +4,16 @@ export const V2_EVENT_FIELD_NAMES = {
4
4
  Trade: ["launchId", "trader", "recipient", "isBuy", "quoteGross", "quoteNet", "refund", "tokens", "fees", "traderRef", "fromResale", "fromFirst", "unfilled", "sqrtBefore", "sqrtAfter", "sqrtF", "floor", "cushion", "sCirc", "steps", "budgetHit", "slot", "ts", "kind", "creatorRef", "bidMoney", "msPaid"],
5
5
  HolderIndexRolled: ["launchId", "index", "wMatured", "wPending", "carry"],
6
6
  DeadSynced: ["launchId", "added", "deadTokens", "sCirc"],
7
+
8
+ HolderMoved: ["launchId", "from", "to", "value", "fromBalance", "toBalance"],
7
9
  BackingCredited: ["launchId", "donor", "amount", "fAfter", "slot"],
8
10
 
9
11
  TokensBurnedV2: ["launchId", "wallet", "role", "place", "fromTeamBuy", "fromWallet", "balanceBefore", "owedAfter", "split", "supply", "sOut", "floorAfterX64", "fromShareBought"],
10
12
 
13
+ RefSlices: ["launchId", "trader", "traderParts", "creatorParts", "og"],
14
+
15
+ OgUserSet: ["referrer", "from", "until", "count"],
16
+ OgUserRevoked: ["referrer", "until", "count"],
17
+
11
18
  OptedIn: ["a"],
12
19
  } as const;
@@ -13,8 +13,12 @@ export const EVM_EVENT_SCHEMAS: readonly EvmEventSchema[] = [
13
13
  { name: "Trade", signature: "Trade(uint256,address,address,bool,uint256,uint256,uint256,uint256,uint256[5],uint256,uint256,uint256,uint256,uint128,uint128,uint128,uint256,uint256,uint256,uint8,bool,uint64,uint64,uint8,uint256,uint256,uint256[4])", topic: "0xf13d84552bb2de89213afd3ee8de6d2f901a8ef3c46baecd3ba56d079ec5bbee", params: [{"name":"launchId","type":"uint256","indexed":true},{"name":"trader","type":"address","indexed":true},{"name":"recipient","type":"address","indexed":true},{"name":"isBuy","type":"bool","indexed":false},{"name":"quoteGross","type":"uint256","indexed":false},{"name":"quoteNet","type":"uint256","indexed":false},{"name":"refund","type":"uint256","indexed":false},{"name":"tokens","type":"uint256","indexed":false},{"name":"fees","type":"uint256[5]","indexed":false},{"name":"traderRef","type":"uint256","indexed":false},{"name":"fromResale","type":"uint256","indexed":false},{"name":"fromFirst","type":"uint256","indexed":false},{"name":"unfilled","type":"uint256","indexed":false},{"name":"sqrtBefore","type":"uint128","indexed":false},{"name":"sqrtAfter","type":"uint128","indexed":false},{"name":"sqrtF","type":"uint128","indexed":false},{"name":"floor","type":"uint256","indexed":false},{"name":"cushion","type":"uint256","indexed":false},{"name":"sCirc","type":"uint256","indexed":false},{"name":"steps","type":"uint8","indexed":false},{"name":"budgetHit","type":"bool","indexed":false},{"name":"slot","type":"uint64","indexed":false},{"name":"ts","type":"uint64","indexed":false},{"name":"kind","type":"uint8","indexed":false},{"name":"creatorRef","type":"uint256","indexed":false},{"name":"bidMoney","type":"uint256","indexed":false},{"name":"msPaid","type":"uint256[4]","indexed":false}] },
14
14
  { name: "HolderIndexRolled", signature: "HolderIndexRolled(uint256,uint128,uint64,uint64,uint64)", topic: "0xf20012f017d83d67e79d107e45ef1b26b2c12801c8ac321026fa5fbf4a4617a6", params: [{"name":"launchId","type":"uint256","indexed":true},{"name":"index","type":"uint128","indexed":false},{"name":"wMatured","type":"uint64","indexed":false},{"name":"wPending","type":"uint64","indexed":false},{"name":"carry","type":"uint64","indexed":false}] },
15
15
  { name: "DeadSynced", signature: "DeadSynced(uint256,uint256,uint256,uint256)", topic: "0x6846c78bd22de57afa536b973536ab5c61067e4d1b4ea058582ba5069d9773af", params: [{"name":"launchId","type":"uint256","indexed":true},{"name":"added","type":"uint256","indexed":false},{"name":"deadTokens","type":"uint256","indexed":false},{"name":"sCirc","type":"uint256","indexed":false}] },
16
+ { name: "HolderMoved", signature: "HolderMoved(uint256,address,address,uint256,uint256,uint256)", topic: "0xd5824b5333646edb861042e3e4dc301d313bad82266261cc142ea065a6f80f62", params: [{"name":"launchId","type":"uint256","indexed":true},{"name":"from","type":"address","indexed":true},{"name":"to","type":"address","indexed":true},{"name":"value","type":"uint256","indexed":false},{"name":"fromBalance","type":"uint256","indexed":false},{"name":"toBalance","type":"uint256","indexed":false}] },
16
17
  { name: "BackingCredited", signature: "BackingCredited(uint256,address,uint256,uint256,uint64)", topic: "0x9d068fe704d7ba4d84d7cae6b6f5b80e22bc5282d5677787bd0c6fb6b1375797", params: [{"name":"launchId","type":"uint256","indexed":true},{"name":"donor","type":"address","indexed":true},{"name":"amount","type":"uint256","indexed":false},{"name":"fAfter","type":"uint256","indexed":false},{"name":"slot","type":"uint64","indexed":false}] },
17
18
  { name: "TokensBurnedV2", signature: "TokensBurnedV2(uint256,address,uint8,uint8,uint256,uint256,uint256,uint256,uint256[10],uint256,uint256,uint256,uint256)", topic: "0xf6e435381411d86653aa1fb249000f3ead53faa462387a4492da7021bb1ed930", params: [{"name":"launchId","type":"uint256","indexed":true},{"name":"wallet","type":"address","indexed":true},{"name":"role","type":"uint8","indexed":false},{"name":"place","type":"uint8","indexed":false},{"name":"fromTeamBuy","type":"uint256","indexed":false},{"name":"fromWallet","type":"uint256","indexed":false},{"name":"balanceBefore","type":"uint256","indexed":false},{"name":"owedAfter","type":"uint256","indexed":false},{"name":"split","type":"uint256[10]","indexed":false},{"name":"supply","type":"uint256","indexed":false},{"name":"sOut","type":"uint256","indexed":false},{"name":"floorAfterX64","type":"uint256","indexed":false},{"name":"fromShareBought","type":"uint256","indexed":false}] },
19
+ { name: "RefSlices", signature: "RefSlices(uint256,address,uint256[3],uint256[3],uint8)", topic: "0x70230bb504c4cfaa69721add1e2556ac9a5062317ccccff591bea6f9519002f2", params: [{"name":"launchId","type":"uint256","indexed":true},{"name":"trader","type":"address","indexed":true},{"name":"traderParts","type":"uint256[3]","indexed":false},{"name":"creatorParts","type":"uint256[3]","indexed":false},{"name":"og","type":"uint8","indexed":false}] },
20
+ { name: "OgUserSet", signature: "OgUserSet(address,uint64,uint64,uint16)", topic: "0xe77b61264f15c177ea65dbd08e49ca5f4082c241812720be4734124a431e72ee", params: [{"name":"referrer","type":"address","indexed":true},{"name":"from","type":"uint64","indexed":false},{"name":"until","type":"uint64","indexed":false},{"name":"count","type":"uint16","indexed":false}] },
21
+ { name: "OgUserRevoked", signature: "OgUserRevoked(address,uint64,uint16)", topic: "0xa4f04a24e1d2ca998acdb3c7db54bd6796fb2a591a81992e13d2585fecd6f7e7", params: [{"name":"referrer","type":"address","indexed":true},{"name":"until","type":"uint64","indexed":false},{"name":"count","type":"uint16","indexed":false}] },
18
22
  { name: "OptedIn", signature: "OptedIn(address)", topic: "0x25f9c685db8e2630204f5e7c890a95f58852ccac883a9d96f44a72b777b06c59", params: [{"name":"a","type":"address","indexed":true}] },
19
23
  { name: "ClaimSkipped", signature: "ClaimSkipped(address,address,uint256)", topic: "0x4db58311c6a38618cc6dd27586cfb08657be781d572fb89d63886e3a04b654fa", params: [{"name":"wallet","type":"address","indexed":true},{"name":"quote","type":"address","indexed":true},{"name":"amount","type":"uint256","indexed":false}] },
20
24
  { name: "Claimed", signature: "Claimed(address,address,address,uint16,uint256,uint256,uint256,uint256,uint256,uint256,uint256)", topic: "0xc65b75258efd65cacbab47f067226591f78c24d2ee3c3deedf737ca24dc84ada", params: [{"name":"wallet","type":"address","indexed":true},{"name":"sender","type":"address","indexed":true},{"name":"quote","type":"address","indexed":true},{"name":"types","type":"uint16","indexed":false},{"name":"creator","type":"uint256","indexed":false},{"name":"creatorRef","type":"uint256","indexed":false},{"name":"teamSlot","type":"uint256","indexed":false},{"name":"traderRef","type":"uint256","indexed":false},{"name":"holder","type":"uint256","indexed":false},{"name":"extra","type":"uint256","indexed":false},{"name":"amount","type":"uint256","indexed":false}] },
@@ -100,6 +104,8 @@ export const EVM_ERRORS: readonly ProgramErrorRow[] = [
100
104
  { chain: "evm", name: "NotTeamMember", message: "NotTeamMember", code: null, selector: "0x2793ed7d", signature: "NotTeamMember()" },
101
105
  { chain: "evm", name: "NotTimelock", message: "NotTimelock", code: null, selector: "0xcad4da2a", signature: "NotTimelock()" },
102
106
  { chain: "evm", name: "NotToken", message: "NotToken", code: null, selector: "0x21f2b69c", signature: "NotToken()" },
107
+ { chain: "evm", name: "OgAlreadySet", message: "OgAlreadySet", code: null, selector: "0x15a3af55", signature: "OgAlreadySet()" },
108
+ { chain: "evm", name: "OgFull", message: "OgFull", code: null, selector: "0x94de33e9", signature: "OgFull()" },
103
109
  { chain: "evm", name: "Overflow", message: "Overflow", code: null, selector: "0x35278d12", signature: "Overflow()" },
104
110
  { chain: "evm", name: "OverOwed", message: "OverOwed", code: null, selector: "0xbf537318", signature: "OverOwed()" },
105
111
  { chain: "evm", name: "PresetDeleted", message: "PresetDeleted", code: null, selector: "0xf94f84f1", signature: "PresetDeleted()" },
@@ -106,6 +106,7 @@ export const FLOOR_AMM_V2_FUNCTIONS: readonly EvmFunctionRow[] = [
106
106
  { module: "floorAmmV2", name: "buyFromBalance", signature: "buyFromBalance(uint256,uint256,address,address,uint256)", selector: "0x5f9f56d2", outputs: "((uint256,uint256,uint256,uint256,bool,bool,bool))" },
107
107
  { module: "floorAmmV2", name: "creditBacking", signature: "creditBacking(uint256,uint256)", selector: "0x1f341504", outputs: "()" },
108
108
  { module: "floorAmmV2", name: "nextModule", signature: "nextModule()", selector: "0xf85abfc7", outputs: "(address)" },
109
+ { module: "floorAmmV2", name: "noteMove", signature: "noteMove(address,address,uint256,uint256,uint256)", selector: "0xe6b761ea", outputs: "()" },
109
110
  { module: "floorAmmV2", name: "proxiableUUID", signature: "proxiableUUID()", selector: "0x52d1902d", outputs: "(bytes32)" },
110
111
  { module: "floorAmmV2", name: "quoteBuy", signature: "quoteBuy(uint256,uint256,address)", selector: "0xec7a34c9", outputs: "((uint256,uint256,uint256,uint256,bool,bool,bool))" },
111
112
  { module: "floorAmmV2", name: "quoteSell", signature: "quoteSell(uint256,uint256,address)", selector: "0x0cff08d1", outputs: "(uint256)" },
@@ -119,7 +120,7 @@ export const FLOOR_AMM_V2_FUNCTIONS: readonly EvmFunctionRow[] = [
119
120
  { module: "floorAmmViewsV2", name: "bidMoney", signature: "bidMoney(uint256)", selector: "0x8e403c51", outputs: "(uint256)" },
120
121
  { module: "floorAmmViewsV2", name: "circulatingOf", signature: "circulatingOf(uint256)", selector: "0x72812fcf", outputs: "(uint256,uint256,uint256)" },
121
122
  { module: "floorAmmViewsV2", name: "holderBook", signature: "holderBook(uint256)", selector: "0xf5d23b14", outputs: "((uint128,uint64,uint64,uint128,uint128))" },
122
- { module: "floorAmmViewsV2", name: "launchBook", signature: "launchBook(uint256)", selector: "0x926310f1", outputs: "((uint128,uint128,uint128,uint128[],uint8,(uint128,uint128,uint64,uint64,uint64,uint128,uint16,uint16,uint8,uint8)[48],uint128,uint64,uint64[],uint128[],uint8,uint8,uint128[],uint128[],uint128,uint64,bool,uint32[5]))" },
123
+ { module: "floorAmmViewsV2", name: "launchBook", signature: "launchBook(uint256)", selector: "0x926310f1", outputs: "((uint128,uint128,uint128,uint128[],uint8,(uint128,uint128,uint64,uint64,uint64,uint128,uint16,uint16,uint8,uint8)[48],uint128,uint64,uint64[],uint128[],uint8,uint8,uint128[],uint128[],uint128,uint64,bool,uint32[5],uint128,uint64,bool))" },
123
124
  { module: "floorAmmViewsV2", name: "launchCount", signature: "launchCount()", selector: "0x27cca59f", outputs: "(uint256)" },
124
125
  { module: "floorAmmViewsV2", name: "launchFeeCurve", signature: "launchFeeCurve(uint256)", selector: "0xc598083f", outputs: "((uint32[5],uint128,uint128))" },
125
126
  { module: "floorAmmViewsV2", name: "launchMilestones", signature: "launchMilestones(uint256)", selector: "0x2414ccf1", outputs: "((uint128[4],uint128[4]))" },
@@ -151,4 +152,51 @@ export const FLOOR_AMM_V2_FUNCTIONS: readonly EvmFunctionRow[] = [
151
152
  { module: "floorAmmClaimsV2", name: "nextModule", signature: "nextModule()", selector: "0xf85abfc7", outputs: "(address)" },
152
153
  { module: "floorAmmClaimsV2", name: "teamSlotAdd", signature: "teamSlotAdd(uint256,bytes32,uint8,uint256,bool)", selector: "0xd5402e81", outputs: "()" },
153
154
  { module: "floorAmmClaimsV2", name: "unlockCreatorBuy", signature: "unlockCreatorBuy(uint256)", selector: "0xf03d6d5e", outputs: "(uint256)" },
155
+ { module: "floorAmmGovV2", name: "NATIVE", signature: "NATIVE()", selector: "0xa0cf0aea", outputs: "(address)" },
156
+ { module: "floorAmmGovV2", name: "acceptAuthority", signature: "acceptAuthority()", selector: "0x1580798f", outputs: "()" },
157
+ { module: "floorAmmGovV2", name: "accounted", signature: "accounted(address)", selector: "0xee1a56ce", outputs: "(uint256)" },
158
+ { module: "floorAmmGovV2", name: "addQuote", signature: "addQuote(address,uint256,uint256)", selector: "0x488c664b", outputs: "()" },
159
+ { module: "floorAmmGovV2", name: "authority", signature: "authority()", selector: "0xbf7e214f", outputs: "(address)" },
160
+ { module: "floorAmmGovV2", name: "bindHandle", signature: "bindHandle(bytes32,address,address[],uint256,bytes,bytes)", selector: "0xcea3463e", outputs: "()" },
161
+ { module: "floorAmmGovV2", name: "claimPayoutTo", signature: "claimPayoutTo(address,address)", selector: "0xc14ab75d", outputs: "(uint256)" },
162
+ { module: "floorAmmGovV2", name: "clearTraderRef", signature: "clearTraderRef(address)", selector: "0x53550430", outputs: "()" },
163
+ { module: "floorAmmGovV2", name: "createPaused", signature: "createPaused()", selector: "0xbac7b497", outputs: "(bool)" },
164
+ { module: "floorAmmGovV2", name: "floorTokenAccrued", signature: "floorTokenAccrued(address)", selector: "0xf3a261f9", outputs: "(uint256)" },
165
+ { module: "floorAmmGovV2", name: "handleOwed", signature: "handleOwed(bytes32,address)", selector: "0xaad2ed5c", outputs: "(uint256)" },
166
+ { module: "floorAmmGovV2", name: "handleWallet", signature: "handleWallet(bytes32)", selector: "0xc6da686d", outputs: "(address)" },
167
+ { module: "floorAmmGovV2", name: "holderBucket", signature: "holderBucket(address)", selector: "0x088806d0", outputs: "(uint256)" },
168
+ { module: "floorAmmGovV2", name: "holderDest", signature: "holderDest()", selector: "0x84a6263a", outputs: "(address)" },
169
+ { module: "floorAmmGovV2", name: "initialize", signature: "initialize(address,address,address,address)", selector: "0xf8c8765e", outputs: "()" },
170
+ { module: "floorAmmGovV2", name: "metadataBase", signature: "metadataBase()", selector: "0x65b973c3", outputs: "(string)" },
171
+ { module: "floorAmmGovV2", name: "moveHandleOwed", signature: "moveHandleOwed(bytes32,address[])", selector: "0xc43594a1", outputs: "(uint256)" },
172
+ { module: "floorAmmGovV2", name: "nativeCreateFee", signature: "nativeCreateFee()", selector: "0x10b51e45", outputs: "(uint256)" },
173
+ { module: "floorAmmGovV2", name: "ogCount", signature: "ogCount()", selector: "0x9457990a", outputs: "(uint16,uint64)" },
174
+ { module: "floorAmmGovV2", name: "ogUserOf", signature: "ogUserOf(address)", selector: "0x6df29e2f", outputs: "(uint64,uint64,bool)" },
175
+ { module: "floorAmmGovV2", name: "owedOf", signature: "owedOf(address,address)", selector: "0xfacba08d", outputs: "((uint128,uint128,uint128,uint128,uint128,uint128))" },
176
+ { module: "floorAmmGovV2", name: "owedOfMany", signature: "owedOfMany(address,address[])", selector: "0xa1efa4ba", outputs: "((uint128,uint128,uint128,uint128,uint128,uint128)[])" },
177
+ { module: "floorAmmGovV2", name: "payoutOwed", signature: "payoutOwed(address,address)", selector: "0xae3f9120", outputs: "(uint256)" },
178
+ { module: "floorAmmGovV2", name: "pendingAuthority", signature: "pendingAuthority()", selector: "0xfabb94bb", outputs: "(address)" },
179
+ { module: "floorAmmGovV2", name: "platformOwed", signature: "platformOwed(address)", selector: "0x240b9586", outputs: "(uint256)" },
180
+ { module: "floorAmmGovV2", name: "priceUpdater", signature: "priceUpdater()", selector: "0xfc612a8d", outputs: "(address)" },
181
+ { module: "floorAmmGovV2", name: "quoteEntry", signature: "quoteEntry(address)", selector: "0x77665076", outputs: "((bool,bool,uint8,uint256,uint256,uint64,uint64))" },
182
+ { module: "floorAmmGovV2", name: "quoteRisk", signature: "quoteRisk(address)", selector: "0x1461d14e", outputs: "(uint256,uint256,(uint128,uint32,uint32,uint64))" },
183
+ { module: "floorAmmGovV2", name: "quotes", signature: "quotes()", selector: "0xd6a5d7db", outputs: "(address[])" },
184
+ { module: "floorAmmGovV2", name: "referralAuthority", signature: "referralAuthority()", selector: "0x2fe0a99a", outputs: "(address)" },
185
+ { module: "floorAmmGovV2", name: "revokeOgUser", signature: "revokeOgUser(address)", selector: "0x52e52ecc", outputs: "()" },
186
+ { module: "floorAmmGovV2", name: "setCreatePaused", signature: "setCreatePaused(bool)", selector: "0x83bcec85", outputs: "()" },
187
+ { module: "floorAmmGovV2", name: "setHolderDest", signature: "setHolderDest(address)", selector: "0x6ad3e66d", outputs: "()" },
188
+ { module: "floorAmmGovV2", name: "setMetadataBase", signature: "setMetadataBase(string)", selector: "0xd3811c0f", outputs: "()" },
189
+ { module: "floorAmmGovV2", name: "setNativeCreateFee", signature: "setNativeCreateFee(uint256)", selector: "0xa4433667", outputs: "()" },
190
+ { module: "floorAmmGovV2", name: "setOgUser", signature: "setOgUser(address,uint256,bytes)", selector: "0x02cb4469", outputs: "()" },
191
+ { module: "floorAmmGovV2", name: "setPriceUpdater", signature: "setPriceUpdater(address)", selector: "0x97c4a5f3", outputs: "()" },
192
+ { module: "floorAmmGovV2", name: "setQuoteCap", signature: "setQuoteCap(address,uint128)", selector: "0x42adf398", outputs: "()" },
193
+ { module: "floorAmmGovV2", name: "setQuotePrice", signature: "setQuotePrice(address,uint256)", selector: "0x3857ed9e", outputs: "()" },
194
+ { module: "floorAmmGovV2", name: "setReferralAuthority", signature: "setReferralAuthority(address)", selector: "0x46325d7a", outputs: "()" },
195
+ { module: "floorAmmGovV2", name: "setTimelock", signature: "setTimelock(address)", selector: "0xbdacb303", outputs: "()" },
196
+ { module: "floorAmmGovV2", name: "setTraderRef", signature: "setTraderRef(address,address[3],uint256,bytes,bytes)", selector: "0xd7426758", outputs: "()" },
197
+ { module: "floorAmmGovV2", name: "setTreasury", signature: "setTreasury(address)", selector: "0xf0f44260", outputs: "()" },
198
+ { module: "floorAmmGovV2", name: "timelock", signature: "timelock()", selector: "0xd33219b4", outputs: "(address)" },
199
+ { module: "floorAmmGovV2", name: "transferAuthority", signature: "transferAuthority(address)", selector: "0x3078db6c", outputs: "()" },
200
+ { module: "floorAmmGovV2", name: "treasury", signature: "treasury()", selector: "0x61d027b3", outputs: "(address)" },
201
+ { module: "floorAmmGovV2", name: "updateQuote", signature: "updateQuote(address,bool,uint256,uint256)", selector: "0x21593d6e", outputs: "()" },
154
202
  ];
@@ -27,6 +27,9 @@ export const SOLANA_EVENT_SCHEMAS: readonly SolanaEventSchema[] = [
27
27
  { name: "TraderRefOpened", discriminator: "b19ede398fd84173", source: "v1", fields: [["trader","pubkey"],["quoteMint","pubkey"],["tiers","pubkey[3]"]] },
28
28
  { name: "TraderLinkOpened", discriminator: "ce3cf7987530744b", source: "v1", fields: [["trader","pubkey"],["tiers","pubkey[3]"]] },
29
29
  { name: "TraderRefCleared", discriminator: "2248a8735d5891ac", source: "v1", fields: [["trader","pubkey"],["records","u16"]] },
30
+ { name: "OgUserSet", discriminator: "fa6fd6a5ca80af7e", source: "v1", fields: [["referrer","pubkey"],["from","i64"],["until","i64"],["count","u16"]] },
31
+ { name: "OgUserRevoked", discriminator: "500ecde2e01f6590", source: "v1", fields: [["referrer","pubkey"],["until","i64"],["count","u16"]] },
32
+ { name: "OgSynced", discriminator: "c4e2e1034f80b86e", source: "v1", fields: [["referrer","pubkey"],["records","u16"]] },
30
33
  { name: "CreatorBuyUnlocked", discriminator: "2a091cbbe392c8fc", source: "v1", fields: [["launch","pubkey"],["creator","pubkey"],["tokens","u64"],["members","u64[10]?"],["paid","u64?"]] },
31
34
  { name: "RefOwedOpened", discriminator: "c6738dc0a56e6a77", source: "v1", fields: [["referrer","pubkey"],["quoteMint","pubkey"]] },
32
35
  { name: "RefsRolled", discriminator: "65150ff9ec7a53ab", source: "v1", fields: [["quoteMint","pubkey"],["traderRefs","u16"],["amount","u64"]] },
@@ -62,6 +65,7 @@ export const SOLANA_EVENT_SCHEMAS: readonly SolanaEventSchema[] = [
62
65
  { name: "HolderPositionClosed", discriminator: "a5451f6d7c8dab3c", source: "v2", fields: [["launch","pubkey"],["owner","pubkey"],["amount","u64"],["paid","u64"]] },
63
66
  { name: "HolderIndexRolled", discriminator: "5c857c0e16a9a203", source: "v2", fields: [["launch","pubkey"],["index","u128"],["wMatured","u64"],["wPending","u64"],["carry","u64"]] },
64
67
  { name: "DeadSynced", discriminator: "29e5a9cda4b90d32", source: "v2", fields: [["launch","pubkey"],["added","u64"],["deadTokens","u64"],["sCirc","u64"]] },
68
+ { name: "RefSlices", discriminator: "328f40d2f919f9a9", source: "v2", fields: [["launch","pubkey"],["trader","pubkey"],["traderParts","u64[3]"],["creatorParts","u64[3]"],["og","u8"]] },
65
69
  { name: "GenesisRaiseBought", discriminator: "81c072c6908a578b", source: "v2", fields: [["launch","pubkey"],["trader","pubkey"],["isBuy","bool"],["quoteGross","u64"],["quoteNet","u64"],["refund","u64"],["tokens","u64"],["fees","u64[5]"],["traderRef","u64"],["fromResale","u64"],["fromFirst","u64"],["unfilled","u64"],["sqrtBefore","u128"],["sqrtAfter","u128"],["sqrtF","u128"],["floor","u64"],["cushion","u64"],["sCirc","u64"],["steps","u8"],["budgetHit","bool"],["slot","u64"],["ts","i64"],["kind","u8"],["creatorRef","u64"],["recipient","pubkey"],["bidMoney","u64"],["msPaid","u64[4]"]] },
66
70
  ];
67
71
 
@@ -137,4 +141,5 @@ export const SOLANA_ERRORS: readonly ProgramErrorRow[] = [
137
141
  { chain: "solana", name: "HookAccountsMissing", message: "the transfer-hook accounts are missing", code: 6068, selector: null, signature: null },
138
142
  { chain: "solana", name: "RowTooManyRanges", message: "the row has too many ranges", code: 6069, selector: null, signature: null },
139
143
  { chain: "solana", name: "RowNotFeasible", message: "the row fails the feasibility check", code: 6070, selector: null, signature: null },
144
+ { chain: "solana", name: "OgFull", message: "the OG Users are full: OG_MAX windows are set on this chain", code: 6071, selector: null, signature: null },
140
145
  ];
@@ -27113,6 +27113,83 @@ export const CHAIN_ROWS = [
27113
27113
  "address": "0xfd6f06d323f6cb08ee9eeb2d201e9ec0e9112c88",
27114
27114
  "decimals": 18,
27115
27115
  "kind": "stock"
27116
+ },
27117
+ {
27118
+ "symbol": "EQQQQ",
27119
+ "name": "EQX Tokenized QQQ",
27120
+ "address": "0x095cca17f0619596115eA09bbE1D80431685Ba1A",
27121
+ "decimals": 8,
27122
+ "kind": "stock"
27123
+ },
27124
+ {
27125
+ "symbol": "EQSPY",
27126
+ "name": "EQX Tokenized SPY",
27127
+ "address": "0x07A76acCed707De999A54D39aFF62A2d7ac4CC81",
27128
+ "decimals": 8,
27129
+ "kind": "stock"
27130
+ },
27131
+ {
27132
+ "symbol": "EQNVDA",
27133
+ "name": "EQX Tokenized NVDA",
27134
+ "address": "0xA23aFe6Bd466BdB806a83AfDDA76F644FC4347CF",
27135
+ "decimals": 8,
27136
+ "kind": "stock"
27137
+ },
27138
+ {
27139
+ "symbol": "EQTSLA",
27140
+ "name": "EQX Tokenized TSLA",
27141
+ "address": "0x883DAd2Aa97175c0D1569E1de61204ac47b2b8fb",
27142
+ "decimals": 8,
27143
+ "kind": "stock"
27144
+ },
27145
+ {
27146
+ "symbol": "EQAAPL",
27147
+ "name": "EQX Tokenized AAPL",
27148
+ "address": "0x15d82780780Ca72570818f91587B752562D655bc",
27149
+ "decimals": 8,
27150
+ "kind": "stock"
27151
+ },
27152
+ {
27153
+ "symbol": "EQGOOG",
27154
+ "name": "EQX Tokenized GOOGL",
27155
+ "address": "0x4720b40C89Ff3A74C6bE8eA34Cf40FaE5eacEd79",
27156
+ "decimals": 8,
27157
+ "kind": "stock"
27158
+ },
27159
+ {
27160
+ "symbol": "EQMETA",
27161
+ "name": "EQX Tokenized META",
27162
+ "address": "0xF5c6190d9178097563372a4acA15D52Ec24F129A",
27163
+ "decimals": 8,
27164
+ "kind": "stock"
27165
+ },
27166
+ {
27167
+ "symbol": "EQMSFT",
27168
+ "name": "EQX Tokenized MSFT",
27169
+ "address": "0xca911A8ae21baAf9CDec0baa45259c64Ec8AE59E",
27170
+ "decimals": 8,
27171
+ "kind": "stock"
27172
+ },
27173
+ {
27174
+ "symbol": "EQAMZN",
27175
+ "name": "EQX Tokenized AMZN",
27176
+ "address": "0x582C6ADd0eb720EA1c2e2019fF9b7c21Fe99288F",
27177
+ "decimals": 8,
27178
+ "kind": "stock"
27179
+ },
27180
+ {
27181
+ "symbol": "EQMU",
27182
+ "name": "EQX Tokenized MU",
27183
+ "address": "0x9164Fd5f67FE4188Ff79675182183512bC37d66D",
27184
+ "decimals": 8,
27185
+ "kind": "stock"
27186
+ },
27187
+ {
27188
+ "symbol": "EQSPCX",
27189
+ "name": "EQX Tokenized SPCX",
27190
+ "address": "0xF115FF708A795cD0E06531Dec57ed716138bE8BD",
27191
+ "decimals": 8,
27192
+ "kind": "stock"
27116
27193
  }
27117
27194
  ]
27118
27195
  },
package/src/errors.ts CHANGED
@@ -91,7 +91,7 @@ export const SOLANA_ERROR_NAMES = [
91
91
  "GenesisDustNotYet", "GenesisConvertCapped", "GenesisPriceStale", "GenesisConvertSlippage", "GenesisSolNotConverted",
92
92
  "GenesisWagmiWrongState", "GenesisWagmiNoPreset", "GenesisWagmiQuoteNotListed", "HolderDestNotSet", "NotTeamMember",
93
93
  "BurnTooLarge", "NothingToSettle", "HolderPositionExists", "HolderPositionNotEmpty", "HolderBookMismatch", "DeadAccountNotDead",
94
- "HookAccountsMissing", "RowTooManyRanges", "RowNotFeasible",
94
+ "HookAccountsMissing", "RowTooManyRanges", "RowNotFeasible", "OgFull",
95
95
  ] as const;
96
96
 
97
97
  export const SOLANA_ERROR_BASE = 6000;
@@ -114,7 +114,7 @@ const EXACT: Readonly<Record<string, FloorErrorCode>> = {
114
114
  OverOwed: "OverOwed", ClaimsShort: "OverOwed", UnknownClaimType: "UnknownClaimType",
115
115
  TeamSlotRateOverMax: "TeamSlot", TeamSlotFull: "TeamSlot", TeamSlotPaid: "TeamSlot", TeamSlotExists: "TeamSlot", TeamSlotNoRequest: "TeamSlot",
116
116
  NotPendingHandle: "TeamSlot", BadMember: "TeamSlot", HandleAlreadyBound: "TeamSlot",
117
- TraderRefMismatch: "Referral", TraderRefSet: "Referral", BadReferralSig: "Referral", BadSignature: "Referral", ReferralSigExpired: "Referral",
117
+ TraderRefMismatch: "Referral", TraderRefSet: "Referral", OgFull: "Referral", BadReferralSig: "Referral", BadSignature: "Referral", ReferralSigExpired: "Referral",
118
118
  BurnTooLarge: "BurnTooLarge", PageFull: "PageFull",
119
119
  NotAuthority: "NotAuthorized", NotUpgradeAuthority: "NotAuthorized", NotPriceUpdater: "NotAuthorized", RoleNotHeld: "NotAuthorized",
120
120
  NotTeamMember: "NotAuthorized", NotCreator: "NotAuthorized", NotTimelock: "NotAuthorized", NotReferralAuthority: "NotAuthorized",