2020-05-13 01:11:10 +03:00
|
|
|
import { createAction } from '@reduxjs/toolkit'
|
2021-03-24 04:45:58 +03:00
|
|
|
import { ChainId } from '@uniswap/sdk-core'
|
2020-05-13 01:11:10 +03:00
|
|
|
|
2020-05-13 17:59:51 +03:00
|
|
|
export interface SerializableTransactionReceipt {
|
|
|
|
to: string
|
|
|
|
from: string
|
|
|
|
contractAddress: string
|
|
|
|
transactionIndex: number
|
|
|
|
blockHash: string
|
|
|
|
transactionHash: string
|
|
|
|
blockNumber: number
|
|
|
|
status?: number
|
|
|
|
}
|
|
|
|
|
2020-05-13 01:11:10 +03:00
|
|
|
export const addTransaction = createAction<{
|
2020-07-27 02:07:02 +03:00
|
|
|
chainId: ChainId
|
2020-05-13 01:11:10 +03:00
|
|
|
hash: string
|
2020-05-14 17:32:48 +03:00
|
|
|
from: string
|
2020-06-11 22:56:28 +03:00
|
|
|
approval?: { tokenAddress: string; spender: string }
|
2020-09-24 19:18:57 +03:00
|
|
|
claim?: { recipient: string }
|
2020-05-13 01:11:10 +03:00
|
|
|
summary?: string
|
2020-07-27 02:07:02 +03:00
|
|
|
}>('transactions/addTransaction')
|
|
|
|
export const clearAllTransactions = createAction<{ chainId: ChainId }>('transactions/clearAllTransactions')
|
2020-05-13 17:59:51 +03:00
|
|
|
export const finalizeTransaction = createAction<{
|
2020-07-27 02:07:02 +03:00
|
|
|
chainId: ChainId
|
2020-05-13 17:59:51 +03:00
|
|
|
hash: string
|
|
|
|
receipt: SerializableTransactionReceipt
|
2020-07-27 02:07:02 +03:00
|
|
|
}>('transactions/finalizeTransaction')
|
|
|
|
export const checkedTransaction = createAction<{
|
|
|
|
chainId: ChainId
|
|
|
|
hash: string
|
|
|
|
blockNumber: number
|
|
|
|
}>('transactions/checkedTransaction')
|