Search
Search

Transaction: CAiWLvM...Enxv

Receiver
Status
Succeeded
Transaction Fee
0.00085 
Deposit Value
<0.00001 
Gas Used
8 Tgas
Attached Gas
300 Tgas
Created
March 20, 2024 at 2:36:22pm
Hash
CAiWLvM5cwTkBbQEtM9qR1mWW4hbitXSD6uUJea9Enxv

Actions

Called method: 'set' in contract: social.near
Arguments:
{ "data": { "bos.dapplets.near": { "widget": { "OnboardingTest.Main": { "": "const TIME_UNTIL_RESHOW = 1000 * 60 // TESTING\n// const TIME_UNTIL_RESHOW = 1000 * 60 * 60 * 3 // PROD\n\nconst [show, setShow] = useState(false)\nconst [start, setStart] = useState(false)\nconst [showFrom, setShowFrom] = useState(0)\n\nconst response = Near.view('app.webguide.near', 'get_guide', { guide_id: props?.link?.id })\nconst data = response && JSON.parse(response)\nconst lastShow = data && data?.reduce((acc, chapter) => {\n acc[chapter.id] = Storage.privateGet(chapter.id + '/lastShow')\n return acc\n}, {})\n\nconsole.log('data', data)\nconsole.log('props?.link?.id', props?.link?.id)\nconsole.log('props', props)\nconsole.log('lastShow',lastShow)\n\nuseEffect(() => {\n if (\n !start && (\n lastShow === null || (\n lastShow && Object.values(lastShow).every(a => a === null)\n )\n )\n ) return;\n // here if (start || (lastShow && Object.values(lastShow).some(a => a !== null))) -- ToDo: replace?\n\n if (!start) {\n setStart(true)\n return\n }\n \n // *** DISPLAY LOGIC ***\n\n if (lastShow) {\n const currentMutation = data.find((ch) => ch?.id.includes('mutation'))?.id\n const currentTime = Date.now()\n\n for (const key of Object.keys(lastShow)) {\n if (!lastShow[key]) continue\n\n // TESTING\n if (lastShow[key].doNotShowAgain && currentTime - lastShow[key].time > TIME_UNTIL_RESHOW * 3)\n lastShow[key].doNotShowAgain = false\n //\n\n // DO NOT refactor the following code block to stay the logic clear!!!\n if (currentMutation === lastShow[key].mutation) {\n if (!lastShow[key].doNotShowAgain) {\n lastShow[key].show = currentTime - lastShow[key].time > TIME_UNTIL_RESHOW\n } else {\n if (lastShow[key].isViewed) {\n lastShow[key].show = false\n } else {\n lastShow[key].show = currentTime - lastShow[key].time > TIME_UNTIL_RESHOW\n }\n }\n } else {\n if (!lastShow[key].doNotShowAgain) {\n if (lastShow[key].isViewed) {\n lastShow[key].show = currentTime - lastShow[key].time > TIME_UNTIL_RESHOW\n } else {\n lastShow[key].show = true\n }\n } else {\n if (lastShow[key].isViewed) {\n lastShow[key].show = false\n } else {\n lastShow[key].show = true\n }\n }\n }\n }\n }\n console.log('lastShow with .show', lastShow)\n\n // *** SORT LOGIC ***\n\n if (!lastShow && context.accountId === props?.link?.authorId) {\n // show form to the author\n setShow(true)\n } else if (lastShow && Object.values(lastShow).some(a => a?.show)) {\n // with sort - some chapters have been displayed\n data.sort(\n (a, b) =>\n !lastShow[a.id] && !lastShow[b.id]\n ? 0\n : !lastShow[a.id]\n ? 1\n : !lastShow[b.id]\n ? -1\n : lastShow[a.id].show - lastShow[b.id].show\n )\n console.log('data after sort', data)\n setShowFrom(Object.values(lastShow).filter(a => !a).length)\n setShow(true)\n } else if (lastShow && Object.values(lastShow).every(a => !a)) {\n // without sort - for the first time\n setShow(true)\n }\n}, [start, lastShow])\n\nsetTimeout(() => setStart(true), 10000)\n\nconst OverlayTriggerWrapper = styled.div`\n display: flex;\n z-index: 500;\n\n .OverlayTrigger {\n position: absolute;\n background: #db504a;\n border: 1px solid #db504a;\n width: 6px;\n height: 49px;\n right: -6px;\n top: 10px;\n border-radius: 0px 4px 4px 0px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n z-index: 79;\n }\n`\n\nconst Onboarding = styled.div`\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n\n animation: falling-animation 0.3s linear forwards;\n\n @keyframes falling-animation {\n from {\n transform: translate(-50%, -200%);\n }\n\n to {\n transform: translate(-50%, -50%);\n }\n }\n`;\n\nconst handleClose = (doNotShowAgain, viewedPages) => {\n if (data) {\n const time = Date.now()\n const mutation = data.find((ch) => ch?.id.includes('mutation'))?.id\n data.forEach((chapter) =>\n Storage.privateSet(\n chapter.id + '/lastShow',\n {\n time,\n doNotShowAgain: doNotShowAgain || lastShow[chapter.id].doNotShowAgain,\n mutation,\n // ToDo: gateway, ???\n // ToDo: source, ???\n isViewed: viewedPages.includes(chapter.id),\n }\n )\n )\n }\n setShow(false)\n}\n\nconst saveData = (inputData) => {\n if (context?.accountId) {\n Near.call(\n 'app.webguide.near',\n 'set_guide',\n {\n guide_id: props.link.id,\n data: inputData,\n }\n )\n }\n}\n\nreturn (\n <OverlayTriggerWrapper>\n {show ? (\n <DappletOverlay>\n <Onboarding>\n <Widget\n props={{ handleClose, data, saveData, setShow, link: props.link, showFrom }}\n src=\"bos.dapplets.near/widget/OnboardingTest.SandboxOnboarding\"\n />\n </Onboarding>\n </DappletOverlay>\n ) : null}\n </OverlayTriggerWrapper>\n)\n" } } } } }

Transaction Execution Plan

Convert Transaction To Receipt
Gas Burned:
2 Tgas
Tokens Burned:
0.00024 
Receipt:
Predecessor ID:
Receiver ID:
Gas Burned:
6 Tgas
Tokens Burned:
0.0006 
Called method: 'set' in contract: social.near
Arguments:
{ "data": { "bos.dapplets.near": { "widget": { "OnboardingTest.Main": { "": "const TIME_UNTIL_RESHOW = 1000 * 60 // TESTING\n// const TIME_UNTIL_RESHOW = 1000 * 60 * 60 * 3 // PROD\n\nconst [show, setShow] = useState(false)\nconst [start, setStart] = useState(false)\nconst [showFrom, setShowFrom] = useState(0)\n\nconst response = Near.view('app.webguide.near', 'get_guide', { guide_id: props?.link?.id })\nconst data = response && JSON.parse(response)\nconst lastShow = data && data?.reduce((acc, chapter) => {\n acc[chapter.id] = Storage.privateGet(chapter.id + '/lastShow')\n return acc\n}, {})\n\nconsole.log('data', data)\nconsole.log('props?.link?.id', props?.link?.id)\nconsole.log('props', props)\nconsole.log('lastShow',lastShow)\n\nuseEffect(() => {\n if (\n !start && (\n lastShow === null || (\n lastShow && Object.values(lastShow).every(a => a === null)\n )\n )\n ) return;\n // here if (start || (lastShow && Object.values(lastShow).some(a => a !== null))) -- ToDo: replace?\n\n if (!start) {\n setStart(true)\n return\n }\n \n // *** DISPLAY LOGIC ***\n\n if (lastShow) {\n const currentMutation = data.find((ch) => ch?.id.includes('mutation'))?.id\n const currentTime = Date.now()\n\n for (const key of Object.keys(lastShow)) {\n if (!lastShow[key]) continue\n\n // TESTING\n if (lastShow[key].doNotShowAgain && currentTime - lastShow[key].time > TIME_UNTIL_RESHOW * 3)\n lastShow[key].doNotShowAgain = false\n //\n\n // DO NOT refactor the following code block to stay the logic clear!!!\n if (currentMutation === lastShow[key].mutation) {\n if (!lastShow[key].doNotShowAgain) {\n lastShow[key].show = currentTime - lastShow[key].time > TIME_UNTIL_RESHOW\n } else {\n if (lastShow[key].isViewed) {\n lastShow[key].show = false\n } else {\n lastShow[key].show = currentTime - lastShow[key].time > TIME_UNTIL_RESHOW\n }\n }\n } else {\n if (!lastShow[key].doNotShowAgain) {\n if (lastShow[key].isViewed) {\n lastShow[key].show = currentTime - lastShow[key].time > TIME_UNTIL_RESHOW\n } else {\n lastShow[key].show = true\n }\n } else {\n if (lastShow[key].isViewed) {\n lastShow[key].show = false\n } else {\n lastShow[key].show = true\n }\n }\n }\n }\n }\n console.log('lastShow with .show', lastShow)\n\n // *** SORT LOGIC ***\n\n if (!lastShow && context.accountId === props?.link?.authorId) {\n // show form to the author\n setShow(true)\n } else if (lastShow && Object.values(lastShow).some(a => a?.show)) {\n // with sort - some chapters have been displayed\n data.sort(\n (a, b) =>\n !lastShow[a.id] && !lastShow[b.id]\n ? 0\n : !lastShow[a.id]\n ? 1\n : !lastShow[b.id]\n ? -1\n : lastShow[a.id].show - lastShow[b.id].show\n )\n console.log('data after sort', data)\n setShowFrom(Object.values(lastShow).filter(a => !a).length)\n setShow(true)\n } else if (lastShow && Object.values(lastShow).every(a => !a)) {\n // without sort - for the first time\n setShow(true)\n }\n}, [start, lastShow])\n\nsetTimeout(() => setStart(true), 10000)\n\nconst OverlayTriggerWrapper = styled.div`\n display: flex;\n z-index: 500;\n\n .OverlayTrigger {\n position: absolute;\n background: #db504a;\n border: 1px solid #db504a;\n width: 6px;\n height: 49px;\n right: -6px;\n top: 10px;\n border-radius: 0px 4px 4px 0px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n z-index: 79;\n }\n`\n\nconst Onboarding = styled.div`\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n\n animation: falling-animation 0.3s linear forwards;\n\n @keyframes falling-animation {\n from {\n transform: translate(-50%, -200%);\n }\n\n to {\n transform: translate(-50%, -50%);\n }\n }\n`;\n\nconst handleClose = (doNotShowAgain, viewedPages) => {\n if (data) {\n const time = Date.now()\n const mutation = data.find((ch) => ch?.id.includes('mutation'))?.id\n data.forEach((chapter) =>\n Storage.privateSet(\n chapter.id + '/lastShow',\n {\n time,\n doNotShowAgain: doNotShowAgain || lastShow[chapter.id].doNotShowAgain,\n mutation,\n // ToDo: gateway, ???\n // ToDo: source, ???\n isViewed: viewedPages.includes(chapter.id),\n }\n )\n )\n }\n setShow(false)\n}\n\nconst saveData = (inputData) => {\n if (context?.accountId) {\n Near.call(\n 'app.webguide.near',\n 'set_guide',\n {\n guide_id: props.link.id,\n data: inputData,\n }\n )\n }\n}\n\nreturn (\n <OverlayTriggerWrapper>\n {show ? (\n <DappletOverlay>\n <Onboarding>\n <Widget\n props={{ handleClose, data, saveData, setShow, link: props.link, showFrom }}\n src=\"bos.dapplets.near/widget/OnboardingTest.SandboxOnboarding\"\n />\n </Onboarding>\n </DappletOverlay>\n ) : null}\n </OverlayTriggerWrapper>\n)\n" } } } } }
Result:
{ "block_height": "115101854" }
No logs
Receipt:
Predecessor ID:
Receiver ID:
Gas Burned:
223 Ggas
Tokens Burned:
0 
Transferred 0.18843  to bos.dapplets.near
Empty result
No logs