Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const configsByEnvironment: Record<NearIntentsEnv, EnvConfig> = {
poaBridgeBaseURL: "https://bridge.chaindefuser.com",
solverRelayBaseURL: "https://solver-relay-v2.chaindefuser.com",
managerConsoleBaseURL: "https://api-mng-console.chaindefuser.com/api/",
nearIntentsBaseURL: "https://app.near-intents.org/api/",
nearIntentsBaseURL: "https://near-intents.org/api/",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify reachability & downstream concatenation assumptions for new base URL

The domain changed from app.near-intents.org to near-intents.org.

  1. Make sure the new endpoint is already live and does not rely on HTTP → HTTPS or sub-domain redirects, otherwise SDK calls will break in production.
  2. All call-sites that append path segments must account for the preserved trailing slash; absence/presence mismatches can silently produce URLs with double slashes or missing separators.

Run the quick grep below to surface any concatenations that may already include a leading slash (look for /${config.env.nearIntentsBaseURL}-style patterns):


🏁 Script executed:

#!/bin/bash
# List files where nearIntentsBaseURL is concatenated with a literal '/'
rg --line-number --fixed-strings "${config.env.nearIntentsBaseURL}/" || true

Length of output: 122


🏁 Script executed:

#!/bin/bash
# Search for all references to nearIntentsBaseURL to inspect how it’s used/concatenated
rg --line-number -C2 "nearIntentsBaseURL" || true

Length of output: 1197


🏁 Script executed:

#!/bin/bash
set -e

echo "Testing production endpoint (near-intents.org/api/):"
curl -Is http://near-intents.org/api/ | head -n1
curl -Is https://near-intents.org/api/ | head -n1

echo
echo "Testing stage endpoint (stage.near-intents.org/api/):"
curl -Is http://stage.near-intents.org/api/ | head -n1
curl -Is https://stage.near-intents.org/api/ | head -n1

Length of output: 555


Confirm direct HTTPS & trailing‐slash behavior for nearIntentsBaseURL

File: src/config.ts
Line: 34

nearIntentsBaseURL: "https://near-intents.org/api/",

Requests to both near-intents.org/api/ and stage.near-intents.org/api/ currently return HTTP 301/308 redirects:

  • http://…/api/ → 301 Moved Permanently (to HTTPS)
  • https://…/api/ → 308 Permanent Redirect
  1. Ensure your SDK’s HTTP client automatically follows these redirects in production, or update the base URL to point directly at the final HTTPS endpoint (e.g. https://near-intents.org/api without the trailing slash) to avoid extra round-trips or potential breakage.
  2. I searched for all nearIntentsBaseURL references and found one concatenation:
    • src/queries/solverLiquidityQuerires.ts (line 20):
    url: `${globalConfig.env.nearIntentsBaseURL}solver_liquidity`
    This is correct given the trailing slash. No other call-sites append a leading slash—please keep future concatenations consistent with the preserved slash semantics to prevent malformed URLs.
🤖 Prompt for AI Agents
In src/config.ts at line 34, the nearIntentsBaseURL includes a trailing slash
causing HTTP redirects when used. To fix this, remove the trailing slash from
the URL to directly use the final HTTPS endpoint (change to
"https://near-intents.org/api"). Also, ensure all future URL concatenations
respect this no-trailing-slash format by adding slashes explicitly in
concatenations to avoid malformed URLs, as currently done in
src/queries/solverLiquidityQuerires.ts line 20.

},
stage: {
contractID: "staging-intents.near",
Expand Down