mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-04 05:43:57 +00:00
Merge branch 'development' of github.com:gnosis/safe-react into development
This commit is contained in:
commit
8bbc1ce62d
@ -161,7 +161,7 @@
|
||||
"@gnosis.pm/safe-apps-sdk": "1.0.3",
|
||||
"@gnosis.pm/safe-apps-sdk-v1": "npm:@gnosis.pm/safe-apps-sdk@0.4.2",
|
||||
"@gnosis.pm/safe-contracts": "1.1.1-dev.2",
|
||||
"@gnosis.pm/safe-react-components": "https://github.com/gnosis/safe-react-components.git#fb1a523",
|
||||
"@gnosis.pm/safe-react-components": "https://github.com/gnosis/safe-react-components.git#f610327",
|
||||
"@gnosis.pm/util-contracts": "2.0.6",
|
||||
"@ledgerhq/hw-transport-node-hid-singleton": "5.41.0",
|
||||
"@material-ui/core": "^4.11.0",
|
||||
|
@ -42,15 +42,25 @@ export const loadPagedHistoryTransactions = async (
|
||||
export const loadHistoryTransactions = async (safeAddress: string): Promise<HistoryGatewayResponse['results']> => {
|
||||
const historyTransactionsUrl = getHistoryTransactionsUrl(safeAddress)
|
||||
|
||||
const {
|
||||
data: { results, ...pointers },
|
||||
} = await axios.get<HistoryGatewayResponse, AxiosResponse<HistoryGatewayResponse>>(historyTransactionsUrl)
|
||||
try {
|
||||
const {
|
||||
data: { results, ...pointers },
|
||||
} = await axios.get<HistoryGatewayResponse, AxiosResponse<HistoryGatewayResponse>>(historyTransactionsUrl)
|
||||
|
||||
if (!historyPointers[safeAddress]) {
|
||||
historyPointers[safeAddress] = pointers
|
||||
if (!historyPointers[safeAddress]) {
|
||||
historyPointers[safeAddress] = pointers
|
||||
}
|
||||
|
||||
return results
|
||||
} catch (error) {
|
||||
// When the safe is just created there is a delay until the gateway recognize the
|
||||
// safe address, when that happens it returns 404.
|
||||
if (error.response.status === 404) {
|
||||
return []
|
||||
}
|
||||
|
||||
throw Error(`There was an error trying to fetch history txs from safeAddress ${safeAddress}`)
|
||||
}
|
||||
|
||||
return results
|
||||
}
|
||||
|
||||
/************/
|
||||
@ -90,14 +100,23 @@ export const loadPagedQueuedTransactions = async (
|
||||
|
||||
export const loadQueuedTransactions = async (safeAddress: string): Promise<QueuedGatewayResponse['results']> => {
|
||||
const queuedTransactionsUrl = getQueuedTransactionsUrl(safeAddress)
|
||||
try {
|
||||
const {
|
||||
data: { results, ...pointers },
|
||||
} = await axios.get<QueuedGatewayResponse, AxiosResponse<QueuedGatewayResponse>>(queuedTransactionsUrl)
|
||||
|
||||
const {
|
||||
data: { results, ...pointers },
|
||||
} = await axios.get<QueuedGatewayResponse, AxiosResponse<QueuedGatewayResponse>>(queuedTransactionsUrl)
|
||||
if (!queuedPointers[safeAddress] || queuedPointers[safeAddress].next === null) {
|
||||
queuedPointers[safeAddress] = pointers
|
||||
}
|
||||
|
||||
if (!queuedPointers[safeAddress] || queuedPointers[safeAddress].next === null) {
|
||||
queuedPointers[safeAddress] = pointers
|
||||
return results
|
||||
} catch (error) {
|
||||
// When the safe is just created there is a delay until the gateway recognize the
|
||||
// safe address, when that happens it returns 404.
|
||||
if (error.response.status === 404) {
|
||||
return []
|
||||
}
|
||||
|
||||
throw Error(`There was an error trying to fetch queued txs from safeAddress ${safeAddress}`)
|
||||
}
|
||||
|
||||
return results
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ const SIGNERS = {
|
||||
const getSignersByWallet = (isHW) =>
|
||||
isHW ? [SIGNERS.ETH_SIGN] : [SIGNERS.EIP712_V3, SIGNERS.EIP712_V4, SIGNERS.EIP712, SIGNERS.ETH_SIGN]
|
||||
|
||||
export const SAFE_VERSION_FOR_OFFCHAIN_SIGNATURES = '>=1.1.1'
|
||||
export const SAFE_VERSION_FOR_OFFCHAIN_SIGNATURES = '>=1.0.0'
|
||||
|
||||
export const tryOffchainSigning = async (safeTxHash: string, txArgs, isHW: boolean): Promise<string> => {
|
||||
let signature
|
||||
|
@ -14,7 +14,7 @@ type FeatureConfigByVersion = {
|
||||
}
|
||||
|
||||
const FEATURES_BY_VERSION: FeatureConfigByVersion[] = [
|
||||
{ name: FEATURES.ERC721, validVersion: '>=1.1.1' },
|
||||
{ name: FEATURES.ERC721 },
|
||||
{ name: FEATURES.ERC1155, validVersion: '>=1.1.1' },
|
||||
{ name: FEATURES.SAFE_APPS },
|
||||
{ name: FEATURES.CONTRACT_INTERACTION },
|
||||
|
@ -1,15 +1,17 @@
|
||||
import { Loader } from '@gnosis.pm/safe-react-components'
|
||||
import { Loader, Title } from '@gnosis.pm/safe-react-components'
|
||||
import React, { ReactElement } from 'react'
|
||||
|
||||
import { usePagedHistoryTransactions } from './hooks/usePagedHistoryTransactions'
|
||||
import { Centered } from './styled'
|
||||
import { Centered, NoTransactions } from './styled'
|
||||
import { HistoryTxList } from './HistoryTxList'
|
||||
import { TxsInfiniteScroll } from './TxsInfiniteScroll'
|
||||
import Img from 'src/components/layout/Img'
|
||||
import NoTransactionsImage from './assets/no-transactions.svg'
|
||||
|
||||
export const HistoryTransactions = (): ReactElement => {
|
||||
const { count, hasMore, next, transactions, isLoading } = usePagedHistoryTransactions()
|
||||
|
||||
if (count === 0) {
|
||||
if (isLoading || !transactions) {
|
||||
return (
|
||||
<Centered>
|
||||
<Loader size="md" />
|
||||
@ -17,6 +19,15 @@ export const HistoryTransactions = (): ReactElement => {
|
||||
)
|
||||
}
|
||||
|
||||
if (count === 0) {
|
||||
return (
|
||||
<NoTransactions>
|
||||
<Img alt="No Transactions yet" src={NoTransactionsImage} />
|
||||
<Title size="xs">History transactions will appear here </Title>
|
||||
</NoTransactions>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<TxsInfiniteScroll next={next} hasMore={hasMore} isLoading={isLoading}>
|
||||
<HistoryTxList transactions={transactions} />
|
||||
|
@ -1,23 +1,16 @@
|
||||
import { Loader, Title } from '@gnosis.pm/safe-react-components'
|
||||
import React, { ReactElement } from 'react'
|
||||
import style from 'styled-components'
|
||||
|
||||
import Img from 'src/components/layout/Img'
|
||||
import { ActionModal } from './ActionModal'
|
||||
import NoTransactionsImage from './assets/no-transactions.svg'
|
||||
import { usePagedQueuedTransactions } from './hooks/usePagedQueuedTransactions'
|
||||
import { QueueTxList } from './QueueTxList'
|
||||
import { Centered } from './styled'
|
||||
import { Centered, NoTransactions } from './styled'
|
||||
import { TxActionProvider } from './TxActionProvider'
|
||||
import { TxsInfiniteScroll } from './TxsInfiniteScroll'
|
||||
import { TxLocationContext } from './TxLocationProvider'
|
||||
|
||||
const NoTransactions = style.div`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 60px;
|
||||
`
|
||||
|
||||
export const QueueTransactions = (): ReactElement => {
|
||||
const { count, isLoading, hasMore, next, transactions } = usePagedQueuedTransactions()
|
||||
|
||||
@ -35,7 +28,7 @@ export const QueueTransactions = (): ReactElement => {
|
||||
return (
|
||||
<NoTransactions>
|
||||
<Img alt="No Transactions yet" src={NoTransactionsImage} />
|
||||
<Title size="xs">Transactions will appear here </Title>
|
||||
<Title size="xs">Queue transactions will appear here </Title>
|
||||
</NoTransactions>
|
||||
)
|
||||
}
|
||||
|
@ -46,7 +46,6 @@ export const RejectTxModal = ({ isOpen, onClose, gwTransaction }: Props): React.
|
||||
isOffChainSignature,
|
||||
isCreation,
|
||||
gasLimit,
|
||||
gasEstimation,
|
||||
gasPriceFormatted,
|
||||
} = useEstimateTransactionGas({
|
||||
txData: EMPTY_DATA,
|
||||
@ -85,7 +84,7 @@ export const RejectTxModal = ({ isOpen, onClose, gwTransaction }: Props): React.
|
||||
<EditableTxParameters
|
||||
ethGasLimit={gasLimit}
|
||||
ethGasPrice={gasPriceFormatted}
|
||||
safeTxGas={gasEstimation.toString()}
|
||||
safeTxGas={'0'}
|
||||
safeNonce={nonce.toString()}
|
||||
parametersStatus={getParametersStatus()}
|
||||
>
|
||||
|
@ -503,3 +503,8 @@ export const AlignItemsWithMargin = styled.div`
|
||||
margin-right: 6px;
|
||||
}
|
||||
`
|
||||
export const NoTransactions = styled.div`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 60px;
|
||||
`
|
||||
|
@ -1561,9 +1561,9 @@
|
||||
solc "0.5.14"
|
||||
truffle "^5.1.21"
|
||||
|
||||
"@gnosis.pm/safe-react-components@https://github.com/gnosis/safe-react-components.git#fb1a523":
|
||||
"@gnosis.pm/safe-react-components@https://github.com/gnosis/safe-react-components.git#f610327":
|
||||
version "0.5.0"
|
||||
resolved "https://github.com/gnosis/safe-react-components.git#fb1a523ece12aa54e7e6a1169c7cd13da5bf5b61"
|
||||
resolved "https://github.com/gnosis/safe-react-components.git#f610327c109810547513079196514b05cda63844"
|
||||
dependencies:
|
||||
classnames "^2.2.6"
|
||||
react-media "^1.10.0"
|
||||
@ -15713,7 +15713,7 @@ polished@^3.3.1:
|
||||
resolved "https://registry.yarnpkg.com/polished/-/polished-3.6.7.tgz#44cbd0047f3187d83db0c479ef0c7d5583af5fb6"
|
||||
integrity sha512-b4OViUOihwV0icb9PHmWbR+vPqaSzSAEbgLskvb7ANPATVXGiYv/TQFHQo65S53WU9i5EQ1I03YDOJW7K0bmYg==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.12.5"
|
||||
"@babel/runtime" "^7.9.2"
|
||||
|
||||
popper.js@1.16.1-lts:
|
||||
version "1.16.1-lts"
|
||||
|
Loading…
x
Reference in New Issue
Block a user