2020-05-13 01:11:10 +03:00
|
|
|
import { createAction } from '@reduxjs/toolkit'
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2021-05-21 04:14:55 +03:00
|
|
|
export const addTransaction =
|
|
|
|
createAction<{
|
|
|
|
chainId: number
|
|
|
|
hash: string
|
|
|
|
from: string
|
|
|
|
approval?: { tokenAddress: string; spender: string }
|
|
|
|
claim?: { recipient: string }
|
|
|
|
summary?: string
|
|
|
|
}>('transactions/addTransaction')
|
2021-05-20 19:21:40 +03:00
|
|
|
export const clearAllTransactions = createAction<{ chainId: number }>('transactions/clearAllTransactions')
|
2020-05-13 17:59:51 +03:00
|
|
|
export const finalizeTransaction = createAction<{
|
2021-05-20 19:21:40 +03:00
|
|
|
chainId: number
|
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<{
|
2021-05-20 19:21:40 +03:00
|
|
|
chainId: number
|
2020-07-27 02:07:02 +03:00
|
|
|
hash: string
|
|
|
|
blockNumber: number
|
|
|
|
}>('transactions/checkedTransaction')
|