---
title: "Leather Collectibles and Token Details: Shared Across Extension and Mobile"
description: "Built the shared token details and NFT gallery features that the Leather extension and mobile app both use, on top of a features package in the monorepo."
tags: ["TypeScript", "React", "React Native", "Node.js", "Stacks", "Bitcoin Ordinals", "Panda CSS", "Mono-repo architecture"]
canonical: https://petewatters.ie/work/leather-nfts/
source: https://petewatters.ie/work/leather-nfts.md
---

# Leather Collectibles and Token Details: Shared Across Extension and Mobile

## Overview

Leather's browser extension and mobile app each had their own code for activity, collectibles and token details. I built the shared token details and NFT gallery features that both apps now use. That included TypeScript and Node.js backend-for-frontend (BFF) services that combine blockchain data with third-party API data.

This case study covers how the shared code was introduced and how the collectibles and token details work was built on top of it.

For the monorepo and the mobile app, see [the Leather Mobile case study](/work/leather-mobile/).

## The problem

The extension and the mobile app duplicated the same logic. A fix to collectibles in one app did not reach the other. The two apps drifted.

The collectibles themselves come from different places. Stacks NFTs, Bitcoin Ordinals inscriptions and Stamps each have their own data source and shape. Without a shared model, every screen would need a branch per source.

## What I built

### Chapter 1: Shared features behind a flag

I moved shared behaviour into a `features` package in the monorepo, using branch by abstraction: the new code sat behind a flag next to the old code until it was ready. Activity moved first, with shared queries. I later split one flag into four, so the team could see what had merged and work on the rest in parallel.

### Chapter 2: Collectibles and token details

On mobile I built token details and the collectibles home widget. On the extension I moved collectibles to the shared service, removed the legacy code, and added token details, collectible details screens and empty states. I also extended the shared collectibles service with Stamps, and added an E2E test for sending an inscription.

A shared `CollectibleView` type and type guards are the contract. Both apps render the same data shape.

<figure>
  <video src="/videos/work/leather-nfts/cross-platform-activity.mp4" aria-label="Demo: shared feature packages running on Leather mobile and the browser extension" autoplay loop muted playsinline preload="metadata"></video>
  <figcaption>Shared feature packages: the same logic driving the UI on both mobile and the extension.</figcaption>
</figure>

<figure>
  <video src="/videos/work/leather-nfts/collectibles-mobile.mp4" aria-label="Demo: the collectibles gallery on Leather mobile" autoplay loop muted playsinline preload="metadata"></video>
  <figcaption>The collectibles gallery on mobile.</figcaption>
</figure>

<figure>
  <video src="/videos/work/leather-nfts/collectibles-extension.mp4" aria-label="Demo: the collectibles gallery on the Leather browser extension" autoplay loop muted playsinline preload="metadata"></video>
  <figcaption>The same gallery on the browser extension: one shared service, two apps.</figcaption>
</figure>

## Outcome

The extension and mobile app now share one collectibles service and one data model. Stacks NFTs, Ordinals inscriptions and Stamps go through the same code path. A fix to collectibles now reaches both apps at once.
