Skip to content

Commit

Permalink
Fix failing result submit (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
schaier-io authored Feb 23, 2025
2 parents 8064cb8 + aa0abcc commit ba33129
Show file tree
Hide file tree
Showing 34 changed files with 9,258 additions and 6,780 deletions.
212 changes: 104 additions & 108 deletions frontend/openapi-docs.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions frontend/src/components/dashboard/ContractTransactionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ const formatStatus = (status: string) => {
};

export function ContractTransactionList({ contractAddress, network, paymentType }: TransactionListProps) {
const [transactions, setTransactions] = useState<{ id: string; createdAt: string; updatedAt: string; blockchainIdentifier: string; lastCheckedAt: string | null; submitResultTime: string; unlockTime: string; refundTime: string; requestedById: string; onChainState: "FundsLocked" | "FundsOrDatumInvalid" | "ResultSubmitted" | "RefundRequested" | "Disputed" | "Withdrawn" | "RefundWithdrawn" | "DisputedWithdrawn"; resultHash: string; NextAction: { requestedAction: "None" | "Ignore" | "WaitingForManualAction" | "WaitingForExternalAction" | "SubmitResultRequested" | "SubmitResultInitiated" | "WithdrawRequested" | "WithdrawInitiated" | "AuthorizeRefundRequested" | "AuthorizeRefundInitiated"; errorType: "NetworkError" | "Unknown"; errorNote: string | null; } | { requestedAction: "None" | "Ignore" | "WaitingForManualAction" | "WaitingForExternalAction" | "FundsLockingRequested" | "FundsLockingInitiated" | "SetRefundRequestedRequested" | "SetRefundRequestedInitiated" | "UnSetRefundRequestedRequested" | "UnSetRefundRequestedInitiated" | "WithdrawRefundRequested" | "WithdrawRefundInitiated"; errorType: "NetworkError" | "InsufficientFunds" | "Unknown"; errorNote: string | null; }; CurrentTransaction: { id: string; createdAt: string; updatedAt: string; txHash: string | null; } | { id: string; createdAt: string; updatedAt: string; txHash: string; status: "Pending" | "Confirmed" | "FailedViaTimeout"; } | null; TransactionHistory: { id: string; createdAt: string; updatedAt: string; txHash: string | null; }[] | { id: string; createdAt: string; updatedAt: string; txHash: string; status: "Pending" | "Confirmed" | "FailedViaTimeout"; }[] | null; Amounts: { id: string; createdAt: string; updatedAt: string; amount: string; unit: string; }[] | { id: string; createdAt: string; updatedAt: string; amount: string; unit: string; }[]; PaymentSource: { id: string; network: "Preprod" | "Mainnet"; smartContractAddress: string; paymentType: "Web3CardanoV1"; } | { id: string; network: "Preprod" | "Mainnet"; smartContractAddress: string; paymentType: "Web3CardanoV1"; }; SellerWallet?: { id: string; walletVkey: string; } | null; SmartContractWallet: { id: string; walletVkey: string; walletAddress: string; } | { id: string; walletVkey: string; walletAddress: string; } | null; metadata: string | null; type: string; BuyerWallet?: { id: string; walletVkey: string; } | null; }[]>([]);
const [transactions, setTransactions] = useState<{ id: string; createdAt: string; updatedAt: string; blockchainIdentifier: string; lastCheckedAt: string | null; submitResultTime: string; unlockTime: string; externalDisputeUnlockTime: string; requestedById: string; onChainState: "FundsLocked" | "FundsOrDatumInvalid" | "ResultSubmitted" | "RefundRequested" | "Disputed" | "Withdrawn" | "RefundWithdrawn" | "DisputedWithdrawn"; cooldownTime: number; cooldownTimeOtherParty: number; resultHash: string; NextAction: { requestedAction: "None" | "Ignore" | "WaitingForManualAction" | "WaitingForExternalAction" | "FundsLockingRequested" | "FundsLockingInitiated" | "SetRefundRequestedRequested" | "SetRefundRequestedInitiated" | "UnSetRefundRequestedRequested" | "UnSetRefundRequestedInitiated" | "WithdrawRefundRequested" | "WithdrawRefundInitiated"; errorType: "NetworkError" | "InsufficientFunds" | "Unknown"; errorNote: string | null; } | { requestedAction: "None" | "Ignore" | "WaitingForManualAction" | "WaitingForExternalAction" | "SubmitResultRequested" | "SubmitResultInitiated" | "WithdrawRequested" | "WithdrawInitiated" | "AuthorizeRefundRequested" | "AuthorizeRefundInitiated"; errorType: "NetworkError" | "Unknown"; errorNote: string | null; }; CurrentTransaction: { id: string; createdAt: string; updatedAt: string; txHash: string; status: "Pending" | "Confirmed" | "FailedViaTimeout"; } | { id: string; createdAt: string; updatedAt: string; txHash: string | null; } | null; TransactionHistory: { id: string; createdAt: string; updatedAt: string; txHash: string; status: "Pending" | "Confirmed" | "FailedViaTimeout"; }[] | { id: string; createdAt: string; updatedAt: string; txHash: string | null; }[] | null; Amounts: { id: string; createdAt: string; updatedAt: string; amount: string; unit: string; }[] | { id: string; createdAt: string; updatedAt: string; amount: string; unit: string; }[]; PaymentSource: { id: string; network: "Preprod" | "Mainnet"; smartContractAddress: string; paymentType: "Web3CardanoV1"; } | { id: string; network: "Preprod" | "Mainnet"; smartContractAddress: string; paymentType: "Web3CardanoV1"; }; SellerWallet?: { id: string; walletVkey: string; } | null; SmartContractWallet: { id: string; walletVkey: string; walletAddress: string; } | { id: string; walletVkey: string; walletAddress: string; } | null; metadata: string | null; type: string; BuyerWallet?: { id: string; walletVkey: string; } | null; }[]>([]);
const [isLoading, setIsLoading] = useState(false);
const [hasMore, setHasMore] = useState(true);
const [cursorIdentifier, setCursorIdentifier] = useState<string | null>(null);
const [filter, setFilter] = useState<TransactionType>('all');
const [searchQuery, setSearchQuery] = useState('');
const [selectedTransaction, setSelectedTransaction] = useState<{ id: string; createdAt: string; updatedAt: string; blockchainIdentifier: string; lastCheckedAt: string | null; submitResultTime: string; unlockTime: string; refundTime: string; requestedById: string; onChainState: "FundsLocked" | "FundsOrDatumInvalid" | "ResultSubmitted" | "RefundRequested" | "Disputed" | "Withdrawn" | "RefundWithdrawn" | "DisputedWithdrawn"; resultHash: string; NextAction: { requestedAction: "None" | "Ignore" | "WaitingForManualAction" | "WaitingForExternalAction" | "SubmitResultRequested" | "SubmitResultInitiated" | "WithdrawRequested" | "WithdrawInitiated" | "AuthorizeRefundRequested" | "AuthorizeRefundInitiated"; errorType: "NetworkError" | "Unknown"; errorNote: string | null; } | { requestedAction: "None" | "Ignore" | "WaitingForManualAction" | "WaitingForExternalAction" | "FundsLockingRequested" | "FundsLockingInitiated" | "SetRefundRequestedRequested" | "SetRefundRequestedInitiated" | "UnSetRefundRequestedRequested" | "UnSetRefundRequestedInitiated" | "WithdrawRefundRequested" | "WithdrawRefundInitiated"; errorType: "NetworkError" | "InsufficientFunds" | "Unknown"; errorNote: string | null; }; CurrentTransaction: { id: string; createdAt: string; updatedAt: string; txHash: string | null; } | { id: string; createdAt: string; updatedAt: string; txHash: string; status: "Pending" | "Confirmed" | "FailedViaTimeout"; } | null; TransactionHistory: { id: string; createdAt: string; updatedAt: string; txHash: string | null; }[] | { id: string; createdAt: string; updatedAt: string; txHash: string; status: "Pending" | "Confirmed" | "FailedViaTimeout"; }[] | null; Amounts: { id: string; createdAt: string; updatedAt: string; amount: string; unit: string; }[] | { id: string; createdAt: string; updatedAt: string; amount: string; unit: string; }[]; PaymentSource: { id: string; network: "Preprod" | "Mainnet"; smartContractAddress: string; paymentType: "Web3CardanoV1"; } | { id: string; network: "Preprod" | "Mainnet"; smartContractAddress: string; paymentType: "Web3CardanoV1"; }; SellerWallet?: { id: string; walletVkey: string; } | null; SmartContractWallet: { id: string; walletVkey: string; walletAddress: string; } | { id: string; walletVkey: string; walletAddress: string; } | null; metadata: string | null; type: string; BuyerWallet?: { id: string; walletVkey: string; } | null; } | null>(null);
const [selectedTransaction, setSelectedTransaction] = useState<{ id: string; createdAt: string; updatedAt: string; blockchainIdentifier: string; lastCheckedAt: string | null; submitResultTime: string; unlockTime: string; externalDisputeUnlockTime: string; requestedById: string; onChainState: "FundsLocked" | "FundsOrDatumInvalid" | "ResultSubmitted" | "RefundRequested" | "Disputed" | "Withdrawn" | "RefundWithdrawn" | "DisputedWithdrawn"; cooldownTime: number; cooldownTimeOtherParty: number; resultHash: string; NextAction: { requestedAction: "None" | "Ignore" | "WaitingForManualAction" | "WaitingForExternalAction" | "FundsLockingRequested" | "FundsLockingInitiated" | "SetRefundRequestedRequested" | "SetRefundRequestedInitiated" | "UnSetRefundRequestedRequested" | "UnSetRefundRequestedInitiated" | "WithdrawRefundRequested" | "WithdrawRefundInitiated"; errorType: "NetworkError" | "InsufficientFunds" | "Unknown"; errorNote: string | null; } | { requestedAction: "None" | "Ignore" | "WaitingForManualAction" | "WaitingForExternalAction" | "SubmitResultRequested" | "SubmitResultInitiated" | "WithdrawRequested" | "WithdrawInitiated" | "AuthorizeRefundRequested" | "AuthorizeRefundInitiated"; errorType: "NetworkError" | "Unknown"; errorNote: string | null; }; CurrentTransaction: { id: string; createdAt: string; updatedAt: string; txHash: string; status: "Pending" | "Confirmed" | "FailedViaTimeout"; } | { id: string; createdAt: string; updatedAt: string; txHash: string | null; } | null; TransactionHistory: { id: string; createdAt: string; updatedAt: string; txHash: string; status: "Pending" | "Confirmed" | "FailedViaTimeout"; }[] | { id: string; createdAt: string; updatedAt: string; txHash: string | null; }[] | null; Amounts: { id: string; createdAt: string; updatedAt: string; amount: string; unit: string; }[] | { id: string; createdAt: string; updatedAt: string; amount: string; unit: string; }[]; PaymentSource: { id: string; network: "Preprod" | "Mainnet"; smartContractAddress: string; paymentType: "Web3CardanoV1"; } | { id: string; network: "Preprod" | "Mainnet"; smartContractAddress: string; paymentType: "Web3CardanoV1"; }; SellerWallet?: { id: string; walletVkey: string; } | null; SmartContractWallet: { id: string; walletVkey: string; walletAddress: string; } | { id: string; walletVkey: string; walletAddress: string; } | null; metadata: string | null; type: string; BuyerWallet?: { id: string; walletVkey: string; } | null; } | null>(null);
const { apiClient } = useAppContext();


const fetchTransactions = useCallback(async (cursor?: string) => {
setIsLoading(true);
try {
const combined: { id: string; createdAt: string; updatedAt: string; blockchainIdentifier: string; lastCheckedAt: string | null; submitResultTime: string; unlockTime: string; refundTime: string; requestedById: string; onChainState: "FundsLocked" | "FundsOrDatumInvalid" | "ResultSubmitted" | "RefundRequested" | "Disputed" | "Withdrawn" | "RefundWithdrawn" | "DisputedWithdrawn"; resultHash: string; NextAction: { requestedAction: "None" | "Ignore" | "WaitingForManualAction" | "WaitingForExternalAction" | "SubmitResultRequested" | "SubmitResultInitiated" | "WithdrawRequested" | "WithdrawInitiated" | "AuthorizeRefundRequested" | "AuthorizeRefundInitiated"; errorType: "NetworkError" | "Unknown"; errorNote: string | null; } | { requestedAction: "None" | "Ignore" | "WaitingForManualAction" | "WaitingForExternalAction" | "FundsLockingRequested" | "FundsLockingInitiated" | "SetRefundRequestedRequested" | "SetRefundRequestedInitiated" | "UnSetRefundRequestedRequested" | "UnSetRefundRequestedInitiated" | "WithdrawRefundRequested" | "WithdrawRefundInitiated"; errorType: "NetworkError" | "InsufficientFunds" | "Unknown"; errorNote: string | null; }; CurrentTransaction: { id: string; createdAt: string; updatedAt: string; txHash: string | null; } | { id: string; createdAt: string; updatedAt: string; txHash: string; status: "Pending" | "Confirmed" | "FailedViaTimeout"; } | null; TransactionHistory: { id: string; createdAt: string; updatedAt: string; txHash: string | null; }[] | { id: string; createdAt: string; updatedAt: string; txHash: string; status: "Pending" | "Confirmed" | "FailedViaTimeout"; }[] | null; Amounts: { id: string; createdAt: string; updatedAt: string; amount: string; unit: string; }[] | { id: string; createdAt: string; updatedAt: string; amount: string; unit: string; }[]; PaymentSource: { id: string; network: "Preprod" | "Mainnet"; smartContractAddress: string; paymentType: "Web3CardanoV1"; } | { id: string; network: "Preprod" | "Mainnet"; smartContractAddress: string; paymentType: "Web3CardanoV1"; }; SellerWallet?: { id: string; walletVkey: string; } | null; SmartContractWallet: { id: string; walletVkey: string; walletAddress: string; } | { id: string; walletVkey: string; walletAddress: string; } | null; metadata: string | null; type: string; BuyerWallet?: { id: string; walletVkey: string; } | null; }[] = [];
const combined: { id: string; createdAt: string; updatedAt: string; blockchainIdentifier: string; lastCheckedAt: string | null; submitResultTime: string; unlockTime: string; externalDisputeUnlockTime: string; requestedById: string; onChainState: "FundsLocked" | "FundsOrDatumInvalid" | "ResultSubmitted" | "RefundRequested" | "Disputed" | "Withdrawn" | "RefundWithdrawn" | "DisputedWithdrawn"; cooldownTime: number; cooldownTimeOtherParty: number; resultHash: string; NextAction: { requestedAction: "None" | "Ignore" | "WaitingForManualAction" | "WaitingForExternalAction" | "FundsLockingRequested" | "FundsLockingInitiated" | "SetRefundRequestedRequested" | "SetRefundRequestedInitiated" | "UnSetRefundRequestedRequested" | "UnSetRefundRequestedInitiated" | "WithdrawRefundRequested" | "WithdrawRefundInitiated"; errorType: "NetworkError" | "InsufficientFunds" | "Unknown"; errorNote: string | null; } | { requestedAction: "None" | "Ignore" | "WaitingForManualAction" | "WaitingForExternalAction" | "SubmitResultRequested" | "SubmitResultInitiated" | "WithdrawRequested" | "WithdrawInitiated" | "AuthorizeRefundRequested" | "AuthorizeRefundInitiated"; errorType: "NetworkError" | "Unknown"; errorNote: string | null; }; CurrentTransaction: { id: string; createdAt: string; updatedAt: string; txHash: string; status: "Pending" | "Confirmed" | "FailedViaTimeout"; } | { id: string; createdAt: string; updatedAt: string; txHash: string | null; } | null; TransactionHistory: { id: string; createdAt: string; updatedAt: string; txHash: string; status: "Pending" | "Confirmed" | "FailedViaTimeout"; }[] | { id: string; createdAt: string; updatedAt: string; txHash: string | null; }[] | null; Amounts: { id: string; createdAt: string; updatedAt: string; amount: string; unit: string; }[] | { id: string; createdAt: string; updatedAt: string; amount: string; unit: string; }[]; PaymentSource: { id: string; network: "Preprod" | "Mainnet"; smartContractAddress: string; paymentType: "Web3CardanoV1"; } | { id: string; network: "Preprod" | "Mainnet"; smartContractAddress: string; paymentType: "Web3CardanoV1"; }; SellerWallet?: { id: string; walletVkey: string; } | null; SmartContractWallet: { id: string; walletVkey: string; walletAddress: string; } | { id: string; walletVkey: string; walletAddress: string; } | null; metadata: string | null; type: string; BuyerWallet?: { id: string; walletVkey: string; } | null; }[] = [];
const purchases = await getPurchase({
client: apiClient,
query: {
Expand Down
Loading

0 comments on commit ba33129

Please sign in to comment.