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,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* NextBlock TX Landing Provider
|
|
4
|
+
*
|
|
5
|
+
* Submits transactions via NextBlock's HTTP REST endpoint.
|
|
6
|
+
* API key is passed in the Authorization header.
|
|
7
|
+
* Supports ping() via the /health endpoint.
|
|
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
|
+
"NEXTbLoCkB51HpLBLojQfpyVAMorm3zzKg7w9NFdqid",
|
|
22
|
+
"nextBLoCkPMgmG8ZgJtABeScP35qLa2AMCNKntAP7Xc",
|
|
23
|
+
"NextbLoCkVtMGcV47JzewQdvBpLqT9TxQFozQkN98pE",
|
|
24
|
+
"NexTbLoCkWykbLuB1NkjXgFWkX9oAtcoagQegygXXA2",
|
|
25
|
+
"NeXTBLoCKs9F1y5PJS9CKrFNNLU1keHW71rfh7KgA1X",
|
|
26
|
+
"NexTBLockJYZ7QD7p2byrUa6df8ndV2WSd8GkbWqfbb",
|
|
27
|
+
"neXtBLock1LeC67jYd1QdAa32kbVeubsfPNTJC1V5At",
|
|
28
|
+
"nEXTBLockYgngeRmRrjDV31mGSekVPqZoMGhQEZtPVG",
|
|
29
|
+
];
|
|
30
|
+
const DEFAULT_TIP_SOL = 0.001;
|
|
31
|
+
const ENDPOINT = "https://ams.nextblock.io/api/v2/submit";
|
|
32
|
+
const HEALTH_ENDPOINT = "https://ams.nextblock.io/health";
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
// Provider
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
function createProvider() {
|
|
37
|
+
return {
|
|
38
|
+
name: "nextblock",
|
|
39
|
+
isEnabled() {
|
|
40
|
+
return !!process.env.NEXTBLOCK_API_KEY;
|
|
41
|
+
},
|
|
42
|
+
async ping() {
|
|
43
|
+
await axios_1.default.get(HEALTH_ENDPOINT, { timeout: 5_000 });
|
|
44
|
+
},
|
|
45
|
+
async submit(ixs, signer, blockhash, opts) {
|
|
46
|
+
const provider = this.name;
|
|
47
|
+
try {
|
|
48
|
+
const key = process.env.NEXTBLOCK_API_KEY || "";
|
|
49
|
+
if (!key) {
|
|
50
|
+
return { provider, accepted: false, error: "NEXTBLOCK_API_KEY not set" };
|
|
51
|
+
}
|
|
52
|
+
const tipSol = Math.max(opts.tipSol && opts.tipSol > 0 ? opts.tipSol : DEFAULT_TIP_SOL, DEFAULT_TIP_SOL);
|
|
53
|
+
const tipAccount = (0, types_1.pickRandom)(TIP_ACCOUNTS);
|
|
54
|
+
// Build tip instruction
|
|
55
|
+
const tipIx = web3_js_1.SystemProgram.transfer({
|
|
56
|
+
fromPubkey: signer.publicKey,
|
|
57
|
+
toPubkey: new web3_js_1.PublicKey(tipAccount),
|
|
58
|
+
lamports: Math.round(tipSol * web3_js_1.LAMPORTS_PER_SOL),
|
|
59
|
+
});
|
|
60
|
+
// Build V0 transaction — never mutate input ixs
|
|
61
|
+
const allIxs = [...ixs, tipIx];
|
|
62
|
+
const bh = (0, types_1.extractBlockhash)(blockhash);
|
|
63
|
+
const messageV0 = new web3_js_1.TransactionMessage({
|
|
64
|
+
payerKey: signer.publicKey,
|
|
65
|
+
recentBlockhash: bh,
|
|
66
|
+
instructions: allIxs,
|
|
67
|
+
}).compileToV0Message(opts.addressLookupTables);
|
|
68
|
+
const tx = new web3_js_1.VersionedTransaction(messageV0);
|
|
69
|
+
const signers = [signer, ...(opts.extraSigners ?? [])];
|
|
70
|
+
tx.sign(signers);
|
|
71
|
+
const b64 = Buffer.from(tx.serialize()).toString("base64");
|
|
72
|
+
const t0 = Date.now();
|
|
73
|
+
const response = await axios_1.default.post(ENDPOINT, {
|
|
74
|
+
transaction: {
|
|
75
|
+
content: b64,
|
|
76
|
+
},
|
|
77
|
+
skipPreFlight: true,
|
|
78
|
+
frontRunningProtection: false,
|
|
79
|
+
snipeTransaction: opts.operation === "snipe",
|
|
80
|
+
}, {
|
|
81
|
+
headers: { Authorization: key },
|
|
82
|
+
timeout: 10_000,
|
|
83
|
+
});
|
|
84
|
+
const latencyMs = Date.now() - t0;
|
|
85
|
+
if (response.status >= 200 && response.status < 300) {
|
|
86
|
+
const signature = response.data?.signature || response.data?.result;
|
|
87
|
+
return { provider, accepted: true, signature, latencyMs };
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
provider,
|
|
91
|
+
accepted: false,
|
|
92
|
+
error: `HTTP ${response.status}: ${JSON.stringify(response.data).slice(0, 200)}`,
|
|
93
|
+
latencyMs,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
catch (err) {
|
|
97
|
+
return {
|
|
98
|
+
provider,
|
|
99
|
+
accepted: false,
|
|
100
|
+
error: err?.response?.data?.error ||
|
|
101
|
+
err?.response?.data?.message ||
|
|
102
|
+
err?.message ||
|
|
103
|
+
"NextBlock request failed",
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=nextblock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextblock.js","source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actions via node1.me's HTTP JSON-RPC endpoint.
|
|
5
|
+
* API key is sent in the `api-key` header.
|
|
6
|
+
* Minimum enforced tip: 0.002 SOL.
|
|
7
|
+
*/
|
|
8
|
+
import { ILandingProvider } from "../types";
|
|
9
|
+
declare function createProvider(): ILandingProvider;
|
|
10
|
+
export { createProvider };
|
|
11
|
+
//# sourceMappingURL=node1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node1.d.ts","sourceRoot":"","sources":["../../../../src/transactions/landing/providers/node1.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH,OAAO,EACL,gBAAgB,EAKjB,MAAM,UAAU,CAAC;AAwBlB,iBAAS,cAAc,IAAI,gBAAgB,CAsF1C;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* node1.me TX Landing Provider
|
|
4
|
+
*
|
|
5
|
+
* Submits transactions via node1.me's HTTP JSON-RPC endpoint.
|
|
6
|
+
* API key is sent in the `api-key` header.
|
|
7
|
+
* Minimum enforced tip: 0.002 SOL.
|
|
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
|
+
"node1PqAa3BWWzUnTHVbw8NJHC874zn9ngAkXjgWEej",
|
|
22
|
+
"node1UzzTxAAeBTpfZkQPJXBAqixsbdth11ba1NXLBG",
|
|
23
|
+
"node1Qm1bV4fwYnCurP8otJ9s5yrkPq7SPZ5uhj3Tsv",
|
|
24
|
+
"node1PUber6SFmSQgvf2ECmXsHP5o3boRSGhvJyPMX1",
|
|
25
|
+
"node1AyMbeqiVN6eoQzEAwCA6Pk826hrdqdAHR7cdJ3",
|
|
26
|
+
"node1YtWCoTwwVYTFLfS19zquRQzYX332hs1HEuRBjC",
|
|
27
|
+
];
|
|
28
|
+
/** Minimum tip enforced by node1.me */
|
|
29
|
+
const DEFAULT_TIP_SOL = 0.002;
|
|
30
|
+
const ENDPOINT = "https://ams.node1.me";
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
// Provider
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
function createProvider() {
|
|
35
|
+
return {
|
|
36
|
+
name: "node1",
|
|
37
|
+
isEnabled() {
|
|
38
|
+
return !!process.env.NODE1_API_KEY;
|
|
39
|
+
},
|
|
40
|
+
async submit(ixs, signer, blockhash, opts) {
|
|
41
|
+
const provider = this.name;
|
|
42
|
+
try {
|
|
43
|
+
const apiKey = process.env.NODE1_API_KEY || "";
|
|
44
|
+
if (!apiKey) {
|
|
45
|
+
return { provider, accepted: false, error: "NODE1_API_KEY not set" };
|
|
46
|
+
}
|
|
47
|
+
// Enforce minimum tip of 0.002 SOL
|
|
48
|
+
const requestedTip = opts.tipSol && opts.tipSol > 0 ? opts.tipSol : DEFAULT_TIP_SOL;
|
|
49
|
+
const tipSol = Math.max(requestedTip, 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 message = new web3_js_1.TransactionMessage({
|
|
61
|
+
payerKey: signer.publicKey,
|
|
62
|
+
recentBlockhash: bh,
|
|
63
|
+
instructions: allIxs,
|
|
64
|
+
});
|
|
65
|
+
const messageV0 = message.compileToV0Message(opts.addressLookupTables);
|
|
66
|
+
const tx = new web3_js_1.VersionedTransaction(messageV0);
|
|
67
|
+
const signers = [signer, ...(opts.extraSigners ?? [])];
|
|
68
|
+
tx.sign(signers);
|
|
69
|
+
const b64 = Buffer.from(tx.serialize()).toString("base64");
|
|
70
|
+
const t0 = Date.now();
|
|
71
|
+
const response = await axios_1.default.post(ENDPOINT, {
|
|
72
|
+
jsonrpc: "2.0",
|
|
73
|
+
id: 1,
|
|
74
|
+
method: "sendTransaction",
|
|
75
|
+
params: [b64, { encoding: "base64" }],
|
|
76
|
+
}, {
|
|
77
|
+
timeout: 10_000,
|
|
78
|
+
headers: {
|
|
79
|
+
"Content-Type": "application/json",
|
|
80
|
+
"api-key": apiKey,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
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 node1 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 || "node1 request failed",
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=node1.js.map
|
|
@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oBACzB,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;iBACtC,EACD;oBACE,OAAO,EAAE,MAAM;oBACf,OAAO,EAAE;wBACP,cAAc,EAAE,kBAAkB;wBAClC,SAAS,EAAE,MAAM;qBAClB;iBACF,CACF,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,qBAAqB,CAAC;gBACjG,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,sBAAsB;iBACrF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nozomi TX Landing Provider (Temporal)
|
|
3
|
+
*
|
|
4
|
+
* Submits transactions via Nozomi's HTTP endpoints across 4 regions.
|
|
5
|
+
* Primary submission goes to the AMS endpoint.
|
|
6
|
+
* Uses raw base64 body with Content-Type: text/plain (NOT JSON-RPC).
|
|
7
|
+
*/
|
|
8
|
+
import { ILandingProvider } from "../types";
|
|
9
|
+
declare function createProvider(): ILandingProvider;
|
|
10
|
+
export { createProvider };
|
|
11
|
+
//# sourceMappingURL=nozomi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nozomi.d.ts","sourceRoot":"","sources":["../../../../src/transactions/landing/providers/nozomi.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH,OAAO,EACL,gBAAgB,EAKjB,MAAM,UAAU,CAAC;AAwClB,iBAAS,cAAc,IAAI,gBAAgB,CA+F1C;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Nozomi TX Landing Provider (Temporal)
|
|
4
|
+
*
|
|
5
|
+
* Submits transactions via Nozomi's HTTP endpoints across 4 regions.
|
|
6
|
+
* Primary submission goes to the AMS endpoint.
|
|
7
|
+
* Uses raw base64 body with Content-Type: text/plain (NOT JSON-RPC).
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.createProvider = createProvider;
|
|
11
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
12
|
+
const types_1 = require("../types");
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// Config
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
const TIP_ACCOUNTS = [
|
|
17
|
+
"TEMPaMeCRFAS9EKF53Jd6KpHxgL47uWLcpFArU1Fanq",
|
|
18
|
+
"noz3jAjPiHuBPqiSPkkugaJDkJscPuRhYnSpbi8UvC4",
|
|
19
|
+
"noz3str9KXfpKknefHji8L1mPgimezaiUyCHYMDv1GE",
|
|
20
|
+
"noz6uoYCDijhu1V7cutCpwxNiSovEwLdRHPwmgCGDNo",
|
|
21
|
+
"noz9EPNcT7WH6Sou3sr3GGjHQYVkN3DNirpbvDkv9YJ",
|
|
22
|
+
"nozc5yT15LazbLTFVZzoNZCwjh3yUtW86LoUyqsBu4L",
|
|
23
|
+
"nozFrhfnNGoyqwVuwPAW4aaGqempx4PU6g6D9CJMv7Z",
|
|
24
|
+
"nozievPk7HyK1Rqy1MPJwVQ7qQg2QoJGyP71oeDwbsu",
|
|
25
|
+
"noznbgwYnBLDHu8wcQVCEw6kDrXkPdKkydGJGNXGvL7",
|
|
26
|
+
"nozNVWs5N8mgzuD3qigrCG2UoKxZttxzZ85pvAQVrbP",
|
|
27
|
+
"nozpEGbwx4BcGp6pvEdAh1JoC2CQGZdU6HbNP1v2p6P",
|
|
28
|
+
"nozrhjhkCr3zXT3BiT4WCodYCUFeQvcdUkM7MqhKqge",
|
|
29
|
+
"nozrwQtWhEdrA6W8dkbt9gnUaMs52PdAv5byipnadq3",
|
|
30
|
+
"nozUacTVWub3cL4mJmGCYjKZTnE9RbdY5AP46iQgbPJ",
|
|
31
|
+
"nozWCyTPppJjRuw2fpzDhhWbW355fzosWSzrrMYB1Qk",
|
|
32
|
+
"nozWNju6dY353eMkMqURqwQEoM3SFgEKC6psLCSfUne",
|
|
33
|
+
"nozxNBgWohjR75vdspfxR5H9ceC7XXH99xpxhVGt3Bb",
|
|
34
|
+
];
|
|
35
|
+
const DEFAULT_TIP_SOL = 0.001;
|
|
36
|
+
/** Primary endpoint (AMS). Other regions are available for future multi-region fanout. */
|
|
37
|
+
const REGIONS = [
|
|
38
|
+
"http://ams1.nozomi.temporal.xyz",
|
|
39
|
+
"http://fra2.nozomi.temporal.xyz",
|
|
40
|
+
"http://ewr1.nozomi.temporal.xyz",
|
|
41
|
+
"http://pit1.nozomi.temporal.xyz",
|
|
42
|
+
];
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
// Provider
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
function createProvider() {
|
|
47
|
+
return {
|
|
48
|
+
name: "nozomi",
|
|
49
|
+
isEnabled() {
|
|
50
|
+
return !!process.env.NOZOMI_API_KEY;
|
|
51
|
+
},
|
|
52
|
+
async submit(ixs, signer, blockhash, opts) {
|
|
53
|
+
const provider = this.name;
|
|
54
|
+
try {
|
|
55
|
+
// Use separate key for create_account if available
|
|
56
|
+
const key = opts.operation === "create_account" && process.env.NOZOMI_API_KEY_CREATE
|
|
57
|
+
? process.env.NOZOMI_API_KEY_CREATE
|
|
58
|
+
: process.env.NOZOMI_API_KEY || "";
|
|
59
|
+
if (!key) {
|
|
60
|
+
return { provider, accepted: false, error: "NOZOMI_API_KEY not set" };
|
|
61
|
+
}
|
|
62
|
+
const tipSol = opts.tipSol && opts.tipSol > 0 ? opts.tipSol : DEFAULT_TIP_SOL;
|
|
63
|
+
const tipAccount = (0, types_1.pickRandom)(TIP_ACCOUNTS);
|
|
64
|
+
// Build tip instruction
|
|
65
|
+
const tipIx = web3_js_1.SystemProgram.transfer({
|
|
66
|
+
fromPubkey: signer.publicKey,
|
|
67
|
+
toPubkey: new web3_js_1.PublicKey(tipAccount),
|
|
68
|
+
lamports: Math.round(tipSol * web3_js_1.LAMPORTS_PER_SOL),
|
|
69
|
+
});
|
|
70
|
+
// Build V0 transaction — never mutate input ixs
|
|
71
|
+
const allIxs = [...ixs, tipIx];
|
|
72
|
+
const bh = (0, types_1.extractBlockhash)(blockhash);
|
|
73
|
+
const message = new web3_js_1.TransactionMessage({
|
|
74
|
+
payerKey: signer.publicKey,
|
|
75
|
+
recentBlockhash: bh,
|
|
76
|
+
instructions: allIxs,
|
|
77
|
+
});
|
|
78
|
+
const messageV0 = message.compileToV0Message(opts.addressLookupTables);
|
|
79
|
+
const tx = new web3_js_1.VersionedTransaction(messageV0);
|
|
80
|
+
const signers = [signer, ...(opts.extraSigners ?? [])];
|
|
81
|
+
tx.sign(signers);
|
|
82
|
+
const b64 = Buffer.from(tx.serialize()).toString("base64");
|
|
83
|
+
// Submit to primary AMS endpoint
|
|
84
|
+
const url = `${REGIONS[0]}/api/sendTransaction2?c=${key}`;
|
|
85
|
+
const t0 = Date.now();
|
|
86
|
+
const response = await fetch(url, {
|
|
87
|
+
method: "POST",
|
|
88
|
+
headers: { "Content-Type": "text/plain" },
|
|
89
|
+
body: b64,
|
|
90
|
+
signal: AbortSignal.timeout(10_000),
|
|
91
|
+
});
|
|
92
|
+
const latencyMs = Date.now() - t0;
|
|
93
|
+
const text = await response.text();
|
|
94
|
+
if (response.ok) {
|
|
95
|
+
// Response body is the signature string
|
|
96
|
+
const signature = text.trim();
|
|
97
|
+
if (signature && signature.length > 20) {
|
|
98
|
+
return { provider, accepted: true, signature, latencyMs };
|
|
99
|
+
}
|
|
100
|
+
// Try parsing as JSON in case endpoint returns wrapped response
|
|
101
|
+
try {
|
|
102
|
+
const json = JSON.parse(text);
|
|
103
|
+
if (json.signature || json.result) {
|
|
104
|
+
return { provider, accepted: true, signature: json.signature || json.result, latencyMs };
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
// Not JSON — use raw text
|
|
109
|
+
}
|
|
110
|
+
return { provider, accepted: true, signature: signature || undefined, latencyMs };
|
|
111
|
+
}
|
|
112
|
+
return { provider, accepted: false, error: `HTTP ${response.status}: ${text.slice(0, 200)}`, latencyMs };
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
return {
|
|
116
|
+
provider,
|
|
117
|
+
accepted: false,
|
|
118
|
+
error: err?.message || "Nozomi request failed",
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=nozomi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nozomi.js","sourceRoot":"","sources":["../../../../src/transactions/landing/providers/nozomi.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AA0JM,wCAAc;AAxJvB,6CAQyB;AACzB,oCAMkB;AAElB,8EAA8E;AAC9E,SAAS;AACT,8EAA8E;AAE9E,MAAM,YAAY,GAAG;IACnB,6CAA6C;IA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KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,CAAC;YAC3G,CAAC;YAAC,OAAO,GAAQ,EAAE,CAAC;gBAClB,OAAO;oBACL,QAAQ;oBACR,QAAQ,EAAE,KAAK;oBACf,KAAK,EAAE,GAAG,EAAE,OAAO,IAAI,uBAAuB;iBAC/C,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Soyas TX Landing Provider (QUIC via Go binary)
|
|
3
|
+
*
|
|
4
|
+
* Submits transactions via the `soyas-client` compiled Go binary,
|
|
5
|
+
* which communicates over QUIC with Soyas infrastructure.
|
|
6
|
+
* Uses child_process.execFile to invoke the binary.
|
|
7
|
+
*
|
|
8
|
+
* Binary path defaults to `<project-root>/soyas-client` but can be
|
|
9
|
+
* overridden via SOYAS_BINARY_PATH env var.
|
|
10
|
+
*
|
|
11
|
+
* Supports ping() to test binary connectivity.
|
|
12
|
+
*/
|
|
13
|
+
import { ILandingProvider } from "../types";
|
|
14
|
+
declare function createProvider(): ILandingProvider;
|
|
15
|
+
export { createProvider };
|
|
16
|
+
//# sourceMappingURL=soyas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"soyas.d.ts","sourceRoot":"","sources":["../../../../src/transactions/landing/providers/soyas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAaH,OAAO,EACL,gBAAgB,EAKjB,MAAM,UAAU,CAAC;AAiDlB,iBAAS,cAAc,IAAI,gBAAgB,CA6H1C;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Soyas TX Landing Provider (QUIC via Go binary)
|
|
4
|
+
*
|
|
5
|
+
* Submits transactions via the `soyas-client` compiled Go binary,
|
|
6
|
+
* which communicates over QUIC with Soyas infrastructure.
|
|
7
|
+
* Uses child_process.execFile to invoke the binary.
|
|
8
|
+
*
|
|
9
|
+
* Binary path defaults to `<project-root>/soyas-client` but can be
|
|
10
|
+
* overridden via SOYAS_BINARY_PATH env var.
|
|
11
|
+
*
|
|
12
|
+
* Supports ping() to test binary connectivity.
|
|
13
|
+
*/
|
|
14
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
+
}
|
|
20
|
+
Object.defineProperty(o, k2, desc);
|
|
21
|
+
}) : (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
o[k2] = m[k];
|
|
24
|
+
}));
|
|
25
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
26
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
27
|
+
}) : function(o, v) {
|
|
28
|
+
o["default"] = v;
|
|
29
|
+
});
|
|
30
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
31
|
+
var ownKeys = function(o) {
|
|
32
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
33
|
+
var ar = [];
|
|
34
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
return ownKeys(o);
|
|
38
|
+
};
|
|
39
|
+
return function (mod) {
|
|
40
|
+
if (mod && mod.__esModule) return mod;
|
|
41
|
+
var result = {};
|
|
42
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
+
__setModuleDefault(result, mod);
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.createProvider = createProvider;
|
|
49
|
+
const child_process_1 = require("child_process");
|
|
50
|
+
const path = __importStar(require("path"));
|
|
51
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
52
|
+
const types_1 = require("../types");
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
// Config
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
const TIP_ACCOUNTS = [
|
|
57
|
+
"soyas4s6L8KWZ8rsSk1mF3d1mQScoTGGAgjk98bF8nP",
|
|
58
|
+
"soyascXFW5wEEYiwfEmHy2pNwomqzvggJosGVD6TJdY",
|
|
59
|
+
"soyasDBdKjADwPz3xk82U3TNPRDKEWJj7wWLajNHZ1L",
|
|
60
|
+
"soyasE2abjBAynmHbGWgEwk4ctBy7JMTUCNrMbjcnyH",
|
|
61
|
+
];
|
|
62
|
+
const DEFAULT_TIP_SOL = 0.001;
|
|
63
|
+
const ENDPOINT = "ams.landing.soyas.xyz:9000";
|
|
64
|
+
// ---------------------------------------------------------------------------
|
|
65
|
+
// Helpers
|
|
66
|
+
// ---------------------------------------------------------------------------
|
|
67
|
+
function getBinaryPath() {
|
|
68
|
+
return (process.env.SOYAS_BINARY_PATH ||
|
|
69
|
+
path.join(__dirname, "../../../../soyas-client"));
|
|
70
|
+
}
|
|
71
|
+
function execBinary(args) {
|
|
72
|
+
const binaryPath = getBinaryPath();
|
|
73
|
+
return new Promise((resolve, reject) => {
|
|
74
|
+
(0, child_process_1.execFile)(binaryPath, args, { timeout: 15_000, maxBuffer: 1024 * 1024 }, (error, stdout, stderr) => {
|
|
75
|
+
if (error) {
|
|
76
|
+
reject(error);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
resolve({ stdout: stdout?.toString() || "", stderr: stderr?.toString() || "" });
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
// ---------------------------------------------------------------------------
|
|
85
|
+
// Provider
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
function createProvider() {
|
|
88
|
+
return {
|
|
89
|
+
name: "soyas",
|
|
90
|
+
isEnabled() {
|
|
91
|
+
return !!process.env.SOYAS_API_KEY;
|
|
92
|
+
},
|
|
93
|
+
async ping() {
|
|
94
|
+
// Test binary connectivity by calling with empty tx
|
|
95
|
+
const key = process.env.SOYAS_API_KEY || "";
|
|
96
|
+
await execBinary([ENDPOINT, key, ""]);
|
|
97
|
+
},
|
|
98
|
+
async submit(ixs, signer, blockhash, opts) {
|
|
99
|
+
const provider = this.name;
|
|
100
|
+
try {
|
|
101
|
+
const key = process.env.SOYAS_API_KEY || "";
|
|
102
|
+
if (!key) {
|
|
103
|
+
return { provider, accepted: false, error: "SOYAS_API_KEY not set" };
|
|
104
|
+
}
|
|
105
|
+
const tipSol = opts.tipSol && opts.tipSol > 0 ? opts.tipSol : DEFAULT_TIP_SOL;
|
|
106
|
+
const tipAccount = (0, types_1.pickRandom)(TIP_ACCOUNTS);
|
|
107
|
+
// Build tip instruction
|
|
108
|
+
const tipIx = web3_js_1.SystemProgram.transfer({
|
|
109
|
+
fromPubkey: signer.publicKey,
|
|
110
|
+
toPubkey: new web3_js_1.PublicKey(tipAccount),
|
|
111
|
+
lamports: Math.round(tipSol * web3_js_1.LAMPORTS_PER_SOL),
|
|
112
|
+
});
|
|
113
|
+
// Build V0 transaction — never mutate input ixs
|
|
114
|
+
const allIxs = [...ixs, tipIx];
|
|
115
|
+
const bh = (0, types_1.extractBlockhash)(blockhash);
|
|
116
|
+
const messageV0 = new web3_js_1.TransactionMessage({
|
|
117
|
+
payerKey: signer.publicKey,
|
|
118
|
+
recentBlockhash: bh,
|
|
119
|
+
instructions: allIxs,
|
|
120
|
+
}).compileToV0Message(opts.addressLookupTables);
|
|
121
|
+
const tx = new web3_js_1.VersionedTransaction(messageV0);
|
|
122
|
+
const signers = [signer, ...(opts.extraSigners ?? [])];
|
|
123
|
+
tx.sign(signers);
|
|
124
|
+
const b64 = Buffer.from(tx.serialize()).toString("base64");
|
|
125
|
+
// Call the Go binary: soyas-client <endpoint> <apiKey> <txBase64>
|
|
126
|
+
const t0 = Date.now();
|
|
127
|
+
const { stdout, stderr } = await execBinary([ENDPOINT, key, b64]);
|
|
128
|
+
const latencyMs = Date.now() - t0;
|
|
129
|
+
const output = stdout.trim();
|
|
130
|
+
// Check for errors in stderr or known error patterns in stdout
|
|
131
|
+
if (stderr && stderr.trim().length > 0) {
|
|
132
|
+
const errText = stderr.trim();
|
|
133
|
+
// Some binaries write status to stderr but succeed — check for explicit errors
|
|
134
|
+
if (errText.toLowerCase().includes("error") ||
|
|
135
|
+
errText.toLowerCase().includes("fail")) {
|
|
136
|
+
return {
|
|
137
|
+
provider,
|
|
138
|
+
accepted: false,
|
|
139
|
+
error: errText.slice(0, 200),
|
|
140
|
+
latencyMs,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
// If stdout looks like a signature (base58, 87-88 chars), treat as success
|
|
145
|
+
if (output && output.length >= 43 && !output.toLowerCase().includes("error")) {
|
|
146
|
+
return { provider, accepted: true, signature: output, latencyMs };
|
|
147
|
+
}
|
|
148
|
+
// Try to parse stdout as JSON
|
|
149
|
+
try {
|
|
150
|
+
const json = JSON.parse(output);
|
|
151
|
+
if (json.signature || json.result) {
|
|
152
|
+
return {
|
|
153
|
+
provider,
|
|
154
|
+
accepted: true,
|
|
155
|
+
signature: json.signature || json.result,
|
|
156
|
+
latencyMs,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
if (json.error) {
|
|
160
|
+
return {
|
|
161
|
+
provider,
|
|
162
|
+
accepted: false,
|
|
163
|
+
error: typeof json.error === "string" ? json.error : JSON.stringify(json.error),
|
|
164
|
+
latencyMs,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
catch {
|
|
169
|
+
// Not JSON — use raw output
|
|
170
|
+
}
|
|
171
|
+
// Fallback: if we got here with no error and some output, assume accepted
|
|
172
|
+
if (output.length > 0) {
|
|
173
|
+
return { provider, accepted: true, signature: output || undefined, latencyMs };
|
|
174
|
+
}
|
|
175
|
+
return {
|
|
176
|
+
provider,
|
|
177
|
+
accepted: false,
|
|
178
|
+
error: "Empty response from soyas-client binary",
|
|
179
|
+
latencyMs,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
catch (err) {
|
|
183
|
+
return {
|
|
184
|
+
provider,
|
|
185
|
+
accepted: false,
|
|
186
|
+
error: err?.message || "Soyas binary execution failed",
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=soyas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"soyas.js","sourceRoot":"","sources":["../../../../src/transactions/landing/providers/soyas.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmMM,wCAAc;AAjMvB,iDAAyC;AACzC,2CAA6B;AAC7B,6CAQyB;AACzB,oCAMkB;AAElB,8EAA8E;AAC9E,SAAS;AACT,8EAA8E;AAE9E,MAAM,YAAY,GAAG;IACnB,6CAA6C;IAC7C,6CAA6C;IAC7C,6CAA6C;IAC7C,6CAA6C;CACrC,CAAC;AAEX,MAAM,eAAe,GAAG,KAAK,CAAC;AAC9B,MAAM,QAAQ,GAAG,4BAA4B,CAAC;AAE9C,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,SAAS,aAAa;IACpB,OAAO,CACL,OAAO,CAAC,GAAG,CAAC,iBAAiB;QAC7B,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,0BAA0B,CAAC,CACjD,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,IAAc;IAChC,MAAM,UAAU,GA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4BACL,QAAQ;4BACR,QAAQ,EAAE,IAAI;4BACd,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM;4BACxC,SAAS;yBACV,CAAC;oBACJ,CAAC;oBACD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;wBACf,OAAO;4BACL,QAAQ;4BACR,QAAQ,EAAE,KAAK;4BACf,KAAK,EAAE,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;4BAC/E,SAAS;yBACV,CAAC;oBACJ,CAAC;gBACH,CAAC;gBAAC,MAAM,CAAC;oBACP,4BAA4B;gBAC9B,CAAC;gBAED,0EAA0E;gBAC1E,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACtB,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,IAAI,SAAS,EAAE,SAAS,EAAE,CAAC;gBACjF,CAAC;gBAED,OAAO;oBACL,QAAQ;oBACR,QAAQ,EAAE,KAAK;oBACf,KAAK,EAAE,yCAAyC;oBAChD,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,+BAA+B;iBACvD,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stellium TX Landing Provider (FlashRPC)
|
|
3
|
+
*
|
|
4
|
+
* Submits transactions via Stellium's HTTP JSON-RPC endpoint.
|
|
5
|
+
* API key is embedded as a URL path segment.
|
|
6
|
+
* Supports ping() for health checking.
|
|
7
|
+
*/
|
|
8
|
+
import { ILandingProvider } from "../types";
|
|
9
|
+
declare function createProvider(): ILandingProvider;
|
|
10
|
+
export { createProvider };
|
|
11
|
+
//# sourceMappingURL=stellium.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stellium.d.ts","sourceRoot":"","sources":["../../../../src/transactions/landing/providers/stellium.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH,OAAO,EACL,gBAAgB,EAKjB,MAAM,UAAU,CAAC;AAoBlB,iBAAS,cAAc,IAAI,gBAAgB,CA6F1C;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|