From d86f3be9bb2b20b1d2e60333392347747fd1ea50 Mon Sep 17 00:00:00 2001 From: scolear Date: Mon, 11 Nov 2024 17:39:23 +0100 Subject: [PATCH] fix: rawVault.uuid --- package.json | 1 + src/app/functions/vault.functions.ts | 1 - src/app/hooks/use-icy-psbt.ts | 12 ++++++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 813c749b..75caa5dc 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "testnet": "vite --mode testnet", "mainnet": "vite --mode mainnet", "build": "tsc && vite build", + "clean": "rm -rf node_modules", "lint": "concurrently -g 'yarn lint:prettier' 'yarn lint:unused-exports' 'yarn run lint:eslint' 'yarn run lint:filename'", "lint:eslint": "eslint \"src/**/*.{ts,tsx}\"", "lint:filename": "ls-lint", diff --git a/src/app/functions/vault.functions.ts b/src/app/functions/vault.functions.ts index 562ada49..604d7621 100644 --- a/src/app/functions/vault.functions.ts +++ b/src/app/functions/vault.functions.ts @@ -3,7 +3,6 @@ import { RawVault } from 'dlc-btc-lib/models'; import { unshiftValue } from 'dlc-btc-lib/utilities'; export function formatVault(vault: RawVault): Vault { - console.log('vault', vault); return { uuid: vault.uuid, timestamp: vault.timestamp.toNumber(), diff --git a/src/app/hooks/use-icy-psbt.ts b/src/app/hooks/use-icy-psbt.ts index adacd4ec..e6aa3215 100644 --- a/src/app/hooks/use-icy-psbt.ts +++ b/src/app/hooks/use-icy-psbt.ts @@ -114,9 +114,13 @@ export function useOneClickYieldPSBT(): UseOneClickYieldPSBTReturnType { vaultUUID: string ): Promise { try { - const rawVault = await fetchICYVault(vaultUUID); + let rawVault = await fetchICYVault(vaultUUID); if (!dlcHandler) throw new Error('DLC Handler is not setup'); + console.log('rawVault', rawVault); + const uuid = rawVault.uuid; + rawVault = { ...rawVault, uuid: paddedHexString }; + const feeRateMultiplier = import.meta.env.VITE_FEE_RATE_MULTIPLIER; // const attestorGroupPublicKey = await getAttestorGroupPublicKey(dlcManagerContract); @@ -139,12 +143,12 @@ export function useOneClickYieldPSBT(): UseOneClickYieldPSBTReturnType { } await submit1CYWithdrawDepositPSBT([appConfiguration.coordinatorURL], { - vaultUUID: mockVault.uuid, + vaultUUID: uuid, withdrawDepositPSBT: withdrawalTransactionHex, attestorChainID: 'evm-hardhat-arb', userBitcoinTaprootPublicKey: dlcHandler.getTaprootDerivedPublicKey(), - valueLocked: mockVault.valueLocked.toString(), - integrationAddress: paddedHexString, + valueLocked: rawVault.valueLocked.toString(), + integrationAddress: paddedHexString.slice(2), }); // resetBitcoinWalletContext();