PageSourceSearch

https://www.tradeport.xyz/_next/static/chunks/pages/discord-bots/alerts/subscribe-dddbf59af9c9da4a.js

js tradeport.xyz collected 2026-10-03 22:57:27 UTC 13,994 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2725],{35945:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/discord-bots/alerts/subscribe",function(){return r(65845)}])},10030:function(e,t,r){"use strict";r.d(t,{B:function(){return o},W:function(){return a}});var i=r(7284);let s={sm:26,md:46,lg:66},n={58:{base:"pt-[58px]",sm:"pt-[calc(58px_+_26px)]",md:"pt-[calc(58px_+_46px)]",lg:"pt-[calc(58px_+_66px)]"},62:{base:"pt-[62px]",sm:"pt-[calc(62px_+_26px)]",md:"pt-[calc(62px_+_46px)]",lg:"pt-[calc(62px_+_66px)]"}},a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:58,{activeBannerSize:t}=(0,i.X)(),r=n[e];return t?r[t]:r.base},o=()=>{let{activeBannerSize:e}=(0,i.X)();return e?s[e]:0}},34437:function(e,t,r){"use strict";r.d(t,{f:function(){return o}});var i=r(52676),s=r(48705),n=r(90892),a=r(15233);let o=e=>{var t;let{className:r,chain:o,walletName:l,long:c,veryLong:d,iconSize:x=80}=e;return(0,i.jsxs)("div",{className:(0,a.cn)("flex flex-col items-center justify-center gap-3 border border-light-grey bg-black/40 rounded-lg w-[200px] h-[200px] p-4",r),children:[(0,i.jsx)("img",{src:(0,n.y)("/icons/logos/".concat(o,".svg")),alt:"".concat(o," Logo"),width:x,height:x}),(0,i.jsx)("span",{className:"mt-2 text-base font-medium text-center w-full truncate",title:l,children:"".concat(null!==(t=(0,s.P)({wallet:l,long:c,veryLong:d}))&&void 0!==t?t:"No wallet connected")})]})}},65845:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return P}});var i=r(52676),s=r(81596),n=r.n(s),a=r(20320),o=r(49995),l=r(37409),c=r(26097),d=r(78875),x=r(90892),u=r(67930),m=r(15233);let p="https://discord.gg/MwBz4nFWFK",h=e=>{let{className:t}=e;return(0,i.jsxs)("div",{className:(0,m.cn)("max-w-sm rounded-lg border border-primary-edge bg-primary-tint p-4",t),children:[(0,i.jsx)("h2",{className:"text-base font-semibold",children:"One more step: join the Tradeport Discord"}),(0,i.jsx)("p",{className:"mt-2 text-sm leading-relaxed",children:"Discord only lets the bot message people who share a server with it. If you are not in the Tradeport Discord, your alerts will not arrive. Join now, then continue."}),(0,i.jsx)(c.z,{asChild:!0,variant:"primaryFilled",className:"mt-3 h-auto min-h-9 w-full py-2 sm:w-auto",children:(0,i.jsx)("a",{href:p,target:"_blank",rel:"noreferrer",onClick:e=>{e.stopPropagation(),(0,u.nn)({text:"Join the Tradeport Discord",action:"Clicked on Join Discord server link",component:"DiscordNotificationsSubForm",target_url:p})},children:"Join the Tradeport Discord"})})]})};var g=r(83523),b=r(75271),v=r(36696),j=r(67842),f=r(70099),y=r(63545),N=r(10603);let w=()=>{var e;let t=(0,N.useRouter)(),[r,i]=(0,b.useState)(null),[s,n]=(0,b.useState)(null),[a,o]=(0,b.useState)(null),[l,c]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{(async()=>{var e,r,s,a,l,d,x;if(null==t?void 0:null===(e=t.query)||void 0===e?void 0:e.code){try{c(!0);let e=await (0,g.Z)("/api/discord/user/verify?code=".concat(null==t?void 0:null===(r=t.query)||void 0===r?void 0:r.code));(null==e?void 0:null===(s=e.data)||void 0===s?void 0:s.userName)&&(i(null==e?void 0:null===(a=e.data)||void 0===a?void 0:a.userName),n(null==e?void 0:null===(l=e.data)||void 0===l?void 0:l.avatarImage),(null==e?void 0:null===(d=e.data)||void 0===d?void 0:d.token)&&o(null==e?void 0:null===(x=e.data)||void 0===x?void 0:x.token))}catch(e){}c(!1),(0,y.I)({router:t,queryParams:{...t.query},queryParamKeysToDelete:["code"]})}})()},[null==t?void 0:null===(e=t.query)||void 0===e?void 0:e.code]),{discordUserName:r,discordUserAvatarUrl:s,discordUserOAuthToken:a,isDiscordUserLoading:l}};var k=r(34437),D=r(44220),C=r.n(D),_=r(73764);let F=e=>{let{className:t,discordUserAvatarUrl:r,discordUserName:s,isLoading:n}=e;return(0,i.jsx)("div",{className:(0,m.cn)("relative flex items-center justify-center gap-2 rounded-sm border border-light-grey p-2",t),children:n?(0,i.jsxs)(_.y,{baseColor:"#222223",highlightColor:"#2e2e2f",children:[(0,i.jsx)(_.Z,{width:21,height:21,style:{lineHeight:"1",borderRadius:"100%"}}),(0,i.jsx)(_.Z,{width:70,height:18,style:{lineHeight:"1"}})]}):(0,i.jsxs)(i.Fragment,{children:[r&&(0,i.jsx)(C(),{className:"rounded-full",src:r,alt:"Discord user avatar",width:23,height:23}),s&&(0,i.jsx)("span",{children:s})]})})},S="https://discord.com/api/oauth2/authorize?client_id=916846992053895249&redirect_uri=".concat(encodeURIComponent("https://www.tradeport.xyz/discord-bots/alerts/subscribe"),"&response_type=code&scope=identify"),z=()=>{var e,t;let{suiSignMessage:r,deSerializeMsg:s,deSerializeSig:n}=(0,a.EB)(),{openSecondModal:y,setSecondModalContent:N,setSecondModalHeader:D}=(0,d.WD)(),C=(0,j.MW)(),_=(0,j.It)(),z=(0,j.MT)(),[T,P]=(0,b.useState)(!1),[A,U]=(0,b.useState)(!1),[W,M]=(0,b.useState)(0),{discordUserName:E,discordUserAvatarUrl:I,discordUserOAuthToken:B,isDiscordUserLoading:q}=w(),L=()=>{D((0,i.jsx)(l.x,{title:"Connect Wallet"})),N((0,i.jsx)(f.R,{chains:["sui"]})),y()},O=async()=>{U(!0);try{if("sui"===_){let e=new TextEncoder().encode("Subscribe to Discord direct market notifications for this wallet");await r({message:e,onSuccess:async e=>{let t=(0,o.C)({signedMessage:e,deSerializeSig:n,deSerializeMsg:s});try{await g.Z.post("/api/discord/user/subscribe-to-notifications?token=".concat(B),{wallet:C,chain:_,subscriptions:["all"],...t}),P(!0),v.ZP.success("Subscribed to alerts!")}catch(e){}U(!1)}})}}catch(e){U(!1)}},G=e=>{let{direction:t,disabled:r}=e;return(0,i.jsx)("div",{className:"",children:(0,i.jsx)(c.z,{disabled:r,className:"h-8 border border-neutral-500 bg-dark-grey text-neutral-300 transition-all duration-300 hover:bg-light-grey",onClick:e=>{null==e||e.stopPropagation(),(0,u.AD)({text:"back"==t?"<- Back":"Next ->",action:"Clicked on Next button",component:"DiscordNotificationSubForm"}),"back"==t&&M(W-1),"next"==t&&M(W+1)},children:"back"==t?"<- Back":"Next ->"})})},R=[{idx:0,title:"Authorize Discord",content:(0,i.jsx)("div",{className:"mt-6",children:E||q?(0,i.jsxs)("div",{className:"m-1 flex flex-col",children:[(0,i.jsx)(F,{discordUserAvatarUrl:I,discordUserName:E,isLoading:q}),(0,i.jsx)("a",{className:"ml-1 mt-1 text-xs text-receding hover:cursor-pointer hover:text-primary",href:S,target:"_blank",rel:"noreferrer",onClick:e=>{e.stopPropagation(),(0,u.nn)({text:"Change Discord User",action:"Clicked on Change Discord User link",component:"DiscordNotificationsSubForm",target_url:S})},children:"Change Discord User"}),E&&!q&&(0,i.jsx)(h,{className:"mt-4"})]}):(0,i.jsx)(c.z,{asChild:!0,className:"h-8.5 w-full",onClick:e=>{null==e||e.stopPropagation(),(0,u.AD)({text:"Authorize Your Discord",action:"Clicked on Authorize Your Discord button",component:"DiscordNotificationSubForm"})},children:(0,i.jsx)("a",{href:S,target:"_blank",rel:"noreferrer",children:"Authorize Your Discord"})})}),isValid:E,buttons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{}),(0,i.jsx)(G,{direction:"next",disabled:!E})]})},{idx:1,title:"Connect Wallet",content:(0,i.jsx)("div",{className:"mt-7",children:C?(0,i.jsxs)("div",{className:"flex flex-col items-center",children:[(0,i.jsx)(k.f,{chain:_,walletName:z,veryLong:!0}),(0,i.jsx)("span",{className:"ml-1 mt-1 text-xs text-receding hover:cursor-pointer hover:text-primary",onClick:()=>{(0,u.AD)({text:"Change Wallet",action:"Clicked on Change Wallet link",component:"DiscordNotificationsSubForm"}),L()},children:"Change Wallet"})]}):(0,i.jsx)(c.z,{className:"m-auto h-8.5",onClick:e=>{null==e||e.stopPropagation(),(0,u.AD)({text:"Connect Wallet",action:"Clicked on Connect Wallet button",component:"DiscordNotificationsSubForm"}),L()},children:"Connect Wallet"})}),isValid:C&&W>0,buttons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(G,{direction:"back"}),(0,i.jsx)(G,{direction:"next",disabled:!C})]})},{idx:2,title:"Get Alerts!",content:(0,i.jsx)("div",{className:"mt-3",children:(0,i.jsx)("div",{className:"flex items-center",children:T?(0,i.jsxs)("div",{className:"mt-4 flex flex-col items-center",children:[(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)(k.f,{className:(0,m.cn)({"border-primary":T}),chain:_,walletName:z,long:!0}),(0,i.jsx)("div",{className:(0,m.cn)("h-[1px] w-12 border border-light-grey",{"border-primary":T})}),(0,i.jsx)(F,{className:(0,m.cn)({"border-primary":T}),discordUserAvatarUrl:I,discordUserName:E,isLoading:q})]}),(0,i.jsx)("div",{className:"mt-5 max-w-[360px] text-center",children:"Successfully subscribed to alerts! Check Discord DMs to confirm subscription."}),(0,i.jsxs)("div",{className:"mt-2.5",children:[(0,i.jsx)("span",{className:"text-[13px] text-neutral-500",children:"Didn't receive a confirmation? Reach out to us"}),(0,i.jsx)("span",{className:"ml-1 inline",children:(0,i.jsx)("a",{href:p,target:"_blank",rel:"noreferrer",className:"mt-2 inline text-[13px] text-neutral-500 underline",onClick:e=>{e.stopPropagation(),(0,u.nn)({text:"here",action:"Clicked on Discord invite link",component:"DiscordNotificationsSubForm",target_url:p})},children:"here"})})]})]}):(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)(k.f,{chain:_,walletName:z,long:!0}),(0,i.jsx)("div",{className:"h-[1px] w-12 border border-light-grey"}),(0,i.jsx)(F,{discordUserAvatarUrl:I,discordUserName:E,isLoading:q})]})})}),isValid:T,buttons:(0,i.jsx)(i.Fragment,{children:T?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(G,{direction:"back"}),A?(0,i.jsx)(c.z,{className:"h-8.5 w-[93px]",children:(0,i.jsx)("div",{className:"relative h-[22px] w-[93px]",children:(0,i.jsx)("div",{className:"loading-icon left-[27.5px] top-[1px] h-5 w-5"})})}):(0,i.jsx)(c.z,{className:"h-8.5",onClick:e=>{null==e||e.stopPropagation(),(0,u.AD)({text:"Subscribe",action:"Clicked on Subscribe button",component:"DiscordNotificationsSubForm"}),O()},children:"Subscribe"})]})})}];return(0,i.jsxs)("div",{className:"flex flex-col items-center px-1 py-3 pt-1 sm:px-3",children:[(0,i.jsx)("img",{src:(0,x.y)("/icons/social/icons-discord-no-padding.svg"),alt:"Discord Logo",width:50,height:50}),(0,i.jsx)("h1",{className:"mt-1 text-center text-3xl font-medium leading-none",children:"Discord Alerts"}),(0,i.jsx)("p",{className:"mt-3 text-center text-sm font-light leading-tight text-receding",children:"Get real-time updates on your NFT activity—sales, offers, and more!"}),(0,i.jsxs)("div",{className:(0,m.cn)("container mt-5 flex h-[250px] flex-col justify-between rounded-lg border border-border p-3",{"h-auto min-h-[250px] gap-4":0===W&&E&&!q}),children:[(0,i.jsx)("div",{className:"justify-space-around mx-9 flex items-center max-[450px]:mx-6",children:null==R?void 0:R.map(e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)("div",{className:(0,m.cn)("flex h-8 w-8 items-center justify-center rounded-md border border-light-grey text-receding transition-all duration-300",{"border-primary":W==(null==e?void 0:e.idx),"text-primary":W==(null==e?void 0:e.idx)}),children:(null==e?void 0:e.isValid)?(0,i.jsx)("img",{src:(0,x.y)("/icons/green/icons-checkmark.svg"),alt:"checkmark",width:12,height:12}):(0,i.jsx)(i.Fragment,{children:(null==e?void 0:e.idx)+1})}),(0,i.jsx)("span",{className:(0,m.cn)("-bottom-[20[x]] absolute left-1/2 mt-1 w-[120px] flex-1 -translate-x-1/2 text-center text-xs text-receding max-[360px]:text-[11px]",{"text-white":W==(null==e?void 0:e.idx)}),children:null==e?void 0:e.title})]}),(null==e?void 0:e.idx)!==2&&(0,i.jsx)("div",{className:"mx-3 h-[1px] flex-1 border border-light-grey"})]}))}),(0,i.jsx)("div",{className:"flex justify-center",children:null==R?void 0:null===(e=R[W])||void 0===e?void 0:e.content}),(0,i.jsx)("div",{className:"flex w-full justify-between px-3",children:null==R?void 0:null===(t=R[W])||void 0===t?void 0:t.buttons})]}),(0,i.jsxs)("div",{className:"mt-1 flex items-baseline gap-2",children:[(0,i.jsx)("span",{className:"text-xs text-neutral-500",children:"Powered By"}),(0,i.jsx)("a",{href:"https://indexer.xyz",target:"_blank",rel:"noreferrer",className:"icon",onClick:e=>{e.stopPropagation(),(0,u.nn)({text:null,action:"Clicked on Indexer link",component:"DiscordNotificationSubForm",target_url:"https://indexer.xyz"})},children:(0,i.jsx)("img",{src:(0,x.y)("/indexer-logo.svg"),alt:"Indexer - Multichain NFT API",width:59.5,height:10.5,loading:"lazy"})})]})]})};var T=r(10030);function P(){let e=(0,T.B)();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n(),{children:[(0,i.jsx)("title",{children:"TradePort | NFT Marketplace Discord Notifications"}),(0,i.jsx)("meta",{name:"description",content:"Get instant Discord DM alerts whenever your NFT sells, gets a bid, or a bid was accepted! Only takes 1 minute to set up."}),(0,i.jsx)("meta",{name:"robots",content:"index,follow"}),(0,i.jsx)("meta",{property:"og:type",content:"website"}),(0,i.jsx)("meta",{property:"og:url",content:"https://tradeport.xyz.xyz/discord-bots/alerts/subscribe"}),(0,i.jsx)("meta",{property:"og:title",content:"TradePort | NFT Marketplace Discord Notifications"}),(0,i.jsx)("meta",{property:"og:description",content:"Get instant Discord DM alerts whenever your NFT sells, gets a bid, or a bid was accepted! Only takes 1 minute to set up."}),(0,i.jsx)("meta",{property:"og:image",content:"https://www.tradeport.xyz/assets/tradeport-banner.png"}),(0,i.jsx)("meta",{property:"twitter:card",content:"summary_large_image"}),(0,i.jsx)("meta",{property:"twitter:url",content:"https://tradeport.xyz.xyz/discord-bots/alerts/subscribe"}),(0,i.jsx)("meta",{property:"twitter:title",content:"TradePort | NFT Marketplace Discord Notifications"}),(0,i.jsx)("meta",{property:"twitter:description",content:"Get instant Discord DM alerts whenever your NFT sells, gets a bid, or a bid was accepted! Only takes 1 minute to set up."}),(0,i.jsx)("meta",{property:"twitter:image",content:"https://www.tradeport.xyz/assets/tradeport-banner.png"})]}),(0,i.jsx)("div",{className:"page-container flex items-center justify-center py-[80px]",style:{paddingTop:80+e},children:(0,i.jsx)(z,{})})]})}}},function(e){e.O(0,[2888,9774,179],function(){return e(e.s=35945)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.