This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Colorized output | |
const chalk = require('chalk'); | |
// Step 4: Sanitize and format output | |
function getTransferEventParams({ tokens, transaction, nativeTokenSymbol, address }) { | |
// Extracts `Transfer` event | |
const transferEvents = transaction.log_events | |
.filter(({ decoded }) => decoded && decoded.name === 'Transfer') | |
// Filters `Transfer` event as the given address is the sender. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Step 3: Filters transactions out in the following cases: | |
// 1. Swap event doesn't exist | |
// 2. Mint event exists | |
const _swapTransactions = _transactions.filter(({ log_events, value }) => { | |
const events = log_events | |
.filter(({ decoded }) => decoded) | |
.map(({ decoded }) => decoded) | |
const eventNames = events | |
.map(({ name }) => name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { get } = require('axios').default | |
// Step 2: Fetches transaction history from given chainId and address | |
const _transactions = await get(`https://api.covalenthq.com/v1/${chainId}/address/${address}/transactions_v2/`, { | |
params: { | |
'page-size': 100 // Number of transactions per page | |
} | |
}).then(result => result.data.data.items) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { get } = require('axios').default | |
// Define native token symbol for given chain | |
let nativeTokenSymbol; | |
switch (chainId) { | |
case '1': | |
nativeTokenSymbol = 'ETH' | |
break; | |
case '56': | |
nativeTokenSymbol = 'BNB' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Description=Aleo systemd service | |
After=network.target | |
[Service] | |
User=aleo_service | |
Restart=always | |
RestartSec=10 | |
ExecStart=/var/lib/aleo-data/snarkos \ | |
--max-peers 150 \ | |
--min-peers 100 \ |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Apr 20 04:22:51 spacemesh-falcon-node spacemesh[22987]: 2021-04-20T04:22:51.265Z INFO f8bb0.sync .peers now connected {"node_id": "f8bb0dfa9f7384841c8c28fff702e0d4aedafb02641ffb80feb0ac48028a37fa", "n_peers": 8} | |
Apr 20 04:22:51 spacemesh-falcon-node spacemesh[22987]: 2021-04-20T04:22:51.551Z INFO f8bb0.sync epoch has atxs {"node_id": "f8bb0dfa9f7384841c8c28fff702e0d4aedafb02641ffb80feb0ac48028a37fa", "epoch_id": 11} | |
Apr 20 04:22:51 spacemesh-falcon-node spacemesh[22987]: 2021-04-20T04:22:51.611Z INFO f8bb0.sync handle atx hash request {"node_id": "f8bb0dfa9f7384841c8c28fff702e0d4aedafb02641ffb80feb0ac48028a37fa", "requestId": "886b76ed-7404-4fdd-a704-d662d3ce12cf", "sessionId": "1120c6b4-7c06-4f95-8ddb-d758ff8c6aa7", "epoch_id": 11} | |
Apr 20 04:22:51 spacemesh-falcon-node spacemesh[22987]: 2021-04-20T04:22:51.614Z INFO f8bb0.atxDb returned epoch atxs {"node_id |
NewerOlder