@floorlaunchpad/sdk 0.1.1 → 0.3.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.
- package/CHANGELOG.md +114 -0
- package/LICENSE +201 -60
- package/README.md +54 -24
- package/dist/abi/evm-event-names.js +12 -0
- package/dist/abi/evm.gen.js +130 -0
- package/dist/abi/functions.gen.js +144 -0
- package/dist/abi/index.js +17 -0
- package/dist/abi/solana.gen.js +130 -0
- package/dist/burn.js +21 -0
- package/dist/client/evm/index.js +191 -0
- package/dist/client/index.js +19 -0
- package/dist/client/solana/index.js +259 -0
- package/dist/client/types.js +5 -0
- package/dist/codec.js +77 -0
- package/dist/config/codeHash.js +9 -0
- package/dist/config/generated.js +803 -0
- package/dist/config/index.js +49 -0
- package/dist/config/registry.gen.js +118 -0
- package/dist/config/solana-genesis.js +7 -0
- package/dist/ed25519.js +31 -0
- package/dist/errors.js +249 -0
- package/dist/events/index.js +40 -0
- package/dist/events/types.gen.js +3 -0
- package/dist/evm/abi.js +283 -0
- package/dist/evm/balances.js +26 -0
- package/dist/evm/chains.js +148 -0
- package/dist/evm/floor/abi.gen.js +195 -0
- package/dist/evm/floor/calls.js +230 -0
- package/dist/evm/floor/create.js +49 -0
- package/dist/evm/floor/events.js +41 -0
- package/dist/evm/floor/iface.js +44 -0
- package/dist/evm/items.js +209 -0
- package/dist/evm/keccak.js +118 -0
- package/dist/evm/multicall.js +30 -0
- package/dist/evm/router.js +184 -0
- package/dist/evm/squid.js +107 -0
- package/dist/evm/zap.js +128 -0
- package/dist/fixtures.js +53 -0
- package/dist/generated/index.js +28 -0
- package/dist/generated/interface.gen.js +146 -0
- package/dist/handle.js +22 -0
- package/dist/index.js +93 -7
- package/dist/indexer/bodies.js +473 -0
- package/dist/indexer/client.js +105 -0
- package/dist/indexer/contract.js +358 -0
- package/dist/indexer/decode.js +97 -0
- package/dist/indexer/partners.js +105 -0
- package/dist/indexer/paths.js +127 -0
- package/dist/indexer/read.js +109 -0
- package/dist/indexer/stream.js +71 -0
- package/dist/lock.js +16 -0
- package/dist/math/fixed.js +154 -0
- package/dist/math/genesis.js +39 -0
- package/dist/math/index.js +20 -0
- package/dist/math/u256.js +49 -0
- package/dist/math/v2/ask.js +162 -0
- package/dist/math/v2/book.js +607 -0
- package/dist/math/v2/circulating.js +62 -0
- package/dist/math/v2/create.js +122 -0
- package/dist/math/v2/display.js +208 -0
- package/dist/math/v2/error.js +17 -0
- package/dist/math/v2/feasibility.js +174 -0
- package/dist/math/v2/fees.js +121 -0
- package/dist/math/v2/holders.js +105 -0
- package/dist/math/v2/milestones.js +40 -0
- package/dist/math/v2/pow.js +69 -0
- package/dist/math/v2/preset.js +151 -0
- package/dist/math/v2/receipt.js +108 -0
- package/dist/math/v2/relay.js +217 -0
- package/dist/math/v2/rows.js +365 -0
- package/dist/math/v2/split.js +111 -0
- package/dist/math/v2/sqrt.js +84 -0
- package/dist/math/v2/supply.js +21 -0
- package/dist/math/v2/team.js +75 -0
- package/dist/math/v2/trade.js +126 -0
- package/dist/math/v2/wide.js +51 -0
- package/dist/quote.js +6 -0
- package/dist/registryPrice.js +23 -0
- package/dist/route/edge-jupiter.js +42 -0
- package/dist/route/edge.js +11 -0
- package/dist/route/graph.js +51 -0
- package/dist/route/path.js +75 -0
- package/dist/route/quote.js +15 -0
- package/dist/route-jupiter.js +35 -0
- package/dist/route.js +8 -0
- package/dist/sha256.js +61 -0
- package/dist/solana/alt.js +18 -0
- package/dist/solana/floor/accounts.js +392 -0
- package/dist/solana/floor/borsh.js +66 -0
- package/dist/solana/floor/create.js +65 -0
- package/dist/solana/floor/events.js +144 -0
- package/dist/solana/floor/genesis.js +91 -0
- package/dist/solana/floor/genesisList.js +68 -0
- package/dist/solana/floor/instructions.js +448 -0
- package/dist/solana/floor/metadata.js +198 -0
- package/dist/solana/floor/mint.js +206 -0
- package/dist/solana/floor/program.js +64 -0
- package/dist/solana/floor/registry.js +83 -0
- package/dist/solana/instruction.js +49 -0
- package/dist/solana/pda.js +88 -0
- package/dist/solana/tx.js +138 -0
- package/dist/v2/burnPreview.js +35 -0
- package/dist/v2/circulating.js +11 -0
- package/dist/v2/claimAllEvm.js +70 -0
- package/dist/v2/claims-evm.js +120 -0
- package/dist/v2/claims.js +218 -0
- package/dist/v2/dead.js +21 -0
- package/dist/v2/devbuy.js +37 -0
- package/dist/v2/events.js +115 -0
- package/dist/v2/evm.js +299 -0
- package/dist/v2/evmReads.js +76 -0
- package/dist/v2/genesis.js +76 -0
- package/dist/v2/layouts.js +217 -0
- package/dist/v2/market-evm.js +74 -0
- package/dist/v2/presetRowEvm.js +45 -0
- package/dist/v2/press.js +106 -0
- package/dist/v2/quoteMint.js +52 -0
- package/dist/v2/receipt-tx.js +149 -0
- package/dist/v2/route-alt.js +114 -0
- package/dist/v2/route.js +389 -0
- package/dist/v2/router.js +22 -0
- package/dist/v2/solana.js +391 -0
- package/dist/v2/solanaSettle.js +97 -0
- package/dist/v2/tx/evm.js +126 -0
- package/dist/v2/tx/genesis.js +47 -0
- package/dist/v2/tx/index.js +5 -0
- package/dist/v2/tx/solana.js +118 -0
- package/dist/v2/types.js +13 -0
- package/docs/aggregator.md +61 -0
- package/docs/bot.md +50 -0
- package/docs/floor-line.md +66 -0
- package/docs/frontend.md +29 -0
- package/docs/wallet.md +54 -0
- package/examples/floor-line.html +104 -0
- package/package.json +429 -32
- package/src/abi/evm-event-names.ts +12 -0
- package/src/abi/evm.gen.ts +139 -0
- package/src/abi/functions.gen.ts +154 -0
- package/src/abi/index.ts +30 -0
- package/src/abi/solana.gen.ts +140 -0
- package/src/burn.ts +37 -0
- package/src/client/evm/index.ts +199 -0
- package/src/client/index.ts +23 -0
- package/src/client/solana/index.ts +260 -0
- package/src/client/types.ts +162 -0
- package/src/codec.ts +77 -0
- package/src/config/codeHash.ts +9 -0
- package/src/config/generated.ts +803 -0
- package/src/config/index.ts +93 -0
- package/src/config/registry.gen.ts +118 -0
- package/src/config/solana-genesis.ts +7 -0
- package/src/ed25519.ts +31 -0
- package/src/errors.ts +270 -0
- package/src/events/index.ts +44 -0
- package/src/events/types.gen.ts +842 -0
- package/src/evm/abi.ts +292 -0
- package/src/evm/balances.ts +26 -0
- package/src/evm/chains.ts +171 -0
- package/src/evm/floor/abi.gen.ts +195 -0
- package/src/evm/floor/calls.ts +247 -0
- package/src/evm/floor/create.ts +68 -0
- package/src/evm/floor/events.ts +51 -0
- package/src/evm/floor/iface.ts +45 -0
- package/src/evm/items.ts +252 -0
- package/src/evm/keccak.ts +118 -0
- package/src/evm/multicall.ts +43 -0
- package/src/evm/router.ts +209 -0
- package/src/evm/squid.ts +138 -0
- package/src/evm/zap.ts +152 -0
- package/src/fixtures.ts +53 -0
- package/src/generated/index.ts +29 -0
- package/src/generated/interface.gen.ts +153 -0
- package/src/handle.ts +22 -0
- package/src/index.ts +93 -6
- package/src/indexer/bodies.ts +528 -0
- package/src/indexer/client.ts +180 -0
- package/src/indexer/contract.ts +419 -0
- package/src/indexer/decode.ts +109 -0
- package/src/indexer/partners.ts +115 -0
- package/src/indexer/paths.ts +190 -0
- package/src/indexer/read.ts +119 -0
- package/src/indexer/stream.ts +83 -0
- package/src/lock.ts +16 -0
- package/src/math/fixed.ts +154 -0
- package/src/math/genesis.ts +39 -0
- package/src/math/index.ts +24 -0
- package/src/math/u256.ts +49 -0
- package/src/math/v2/ask.ts +218 -0
- package/src/math/v2/book.ts +660 -0
- package/src/math/v2/circulating.ts +69 -0
- package/src/math/v2/create.ts +139 -0
- package/src/math/v2/display.ts +250 -0
- package/src/math/v2/error.ts +19 -0
- package/src/math/v2/feasibility.ts +200 -0
- package/src/math/v2/fees.ts +121 -0
- package/src/math/v2/holders.ts +124 -0
- package/src/math/v2/milestones.ts +51 -0
- package/src/math/v2/pow.ts +71 -0
- package/src/math/v2/preset.ts +189 -0
- package/src/math/v2/receipt.ts +162 -0
- package/src/math/v2/relay.ts +235 -0
- package/src/math/v2/rows.ts +412 -0
- package/src/math/v2/split.ts +160 -0
- package/src/math/v2/sqrt.ts +86 -0
- package/src/math/v2/supply.ts +27 -0
- package/src/math/v2/team.ts +75 -0
- package/src/math/v2/trade.ts +145 -0
- package/src/math/v2/wide.ts +52 -0
- package/src/quote.ts +6 -0
- package/src/registryPrice.ts +28 -0
- package/src/route/edge-jupiter.ts +71 -0
- package/src/route/edge.ts +22 -0
- package/src/route/graph.ts +77 -0
- package/src/route/path.ts +84 -0
- package/src/route/quote.ts +46 -0
- package/src/route-jupiter.ts +36 -0
- package/src/route.ts +8 -0
- package/src/sha256.ts +61 -0
- package/src/solana/alt.ts +25 -0
- package/src/solana/floor/accounts.ts +395 -0
- package/src/solana/floor/borsh.ts +66 -0
- package/src/solana/floor/create.ts +89 -0
- package/src/solana/floor/events.ts +151 -0
- package/src/solana/floor/genesis.ts +111 -0
- package/src/solana/floor/genesisList.ts +75 -0
- package/src/solana/floor/instructions.ts +504 -0
- package/src/solana/floor/metadata.ts +246 -0
- package/src/solana/floor/mint.ts +242 -0
- package/src/solana/floor/program.ts +64 -0
- package/src/solana/floor/registry.ts +96 -0
- package/src/solana/instruction.ts +61 -0
- package/src/solana/pda.ts +91 -0
- package/src/solana/tx.ts +143 -0
- package/src/v2/burnPreview.ts +52 -0
- package/src/v2/circulating.ts +22 -0
- package/src/v2/claimAllEvm.ts +97 -0
- package/src/v2/claims-evm.ts +179 -0
- package/src/v2/claims.ts +288 -0
- package/src/v2/dead.ts +21 -0
- package/src/v2/devbuy.ts +55 -0
- package/src/v2/events.ts +131 -0
- package/src/v2/evm.ts +349 -0
- package/src/v2/evmReads.ts +121 -0
- package/src/v2/genesis.ts +80 -0
- package/src/v2/layouts.ts +219 -0
- package/src/v2/market-evm.ts +95 -0
- package/src/v2/presetRowEvm.ts +54 -0
- package/src/v2/press.ts +124 -0
- package/src/v2/quoteMint.ts +63 -0
- package/src/v2/receipt-tx.ts +251 -0
- package/src/v2/route-alt.ts +114 -0
- package/src/v2/route.ts +494 -0
- package/src/v2/router.ts +22 -0
- package/src/v2/solana.ts +439 -0
- package/src/v2/solanaSettle.ts +117 -0
- package/src/v2/tx/evm.ts +152 -0
- package/src/v2/tx/genesis.ts +66 -0
- package/src/v2/tx/index.ts +5 -0
- package/src/v2/tx/solana.ts +140 -0
- package/src/v2/types.ts +284 -0
- package/dist/adapter.d.ts +0 -28
- package/dist/adapter.d.ts.map +0 -1
- package/dist/adapter.js +0 -2
- package/dist/adapter.js.map +0 -1
- package/dist/chain.d.ts +0 -23
- package/dist/chain.d.ts.map +0 -1
- package/dist/chain.js +0 -25
- package/dist/chain.js.map +0 -1
- package/dist/client.d.ts +0 -26
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -43
- package/dist/client.js.map +0 -1
- package/dist/dex-adapter.d.ts +0 -228
- package/dist/dex-adapter.d.ts.map +0 -1
- package/dist/dex-adapter.js +0 -407
- package/dist/dex-adapter.js.map +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/quotes.d.ts +0 -12
- package/dist/quotes.d.ts.map +0 -1
- package/dist/quotes.gen.d.ts +0 -8
- package/dist/quotes.gen.d.ts.map +0 -1
- package/dist/quotes.gen.js +0 -2170
- package/dist/quotes.gen.js.map +0 -1
- package/dist/quotes.js +0 -24
- package/dist/quotes.js.map +0 -1
- package/dist/types.d.ts +0 -111
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/src/adapter.ts +0 -20
- package/src/chain.ts +0 -39
- package/src/client.ts +0 -41
- package/src/dex-adapter.ts +0 -477
- package/src/quotes.gen.ts +0 -2170
- package/src/quotes.ts +0 -29
- package/src/types.ts +0 -115
package/dist/adapter.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":""}
|
package/dist/chain.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Chains. The same shapes and string keys the FLOOR site uses, so an id produced here is an id the
|
|
3
|
-
* site understands.
|
|
4
|
-
*/
|
|
5
|
-
export type SolanaCluster = 'mainnet' | 'devnet' | 'testnet' | 'local';
|
|
6
|
-
export type EvmRef = {
|
|
7
|
-
readonly family: 'evm';
|
|
8
|
-
readonly chainId: number;
|
|
9
|
-
};
|
|
10
|
-
export type SolanaRef = {
|
|
11
|
-
readonly family: 'solana';
|
|
12
|
-
readonly cluster: SolanaCluster;
|
|
13
|
-
};
|
|
14
|
-
export type ChainRef = EvmRef | SolanaRef;
|
|
15
|
-
/** `eip155:<chainId>` or `solana:<cluster>` (CAIP-2 style). */
|
|
16
|
-
export type ChainKey = string;
|
|
17
|
-
export declare const evmRef: (chainId: number) => EvmRef;
|
|
18
|
-
export declare const solanaRef: (cluster: SolanaCluster) => SolanaRef;
|
|
19
|
-
export declare function chainKey(ref: ChainRef): ChainKey;
|
|
20
|
-
/** A key → its ref, or `null` for anything malformed. Never coerces. */
|
|
21
|
-
export declare function parseChainKey(key: string): ChainRef | null;
|
|
22
|
-
export declare function sameRef(a: ChainRef, b: ChainRef): boolean;
|
|
23
|
-
//# sourceMappingURL=chain.d.ts.map
|
package/dist/chain.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../src/chain.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AACvE,MAAM,MAAM,MAAM,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAC1E,MAAM,MAAM,SAAS,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAA;CAAE,CAAC;AACvF,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAC1C,+DAA+D;AAC/D,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAM9B,eAAO,MAAM,MAAM,GAAI,SAAS,MAAM,KAAG,MAAsC,CAAC;AAChF,eAAO,MAAM,SAAS,GAAI,SAAS,aAAa,KAAG,SAA4C,CAAC;AAEhG,wBAAgB,QAAQ,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ,CAEhD;AAED,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAW1D;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,CAEzD"}
|
package/dist/chain.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const EVM_KEY = 'eip155:';
|
|
2
|
-
const SOL_KEY = 'solana:';
|
|
3
|
-
const CLUSTERS = ['mainnet', 'devnet', 'testnet', 'local'];
|
|
4
|
-
export const evmRef = (chainId) => ({ family: 'evm', chainId });
|
|
5
|
-
export const solanaRef = (cluster) => ({ family: 'solana', cluster });
|
|
6
|
-
export function chainKey(ref) {
|
|
7
|
-
return ref.family === 'evm' ? `${EVM_KEY}${ref.chainId}` : `${SOL_KEY}${ref.cluster}`;
|
|
8
|
-
}
|
|
9
|
-
/** A key → its ref, or `null` for anything malformed. Never coerces. */
|
|
10
|
-
export function parseChainKey(key) {
|
|
11
|
-
if (key.startsWith(EVM_KEY)) {
|
|
12
|
-
const raw = key.slice(EVM_KEY.length);
|
|
13
|
-
const id = Number(raw);
|
|
14
|
-
return /^[0-9]+$/.test(raw) && Number.isSafeInteger(id) && id > 0 ? evmRef(id) : null;
|
|
15
|
-
}
|
|
16
|
-
if (key.startsWith(SOL_KEY)) {
|
|
17
|
-
const c = key.slice(SOL_KEY.length);
|
|
18
|
-
return CLUSTERS.includes(c) ? solanaRef(c) : null;
|
|
19
|
-
}
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
export function sameRef(a, b) {
|
|
23
|
-
return chainKey(a) === chainKey(b);
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=chain.js.map
|
package/dist/chain.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../src/chain.ts"],"names":[],"mappings":"AAWA,MAAM,OAAO,GAAG,SAAS,CAAC;AAC1B,MAAM,OAAO,GAAG,SAAS,CAAC;AAC1B,MAAM,QAAQ,GAA6B,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAErF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;AAChF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAAsB,EAAa,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;AAEhG,MAAM,UAAU,QAAQ,CAAC,GAAa;IACpC,OAAO,GAAG,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;AACxF,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,IAAI,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACtC,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QACvB,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACxF,CAAC;IACD,IAAI,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAkB,CAAC;QACrD,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACpD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,CAAW,EAAE,CAAW;IAC9C,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC"}
|
package/dist/client.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { type ChainRef } from './chain.js';
|
|
2
|
-
import type { FloorChainAdapter } from './adapter.js';
|
|
3
|
-
import type { Amount, Launch, LaunchRef, Quote, Side, TradeParams, UnsignedTx } from './types.js';
|
|
4
|
-
export declare class FloorSdkError extends Error {
|
|
5
|
-
readonly code: 'no_adapter' | 'bad_params';
|
|
6
|
-
constructor(code: 'no_adapter' | 'bad_params', message: string);
|
|
7
|
-
}
|
|
8
|
-
/** One entry point over any number of chain adapters. It routes each call by the launch's chain. */
|
|
9
|
-
export declare class FloorClient {
|
|
10
|
-
#private;
|
|
11
|
-
constructor(adapters: readonly FloorChainAdapter[]);
|
|
12
|
-
adapterFor(chain: ChainRef): FloorChainAdapter;
|
|
13
|
-
getLaunch(ref: LaunchRef): Promise<Launch>;
|
|
14
|
-
listLaunches(chain: ChainRef, opts?: {
|
|
15
|
-
limit?: number;
|
|
16
|
-
cursor?: string;
|
|
17
|
-
}): Promise<{
|
|
18
|
-
readonly launches: readonly Launch[];
|
|
19
|
-
readonly cursor: string | null;
|
|
20
|
-
}>;
|
|
21
|
-
quote(ref: LaunchRef, side: Side, amountIn: Amount, opts?: {
|
|
22
|
-
readonly trader?: string;
|
|
23
|
-
}): Promise<Quote>;
|
|
24
|
-
buildTrade(params: TradeParams): Promise<UnsignedTx>;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAElG,qBAAa,aAAc,SAAQ,KAAK;IAC1B,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY;gBAAjC,IAAI,EAAE,YAAY,GAAG,YAAY,EAAE,OAAO,EAAE,MAAM;CAIxE;AAED,oGAAoG;AACpG,qBAAa,WAAW;;gBAGV,QAAQ,EAAE,SAAS,iBAAiB,EAAE;IAQlD,UAAU,CAAC,KAAK,EAAE,QAAQ,GAAG,iBAAiB;IAM9C,SAAS,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;IAC1C,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;;;;IACxE,KAAK,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,KAAK,CAAC;IAIxG,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;CAKrD"}
|
package/dist/client.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { chainKey } from './chain.js';
|
|
2
|
-
export class FloorSdkError extends Error {
|
|
3
|
-
code;
|
|
4
|
-
constructor(code, message) {
|
|
5
|
-
super(message);
|
|
6
|
-
this.code = code;
|
|
7
|
-
this.name = 'FloorSdkError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
/** One entry point over any number of chain adapters. It routes each call by the launch's chain. */
|
|
11
|
-
export class FloorClient {
|
|
12
|
-
#byChain = new Map();
|
|
13
|
-
constructor(adapters) {
|
|
14
|
-
for (const a of adapters)
|
|
15
|
-
for (const c of a.chains) {
|
|
16
|
-
const k = chainKey(c);
|
|
17
|
-
if (this.#byChain.has(k))
|
|
18
|
-
throw new FloorSdkError('bad_params', `two adapters serve ${k}`);
|
|
19
|
-
this.#byChain.set(k, a);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
adapterFor(chain) {
|
|
23
|
-
const a = this.#byChain.get(chainKey(chain));
|
|
24
|
-
if (!a)
|
|
25
|
-
throw new FloorSdkError('no_adapter', `no adapter serves ${chainKey(chain)}`);
|
|
26
|
-
return a;
|
|
27
|
-
}
|
|
28
|
-
getLaunch(ref) { return this.adapterFor(ref.chain).getLaunch(ref); }
|
|
29
|
-
listLaunches(chain, opts) { return this.adapterFor(chain).listLaunches(chain, opts); }
|
|
30
|
-
quote(ref, side, amountIn, opts) {
|
|
31
|
-
if (amountIn <= 0n)
|
|
32
|
-
throw new FloorSdkError('bad_params', 'amountIn must be > 0');
|
|
33
|
-
return this.adapterFor(ref.chain).quote(ref, side, amountIn, opts);
|
|
34
|
-
}
|
|
35
|
-
buildTrade(params) {
|
|
36
|
-
if (params.amountIn <= 0n)
|
|
37
|
-
throw new FloorSdkError('bad_params', 'amountIn must be > 0');
|
|
38
|
-
if (params.minAmountOut <= 0n)
|
|
39
|
-
throw new FloorSdkError('bad_params', 'minAmountOut must be > 0');
|
|
40
|
-
return this.adapterFor(params.launch.chain).buildTrade(params);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AAIrD,MAAM,OAAO,aAAc,SAAQ,KAAK;IACjB;IAArB,YAAqB,IAAiC,EAAE,OAAe;QACrE,KAAK,CAAC,OAAO,CAAC,CAAC;QADI,SAAI,GAAJ,IAAI,CAA6B;QAEpD,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAED,oGAAoG;AACpG,MAAM,OAAO,WAAW;IACb,QAAQ,GAAG,IAAI,GAAG,EAA6B,CAAC;IAEzD,YAAY,QAAsC;QAChD,KAAK,MAAM,CAAC,IAAI,QAAQ;YAAE,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;gBACnD,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;gBACtB,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;oBAAE,MAAM,IAAI,aAAa,CAAC,YAAY,EAAE,sBAAsB,CAAC,EAAE,CAAC,CAAC;gBAC3F,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC1B,CAAC;IACH,CAAC;IAED,UAAU,CAAC,KAAe;QACxB,MAAM,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7C,IAAI,CAAC,CAAC;YAAE,MAAM,IAAI,aAAa,CAAC,YAAY,EAAE,qBAAqB,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACtF,OAAO,CAAC,CAAC;IACX,CAAC;IAED,SAAS,CAAC,GAAc,IAAqB,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAChG,YAAY,CAAC,KAAe,EAAE,IAA0C,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACtI,KAAK,CAAC,GAAc,EAAE,IAAU,EAAE,QAAgB,EAAE,IAAmC;QACrF,IAAI,QAAQ,IAAI,EAAE;YAAE,MAAM,IAAI,aAAa,CAAC,YAAY,EAAE,sBAAsB,CAAC,CAAC;QAClF,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;IACrE,CAAC;IACD,UAAU,CAAC,MAAmB;QAC5B,IAAI,MAAM,CAAC,QAAQ,IAAI,EAAE;YAAE,MAAM,IAAI,aAAa,CAAC,YAAY,EAAE,sBAAsB,CAAC,CAAC;QACzF,IAAI,MAAM,CAAC,YAAY,IAAI,EAAE;YAAE,MAAM,IAAI,aAAa,CAAC,YAAY,EAAE,0BAA0B,CAAC,CAAC;QACjG,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACjE,CAAC;CACF"}
|
package/dist/dex-adapter.d.ts
DELETED
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The DEX adapter's pure mapping: FLOOR's indexed trades (the indexer's chain-wide `/events` rows) as GeckoTerminal's
|
|
3
|
-
* "Integration API Standards v0.1" events, which DEX Screener reads too. No network and no environment: every function is
|
|
4
|
-
* pure, so an indexer of its own can use the same pair model and answer the same numbers as FLOOR's `/api/dex`.
|
|
5
|
-
*
|
|
6
|
-
* - An invalid answer halts a screener's indexing, so nothing here guesses. Amounts are exact decimal strings of the raw
|
|
7
|
-
* units (`decimalize`), a price is an exact bigint ratio to `PRICE_SIG` significant digits (`ratioString`), never a
|
|
8
|
-
* float, and an event that cannot be stated exactly (a zero amount, a zero price) is dropped by `mapEvents` and
|
|
9
|
-
* counted, never served as a guess.
|
|
10
|
-
* - A pair is immutable: asset0 is always the launch token and asset1 always the quote (the native coin is the zero
|
|
11
|
-
* address, as in a v4 currency0). A swap is exactly `asset0In + asset1Out` (a sell) or `asset1In + asset0Out` (a buy).
|
|
12
|
-
* - Two pairs per launch: the sale (its id the FloorLaunch address; every sale fill) and, once graduated, the pool (its id
|
|
13
|
-
* the v4 pool id on EVM, the Carpenter pool account on Solana; every pool trade and liquidity change).
|
|
14
|
-
*/
|
|
15
|
-
/** A price's significant digits: past a uint256 sqrt's own precision is noise; under it, a rounding a reader can see. */
|
|
16
|
-
export declare const PRICE_SIG = 18;
|
|
17
|
-
/** `raw / 10^decimals`, exact: `1500000` at 6 → `1.5`; no exponent, no trailing zeros, `0` for zero. */
|
|
18
|
-
export declare function decimalize(raw: bigint, decimals: number): string;
|
|
19
|
-
/** `num / den` (both positive) to `sig` significant digits, truncated, as an exact decimal string; `null` when not positive. */
|
|
20
|
-
export declare function ratioString(num: bigint, den: bigint, sig?: number): string | null;
|
|
21
|
-
/** The token's price in its quote, decimalized, from a square-root price (currency1 per currency0, raw units): a v4
|
|
22
|
-
* `sqrtPriceX96` (`bits` 96, the default) or a Carpenter `sqrtPriceX64` (`bits` 64 — Q64.64, never through the X96 scale). */
|
|
23
|
-
export declare function priceFromSqrt(sqrtPriceX96: bigint, quoteIsCurrency1: boolean, tokenDecimals: number, quoteDecimals: number, bits?: 96 | 64): string | null;
|
|
24
|
-
/** Raw amounts in the POOL's currency order (currency0, currency1) — oriented to (token, quote) by `mapEvents` alone. */
|
|
25
|
-
export type Pair01 = readonly [bigint, bigint];
|
|
26
|
-
/**
|
|
27
|
-
* A trade's fees in the POOL's currency order, raw (GeckoTerminal's `fees0In` / `fees1In` / `fees0Out` /
|
|
28
|
-
* `fees1Out`): `in` taken from what the trader paid in before the curve, `out` from what the curve paid out.
|
|
29
|
-
*/
|
|
30
|
-
export interface Fees01 {
|
|
31
|
-
in0: bigint;
|
|
32
|
-
in1: bigint;
|
|
33
|
-
out0: bigint;
|
|
34
|
-
out1: bigint;
|
|
35
|
-
}
|
|
36
|
-
/** One pool trade off the indexer's `/events` (`swapJson` + `txIndex`), the fields this adapter reads. */
|
|
37
|
-
export interface IxSwap {
|
|
38
|
-
blockNumber: number;
|
|
39
|
-
logIndex: number;
|
|
40
|
-
txIndex: number;
|
|
41
|
-
txHash: string;
|
|
42
|
-
timestamp: number;
|
|
43
|
-
token: string;
|
|
44
|
-
side: 'buy' | 'sell';
|
|
45
|
-
quoteAmount: bigint;
|
|
46
|
-
tokenAmount: bigint;
|
|
47
|
-
quoteIsCurrency1: boolean;
|
|
48
|
-
sqrtPriceX96: bigint;
|
|
49
|
-
trader: string | null;
|
|
50
|
-
txFrom: string;
|
|
51
|
-
/** The square root's width: 96 (EVM, the default) or 64 (Carpenter's Q64.64). */
|
|
52
|
-
sqrtBits?: 96 | 64;
|
|
53
|
-
/** The POOL the trade ran on — the v4 PoolId (EVM, lower-case) or the Carpenter pool
|
|
54
|
-
* account (Solana) — held to the launch's own (`PairInfo.poolPairId`). */
|
|
55
|
-
pool?: string;
|
|
56
|
-
/** THE RESERVES after the trade, currency order, raw; `null` = unknown (left out, never 0). EVM: the in-range
|
|
57
|
-
* VIRTUAL reserves off the `Swap` log's own `liquidity` and `sqrtPriceX96` (`virtualReserves`); Solana: the pool's two
|
|
58
|
-
* VAULTS after the transaction. */
|
|
59
|
-
reserves01?: Pair01 | null;
|
|
60
|
-
/** The trade's fees, currency order; `null` = not stateable exactly (left out). */
|
|
61
|
-
fees01?: Fees01 | null;
|
|
62
|
-
}
|
|
63
|
-
/** One sale fill off the indexer's `/events` (`saleFillJson` + `txIndex`, `launch`, `token`, the running totals). */
|
|
64
|
-
export interface IxFill {
|
|
65
|
-
blockNumber: number;
|
|
66
|
-
logIndex: number;
|
|
67
|
-
txIndex: number;
|
|
68
|
-
txHash: string;
|
|
69
|
-
timestamp: number;
|
|
70
|
-
launch: string;
|
|
71
|
-
token: string;
|
|
72
|
-
side: 'buy' | 'sell';
|
|
73
|
-
quoteAmount: bigint;
|
|
74
|
-
tokenAmount: bigint;
|
|
75
|
-
trader: string;
|
|
76
|
-
soldTotal: bigint;
|
|
77
|
-
raisedTotal: bigint;
|
|
78
|
-
/** The fill's FLOOR Platform fee, raw quote — on TOP of a buy's price (taken from what the buyer paid in),
|
|
79
|
-
* OUT of a sell-back's gross (taken from what the sale paid out). `null` = not read. */
|
|
80
|
-
fee?: bigint | null;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* One POOL liquidity change (the DEX adapter's `join` / `exit`): a position opened, grown, shrunk or
|
|
84
|
-
* closed — the HOOK's own positions included (protocol liquidity is the pool's liquidity) — or a donation. Amounts are the
|
|
85
|
-
* PRINCIPAL the change moved, currency order, raw, unsigned; `null` = not stated (the event is dropped and counted).
|
|
86
|
-
*/
|
|
87
|
-
export interface IxLiquidity {
|
|
88
|
-
blockNumber: number;
|
|
89
|
-
logIndex: number;
|
|
90
|
-
txIndex: number;
|
|
91
|
-
txHash: string;
|
|
92
|
-
timestamp: number;
|
|
93
|
-
token: string;
|
|
94
|
-
pool: string;
|
|
95
|
-
kind: 'join' | 'exit';
|
|
96
|
-
amount01: Pair01 | null;
|
|
97
|
-
maker: string;
|
|
98
|
-
/** The pool's reserves after the change (`IxSwap.reserves01`' rule per family); `null` unknown. */
|
|
99
|
-
reserves01: Pair01 | null;
|
|
100
|
-
/** The pool's orientation where the row carries it (EVM); Solana's comes from `PairInfo`. */
|
|
101
|
-
quoteIsCurrency1?: boolean;
|
|
102
|
-
}
|
|
103
|
-
/** What a launch's pairs need, keyed by its token (lower-cased): present only for a launch that is shown (default-deny). */
|
|
104
|
-
export interface PairInfo {
|
|
105
|
-
/** The sale pair's id (the FloorLaunch address, as served). */
|
|
106
|
-
saleId: string;
|
|
107
|
-
/** The pool pair's id, `null` before graduation: the v4 POOL ID (EVM, lower-case 0x + 64 hex) or the Carpenter POOL
|
|
108
|
-
* account (Solana, base58). */
|
|
109
|
-
poolPairId: string | null;
|
|
110
|
-
tokenDecimals: number;
|
|
111
|
-
quoteDecimals: number;
|
|
112
|
-
saleTokens: bigint;
|
|
113
|
-
/** The pool's orientation where the swap row does not carry it (Solana: off the pool's own mints). */
|
|
114
|
-
quoteIsCurrency1?: boolean;
|
|
115
|
-
}
|
|
116
|
-
export type FeeMetadata = {
|
|
117
|
-
fees0In?: string;
|
|
118
|
-
fees1In?: string;
|
|
119
|
-
fees0Out?: string;
|
|
120
|
-
fees1Out?: string;
|
|
121
|
-
};
|
|
122
|
-
export interface DexSwapEvent {
|
|
123
|
-
block: {
|
|
124
|
-
blockNumber: number;
|
|
125
|
-
blockTimestamp: number;
|
|
126
|
-
};
|
|
127
|
-
eventType: 'swap';
|
|
128
|
-
txnId: string;
|
|
129
|
-
txnIndex: number;
|
|
130
|
-
eventIndex: number;
|
|
131
|
-
maker: string;
|
|
132
|
-
pairId: string;
|
|
133
|
-
asset0In?: string;
|
|
134
|
-
asset1In?: string;
|
|
135
|
-
asset0Out?: string;
|
|
136
|
-
asset1Out?: string;
|
|
137
|
-
priceNative: string;
|
|
138
|
-
reserves?: {
|
|
139
|
-
asset0: string;
|
|
140
|
-
asset1: string;
|
|
141
|
-
};
|
|
142
|
-
/** GeckoTerminal's per-swap fees, decimalized, each leg only where non-zero; the key only where one is. */
|
|
143
|
-
metadata?: FeeMetadata;
|
|
144
|
-
}
|
|
145
|
-
/** GeckoTerminal's `JoinExitEvent`: `amount0` the token, `amount1` the quote, decimalized. */
|
|
146
|
-
export interface DexJoinExitEvent {
|
|
147
|
-
block: {
|
|
148
|
-
blockNumber: number;
|
|
149
|
-
blockTimestamp: number;
|
|
150
|
-
};
|
|
151
|
-
eventType: 'join' | 'exit';
|
|
152
|
-
txnId: string;
|
|
153
|
-
txnIndex: number;
|
|
154
|
-
eventIndex: number;
|
|
155
|
-
maker: string;
|
|
156
|
-
pairId: string;
|
|
157
|
-
amount0: string;
|
|
158
|
-
amount1: string;
|
|
159
|
-
reserves?: {
|
|
160
|
-
asset0: string;
|
|
161
|
-
asset1: string;
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
export type DexEvent = DexSwapEvent | DexJoinExitEvent;
|
|
165
|
-
/** Is `e` exactly one of the two swap shapes, every amount positive and the price positive? */
|
|
166
|
-
export declare function isSwapShape(e: DexEvent): boolean;
|
|
167
|
-
/** Is `e` a join / exit with both amounts stated and at least one positive (a fee-only poke moves no principal)? */
|
|
168
|
-
export declare function isJoinExitShape(e: DexEvent): boolean;
|
|
169
|
-
/**
|
|
170
|
-
* A v4 / Carpenter pool's IN-RANGE VIRTUAL reserves, currency order, raw: `L / √P` and `L · √P` with √P in
|
|
171
|
-
* Q64.96 (`bits` 96) or Q64.64 (`bits` 64), rounded down — the amounts a constant-product pool of the same liquidity would
|
|
172
|
-
* hold at this price (their ratio IS the price). `null` for a zero liquidity or price (nothing to state).
|
|
173
|
-
*/
|
|
174
|
-
export declare function virtualReserves(liquidity: bigint, sqrtPrice: bigint, bits?: 96 | 64): Pair01 | null;
|
|
175
|
-
/**
|
|
176
|
-
* The events of one block range, sorted by (block, txnIndex, eventIndex). `info(token)` answers a SHOWN launch's pair info,
|
|
177
|
-
* `undefined` for one that is not shown — its events are left out (default-deny), as the grid leaves it out. An event
|
|
178
|
-
* that cannot be stated exactly is dropped and counted in `dropped`.
|
|
179
|
-
*/
|
|
180
|
-
export declare function mapEvents(swaps: readonly IxSwap[], fills: readonly IxFill[], info: (token: string) => PairInfo | undefined, key?: (id: string) => string, liquidity?: readonly IxLiquidity[]): {
|
|
181
|
-
events: DexEvent[];
|
|
182
|
-
dropped: number;
|
|
183
|
-
};
|
|
184
|
-
/**
|
|
185
|
-
* An EVM trade's fees, currency order: the hook's whole take (`hookFee`, its paired `HookFee` log — always the
|
|
186
|
-
* QUOTE leg: a buy's off the quote IN, a sell's off the quote OUT). The pool's own LP fee is
|
|
187
|
-
* 0 on a FLOOR pool (the hook's dynamic-fee override); a `Swap` that logs a non-zero `fee` (pips) states no exact LP amount,
|
|
188
|
-
* so its fees are `null` (left out), never a guess.
|
|
189
|
-
*/
|
|
190
|
-
export declare function evmFees(side: 'buy' | 'sell', quoteIsCurrency1: boolean, hookFee: bigint, lpFeePips: number): Fees01 | null;
|
|
191
|
-
/** The indexer's `/events` body, decoded; a row that breaks the contract throws (the whole answer is refused, never part). */
|
|
192
|
-
export declare function decodeEventsBody(body: unknown): {
|
|
193
|
-
swaps: IxSwap[];
|
|
194
|
-
fills: IxFill[];
|
|
195
|
-
liquidity: IxLiquidity[];
|
|
196
|
-
};
|
|
197
|
-
/** Split `[from, to]` into two halves (a busy range the indexer refused); `null` for a single block, which cannot split. */
|
|
198
|
-
export declare function halves(from: number, to: number): [[number, number], [number, number]] | null;
|
|
199
|
-
/**
|
|
200
|
-
* A Carpenter trade's fees, currency order, every part the `Swapped` event carries: the hook's five-part split per
|
|
201
|
-
* currency (`feeSplit0` / `feeSplit1`: skim, creator, holder, platform, team), the Carpenter Platform fee
|
|
202
|
-
* (`protocolFeeTotal` in `protocolFeeCurrency`) and the LPs' fee (`lpFeeTotal`, in the INPUT currency). A fee in the trade's
|
|
203
|
-
* input currency is `in`, in its output currency `out`. `null` where the split is not known (`feeSplitKnown` false): never a
|
|
204
|
-
* partial figure.
|
|
205
|
-
*/
|
|
206
|
-
export declare function solanaFees(r: Record<string, unknown>): Fees01 | null;
|
|
207
|
-
/**
|
|
208
|
-
* Carpenter's `GET /chains/:c/events?fromSlot&toSlot` into the
|
|
209
|
-
* SAME rows the EVM body decodes to, so one mapper states both: the slot is the block, `innerIxIndex` the event index, the
|
|
210
|
-
* signature the transaction id, every id BYTE-EXACT (base58 — never lower-cased); the swap's price is the TRADE's own,
|
|
211
|
-
* `walkSqrtPriceX64 ?? postSqrtPriceX64` (Q64.64, `sqrtBits` 64: where the trader's walk landed,
|
|
212
|
-
* before the hook's nudge moved the pool, as the EVM row's own `Swap` price is; `null` / absent walk = a swap before the
|
|
213
|
-
* upgrade, and only then `post`), its orientation the pool's own (`PairInfo.quoteIsCurrency1`, the row carries none). A range with
|
|
214
|
-
* `undecidedSwaps` above 0 is NOT final (a pool not read yet): the caller serves nothing, never a partial page.
|
|
215
|
-
* every swap carries the pool's two VAULTS after the transaction (`reserve0` /
|
|
216
|
-
* `reserve1`, `null` unknown) and its fees (`solanaFees`); `liquidity` (`LiquidityModified`: a positive delta a join, a
|
|
217
|
-
* negative an exit, a zero-delta poke left out; the principal `|amount − fees|` per currency — the event's caller delta less
|
|
218
|
-
* the fees it also paid) and `donations` (`Donated`, a join) ride beside, the maker the event's `owner` / `donor`.
|
|
219
|
-
*/
|
|
220
|
-
export declare function decodeSolanaEventsBody(body: unknown): {
|
|
221
|
-
swaps: IxSwap[];
|
|
222
|
-
fills: IxFill[];
|
|
223
|
-
liquidity: IxLiquidity[];
|
|
224
|
-
undecided: number;
|
|
225
|
-
};
|
|
226
|
-
/** Carpenter's widest range (`span` past it is its 400): the Solana `/events` walk reads windows of this many slots. */
|
|
227
|
-
export declare const SOLANA_EVENTS_SPAN = 2000;
|
|
228
|
-
//# sourceMappingURL=dex-adapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dex-adapter.d.ts","sourceRoot":"","sources":["../src/dex-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,yHAAyH;AACzH,eAAO,MAAM,SAAS,KAAK,CAAC;AAE5B,wGAAwG;AACxG,wBAAgB,UAA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