diff --git a/packages/checkout/src/views/PendingTransaction.tsx b/packages/checkout/src/views/PendingTransaction.tsx index 55a48435..83ecc001 100644 --- a/packages/checkout/src/views/PendingTransaction.tsx +++ b/packages/checkout/src/views/PendingTransaction.tsx @@ -29,7 +29,7 @@ export const PendingTransaction = () => { const pollResponse = await fetchSardineOrderStatus(orderId, isDev) const status = pollResponse.resp.status - const transactionHash = pollResponse.resp?.data?.transactionHash + const transactionHash = pollResponse.resp?.transactionHash console.log('transaction status poll response:', status) diff --git a/packages/kit/src/hooks/useWaasRevalidation.ts b/packages/kit/src/hooks/useWaasRevalidation.ts new file mode 100644 index 00000000..a762a7cd --- /dev/null +++ b/packages/kit/src/hooks/useWaasRevalidation.ts @@ -0,0 +1,39 @@ +import { SequenceWaaS } from '@0xsequence/waas' +import { commons } from '@0xsequence/core' +import { ethers } from 'ethers' +import { useState, useEffect } from 'react' +import { Deferred } from '../utils/deferred' +import { useAccount } from 'wagmi' +import type { SequenceWaasConnector } from '@0xsequence/kit-connectors' + + +export function useWaasRevalidation( + // waasConnector?: any +) { + const { connector } = useAccount() + + const waasConnector = connector?.type === 'sequence-waas' ? connector : undefined + + + useEffect(() => { + async function setup() { + if (!waasConnector) { + return + } + + // @ts-ignore-next-line + const sequenceWaas: SequenceWaaS = waasConnector.sequenceWaas + + if (!sequenceWaas) { + return + } + + sequenceWaas.onValidationRequired(() => { + console.log('TODO: requires validation!') + }) + } + setup() + }, [waasConnector]) + + return +}