uniswap-interface-uncensored/src/state/transactions/actions.ts

34 lines
963 B
TypeScript
Raw Normal View History

import { createAction } from '@reduxjs/toolkit'
import { ChainId } from '@uniswap/sdk-core'
export interface SerializableTransactionReceipt {
to: string
from: string
contractAddress: string
transactionIndex: number
blockHash: string
transactionHash: string
blockNumber: number
status?: number
}
export const addTransaction = createAction<{
chainId: ChainId
hash: string
from: string
approval?: { tokenAddress: string; spender: string }
2020-09-24 19:18:57 +03:00
claim?: { recipient: string }
summary?: string
}>('transactions/addTransaction')
export const clearAllTransactions = createAction<{ chainId: ChainId }>('transactions/clearAllTransactions')
export const finalizeTransaction = createAction<{
chainId: ChainId
hash: string
receipt: SerializableTransactionReceipt
}>('transactions/finalizeTransaction')
export const checkedTransaction = createAction<{
chainId: ChainId
hash: string
blockNumber: number
}>('transactions/checkedTransaction')