Skip to content

Commit

Permalink
approvals wip
Browse files Browse the repository at this point in the history
  • Loading branch information
bokkypoobah committed Jul 26, 2024
1 parent 768a5f6 commit 491d844
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions docs/approvals.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,17 +296,20 @@ const Approvals = {
}
for (const [owner, ownerData] of Object.entries(this.approvals[this.chainId] || {})) {
for (const [contract, contractData] of Object.entries(ownerData)) {
const type = this.tokens[this.chainId] && this.tokens[this.chainId][contract] && this.tokens[this.chainId][contract].type || null;
const token = this.tokens[this.chainId] && this.tokens[this.chainId][contract] || null;
const type = token && token.type || null;
const symbol = token && token.symbol || null;
const name = token && token.name || null;
if (type == "erc20") {
for (const [spender, value] of Object.entries(contractData)) {
results.push({ chainId: this.chainId, contract, type, eventType: "Approval", owner, spender, value });
results.push({ chainId: this.chainId, contract, type, symbol, name, eventType: "Approval", owner, spender, value });
}
} else {
for (const [tokenId, spender] of Object.entries(contractData.tokens)) {
results.push({ chainId: this.chainId, contract, type, eventType: "Approval", owner, spender, value: tokenId });
results.push({ chainId: this.chainId, contract, type, symbol, name, eventType: "Approval", owner, spender, value: tokenId });
}
for (const [spender, approved] of Object.entries(contractData.approvalForAll)) {
results.push({ chainId: this.chainId, contract, type, eventType: "SetApprovalForAll", owner, spender, value: approved });
results.push({ chainId: this.chainId, contract, type, symbol, name, eventType: "SetApprovalForAll", owner, spender, value: approved });
}
}
}
Expand Down
Binary file modified images/SampleScreen_Approvals_20240726.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 491d844

Please sign in to comment.