Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get the last 100 MINA transactions
SELECT transactions.amount,
transactions.fee,
transactions.`from`,
transactions.`to`,
transactions.`hash`,
transactions.id,
transactions.isdelegation,
transactions.memo,
transactions.nonce,
transactions.`datetime`,
transactions.blockstatehash,
transactions.blockheight
FROM (
SELECT transactions.amount,
transactions.fee,
transactions.`from`,
transactions.`to`,
transactions.`hash`,
transactions.id,
transactions.isdelegation,
transactions.memo,
transactions.nonce,
transactions.`datetime`,
transactions.blockstatehash,
transactions.blockheight
FROM minaexplorer.archive.transactions
WHERE `to` = 'B62qk9WYHu2PBYv4EyEubnVQURcwpiV2ysuYYoMdwi8YTnwZQ7H4bLM'
AND canonical = true
AND failurereason is Null
UNION ALL
SELECT transactions.amount,
transactions.fee,
transactions.`from`,
transactions.`to`,
transactions.`hash`,
transactions.id,
transactions.isdelegation,
transactions.memo,
transactions.nonce,
transactions.`datetime`,
transactions.blockstatehash,
transactions.blockheight
FROM minaexplorer.archive.transactions
WHERE `from` = 'B62qk9WYHu2PBYv4EyEubnVQURcwpiV2ysuYYoMdwi8YTnwZQ7H4bLM'
AND canonical = true
AND failurereason is Null
) transactions
ORDER BY datetime DESC,
nonce DESC
LIMIT 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment