@taker007/crypto-guardian-snap 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/icon.svg +4 -29
- package/dist/bundle.js +1 -1
- package/package.json +1 -1
- package/snap.manifest.json +2 -2
package/assets/icon.svg
CHANGED
|
@@ -1,30 +1,5 @@
|
|
|
1
|
-
<svg width="256" height="256" viewBox="0 0 256 256"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<!-- Shield outline -->
|
|
7
|
-
<path d="M128 20
|
|
8
|
-
L200 60
|
|
9
|
-
L200 130
|
|
10
|
-
C200 180 165 215 128 236
|
|
11
|
-
C91 215 56 180 56 130
|
|
12
|
-
L56 60
|
|
13
|
-
Z" fill="none" stroke="#3B82F6" stroke-width="8"></path>
|
|
14
|
-
|
|
15
|
-
<!-- Network nodes -->
|
|
16
|
-
<circle cx="128" cy="95" r="8" fill="#3B82F6"></circle>
|
|
17
|
-
<circle cx="90" cy="135" r="6" fill="#3B82F6"></circle>
|
|
18
|
-
<circle cx="166" cy="135" r="6" fill="#3B82F6"></circle>
|
|
19
|
-
<circle cx="128" cy="165" r="6" fill="#3B82F6"></circle>
|
|
20
|
-
|
|
21
|
-
<!-- Network lines -->
|
|
22
|
-
<line x1="128" y1="95" x2="90" y2="135" stroke="#3B82F6" stroke-width="4"></line>
|
|
23
|
-
<line x1="128" y1="95" x2="166" y2="135" stroke="#3B82F6" stroke-width="4"></line>
|
|
24
|
-
<line x1="90" y1="135" x2="128" y2="165" stroke="#3B82F6" stroke-width="4"></line>
|
|
25
|
-
<line x1="166" y1="135" x2="128" y2="165" stroke="#3B82F6" stroke-width="4"></line>
|
|
26
|
-
|
|
27
|
-
<!-- Checkmark -->
|
|
28
|
-
<path d="M105 135 L120 150 L150 115" fill="none" stroke="#22C55E" stroke-width="8" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
29
|
-
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 256 256">
|
|
2
|
+
<rect width="256" height="256" rx="48" fill="#0B0F1A"/>
|
|
3
|
+
<path d="M128 24 L212 64 V128 C212 180 172 220 128 232 C84 220 44 180 44 128 V64 Z" fill="#14F195"/>
|
|
4
|
+
<circle cx="128" cy="120" r="36" fill="#0B0F1A"/>
|
|
30
5
|
</svg>
|
package/dist/bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};(()=>{"use strict";function n(e,t,n){if("string"==typeof e)throw new Error(`An HTML element ("${String(e)}") was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.`);if(!e)throw new Error("A JSX fragment was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.");return e({...t,key:n})}function o(e,t,o){return n(e,t,o)}function a(e){return Object.fromEntries(Object.entries(e).filter((([,e])=>void 0!==e)))}function r(e){return t=>{const{key:n=null,...o}=t;return{type:e,props:a(o),key:n}}}e.r(t),e.d(t,{onRpcRequest:()=>R});const i=r("Box"),s=r("Heading"),l=r("Divider"),c=r("Row"),d=r("Text"),h=r("Bold"),u="plain",y={formal:{warningHeadline:"This token may be unsafe. Here's why.",acknowledgementHeadline:"Before you proceed",sectionWhyFlagged:"WHY THIS TOKEN WAS FLAGGED",sectionWhatMeans:"WHAT THIS COULD MEAN",sectionObservations:"WHAT WE OBSERVED ON-CHAIN",labelRiskLevel:"Risk Level",labelTradeability:"Tradeability",disclaimerAnalysis:"This analysis reflects on-chain behavior at the time of review and may change.",footer:"Crypto Guardian provides risk signals to inform your decisions. It does not control your wallet or transactions.",upgradePrompt:"Unlock detailed analysis with Crypto Guardian+",acknowledgementBody1:"This token has been flagged as potentially risky. Our analysis is informational and does not guarantee outcomes.",acknowledgementBody2:"You are choosing to proceed with full awareness of the signals shown."},plain:{warningHeadline:"Heads up — we found some concerns.",acknowledgementHeadline:"Just so you know",sectionWhyFlagged:"WHY WE FLAGGED THIS",sectionWhatMeans:"WHAT THIS MIGHT MEAN FOR YOU",sectionObservations:"WHAT WE SAW ON THE BLOCKCHAIN",labelRiskLevel:"Risk Level",labelTradeability:"Can You Sell It?",disclaimerAnalysis:"This is based on what we can see right now. Things can change later.",footer:"Crypto Guardian shares what we find to help you decide. You're always in control of your wallet.",upgradePrompt:"Want the full picture? Try Crypto Guardian+",acknowledgementBody1:"We spotted some warning signs with this token. This info is meant to help you decide — it can't predict what will happen.",acknowledgementBody2:"If you continue, you're doing so knowing what we found."}},p={formal:{reasons:{VERIFIED:"Our analysis simulated a transfer from this token's contract. The simulation completed without errors.",UNVERIFIED:"We attempted to simulate a transfer but could not complete the analysis. This may be due to network conditions or contract complexity.",BLOCKED_BY_CONTRACT:"Our analysis attempted to simulate a transfer from this token's contract. The simulation was rejected."},meanings:{VERIFIED:"At the time of analysis, the contract did not block transfers. This does not guarantee future behavior or rule out other risks.",UNVERIFIED:"We cannot confirm whether this token can be sold. Proceed with caution if you choose to continue.",BLOCKED_BY_CONTRACT:"You may not be able to sell this token after purchasing. This pattern is sometimes associated with honeypot contracts."},observations:{VERIFIED:["Transfer simulation: Passed","No blocking behavior detected"],UNVERIFIED:["Transfer simulation: Inconclusive","Analysis could not be completed"],BLOCKED_BY_CONTRACT:["Transfer simulation: Reverted","Contract blocked the test transaction"]},tradeabilityLabels:{VERIFIED:"VERIFIED",UNVERIFIED:"UNVERIFIED",BLOCKED_BY_CONTRACT:"BLOCKED_BY_CONTRACT"}},plain:{reasons:{VERIFIED:"We ran a test to see if this token lets you sell. The test worked without any problems.",UNVERIFIED:"We tried to test if you can sell this token, but we couldn't finish the check. This might be a network issue or something unusual about the token.",BLOCKED_BY_CONTRACT:"We tried to test if you can sell this token. The token's code stopped our test from working."},meanings:{VERIFIED:"When we checked, the token didn't block sales. But this could change, and there might be other things to watch out for.",UNVERIFIED:"We can't say for sure if you'll be able to sell this token. If you go ahead, be extra careful.",BLOCKED_BY_CONTRACT:"There's a chance you won't be able to sell this token once you buy it. This is sometimes a sign of a scam token (called a \"honeypot\")."},observations:{VERIFIED:["Sale test: Passed","No red flags found"],UNVERIFIED:["Sale test: Unclear","We couldn't finish checking"],BLOCKED_BY_CONTRACT:["Sale test: Blocked","The token stopped our test"]},tradeabilityLabels:{VERIFIED:"Looks OK",UNVERIFIED:"Not Sure",BLOCKED_BY_CONTRACT:"Blocked"}}};function m(){return y[u]}function f(){return p[u]}function b(e){switch(e){case"LOW":return"LOW";case"HIGH":return"HIGH";case"CRITICAL":return"CRITICAL";default:return"UNKNOWN"}}function T(e){return f().tradeabilityLabels[e]}function g(e){switch(e){case"LOW":return"LOW";case"CRITICAL":return"CRITICAL";default:return"HIGH"}}function w(e){switch(e){case"VERIFIED":return"VERIFIED";case"BLOCKED_BY_CONTRACT":return"BLOCKED_BY_CONTRACT";default:return"UNVERIFIED"}}const E={riskLevel:"HIGH",tradeability:"UNVERIFIED",warnings:["Unable to verify this token at the moment."]};function I(e){const t=m();return o(i,{children:[n(s,{children:t.warningHeadline}),n(l,{}),n(c,{label:t.labelRiskLevel,children:n(d,{children:n(h,{children:b(e.riskLevel)})})}),n(c,{label:t.labelTradeability,children:n(d,{children:n(h,{children:T(e.tradeability)})})}),n(l,{}),n(d,{children:t.disclaimerAnalysis}),n(l,{}),n(d,{children:t.upgradePrompt}),n(l,{}),n(d,{children:t.footer})]})}function k(e){const t=m();return o(i,{children:[n(s,{children:t.warningHeadline}),n(l,{}),n(c,{label:t.labelRiskLevel,children:n(d,{children:n(h,{children:b(e.riskLevel)})})}),n(c,{label:t.labelTradeability,children:n(d,{children:n(h,{children:T(e.tradeability)})})}),n(l,{}),e.reason&&o(i,{children:[n(d,{children:n(h,{children:t.sectionWhyFlagged})}),n(d,{children:e.reason})]}),e.meaning&&o(i,{children:[n(d,{children:n(h,{children:t.sectionWhatMeans})}),n(d,{children:e.meaning})]}),e.observations&&e.observations.length>0&&o(i,{children:[n(d,{children:n(h,{children:t.sectionObservations})}),e.observations.map(((e,t)=>o(d,{children:["• ",e]},`obs-${e.substring(0,10)}`)))]}),n(l,{}),n(d,{children:t.disclaimerAnalysis}),n(l,{}),n(d,{children:t.footer})]})}function C(){const e=m();return o(i,{children:[n(s,{children:e.acknowledgementHeadline}),n(l,{}),n(d,{children:e.acknowledgementBody1}),n(d,{children:e.acknowledgementBody2}),n(l,{}),n(d,{children:e.footer})]})}function O(e){const t=f();return{riskLevel:{VERIFIED:"LOW",UNVERIFIED:"HIGH",BLOCKED_BY_CONTRACT:"CRITICAL"}[e],tradeability:e,reason:t.reasons[e],meaning:t.meanings[e],observations:t.observations[e]}}const R=async({origin:e,request:t})=>{switch(t.method){case"showWarning":{const e=t.params,n=O(e?.tradeability||"BLOCKED_BY_CONTRACT");return snap.request({method:"snap_dialog",params:{type:"confirmation",content:I(n)}})}case"showAnalysis":{const e=t.params,n=O(e?.tradeability||"BLOCKED_BY_CONTRACT");return snap.request({method:"snap_dialog",params:{type:"confirmation",content:k(n)}})}case"showAcknowledgement":return snap.request({method:"snap_dialog",params:{type:"confirmation",content:C()}});case"analyzeToken":{const e=t.params;if(!e?.tokenAddress)throw new Error("Token address is required");const n=function(e){return e?{riskLevel:g(e.risk.level),tradeability:w(e.risk.tradeability),warnings:e.risk.warnings}:E}(await async function(e){try{const t=await fetch("http://192.168.20.60:4006/api/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e,chainId:"eth"})});return t.ok?await t.json():(console.error(`[CryptoGuard] Backend returned ${t.status}: ${t.statusText}`),null)}catch(e){return console.error("[CryptoGuard] Failed to reach backend:",e),null}}(e.tokenAddress));return snap.request({method:"snap_dialog",params:{type:"confirmation",content:I(n)}})}case"getCopyMode":return{mode:u};default:throw new Error(`Method not found: ${t.method}`)}}})(),module.exports=t})();
|
|
1
|
+
(()=>{var e={d:(n,t)=>{for(var o in t)e.o(t,o)&&!e.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:t[o]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};(()=>{"use strict";function t(e,n,t){if("string"==typeof e)throw new Error(`An HTML element ("${String(e)}") was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.`);if(!e)throw new Error("A JSX fragment was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.");return e({...n,key:t})}function o(e,n,o){return t(e,n,o)}function i(e){return Object.fromEntries(Object.entries(e).filter((([,e])=>void 0!==e)))}function r(e){return n=>{const{key:t=null,...o}=n;return{type:e,props:i(o),key:t}}}e.r(n),e.d(n,{onRpcRequest:()=>_});const a=r("Box"),s=r("Heading"),l=r("Divider"),c=r("Row"),d=r("Text"),u=r("Bold"),h=r("Link"),m="plain",p={formal:{warningHeadline:"This token may be unsafe. Here's why.",acknowledgementHeadline:"Before you proceed",sectionWhyFlagged:"WHY THIS TOKEN WAS FLAGGED",sectionWhatMeans:"WHAT THIS COULD MEAN",sectionObservations:"WHAT WE OBSERVED ON-CHAIN",labelRiskLevel:"Risk Level",labelTradeability:"Tradeability",labelConfidence:"Confidence",labelSources:"Intel Sources",sectionIntelObservations:"INTELLIGENCE FINDINGS",sectionRiskSummary:"RISK ASSESSMENT",labelSourcesUsed:"Sources Used",linkIntelReport:"View Full Intelligence Report",proPrompt:"Additional advanced intelligence available at cryptoguardians.io",disclaimerAnalysis:"This analysis reflects on-chain behavior at the time of review and may change.",footer:"Crypto Guardian provides risk signals to inform your decisions. It does not control your wallet or transactions.",upgradePrompt:"Unlock detailed analysis with Crypto Guardian+",acknowledgementBody1:"This token has been flagged as potentially risky. Our analysis is informational and does not guarantee outcomes.",acknowledgementBody2:"You are choosing to proceed with full awareness of the signals shown."},plain:{warningHeadline:"Heads up — we found some concerns.",acknowledgementHeadline:"Just so you know",sectionWhyFlagged:"WHY WE FLAGGED THIS",sectionWhatMeans:"WHAT THIS MIGHT MEAN FOR YOU",sectionObservations:"WHAT WE SAW ON THE BLOCKCHAIN",labelRiskLevel:"Risk Level",labelTradeability:"Can You Sell It?",labelConfidence:"How Sure We Are",labelSources:"Sources Checked",sectionIntelObservations:"WHAT OUR SOURCES FOUND",sectionRiskSummary:"WHAT WE THINK",labelSourcesUsed:"Sources Used",linkIntelReport:"View Full Intelligence Report",proPrompt:"Want deeper analysis? Visit cryptoguardians.io",disclaimerAnalysis:"This is based on what we can see right now. Things can change later.",footer:"Crypto Guardian shares what we find to help you decide. You're always in control of your wallet.",upgradePrompt:"Want the full picture? Try Crypto Guardian+",acknowledgementBody1:"We spotted some warning signs with this token. This info is meant to help you decide — it can't predict what will happen.",acknowledgementBody2:"If you continue, you're doing so knowing what we found."}},y={formal:{reasons:{VERIFIED:"Our analysis simulated a transfer from this token's contract. The simulation completed without errors.",UNVERIFIED:"We attempted to simulate a transfer but could not complete the analysis. This may be due to network conditions or contract complexity.",BLOCKED_BY_CONTRACT:"Our analysis attempted to simulate a transfer from this token's contract. The simulation was rejected."},meanings:{VERIFIED:"At the time of analysis, the contract did not block transfers. This does not guarantee future behavior or rule out other risks.",UNVERIFIED:"We cannot confirm whether this token can be sold. Proceed with caution if you choose to continue.",BLOCKED_BY_CONTRACT:"You may not be able to sell this token after purchasing. This pattern is sometimes associated with honeypot contracts."},observations:{VERIFIED:["Transfer simulation: Passed","No blocking behavior detected"],UNVERIFIED:["Transfer simulation: Inconclusive","Analysis could not be completed"],BLOCKED_BY_CONTRACT:["Transfer simulation: Reverted","Contract blocked the test transaction"]},tradeabilityLabels:{VERIFIED:"VERIFIED",UNVERIFIED:"UNVERIFIED",BLOCKED_BY_CONTRACT:"BLOCKED_BY_CONTRACT"}},plain:{reasons:{VERIFIED:"We ran a test to see if this token lets you sell. The test worked without any problems.",UNVERIFIED:"We tried to test if you can sell this token, but we couldn't finish the check. This might be a network issue or something unusual about the token.",BLOCKED_BY_CONTRACT:"We tried to test if you can sell this token. The token's code stopped our test from working."},meanings:{VERIFIED:"When we checked, the token didn't block sales. But this could change, and there might be other things to watch out for.",UNVERIFIED:"We can't say for sure if you'll be able to sell this token. If you go ahead, be extra careful.",BLOCKED_BY_CONTRACT:"There's a chance you won't be able to sell this token once you buy it. This is sometimes a sign of a scam token (called a \"honeypot\")."},observations:{VERIFIED:["Sale test: Passed","No red flags found"],UNVERIFIED:["Sale test: Unclear","We couldn't finish checking"],BLOCKED_BY_CONTRACT:["Sale test: Blocked","The token stopped our test"]},tradeabilityLabels:{VERIFIED:"Looks OK",UNVERIFIED:"Not Sure",BLOCKED_BY_CONTRACT:"Blocked"}}};function f(){return p[m]}function b(){return y[m]}const k={HONEYPOT_RISK:{formal:"Honeypot risk detected in contract",plain:"This token may trap your funds"},HIGH_TAX:{formal:"Abnormally high transaction tax detected",plain:"Very high fees when buying/selling"},PROXY_CONTRACT:{formal:"Contract uses upgradeable proxy pattern",plain:"Contract code can be changed by owner"},UNVERIFIED_SOURCE:{formal:"Contract source code is not verified",plain:"Contract code is hidden — can't be reviewed"},OWNERSHIP_NOT_RENOUNCED:{formal:"Contract ownership not renounced",plain:"Someone still controls this contract"},LOW_LIQUIDITY:{formal:"Low liquidity pool depth",plain:"Very little money backing this token"},VERY_LOW_LIQUIDITY:{formal:"Critically low liquidity",plain:"Almost no money backing this token"},MINT_AUTHORITY_PRESENT:{formal:"Mint authority retained — supply can increase",plain:"Owner can create more tokens anytime"},FREEZE_AUTHORITY_PRESENT:{formal:"Freeze authority present — accounts can be frozen",plain:"Owner can freeze your tokens"},HIGH_HOLDER_CONCENTRATION:{formal:"Top holders control large supply percentage",plain:"A few wallets hold most of the supply"},EXTREME_HOLDER_CONCENTRATION:{formal:"Extreme holder concentration detected",plain:"A tiny number of wallets control most tokens"},CREATOR_IS_NEW_WALLET:{formal:"Creator wallet has no prior history",plain:"Created by a brand-new wallet"},LP_NOT_LOCKED:{formal:"Liquidity pool is not locked",plain:"Liquidity can be pulled at any time"},RUGCHECK_HIGH_RISK:{formal:"RugCheck: High rugpull risk score",plain:"High risk of being a rug pull"},VERY_FEW_HOLDERS:{formal:"Token has very few holders",plain:"Almost nobody holds this token"},TOKEN_2022:{formal:"Token uses Token-2022 program extensions",plain:"Token uses newer program with extra features"}};function E(e){const n=e.riskFlags.length+e.scamIndicators.length;return"DANGEROUS"===e.recommendation||e.riskScore>=70?`This token shows multiple warning signs${n>0?` including ${n} risk indicators`:""}. Be very careful.`:"CAUTION"===e.recommendation||e.riskScore>=30?`This token has some risk indicators${n>0?` (${n} found)`:""}. Review carefully before interacting.`:"No major risk indicators detected based on available intelligence sources."}function I(e){const n=e.confidenceScore,t=e.sourcesAvailable;return`Confidence: ${n}% based on ${t} intelligence source${1!==t?"s":""}.`}function g(e){switch(e){case"LOW":return"LOW";case"HIGH":return"HIGH";case"CRITICAL":return"CRITICAL";default:return"UNKNOWN"}}function T(e){return b().tradeabilityLabels[e]}function w(e){switch(e){case"LOW":return"LOW";case"CRITICAL":return"CRITICAL";default:return"HIGH"}}function R(e){switch(e){case"VERIFIED":return"VERIFIED";case"BLOCKED_BY_CONTRACT":return"BLOCKED_BY_CONTRACT";default:return"UNVERIFIED"}}const C={riskLevel:"HIGH",tradeability:"UNVERIFIED",warnings:["Unable to verify this token at the moment."]};function O(e){if(!e)return C;const n={riskLevel:w(e.risk.level),tradeability:R(e.risk.tradeability),warnings:e.risk.warnings};if(e.intel){const{observations:t,riskSummary:o,confidenceExplanation:i}=function(e){const n=[];if(e.tokenName&&e.tokenSymbol){const t=`Token: ${e.tokenName} (${e.tokenSymbol})`;n.push(t)}if(e.isVerified&&n.push("Contract code: Publicly verified"),e.liquidityUsd>0){const t=e.liquidityUsd>=1e6?`$${(e.liquidityUsd/1e6).toFixed(1)}M`:e.liquidityUsd>=1e3?`$${(e.liquidityUsd/1e3).toFixed(0)}K`:`$${e.liquidityUsd.toFixed(0)}`;n.push(`Liquidity: ${t}`)}for(const t of e.riskFlags.slice(0,5)){const e=k[t];e&&n.push(e[m])}for(const t of e.scamIndicators.slice(0,3)){const e=k[t];e&&n.push(e[m])}return{observations:n,riskSummary:E(e),confidenceExplanation:I(e),intelReportUrl:null}}(e.intel);n.tokenName=e.intel.tokenName,n.tokenSymbol=e.intel.tokenSymbol,n.confidencePercent=e.intel.confidenceScore,n.sourcesUsed=e.intel.sourcesAvailable,n.sourceNames=e.intel.sourceNames,n.intelObservations=t,n.recommendation=e.intel.recommendation,n.riskSummary=o,n.confidenceExplanation=i,n.intelReportUrl=function(e,n="eth"){return`https://cryptoguardians.io/intel/${e}?chain=${n}`}(e.token,e.chainId)}return n}function N(e){const n=f();return o(a,{children:[t(s,{children:n.warningHeadline}),t(l,{}),t(c,{label:n.labelRiskLevel,children:t(d,{children:t(u,{children:g(e.riskLevel)})})}),t(c,{label:n.labelTradeability,children:t(d,{children:t(u,{children:T(e.tradeability)})})}),void 0!==e.confidencePercent&&t(c,{label:n.labelConfidence,children:t(d,{children:o(u,{children:[e.confidencePercent,"%"]})})}),void 0!==e.sourcesUsed&&t(c,{label:n.labelSources,children:t(d,{children:o(u,{children:[e.sourcesUsed," checked"]})})}),e.riskSummary&&o(a,{children:[t(l,{}),t(d,{children:t(u,{children:n.sectionRiskSummary})}),t(d,{children:e.riskSummary})]}),e.confidenceExplanation&&t(d,{children:e.confidenceExplanation}),e.sourceNames&&e.sourceNames.length>0&&o(d,{children:[n.labelSourcesUsed,": ",e.sourceNames.join(", ")]}),t(l,{}),e.intelReportUrl&&t(d,{children:t(h,{href:e.intelReportUrl,children:n.linkIntelReport})}),t(d,{children:n.disclaimerAnalysis}),t(l,{}),t(d,{children:n.upgradePrompt}),t(l,{}),t(d,{children:n.footer})]})}function S(e){const n=f();return o(a,{children:[t(s,{children:n.warningHeadline}),t(l,{}),t(c,{label:n.labelRiskLevel,children:t(d,{children:t(u,{children:g(e.riskLevel)})})}),t(c,{label:n.labelTradeability,children:t(d,{children:t(u,{children:T(e.tradeability)})})}),void 0!==e.confidencePercent&&t(c,{label:n.labelConfidence,children:t(d,{children:o(u,{children:[e.confidencePercent,"%"]})})}),void 0!==e.sourcesUsed&&t(c,{label:n.labelSources,children:t(d,{children:o(u,{children:[e.sourcesUsed," checked"]})})}),e.riskSummary&&o(a,{children:[t(l,{}),t(d,{children:t(u,{children:n.sectionRiskSummary})}),t(d,{children:e.riskSummary})]}),e.confidenceExplanation&&t(d,{children:e.confidenceExplanation}),e.sourceNames&&e.sourceNames.length>0&&o(d,{children:[n.labelSourcesUsed,": ",e.sourceNames.join(", ")]}),t(l,{}),e.reason&&o(a,{children:[t(d,{children:t(u,{children:n.sectionWhyFlagged})}),t(d,{children:e.reason})]}),e.meaning&&o(a,{children:[t(d,{children:t(u,{children:n.sectionWhatMeans})}),t(d,{children:e.meaning})]}),e.observations&&e.observations.length>0&&o(a,{children:[t(d,{children:t(u,{children:n.sectionObservations})}),e.observations.map(((e,n)=>o(d,{children:["• ",e]},`obs-${e.substring(0,10)}`)))]}),e.intelObservations&&e.intelObservations.length>0&&o(a,{children:[t(d,{children:t(u,{children:n.sectionIntelObservations})}),e.intelObservations.map(((e,n)=>o(d,{children:["• ",e]},`intel-${e.substring(0,10)}`)))]}),t(l,{}),e.intelReportUrl&&t(d,{children:t(h,{href:e.intelReportUrl,children:n.linkIntelReport})}),t(d,{children:n.proPrompt}),t(d,{children:n.disclaimerAnalysis}),t(l,{}),t(d,{children:n.footer})]})}function A(){const e=f();return o(a,{children:[t(s,{children:e.acknowledgementHeadline}),t(l,{}),t(d,{children:e.acknowledgementBody1}),t(d,{children:e.acknowledgementBody2}),t(l,{}),t(d,{children:e.footer})]})}function L(e){const n=b();return{riskLevel:{VERIFIED:"LOW",UNVERIFIED:"HIGH",BLOCKED_BY_CONTRACT:"CRITICAL"}[e],tradeability:e,reason:n.reasons[e],meaning:n.meanings[e],observations:n.observations[e]}}const _=async({origin:e,request:n})=>{switch(n.method){case"showWarning":{const e=n.params,t=L(e?.tradeability||"BLOCKED_BY_CONTRACT");return snap.request({method:"snap_dialog",params:{type:"confirmation",content:N(t)}})}case"showAnalysis":{const e=n.params,t=L(e?.tradeability||"BLOCKED_BY_CONTRACT");return snap.request({method:"snap_dialog",params:{type:"confirmation",content:S(t)}})}case"showAcknowledgement":return snap.request({method:"snap_dialog",params:{type:"confirmation",content:A()}});case"analyzeToken":{const e=n.params;if(!e?.tokenAddress)throw new Error("Token address is required");const t=O(await async function(e){try{const n=await fetch("https://cryptoguardians.io/api/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e,chainId:"eth"})});return n.ok?await n.json():(console.error(`[CryptoGuard] Backend returned ${n.status}: ${n.statusText}`),null)}catch(e){return console.error("[CryptoGuard] Failed to reach backend:",e),null}}(e.tokenAddress));return snap.request({method:"snap_dialog",params:{type:"confirmation",content:N(t)}})}case"getCopyMode":return{mode:m};default:throw new Error(`Method not found: ${n.method}`)}}})(),module.exports=n})();
|
package/package.json
CHANGED
package/snap.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.0.
|
|
2
|
+
"version": "1.0.5",
|
|
3
3
|
"description": "Crypto Guardian provides risk signals for Ethereum tokens. Advisory only — does not block transactions.",
|
|
4
4
|
"proposedName": "Crypto Guardian",
|
|
5
5
|
"repository": {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"url": "https://github.com/taker007/crypto-guardian.git"
|
|
8
8
|
},
|
|
9
9
|
"source": {
|
|
10
|
-
"shasum": "
|
|
10
|
+
"shasum": "do1nNiGDDvb3tFioMnUxvdPNUksraReEW/BGGfwW1fU=",
|
|
11
11
|
"location": {
|
|
12
12
|
"npm": {
|
|
13
13
|
"filePath": "dist/bundle.js",
|