diff --git a/package.json b/package.json index 906f0f5a..5569f4fa 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "concurrently": "^8.2.2", "d3": "^7.9.0", "decimal.js": "^10.4.3", - "dlc-btc-lib": "2.4.7", + "dlc-btc-lib": "2.4.8", "dotenv": "^16.3.1", "ethers": "5.7.2", "formik": "^2.4.5", diff --git a/src/app/hooks/use-psbt.ts b/src/app/hooks/use-psbt.ts index 7f83cc64..926f3606 100644 --- a/src/app/hooks/use-psbt.ts +++ b/src/app/hooks/use-psbt.ts @@ -36,7 +36,10 @@ export function usePSBT(): UsePSBTReturnType { } = useContext(EthereumNetworkConfigurationContext); const { address: ethereumUserAddress } = useAccount(); const { userAddress: rippleUserAddress } = useContext(XRPWalletContext); - const { rippleClient } = useContext(RippleNetworkConfigurationContext); + const { + rippleClient, + rippleNetworkConfiguration: { rippleAttestorChainID }, + } = useContext(RippleNetworkConfigurationContext); const { bitcoinWalletType, dlcHandler, resetBitcoinWalletContext } = useContext(BitcoinWalletContext); @@ -96,7 +99,7 @@ export function usePSBT(): UsePSBTReturnType { if (networkType === 'evm') { return ethereumAttestorChainID; } else if (networkType === 'xrpl') { - return 'ripple-xrpl-testnet'; + return rippleAttestorChainID; } else { throw new Error('Network Type is not setup'); } diff --git a/src/app/hooks/use-xrpl-gem.ts b/src/app/hooks/use-xrpl-gem.ts index d494bdda..c69fdacb 100644 --- a/src/app/hooks/use-xrpl-gem.ts +++ b/src/app/hooks/use-xrpl-gem.ts @@ -19,7 +19,10 @@ interface useXRPLGemReturnType { } export function useGemWallet(): useXRPLGemReturnType { - const { rippleClient } = useContext(RippleNetworkConfigurationContext); + const { + rippleClient, + rippleNetworkConfiguration: { rippleAttestorChainID }, + } = useContext(RippleNetworkConfigurationContext); const [isLoading, setIsLoading] = useState<[boolean, string]>([false, '']); @@ -73,7 +76,11 @@ export function useGemWallet(): useXRPLGemReturnType { setIsLoading([true, 'Waiting for Check to be processed']); - return await xrpHandler.sendCheckTXHash(appConfiguration.coordinatorURL, txHash); + return await xrpHandler.sendCheckTXHash( + appConfiguration.coordinatorURL, + txHash, + rippleAttestorChainID + ); } catch (error) { throw new GemError(`Error creating Check: ${error}`); } finally { diff --git a/src/app/hooks/use-xrpl-ledger.ts b/src/app/hooks/use-xrpl-ledger.ts index 8e45b5cf..4ee657b8 100644 --- a/src/app/hooks/use-xrpl-ledger.ts +++ b/src/app/hooks/use-xrpl-ledger.ts @@ -21,7 +21,10 @@ interface useXRPLLedgerReturnType { type TransportInstance = Awaited>; export function useXRPLLedger(): useXRPLLedgerReturnType { - const { rippleClient } = useContext(RippleNetworkConfigurationContext); + const { + rippleClient, + rippleNetworkConfiguration: { rippleAttestorChainID }, + } = useContext(RippleNetworkConfigurationContext); const [isLoading, setIsLoading] = useState<[boolean, string]>([false, '']); @@ -127,7 +130,11 @@ export function useXRPLLedger(): useXRPLLedgerReturnType { setIsLoading([true, 'Waiting for Check to be processed']); - return await currentXRPHandler.sendCheckTXHash(appConfiguration.coordinatorURL, txHash); + return await currentXRPHandler.sendCheckTXHash( + appConfiguration.coordinatorURL, + txHash, + rippleAttestorChainID + ); } catch (error) { throw new LedgerError(`Error creating Check: ${error}`); } finally { diff --git a/src/app/providers/ripple-network-configuration.provider.tsx b/src/app/providers/ripple-network-configuration.provider.tsx index b0f3c3dd..d5bbd2aa 100644 --- a/src/app/providers/ripple-network-configuration.provider.tsx +++ b/src/app/providers/ripple-network-configuration.provider.tsx @@ -32,13 +32,13 @@ function getRippleNetworkConfiguration( return { rippleExplorerAPIURL: 'https://livenet.xrpl.org/', websocketURL: 'wss://s1.ripple.com/', - ripplemAttestorChainID: 'xrpl-ripple-mainnet', + rippleAttestorChainID: 'ripple-xrpl-mainnet', }; case RippleNetworkID.Testnet: return { rippleExplorerAPIURL: 'https://testnet.xrpl.org/', websocketURL: 'wss://s.altnet.rippletest.net:51233', - ripplemAttestorChainID: 'xrpl-ripple-testnet', + rippleAttestorChainID: 'ripple-xrpl-testnet', }; default: diff --git a/src/shared/models/ripple.models.ts b/src/shared/models/ripple.models.ts index 7d4795c2..75ac3b3d 100644 --- a/src/shared/models/ripple.models.ts +++ b/src/shared/models/ripple.models.ts @@ -1,3 +1,5 @@ +import { AttestorChainID } from 'dlc-btc-lib/models'; + export interface RippleNetwork { id: RippleNetworkID; name: string; @@ -11,5 +13,5 @@ export enum RippleNetworkID { export interface RippleNetworkConfiguration { rippleExplorerAPIURL: string; websocketURL: string; - ripplemAttestorChainID: 'xrpl-ripple-mainnet' | 'xrpl-ripple-testnet'; + rippleAttestorChainID: AttestorChainID; } diff --git a/yarn.lock b/yarn.lock index d829008a..f62573c4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5195,10 +5195,10 @@ dir-glob@^3.0.1: dependencies: path-type "^4.0.0" -dlc-btc-lib@2.4.7: - version "2.4.7" - resolved "https://registry.yarnpkg.com/dlc-btc-lib/-/dlc-btc-lib-2.4.7.tgz#9b40484ebe6529bf89e43b721b8fb8380946bf3d" - integrity sha512-X+OLDd13tZFC4/PTos9ozFaW7PGRDEP9zWA6TnLGyyi5TeorBioI5X5yOx9OV709pFjbmti+4qqJ08d/oHIjtQ== +dlc-btc-lib@2.4.8: + version "2.4.8" + resolved "https://registry.yarnpkg.com/dlc-btc-lib/-/dlc-btc-lib-2.4.8.tgz#dd59f49b5f3df6a788843b2501a60f7048fbc304" + integrity sha512-06SAymipYWEvb/23JUs+iU6hF7qmBs+ck6iI2kQoZT9dsqDre7w6JcmSGtzPFzwupycfV/z8S8XRJ1eR02lNgw== dependencies: "@gemwallet/api" "3.8.0" "@ledgerhq/hw-app-btc" "10.4.1"