outsmart 2.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +568 -0
- package/dist/cli.d.ts +44 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +1251 -0
- package/dist/cli.js.map +1 -0
- package/dist/dex/byreal-clmm.d.ts +16 -0
- package/dist/dex/byreal-clmm.d.ts.map +1 -0
- package/dist/dex/byreal-clmm.js +39 -0
- package/dist/dex/byreal-clmm.js.map +1 -0
- package/dist/dex/dflow.d.ts +27 -0
- package/dist/dex/dflow.d.ts.map +1 -0
- package/dist/dex/dflow.js +200 -0
- package/dist/dex/dflow.js.map +1 -0
- package/dist/dex/fusion-amm.d.ts +44 -0
- package/dist/dex/fusion-amm.d.ts.map +1 -0
- package/dist/dex/fusion-amm.js +546 -0
- package/dist/dex/fusion-amm.js.map +1 -0
- package/dist/dex/futarchy-amm.d.ts +32 -0
- package/dist/dex/futarchy-amm.d.ts.map +1 -0
- package/dist/dex/futarchy-amm.js +443 -0
- package/dist/dex/futarchy-amm.js.map +1 -0
- package/dist/dex/futarchy-idl.d.ts +2568 -0
- package/dist/dex/futarchy-idl.d.ts.map +1 -0
- package/dist/dex/futarchy-idl.js +2570 -0
- package/dist/dex/futarchy-idl.js.map +1 -0
- package/dist/dex/futarchy-launchpad.d.ts +68 -0
- package/dist/dex/futarchy-launchpad.d.ts.map +1 -0
- package/dist/dex/futarchy-launchpad.js +377 -0
- package/dist/dex/futarchy-launchpad.js.map +1 -0
- package/dist/dex/index.d.ts +88 -0
- package/dist/dex/index.d.ts.map +1 -0
- package/dist/dex/index.js +159 -0
- package/dist/dex/index.js.map +1 -0
- package/dist/dex/jupiter-ultra.d.ts +27 -0
- package/dist/dex/jupiter-ultra.d.ts.map +1 -0
- package/dist/dex/jupiter-ultra.js +369 -0
- package/dist/dex/jupiter-ultra.js.map +1 -0
- package/dist/dex/meteora-damm-v1.d.ts +36 -0
- package/dist/dex/meteora-damm-v1.d.ts.map +1 -0
- package/dist/dex/meteora-damm-v1.js +314 -0
- package/dist/dex/meteora-damm-v1.js.map +1 -0
- package/dist/dex/meteora-damm-v2.d.ts +103 -0
- package/dist/dex/meteora-damm-v2.d.ts.map +1 -0
- package/dist/dex/meteora-damm-v2.js +1146 -0
- package/dist/dex/meteora-damm-v2.js.map +1 -0
- package/dist/dex/meteora-dbc.d.ts +38 -0
- package/dist/dex/meteora-dbc.d.ts.map +1 -0
- package/dist/dex/meteora-dbc.js +374 -0
- package/dist/dex/meteora-dbc.js.map +1 -0
- package/dist/dex/meteora-dlmm.d.ts +79 -0
- package/dist/dex/meteora-dlmm.d.ts.map +1 -0
- package/dist/dex/meteora-dlmm.js +735 -0
- package/dist/dex/meteora-dlmm.js.map +1 -0
- package/dist/dex/orca.d.ts +31 -0
- package/dist/dex/orca.d.ts.map +1 -0
- package/dist/dex/orca.js +536 -0
- package/dist/dex/orca.js.map +1 -0
- package/dist/dex/pancakeswap-clmm.d.ts +16 -0
- package/dist/dex/pancakeswap-clmm.d.ts.map +1 -0
- package/dist/dex/pancakeswap-clmm.js +39 -0
- package/dist/dex/pancakeswap-clmm.js.map +1 -0
- package/dist/dex/pumpfun-amm.d.ts +46 -0
- package/dist/dex/pumpfun-amm.d.ts.map +1 -0
- package/dist/dex/pumpfun-amm.js +692 -0
- package/dist/dex/pumpfun-amm.js.map +1 -0
- package/dist/dex/pumpfun.d.ts +41 -0
- package/dist/dex/pumpfun.d.ts.map +1 -0
- package/dist/dex/pumpfun.js +555 -0
- package/dist/dex/pumpfun.js.map +1 -0
- package/dist/dex/raydium-amm-v4.d.ts +11 -0
- package/dist/dex/raydium-amm-v4.d.ts.map +1 -0
- package/dist/dex/raydium-amm-v4.js +649 -0
- package/dist/dex/raydium-amm-v4.js.map +1 -0
- package/dist/dex/raydium-clmm.d.ts +12 -0
- package/dist/dex/raydium-clmm.d.ts.map +1 -0
- package/dist/dex/raydium-clmm.js +675 -0
- package/dist/dex/raydium-clmm.js.map +1 -0
- package/dist/dex/raydium-cpmm.d.ts +10 -0
- package/dist/dex/raydium-cpmm.d.ts.map +1 -0
- package/dist/dex/raydium-cpmm.js +613 -0
- package/dist/dex/raydium-cpmm.js.map +1 -0
- package/dist/dex/raydium-launchlab.d.ts +12 -0
- package/dist/dex/raydium-launchlab.d.ts.map +1 -0
- package/dist/dex/raydium-launchlab.js +530 -0
- package/dist/dex/raydium-launchlab.js.map +1 -0
- package/dist/dex/shared/clmm-base.d.ts +58 -0
- package/dist/dex/shared/clmm-base.d.ts.map +1 -0
- package/dist/dex/shared/clmm-base.js +891 -0
- package/dist/dex/shared/clmm-base.js.map +1 -0
- package/dist/dex/types.d.ts +601 -0
- package/dist/dex/types.d.ts.map +1 -0
- package/dist/dex/types.js +137 -0
- package/dist/dex/types.js.map +1 -0
- package/dist/dexscreener/index.d.ts +2 -0
- package/dist/dexscreener/index.d.ts.map +1 -0
- package/dist/dexscreener/index.js +18 -0
- package/dist/dexscreener/index.js.map +1 -0
- package/dist/dexscreener/info.d.ts +22 -0
- package/dist/dexscreener/info.d.ts.map +1 -0
- package/dist/dexscreener/info.js +104 -0
- package/dist/dexscreener/info.js.map +1 -0
- package/dist/helpers/check_balance.d.ts +10 -0
- package/dist/helpers/check_balance.d.ts.map +1 -0
- package/dist/helpers/check_balance.js +34 -0
- package/dist/helpers/check_balance.js.map +1 -0
- package/dist/helpers/config.d.ts +51 -0
- package/dist/helpers/config.d.ts.map +1 -0
- package/dist/helpers/config.js +118 -0
- package/dist/helpers/config.js.map +1 -0
- package/dist/helpers/index.d.ts +8 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +29 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/logger.d.ts +27 -0
- package/dist/helpers/logger.d.ts.map +1 -0
- package/dist/helpers/logger.js +39 -0
- package/dist/helpers/logger.js.map +1 -0
- package/dist/helpers/token-2022.d.ts +32 -0
- package/dist/helpers/token-2022.d.ts.map +1 -0
- package/dist/helpers/token-2022.js +48 -0
- package/dist/helpers/token-2022.js.map +1 -0
- package/dist/helpers/unwrap_sol.d.ts +2 -0
- package/dist/helpers/unwrap_sol.d.ts.map +1 -0
- package/dist/helpers/unwrap_sol.js +67 -0
- package/dist/helpers/unwrap_sol.js.map +1 -0
- package/dist/helpers/util.d.ts +698 -0
- package/dist/helpers/util.d.ts.map +1 -0
- package/dist/helpers/util.js +181 -0
- package/dist/helpers/util.js.map +1 -0
- package/dist/helpers/utils.d.ts +10 -0
- package/dist/helpers/utils.d.ts.map +1 -0
- package/dist/helpers/utils.js +97 -0
- package/dist/helpers/utils.js.map +1 -0
- package/dist/helpers/wrap_sol.d.ts +3 -0
- package/dist/helpers/wrap_sol.d.ts.map +1 -0
- package/dist/helpers/wrap_sol.js +88 -0
- package/dist/helpers/wrap_sol.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/transactions/bloXroute_tips_tx_executor.d.ts +4 -0
- package/dist/transactions/bloXroute_tips_tx_executor.d.ts.map +1 -0
- package/dist/transactions/bloXroute_tips_tx_executor.js +70 -0
- package/dist/transactions/bloXroute_tips_tx_executor.js.map +1 -0
- package/dist/transactions/index.d.ts +6 -0
- package/dist/transactions/index.d.ts.map +1 -0
- package/dist/transactions/index.js +30 -0
- package/dist/transactions/index.js.map +1 -0
- package/dist/transactions/jito_tips_tx_executor.d.ts +15 -0
- package/dist/transactions/jito_tips_tx_executor.d.ts.map +1 -0
- package/dist/transactions/jito_tips_tx_executor.js +99 -0
- package/dist/transactions/jito_tips_tx_executor.js.map +1 -0
- package/dist/transactions/landing/index.d.ts +30 -0
- package/dist/transactions/landing/index.d.ts.map +1 -0
- package/dist/transactions/landing/index.js +60 -0
- package/dist/transactions/landing/index.js.map +1 -0
- package/dist/transactions/landing/nonce-manager.d.ts +116 -0
- package/dist/transactions/landing/nonce-manager.d.ts.map +1 -0
- package/dist/transactions/landing/nonce-manager.js +393 -0
- package/dist/transactions/landing/nonce-manager.js.map +1 -0
- package/dist/transactions/landing/orchestrator.d.ts +104 -0
- package/dist/transactions/landing/orchestrator.d.ts.map +1 -0
- package/dist/transactions/landing/orchestrator.js +329 -0
- package/dist/transactions/landing/orchestrator.js.map +1 -0
- package/dist/transactions/landing/providers/astralane.d.ts +12 -0
- package/dist/transactions/landing/providers/astralane.d.ts.map +1 -0
- package/dist/transactions/landing/providers/astralane.js +132 -0
- package/dist/transactions/landing/providers/astralane.js.map +1 -0
- package/dist/transactions/landing/providers/blockrazor.d.ts +11 -0
- package/dist/transactions/landing/providers/blockrazor.d.ts.map +1 -0
- package/dist/transactions/landing/providers/blockrazor.js +134 -0
- package/dist/transactions/landing/providers/blockrazor.js.map +1 -0
- package/dist/transactions/landing/providers/bloxroute.d.ts +12 -0
- package/dist/transactions/landing/providers/bloxroute.d.ts.map +1 -0
- package/dist/transactions/landing/providers/bloxroute.js +102 -0
- package/dist/transactions/landing/providers/bloxroute.js.map +1 -0
- package/dist/transactions/landing/providers/flashblock.d.ts +10 -0
- package/dist/transactions/landing/providers/flashblock.d.ts.map +1 -0
- package/dist/transactions/landing/providers/flashblock.js +102 -0
- package/dist/transactions/landing/providers/flashblock.js.map +1 -0
- package/dist/transactions/landing/providers/helius-sender.d.ts +11 -0
- package/dist/transactions/landing/providers/helius-sender.d.ts.map +1 -0
- package/dist/transactions/landing/providers/helius-sender.js +101 -0
- package/dist/transactions/landing/providers/helius-sender.js.map +1 -0
- package/dist/transactions/landing/providers/jito.d.ts +16 -0
- package/dist/transactions/landing/providers/jito.d.ts.map +1 -0
- package/dist/transactions/landing/providers/jito.js +110 -0
- package/dist/transactions/landing/providers/jito.js.map +1 -0
- package/dist/transactions/landing/providers/nextblock.d.ts +11 -0
- package/dist/transactions/landing/providers/nextblock.d.ts.map +1 -0
- package/dist/transactions/landing/providers/nextblock.js +109 -0
- package/dist/transactions/landing/providers/nextblock.js.map +1 -0
- package/dist/transactions/landing/providers/node1.d.ts +11 -0
- package/dist/transactions/landing/providers/node1.d.ts.map +1 -0
- package/dist/transactions/landing/providers/node1.js +101 -0
- package/dist/transactions/landing/providers/node1.js.map +1 -0
- package/dist/transactions/landing/providers/nozomi.d.ts +11 -0
- package/dist/transactions/landing/providers/nozomi.d.ts.map +1 -0
- package/dist/transactions/landing/providers/nozomi.js +124 -0
- package/dist/transactions/landing/providers/nozomi.js.map +1 -0
- package/dist/transactions/landing/providers/soyas.d.ts +16 -0
- package/dist/transactions/landing/providers/soyas.d.ts.map +1 -0
- package/dist/transactions/landing/providers/soyas.js +192 -0
- package/dist/transactions/landing/providers/soyas.js.map +1 -0
- package/dist/transactions/landing/providers/stellium.d.ts +11 -0
- package/dist/transactions/landing/providers/stellium.d.ts.map +1 -0
- package/dist/transactions/landing/providers/stellium.js +102 -0
- package/dist/transactions/landing/providers/stellium.js.map +1 -0
- package/dist/transactions/landing/providers/zero-slot.d.ts +10 -0
- package/dist/transactions/landing/providers/zero-slot.d.ts.map +1 -0
- package/dist/transactions/landing/providers/zero-slot.js +92 -0
- package/dist/transactions/landing/providers/zero-slot.js.map +1 -0
- package/dist/transactions/landing/tip-accounts.d.ts +22 -0
- package/dist/transactions/landing/tip-accounts.d.ts.map +1 -0
- package/dist/transactions/landing/tip-accounts.js +140 -0
- package/dist/transactions/landing/tip-accounts.js.map +1 -0
- package/dist/transactions/landing/types.d.ts +98 -0
- package/dist/transactions/landing/types.d.ts.map +1 -0
- package/dist/transactions/landing/types.js +30 -0
- package/dist/transactions/landing/types.js.map +1 -0
- package/dist/transactions/nozomi/tx-submission.d.ts +14 -0
- package/dist/transactions/nozomi/tx-submission.d.ts.map +1 -0
- package/dist/transactions/nozomi/tx-submission.js +107 -0
- package/dist/transactions/nozomi/tx-submission.js.map +1 -0
- package/dist/transactions/send-rpc.d.ts +54 -0
- package/dist/transactions/send-rpc.d.ts.map +1 -0
- package/dist/transactions/send-rpc.js +126 -0
- package/dist/transactions/send-rpc.js.map +1 -0
- package/dist/transactions/simple_tx_executor.d.ts +10 -0
- package/dist/transactions/simple_tx_executor.d.ts.map +1 -0
- package/dist/transactions/simple_tx_executor.js +33 -0
- package/dist/transactions/simple_tx_executor.js.map +1 -0
- package/package.json +112 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blockrazor.js","sourceRoot":"","sources":["../../../../src/transactions/landing/providers/blockrazor.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;AAkKM,wCAAc;AAhKvB,kDAA6C;AAC7C,gDAAwB;AACxB,kDAA0B;AAC1B,6CAQyB;AACzB,oCAMkB;AAElB,8EAA8E;AAC9E,SAAS;AACT,8EAA8E;AAE9E,MAAM,YAAY,GAAG;IACnB,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;CACtC,CAAC;AAEX,MAAM,eAAe,GAAG,KAAK,CAAC;AAC9B,MAAM,QAAQ,GAAG,4CAA4C,CAAC;AAE9D,8EAA8E;AAC9E,yCAAyC;AACzC,8EAA8E;AAE9E,IAAI,OAAO,GAAyB,IAAI,CAAC;AAEzC,SAAS,SAAS,CAAC,MAAc;IAC/B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,GAAG,eAAK,CAAC,MAAM,CAAC;YACrB,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,MAAM;YACf,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,MAAM,EAAE,MAAM;aACf;YACD,SAAS,EAAE,IAAI,cAAI,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;YAC9C,UAAU,EAAE,IAAI,eAAK,CAAC,KAAK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MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;gBAC3B,MAAM,SAAS,GAAuB,IAAI,EAAE,SAAS,IAAI,IAAI,EAAE,MAAM,CAAC;gBACtE,IAAI,SAAS,EAAE,CAAC;oBACd,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;gBAC5D,CAAC;gBAED,+CAA+C;gBAC/C,IAAI,IAAI,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,EAAE,MAAM,KAAK,IAAI,EAAE,CAAC;oBACpD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;gBACjD,CAAC;gBAED,MAAM,MAAM,GAAG,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,OAAO,IAAI,0BAA0B,CAAC;gBAC1E,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;YACzE,CAAC;YAAC,OAAO,GAAQ,EAAE,CAAC;gBAClB,OAAO;oBACL,QAAQ;oBACR,QAAQ,EAAE,KAAK;oBACf,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,IAAI,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,IAAI,GAAG,EAAE,OAAO,IAAI,2BAA2B;iBACjH,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* bloXroute TX Landing Provider
|
|
3
|
+
*
|
|
4
|
+
* Submits transactions via the bloXroute Solana Trader SDK (HttpProvider).
|
|
5
|
+
* Uses legacy Transaction (not VersionedTransaction) because the SDK's
|
|
6
|
+
* postSubmit expects a legacy-serialized base64 payload.
|
|
7
|
+
* Gets its OWN blockhash from the provider for consistency with SDK expectations.
|
|
8
|
+
*/
|
|
9
|
+
import { ILandingProvider } from "../types";
|
|
10
|
+
declare function createProvider(): ILandingProvider;
|
|
11
|
+
export { createProvider };
|
|
12
|
+
//# sourceMappingURL=bloxroute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bloxroute.d.ts","sourceRoot":"","sources":["../../../../src/transactions/landing/providers/bloxroute.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAaH,OAAO,EACL,gBAAgB,EAIjB,MAAM,UAAU,CAAC;AAqClB,iBAAS,cAAc,IAAI,gBAAgB,CAyE1C;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* bloXroute TX Landing Provider
|
|
4
|
+
*
|
|
5
|
+
* Submits transactions via the bloXroute Solana Trader SDK (HttpProvider).
|
|
6
|
+
* Uses legacy Transaction (not VersionedTransaction) because the SDK's
|
|
7
|
+
* postSubmit expects a legacy-serialized base64 payload.
|
|
8
|
+
* Gets its OWN blockhash from the provider for consistency with SDK expectations.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.createProvider = createProvider;
|
|
12
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
13
|
+
const solana_trader_client_ts_1 = require("@bloxroute/solana-trader-client-ts");
|
|
14
|
+
const types_1 = require("../types");
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
// Config
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
const TIP_ACCOUNTS = [
|
|
19
|
+
"HWEoBxYs7ssKuudEjzjmpfJVX7Dvi7wescFsVx2L5yoY",
|
|
20
|
+
"95cfoy472fcQHaw4tPGBTKpn6ZQnfEPfBgDQx6gcRmRg",
|
|
21
|
+
"3UQUKjhMKaY2S6bjcQD6yHB7utcZt5bfarRCmctpRtUd",
|
|
22
|
+
"FogxVNs6Mm2w9rnGL1vkARSwJxvLE8mujTv3LK8RnUhF",
|
|
23
|
+
];
|
|
24
|
+
const DEFAULT_TIP_SOL = 0.001;
|
|
25
|
+
const ENDPOINT = "http://amsterdam.solana.dex.blxrbdn.com";
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
// Lazy provider singleton
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
let _provider = null;
|
|
30
|
+
function getProvider() {
|
|
31
|
+
if (_provider)
|
|
32
|
+
return _provider;
|
|
33
|
+
const authKey = process.env.BLOXROUTE_AUTH_KEY || "";
|
|
34
|
+
const apiKey = process.env.BLOXROUTE_API_KEY || "";
|
|
35
|
+
if (!authKey || !apiKey)
|
|
36
|
+
return null;
|
|
37
|
+
_provider = new solana_trader_client_ts_1.HttpProvider(apiKey, authKey, ENDPOINT);
|
|
38
|
+
return _provider;
|
|
39
|
+
}
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
// Provider
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
function createProvider() {
|
|
44
|
+
return {
|
|
45
|
+
name: "bloxroute",
|
|
46
|
+
isEnabled() {
|
|
47
|
+
return !!process.env.BLOXROUTE_API_KEY && !!process.env.BLOXROUTE_AUTH_KEY;
|
|
48
|
+
},
|
|
49
|
+
async submit(ixs, signer, blockhash, opts) {
|
|
50
|
+
const providerName = this.name;
|
|
51
|
+
try {
|
|
52
|
+
const sdkProvider = getProvider();
|
|
53
|
+
if (!sdkProvider) {
|
|
54
|
+
return { provider: providerName, accepted: false, error: "BLOXROUTE_API_KEY or BLOXROUTE_AUTH_KEY not set" };
|
|
55
|
+
}
|
|
56
|
+
const tipSol = opts.tipSol && opts.tipSol > 0 ? opts.tipSol : DEFAULT_TIP_SOL;
|
|
57
|
+
const tipAccount = (0, types_1.pickRandom)(TIP_ACCOUNTS);
|
|
58
|
+
// Build tip instruction
|
|
59
|
+
const tipIx = web3_js_1.SystemProgram.transfer({
|
|
60
|
+
fromPubkey: signer.publicKey,
|
|
61
|
+
toPubkey: new web3_js_1.PublicKey(tipAccount),
|
|
62
|
+
lamports: Math.round(tipSol * web3_js_1.LAMPORTS_PER_SOL),
|
|
63
|
+
});
|
|
64
|
+
// bloXroute SDK expects legacy Transaction — get its OWN blockhash
|
|
65
|
+
const recentBlockhashResp = await sdkProvider.getRecentBlockHash({});
|
|
66
|
+
const bh = recentBlockhashResp.blockHash;
|
|
67
|
+
// Build legacy transaction — never mutate input ixs
|
|
68
|
+
const allIxs = [...ixs, tipIx];
|
|
69
|
+
const tx = new web3_js_1.Transaction({
|
|
70
|
+
recentBlockhash: bh,
|
|
71
|
+
feePayer: signer.publicKey,
|
|
72
|
+
});
|
|
73
|
+
tx.add(...allIxs);
|
|
74
|
+
// Sign with primary + extra signers
|
|
75
|
+
const allSigners = [signer, ...(opts.extraSigners ?? [])];
|
|
76
|
+
tx.sign(...allSigners);
|
|
77
|
+
const b64 = Buffer.from(tx.serialize()).toString("base64");
|
|
78
|
+
const t0 = Date.now();
|
|
79
|
+
const response = await sdkProvider.postSubmit({
|
|
80
|
+
transaction: { content: b64, isCleanup: false },
|
|
81
|
+
frontRunningProtection: false,
|
|
82
|
+
useStakedRPCs: true,
|
|
83
|
+
skipPreFlight: false,
|
|
84
|
+
});
|
|
85
|
+
const latencyMs = Date.now() - t0;
|
|
86
|
+
const signature = response.signature;
|
|
87
|
+
if (signature) {
|
|
88
|
+
return { provider: providerName, accepted: true, signature, latencyMs };
|
|
89
|
+
}
|
|
90
|
+
return { provider: providerName, accepted: false, error: "No signature in bloXroute response", latencyMs };
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
return {
|
|
94
|
+
provider: providerName,
|
|
95
|
+
accepted: false,
|
|
96
|
+
error: err?.message || "bloXroute request failed",
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=bloxroute.js.map
|
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7
|
+
import { ILandingProvider } from "../types";
|
|
8
|
+
declare function createProvider(): ILandingProvider;
|
|
9
|
+
export { createProvider };
|
|
10
|
+
//# sourceMappingURL=flashblock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flashblock.d.ts","sourceRoot":"","sources":["../../../../src/transactions/landing/providers/flashblock.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,OAAO,EACL,gBAAgB,EAKjB,MAAM,UAAU,CAAC;AA0BlB,iBAAS,cAAc,IAAI,gBAAgB,CAsF1C;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Flashblock TX Landing Provider
|
|
4
|
+
*
|
|
5
|
+
* Submits transactions via Flashblock's HTTP REST batch endpoint.
|
|
6
|
+
* API key is passed in the Authorization header.
|
|
7
|
+
*/
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.createProvider = createProvider;
|
|
13
|
+
const axios_1 = __importDefault(require("axios"));
|
|
14
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
15
|
+
const types_1 = require("../types");
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
// Config
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
const TIP_ACCOUNTS = [
|
|
20
|
+
"FLaShB3iXXTWE1vu9wQsChUKq3HFtpMAhb8kAh1pf1wi",
|
|
21
|
+
"FLashhsorBmM9dLpuq6qATawcpqk1Y2aqaZfkd48iT3W",
|
|
22
|
+
"FLaSHJNm5dWYzEgnHJWWJP5ccu128Mu61NJLxUf7mUXU",
|
|
23
|
+
"FLaSHR4Vv7sttd6TyDF4yR1bJyAxRwWKbohDytEMu3wL",
|
|
24
|
+
"FLASHRzANfcAKDuQ3RXv9hbkBy4WVEKDzoAgxJ56DiE4",
|
|
25
|
+
"FLasHstqx11M8W56zrSEqkCyhMCCpr6ze6Mjdvqope5s",
|
|
26
|
+
"FLAShyAyBcKb39KPxSzXcepiS8iDYUhDGwJcJDPX4g2B",
|
|
27
|
+
"FLasHXTqrbNvpWFB6grN47HGZfK6pze9HLNTgbukfPSk",
|
|
28
|
+
"FLAshyAyBcKb39KPxSzXcepiS8iDYUhDGwJcJDPX4g2B",
|
|
29
|
+
"FLAsHZTRcf3Dy1APaz6j74ebdMC6Xx4g6i9YxjyrDybR",
|
|
30
|
+
];
|
|
31
|
+
const DEFAULT_TIP_SOL = 0.001;
|
|
32
|
+
const ENDPOINT = "http://ams.flashblock.trade/api/v2/submit-batch";
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
// Provider
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
function createProvider() {
|
|
37
|
+
return {
|
|
38
|
+
name: "flashblock",
|
|
39
|
+
isEnabled() {
|
|
40
|
+
return !!process.env.FLASHBLOCK_API_KEY;
|
|
41
|
+
},
|
|
42
|
+
async submit(ixs, signer, blockhash, opts) {
|
|
43
|
+
const provider = this.name;
|
|
44
|
+
try {
|
|
45
|
+
const key = process.env.FLASHBLOCK_API_KEY || "";
|
|
46
|
+
if (!key) {
|
|
47
|
+
return { provider, accepted: false, error: "FLASHBLOCK_API_KEY not set" };
|
|
48
|
+
}
|
|
49
|
+
const tipSol = opts.tipSol && opts.tipSol > 0 ? opts.tipSol : DEFAULT_TIP_SOL;
|
|
50
|
+
const tipAccount = (0, types_1.pickRandom)(TIP_ACCOUNTS);
|
|
51
|
+
// Build tip instruction
|
|
52
|
+
const tipIx = web3_js_1.SystemProgram.transfer({
|
|
53
|
+
fromPubkey: signer.publicKey,
|
|
54
|
+
toPubkey: new web3_js_1.PublicKey(tipAccount),
|
|
55
|
+
lamports: Math.round(tipSol * web3_js_1.LAMPORTS_PER_SOL),
|
|
56
|
+
});
|
|
57
|
+
// Build V0 transaction — never mutate input ixs
|
|
58
|
+
const allIxs = [...ixs, tipIx];
|
|
59
|
+
const bh = (0, types_1.extractBlockhash)(blockhash);
|
|
60
|
+
const messageV0 = new web3_js_1.TransactionMessage({
|
|
61
|
+
payerKey: signer.publicKey,
|
|
62
|
+
recentBlockhash: bh,
|
|
63
|
+
instructions: allIxs,
|
|
64
|
+
}).compileToV0Message(opts.addressLookupTables);
|
|
65
|
+
const tx = new web3_js_1.VersionedTransaction(messageV0);
|
|
66
|
+
const signers = [signer, ...(opts.extraSigners ?? [])];
|
|
67
|
+
tx.sign(signers);
|
|
68
|
+
const b64 = Buffer.from(tx.serialize()).toString("base64");
|
|
69
|
+
const t0 = Date.now();
|
|
70
|
+
const response = await axios_1.default.post(ENDPOINT, { transactions: [b64] }, {
|
|
71
|
+
headers: { Authorization: key },
|
|
72
|
+
timeout: 10_000,
|
|
73
|
+
});
|
|
74
|
+
const latencyMs = Date.now() - t0;
|
|
75
|
+
// Flashblock REST typically returns 200 on acceptance
|
|
76
|
+
if (response.status >= 200 && response.status < 300) {
|
|
77
|
+
const signature = response.data?.signature ||
|
|
78
|
+
response.data?.result ||
|
|
79
|
+
response.data?.signatures?.[0];
|
|
80
|
+
return { provider, accepted: true, signature, latencyMs };
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
provider,
|
|
84
|
+
accepted: false,
|
|
85
|
+
error: `HTTP ${response.status}: ${JSON.stringify(response.data).slice(0, 200)}`,
|
|
86
|
+
latencyMs,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
return {
|
|
91
|
+
provider,
|
|
92
|
+
accepted: false,
|
|
93
|
+
error: err?.response?.data?.error ||
|
|
94
|
+
err?.response?.data?.message ||
|
|
95
|
+
err?.message ||
|
|
96
|
+
"Flashblock request failed",
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=flashblock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flashblock.js","sourceRoot":"","sources":["../../../../src/transactions/landing/providers/flashblock.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAoIM,wCAAc;AAlIvB,kDAA0B;AAC1B,6CAQyB;AACzB,oCAMkB;AAElB,8EAA8E;AAC9E,SAAS;AACT,8EAA8E;AAE9E,MAAM,YAAY,GAAG;IACnB,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;CACtC,CAAC;AAEX,MAAM,eAAe,GAAG,KAAK,CAAC;AAC9B,MAAM,QAAQ,GAAG,iDAAiD,CAAC;AAEnE,8EAA8E;AAC9E,WAAW;AACX,8EAA8E;AAE9E,SAAS,cAAc;IACrB,OAAO;QACL,IAAI,EAAE,YAAY;QAElB,SAAS;YACP,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;QAC1C,CAAC;QAED,KAAK,CAAC,MAAM,CACV,GAA6B,EAC7B,MAAe,EACf,SAAuE,EACvE,IAAmB;YAEnB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;YAC3B,IAAI,CAAC;gBACH,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,EAAE,CAAC;gBACjD,IAAI,CAAC,GAAG,EAAE,CAAC;oBACT,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,4BAA4B,EAAE,CAAC;gBAC5E,CAAC;gBAED,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC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EAAE;oBAC/B,OAAO,EAAE,MAAM;iBAChB,CACF,CAAC;gBACF,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;gBAElC,sDAAsD;gBACtD,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;oBACpD,MAAM,SAAS,GACb,QAAQ,CAAC,IAAI,EAAE,SAAS;wBACxB,QAAQ,CAAC,IAAI,EAAE,MAAM;wBACrB,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;oBACjC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;gBAC5D,CAAC;gBAED,OAAO;oBACL,QAAQ;oBACR,QAAQ,EAAE,KAAK;oBACf,KAAK,EAAE,QAAQ,QAAQ,CAAC,MAAM,KAAK,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE;oBAChF,SAAS;iBACV,CAAC;YACJ,CAAC;YAAC,OAAO,GAAQ,EAAE,CAAC;gBAClB,OAAO;oBACL,QAAQ;oBACR,QAAQ,EAAE,KAAK;oBACf,KAAK,EACH,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK;wBAC1B,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO;wBAC5B,GAAG,EAAE,OAAO;wBACZ,2BAA2B;iBAC9B,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helius Sender TX Landing Provider
|
|
3
|
+
*
|
|
4
|
+
* Submits transactions via Helius's fast sender endpoint.
|
|
5
|
+
* Uses HTTP JSON-RPC with sendTransaction, base64 encoding,
|
|
6
|
+
* skipPreflight: true, maxRetries: 0.
|
|
7
|
+
*/
|
|
8
|
+
import { ILandingProvider } from "../types";
|
|
9
|
+
declare function createProvider(): ILandingProvider;
|
|
10
|
+
export { createProvider };
|
|
11
|
+
//# sourceMappingURL=helius-sender.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helius-sender.d.ts","sourceRoot":"","sources":["../../../../src/transactions/landing/providers/helius-sender.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH,OAAO,EACL,gBAAgB,EAKjB,MAAM,UAAU,CAAC;AA0BlB,iBAAS,cAAc,IAAI,gBAAgB,CAmF1C;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Helius Sender TX Landing Provider
|
|
4
|
+
*
|
|
5
|
+
* Submits transactions via Helius's fast sender endpoint.
|
|
6
|
+
* Uses HTTP JSON-RPC with sendTransaction, base64 encoding,
|
|
7
|
+
* skipPreflight: true, maxRetries: 0.
|
|
8
|
+
*/
|
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.createProvider = createProvider;
|
|
14
|
+
const axios_1 = __importDefault(require("axios"));
|
|
15
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
16
|
+
const types_1 = require("../types");
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
// Config
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
const TIP_ACCOUNTS = [
|
|
21
|
+
"4ACfpUFoaSD9bfPdeu6DBt89gB6ENTeHBXCAi87NhDEE",
|
|
22
|
+
"D2L6yPZ2FmmmTKPgzaMKdhu6EWZcTpLy1Vhx8uvZe7NZ",
|
|
23
|
+
"9bnz4RShgq1hAnLnZbP8kbgBg1kEmcJBYQq3gQbmnSta",
|
|
24
|
+
"5VY91ws6B2hMmBFRsXkoAAdsPHBJwRfBht4DXox3xkwn",
|
|
25
|
+
"2nyhqdwKcJZR2vcqCyrYsaPVdAnFoJjiksCXJ7hfEYgD",
|
|
26
|
+
"2q5pghRs6arqVjRvT5gfgWfWcHWmw1ZuCzphgd5KfWGJ",
|
|
27
|
+
"wyvPkWjVZz1M8fHQnMMCDTQDbkManefNNhweYk5WkcF",
|
|
28
|
+
"3KCKozbAaF75qEU33jtzozcJ29yJuaLJTy2jFdzUY8bT",
|
|
29
|
+
"4vieeGHPYPG2MmyPRcYjdiDmmhN3ww7hsFNap8pVN3Ey",
|
|
30
|
+
"4TQLFNWK8AovT1gFvda5jfw2oJeRMKEmw7aH6MGBJ3or",
|
|
31
|
+
];
|
|
32
|
+
const DEFAULT_TIP_SOL = 0.001;
|
|
33
|
+
const DEFAULT_ENDPOINT = "http://ams-sender.helius-rpc.com/fast";
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
// Provider
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
function createProvider() {
|
|
38
|
+
return {
|
|
39
|
+
name: "helius-sender",
|
|
40
|
+
isEnabled() {
|
|
41
|
+
// Public endpoint — always enabled unless explicitly overridden to empty
|
|
42
|
+
return true;
|
|
43
|
+
},
|
|
44
|
+
async submit(ixs, signer, blockhash, opts) {
|
|
45
|
+
const provider = this.name;
|
|
46
|
+
try {
|
|
47
|
+
const tipSol = opts.tipSol && opts.tipSol > 0 ? opts.tipSol : DEFAULT_TIP_SOL;
|
|
48
|
+
const tipAccount = (0, types_1.pickRandom)(TIP_ACCOUNTS);
|
|
49
|
+
// Build tip instruction
|
|
50
|
+
const tipIx = web3_js_1.SystemProgram.transfer({
|
|
51
|
+
fromPubkey: signer.publicKey,
|
|
52
|
+
toPubkey: new web3_js_1.PublicKey(tipAccount),
|
|
53
|
+
lamports: Math.round(tipSol * web3_js_1.LAMPORTS_PER_SOL),
|
|
54
|
+
});
|
|
55
|
+
// Build V0 transaction — never mutate input ixs
|
|
56
|
+
const allIxs = [...ixs, tipIx];
|
|
57
|
+
const bh = (0, types_1.extractBlockhash)(blockhash);
|
|
58
|
+
const message = new web3_js_1.TransactionMessage({
|
|
59
|
+
payerKey: signer.publicKey,
|
|
60
|
+
recentBlockhash: bh,
|
|
61
|
+
instructions: allIxs,
|
|
62
|
+
});
|
|
63
|
+
const messageV0 = message.compileToV0Message(opts.addressLookupTables);
|
|
64
|
+
const tx = new web3_js_1.VersionedTransaction(messageV0);
|
|
65
|
+
const signers = [signer, ...(opts.extraSigners ?? [])];
|
|
66
|
+
tx.sign(signers);
|
|
67
|
+
const b64 = Buffer.from(tx.serialize()).toString("base64");
|
|
68
|
+
const endpoint = process.env.HELIUS_SENDER_URL || DEFAULT_ENDPOINT;
|
|
69
|
+
const t0 = Date.now();
|
|
70
|
+
const response = await axios_1.default.post(endpoint, {
|
|
71
|
+
jsonrpc: "2.0",
|
|
72
|
+
id: 1,
|
|
73
|
+
method: "sendTransaction",
|
|
74
|
+
params: [
|
|
75
|
+
b64,
|
|
76
|
+
{
|
|
77
|
+
encoding: "base64",
|
|
78
|
+
skipPreflight: true,
|
|
79
|
+
maxRetries: 0,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
}, { timeout: 10_000 });
|
|
83
|
+
const latencyMs = Date.now() - t0;
|
|
84
|
+
const signature = response.data?.result;
|
|
85
|
+
if (signature) {
|
|
86
|
+
return { provider, accepted: true, signature, latencyMs };
|
|
87
|
+
}
|
|
88
|
+
const errMsg = response.data?.error?.message || JSON.stringify(response.data?.error) || "Unknown helius-sender error";
|
|
89
|
+
return { provider, accepted: false, error: errMsg, latencyMs };
|
|
90
|
+
}
|
|
91
|
+
catch (err) {
|
|
92
|
+
return {
|
|
93
|
+
provider,
|
|
94
|
+
accepted: false,
|
|
95
|
+
error: err?.response?.data?.error?.message || err?.message || "helius-sender request failed",
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=helius-sender.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helius-sender.js","sourceRoot":"","sources":["../../../../src/transactions/landing/providers/helius-sender.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;AAiIM,wCAAc;AA/HvB,kDAA0B;AAC1B,6CAQyB;AACzB,oCAMkB;AAElB,8EAA8E;AAC9E,SAAS;AACT,8EAA8E;AAE9E,MAAM,YAAY,GAAG;IACnB,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,6CAA6C;IAC7C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;CACtC,CAAC;AAEX,MAAM,eAAe,GAAG,KAAK,CAAC;AAC9B,MAAM,gBAAgB,GAAG,uCAAuC,CAAC;AAEjE,8EAA8E;AAC9E,WAAW;AACX,8EAA8E;AAE9E,SAAS,cAAc;IACrB,OAAO;QACL,IAAI,EAAE,eAAe;QAErB,SAAS;YACP,yEAAyE;YACzE,OAAO,IAAI,CAAC;QACd,CAAC;QAED,KAAK,CAAC,MAAM,CACV,GAA6B,EAC7B,MAAe,EACf,SAAuE,EACvE,IAAmB;YAEnB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;YAC3B,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC;gBAC9E,MAAM,UAAU,GAAG,IAAA,kBAAU,EAAC,YAAY,CAAC,CAAC;gBAE5C,wBAAwB;gBACxB,MAAM,KAAK,GAAG,uBAAa,CAAC,QAAQ,CAAC;oBACnC,UAAU,EAAE,MAAM,CAAC,SAAS;oBAC5B,QAAQ,EAAE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EAAE,CAAC;yBACd;qBACF;iBACF,EACD,EAAE,OAAO,EAAE,MAAM,EAAE,CACpB,CAAC;gBACF,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;gBAElC,MAAM,SAAS,GAAuB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAC5D,IAAI,SAAS,EAAE,CAAC;oBACd,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;gBAC5D,CAAC;gBAED,MAAM,MAAM,GACV,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,6BAA6B,CAAC;gBACzG,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;YACjE,CAAC;YAAC,OAAO,GAAQ,EAAE,CAAC;gBAClB,OAAO;oBACL,QAAQ;oBACR,QAAQ,EAAE,KAAK;oBACf,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,IAAI,GAAG,EAAE,OAAO,IAAI,8BAA8B;iBAC7F,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Jito TX Landing Provider (gRPC Bundle)
|
|
3
|
+
*
|
|
4
|
+
* Submits transactions as a Jito bundle via the gRPC block-engine.
|
|
5
|
+
* Requires `jito-ts` SDK and a BLOCK_ENGINE_URL env var.
|
|
6
|
+
*
|
|
7
|
+
* Unlike other providers, Jito works with bundles — the main signed
|
|
8
|
+
* VersionedTransaction is wrapped in a Bundle and a tip tx is added
|
|
9
|
+
* via `bundle.addTipTx()`.
|
|
10
|
+
*
|
|
11
|
+
* Tip accounts are fetched lazily from `searcher.getTipAccounts()`.
|
|
12
|
+
*/
|
|
13
|
+
import { ILandingProvider } from "../types";
|
|
14
|
+
declare function createProvider(): ILandingProvider;
|
|
15
|
+
export { createProvider };
|
|
16
|
+
//# sourceMappingURL=jito.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jito.d.ts","sourceRoot":"","sources":["../../../../src/transactions/landing/providers/jito.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAcH,OAAO,EACL,gBAAgB,EAKjB,MAAM,UAAU,CAAC;AAkBlB,iBAAS,cAAc,IAAI,gBAAgB,CAmG1C;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Jito TX Landing Provider (gRPC Bundle)
|
|
4
|
+
*
|
|
5
|
+
* Submits transactions as a Jito bundle via the gRPC block-engine.
|
|
6
|
+
* Requires `jito-ts` SDK and a BLOCK_ENGINE_URL env var.
|
|
7
|
+
*
|
|
8
|
+
* Unlike other providers, Jito works with bundles — the main signed
|
|
9
|
+
* VersionedTransaction is wrapped in a Bundle and a tip tx is added
|
|
10
|
+
* via `bundle.addTipTx()`.
|
|
11
|
+
*
|
|
12
|
+
* Tip accounts are fetched lazily from `searcher.getTipAccounts()`.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.createProvider = createProvider;
|
|
16
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
17
|
+
const searcher_1 = require("jito-ts/dist/sdk/block-engine/searcher");
|
|
18
|
+
const types_1 = require("jito-ts/dist/sdk/block-engine/types");
|
|
19
|
+
const utils_1 = require("jito-ts/dist/sdk/block-engine/utils");
|
|
20
|
+
const types_2 = require("../types");
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
// Config
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
const DEFAULT_TIP_SOL = 0.0001;
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
// State
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
let cachedTipAccounts = null;
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
// Provider
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
function createProvider() {
|
|
33
|
+
return {
|
|
34
|
+
name: "jito",
|
|
35
|
+
isEnabled() {
|
|
36
|
+
return !!process.env.BLOCK_ENGINE_URL;
|
|
37
|
+
},
|
|
38
|
+
async submit(ixs, signer, blockhash, opts) {
|
|
39
|
+
const provider = this.name;
|
|
40
|
+
try {
|
|
41
|
+
const blockEngineUrl = process.env.BLOCK_ENGINE_URL || "";
|
|
42
|
+
if (!blockEngineUrl) {
|
|
43
|
+
return { provider, accepted: false, error: "BLOCK_ENGINE_URL not set" };
|
|
44
|
+
}
|
|
45
|
+
const tipSol = opts.tipSol && opts.tipSol > 0 ? opts.tipSol : DEFAULT_TIP_SOL;
|
|
46
|
+
const bh = (0, types_2.extractBlockhash)(blockhash);
|
|
47
|
+
// Create searcher client
|
|
48
|
+
const searcher = (0, searcher_1.searcherClient)(blockEngineUrl);
|
|
49
|
+
// Lazily fetch tip accounts
|
|
50
|
+
if (!cachedTipAccounts) {
|
|
51
|
+
const tipAccountsResult = await searcher.getTipAccounts();
|
|
52
|
+
if ((0, utils_1.isError)(tipAccountsResult)) {
|
|
53
|
+
return {
|
|
54
|
+
provider,
|
|
55
|
+
accepted: false,
|
|
56
|
+
error: `Failed to fetch Jito tip accounts: ${tipAccountsResult}`,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
cachedTipAccounts = tipAccountsResult;
|
|
60
|
+
}
|
|
61
|
+
if (!cachedTipAccounts || cachedTipAccounts.length === 0) {
|
|
62
|
+
return { provider, accepted: false, error: "No Jito tip accounts available" };
|
|
63
|
+
}
|
|
64
|
+
// Build the main V0 transaction (without tip — tip is a separate bundle tx)
|
|
65
|
+
const mainIxs = [...ixs]; // never mutate input
|
|
66
|
+
const messageV0 = new web3_js_1.TransactionMessage({
|
|
67
|
+
payerKey: signer.publicKey,
|
|
68
|
+
recentBlockhash: bh,
|
|
69
|
+
instructions: mainIxs,
|
|
70
|
+
}).compileToV0Message(opts.addressLookupTables);
|
|
71
|
+
const mainTx = new web3_js_1.VersionedTransaction(messageV0);
|
|
72
|
+
const signers = [signer, ...(opts.extraSigners ?? [])];
|
|
73
|
+
mainTx.sign(signers);
|
|
74
|
+
// Create bundle and add the main transaction
|
|
75
|
+
const bundle = new types_1.Bundle([mainTx], 5); // max 5 txs in bundle
|
|
76
|
+
// Add tip transaction to the bundle
|
|
77
|
+
const tipAccount = (0, types_2.pickRandom)(cachedTipAccounts);
|
|
78
|
+
bundle.addTipTx(signer, Math.round(tipSol * web3_js_1.LAMPORTS_PER_SOL), new web3_js_1.PublicKey(tipAccount), bh);
|
|
79
|
+
// Send bundle via gRPC
|
|
80
|
+
const t0 = Date.now();
|
|
81
|
+
const result = await searcher.sendBundle(bundle);
|
|
82
|
+
const latencyMs = Date.now() - t0;
|
|
83
|
+
if ((0, utils_1.isError)(result)) {
|
|
84
|
+
return {
|
|
85
|
+
provider,
|
|
86
|
+
accepted: false,
|
|
87
|
+
error: `Jito bundle rejected: ${result}`,
|
|
88
|
+
latencyMs,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
// result is the bundle ID on success
|
|
92
|
+
const bundleId = result;
|
|
93
|
+
return {
|
|
94
|
+
provider,
|
|
95
|
+
accepted: true,
|
|
96
|
+
bundleId,
|
|
97
|
+
latencyMs,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
return {
|
|
102
|
+
provider,
|
|
103
|
+
accepted: false,
|
|
104
|
+
error: err?.message || "Jito bundle request failed",
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=jito.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jito.js","sourceRoot":"","sources":["../../../../src/transactions/landing/providers/jito.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;AA2IM,wCAAc;AAzIvB,6CAQyB;AACzB,qEAAwE;AACxE,+DAA6D;AAC7D,+DAA8D;AAC9D,oCAMkB;AAElB,8EAA8E;AAC9E,SAAS;AACT,8EAA8E;AAE9E,MAAM,eAAe,GAAG,MAAM,CAAC;AAE/B,8EAA8E;AAC9E,QAAQ;AACR,8EAA8E;AAE9E,IAAI,iBAAiB,GAAoB,IAAI,CAAC;AAE9C,8EAA8E;AAC9E,WAAW;AACX,8EAA8E;AAE9E,SAAS,cAAc;IACrB,OAAO;QACL,IAAI,EAAE,MAAM;QAEZ,SAAS;YACP,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;QACxC,CAAC;QAED,KAAK,CAAC,MAAM,CACV,GAA6B,EAC7B,MAAe,EACf,SAAuE,EACvE,IAAmB;YAEnB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;YAC3B,IAAI,CAAC;gBACH,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAC;gBAC1D,IAAI,CAAC,cAAc,EAAE,CAAC;oBACpB,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAC;gBAC1E,CAAC;gBAED,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC;gBAC9E,MAAM,EAAE,GAAG,IAAA,wBAAgB,EAAC,SAAS,CAAC,CAAC;gBAEvC,yBAAyB;gBACzB,MAAM,QAAQ,GAAG,IAAA,yBAAc,EAAC,cAAc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AAiB,CAAC,CAAC;gBACjD,MAAM,CAAC,QAAQ,CACb,MAAM,EACN,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,0BAAgB,CAAC,EACrC,IAAI,mBAAS,CAAC,UAAU,CAAC,EACzB,EAAE,CACH,CAAC;gBAEF,uBAAuB;gBACvB,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;gBACtB,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;gBACjD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;gBAElC,IAAI,IAAA,eAAO,EAAC,MAAM,CAAC,EAAE,CAAC;oBACpB,OAAO;wBACL,QAAQ;wBACR,QAAQ,EAAE,KAAK;wBACf,KAAK,EAAE,yBAAyB,MAAM,EAAE;wBACxC,SAAS;qBACV,CAAC;gBACJ,CAAC;gBAED,qCAAqC;gBACrC,MAAM,QAAQ,GAAG,MAA2B,CAAC;gBAC7C,OAAO;oBACL,QAAQ;oBACR,QAAQ,EAAE,IAAI;oBACd,QAAQ;oBACR,SAAS;iBACV,CAAC;YACJ,CAAC;YAAC,OAAO,GAAQ,EAAE,CAAC;gBAClB,OAAO;oBACL,QAAQ;oBACR,QAAQ,EAAE,KAAK;oBACf,KAAK,EAAE,GAAG,EAAE,OAAO,IAAI,4BAA4B;iBACpD,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NextBlock TX Landing Provider
|
|
3
|
+
*
|
|
4
|
+
* Submits transactions via NextBlock's HTTP REST endpoint.
|
|
5
|
+
* API key is passed in the Authorization header.
|
|
6
|
+
* Supports ping() via the /health endpoint.
|
|
7
|
+
*/
|
|
8
|
+
import { ILandingProvider } from "../types";
|
|
9
|
+
declare function createProvider(): ILandingProvider;
|
|
10
|
+
export { createProvider };
|
|
11
|
+
//# sourceMappingURL=nextblock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextblock.d.ts","sourceRoot":"","sources":["../../../../src/transactions/landing/providers/nextblock.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH,OAAO,EACL,gBAAgB,EAKjB,MAAM,UAAU,CAAC;AAyBlB,iBAAS,cAAc,IAAI,gBAAgB,CAiG1C;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|