From b3f74dbbb745b7eabd5b136702bd8bdbe1f9924e Mon Sep 17 00:00:00 2001 From: Phu Pham Date: Wed, 22 Jan 2025 16:39:35 -0500 Subject: [PATCH] fix ledger api_version and use different url for amendment backtracking --- src/connection-manager/wsHandling.ts | 4 ++++ src/shared/database/amendments.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/connection-manager/wsHandling.ts b/src/connection-manager/wsHandling.ts index 86fb450..172449d 100644 --- a/src/connection-manager/wsHandling.ts +++ b/src/connection-manager/wsHandling.ts @@ -264,11 +264,15 @@ async function backtrackNetworkAmendmentStatus( index < currentLedger; index += 256 ) { + // Use api V1 instead of the default (V2) since we don't have the correct + // LedgerResponseExpanded type for V2 + // TODO: change to V2 once the issue is fixed. const ledger: LedgerResponse = await client.request({ command: 'ledger', transactions: true, ledger_index: index, expand: true, + api_version: 1, }) await handleWsMessageLedgerEnableAmendments( diff --git a/src/shared/database/amendments.ts b/src/shared/database/amendments.ts index a637ecf..adf6eff 100644 --- a/src/shared/database/amendments.ts +++ b/src/shared/database/amendments.ts @@ -39,7 +39,7 @@ const AMENDMENT_VERSION_REGEX = /\| \[(?[a-zA-Z0-9_]+)\][^\n]+\| (?v[0-9]*\.[0-9]*\.[0-9]*|TBD) *\|/u export const NETWORKS_HOSTS = new Map([ - ['main', 'ws://s2.ripple.com:51233'], + ['main', 'wss://xrplcluster.com'], ['test', 'wss://s.altnet.rippletest.net:51233'], ['dev', 'wss://s.devnet.rippletest.net:51233'], ])