-
Notifications
You must be signed in to change notification settings - Fork 1
Transaction app types and mapping from json to UI layer
-
Transaction DTO (backend)
-
Data layer mapping:
-
Transfer
- condition:
transactionDto.transfers.size == 1 - fields:
recipient = transactionDto.transfers[0].to, sender = transactionDto.transfers[0].from , value = transactionDto.transfers[0].value, date = transactionDto.transfers[0].executionDate, Erc20TokenInfo, Erc721TokenInfo, ETH
- condition:
-
SettingsChange
- precondition: these are the solidity contracts method names to be supported for now.
settingMethodNames = ["setFallbackHandler", "addOwnerWithThreshold", "removeOwner", "swapOwner", "changeThreshold", "changeMasterCopy"] - condition:
transactionDto.to == transactionDto.safe && transactionDto.dataDecoded != null && settingMethodNames.contains(transactionDto.dataDecoded.method) - fields:
dataDecoded, date = (transactionDto.executionDate ?: transactionDto.submissionDate ?: transactionDto.creationDate)
- precondition: these are the solidity contracts method names to be supported for now.
-
Custom (Multisend included)
- condition: else
- fields:
transactionDto.to, transactionDto.value, sizeInBytes(transactionDto.data), date = (transactionDto.executionDate ?: transactionDto.submissionDate ?: transactionDto.creationDate)
// Multisend: list<Transfer | SettingsChange | Custom | Multisend>
-
-
UI layer mapping: (each type is grouped by queued/history)
-
Transfer
- transfer direction:
if(Transfer.recipient == currentSafe) Incoming else Outgoing
- transfer direction:
-
SettingsChange
-
methodName = SettingsChange.dataDecoded.method, define human readable assets for each method insettingMethodNames = ["setFallbackHandler", "addOwnerWithThreshold", "removeOwner", "swapOwner", "changeThreshold", "changeMasterCopy"]
-
-
ChangeMasterCopy (specification of SettingsChange)
-
SettingsChange.dataDecoded.method == "changeMasterCopy", get version name string from hardcoded asset (SettingsChange.dataDecoded.params[0].value)
-
-
Custom
- n/a
-
-
Status calculation (precondition: Safe info needs to be available. Should be fetched on the first page of transaction data and re-triggered on user refresh):
-
queued = status is one of {pending, waitingForConfirmation, waitingFroExecution} sorted by nonce ascending, creation date descending NOTE: since these are outgoing transactions, they must have nonce.
- Pending: Submitted from device, therefore not supported yet
- WaitingForConfirmation
- condition:
transactionDto.isExecuted != true && transactionDto.nonce >= safe.nonce && transactionDto.confirmations.size < safe.threshold
- condition:
- WaitingForExecution
- condition:
transactionDto.isExecuted != true && transactionDto.nonce >= safe.nonce && transactionDto.confirmations.size >= safe.threshold
- condition:
-
history = status is one of {success, failed, cancelled} sorted by execution date (if null, then created date), descending
- Success
- condition:
transactionDto.isExecuted == true && transactionDto.isSuccessful == true
- condition:
- Failed
- condition:
transactionDto.isExecuted == true && transactionDto.isSuccessful != true
- condition:
- Cancelled
- condition:
transactionDto.isExecuted != true && transactionDto.nonce < safe.nonce
- condition:
- Success
-
-
Pagination No dodgy business
-
Backend Assumptions: transfers - logical transfers inferred from the transaction
-
ETHER_TRANSFER: ETH is transferred (data = null) -
ERC20_TRANSFER: some token -
ERC721_TRANSFER: some other token -
UNKNOWN: might be a sh*t token