XRPL-Labs/XrplTxData

Getting ALL_CONNECTIONS_FAILED: All endpoints are offline (or don't provide full history) using xrpl-txdata version-1.2.1

KumarUjjwal2022 opened this issue · 2 comments

Hi Team,

I am getting this issue i.e. ALL_CONNECTIONS_FAILED: All endpoints are offline (or don't provide full history) while using xrpl-txdata version 1.2.1 in nodejs version 18.16.0 from few days while verifying xrpl NFT exchange transaction and this is public platform.

My code to verify transaction is :-
'use strict';
require("dotenv").config();
const { XummSdk } = require("xumm-sdk");
const { TxData } = require('xrpl-txdata');
const XUMM_API_KEY = process.env.XUMM_API_KEY;
const XUMM_API_SECRET = process.env.XUMM_API_SECRET;
const Sdk = new XummSdk(XUMM_API_KEY, XUMM_API_SECRET);
const VerifyTx = new TxData([
'wss://xrplcluster.com',
'wss://s2.ripple.com',
'wss://xrpl.link'
], {
EndpointTimeoutMs: 750,
OverallTimeoutMs: 5000,
AllowNoFullHistory: false
})

/* Verify Transaction with Tx Id*/
async function verifyTransaction(resolveData) {
try {
const result = await Sdk.payload.get(resolveData.payload_uuidv4)
const VerifiedResult = await VerifyTx.get(result.response.txid, 20)
const { meta: { TransactionResult }} = VerifiedResult.result;
const balanceCheck = isEmpty(VerifiedResult.balanceChanges);
return { balanceCheck, TransactionResult };
} catch (error) {
console.log("error verifytransaction",error)
return {error};
}
}

function isEmpty(obj) {
return Object.keys(obj).length === 0;
}

module.exports = { verifyTransaction };

Please suggest me what to do, Should I update npm package or what is the solution?
Thanking for any help.

Can you please retry with version 1.3.0 (the lastest on NPM)

Thanks @WietseWind , Let me update NPM once. I'll inform you, When updated. As its working in my local environment but fails on production.