felix-mcp 2.0.123 → 2.0.128
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/README.md +26 -3
- package/dist/arc-hl-return-ports.js +15 -2
- package/dist/arc-hl-return.js +4 -2
- package/dist/arc-home.js +3 -10
- package/dist/arc-hypercore-funding.js +1076 -0
- package/dist/arc-hypercore-return.js +826 -0
- package/dist/arc-pm-return.js +28 -3
- package/dist/arc-safe-invalidation-hints.js +209 -0
- package/dist/arc-safe-invalidation.js +672 -0
- package/dist/arc-venue-app-policy.js +30 -0
- package/dist/funding.js +192 -25
- package/dist/getting-started-guide.js +6 -1
- package/dist/http-server.js +25 -8
- package/dist/index.js +511 -43
- package/dist/polymarket.js +5 -3
- package/dist/public-venue.js +35 -0
- package/dist/rpc-endpoints.js +133 -0
- package/dist/safe-migration.js +7 -3
- package/dist/safe-onboarding.js +58 -49
- package/dist/safe-policy.js +39 -28
- package/package.json +14 -2
- package/server.json +2 -2
package/README.md
CHANGED
|
@@ -7,9 +7,32 @@
|
|
|
7
7
|
Non-custodial trading tools for AI agents across Hyperliquid, Polymarket, and
|
|
8
8
|
Derive. Live execution is the default; paper mode must be selected explicitly.
|
|
9
9
|
|
|
10
|
-
Package version: `felix-mcp@2.0.
|
|
10
|
+
Package version: `felix-mcp@2.0.128`. For prepublication review, use the local
|
|
11
11
|
tarball below. Packaging checks do not certify live money workflows.
|
|
12
12
|
|
|
13
|
+
## Hosted (no install)
|
|
14
|
+
|
|
15
|
+
Connect any MCP client that can send a header to the hosted endpoint:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
claude mcp add --transport http felix https://mcp.felix.trade/mcp \
|
|
19
|
+
--header "Authorization: Bearer fk_YOUR_KEY"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Every request is checked against your API key; revoking the key cuts access on
|
|
23
|
+
the next request. Local signing, key switching and Keychain storage need the
|
|
24
|
+
npm install below.
|
|
25
|
+
|
|
26
|
+
## Chain RPCs (never public)
|
|
27
|
+
|
|
28
|
+
This client never uses a public RPC. Funding and fee top-ups go through Felix's
|
|
29
|
+
authenticated, intent-bound RPC relay. Optionally set `FELIX_POLYGON_RPC_URL`
|
|
30
|
+
(and `FELIX_ARBITRUM_RPC_URL`, `FELIX_ARC_RPC_URL`) to your own private endpoint:
|
|
31
|
+
the client then also re-reads your Safe's on-chain state before signing
|
|
32
|
+
onboarding, policy and withdrawal transactions (without one it trusts Felix's
|
|
33
|
+
verified state, as the app does). The legacy Safe V3 migration and owner-paid
|
|
34
|
+
broadcasts outside the relay require your own endpoint; a public host is refused.
|
|
35
|
+
|
|
13
36
|
## Install
|
|
14
37
|
|
|
15
38
|
### 1. Install
|
|
@@ -25,14 +48,14 @@ node --version
|
|
|
25
48
|
npm ci
|
|
26
49
|
candidate_dir="$(mktemp -d)"
|
|
27
50
|
npm pack --pack-destination "$candidate_dir"
|
|
28
|
-
npm install --global "$candidate_dir/felix-mcp-2.0.
|
|
51
|
+
npm install --global "$candidate_dir/felix-mcp-2.0.128.tgz"
|
|
29
52
|
felix-keys --help
|
|
30
53
|
```
|
|
31
54
|
|
|
32
55
|
After the operator publishes this version, the registry installation is:
|
|
33
56
|
|
|
34
57
|
```bash
|
|
35
|
-
npm install --global felix-mcp@2.0.
|
|
58
|
+
npm install --global felix-mcp@2.0.128
|
|
36
59
|
```
|
|
37
60
|
|
|
38
61
|
### 2. Set up keys locally
|
|
@@ -23,8 +23,12 @@
|
|
|
23
23
|
// journal the encrypted money-workflow journal context, unchanged.
|
|
24
24
|
import { keccak256, parseTransaction, encodeFunctionData, decodeEventLog } from "viem";
|
|
25
25
|
import { HL_ARC_ARBITRUM_BROADCAST_SCOPE, HL_ARC_CHAIN, settlementSignerPort, } from "./arc-hl-return.js";
|
|
26
|
+
import { requirePrivateRpcUrl } from "./rpc-endpoints.js";
|
|
26
27
|
export const HL_API_DEFAULT = "https://api.hyperliquid.xyz";
|
|
27
|
-
|
|
28
|
+
// NO_PUBLIC_RPC_2026_09_25: there is no Arbitrum RPC default. The owner-address
|
|
29
|
+
// reads (nonce, balance, receipts) require FELIX_ARBITRUM_RPC_URL and refuse a
|
|
30
|
+
// public host; resolveHlArcEndpoints is called at use (productionHlArcPorts),
|
|
31
|
+
// so an unset variable surfaces as hl_return_endpoint_invalid, never at import.
|
|
28
32
|
const MAX_RESPONSE_BYTES = 1_000_000;
|
|
29
33
|
const TIMEOUT_MS = 20_000;
|
|
30
34
|
const ARC_NATIVE_USDC_EMITTER = "0xfffffffffffffffffffffffffffffffffffffffe";
|
|
@@ -57,12 +61,21 @@ function endpoint(value, fallback, { allowRemoteOverride }) {
|
|
|
57
61
|
}
|
|
58
62
|
return url.toString().replace(/\/$/, "");
|
|
59
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Only Hyperliquid's own API: the HL -> Arbitrum -> Relay route needs no client
|
|
66
|
+
* Arbitrum or Arc RPC (Felix proves the payout and the credit with quorum reads).
|
|
67
|
+
* Same rule as below: a remote override is refused so a mis-set variable cannot
|
|
68
|
+
* redirect a signed withdraw3.
|
|
69
|
+
*/
|
|
70
|
+
export function resolveHyperliquidEndpoint(env = process.env) {
|
|
71
|
+
return endpoint(env.FELIX_HYPERLIQUID_API_URL, HL_API_DEFAULT, { allowRemoteOverride: false });
|
|
72
|
+
}
|
|
60
73
|
export function resolveHlArcEndpoints(env = process.env) {
|
|
61
74
|
return {
|
|
62
75
|
// The signed withdraw3 only ever goes to Hyperliquid's own API; a remote
|
|
63
76
|
// override is refused so a mis-set variable cannot redirect a signature.
|
|
64
77
|
hyperliquid: endpoint(env.FELIX_HYPERLIQUID_API_URL, HL_API_DEFAULT, { allowRemoteOverride: false }),
|
|
65
|
-
arbitrumRpc: endpoint(env.FELIX_ARBITRUM_RPC_URL,
|
|
78
|
+
arbitrumRpc: requirePrivateRpcUrl("arbitrum", endpoint(env.FELIX_ARBITRUM_RPC_URL, null, { allowRemoteOverride: true })),
|
|
66
79
|
arcRpc: endpoint(env.FELIX_ARC_RPC_URL, null, { allowRemoteOverride: true }),
|
|
67
80
|
};
|
|
68
81
|
}
|
package/dist/arc-hl-return.js
CHANGED
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
// the planned value from 0x0 to the Safe, AND a Safe balance increase of at
|
|
50
50
|
// least that value across the mint block, read at finalized heights.
|
|
51
51
|
import { redactOutput } from "./redact-output.js";
|
|
52
|
+
import { recordVenueIs } from "./public-venue.js";
|
|
52
53
|
import { createHash } from "node:crypto";
|
|
53
54
|
import { privateKeyToAccount } from "viem/accounts";
|
|
54
55
|
import { assertBurnIntentMatches, settlementOwnerAddress, signBurnIntent } from "./arc-settlement.js";
|
|
@@ -551,7 +552,8 @@ class Driver {
|
|
|
551
552
|
}
|
|
552
553
|
validatePrepared(out) {
|
|
553
554
|
const bad = (why) => this.hold("hl_return_prepare_payload_invalid", `The prepared withdrawal failed the client check (${why}); it was not signed.`, { money_moved: false });
|
|
554
|
-
|
|
555
|
+
// venue:"hyperliquid" arrives as market:"crypto" through the public API scrub.
|
|
556
|
+
if (out.ok !== true || !recordVenueIs(out, "hyperliquid") || out.home !== "arc"
|
|
555
557
|
|| out.stage !== "venue_withdrawal" || out.status !== "venue_withdrawal_prepared"
|
|
556
558
|
|| out.money_moved !== false || out.home_usable !== false || out.operation_created !== false) {
|
|
557
559
|
bad("stage");
|
|
@@ -915,7 +917,7 @@ class Driver {
|
|
|
915
917
|
const bad = (why) => this.hold("hl_return_deposit_plan_invalid", `The Arc deposit failed the client check (${why}); nothing was signed for it.`, { money_moved: true });
|
|
916
918
|
if (!UUID_RE.test(String(out.operation_id)) || out.kind !== "arc_deposit_in"
|
|
917
919
|
|| out.intent_id !== prepared.intent_id || out.purpose !== "hyperliquid_arc_home_return"
|
|
918
|
-
|| out
|
|
920
|
+
|| !recordVenueIs(out, "hyperliquid") || out.home !== "arc" || out.stage !== "arc_deposit") {
|
|
919
921
|
bad("identity");
|
|
920
922
|
}
|
|
921
923
|
if (String(out.spoke_arrived_units) !== proven.arrived_units
|
package/dist/arc-home.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
// zero safeTxGas/baseGas and a zero refundReceiver; a payload that sets any of
|
|
11
11
|
// those would let a relayer drain the Safe for "gas", so they are checked.
|
|
12
12
|
import { concatHex, createPublicClient, defineChain, encodeAbiParameters, encodeFunctionData, getAddress, hashStruct, hashTypedData, http, keccak256, pad, parseAbi, toFunctionSelector, } from "viem";
|
|
13
|
+
import { optionalPrivateRpc } from "./rpc-endpoints.js";
|
|
13
14
|
import { privateKeyToAccount } from "viem/accounts";
|
|
14
15
|
import { getRuntimeOwnerPrivateKey } from "./secret-state.js";
|
|
15
16
|
import { ARC_BROADCAST_RECEIPT_GRACE_MS, broadcastSignedTransaction, relayRetry, } from "./arc-settlement.js";
|
|
@@ -982,16 +983,8 @@ export function publicArcHomeRecord(parsed) {
|
|
|
982
983
|
}
|
|
983
984
|
// --------------------------------------------------------------------------- source-chain broadcasting
|
|
984
985
|
export function arcHomeChainRpcUrl(chain) {
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
process.env[`FELIX_${name}_RPC_URL`],
|
|
988
|
-
name === "POLYGON" ? process.env.FELIX_POLYGON_RPC_URL : undefined,
|
|
989
|
-
];
|
|
990
|
-
for (const candidate of candidates) {
|
|
991
|
-
if (typeof candidate === "string" && /^https?:\/\//.test(candidate))
|
|
992
|
-
return candidate;
|
|
993
|
-
}
|
|
994
|
-
return undefined;
|
|
986
|
+
// NO_PUBLIC_RPC_20261115: only the user's own FELIX_<CHAIN>_RPC_URL; a public host refuses.
|
|
987
|
+
return optionalPrivateRpc(chain.trim().toLowerCase()) ?? undefined;
|
|
995
988
|
}
|
|
996
989
|
function ownerChain(chainId) {
|
|
997
990
|
return defineChain({
|