Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rss3/js-sdk

Package Overview
Dependencies
Maintainers
4
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rss3/js-sdk - npm Package Compare versions

Comparing version 0.6.17 to 0.6.18

4

lib/readable/profile/index.d.ts

@@ -33,2 +33,4 @@ import { components } from '../../types/data';

platform: string | undefined;
expireAt: string | null | undefined;
bio: string | undefined;
};

@@ -47,2 +49,4 @@ /**

platform: string | undefined;
expireAt: string | null | undefined;
bio: string | undefined;
};

@@ -61,2 +61,4 @@ import { addressToAvatarURL, formatAddress, isAddress } from '../address';

platform: profile?.platform,
expireAt: profile?.expireAt,
bio: profile?.bio,
};

@@ -63,0 +65,0 @@ }

2

package.json
{
"name": "@rss3/js-sdk",
"description": "RSS3 JavaScript SDK, the Turbocharger🌪️ for Your Next Open Web Development.",
"version": "0.6.17",
"version": "0.6.18",
"author": "Natural Selection Labs and RSS3 Contributors",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -1,1 +0,1 @@

var rss3;(()=>{var e={227:(e,t,a)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const a="color: "+this.color;t.splice(1,0,a,"color: inherit");let n=0,r=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(r=n))})),t.splice(r,0,a)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=a(447)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},447:(e,t,a)=>{e.exports=function(e){function t(e){let a,r,o,s=null;function i(...e){if(!i.enabled)return;const n=i,r=Number(new Date),o=r-(a||r);n.diff=o,n.prev=a,n.curr=r,a=r,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((a,r)=>{if("%%"===a)return"%";s++;const o=t.formatters[r];if("function"==typeof o){const t=e[s];a=o.call(n,t),e.splice(s,1),s--}return a})),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return i.namespace=e,i.useColors=t.useColors(),i.color=t.selectColor(e),i.extend=n,i.destroy=t.destroy,Object.defineProperty(i,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(r!==t.namespaces&&(r=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(i),i}function n(e,a){const n=t(this.namespace+(void 0===a?":":a)+e);return n.log=this.log,n}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let a;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length;for(a=0;a<r;a++)n[a]&&("-"===(e=n[a].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let a,n;for(a=0,n=t.skips.length;a<n;a++)if(t.skips[a].test(e))return!1;for(a=0,n=t.names.length;a<n;a++)if(t.names[a].test(e))return!0;return!1},t.humanize=a(824),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((a=>{t[a]=e[a]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let a=0;for(let t=0;t<e.length;t++)a=(a<<5)-a+e.charCodeAt(t),a|=0;return t.colors[Math.abs(a)%t.colors.length]},t.enable(t.load()),t}},824:e=>{var t=1e3,a=60*t,n=60*a,r=24*n;function o(e,t,a,n){var r=t>=1.5*a;return Math.round(e/a)+" "+n+(r?"s":"")}e.exports=function(e,s){s=s||{};var i,c,l=typeof e;if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*r;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*a;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===l&&isFinite(e))return s.long?(i=e,(c=Math.abs(i))>=r?o(i,c,r,"day"):c>=n?o(i,c,n,"hour"):c>=a?o(i,c,a,"minute"):c>=t?o(i,c,t,"second"):i+" ms"):function(e){var o=Math.abs(e);return o>=r?Math.round(e/r)+"d":o>=n?Math.round(e/n)+"h":o>=a?Math.round(e/a)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}},t={};function a(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,a),o.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";a.r(n),a.d(n,{addressToAvatarURL:()=>S,dataClient:()=>C,extractAsset:()=>oe,extractContent:()=>ee,extractPrimaryProfile:()=>re,extractProfile:()=>ne,fetchWithLog:()=>f,flatActivity:()=>X,format:()=>Z,formatAddress:()=>_,formatAddressAndNS:()=>k,formatContent:()=>Y,formatPlain:()=>B,formatProfiles:()=>ae,formatTokenValue:()=>q,getActions:()=>g,getTagType:()=>h,handleMetadata:()=>w,hasMultiPrimaryActions:()=>Q,isAddress:()=>v,isMastodon:()=>F,isSupportedNS:()=>x,markdownToTxt:()=>y,searchClient:()=>b,summaryOfHTML:()=>U,themeHTML:()=>$,timeRange:()=>p,tokenizeAction:()=>K,tokenizeActivity:()=>G,tokenizeToActions:()=>V});const e={"Content-Type":"application/json"},t=/\/*$/;function r(e){const t=new URLSearchParams;if(e&&"object"==typeof e)for(const[a,n]of Object.entries(e))null!=n&&t.set(a,n);return t.toString()}function o(e){return JSON.stringify(e)}function s(a={}){const{fetch:n=globalThis.fetch,querySerializer:s,bodySerializer:i,...c}=a,l=new Headers({...e,...c.headers??{}});async function u(e,a){const{headers:u,body:d,params:m={},parseAs:f="json",querySerializer:p=s??r,bodySerializer:g=i??o,...h}=a||{},y=function(e,a){let n=`${a.baseUrl?a.baseUrl.replace(t,""):""}${e}`;if(a.params.path)for(const[e,t]of Object.entries(a.params.path))n=n.replace(`{${e}}`,encodeURIComponent(String(t)));if(a.params.query){const e=a.querySerializer(a.params.query);e&&(n+=`?${e}`)}return n}(e,{baseUrl:c.baseUrl,params:m,querySerializer:p}),C=new Headers(l),b=new Headers(u);for(const[e,t]of b.entries())null==t?C.delete(e):C.set(e,t);const w={redirect:"follow",...c,...h,headers:C};d&&(w.body=g(d));const v=await n(y,w);if(204===v.status||"0"===v.headers.get("Content-Length"))return v.ok?{data:{},response:v}:{error:{},response:v};if(v.ok){let e=v.body;if("stream"!==f){const t=v.clone();e="function"==typeof t[f]?await t[f]():await t.text()}return{data:e,response:v}}let F={};try{F=await v.clone().json()}catch{F=await v.clone().text()}return{error:F,response:v}}return{get:async(e,t)=>u(e,{...t,method:"GET"}),put:async(e,t)=>u(e,{...t,method:"PUT"}),post:async(e,t)=>u(e,{...t,method:"POST"}),del:async(e,t)=>u(e,{...t,method:"DELETE"}),options:async(e,t)=>u(e,{...t,method:"OPTIONS"}),head:async(e,t)=>u(e,{...t,method:"HEAD"}),patch:async(e,t)=>u(e,{...t,method:"PATCH"}),trace:async(e,t)=>u(e,{...t,method:"TRACE"})}}const i=function(e,t){if("undefined"!=typeof process){const e=process.env.DEFAULT_RSS3_NET;if(e)return e}return"https://api.rss3.io"}(),c="115792089237316195423570985008687907853269984665640564039457584007913129639935",l=[".eth",".lens",".csb",".bnb",".bit",".crypto",".zil",".nft",".x",".wallet",".bitcoin",".dao",".888",".blockchain",".avax",".arb",".cyber"],u="0x0000000000000000000000000000000000000000";var d=a(227);const m=a.n(d)()("@rss3/js-sdk");function f(e,t=fetch){return(a,n)=>(n?.body?e("%s %s %s",n?.method,a,n?.body):e("%s %s",n?.method,a),t(a,n))}function p(e="all"){const t=Date.now();switch(e){case"all":return{lte:-1,gte:-1};case"day":return{lte:t,gte:t-864e5};case"week":return{lte:t,gte:t-6048e5};case"month":return{lte:t,gte:t-2592e6};case"year":return{lte:t,gte:t-31536e6}}}function g(e){return 1===e.actions.length?e.actions:e.actions?e.actions.filter((t=>t.tag===e.tag&&t.type===e.type)):[]}function h(e){return`${e.tag}-${e.type}`}function y(e){let t=e?.replaceAll(/!\[[^\]]*\]\((.*?)\s*("(?:.*[^"])")?\s*\)/g,"");return t=t?.replace(/(<([^>]+)>)/gi," "),t=t?.replace(/(#+\s)/gi,""),t}function C(e={}){e.baseUrl||(e.baseUrl=i+"/data");const t=m.extend("search");e.fetch=f(t.extend("fetch"),e.fetch);const a=s(e);return{async activity(e){const{data:t,error:n}=await a.get("/activities/{id}",{params:{path:{id:e}}});if(n||!t)throw n;return t.data&&t.meta?{data:t.data,meta:t.meta}:t},async activities(e,t){const{data:n,error:r}=await a.get("/accounts/{account}/activities",{params:{path:{account:e},query:t}});if(r||!n)throw r;return n.meta?{data:n.data.map((e=>e)),meta:n.meta}:n},async activitiesBatch(e){const{data:t,error:n}=await a.post("/accounts/activities",{body:e});if(n||!t)throw n;return t.meta?{data:t.data.map((e=>e)),meta:t.meta}:t},async mastodonActivities(t,a={}){const n=s(e),{data:r,error:o}=await n.get("/mastodon/{account}/activities",{params:{path:{account:t},query:a}});if(o||!r)throw o;return r.meta?{data:r.data.map((e=>e)),meta:r.meta}:r},async profiles(e,t={}){const{data:n,error:r}=await a.get("/accounts/{account}/profiles",{params:{path:{account:e},query:t}});if(r||!n)throw r;return{data:n.data.map((e=>e)),meta:null}},async mastodonProfiles(e){const[t,a]=e.split("@"),n=await fetch(`https://${a}/api/v2/search?q=${t}&resolve=false&limit=1`).then((e=>e.json())).catch((()=>({data:[]})));if(0===n.accounts.length)return{data:[],meta:null};{const e=n.accounts[0];return{data:[{address:`${e.username}@${a}`,bio:e.note,handle:`${e.username}@${a}`,name:e.username,network:"Mastodon",platform:"Mastodon",profileURI:[e.avatar],url:e.url}],meta:null}}}}}function b(e={}){e.baseUrl||(e.baseUrl=i+"/search");const t=m.extend("search");e.fetch=f(t.extend("fetch"),e.fetch);const a=s(e),n=s(e);return{async spellCheck(e){const{data:t,error:n}=await a.get("/suggestions/spellcheck",{params:{query:e}});if(n||!t)throw n;return t},async suggestions(e){const{data:t,error:n}=await a.get("/suggestions/autocomplete",{params:{query:e}});if(n||!t)throw n;return t},async relatedAddresses(e){const{data:t,error:n}=await a.get("/suggestions/related-addresses",{params:{query:e}});if(n||!t)throw n;return t},async activities(e){const{data:t,error:n}=await a.get("/activities",{params:{query:e}});if(n||!t)throw n;return t},async activity(e){const{data:t,error:n}=await a.get("/activities/{id}",{params:{path:{id:e}}});if(n||!t)throw n;return t},async nft(e){const{data:t,error:a}=await n.post("/api/nft/v2/searchNftCollection",{body:e});if(a||!t)throw a;return t},async wiki(e){const{data:t,error:a}=await n.get("/api/wiki/search",{params:{query:e}});if(a||!t)throw a;return t},async nftImages(e){const{data:t,error:a}=await n.get("/api/nft/nftImages",{params:{query:e}});if(a||!t)throw a;return t},async nftImage(e){const{data:t,error:a}=await n.get("/api/nft/nftImageDetail",{params:{query:e}});if(a||!t)throw a;return t},async dapp(e){const{data:t,error:n}=await a.get("/dapps",{params:{query:e}});if(n||!t)throw n;return t},async todayInHistory(e){const{data:t,error:a}=await n.get("/api/news/today-in-history",{params:{query:e}});if(a||!t)throw a;return t}}}function w(e,t){const a=t[h(e)];a&&a(e.metadata)}function v(e){return!!/^(0x)?[\dA-Fa-f]{40}$/.test(e)}function F(e){return/^\w{1,30}@[\d.A-Za-z-]+\.[A-Za-z]{2,}$/.test(e)}function x(e){if(!e)return!1;let t=!1;return l.map((a=>{e.endsWith(a)&&(t=!0)})),t}function _(e){return e?v(e)?e.slice(0,6)+"..."+e.slice(-4):e:""}function k(e){return v(e)?_(e):x(e)?e.split(".").map((e=>_(e))).join("."):e}function S(e,t){return`https://cdn.stamp.fyi/avatar/${e}?s=${t}`}const A={html:e=>JSON.stringify(R(I(e))),name:e=>JSON.stringify(e),platform:e=>e,address:e=>e,network:e=>JSON.stringify(e),number:e=>e,image:()=>"",symbolImage:()=>"",symbol:e=>e,text:e=>e,time:e=>e,separator:e=>e,unknown:e=>e},$={html:e=>`<span style="color: blueviolet;">${JSON.stringify(R(I(e)))}</span>`,name:e=>`<span style="color: blue;">${e}</span>`,platform:e=>`<span style="color: red;">${e}</span>`,address:e=>`<img src="https://cdn.stamp.fyi/avatar/${e}?s=300" style="height: 32px;" /> <span style="color: green;">${k(e)}</span>`,network:e=>`<span style="color: red;">${e}</span>`,number:e=>e,image:e=>e?`<img src="${e}" style="height: 64px;" />`:"",symbolImage:e=>e?`<img src="${e}" style="height: 16px;" />`:"",symbol:e=>`<span style="color: green;">${e}</span>`,text:e=>e,time:e=>`<span style="color: gray;">${new Date(e).toLocaleString()}</span>`,separator:e=>e,unknown:e=>e};function R(e){let t=!1;return/\n/.test(e)&&(e=(e=e.replace(/\n[\s\S]+/g," ")).trim()),e.length>50&&(e=e.slice(0,50),t=!0),e+(t?"...":"")}function I(e){return e.replace(/<[^>]*>?/gm,"")}function U(e){const t=document.createElement("div");return t.innerHTML=e,R(t.innerText)}function q(e,t){let a,n="0.00";if(e){if(Number.isNaN(Number(e))||0===Number(e))return"0.00";Number(e)>0&&void 0!==t&&(o=t,e=(r=(r=e).length>o?r.slice(0,r.length-o)+"."+r.slice(-o):"0."+"0".repeat(o-r.length)+r).replace(/0+$/,""));const s=e.match(/^(0.0+)(.*)/);a=Number(e)>0&&Number(e)<1?s?s?.[1]+s?.[2].slice(0,3):"0."+e.split("0.")[1].slice(0,3):Number(Number(e).toFixed(3)).toString(),a.includes(".")||(a=Number(e).toFixed(2)),n=a.replace(/(\d)(?=(\d{3})+\.\d+)/g,"$1,")}var r,o;return n}function N(e,t=""){return{type:e,content:t}}const E=j(" "),T=N("separator","; ");function O(e,t=E){return e.reduce(((e,a)=>[...e,t,a]),[]).slice(1)}function j(e){return N("text",e)}function M(e){return N("name",e)}function z(e){return N("image",e||"")}function P(e){return N("network",e||"")}function L(e,t){return e?(e.handle||e.address||!e.name||M(e.name),e.handle?D(e.handle):e.address===u?D(t):D(e.address)):N("unknown","")}function D(e){return N("address",e||"")}function H(e){return e?e.value===c?[N("number","infinite"),N("symbol",e.symbol)]:[N("symbolImage",e.image),N("number",q(e.value,e.decimals)||"0"),N("symbol",e.symbol)]:[N("number","0")]}function J(e){let t="";return e.platform?(t=e.platform,[j("on"),N("platform",t)]):[]}function W(e){if("social"!==e.tag)return j("");let t="";return"title"in e.metadata&&e.metadata.title?t=e.metadata.title:"body"in e.metadata&&e.metadata.body?t=e.metadata.body:"target"in e.metadata&&e.metadata.target&&e.metadata.target.body&&(t=e.metadata.target.body),N("html",t)}function B(e){const t=Z(e,A).filter((e=>""!==e)),a=[];for(let e=0;e<t.length;e++)" "===t[e]&&" "===t[e+1]||a.push(t[e]);return a.join("")}function Z(e,t){return G(e).map((e=>t[e.type]?t[e.type](e.content):t.unknown(e.content)))}function G(e){const t=g(e).reduce(((t,a)=>0===t.length?K(e,a):[...t,T,...K(e,a)]),[]);var a;return t.push(E,(a=e.timestamp,N("time",new Date(1e3*a).toJSON()))),t}function V(e){const t=g(e),a=[];return t.map((t=>{a.push(K(e,t))})),a}function K(e,t){const a=e.owner,n=e.direction;let r=[j("Carried out an activity")];return w(t,{"transaction-transfer":e=>{r=a===t.from?O([D(t.from),j("sent"),...H(e),j("to"),D(t.to)]):O("in"===n?[D(t.to),j("received"),...H(e),j("from"),D(t.from)]:[D(t.to),j("claimed"),...H(e),j("from"),D(t.from)])},"transaction-approval":e=>{r="approve"===e.action?O([D(t.from),j("approved"),...H(e),j("to"),D(t.to)]):O([D(t.from),j("revoked the approval of"),...H(e),j("to"),D(t.to)])},"transaction-mint":e=>{r=O([D(t.from),j("minted"),...H(e)])},"transaction-burn":e=>{r=O([D(t.from),j("burned"),...H(e)])},"transaction-multisig":a=>{"create"===a.action?r=O([j("Created a multisig transaction"),j("to"),D(t.to),...J(e)]):"add_owner"===a.action?r=O([j("Added"),D(a.owner),j("to"),D(a.vault.address),...J(e)]):"remove_owner"===a.action?r=O([j("Removed"),D(a.owner),j("from"),D(a.vault.address),...J(e)]):"change_threshold"===a.action?r=O([j("Changed the threshold of"),D(a.vault.address),...J(e)]):"execution"===a.action&&(r=O([j("Executed a multisig transaction"),...J(e)]))},"transaction-bridge":t=>{let a=[];t.source_network&&t.source_network.name&&(a=[j("from"),P(t.source_network.name),j("to"),P(t.target_network.name)]),r="deposit"===t.action?O([j("Deposited"),...H(t.token),...a,...J(e)]):O([j("Withdrew"),...H(t.token),...a,...J(e)])},"transaction-deploy":e=>{r=O([j("Deployed a contract"),D(e.address)])},"collectible-transfer":e=>{r=O([D(t.from),j("transferred"),z(e.image_url),M(e.name||e.title||"an asset"),j("to"),D(t.to)])},"collectible-approval":e=>{r="approve"===e.action?O([j("Approved"),z(e.image_url),M(`${e.name} collection`),j("to"),D(t.to)]):O([j("Revoked the approval of"),z(e.image_url),M(`${e.name} collection`),j("to"),D(t.to)])},"collectible-mint":e=>{r=O("out"===n?[D(a),j("minted"),z(e.image_url),M(e.name||e.title||"an asset")]:[D(t.to),j("minted"),z(e.image_url),M(e.name||e.title||"an asset"),j("from"),D(t.from)])},"collectible-burn":e=>{r=O([j("Burned"),z(e.image_url),M(e.name||e.title||"an asset")])},"collectible-trade":e=>{r="buy"===e.action?O([j("Bought"),z(e.image_url),M(e.name||e.title||"an asset"),j("from"),D(t.from),...J(t)]):O([j("Sold"),z(e.image_url),M(e.name||e.title||"an asset"),j("to"),D(t.to),...J(t)])},"collectible-auction":e=>{r="create"===e.action?O([j("Created an auction for"),z(e.image_url),M(e.name||e.title||"an asset"),...J(t)]):"bid"===e.action?O([j("Made a bid for"),z(e.image_url),M(e.name||e.title||"an asset"),...J(t)]):"cancel"===e.action?O([j("Canceled an auction for"),z(e.image_url),M(e.name||e.title||"an asset"),...J(t)]):"update"===e.action?O([D(a),j("updated an auction for"),z(e.image_url),M(e.name||e.title||"an asset"),...J(t)]):"finalize"===e.action?O([D(a),j("won an auction for"),z(e.image_url),M(e.name||e.title||"an asset"),...J(t)]):O([D(a),j("invalidated an auction for"),z(e.image_url),M(e.name||e.title||"an asset"),...J(t)])},"exchange-swap":e=>{r=O([D(a),j("swapped"),...H(e.from),j("to"),...H(e.to),...J(t)])},"exchange-liquidity":e=>{const a=e.tokens.flatMap((e=>O([...H(e),j(",")]))).slice(0,-1);"add"===e.action?r=O([j("Added"),...a,j("to liquidity"),...J(t)]):"remove"===e.action?r=O([j("Removed"),...a,j("from liquidity"),...J(t)]):"collect"===e.action?r=O([j("Collected"),...a,j("from liquidity"),...J(t)]):"borrow"===e.action?r=O([j("Borrowed"),...a,j("from liquidity"),...J(t)]):"repay"===e.action?r=O([j("Repaid"),...a,j("to liquidity"),...J(t)]):"supply"===e.action?r=O([j("Supplied"),...a,j("to liquidity"),...J(t)]):"withdraw"===e.action&&(r=O([j("WithDrew"),...a,j("from liquidity"),...J(t)]))},"exchange-loan":e=>{"create"===e.action?r=O([j("Created loan"),...H(e.amount),...J(t)]):"liquidate"===e.action?r=O([j("liquidated loan"),...H(e.amount),...J(t)]):"refinance"===e.action?r=O([j("Refinanced loan"),...H(e.amount),...J(t)]):"repay"===e.action?r=O([j("Repaid loan"),...H(e.amount),...J(t)]):"seize"===e.action&&(r=O([j("Seized loan"),...H(e.amount),...J(t)]))},"donation-donate":e=>{r=O([D(a),j("donated"),z(e.logo),M(e.title||""),...J(t)])},"governance-propose":e=>{r=O([D(a),j("proposed for"),M(e.title||""),...J(t)])},"governance-vote":e=>{r=O([D(a),j("voted for"),M(e.proposal?.options?.join(",")||""),...J(t)])},"social-post":()=>{r=O([D(a),j("published a post"),W(t),...J(t)])},"social-comment":()=>{r=O([D(t.from),j("commented a post"),W(t),...J(t)])},"social-share":()=>{r=O([D(a),j("shared a post"),W(t),...J(t)])},"social-mint":()=>{r=O([D(a),j("minted a post"),W(t),...J(t)])},"social-revise":()=>{r=O([j("Revised a post"),W(t),...J(t)])},"social-follow":e=>{r=O([L(e.from,t.from),j("followed"),L(e.to,t.to),...J(t)])},"social-unfollow":e=>{r=O([L(e.from,t.from),j("unfollowed"),L(e.to,t.to),...J(t)])},"social-profile":e=>{"create"===e.action?r=O([j("Created a profile"),z(e.image_uri),M(e.name||e.handle||""),...J(t)]):"update"===e.action?r=O([j("Updated a profile"),z(e.image_uri),M(e.name||e.handle||""),...J(t)]):"renew"===e.action?r=O([j("Renewed a profile"),z(e.image_uri),M(e.name||e.handle||""),...J(t)]):"wrap"===e.action?r=O([j("Wrapped a profile"),z(e.image_uri),M(e.name||e.handle||""),...J(t)]):"unwrap"===e.action&&(r=O([j("Unwrapped a profile"),z(e.image_uri),M(e.name||e.handle||""),...J(t)]))},"social-proxy":e=>{r="appoint"===e.action?O([j("Approved a proxy"),...J(t)]):O([j("Removed a proxy"),...J(t)])},"social-delete":()=>{r=O([j("Deleted"),W(t),...J(t)])},"metaverse-transfer":e=>{r=O([D(a),j("transferred"),z(e.image_url),M(e.name||e.title||"an asset"),j("to"),D(t.to)])},"metaverse-mint":e=>{r=O([D(a),j("minted"),z(e.image_url),M(e.name||e.title||"an asset"),...J(t)])},"metaverse-burn":e=>{r=O([D(a),j("burned"),z(e.image_url),M(e.name||e.title||"an asset"),...J(t)])},"metaverse-trade":e=>{"buy"===e.action?r=O([D(a),j("bought"),z(e.image_url),M(e.name||e.title||"an asset"),j("from"),D(t.from),...J(t)]):"sell"===e.action?r=O([D(a),j("sold"),z(e.image_url),M(e.name||e.title||"an asset"),j("from"),D(t.from),...J(t)]):"list"===e.action&&(r=O([D(a),j("listed"),z(e.image_url),M(e.name||e.title||"an asset"),j("from"),D(t.from),...J(t)]))}}),r}function Q(e){const t=g(e);let a=0;return t.forEach((t=>{t.type===e.type&&t.tag===e.tag&&a++})),a>1}function X(e){if(Q(e)){const t=[];return g(e).forEach((a=>{t.push({...e,actions:[a]})})),t}return[e]}function Y(e){const t=g(e);if(t.length>0)return ee(t[0])}function ee(e){let t;return w(e,{"social-post":e=>{t=te(e)},"social-comment":e=>{t=te(e)},"social-mint":e=>{t=te(e)},"social-share":e=>{t=te(e)},"social-revise":e=>{t=te(e)},"social-delete":e=>{t=te(e)},"governance-propose":e=>{var a;t={title:(a=e).title,body:a.body}},"governance-vote":e=>{var a;a=e,t={title:a.proposal?.title,body:a.proposal?.body}}}),t}function te(e){const t=e.target,a=t?{author_url:t.author_url,handle:t.handle,profile_id:t.profile_id,title:t.title,body:t.body,media:t.media}:void 0;return{author_url:e.author_url,handle:e.handle,profile_id:e.profile_id,title:e.title,body:e.body,media:e.media,target:a}}function ae(e,t){if(!e)return e;let a=e||[],n=t;return n&&!v(n)&&(n=a.find((e=>!!e.address))?.address),n&&v(n)&&a.push({address:n,bio:"",handle:n,name:_(n),network:"Ethereum",platform:"Ethereum",profileURI:[S(n,30)],socialURI:[]}),a=a?.sort((e=>e?.handle===t?-1:1)),a=a?.sort((e=>"ENS Registrar"===e?.platform?-1:1)),a=a?.map((e=>{if("ENS Registrar"===e.platform&&e.profileURI&&e.profileURI.length>=1&&e.profileURI[0].startsWith("eip155:1")&&(e.profileURI=[`https://metadata.ens.domains/mainnet/avatar/${e.handle}`]),"Unstoppable"===e?.platform){const[t,a]=e?.profileURI||[];e.profileURI=[a,t]}return e})),a}function ne(e){return{name:e?.name||"",avatar:e?.profileURI?.[0]?e?.profileURI?.[0]:e?.handle&&S(e?.handle,30)||"",handle:e?.handle||"",banner:e?.bannerURI?.[0]||"",address:e?.address||"",url:e?.url||"",platform:e?.platform}}function re(e,t){return ne(t?e?.find((e=>e?.handle?.toLowerCase()===t.toLowerCase())):e?.[0])}function oe(e){let t;return w(e,{"collectible-transfer":e=>{t=se(e)},"collectible-approval":e=>{t=se(e)},"collectible-mint":e=>{t=se(e)},"collectible-burn":e=>{t=se(e)},"collectible-trade":e=>{t=se(e)},"collectible-auction":e=>{t=se(e)},"donation-donate":e=>{t=function(e){return{url:e.logo,title:e.title,description:e.description}}(e)}}),t}function se(e){return{url:e.image_url,title:e.name,description:e.description}}})(),rss3=n})();
var rss3;(()=>{var e={227:(e,t,a)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const a="color: "+this.color;t.splice(1,0,a,"color: inherit");let n=0,r=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(r=n))})),t.splice(r,0,a)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=a(447)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},447:(e,t,a)=>{e.exports=function(e){function t(e){let a,r,o,s=null;function i(...e){if(!i.enabled)return;const n=i,r=Number(new Date),o=r-(a||r);n.diff=o,n.prev=a,n.curr=r,a=r,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((a,r)=>{if("%%"===a)return"%";s++;const o=t.formatters[r];if("function"==typeof o){const t=e[s];a=o.call(n,t),e.splice(s,1),s--}return a})),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return i.namespace=e,i.useColors=t.useColors(),i.color=t.selectColor(e),i.extend=n,i.destroy=t.destroy,Object.defineProperty(i,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(r!==t.namespaces&&(r=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(i),i}function n(e,a){const n=t(this.namespace+(void 0===a?":":a)+e);return n.log=this.log,n}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let a;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length;for(a=0;a<r;a++)n[a]&&("-"===(e=n[a].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let a,n;for(a=0,n=t.skips.length;a<n;a++)if(t.skips[a].test(e))return!1;for(a=0,n=t.names.length;a<n;a++)if(t.names[a].test(e))return!0;return!1},t.humanize=a(824),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((a=>{t[a]=e[a]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let a=0;for(let t=0;t<e.length;t++)a=(a<<5)-a+e.charCodeAt(t),a|=0;return t.colors[Math.abs(a)%t.colors.length]},t.enable(t.load()),t}},824:e=>{var t=1e3,a=60*t,n=60*a,r=24*n;function o(e,t,a,n){var r=t>=1.5*a;return Math.round(e/a)+" "+n+(r?"s":"")}e.exports=function(e,s){s=s||{};var i,c,l=typeof e;if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*r;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*a;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===l&&isFinite(e))return s.long?(i=e,(c=Math.abs(i))>=r?o(i,c,r,"day"):c>=n?o(i,c,n,"hour"):c>=a?o(i,c,a,"minute"):c>=t?o(i,c,t,"second"):i+" ms"):function(e){var o=Math.abs(e);return o>=r?Math.round(e/r)+"d":o>=n?Math.round(e/n)+"h":o>=a?Math.round(e/a)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}},t={};function a(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,a),o.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";a.r(n),a.d(n,{addressToAvatarURL:()=>S,dataClient:()=>C,extractAsset:()=>oe,extractContent:()=>ee,extractPrimaryProfile:()=>re,extractProfile:()=>ne,fetchWithLog:()=>f,flatActivity:()=>X,format:()=>Z,formatAddress:()=>_,formatAddressAndNS:()=>k,formatContent:()=>Y,formatPlain:()=>B,formatProfiles:()=>ae,formatTokenValue:()=>q,getActions:()=>g,getTagType:()=>h,handleMetadata:()=>w,hasMultiPrimaryActions:()=>Q,isAddress:()=>v,isMastodon:()=>F,isSupportedNS:()=>x,markdownToTxt:()=>y,searchClient:()=>b,summaryOfHTML:()=>U,themeHTML:()=>$,timeRange:()=>p,tokenizeAction:()=>K,tokenizeActivity:()=>G,tokenizeToActions:()=>V});const e={"Content-Type":"application/json"},t=/\/*$/;function r(e){const t=new URLSearchParams;if(e&&"object"==typeof e)for(const[a,n]of Object.entries(e))null!=n&&t.set(a,n);return t.toString()}function o(e){return JSON.stringify(e)}function s(a={}){const{fetch:n=globalThis.fetch,querySerializer:s,bodySerializer:i,...c}=a,l=new Headers({...e,...c.headers??{}});async function u(e,a){const{headers:u,body:d,params:m={},parseAs:f="json",querySerializer:p=s??r,bodySerializer:g=i??o,...h}=a||{},y=function(e,a){let n=`${a.baseUrl?a.baseUrl.replace(t,""):""}${e}`;if(a.params.path)for(const[e,t]of Object.entries(a.params.path))n=n.replace(`{${e}}`,encodeURIComponent(String(t)));if(a.params.query){const e=a.querySerializer(a.params.query);e&&(n+=`?${e}`)}return n}(e,{baseUrl:c.baseUrl,params:m,querySerializer:p}),C=new Headers(l),b=new Headers(u);for(const[e,t]of b.entries())null==t?C.delete(e):C.set(e,t);const w={redirect:"follow",...c,...h,headers:C};d&&(w.body=g(d));const v=await n(y,w);if(204===v.status||"0"===v.headers.get("Content-Length"))return v.ok?{data:{},response:v}:{error:{},response:v};if(v.ok){let e=v.body;if("stream"!==f){const t=v.clone();e="function"==typeof t[f]?await t[f]():await t.text()}return{data:e,response:v}}let F={};try{F=await v.clone().json()}catch{F=await v.clone().text()}return{error:F,response:v}}return{get:async(e,t)=>u(e,{...t,method:"GET"}),put:async(e,t)=>u(e,{...t,method:"PUT"}),post:async(e,t)=>u(e,{...t,method:"POST"}),del:async(e,t)=>u(e,{...t,method:"DELETE"}),options:async(e,t)=>u(e,{...t,method:"OPTIONS"}),head:async(e,t)=>u(e,{...t,method:"HEAD"}),patch:async(e,t)=>u(e,{...t,method:"PATCH"}),trace:async(e,t)=>u(e,{...t,method:"TRACE"})}}const i=function(e,t){if("undefined"!=typeof process){const e=process.env.DEFAULT_RSS3_NET;if(e)return e}return"https://api.rss3.io"}(),c="115792089237316195423570985008687907853269984665640564039457584007913129639935",l=[".eth",".lens",".csb",".bnb",".bit",".crypto",".zil",".nft",".x",".wallet",".bitcoin",".dao",".888",".blockchain",".avax",".arb",".cyber"],u="0x0000000000000000000000000000000000000000";var d=a(227);const m=a.n(d)()("@rss3/js-sdk");function f(e,t=fetch){return(a,n)=>(n?.body?e("%s %s %s",n?.method,a,n?.body):e("%s %s",n?.method,a),t(a,n))}function p(e="all"){const t=Date.now();switch(e){case"all":return{lte:-1,gte:-1};case"day":return{lte:t,gte:t-864e5};case"week":return{lte:t,gte:t-6048e5};case"month":return{lte:t,gte:t-2592e6};case"year":return{lte:t,gte:t-31536e6}}}function g(e){return 1===e.actions.length?e.actions:e.actions?e.actions.filter((t=>t.tag===e.tag&&t.type===e.type)):[]}function h(e){return`${e.tag}-${e.type}`}function y(e){let t=e?.replaceAll(/!\[[^\]]*\]\((.*?)\s*("(?:.*[^"])")?\s*\)/g,"");return t=t?.replace(/(<([^>]+)>)/gi," "),t=t?.replace(/(#+\s)/gi,""),t}function C(e={}){e.baseUrl||(e.baseUrl=i+"/data");const t=m.extend("search");e.fetch=f(t.extend("fetch"),e.fetch);const a=s(e);return{async activity(e){const{data:t,error:n}=await a.get("/activities/{id}",{params:{path:{id:e}}});if(n||!t)throw n;return t.data&&t.meta?{data:t.data,meta:t.meta}:t},async activities(e,t){const{data:n,error:r}=await a.get("/accounts/{account}/activities",{params:{path:{account:e},query:t}});if(r||!n)throw r;return n.meta?{data:n.data.map((e=>e)),meta:n.meta}:n},async activitiesBatch(e){const{data:t,error:n}=await a.post("/accounts/activities",{body:e});if(n||!t)throw n;return t.meta?{data:t.data.map((e=>e)),meta:t.meta}:t},async mastodonActivities(t,a={}){const n=s(e),{data:r,error:o}=await n.get("/mastodon/{account}/activities",{params:{path:{account:t},query:a}});if(o||!r)throw o;return r.meta?{data:r.data.map((e=>e)),meta:r.meta}:r},async profiles(e,t={}){const{data:n,error:r}=await a.get("/accounts/{account}/profiles",{params:{path:{account:e},query:t}});if(r||!n)throw r;return{data:n.data.map((e=>e)),meta:null}},async mastodonProfiles(e){const[t,a]=e.split("@"),n=await fetch(`https://${a}/api/v2/search?q=${t}&resolve=false&limit=1`).then((e=>e.json())).catch((()=>({data:[]})));if(0===n.accounts.length)return{data:[],meta:null};{const e=n.accounts[0];return{data:[{address:`${e.username}@${a}`,bio:e.note,handle:`${e.username}@${a}`,name:e.username,network:"Mastodon",platform:"Mastodon",profileURI:[e.avatar],url:e.url}],meta:null}}}}}function b(e={}){e.baseUrl||(e.baseUrl=i+"/search");const t=m.extend("search");e.fetch=f(t.extend("fetch"),e.fetch);const a=s(e),n=s(e);return{async spellCheck(e){const{data:t,error:n}=await a.get("/suggestions/spellcheck",{params:{query:e}});if(n||!t)throw n;return t},async suggestions(e){const{data:t,error:n}=await a.get("/suggestions/autocomplete",{params:{query:e}});if(n||!t)throw n;return t},async relatedAddresses(e){const{data:t,error:n}=await a.get("/suggestions/related-addresses",{params:{query:e}});if(n||!t)throw n;return t},async activities(e){const{data:t,error:n}=await a.get("/activities",{params:{query:e}});if(n||!t)throw n;return t},async activity(e){const{data:t,error:n}=await a.get("/activities/{id}",{params:{path:{id:e}}});if(n||!t)throw n;return t},async nft(e){const{data:t,error:a}=await n.post("/api/nft/v2/searchNftCollection",{body:e});if(a||!t)throw a;return t},async wiki(e){const{data:t,error:a}=await n.get("/api/wiki/search",{params:{query:e}});if(a||!t)throw a;return t},async nftImages(e){const{data:t,error:a}=await n.get("/api/nft/nftImages",{params:{query:e}});if(a||!t)throw a;return t},async nftImage(e){const{data:t,error:a}=await n.get("/api/nft/nftImageDetail",{params:{query:e}});if(a||!t)throw a;return t},async dapp(e){const{data:t,error:n}=await a.get("/dapps",{params:{query:e}});if(n||!t)throw n;return t},async todayInHistory(e){const{data:t,error:a}=await n.get("/api/news/today-in-history",{params:{query:e}});if(a||!t)throw a;return t}}}function w(e,t){const a=t[h(e)];a&&a(e.metadata)}function v(e){return!!/^(0x)?[\dA-Fa-f]{40}$/.test(e)}function F(e){return/^\w{1,30}@[\d.A-Za-z-]+\.[A-Za-z]{2,}$/.test(e)}function x(e){if(!e)return!1;let t=!1;return l.map((a=>{e.endsWith(a)&&(t=!0)})),t}function _(e){return e?v(e)?e.slice(0,6)+"..."+e.slice(-4):e:""}function k(e){return v(e)?_(e):x(e)?e.split(".").map((e=>_(e))).join("."):e}function S(e,t){return`https://cdn.stamp.fyi/avatar/${e}?s=${t}`}const A={html:e=>JSON.stringify(R(I(e))),name:e=>JSON.stringify(e),platform:e=>e,address:e=>e,network:e=>JSON.stringify(e),number:e=>e,image:()=>"",symbolImage:()=>"",symbol:e=>e,text:e=>e,time:e=>e,separator:e=>e,unknown:e=>e},$={html:e=>`<span style="color: blueviolet;">${JSON.stringify(R(I(e)))}</span>`,name:e=>`<span style="color: blue;">${e}</span>`,platform:e=>`<span style="color: red;">${e}</span>`,address:e=>`<img src="https://cdn.stamp.fyi/avatar/${e}?s=300" style="height: 32px;" /> <span style="color: green;">${k(e)}</span>`,network:e=>`<span style="color: red;">${e}</span>`,number:e=>e,image:e=>e?`<img src="${e}" style="height: 64px;" />`:"",symbolImage:e=>e?`<img src="${e}" style="height: 16px;" />`:"",symbol:e=>`<span style="color: green;">${e}</span>`,text:e=>e,time:e=>`<span style="color: gray;">${new Date(e).toLocaleString()}</span>`,separator:e=>e,unknown:e=>e};function R(e){let t=!1;return/\n/.test(e)&&(e=(e=e.replace(/\n[\s\S]+/g," ")).trim()),e.length>50&&(e=e.slice(0,50),t=!0),e+(t?"...":"")}function I(e){return e.replace(/<[^>]*>?/gm,"")}function U(e){const t=document.createElement("div");return t.innerHTML=e,R(t.innerText)}function q(e,t){let a,n="0.00";if(e){if(Number.isNaN(Number(e))||0===Number(e))return"0.00";Number(e)>0&&void 0!==t&&(o=t,e=(r=(r=e).length>o?r.slice(0,r.length-o)+"."+r.slice(-o):"0."+"0".repeat(o-r.length)+r).replace(/0+$/,""));const s=e.match(/^(0.0+)(.*)/);a=Number(e)>0&&Number(e)<1?s?s?.[1]+s?.[2].slice(0,3):"0."+e.split("0.")[1].slice(0,3):Number(Number(e).toFixed(3)).toString(),a.includes(".")||(a=Number(e).toFixed(2)),n=a.replace(/(\d)(?=(\d{3})+\.\d+)/g,"$1,")}var r,o;return n}function N(e,t=""){return{type:e,content:t}}const E=j(" "),T=N("separator","; ");function O(e,t=E){return e.reduce(((e,a)=>[...e,t,a]),[]).slice(1)}function j(e){return N("text",e)}function M(e){return N("name",e)}function z(e){return N("image",e||"")}function P(e){return N("network",e||"")}function L(e,t){return e?(e.handle||e.address||!e.name||M(e.name),e.handle?D(e.handle):e.address===u?D(t):D(e.address)):N("unknown","")}function D(e){return N("address",e||"")}function H(e){return e?e.value===c?[N("number","infinite"),N("symbol",e.symbol)]:[N("symbolImage",e.image),N("number",q(e.value,e.decimals)||"0"),N("symbol",e.symbol)]:[N("number","0")]}function J(e){let t="";return e.platform?(t=e.platform,[j("on"),N("platform",t)]):[]}function W(e){if("social"!==e.tag)return j("");let t="";return"title"in e.metadata&&e.metadata.title?t=e.metadata.title:"body"in e.metadata&&e.metadata.body?t=e.metadata.body:"target"in e.metadata&&e.metadata.target&&e.metadata.target.body&&(t=e.metadata.target.body),N("html",t)}function B(e){const t=Z(e,A).filter((e=>""!==e)),a=[];for(let e=0;e<t.length;e++)" "===t[e]&&" "===t[e+1]||a.push(t[e]);return a.join("")}function Z(e,t){return G(e).map((e=>t[e.type]?t[e.type](e.content):t.unknown(e.content)))}function G(e){const t=g(e).reduce(((t,a)=>0===t.length?K(e,a):[...t,T,...K(e,a)]),[]);var a;return t.push(E,(a=e.timestamp,N("time",new Date(1e3*a).toJSON()))),t}function V(e){const t=g(e),a=[];return t.map((t=>{a.push(K(e,t))})),a}function K(e,t){const a=e.owner,n=e.direction;let r=[j("Carried out an activity")];return w(t,{"transaction-transfer":e=>{r=a===t.from?O([D(t.from),j("sent"),...H(e),j("to"),D(t.to)]):O("in"===n?[D(t.to),j("received"),...H(e),j("from"),D(t.from)]:[D(t.to),j("claimed"),...H(e),j("from"),D(t.from)])},"transaction-approval":e=>{r="approve"===e.action?O([D(t.from),j("approved"),...H(e),j("to"),D(t.to)]):O([D(t.from),j("revoked the approval of"),...H(e),j("to"),D(t.to)])},"transaction-mint":e=>{r=O([D(t.from),j("minted"),...H(e)])},"transaction-burn":e=>{r=O([D(t.from),j("burned"),...H(e)])},"transaction-multisig":a=>{"create"===a.action?r=O([j("Created a multisig transaction"),j("to"),D(t.to),...J(e)]):"add_owner"===a.action?r=O([j("Added"),D(a.owner),j("to"),D(a.vault.address),...J(e)]):"remove_owner"===a.action?r=O([j("Removed"),D(a.owner),j("from"),D(a.vault.address),...J(e)]):"change_threshold"===a.action?r=O([j("Changed the threshold of"),D(a.vault.address),...J(e)]):"execution"===a.action&&(r=O([j("Executed a multisig transaction"),...J(e)]))},"transaction-bridge":t=>{let a=[];t.source_network&&t.source_network.name&&(a=[j("from"),P(t.source_network.name),j("to"),P(t.target_network.name)]),r="deposit"===t.action?O([j("Deposited"),...H(t.token),...a,...J(e)]):O([j("Withdrew"),...H(t.token),...a,...J(e)])},"transaction-deploy":e=>{r=O([j("Deployed a contract"),D(e.address)])},"collectible-transfer":e=>{r=O([D(t.from),j("transferred"),z(e.image_url),M(e.name||e.title||"an asset"),j("to"),D(t.to)])},"collectible-approval":e=>{r="approve"===e.action?O([j("Approved"),z(e.image_url),M(`${e.name} collection`),j("to"),D(t.to)]):O([j("Revoked the approval of"),z(e.image_url),M(`${e.name} collection`),j("to"),D(t.to)])},"collectible-mint":e=>{r=O("out"===n?[D(a),j("minted"),z(e.image_url),M(e.name||e.title||"an asset")]:[D(t.to),j("minted"),z(e.image_url),M(e.name||e.title||"an asset"),j("from"),D(t.from)])},"collectible-burn":e=>{r=O([j("Burned"),z(e.image_url),M(e.name||e.title||"an asset")])},"collectible-trade":e=>{r="buy"===e.action?O([j("Bought"),z(e.image_url),M(e.name||e.title||"an asset"),j("from"),D(t.from),...J(t)]):O([j("Sold"),z(e.image_url),M(e.name||e.title||"an asset"),j("to"),D(t.to),...J(t)])},"collectible-auction":e=>{r="create"===e.action?O([j("Created an auction for"),z(e.image_url),M(e.name||e.title||"an asset"),...J(t)]):"bid"===e.action?O([j("Made a bid for"),z(e.image_url),M(e.name||e.title||"an asset"),...J(t)]):"cancel"===e.action?O([j("Canceled an auction for"),z(e.image_url),M(e.name||e.title||"an asset"),...J(t)]):"update"===e.action?O([D(a),j("updated an auction for"),z(e.image_url),M(e.name||e.title||"an asset"),...J(t)]):"finalize"===e.action?O([D(a),j("won an auction for"),z(e.image_url),M(e.name||e.title||"an asset"),...J(t)]):O([D(a),j("invalidated an auction for"),z(e.image_url),M(e.name||e.title||"an asset"),...J(t)])},"exchange-swap":e=>{r=O([D(a),j("swapped"),...H(e.from),j("to"),...H(e.to),...J(t)])},"exchange-liquidity":e=>{const a=e.tokens.flatMap((e=>O([...H(e),j(",")]))).slice(0,-1);"add"===e.action?r=O([j("Added"),...a,j("to liquidity"),...J(t)]):"remove"===e.action?r=O([j("Removed"),...a,j("from liquidity"),...J(t)]):"collect"===e.action?r=O([j("Collected"),...a,j("from liquidity"),...J(t)]):"borrow"===e.action?r=O([j("Borrowed"),...a,j("from liquidity"),...J(t)]):"repay"===e.action?r=O([j("Repaid"),...a,j("to liquidity"),...J(t)]):"supply"===e.action?r=O([j("Supplied"),...a,j("to liquidity"),...J(t)]):"withdraw"===e.action&&(r=O([j("WithDrew"),...a,j("from liquidity"),...J(t)]))},"exchange-loan":e=>{"create"===e.action?r=O([j("Created loan"),...H(e.amount),...J(t)]):"liquidate"===e.action?r=O([j("liquidated loan"),...H(e.amount),...J(t)]):"refinance"===e.action?r=O([j("Refinanced loan"),...H(e.amount),...J(t)]):"repay"===e.action?r=O([j("Repaid loan"),...H(e.amount),...J(t)]):"seize"===e.action&&(r=O([j("Seized loan"),...H(e.amount),...J(t)]))},"donation-donate":e=>{r=O([D(a),j("donated"),z(e.logo),M(e.title||""),...J(t)])},"governance-propose":e=>{r=O([D(a),j("proposed for"),M(e.title||""),...J(t)])},"governance-vote":e=>{r=O([D(a),j("voted for"),M(e.proposal?.options?.join(",")||""),...J(t)])},"social-post":()=>{r=O([D(a),j("published a post"),W(t),...J(t)])},"social-comment":()=>{r=O([D(t.from),j("commented a post"),W(t),...J(t)])},"social-share":()=>{r=O([D(a),j("shared a post"),W(t),...J(t)])},"social-mint":()=>{r=O([D(a),j("minted a post"),W(t),...J(t)])},"social-revise":()=>{r=O([j("Revised a post"),W(t),...J(t)])},"social-follow":e=>{r=O([L(e.from,t.from),j("followed"),L(e.to,t.to),...J(t)])},"social-unfollow":e=>{r=O([L(e.from,t.from),j("unfollowed"),L(e.to,t.to),...J(t)])},"social-profile":e=>{"create"===e.action?r=O([j("Created a profile"),z(e.image_uri),M(e.name||e.handle||""),...J(t)]):"update"===e.action?r=O([j("Updated a profile"),z(e.image_uri),M(e.name||e.handle||""),...J(t)]):"renew"===e.action?r=O([j("Renewed a profile"),z(e.image_uri),M(e.name||e.handle||""),...J(t)]):"wrap"===e.action?r=O([j("Wrapped a profile"),z(e.image_uri),M(e.name||e.handle||""),...J(t)]):"unwrap"===e.action&&(r=O([j("Unwrapped a profile"),z(e.image_uri),M(e.name||e.handle||""),...J(t)]))},"social-proxy":e=>{r="appoint"===e.action?O([j("Approved a proxy"),...J(t)]):O([j("Removed a proxy"),...J(t)])},"social-delete":()=>{r=O([j("Deleted"),W(t),...J(t)])},"metaverse-transfer":e=>{r=O([D(a),j("transferred"),z(e.image_url),M(e.name||e.title||"an asset"),j("to"),D(t.to)])},"metaverse-mint":e=>{r=O([D(a),j("minted"),z(e.image_url),M(e.name||e.title||"an asset"),...J(t)])},"metaverse-burn":e=>{r=O([D(a),j("burned"),z(e.image_url),M(e.name||e.title||"an asset"),...J(t)])},"metaverse-trade":e=>{"buy"===e.action?r=O([D(a),j("bought"),z(e.image_url),M(e.name||e.title||"an asset"),j("from"),D(t.from),...J(t)]):"sell"===e.action?r=O([D(a),j("sold"),z(e.image_url),M(e.name||e.title||"an asset"),j("from"),D(t.from),...J(t)]):"list"===e.action&&(r=O([D(a),j("listed"),z(e.image_url),M(e.name||e.title||"an asset"),j("from"),D(t.from),...J(t)]))}}),r}function Q(e){const t=g(e);let a=0;return t.forEach((t=>{t.type===e.type&&t.tag===e.tag&&a++})),a>1}function X(e){if(Q(e)){const t=[];return g(e).forEach((a=>{t.push({...e,actions:[a]})})),t}return[e]}function Y(e){const t=g(e);if(t.length>0)return ee(t[0])}function ee(e){let t;return w(e,{"social-post":e=>{t=te(e)},"social-comment":e=>{t=te(e)},"social-mint":e=>{t=te(e)},"social-share":e=>{t=te(e)},"social-revise":e=>{t=te(e)},"social-delete":e=>{t=te(e)},"governance-propose":e=>{var a;t={title:(a=e).title,body:a.body}},"governance-vote":e=>{var a;a=e,t={title:a.proposal?.title,body:a.proposal?.body}}}),t}function te(e){const t=e.target,a=t?{author_url:t.author_url,handle:t.handle,profile_id:t.profile_id,title:t.title,body:t.body,media:t.media}:void 0;return{author_url:e.author_url,handle:e.handle,profile_id:e.profile_id,title:e.title,body:e.body,media:e.media,target:a}}function ae(e,t){if(!e)return e;let a=e||[],n=t;return n&&!v(n)&&(n=a.find((e=>!!e.address))?.address),n&&v(n)&&a.push({address:n,bio:"",handle:n,name:_(n),network:"Ethereum",platform:"Ethereum",profileURI:[S(n,30)],socialURI:[]}),a=a?.sort((e=>e?.handle===t?-1:1)),a=a?.sort((e=>"ENS Registrar"===e?.platform?-1:1)),a=a?.map((e=>{if("ENS Registrar"===e.platform&&e.profileURI&&e.profileURI.length>=1&&e.profileURI[0].startsWith("eip155:1")&&(e.profileURI=[`https://metadata.ens.domains/mainnet/avatar/${e.handle}`]),"Unstoppable"===e?.platform){const[t,a]=e?.profileURI||[];e.profileURI=[a,t]}return e})),a}function ne(e){return{name:e?.name||"",avatar:e?.profileURI?.[0]?e?.profileURI?.[0]:e?.handle&&S(e?.handle,30)||"",handle:e?.handle||"",banner:e?.bannerURI?.[0]||"",address:e?.address||"",url:e?.url||"",platform:e?.platform,expireAt:e?.expireAt,bio:e?.bio}}function re(e,t){return ne(t?e?.find((e=>e?.handle?.toLowerCase()===t.toLowerCase())):e?.[0])}function oe(e){let t;return w(e,{"collectible-transfer":e=>{t=se(e)},"collectible-approval":e=>{t=se(e)},"collectible-mint":e=>{t=se(e)},"collectible-burn":e=>{t=se(e)},"collectible-trade":e=>{t=se(e)},"collectible-auction":e=>{t=se(e)},"donation-donate":e=>{t=function(e){return{url:e.logo,title:e.title,description:e.description}}(e)}}),t}function se(e){return{url:e.image_url,title:e.name,description:e.description}}})(),rss3=n})();
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc