Skip to content

Commit

Permalink
feat: Adapt to Polygonscan's new template, fix NFT risk radar chart i…
Browse files Browse the repository at this point in the history
…ssues caused by opensea updates, and repair broken links in downloaded fundflow SVGs
  • Loading branch information
0xbe37e committed Oct 26, 2023
1 parent 94428e3 commit f6b6b85
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### v4.1.0

[feat] Adapt to the new template of Polygonscan [fix] Resolve NFT risk radar chart malfunction due to opensea website updates [fix] Correct invalid redirect links in the downloaded fundflow SVG images

### v4.0.1

- [fix] Resolve domain matching issues
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "metadock",
"version": "4.0.1",
"version": "4.1.0",
"repository": {
"type": "git",
"url": "https://github.com/blocksecteam/metadock.git"
Expand Down
2 changes: 1 addition & 1 deletion src/common/components/Dropdown/index.module.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

.btn {
color: #fff;
background-color: #0784c3;
background-color: var(--bs-primary);
padding: 0.25rem 0.6rem;
border-radius: 6px;
.flex-center;
Expand Down
2 changes: 1 addition & 1 deletion src/common/components/ModalFundFlow/dot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const genNode = (
tooltip="${address}"
target="_blank"
fixedsize="true"
width="2.9"
width="3"
height="1"
image="${logo || ChainUtils.getChainLogo(chain)}"
label=<<table border="0">${
Expand Down
12 changes: 6 additions & 6 deletions src/common/components/ModalFundFlow/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const nodeHover = (
}
})

imgPosition.analyze.x = `${Number(pathList[8][0]) + 10}`
imgPosition.analyze.x = `${Number(pathList[8][0]) + 12}`
imgPosition.analyze.y = `${Number(pathList[8][1]) - 30}`
}

Expand Down Expand Up @@ -157,10 +157,6 @@ export const nodeHover = (
nodeAClone.on('mouseleave', () => {
clearGraphTemp()
})

nodeAClone.on('click', function () {
if (nodeData.url) window.open(nodeData.url)
})
}

export const nodeStrokeWidthChange = (
Expand Down Expand Up @@ -192,6 +188,10 @@ export const initNodes = (fundFlow: FundFlowRes) => {

node.select('path').attr('fill', '#f8f8f8')

node
.select('g > a')
.attr('href', fundFlow.nodes.find(v => v.id === d3Ele.key)!.url)

// Initializes the position of the image
const _image = node.select('image')
if (_image) {
Expand All @@ -207,7 +207,7 @@ export const initNodes = (fundFlow: FundFlowRes) => {
node.on('mouseenter', () => {
nodeStrokeWidthChange(node, '#00a54c', '3')

nodeHover(node, d3Ele.key, fundFlow!.nodes.find(v => v.id === d3Ele.key)!)
nodeHover(node, d3Ele.key, fundFlow.nodes.find(v => v.id === d3Ele.key)!)
})

node.on('mouseleave', () => {
Expand Down
5 changes: 3 additions & 2 deletions src/common/config/allowlist.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
ETHERSCAN_V1_MATCHES: [
'*://*.polygonscan.com/*',
'*://mumbai.polygonscan.com/*',
'*://*.snowtrace.io/*',
'*://optimistic.etherscan.io/*',
'*://*.arbiscan.io/*',
Expand All @@ -27,7 +27,8 @@ export default {
'*://bscscan.com/*',
'*://goto.bscscan.com/*',
'*://www.bscscan.com/*',
'*://testnet.bscscan.com/*'
'*://testnet.bscscan.com/*',
'*://polygonscan.com/*'
],
BTC_EXPLORER_MATCHES: ['*://explorer.btc.com/*'],
BLOCKSEC_MATCHES: ['*://*.blocksec.com/*'],
Expand Down
4 changes: 2 additions & 2 deletions src/content/opensea/feat-scripts/compliance-analysis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ const genComplianceRadarPlot = async () => {
if (originGraphEl) return

const containerEl = document.querySelector<HTMLElement>(
'#main > div > div > div > div:nth-of-type(5) > div > div:nth-of-type(2) > div, #main > div > div > div:nth-of-type(5) > div > div:nth-of-type(2) > div'
'#main > main > div > div > div > div:nth-of-type(5) > div > div:nth-of-type(2) > div, #main > div > div > div:nth-of-type(5) > div > div:nth-of-type(2) > div'
)

const linkEl = document.querySelector<HTMLElement>(
'#main > div > div > div > div:nth-of-type(3) > div > div > div:last-of-type > div > div > div:first-of-type > div > div > a:first-of-type, #main > div > div > div:nth-of-type(3) > div > div > div:last-of-type > div > div > div:first-of-type > div > div > a:first-of-type'
'#main > main > div > div > div > div:nth-of-type(3) > div > div > div:last-of-type > div > div > div:first-of-type > div > div > a:first-of-type, #main > div > div > div:nth-of-type(3) > div > div > div:last-of-type > div > div > div:first-of-type > div > div > a:first-of-type'
)

if (!containerEl || !linkEl) return
Expand Down

0 comments on commit f6b6b85

Please sign in to comment.