@floorlaunchpad/sdk 0.7.0 → 0.8.1

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 (105) hide show
  1. package/CHANGELOG.md +143 -0
  2. package/README.md +12 -1
  3. package/dist/abi/evm.gen.js +75 -2
  4. package/dist/abi/functions.gen.js +87 -1
  5. package/dist/abi/solana.gen.js +59 -0
  6. package/dist/client/solana/index.js +25 -6
  7. package/dist/config/generated.js +803 -26374
  8. package/dist/errors.js +20 -1
  9. package/dist/events/types.gen.js +1 -1
  10. package/dist/evm/chains.js +49 -0
  11. package/dist/evm/floor/abi.gen.js +115 -0
  12. package/dist/evm/squid.js +21 -5
  13. package/dist/evm/venues.js +302 -0
  14. package/dist/generated/interface.gen.js +45 -1
  15. package/dist/index.js +7 -0
  16. package/dist/indexer/bodies.js +154 -2
  17. package/dist/indexer/client.js +8 -1
  18. package/dist/indexer/contract.js +78 -11
  19. package/dist/indexer/paths.js +46 -0
  20. package/dist/indexer/read.js +14 -1
  21. package/dist/math/v2/book.js +24 -7
  22. package/dist/math/v2/create.js +1 -1
  23. package/dist/math/v2/escrow.js +205 -0
  24. package/dist/math/v2/office.js +110 -0
  25. package/dist/math/v2/relay.js +263 -96
  26. package/dist/math/v2/team.js +28 -0
  27. package/dist/math/v2/trade.js +3 -1
  28. package/dist/reprice.js +88 -0
  29. package/dist/route/quote.js +16 -0
  30. package/dist/scaledUi.js +113 -0
  31. package/dist/solana/floor/accounts.js +8 -2
  32. package/dist/solana/floor/events.js +56 -1
  33. package/dist/solana/floor/instructions.js +16 -0
  34. package/dist/stockRefresh.js +99 -0
  35. package/dist/ton/consts.generated.js +2 -2
  36. package/dist/ton/gas.js +3 -3
  37. package/dist/v2/claims.js +28 -5
  38. package/dist/v2/devbuy.js +28 -3
  39. package/dist/v2/evm.js +178 -5
  40. package/dist/v2/layouts.js +100 -2
  41. package/dist/v2/office-events.js +127 -0
  42. package/dist/v2/office-evm.js +68 -0
  43. package/dist/v2/office-read.js +182 -0
  44. package/dist/v2/office-solana.js +134 -0
  45. package/dist/v2/office-trade.js +73 -0
  46. package/dist/v2/route-alt.js +1 -0
  47. package/dist/v2/route.js +1 -1
  48. package/dist/v2/solana.js +224 -5
  49. package/dist/v2/solanaSettle.js +2 -0
  50. package/dist/v2/tx/evm.js +51 -1
  51. package/dist/v2/tx/solana.js +3 -3
  52. package/dist/v2/types.js +4 -0
  53. package/docs/aggregator.md +19 -0
  54. package/examples/floor-line.html +1 -1
  55. package/package.json +26 -1
  56. package/src/abi/evm.gen.ts +75 -2
  57. package/src/abi/functions.gen.ts +87 -1
  58. package/src/abi/solana.gen.ts +59 -0
  59. package/src/client/solana/index.ts +25 -6
  60. package/src/config/generated.ts +803 -26374
  61. package/src/errors.ts +20 -1
  62. package/src/events/types.gen.ts +402 -1
  63. package/src/evm/chains.ts +58 -0
  64. package/src/evm/floor/abi.gen.ts +115 -0
  65. package/src/evm/squid.ts +22 -6
  66. package/src/evm/venues.ts +340 -0
  67. package/src/generated/interface.gen.ts +45 -1
  68. package/src/index.ts +7 -0
  69. package/src/indexer/bodies.ts +167 -2
  70. package/src/indexer/client.ts +16 -2
  71. package/src/indexer/contract.ts +84 -12
  72. package/src/indexer/paths.ts +77 -0
  73. package/src/indexer/read.ts +16 -3
  74. package/src/math/v2/book.ts +23 -7
  75. package/src/math/v2/create.ts +1 -1
  76. package/src/math/v2/escrow.ts +213 -0
  77. package/src/math/v2/office.ts +114 -0
  78. package/src/math/v2/relay.ts +269 -96
  79. package/src/math/v2/team.ts +28 -0
  80. package/src/math/v2/trade.ts +3 -1
  81. package/src/reprice.ts +121 -0
  82. package/src/route/quote.ts +16 -0
  83. package/src/scaledUi.ts +123 -0
  84. package/src/solana/floor/accounts.ts +8 -2
  85. package/src/solana/floor/events.ts +57 -2
  86. package/src/solana/floor/instructions.ts +16 -0
  87. package/src/stockRefresh.ts +131 -0
  88. package/src/ton/consts.generated.ts +2 -2
  89. package/src/ton/gas.ts +3 -3
  90. package/src/v2/claims.ts +34 -5
  91. package/src/v2/devbuy.ts +38 -3
  92. package/src/v2/evm.ts +204 -5
  93. package/src/v2/layouts.ts +100 -2
  94. package/src/v2/office-events.ts +133 -0
  95. package/src/v2/office-evm.ts +76 -0
  96. package/src/v2/office-read.ts +264 -0
  97. package/src/v2/office-solana.ts +159 -0
  98. package/src/v2/office-trade.ts +96 -0
  99. package/src/v2/route-alt.ts +1 -0
  100. package/src/v2/route.ts +1 -1
  101. package/src/v2/solana.ts +235 -5
  102. package/src/v2/solanaSettle.ts +2 -0
  103. package/src/v2/tx/evm.ts +51 -1
  104. package/src/v2/tx/solana.ts +5 -3
  105. package/src/v2/types.ts +66 -1
@@ -0,0 +1,340 @@
1
+
2
+
3
+ import { bytesToHex, checksumAddress, decodeAbi, encodeAbi, encodeCall } from "./abi.ts";
4
+ import { chainById } from "./chains.ts";
5
+ import { AERODROME_SLIPSTREAM_KEY, UR_ADDRESS_THIS, UR_MSG_SENDER, UR_UNWRAP_WETH, UR_V3_SWAP_EXACT_IN, UR_WRAP_ETH, V4_NATIVE, v3Path, v4PoolKey, zapSwapData } from "./zap.ts";
6
+ import type { EdgeQuote, EdgeQuoter } from "../route/quote.ts";
7
+ import { EVM_NATIVE, coinKey } from "../route/graph.ts";
8
+
9
+ export const DEX_FAMILY = { v2: 1, v3: 2, universal: 3, solidly: 4, algebra: 5 } as const;
10
+
11
+ export type DexVenue = "uniswap" | "aerodrome" | "pancake" | "project-x" | "nest" | "ramses" | "hyperswap";
12
+ export type LegKind = "ur" | "ur-v4" | "v3-router" | "router02" | "algebra";
13
+
14
+ export type QuoteKind = "fee" | "tick" | "algebra" | "v4";
15
+
16
+ export interface VenueLeg {
17
+ readonly chainId: number;
18
+ readonly venue: DexVenue;
19
+ readonly router: string;
20
+ readonly quoter: string;
21
+ readonly quoteKind: QuoteKind;
22
+ readonly legKind: LegKind;
23
+
24
+ readonly weth: string | null;
25
+
26
+ readonly nativeView?: { readonly token: string; readonly scale: bigint };
27
+
28
+ readonly keys: readonly number[];
29
+
30
+ readonly urTail?: "minHop" | "isUni" | "none";
31
+
32
+ readonly pathKey?: (key: number) => number;
33
+
34
+ readonly v4TickOf?: Readonly<Record<number, number>>;
35
+ }
36
+
37
+ export interface VenueReads {
38
+
39
+ simulate(a: { to: string; data: string }): Promise<string>;
40
+
41
+ call(a: { to: string; data: string }): Promise<string>;
42
+ }
43
+
44
+ const SLOT_OF: Readonly<Record<DexVenue, string>> = {
45
+ uniswap: "uniswap-ur", aerodrome: "aerodrome-ur", pancake: "pancake-ur", "project-x": "prjx", nest: "nest", ramses: "ramses-ur", hyperswap: "hyperswap",
46
+ };
47
+ const FEES_UNI = [100, 500, 3000, 10000] as const;
48
+ const FEES_PANCAKE = [100, 500, 2500, 10000] as const;
49
+ const WETH_OP = "0x4200000000000000000000000000000000000006";
50
+ const WHYPE = "0x5555555555555555555555555555555555555555";
51
+
52
+ const routerOf = (chainId: number, venue: DexVenue): string => {
53
+ const r = chainById(chainId)?.zapRouters.find((z) => z.slot === SLOT_OF[venue]);
54
+ if (!r) throw new Error(`no router row ${venue} on ${chainId}`);
55
+ return checksumAddress(r.router);
56
+ };
57
+ const wethOf = (chainId: number): string => checksumAddress(chainById(chainId)?.wrappedNative ?? WETH_OP);
58
+
59
+ export const UNISWAP_V3_QUOTER: Readonly<Record<number, string>> = Object.freeze({
60
+ 1: "0x61fFE014bA17989E743c5F6cB21bF9697530B21e",
61
+ 8453: "0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a",
62
+ 56: "0x78D78E420Da98ad378D7799bE8f4AF69033EB077",
63
+ 42161: "0x61fFE014bA17989E743c5F6cB21bF9697530B21e",
64
+ 4663: "0x33e885eD0Ec9bF04EcfB19341582aADCb4c8A9E7",
65
+ 5042: "0x7DfD4F31be6814D2906BDE155c3e1B146EAc1468",
66
+ 99901: "0x204FAca1764B154221e35c0d20aBb3c525710498",
67
+ });
68
+
69
+ export const UNISWAP_V3_FEES: readonly number[] = Object.freeze([...FEES_UNI]);
70
+
71
+ function leg(chainId: number, venue: DexVenue, l: Omit<VenueLeg, "chainId" | "venue" | "router">): VenueLeg {
72
+ return Object.freeze({ chainId, venue, router: routerOf(chainId, venue), ...l, quoter: checksumAddress(l.quoter) });
73
+ }
74
+ const uniswap = (chainId: number): VenueLeg =>
75
+ leg(chainId, "uniswap", { quoter: UNISWAP_V3_QUOTER[chainId], quoteKind: "fee", legKind: "ur", weth: wethOf(chainId), keys: FEES_UNI, urTail: "minHop" });
76
+ const pancake = (chainId: number, weth: string): VenueLeg =>
77
+ leg(chainId, "pancake", { quoter: "0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997", quoteKind: "fee", legKind: "ur", weth: checksumAddress(weth), keys: FEES_PANCAKE, urTail: "none" });
78
+ const ramsesKeys = [1, 5, 10, 50, 100, 200];
79
+
80
+ export const VENUE_LEGS: Readonly<Record<number, readonly VenueLeg[]>> = Object.freeze({
81
+ 1: [uniswap(1)],
82
+ 8453: [
83
+ leg(8453, "aerodrome", { quoter: "0x254cF9E1E6e233aa1AC962CB9B05b2cfeAaE15b0", quoteKind: "tick", legKind: "ur", weth: checksumAddress(WETH_OP), keys: [1, 10, 50, 100, 200, 2000], urTail: "isUni", pathKey: (ts) => AERODROME_SLIPSTREAM_KEY | ts }),
84
+ uniswap(8453),
85
+ pancake(8453, WETH_OP),
86
+ ],
87
+ 56: [pancake(56, "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"), uniswap(56)],
88
+ 42161: [uniswap(42161)],
89
+ 999: [
90
+ leg(999, "project-x", { quoter: "0x239F11a7A3E08f2B8110D4CA9F6B95d4c8865258", quoteKind: "fee", legKind: "v3-router", weth: checksumAddress(WHYPE), keys: FEES_UNI }),
91
+ leg(999, "hyperswap", { quoter: "0x03A918028f22D9E1473B7959C927AD7425A45C7C", quoteKind: "fee", legKind: "router02", weth: checksumAddress(WHYPE), keys: FEES_UNI }),
92
+ leg(999, "nest", { quoter: "0xBea20609A4772311c5b81F814Cd4f9ECaEF5DFAd", quoteKind: "algebra", legKind: "algebra", weth: checksumAddress(WHYPE), keys: [0] }),
93
+ leg(999, "ramses", { quoter: "0x403Bf94fe505cA0F0b1563C350B57dCeC8303ECd", quoteKind: "tick", legKind: "ur", weth: checksumAddress(WHYPE), keys: ramsesKeys, urTail: "none" }),
94
+ ],
95
+ 4663: [
96
+ uniswap(4663),
97
+ leg(4663, "ramses", { quoter: "0x4730e03EB4a58A5e20244062D5f9A99bCf5770a6", quoteKind: "tick", legKind: "ur", weth: checksumAddress("0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73"), keys: ramsesKeys, urTail: "none" }),
98
+ ],
99
+
100
+ 99901: [
101
+ leg(99901, "uniswap", { quoter: "0x379F556c5a748BD7Cc9baF0F7A344094Ac1814f5", quoteKind: "v4", legKind: "ur-v4", weth: checksumAddress(V4_NATIVE), keys: [3000, 10000], v4TickOf: { 3000: 60, 10000: 200 } }),
102
+ ],
103
+
104
+ 5042: [
105
+ leg(5042, "uniswap", { quoter: "0x7DfD4F31be6814D2906BDE155c3e1B146EAc1468", quoteKind: "fee", legKind: "ur", weth: null, nativeView: { token: checksumAddress("0x3600000000000000000000000000000000000000"), scale: 10n ** 12n }, keys: FEES_UNI, urTail: "minHop" }),
106
+ ],
107
+ });
108
+
109
+ export function venueLegOf(chainId: number, router: string): VenueLeg | null {
110
+ return (VENUE_LEGS[chainId] ?? []).find((l) => l.router.toLowerCase() === router.toLowerCase()) ?? null;
111
+ }
112
+
113
+ const FAMILY_OF_LEG: Readonly<Record<LegKind, number>> = { ur: DEX_FAMILY.universal, "ur-v4": DEX_FAMILY.universal, "v3-router": DEX_FAMILY.v3, router02: DEX_FAMILY.v3, algebra: DEX_FAMILY.algebra };
114
+
115
+ export const WIRED_DEX_FAMILIES: readonly number[] = Object.freeze([DEX_FAMILY.v2, DEX_FAMILY.universal, DEX_FAMILY.v3, DEX_FAMILY.algebra]);
116
+ export const dexFamilyWired = (family: number): boolean => WIRED_DEX_FAMILIES.includes(family);
117
+
118
+ export const wiredLegOf = (chainId: number, family: number, dex: string): VenueLeg | null => {
119
+ const l = venueLegOf(chainId, dex);
120
+ return l !== null && FAMILY_OF_LEG[l.legKind] === family ? l : null;
121
+ };
122
+
123
+ export const dexLegWired = (chainId: number, family: number, dex: string): boolean =>
124
+ family === DEX_FAMILY.v2 || (dexFamilyWired(family) && wiredLegOf(chainId, family, dex) !== null);
125
+
126
+ export const legTokenOf = (l: VenueLeg, native: boolean, token: string): string =>
127
+ native ? (l.weth ?? (l.nativeView as { token: string }).token) : checksumAddress(token);
128
+
129
+ const QUOTE_SIG: Readonly<Record<QuoteKind, string>> = {
130
+ fee: "quoteExactInputSingle((address,address,uint256,uint24,uint160))",
131
+ tick: "quoteExactInputSingle((address,address,uint256,int24,uint160))",
132
+ algebra: "quoteExactInputSingle((address,address,uint256,uint160))",
133
+ v4: "quoteExactInputSingle(((address,address,uint24,int24,address),bool,uint128,bytes))",
134
+ };
135
+
136
+ const v4PoolAt = (l: VenueLeg, key: number): { fee: number; tickSpacing: number } | null => {
137
+ const tickSpacing = l.v4TickOf?.[key];
138
+ return tickSpacing === undefined ? null : { fee: key, tickSpacing };
139
+ };
140
+
141
+ const firstWord = (hex: string): bigint | null => {
142
+ const h = hex.startsWith("0x") ? hex.slice(2) : hex;
143
+ if (h.length < 64) return null;
144
+ const out = BigInt("0x" + h.slice(0, 64));
145
+ return out > 0n ? out : null;
146
+ };
147
+
148
+ async function quoteAt(reads: VenueReads, l: VenueLeg, tokenIn: string, tokenOut: string, amountIn: bigint, key: number): Promise<bigint | null> {
149
+ try {
150
+ let data: string;
151
+ if (l.quoteKind === "v4") {
152
+ const pool = v4PoolAt(l, key);
153
+ if (pool === null || amountIn >= 1n << 128n) return null;
154
+ const { key: k, zeroForOne } = v4PoolKey(tokenIn, tokenOut, pool);
155
+ data = bytesToHex(encodeCall(QUOTE_SIG.v4, [[[k.currency0, k.currency1, BigInt(k.fee), BigInt(k.tickSpacing), k.hooks], zeroForOne, amountIn, "0x"]]));
156
+ } else {
157
+ const tail = l.quoteKind === "algebra" ? [] : [BigInt(key)];
158
+ data = bytesToHex(encodeCall(QUOTE_SIG[l.quoteKind], [[tokenIn, tokenOut, amountIn, ...tail, 0n]]));
159
+ }
160
+ return firstWord(await reads.simulate({ to: l.quoter, data }));
161
+ } catch {
162
+ return null;
163
+ }
164
+ }
165
+
166
+ export async function bestVenueHop(reads: VenueReads, l: VenueLeg, a: { fromNative: boolean; from: string; toNative: boolean; to: string; amountIn: bigint }): Promise<{ key: number; out: bigint } | null> {
167
+ if (a.fromNative && a.toNative) return null;
168
+ const tokenIn = legTokenOf(l, a.fromNative, a.from);
169
+ const tokenOut = legTokenOf(l, a.toNative, a.to);
170
+ if (tokenIn === tokenOut) return null;
171
+ const scale = l.nativeView?.scale ?? 1n;
172
+ if (a.fromNative && a.amountIn % scale !== 0n) return null;
173
+ const amountIn = a.fromNative ? a.amountIn / scale : a.amountIn;
174
+ if (amountIn <= 0n) return null;
175
+ const outs = await Promise.all(l.keys.map(async (key) => ({ key, out: await quoteAt(reads, l, tokenIn, tokenOut, amountIn, key) })));
176
+ let best: { key: number; out: bigint } | null = null;
177
+ for (const o of outs) if (o.out !== null && (best === null || o.out > best.out)) best = { key: o.key, out: o.out };
178
+ return best === null ? null : { key: best.key, out: a.toNative ? best.out * scale : best.out };
179
+ }
180
+
181
+ const UR_EXECUTE = "execute(bytes,bytes[],uint256)";
182
+ const SWAP_HEAD = ["address", "uint256", "uint256", "bytes", "bool"];
183
+ const cmdsHex = (cs: readonly number[]): string => "0x" + cs.map((c) => c.toString(16).padStart(2, "0")).join("");
184
+ const enc = (types: string[], values: unknown[]): string => bytesToHex(encodeAbi(types, values as never));
185
+ const call = (sig: string, values: unknown[]): string => bytesToHex(encodeCall(sig, values as never));
186
+
187
+ const V3_SWAP = "exactInputSingle((address,address,uint24,address,uint256,uint256,uint256,uint160))";
188
+ const R02_SWAP = "exactInputSingle((address,address,uint24,address,uint256,uint256,uint160))";
189
+ const ALG_SWAP = "exactInputSingle((address,address,address,uint256,uint256,uint256,uint160))";
190
+
191
+ export interface LegCall { fromNative: boolean; from: string; toNative: boolean; to: string; key: number; amountIn: bigint; minOut: bigint; recipient: string; deadline: bigint }
192
+
193
+ export function venueLegData(l: VenueLeg, a: LegCall): string {
194
+ if (a.amountIn <= 0n || a.minOut <= 0n) throw new RangeError("a leg needs an amount and a minimum");
195
+ if (a.fromNative && a.toNative) throw new RangeError("a leg swaps the coin into itself");
196
+ const tokenIn = legTokenOf(l, a.fromNative, a.from);
197
+ const tokenOut = legTokenOf(l, a.toNative, a.to);
198
+ if (tokenIn === tokenOut) throw new RangeError("a leg swaps a coin into itself");
199
+ if (!l.keys.includes(a.key)) throw new RangeError("a leg at a key its venue does not ask");
200
+ const recipient = checksumAddress(a.recipient);
201
+ if (l.legKind === "ur-v4") {
202
+
203
+ const pool = v4PoolAt(l, a.key);
204
+ if (pool === null) throw new RangeError("a v4 leg at a key with no pool");
205
+ return zapSwapData({ family: "uniswap-ur", route: { tokens: [tokenIn, tokenOut], v4: pool }, amountIn: a.amountIn, minQuoteOut: a.minOut, zap: recipient, deadline: a.deadline });
206
+ }
207
+ if (l.legKind === "ur") {
208
+ const scale = l.nativeView?.scale ?? 1n;
209
+ if (a.fromNative && a.amountIn % scale !== 0n) throw new RangeError("a native amount the view cannot carry");
210
+ const amountIn = a.fromNative ? a.amountIn / scale : a.amountIn;
211
+
212
+ const minOut = a.toNative && l.nativeView ? (a.minOut + scale - 1n) / scale : a.minOut;
213
+ const wrap = l.weth !== null;
214
+ const path = v3Path([tokenIn, tokenOut], [(l.pathKey ?? ((k: number) => k))(a.key)]);
215
+ const swapTo = a.toNative && wrap ? UR_ADDRESS_THIS : UR_MSG_SENDER;
216
+ const head = [swapTo, amountIn, minOut, path, false];
217
+ const swap = l.urTail === "minHop" ? enc([...SWAP_HEAD, "uint256[]"], [...head, []]) : l.urTail === "isUni" ? enc([...SWAP_HEAD, "bool"], [...head, false]) : enc(SWAP_HEAD, head);
218
+ const cmds: number[] = [];
219
+ const inputs: string[] = [];
220
+ if (a.fromNative && wrap) { cmds.push(UR_WRAP_ETH); inputs.push(enc(["address", "uint256"], [UR_ADDRESS_THIS, amountIn])); }
221
+ cmds.push(UR_V3_SWAP_EXACT_IN); inputs.push(swap);
222
+ if (a.toNative && wrap) { cmds.push(UR_UNWRAP_WETH); inputs.push(enc(["address", "uint256"], [UR_MSG_SENDER, minOut])); }
223
+ return call(UR_EXECUTE, [cmdsHex(cmds), inputs, a.deadline]);
224
+ }
225
+
226
+ if (l.legKind === "algebra") {
227
+ const swap = (to: string): string => call(ALG_SWAP, [[tokenIn, tokenOut, to, a.deadline, a.amountIn, a.minOut, 0n]]);
228
+ if (!a.toNative) return swap(recipient);
229
+
230
+ return call("multicall(bytes[])", [[swap(V4_NATIVE), call("unwrapWNativeToken(uint256,address)", [a.minOut, recipient])]]);
231
+ }
232
+ if (l.legKind === "v3-router") {
233
+ const swap = (to: string): string => call(V3_SWAP, [[tokenIn, tokenOut, BigInt(a.key), to, a.deadline, a.amountIn, a.minOut, 0n]]);
234
+ if (!a.toNative) return swap(recipient);
235
+ return call("multicall(bytes[])", [[swap(l.router), call("unwrapWETH9(uint256,address)", [a.minOut, recipient])]]);
236
+ }
237
+ const swap = (to: string): string => call(R02_SWAP, [[tokenIn, tokenOut, BigInt(a.key), to, a.amountIn, a.minOut, 0n]]);
238
+ const calls = a.toNative ? [swap(UR_ADDRESS_THIS), call("unwrapWETH9(uint256,address)", [a.minOut, recipient])] : [swap(recipient)];
239
+ return call("multicall(uint256,bytes[])", [a.deadline, calls]);
240
+ }
241
+
242
+ export function uniswapLegData(top: { weth: string }, a: { tokenIn: string; tokenOut: string; nativeIn: boolean; nativeOut: boolean; fee: number; amountIn: bigint; minOut: bigint; deadline: bigint }): string {
243
+ if (a.amountIn <= 0n || a.minOut <= 0n) throw new RangeError("a Uniswap leg needs an amount and a minimum");
244
+ if (a.nativeIn && a.nativeOut) throw new RangeError("a Uniswap leg swaps the coin into itself");
245
+ const tokenIn = a.nativeIn ? checksumAddress(top.weth) : checksumAddress(a.tokenIn);
246
+ const tokenOut = a.nativeOut ? checksumAddress(top.weth) : checksumAddress(a.tokenOut);
247
+ if (tokenIn === tokenOut) throw new RangeError("a Uniswap leg swaps a coin into itself");
248
+ const swapTo = a.nativeOut ? UR_ADDRESS_THIS : UR_MSG_SENDER;
249
+ const swap = enc([...SWAP_HEAD, "uint256[]"], [swapTo, a.amountIn, a.minOut, v3Path([tokenIn, tokenOut], [a.fee]), false, []]);
250
+ const cmds: number[] = [];
251
+ const inputs: string[] = [];
252
+ if (a.nativeIn) { cmds.push(UR_WRAP_ETH); inputs.push(enc(["address", "uint256"], [UR_ADDRESS_THIS, a.amountIn])); }
253
+ cmds.push(UR_V3_SWAP_EXACT_IN); inputs.push(swap);
254
+ if (a.nativeOut) { cmds.push(UR_UNWRAP_WETH); inputs.push(enc(["address", "uint256"], [UR_MSG_SENDER, a.minOut])); }
255
+ return call(UR_EXECUTE, [cmdsHex(cmds), inputs, a.deadline]);
256
+ }
257
+
258
+ export interface DexEdgeRaw { readonly provider: "dex"; readonly family: number; readonly dex: string; readonly path: readonly string[]; readonly from: string; readonly to: string; readonly chainId?: number; readonly key?: number }
259
+ export const isDexEdgeRaw = (raw: unknown): raw is DexEdgeRaw =>
260
+ typeof raw === "object" && raw !== null && (raw as { provider?: unknown }).provider === "dex";
261
+
262
+ export interface DexEdgeRow { chainId: number; router: string; family: number }
263
+
264
+ const isNative = (coin: string): boolean => coinKey(coin) === EVM_NATIVE;
265
+
266
+ export function legMinOut(out: bigint, slippageBps: number): bigint {
267
+ const m = (out * BigInt(10_000 - slippageBps)) / 10_000n;
268
+ return m > 0n ? m : 1n;
269
+ }
270
+
271
+ const WETH_CACHE = new WeakMap<object, Map<string, Promise<string>>>();
272
+
273
+ function v2WethOf(reads: VenueReads, dex: string): Promise<string> {
274
+ let m = WETH_CACHE.get(reads);
275
+ if (m === undefined) { m = new Map(); WETH_CACHE.set(reads, m); }
276
+ const k = dex.toLowerCase();
277
+ let hit = m.get(k);
278
+ if (hit === undefined) {
279
+ hit = reads.call({ to: dex, data: call("WETH()", []) }).then((h) => checksumAddress(decodeAbi(["address"], h)[0] as string));
280
+ m.set(k, hit);
281
+ const mm = m;
282
+ hit.catch(() => { mm.delete(k); });
283
+ }
284
+ return hit;
285
+ }
286
+
287
+ async function v2PathOf(reads: VenueReads, dex: string, from: string, to: string): Promise<string[]> {
288
+ const weth = isNative(from) || isNative(to) ? await v2WethOf(reads, dex) : null;
289
+ const tok = (c: string): string => (isNative(c) ? (weth as string) : checksumAddress(c));
290
+ const path = [tok(from), tok(to)];
291
+ if (path[0] === path[1]) throw new RangeError("the edge leg swaps a coin into itself");
292
+ return path;
293
+ }
294
+
295
+ function v2EdgeQuoter(reads: VenueReads, dex: string): EdgeQuoter {
296
+ return async (req): Promise<EdgeQuote> => {
297
+ const path = await v2PathOf(reads, dex, req.from, req.to);
298
+ const amounts = decodeAbi(["uint256[]"], await reads.call({ to: dex, data: call("getAmountsOut(uint256,address[])", [req.amountIn, path]) }))[0] as bigint[];
299
+ const out = amounts[amounts.length - 1] ?? 0n;
300
+ if (amounts.length !== path.length || amounts[0] !== req.amountIn || out <= 0n) throw new RangeError("no edge route");
301
+ const raw: DexEdgeRaw = { provider: "dex", family: DEX_FAMILY.v2, dex, path, from: req.from, to: req.to };
302
+ return { inAmount: req.amountIn, outAmount: out, minOut: legMinOut(out, req.slippageBps), raw };
303
+ };
304
+ }
305
+
306
+ function venueEdgeQuoter(reads: VenueReads, row: DexEdgeRow): EdgeQuoter {
307
+ return async (req): Promise<EdgeQuote> => {
308
+ const l = wiredLegOf(row.chainId, row.family, row.router);
309
+ if (l === null) throw new RangeError("no edge route");
310
+ const fromNative = isNative(req.from), toNative = isNative(req.to);
311
+ const path = [legTokenOf(l, fromNative, req.from), legTokenOf(l, toNative, req.to)];
312
+ if (path[0] === path[1]) throw new RangeError("the edge leg swaps a coin into itself");
313
+ const hop = await bestVenueHop(reads, l, { fromNative, from: path[0], toNative, to: path[1], amountIn: req.amountIn });
314
+ if (hop === null) throw new RangeError("no edge route");
315
+ const raw: DexEdgeRaw = { provider: "dex", family: row.family, dex: l.router, path, from: req.from, to: req.to, chainId: row.chainId, key: hop.key };
316
+ return { inAmount: req.amountIn, outAmount: hop.out, minOut: legMinOut(hop.out, req.slippageBps), raw };
317
+ };
318
+ }
319
+
320
+ export function dexEdgeQuoter(row: DexEdgeRow, reads: VenueReads): EdgeQuoter {
321
+ return row.family === DEX_FAMILY.v2 ? v2EdgeQuoter(reads, row.router) : venueEdgeQuoter(reads, row);
322
+ }
323
+
324
+ const V2_ETH_FOR_TOKENS = "swapExactETHForTokens(uint256,address[],address,uint256)";
325
+ const V2_TOKENS_FOR_TOKENS = "swapExactTokensForTokens(uint256,uint256,address[],address,uint256)";
326
+ const V2_TOKENS_FOR_ETH = "swapExactTokensForETH(uint256,uint256,address[],address,uint256)";
327
+
328
+ export function dexSwapData(raw: unknown, p: { amountIn: bigint; minOut: bigint; recipient: string; deadline: bigint }): string {
329
+ if (!isDexEdgeRaw(raw) || !dexFamilyWired(raw.family)) throw new RangeError("edge build refused");
330
+ if (p.amountIn <= 0n || p.minOut <= 0n) throw new RangeError("edge build refused");
331
+ if (raw.family !== DEX_FAMILY.v2) {
332
+ const l = raw.chainId === undefined ? null : wiredLegOf(raw.chainId, raw.family, raw.dex);
333
+ if (l === null || raw.key === undefined || raw.path.length !== 2) throw new RangeError("edge build refused");
334
+ return venueLegData(l, { fromNative: isNative(raw.from), from: raw.path[0], toNative: isNative(raw.to), to: raw.path[1], key: raw.key, amountIn: p.amountIn, minOut: p.minOut, recipient: p.recipient, deadline: p.deadline });
335
+ }
336
+ const path = [...raw.path];
337
+ if (isNative(raw.from)) return call(V2_ETH_FOR_TOKENS, [p.minOut, path, p.recipient, p.deadline]);
338
+ if (isNative(raw.to)) return call(V2_TOKENS_FOR_ETH, [p.amountIn, p.minOut, path, p.recipient, p.deadline]);
339
+ return call(V2_TOKENS_FOR_TOKENS, [p.amountIn, p.minOut, path, p.recipient, p.deadline]);
340
+ }
@@ -36,7 +36,9 @@ export const EVM_FUNCTION_SELECTORS: readonly EvmFunctionSelectorRow[] = [
36
36
  { name: "burnFrom", signature: "burnFrom(address,uint256)", selector: "0x79cc6790", sources: ["floorToken","floorTokenIndexed"] },
37
37
  { name: "burnTeamV2", signature: "burnTeamV2(uint256,uint8,uint256)", selector: "0x2f7bf11b", sources: ["floorAmmClaimsV2"] },
38
38
  { name: "buy", signature: "buy(uint256,uint256,uint256,address,uint256)", selector: "0x102d8c79", sources: ["floorAmm","floorAmmV2"] },
39
+ { name: "buyFor", signature: "buyFor(uint256,uint256,uint256,address,uint256,address)", selector: "0x67105875", sources: ["floorAmm","floorAmmV2"] },
39
40
  { name: "buyFromBalance", signature: "buyFromBalance(uint256,uint256,address,address,uint256)", selector: "0x5f9f56d2", sources: ["floorAmm","floorAmmV2"] },
41
+ { name: "buyFromBalanceFor", signature: "buyFromBalanceFor(uint256,uint256,address,address,uint256,address)", selector: "0xbb6cda49", sources: ["floorAmm","floorAmmV2"] },
40
42
  { name: "buyWithEth", signature: "buyWithEth(uint256,bytes,uint256,uint256,address,uint256)", selector: "0xef8772c4", sources: ["floorZap"] },
41
43
  { name: "buyWithToken", signature: "buyWithToken(uint256,address,uint256,bytes,uint256,uint256,address,uint256)", selector: "0x9fd30605", sources: ["floorZap"] },
42
44
  { name: "checkPreset", signature: "checkPreset(bytes)", selector: "0x6337513e", sources: ["floorAmm"] },
@@ -48,7 +50,22 @@ export const EVM_FUNCTION_SELECTORS: readonly EvmFunctionSelectorRow[] = [
48
50
  { name: "createLaunch", signature: "createLaunch((uint8,address,string,string,uint256,uint256,bool,bytes32,uint256,uint16))", selector: "0x25b62f18", sources: ["floorAmm","floorAmmCreateV2"] },
49
51
  { name: "createPaused", signature: "createPaused()", selector: "0xbac7b497", sources: ["floorAmm","floorAmmGovV2"] },
50
52
  { name: "creditBacking", signature: "creditBacking(uint256,uint256)", selector: "0x1f341504", sources: ["floorAmmV2"] },
53
+ { name: "creditPlatform", signature: "creditPlatform(uint256,uint256,bytes32)", selector: "0x93fe58a2", sources: ["floorAmm","floorAmmV2"] },
51
54
  { name: "DEAD", signature: "DEAD()", selector: "0x03fd2a45", sources: ["floorTokenIndexed"] },
55
+ { name: "dealEscrowArm", signature: "dealEscrowArm(bytes32,uint8)", selector: "0x3fe96415", sources: ["floorAmm","floorAmmClaimsV2"] },
56
+ { name: "dealEscrowArmV3", signature: "dealEscrowArmV3(bytes32,uint8)", selector: "0x32037a0e", sources: ["floorAmm","floorAmmClaimsV2"] },
57
+ { name: "dealEscrowCancel", signature: "dealEscrowCancel(bytes32)", selector: "0x16d11c50", sources: ["floorAmm","floorAmmViewsV2"] },
58
+ { name: "dealEscrowMarketCap", signature: "dealEscrowMarketCap(uint256)", selector: "0x96cefeb9", sources: ["floorAmm","floorAmmViewsV2"] },
59
+ { name: "dealEscrowObject", signature: "dealEscrowObject(bytes32,uint8)", selector: "0xd8071cc0", sources: ["floorAmm","floorAmmViewsV2"] },
60
+ { name: "dealEscrowOf", signature: "dealEscrowOf(bytes32)", selector: "0x2a144918", sources: ["floorAmm","floorAmmViewsV2"] },
61
+ { name: "dealEscrowOpen", signature: "dealEscrowOpen(uint256,address,bytes32,bool,uint256[],uint256[],int64)", selector: "0xe279a5e8", sources: ["floorAmm","floorAmmClaimsV2"] },
62
+ { name: "dealEscrowOpenV3", signature: "dealEscrowOpenV3(uint256,address,bytes32,bool,(uint8[],uint256[],uint256[],uint8,address,uint16,int64))", selector: "0xa1330ee1", sources: ["floorAmm","floorAmmClaimsV2"] },
63
+ { name: "dealEscrowRefund", signature: "dealEscrowRefund(bytes32)", selector: "0x947a9b41", sources: ["floorAmm","floorAmmClaimsV2"] },
64
+ { name: "dealEscrowRelease", signature: "dealEscrowRelease(bytes32,uint8)", selector: "0xcd129e2e", sources: ["floorAmm","floorAmmClaimsV2"] },
65
+ { name: "dealEscrowReleaseV3", signature: "dealEscrowReleaseV3(bytes32,uint8)", selector: "0xb25894ac", sources: ["floorAmm","floorAmmClaimsV2"] },
66
+ { name: "dealEscrowSubmitProof", signature: "dealEscrowSubmitProof(bytes32,uint8,bytes32)", selector: "0x236f5ea6", sources: ["floorAmm","floorAmmViewsV2"] },
67
+ { name: "dealEscrowV3Of", signature: "dealEscrowV3Of(bytes32)", selector: "0xaffbc4bb", sources: ["floorAmm","floorAmmViewsV2"] },
68
+ { name: "dealFeeCapBps", signature: "dealFeeCapBps()", selector: "0xfd066b8a", sources: ["floorAmm","floorAmmGovV2"] },
52
69
  { name: "decimals", signature: "decimals()", selector: "0x313ce567", sources: ["floorToken","floorTokenIndexed"] },
53
70
  { name: "decodeRow", signature: "decodeRow(bytes)", selector: "0x8fff698d", sources: ["floorAmmCreateV2"] },
54
71
  { name: "deletePreset", signature: "deletePreset(uint8)", selector: "0xb2d0d2a5", sources: ["floorAmm"] },
@@ -79,12 +96,29 @@ export const EVM_FUNCTION_SELECTORS: readonly EvmFunctionSelectorRow[] = [
79
96
  { name: "name", signature: "name()", selector: "0x06fdde03", sources: ["floorToken","floorTokenIndexed"] },
80
97
  { name: "NATIVE", signature: "NATIVE()", selector: "0xa0cf0aea", sources: ["floorAmm","floorAmmGovV2"] },
81
98
  { name: "nativeCreateFee", signature: "nativeCreateFee()", selector: "0x10b51e45", sources: ["floorAmm","floorAmmGovV2"] },
82
- { name: "nextModule", signature: "nextModule()", selector: "0xf85abfc7", sources: ["floorAmmV2","floorAmmViewsV2","floorAmmCreateV2","floorAmmClaimsV2"] },
99
+ { name: "nextModule", signature: "nextModule()", selector: "0xf85abfc7", sources: ["floorAmmV2","floorAmmViewsV2","floorAmmCreateV2","floorAmmClaimsV2","floorAmmOfficeV2"] },
83
100
  { name: "nextPresetId", signature: "nextPresetId()", selector: "0xc8a768e6", sources: ["floorAmm"] },
84
101
  { name: "nonces", signature: "nonces(address)", selector: "0x7ecebe00", sources: ["floorToken","floorTokenIndexed"] },
85
102
  { name: "noteBurn", signature: "noteBurn(uint256)", selector: "0x6db7cd01", sources: ["floorAmmCreateV2"] },
86
103
  { name: "noteDead", signature: "noteDead(uint256)", selector: "0xbdf3b0de", sources: ["floorAmmCreateV2"] },
87
104
  { name: "noteMove", signature: "noteMove(address,address,uint256,uint256,uint256)", selector: "0xe6b761ea", sources: ["floorAmmV2"] },
105
+ { name: "officeAcceptController", signature: "officeAcceptController(bytes32)", selector: "0x94a408e4", sources: ["floorAmm","floorAmmOfficeV2"] },
106
+ { name: "officeAcceptMerge", signature: "officeAcceptMerge(bytes32,bytes32,address)", selector: "0x5b134957", sources: ["floorAmm","floorAmmOfficeV2"] },
107
+ { name: "officeAddMember", signature: "officeAddMember(bytes32,address)", selector: "0xe65ac3d9", sources: ["floorAmm","floorAmmOfficeV2"] },
108
+ { name: "officeBuy", signature: "officeBuy(bytes32,uint256,uint256,uint256)", selector: "0xad7e22ec", sources: ["floorAmm","floorAmmOfficeV2"] },
109
+ { name: "officeCancelMerge", signature: "officeCancelMerge(bytes32)", selector: "0x009048f9", sources: ["floorAmm","floorAmmOfficeV2"] },
110
+ { name: "officeDeposit", signature: "officeDeposit(bytes32,uint256)", selector: "0x303a9f22", sources: ["floorAmm","floorAmmOfficeV2"] },
111
+ { name: "officeLeave", signature: "officeLeave(bytes32)", selector: "0xa3c22110", sources: ["floorAmm","floorAmmOfficeV2"] },
112
+ { name: "officeMemberOf", signature: "officeMemberOf(bytes32,address)", selector: "0x17883590", sources: ["floorAmm","floorAmmOfficeV2"] },
113
+ { name: "officeMergeStep", signature: "officeMergeStep(bytes32)", selector: "0x8c2973f8", sources: ["floorAmm","floorAmmOfficeV2"] },
114
+ { name: "officeOf", signature: "officeOf(bytes32)", selector: "0x525c1680", sources: ["floorAmm","floorAmmOfficeV2"] },
115
+ { name: "officeOpen", signature: "officeOpen(bytes32,address)", selector: "0x749cd130", sources: ["floorAmm","floorAmmOfficeV2"] },
116
+ { name: "officeProposeController", signature: "officeProposeController(bytes32,address)", selector: "0x7dc27095", sources: ["floorAmm","floorAmmOfficeV2"] },
117
+ { name: "officeProposeMerge", signature: "officeProposeMerge(bytes32,bytes32,address)", selector: "0x95660c91", sources: ["floorAmm","floorAmmOfficeV2"] },
118
+ { name: "officeRemoveMember", signature: "officeRemoveMember(bytes32,address)", selector: "0xf1b0f92d", sources: ["floorAmm","floorAmmOfficeV2"] },
119
+ { name: "officeSell", signature: "officeSell(bytes32,uint256,address,uint256,uint256)", selector: "0x6b8325c5", sources: ["floorAmm","floorAmmOfficeV2"] },
120
+ { name: "officeSetShare", signature: "officeSetShare(bytes32,address,uint16)", selector: "0x1569850a", sources: ["floorAmm","floorAmmOfficeV2"] },
121
+ { name: "officeValue", signature: "officeValue(bytes32)", selector: "0x7f2683e3", sources: ["floorAmm","floorAmmOfficeV2"] },
88
122
  { name: "ogCount", signature: "ogCount()", selector: "0x9457990a", sources: ["floorAmmGovV2"] },
89
123
  { name: "ogUserOf", signature: "ogUserOf(address)", selector: "0x6df29e2f", sources: ["floorAmmGovV2"] },
90
124
  { name: "optedIn", signature: "optedIn(address)", selector: "0x4824b8fd", sources: ["floorTokenIndexed"] },
@@ -109,13 +143,20 @@ export const EVM_FUNCTION_SELECTORS: readonly EvmFunctionSelectorRow[] = [
109
143
  { name: "quotes", signature: "quotes()", selector: "0xd6a5d7db", sources: ["floorAmm","floorAmmGovV2"] },
110
144
  { name: "quoteSell", signature: "quoteSell(uint256,uint256,address)", selector: "0x0cff08d1", sources: ["floorAmm","floorAmmV2"] },
111
145
  { name: "referralAuthority", signature: "referralAuthority()", selector: "0x2fe0a99a", sources: ["floorAmm","floorAmmGovV2"] },
146
+ { name: "refVolume", signature: "refVolume(uint256,address)", selector: "0xe6a32581", sources: ["floorAmm","floorAmmViewsV2"] },
147
+ { name: "relayBook", signature: "relayBook(uint256)", selector: "0xd1f6ab70", sources: ["floorAmmV2"] },
148
+ { name: "relayBooks", signature: "relayBooks(uint256,uint256)", selector: "0xcf90be94", sources: ["floorAmmV2"] },
112
149
  { name: "releaseSkipped", signature: "releaseSkipped(address)", selector: "0x215fa9eb", sources: ["floorTokenIndexed"] },
113
150
  { name: "revokeOgUser", signature: "revokeOgUser(address)", selector: "0x52e52ecc", sources: ["floorAmmGovV2"] },
151
+ { name: "roomOf", signature: "roomOf()", selector: "0x7a0be43c", sources: ["floorAmmV2"] },
114
152
  { name: "router", signature: "router()", selector: "0xf887ea40", sources: ["floorZap"] },
153
+ { name: "routerDeployer", signature: "routerDeployer()", selector: "0xe8381015", sources: ["floorAmm","floorAmmV2"] },
115
154
  { name: "sell", signature: "sell(uint256,uint256,uint256,address,uint256)", selector: "0xbadb999b", sources: ["floorAmm","floorAmmV2"] },
116
155
  { name: "sellFromBalance", signature: "sellFromBalance(uint256,uint256,address,uint256)", selector: "0x611b00a8", sources: ["floorAmm","floorAmmV2"] },
156
+ { name: "sellFromBalanceFor", signature: "sellFromBalanceFor(uint256,uint256,address,uint256,address)", selector: "0x54590af6", sources: ["floorAmm","floorAmmV2"] },
117
157
  { name: "sellWithPermit", signature: "sellWithPermit(uint256,uint256,uint256,address,uint256,uint256,uint8,bytes32,bytes32)", selector: "0x2ab030d3", sources: ["floorAmm","floorAmmV2"] },
118
158
  { name: "setCreatePaused", signature: "setCreatePaused(bool)", selector: "0x83bcec85", sources: ["floorAmm","floorAmmGovV2"] },
159
+ { name: "setDealFeeCap", signature: "setDealFeeCap(uint16)", selector: "0x041a4410", sources: ["floorAmm","floorAmmGovV2"] },
119
160
  { name: "setHolderDest", signature: "setHolderDest(address)", selector: "0x6ad3e66d", sources: ["floorAmm","floorAmmGovV2"] },
120
161
  { name: "setMetadataBase", signature: "setMetadataBase(string)", selector: "0xd3811c0f", sources: ["floorAmm","floorAmmGovV2"] },
121
162
  { name: "setNativeCreateFee", signature: "setNativeCreateFee(uint256)", selector: "0xa4433667", sources: ["floorAmm","floorAmmGovV2"] },
@@ -136,6 +177,9 @@ export const EVM_FUNCTION_SELECTORS: readonly EvmFunctionSelectorRow[] = [
136
177
  { name: "teamShareBuyAndClaim", signature: "teamShareBuyAndClaim(uint256,uint256,uint256,uint256)", selector: "0xc7f1048c", sources: ["floorAmmViewsV2"] },
137
178
  { name: "teamShareOf", signature: "teamShareOf(uint256,address)", selector: "0xb2280af2", sources: ["floorAmm","floorAmmViewsV2"] },
138
179
  { name: "teamSlotAdd", signature: "teamSlotAdd(uint256,bytes32,uint8,uint256,bool)", selector: "0xd5402e81", sources: ["floorAmm","floorAmmClaimsV2"] },
180
+ { name: "teamSlotAddDeal", signature: "teamSlotAddDeal(uint256,bytes32,uint8,uint256,uint16)", selector: "0xed6c1829", sources: ["floorAmm","floorAmmClaimsV2"] },
181
+ { name: "teamSlotAddDealV3", signature: "teamSlotAddDealV3(uint256,bytes32,uint8,uint256,uint16,address,uint16)", selector: "0x883baaa4", sources: ["floorAmm","floorAmmClaimsV2"] },
182
+ { name: "teamSlotAgencyOf", signature: "teamSlotAgencyOf(uint256,uint8)", selector: "0x1764d99f", sources: ["floorAmm","floorAmmViewsV2"] },
139
183
  { name: "teamSlotOf", signature: "teamSlotOf(uint256)", selector: "0x8744aded", sources: ["floorAmmViewsV2"] },
140
184
  { name: "timelock", signature: "timelock()", selector: "0xd33219b4", sources: ["floorAmm","floorAmmGovV2"] },
141
185
  { name: "TOKEN_SCALE", signature: "TOKEN_SCALE()", selector: "0xcae07d2a", sources: ["floorTokenIndexed"] },
package/src/index.ts CHANGED
@@ -19,11 +19,15 @@ export * as solanaTx from "./solana/tx.ts";
19
19
  export * as solanaAlt from "./solana/alt.ts";
20
20
  export * as handle from "./handle.ts";
21
21
  export * as burn from "./burn.ts";
22
+ export * as scaledUi from "./scaledUi.ts";
23
+ export * as stockRefresh from "./stockRefresh.ts";
24
+ export * as reprice from "./reprice.ts";
22
25
  export * as evmKeccak from "./evm/keccak.ts";
23
26
  export * as evmAbi from "./evm/abi.ts";
24
27
  export * as evmItems from "./evm/items.ts";
25
28
  export * as evmZap from "./evm/zap.ts";
26
29
  export * as evmRouter from "./evm/router.ts";
30
+ export * as evmVenues from "./evm/venues.ts";
27
31
  export * as evmChains from "./evm/chains.ts";
28
32
  export * as evmMulticall from "./evm/multicall.ts";
29
33
  export * as evmFloorAbiGen from "./evm/floor/abi.gen.ts";
@@ -66,6 +70,7 @@ export * as mathV2Error from "./math/v2/error.ts";
66
70
  export * as mathV2Holders from "./math/v2/holders.ts";
67
71
  export * as mathV2Milestones from "./math/v2/milestones.ts";
68
72
  export * as mathV2Rows from "./math/v2/rows.ts";
73
+ export * as mathV2Escrow from "./math/v2/escrow.ts";
69
74
  export * as mathV2Circulating from "./math/v2/circulating.ts";
70
75
  export * as mathV2Ask from "./math/v2/ask.ts";
71
76
  export * as mathV2Feasibility from "./math/v2/feasibility.ts";
@@ -92,3 +97,5 @@ export * as fixtures from "./fixtures.ts";
92
97
  export * as client from "./client/index.ts";
93
98
  export * as errors from "./errors.ts";
94
99
  export * as generated from "./generated/index.ts";
100
+ export * as v2OfficeRead from "./v2/office-read.ts";
101
+ export * as v2OfficeTrade from "./v2/office-trade.ts";