Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions explorer_backend/daos/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ export const getTransactionsByBlockHash = async (hash: string): Promise<Transact
query: `SELECT
${fieldsElem}
FROM transactions WHERE block_hash = {hash: String}
order by transaction_index asc
ORDER BY
timestamp DESC,
block_id DESC,
transaction_index ASC
seqno DESC,
outgoing ASC,
`,
query_params: {
hash,
Expand All @@ -141,7 +146,12 @@ export const getTransactionsByBlock = async (
query: `SELECT
${fieldsElem}
FROM transactions WHERE block_id = {id: Int32} AND shard_id = {shard: Int32}
order by outgoing, transaction_index asc
ORDER BY
timestamp DESC,
block_id DESC,
transaction_index ASC
seqno DESC,
outgoing ASC,
`,
query_params: {
shard,
Expand Down Expand Up @@ -173,7 +183,13 @@ export const getTransactionsByAddress = async (address: string, offset: number,
query: `SELECT
${fieldsElem}
FROM transactions
WHERE from = {address: String} OR to = {address: String} ORDER BY timestamp DESC LIMIT {limit: Int32} OFFSET {offset: Int32}
WHERE from = {address: String} OR to = {address: String}
ORDER BY
timestamp DESC,
block_id DESC,
seqno DESC,
outgoing ASC
LIMIT {limit: Int32} OFFSET {offset: Int32}
`,
query_params: {
address: address.slice(2).toUpperCase(),
Expand Down
Loading