From b7a6e5524e1a3d1f3bdec0a4c73d8b96404e1cc0 Mon Sep 17 00:00:00 2001 From: Lucas Magnus Date: Wed, 17 Jan 2024 14:17:05 -0300 Subject: [PATCH] add vcRpc to deposit contract --- frontend/src/hooks/useContracts/context.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/hooks/useContracts/context.tsx b/frontend/src/hooks/useContracts/context.tsx index ef217fa5..ca821d45 100644 --- a/frontend/src/hooks/useContracts/context.tsx +++ b/frontend/src/hooks/useContracts/context.tsx @@ -4,7 +4,7 @@ import freighter from '@stellar/freighter-api' import { FeeBumpTransaction, Transaction } from '@stellar/stellar-sdk' import axios from 'axios' import { useHorizon } from 'hooks/useHorizon' -import { STELLAR_NETWORK } from 'soroban/constants' +import { STELLAR_NETWORK, vcRpcHandler } from 'soroban/constants' import { StellarPlus } from 'stellar-plus' import { CertificateOfDepositClient } from 'stellar-plus/lib/stellar-plus/soroban/contracts/certificate-of-deposit' import { TransactionXdr } from 'stellar-plus/lib/stellar-plus/types' @@ -144,6 +144,7 @@ export const ContractsProvider: React.FC = ({ children }) => { return new StellarPlus.Contracts.CertificateOfDeposit({ network: STELLAR_NETWORK, contractId: contractId, + rpcHandler: vcRpcHandler }) } @@ -180,11 +181,14 @@ export const ContractsProvider: React.FC = ({ children }) => { ...userTxInvocation(sourcePk), }) + console.log(3) setIsDepositing(false) setDepositConfirmed(true) setTimeout(() => setDepositConfirmed(false), 5000) return true - } catch (error) { + } catch (error : any) { + console.log(error) + console.log(error.meta) if (axios.isAxiosError(error)) { throw new Error(error.message) }