Skip to content

Commit

Permalink
implements onboarding routes, updates content
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandrosGounis committed May 6, 2024
1 parent 7e7f987 commit 2cd3aed
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 32 deletions.
73 changes: 42 additions & 31 deletions src/discover/storage/v4.mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,28 @@
"description": "McLaren Racing's officially licensed Digital Collectibles"
},
{
"title": "Gap Threads",
"title": "objkt",
"categories": [
"sports",
"collectibles"
"marketplace"
],
"squareLogoUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/4c006ab4-a7f2-4de1-a8de-359257a69e00/raw",
"squareLogoUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/0d36c6e9-d85d-4c23-5252-0f3d7c037400/raw",
"wideLogoUri": "",
"webBannerUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/4c006ab4-a7f2-4de1-a8de-359257a69e00/webBannerUri",
"mobileBannerUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/4c006ab4-a7f2-4de1-a8de-359257a69e00/mobileBannerUri",
"projectUrl": "https://objkt.com/collections/gapthreads",
"description": "A fun and interactive digital collectible experience"
"webBannerUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/d5d319d6-05b9-415d-5f6a-5575d7874000/webBannerUri",
"mobileBannerUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/d5d319d6-05b9-415d-5f6a-5575d7874000/mobileBannerUri",
"projectUrl": "https://objkt.com/",
"description": "The best Tezos NFTs all in one place"
},
{
"title": "Test Feature",
"title": "fxhash",
"categories": [
"category"
"marketplace"
],
"squareLogoUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/8c96da2b-6a5a-4b84-86aa-cd2149b64400/raw",
"squareLogoUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/assets/img/alias/fxhash/raw",
"wideLogoUri": "",
"webBannerUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/8c96da2b-6a5a-4b84-86aa-cd2149b64400/webBannerUri",
"mobileBannerUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/8c96da2b-6a5a-4b84-86aa-cd2149b64400/mobileBannerUri",
"projectUrl": "https://tezos.com/",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Viv"
"webBannerUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/56d593e4-b7b2-4914-9424-54a20d5a4a00/webBannerUri",
"mobileBannerUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/56d593e4-b7b2-4914-9424-54a20d5a4a00/mobileBannerUri",
"projectUrl": "https://www.fxhash.xyz",
"description": "Open generative art NFT platform on Tezos"
}
],
"title": "Featured"
Expand All @@ -64,8 +63,8 @@
],
"squareLogoUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/0d36c6e9-d85d-4c23-5252-0f3d7c037400/raw",
"wideLogoUri": "",
"webBannerUri": "",
"mobileBannerUri": "",
"webBannerUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/d5d319d6-05b9-415d-5f6a-5575d7874000/webBannerUri",
"mobileBannerUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/d5d319d6-05b9-415d-5f6a-5575d7874000/mobileBannerUri",
"projectUrl": "https://objkt.com/",
"description": "The best Tezos NFTs all in one place"
},
Expand All @@ -76,8 +75,8 @@
],
"squareLogoUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/assets/img/alias/fxhash/raw",
"wideLogoUri": "",
"webBannerUri": "",
"mobileBannerUri": "",
"webBannerUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/56d593e4-b7b2-4914-9424-54a20d5a4a00/webBannerUri",
"mobileBannerUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/56d593e4-b7b2-4914-9424-54a20d5a4a00/mobileBannerUri",
"projectUrl": "https://www.fxhash.xyz",
"description": "Open generative art NFT platform on Tezos"
},
Expand Down Expand Up @@ -116,18 +115,6 @@
"mobileBannerUri": "",
"projectUrl": "https://www.8bidou.com/",
"description": "The on-chain bitmap minter & marketplace"
},
{
"title": "Rarible",
"categories": [
"marketplace"
],
"squareLogoUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/assets/img/alias/rarible/raw",
"wideLogoUri": "",
"webBannerUri": "",
"mobileBannerUri": "",
"projectUrl": "https://rarible.com/",
"description": "Aggregated NFT marketplace with rewards"
}
],
"title": "Marketplaces"
Expand Down Expand Up @@ -193,6 +180,30 @@
"mobileBannerUri": "",
"projectUrl": "https://youves.com/",
"description": "Your tool on Tezos for asset creation and management"
},
{
"title": "tezfin",
"categories": [
"exchange"
],
"squareLogoUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/51ba068e-7114-402b-fcd5-9b7420872d00/raw",
"wideLogoUri": "",
"webBannerUri": "",
"mobileBannerUri": "",
"projectUrl": "https://tezos.finance/",
"description": "On-chain Savings & Loan on Tezos Blockchain"
},
{
"title": "Yupana",
"categories": [
"exchange"
],
"squareLogoUri": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/2ff29e44-b5c1-4564-edea-cff666648d00/raw",
"wideLogoUri": "",
"webBannerUri": "",
"mobileBannerUri": "",
"projectUrl": "https://yupana.finance/",
"description": "The first open-source and non-custodial lending protocol on Tezos"
}
],
"title": "DeFi"
Expand Down
2 changes: 1 addition & 1 deletion src/explore/storage/contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
"KT1CzVSa18hndYupV9NcXy3Qj7p8YFDZKVQv"
],
"description": "Have fun exploring a galaxy of NFTs",
"thumbnailImageUrl": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/assets/img/alias/mooncakes/raw",
"thumbnailImageUrl": "https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/76180f46-12c0-4d04-ca11-f4f014b87700/raw",
"discover": {
"dappUrl": "https://mooncakes.fun",
"category": [
Expand Down
35 changes: 35 additions & 0 deletions src/onboarding/discover/handle-assets.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { ROUTES } from "../../router"

const BASE_PATH = ROUTES.ONBOARDING_DISCOVER_ASSETS

export const REMAP: Record<string, string> = {
contract: 'contractAddresses',
contractAddress: 'contractAddresses',
}

const ASSETS = [
"https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/assets/img/alias/dogami-thumbnail/raw",
"https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/9dc016fe-e253-4018-f993-b64c04652200/raw",
"https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/assets/img/alias/mclaren-thumbnail2/raw",
"https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/assets/img/alias/mufc/raw",
"https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/assets/img/alias/ziggurats/raw",
"https://imagedelivery.net/X6w5bi3ztwg4T4f6LG8s0Q/d59ccc19-894a-4f11-4119-94161e1ed200/raw"
]

export async function handleAssets(request: Request): Promise<Response> {
const { pathname } = new URL(request.url)
const assetIndex = pathname.substring(BASE_PATH.length - 1)

const index = Number(assetIndex)

if (!Number.isFinite(index)) {
return new Response('Malformed URL', { status: 500 })
}

if (index < 0 || index > 5) {
return new Response('Index out of bounds', { status: 500 })
}

return Response.redirect(ASSETS[index], 301)
}

9 changes: 9 additions & 0 deletions src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { RouteHandler, Router } from 'itty-router';
import { handleDiscover } from './discover/handle-discover';
import { handleExpore } from './explore/handle-explore';
import { handleMetadata } from './metadata/handle-metadata';
import { handleAssets } from './onboarding/discover/handle-assets';
import { handleProxy } from './proxy/handle-proxy';
import { handleVersion } from './version/handle-version';

Expand All @@ -10,8 +11,12 @@ export enum ROUTES {
DISCOVER_V2 = '/v2/discover',
DISCOVER_V3 = '/v3/discover',
DISCOVER_V4 = '/v4/discover',

EXPLORE = '/v1/explore',
EXPLORE_V2 = '/v2/explore',

ONBOARDING_DISCOVER_ASSETS = '/v4/onboarding/discover/assets/*',

METADATA = '/v1/metadata/*',
PROXY = '/v1/proxy',
VERSION = '/v1/version',
Expand All @@ -23,8 +28,12 @@ router.get(ROUTES.DISCOVER, handleDiscover as unknown as RouteHandler)
router.get(ROUTES.DISCOVER_V2, handleDiscover as unknown as RouteHandler)
router.get(ROUTES.DISCOVER_V3, handleDiscover as unknown as RouteHandler)
router.get(ROUTES.DISCOVER_V4, handleDiscover as unknown as RouteHandler)

router.get(ROUTES.EXPLORE, handleExpore as unknown as RouteHandler)
router.get(ROUTES.EXPLORE_V2, handleExpore as unknown as RouteHandler)

router.get(ROUTES.ONBOARDING_DISCOVER_ASSETS, handleAssets as unknown as RouteHandler)

router.get(ROUTES.METADATA, handleMetadata as unknown as RouteHandler)
router.get(ROUTES.PROXY, handleProxy as unknown as RouteHandler)
router.get(ROUTES.VERSION, handleVersion as unknown as RouteHandler)
Expand Down

0 comments on commit 2cd3aed

Please sign in to comment.