Skip to content

Commit

Permalink
checkout flow fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SamueleA committed May 1, 2024
1 parent d581ca7 commit a975fbc
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/checkout/src/views/PendingTransaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
39 changes: 39 additions & 0 deletions packages/kit/src/hooks/useWaasRevalidation.ts
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit a975fbc

Please sign in to comment.