tx list wip, add TransactionsNew folder and skeleton for an api call to save tx
This commit is contained in:
parent
7bb49a353f
commit
ee5d7f270b
|
@ -7,7 +7,7 @@ import {
|
||||||
} from '~/config/names'
|
} from '~/config/names'
|
||||||
|
|
||||||
const devConfig = {
|
const devConfig = {
|
||||||
[TX_SERVICE_HOST]: 'http://localhost:8000/api/v1/',
|
[TX_SERVICE_HOST]: 'https://safe-transaction-history.dev.gnosisdev.com/api/v1/',
|
||||||
[ENABLED_TX_SERVICE_REMOVAL_SENDER]: false,
|
[ENABLED_TX_SERVICE_REMOVAL_SENDER]: false,
|
||||||
[SIGNATURES_VIA_METAMASK]: false,
|
[SIGNATURES_VIA_METAMASK]: false,
|
||||||
[RELAY_API_URL]: 'https://safe-relay.staging.gnosisdev.com/api/v1',
|
[RELAY_API_URL]: 'https://safe-relay.staging.gnosisdev.com/api/v1',
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
export * from './estimateTxGas'
|
export * from './estimateTxGas'
|
||||||
|
export * from './saveTxViaService'
|
|
@ -0,0 +1,18 @@
|
||||||
|
// @flow
|
||||||
|
import axios from 'axios'
|
||||||
|
import { getTxServiceUriFrom, getTxServiceHost } from '~/config/index'
|
||||||
|
|
||||||
|
export const saveTxViaService = (safeAddress: string, to: string, value: string, data, operation = 0) => {
|
||||||
|
const txServiceHost = getTxServiceHost()
|
||||||
|
const txServiceUri = getTxServiceUriFrom(safeAddress)
|
||||||
|
const url = `${txServiceHost}${txServiceUri}`
|
||||||
|
// const estimationValue = isTokenTransfer(tx.data) ? '0' : value.toString(10)
|
||||||
|
|
||||||
|
return axios.post(url, {
|
||||||
|
safe: safeAddress,
|
||||||
|
to,
|
||||||
|
data: '0x',
|
||||||
|
value,
|
||||||
|
operation,
|
||||||
|
})
|
||||||
|
}
|
|
@ -19,6 +19,7 @@ import {
|
||||||
} from '~/theme/variables'
|
} from '~/theme/variables'
|
||||||
import { copyToClipboard } from '~/utils/clipboard'
|
import { copyToClipboard } from '~/utils/clipboard'
|
||||||
import Balances from './Balances'
|
import Balances from './Balances'
|
||||||
|
import Transactions from './TransactionsNew'
|
||||||
|
|
||||||
type Props = SelectorProps & {
|
type Props = SelectorProps & {
|
||||||
classes: Object,
|
classes: Object,
|
||||||
|
@ -141,6 +142,7 @@ class Layout extends React.Component<Props, State> {
|
||||||
createTransaction={createTransaction}
|
createTransaction={createTransaction}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{tabIndex === 1 && <Transactions />}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
// @flow
|
||||||
|
import * as React from 'react'
|
||||||
|
import Bold from '~/components/layout/Bold'
|
||||||
|
import Col from '~/components/layout/Col'
|
||||||
|
import Row from '~/components/layout/Row'
|
||||||
|
import Paragraph from '~/components/layout/Paragraph/index'
|
||||||
|
|
||||||
|
const NoRights = () => (
|
||||||
|
<Row>
|
||||||
|
<Col xs={12} center="xs" sm={10} smOffset={2} start="sm" margin="md">
|
||||||
|
<Paragraph size="lg">
|
||||||
|
<Bold>No transactions found for this safe</Bold>
|
||||||
|
</Paragraph>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
)
|
||||||
|
|
||||||
|
export default NoRights
|
|
@ -0,0 +1,21 @@
|
||||||
|
// @flow
|
||||||
|
import * as React from 'react'
|
||||||
|
import { List } from 'immutable'
|
||||||
|
import NoTransactions from '~/routes/safe/components/Transactions/NoTransactions'
|
||||||
|
|
||||||
|
type Props = SelectorProps &
|
||||||
|
Actions & {
|
||||||
|
safeName: string,
|
||||||
|
safeAddress: string,
|
||||||
|
threshold: number,
|
||||||
|
}
|
||||||
|
class Transactions extends React.Component<Props, {}> {
|
||||||
|
render() {
|
||||||
|
const { transactions = List(), safeName, threshold } = this.props
|
||||||
|
const hasTransactions = false
|
||||||
|
|
||||||
|
return <React.Fragment>{hasTransactions ? <div /> : <NoTransactions />}</React.Fragment>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Transactions
|
Loading…
Reference in New Issue