Skip to content

Commit 95ed0f9

Browse files
committed
normalize jsonrpc
1 parent e763311 commit 95ed0f9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/server/handlers/private-api.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,13 @@ const broadcastTronTransaction = async (
688688
node: ChainstackNode,
689689
signedPayload: string,
690690
): Promise<ChainBroadcastResponse> => {
691-
const endpoint = ensureHttpsEndpoint(node).replace(/\/+$/, "");
691+
const baseEndpoint =
692+
node.details?.solidity_http_api_endpoint?.replace(/\/+$/, "") || ensureHttpsEndpoint(node).replace(/\/+$/, "");
693+
694+
const endpoint = baseEndpoint.endsWith("/jsonrpc")
695+
? baseEndpoint.slice(0, -"/jsonrpc".length)
696+
: baseEndpoint;
697+
692698
const config = buildNodeAxiosConfig(node);
693699

694700
const normalizedPayload = signedPayload.startsWith("0x") ? signedPayload.slice(2) : signedPayload;

0 commit comments

Comments
 (0)