Skip to content

Commit

Permalink
ui wip
Browse files Browse the repository at this point in the history
  • Loading branch information
bokkypoobah committed Sep 18, 2024
1 parent 1483bd3 commit 04b9662
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ function parseTokenAgentEventLogs(logs, chainId, tokenAgentAddress, tokenAgentAb
timestamp,
};

} else if (logData.eventFragment.name == "InternalTransfer") {
// event InternalTransfer(address indexed from, address indexed to, uint ethers, Unixtime timestamp);
const [from, to, ethers, timestamp] = logData.args;
eventRecord = { eventType: "InternalTransfer", from, to, ethers: ethers.toString(), timestamp };
} else if (logData.eventFragment.name == "OffersInvalidated") {
// event OffersInvalidated(Nonce newNonce, Unixtime timestamp);
const [newNonce, timestamp] = logData.args;
Expand Down
28 changes: 28 additions & 0 deletions docs/tradeFungibles.js
Original file line number Diff line number Diff line change
Expand Up @@ -1829,6 +1829,34 @@ data: {{ data }}
Vue.set(this.data, 'balanceAddresses', balanceAddresses);
// console.log(now() + " INFO TradeFungibles:methods.loadData - balanceAddresses: " + JSON.stringify(balanceAddresses));

const internalTransferFromEventsfilter = {
address: null, fromBlock: 0, toBlock: blockNumber,
topics: [[
// event InternalTransfer(address indexed from, address indexed to, uint ethers, Unixtime timestamp);
ethers.utils.id("InternalTransfer(address,address,uint256,uint40)"),
],
balanceAddresses.map(e => '0x000000000000000000000000' + e.substring(2, 42).toLowerCase()),
null,
null,
]};
const internalTransferFromEventsEventLogs = await provider.getLogs(internalTransferFromEventsfilter);
const internalTransferFromEvents = parseTokenAgentEventLogs(internalTransferFromEventsEventLogs, this.chainId, this.settings.tokenAgentAddress, network.tokenAgent.abi, blockNumber);
console.log(now() + " INFO TradeFungibles:methods.loadData - internalTransferFromEvents: " + JSON.stringify(internalTransferFromEvents));

const internalTransferToEventsfilter = {
address: null, fromBlock: 0, toBlock: blockNumber,
topics: [[
// event InternalTransfer(address indexed from, address indexed to, uint ethers, Unixtime timestamp);
ethers.utils.id("InternalTransfer(address,address,uint256,uint40)"),
],
null,
balanceAddresses.map(e => '0x000000000000000000000000' + e.substring(2, 42).toLowerCase()),
null,
]};
const internalTransferToEventsEventLogs = await provider.getLogs(internalTransferToEventsfilter);
const internalTransferToEvents = parseTokenAgentEventLogs(internalTransferToEventsEventLogs, this.chainId, this.settings.tokenAgentAddress, network.tokenAgent.abi, blockNumber);
console.log(now() + " INFO TradeFungibles:methods.loadData - internalTransferToEvents: " + JSON.stringify(internalTransferToEvents));

if (approvalAddresses.length > 0) {
const tokenApprovalsfilter = {
address: this.settings.tokenContractAddress, fromBlock: 0, toBlock: blockNumber,
Expand Down

0 comments on commit 04b9662

Please sign in to comment.