Skip to content

Commit

Permalink
add logs to track address
Browse files Browse the repository at this point in the history
  • Loading branch information
jhesgodi committed Feb 29, 2024
1 parent cb0c575 commit f1e0a1b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,21 @@ export const useSignOrder = (input: SignOrderInput) => {
paymentType: SalePaymentTypes,
fromTokenAddress: string,
): Promise<SignResponse | undefined> => {
const signer = provider?.getSigner();
const spenderAddress = await signer?.getAddress() || '';
console.log('🚀 ~ SignApiRequest.spenderAddress:', spenderAddress); // eslint-disable-line
console.log('🚀 ~ SignApiRequest.recipientAddress:', recipientAddress); // eslint-disable-line

if (!recipientAddress) {
setSignError({
type: SaleErrorTypes.SERVICE_BREAKDOWN, data: { reason: 'No recipient address' },
});
return undefined;
}

try {
const data: SignApiRequest = {
recipient_address: '',
recipient_address: recipientAddress,
payment_type: paymentType,
currency_filter: SignCurrencyFilter.CONTRACT_ADDRESS,
currency_value: fromTokenAddress,
Expand All @@ -249,6 +261,7 @@ export const useSignOrder = (input: SignOrderInput) => {
quantity: item.qty,
})),
};

console.log('🚀 ~ sign/request:', data); // eslint-disable-line

const baseUrl = `${PRIMARY_SALES_API_BASE_URL[environment]}/${environmentId}/order/sign`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const useSmartCheckout = ({
try {
const signer = provider?.getSigner();
const spenderAddress = await signer?.getAddress() || '';
console.log('🚀 ~ spenderAddress:', spenderAddress); // eslint-disable-line

const userFractionalBalanceBlocked = await isUserFractionalBalanceBlocked(
spenderAddress,
Expand Down Expand Up @@ -61,11 +62,11 @@ export const useSmartCheckout = ({
throw new Error();
}
const result = { ...res };
// const filteredSmartCheckoutResult = filterSmartCheckoutResult(result, provider);
const filteredSmartCheckoutResult = filterSmartCheckoutResult(result);
const filteredSmartCheckoutResult = filterSmartCheckoutResult(result, provider);
setSmartCheckoutResult(filteredSmartCheckoutResult);
return result;
} catch (err: any) {
console.log('🚀 ~ setSmartCheckoutError:', err); // eslint-disable-line
setSmartCheckoutError({
type: SaleErrorTypes.SMART_CHECKOUT_ERROR,
data: { error: err },
Expand Down

0 comments on commit f1e0a1b

Please sign in to comment.