diff --git a/.dockerignore b/.dockerignore
index 853f13566..e6204d335 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -18,6 +18,7 @@ packages/cra-template
packages/docs
packages/explorer
packages/nft
+packages/ft
packages/nodejs-template
packages/secp256k1
packages/swap/
diff --git a/README.md b/README.md
index 0e8160027..0f54bb435 100644
--- a/README.md
+++ b/README.md
@@ -18,8 +18,8 @@ This monorepo contains everything you need to build smart contract based applica
* [Wallet](https://github.com/bitcoin-computer/monorepo/tree/main/packages/wallet#readme) - A non-custodial wallet
* [Blockchain Explorer](https://github.com/bitcoin-computer/monorepo/tree/main/packages/explorer#readme) - A block explorer with smart contract support
* [Chat](https://github.com/bitcoin-computer/monorepo/tree/main/packages/chat#readme) - A p2p chat via Bitcoin and Litecoin
-* [TBC20 App](https://github.com/bitcoin-computer/monorepo/tree/main/packages/TBC20-app#readme) - An app for minting, sending, and storing fungible tokens
-* [TBC721 App](https://github.com/bitcoin-computer/monorepo/tree/main/packages/TBC721-app#readme) - An app for minting, sending, and storing non-fungible tokens
+* [Fungible Token App](https://github.com/bitcoin-computer/monorepo/tree/main/packages/ft#readme) - An app for minting, sending, and storing fungible tokens
+* [Non Fungible Token App](https://github.com/bitcoin-computer/monorepo/tree/main/packages/nft#readme) - An app for minting, sending, and storing non-fungible tokens
## Standard Contracts
* [TBC20](https://github.com/bitcoin-computer/monorepo/tree/main/packages/TBC20#readme) - An implementation of the ERC20 Fungible Token Standard
diff --git a/packages/README.md b/packages/README.md
index e98bae310..196b780a7 100644
--- a/packages/README.md
+++ b/packages/README.md
@@ -11,8 +11,8 @@ This monorepo contains the following packages.
* [Wallet](https://github.com/bitcoin-computer/monorepo/tree/main/packages/wallet#readme) - A non-custodial wallet
* [Blockchain Explorer](https://github.com/bitcoin-computer/monorepo/tree/main/packages/explorer#readme) - A block explorer with smart contract support
* [Chat](https://github.com/bitcoin-computer/monorepo/tree/main/packages/chat#readme) - A p2p chat via Bitcoin and Litecoin
-* [TCB20 App](https://github.com/bitcoin-computer/monorepo/tree/main/packages/TBC20-app#readme) - An app for minting, sending, and storing fungible tokens
-* [TBC721 App](https://github.com/bitcoin-computer/monorepo/tree/main/packages/TBC721-app#readme) - An app for minting, sending, and storing non-fungible tokens
+* [Fungible Token App](https://github.com/bitcoin-computer/monorepo/tree/main/packages/ft#readme) - An app for minting, sending, and storing fungible tokens
+* [Non Fungible Token App](https://github.com/bitcoin-computer/monorepo/tree/main/packages/nft#readme) - An app for minting, sending, and storing non-fungible tokens
## Standard Contracts
* [TBC20](https://github.com/bitcoin-computer/monorepo/tree/main/packages/TBC20#readme) - An implementation of the ERC20 Fungible Token Standard
diff --git a/packages/TBC404-app/.env.example b/packages/TBC404-app/.env.example
deleted file mode 100644
index 5c8057675..000000000
--- a/packages/TBC404-app/.env.example
+++ /dev/null
@@ -1,8 +0,0 @@
-MNEMONIC=travel upgrade inside soda birth essence junk merit never twenty system opinion
-GENERATE_SOURCEMAP=false
-PORT=1032
-REACT_APP_LTC_REGTEST_URL=https://rltc.node.bitcoincomputer.io
-REACT_APP_BTC_TESTNET_URL=https://btc.node.bitcoincomputer.io
-REACT_APP_BTC_REGTEST_URL=http://127.0.0.1:1031
-REACT_APP_CHAIN=LTC
-REACT_APP_NETWORK=regtest
\ No newline at end of file
diff --git a/packages/TBC404-app/.gitignore b/packages/TBC404-app/.gitignore
deleted file mode 100644
index 274ff2da6..000000000
--- a/packages/TBC404-app/.gitignore
+++ /dev/null
@@ -1,21 +0,0 @@
-# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
-
-# dependencies
-/node_modules
-/.pnp
-.pnp.js
-
-# testing
-/coverage
-
-# production
-/build
-
-# misc
-.DS_Store
-.env.local
-.env.development.local
-.env.test.local
-.env.production.local
-
-*.log*
diff --git a/packages/TBC404-app/.prettierrc b/packages/TBC404-app/.prettierrc
deleted file mode 100644
index b7a412b57..000000000
--- a/packages/TBC404-app/.prettierrc
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "printWidth": 100,
- "semi": false,
- "singleQuote": false,
- "trailingComma": "none"
-}
diff --git a/packages/TBC404-app/README.md b/packages/TBC404-app/README.md
deleted file mode 100644
index 8c67bfdc0..000000000
--- a/packages/TBC404-app/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
TBC404 App
-
- An app for minting, storing, and trading fungible tokens with multiple owners
-
- website · docs
-
-
-
-Ethereum's [ERC404](https://github.com/Pandora-Labs-Org/erc404) contract is a mixed [ERC-20](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol)/[ERC-721](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/token/ERC721) implementation with native liquidity and fractionalization. This package contains an app for a similar contract on Bitcoin.
-
-## Prerequisites
-
-You need to have [git](https://www.git-scm.com/) and [node.js](https://nodejs.org/) installed.
-
-## Installation
-
-
-
-```sh
-# Download the monorepo
-git clone https://github.com/bitcoin-computer/monorepo.git
-
-# Move into monorepo folder
-cd monorepo
-
-# Install the dependencies
-npm install
-```
-
-
-
-### Start the Application
-
-To start the application run the command below and open [http://localhost:3000](http://localhost:3000).
-
-
-
-```bash
-# Move to the package
-cd packages/TBC404-app
-
-# Install the dependencies
-npm install
-
-# Use the default environment variables
-cp .env.example .env
-
-# Start the app
-npm run start
-```
-
-
-
-## Documentation
-
-Have a look at the [docs](https://docs.bitcoincomputer.io/) for the Bitcoin Computer.
-
-## Getting Help
-
-If you have any questions, please let us know on Telegram , Twitter , or by email clemens@bitcoincomputer.io.
-
-## Development Status
-See [here](https://github.com/bitcoin-computer/monorepo/tree/main/packages/lib#development-status).
-
-## Price
-
-See [here](https://www.npmjs.com/package/@bitcoin-computer/lib#price).
-
-## Contributing
-
-This project is intended as a starting point for new development so we want to keep it simple. If you have found a bug please create an [issue](https://github.com/bitcoin-computer/monorepo/issues). If you have a bug fix or a UX improvement please create a pull request [here](https://github.com/bitcoin-computer/monorepo/pulls).
-
-If you want to add a feature we recommend to create a fork. Let us know if you have built something cool and we can link to your project.
-
-## MIT License
-
-Copyright (c) 2022 BCDB Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-[node]: https://github.com/bitcoin-computer/monorepo/tree/main/packages/node
diff --git a/packages/TBC404-app/package.json b/packages/TBC404-app/package.json
deleted file mode 100644
index afd5dcfa3..000000000
--- a/packages/TBC404-app/package.json
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- "name": "@bitcoin-computer/TBC404-app",
- "version": "0.19.0-beta.0",
- "private": true,
- "dependencies": {
- "@bitcoin-computer/components": "^0.19.0-beta.0",
- "@bitcoin-computer/lib": "^0.19.0-beta.0",
- "@testing-library/jest-dom": "^6.4.2",
- "@testing-library/react": "^14.2.1",
- "@testing-library/user-event": "^14.5.2",
- "@types/jest": "^29.5.12",
- "@types/node": "^20.11.21",
- "@types/react": "^18.2.60",
- "@types/react-dom": "^18.2.19",
- "flowbite": "^2.3.0",
- "react": "^18.2.0",
- "react-dom": "^18.2.0",
- "react-icons": "^5.0.1",
- "react-router-dom": "^6.22.1",
- "react-scripts": "5.0.1",
- "tailwindcss": "^3.4.1",
- "typescript": "^4.9.5",
- "web-vitals": "^3.5.2"
- },
- "devDependencies": {
- "@types/chai": "^4.3.12",
- "@types/expect": "^24.3.0",
- "@types/mocha": "^10.0.6",
- "@types/node": "~18.0.0",
- "chai": "^5.1.0",
- "dotenv": "^16.4.5",
- "eslint": "^8.57.0",
- "eslint-config-airbnb-typescript": "^17.1.0",
- "eslint-config-prettier": "~9.1.0",
- "eslint-plugin-import": "^2.29.1",
- "mocha": "^10.3.0",
- "prettier": "~3.2.5",
- "typescript": "~5.3.3"
- },
- "scripts": {
- "start": "react-scripts start",
- "build": "react-scripts build",
- "test": "react-scripts test",
- "eject": "react-scripts eject"
- },
- "eslintConfig": {
- "extends": [
- "react-app",
- "react-app/jest"
- ]
- },
- "browserslist": {
- "production": [
- ">0.2%",
- "not dead",
- "not op_mini all"
- ],
- "development": [
- "last 1 chrome version",
- "last 1 firefox version",
- "last 1 safari version"
- ]
- }
-}
diff --git a/packages/TBC404-app/public/BitcoinComputer-Logo.png b/packages/TBC404-app/public/BitcoinComputer-Logo.png
deleted file mode 100644
index 539aeba1a..000000000
Binary files a/packages/TBC404-app/public/BitcoinComputer-Logo.png and /dev/null differ
diff --git a/packages/TBC404-app/public/favicon.ico b/packages/TBC404-app/public/favicon.ico
deleted file mode 100644
index a11777cc4..000000000
Binary files a/packages/TBC404-app/public/favicon.ico and /dev/null differ
diff --git a/packages/TBC404-app/public/index.html b/packages/TBC404-app/public/index.html
deleted file mode 100644
index 01713aaec..000000000
--- a/packages/TBC404-app/public/index.html
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- React App
-
-
- You need to enable JavaScript to run this app.
-
-
-
-
diff --git a/packages/TBC404-app/public/logo.png b/packages/TBC404-app/public/logo.png
deleted file mode 100644
index 64678214a..000000000
Binary files a/packages/TBC404-app/public/logo.png and /dev/null differ
diff --git a/packages/TBC404-app/public/logo192.png b/packages/TBC404-app/public/logo192.png
deleted file mode 100644
index fc44b0a37..000000000
Binary files a/packages/TBC404-app/public/logo192.png and /dev/null differ
diff --git a/packages/TBC404-app/public/logo512.png b/packages/TBC404-app/public/logo512.png
deleted file mode 100644
index a4e47a654..000000000
Binary files a/packages/TBC404-app/public/logo512.png and /dev/null differ
diff --git a/packages/TBC404-app/public/manifest.json b/packages/TBC404-app/public/manifest.json
deleted file mode 100644
index 080d6c77a..000000000
--- a/packages/TBC404-app/public/manifest.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "short_name": "React App",
- "name": "Create React App Sample",
- "icons": [
- {
- "src": "favicon.ico",
- "sizes": "64x64 32x32 24x24 16x16",
- "type": "image/x-icon"
- },
- {
- "src": "logo192.png",
- "type": "image/png",
- "sizes": "192x192"
- },
- {
- "src": "logo512.png",
- "type": "image/png",
- "sizes": "512x512"
- }
- ],
- "start_url": ".",
- "display": "standalone",
- "theme_color": "#000000",
- "background_color": "#ffffff"
-}
diff --git a/packages/TBC404-app/public/robots.txt b/packages/TBC404-app/public/robots.txt
deleted file mode 100644
index e9e57dc4d..000000000
--- a/packages/TBC404-app/public/robots.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-# https://www.robotstxt.org/robotstxt.html
-User-agent: *
-Disallow:
diff --git a/packages/TBC404-app/src/App.css b/packages/TBC404-app/src/App.css
deleted file mode 100644
index 74b5e0534..000000000
--- a/packages/TBC404-app/src/App.css
+++ /dev/null
@@ -1,38 +0,0 @@
-.App {
- text-align: center;
-}
-
-.App-logo {
- height: 40vmin;
- pointer-events: none;
-}
-
-@media (prefers-reduced-motion: no-preference) {
- .App-logo {
- animation: App-logo-spin infinite 20s linear;
- }
-}
-
-.App-header {
- background-color: #282c34;
- min-height: 100vh;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- font-size: calc(10px + 2vmin);
- color: white;
-}
-
-.App-link {
- color: #61dafb;
-}
-
-@keyframes App-logo-spin {
- from {
- transform: rotate(0deg);
- }
- to {
- transform: rotate(360deg);
- }
-}
diff --git a/packages/TBC404-app/src/App.test.tsx b/packages/TBC404-app/src/App.test.tsx
deleted file mode 100644
index 2a68616d9..000000000
--- a/packages/TBC404-app/src/App.test.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import React from 'react';
-import { render, screen } from '@testing-library/react';
-import App from './App';
-
-test('renders learn react link', () => {
- render( );
- const linkElement = screen.getByText(/learn react/i);
- expect(linkElement).toBeInTheDocument();
-});
diff --git a/packages/TBC404-app/src/App.tsx b/packages/TBC404-app/src/App.tsx
deleted file mode 100644
index db968a582..000000000
--- a/packages/TBC404-app/src/App.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-import "./App.css"
-import { useEffect, useState } from "react"
-import { BrowserRouter, Route, Routes, Navigate } from "react-router-dom"
-import { Navbar } from "./components/Navbar"
-import { initFlowbite } from "flowbite"
-import { Auth, Error404, UtilsContext, Wallet, SmartObject, Transaction, ComputerContext } from "@bitcoin-computer/components"
-import Mint from "./components/Mint"
-import { AllAssets, MyAssets } from "./components/Assets"
-
-export default function App() {
- const [computer] = useState(Auth.getComputer())
-
- useEffect(() => {
- initFlowbite()
- }, [])
-
- return (
-
-
-
-
-
-
-
-
-
- } />
- } />
- } />
- } />
- } />
- } />
- } />
-
-
-
-
-
- )
-}
diff --git a/packages/TBC404-app/src/components/Assets.tsx b/packages/TBC404-app/src/components/Assets.tsx
deleted file mode 100644
index 17c00087f..000000000
--- a/packages/TBC404-app/src/components/Assets.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Auth, Gallery } from "@bitcoin-computer/components"
-
-const publicKey = Auth.getComputer().getPublicKey()
-
-export function MyAssets() {
- return <>
- My Tokens
-
- >
-}
-
-export function AllAssets() {
- return <>
- All Tokens
-
- >
-}
\ No newline at end of file
diff --git a/packages/TBC404-app/src/components/Mint.tsx b/packages/TBC404-app/src/components/Mint.tsx
deleted file mode 100644
index f8fca7969..000000000
--- a/packages/TBC404-app/src/components/Mint.tsx
+++ /dev/null
@@ -1,107 +0,0 @@
-import { useContext, useState } from "react"
-import { ComputerContext, Modal } from "@bitcoin-computer/components"
-import { Token } from "../contracts/token"
-import { Link } from "react-router-dom"
-
-function SuccessContent(rev: string) {
- return <>
-
-
- You created a {
- Modal.hideModal("success-modal")
- }}
- >404 token.
-
-
-
- Modal.hideModal("success-modal")}
- className="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
- >
- Close
-
-
- >
-}
-
-function ErrorContent(msg: string) {
- return <>
-
-
- Something went wrong.
- {msg}
-
-
-
- {
- Modal.hideModal("error-modal")
- }}
- className="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
- >
- Close
-
-
- >
-}
-
-export default function Mint() {
- const computer = useContext(ComputerContext)
- const [successRev, setSuccessRev] = useState('')
- const [errorMsg, setErrorMsg] = useState('')
-
- const onSubmit = async (e: React.SyntheticEvent) => {
- e.preventDefault()
-
- const target = e.target as typeof e.target & {
- supply: { value: string }
- img: { value: string }
- name: { value: string }
- symbol: { value: string }
- }
- const img = target.img.value
- const supply = parseInt(target.supply.value, 10)
- const name = target.name.value
- const symbol = target.symbol.value
-
- try {
- const counter = await computer.new(Token, [computer.getPublicKey(), img, supply, supply, name, symbol])
- setSuccessRev(counter._id)
- Modal.showModal('success-modal')
- } catch(err) {
- if (err instanceof Error) {
- setErrorMsg(err.message)
- Modal.showModal('error-modal')
- }
- }
- }
-
- return (
- <>
-
-
-
- >
- )
-}
\ No newline at end of file
diff --git a/packages/TBC404-app/src/components/Navbar.tsx b/packages/TBC404-app/src/components/Navbar.tsx
deleted file mode 100644
index 08375d6de..000000000
--- a/packages/TBC404-app/src/components/Navbar.tsx
+++ /dev/null
@@ -1,263 +0,0 @@
-import { Link } from "react-router-dom"
-import { Modal, Auth, UtilsContext, Drawer } from "@bitcoin-computer/components"
-import { useEffect, useState } from "react"
-import { initFlowbite } from "flowbite"
-import { Chain, Network } from "../types/common"
-
-const modalTitle = "Connect to Node"
-const modalId = "unsupported-config-modal"
-
-function formatChainAndNetwork(chain: Chain, network: Network) {
- const map = {
- mainnet: "",
- testnet: "t",
- regtest: "r",
- }
- const prefix = map[network]
- return `${prefix}${chain}`
-}
-
-function ModalContent() {
- const [url, setUrl] = useState("")
- function setNetwork(e: React.SyntheticEvent) {
- e.preventDefault()
- localStorage.setItem("URL", url)
- }
-
- function closeModal() {
- Modal.get(modalId).hide()
- }
-
- return (
-
- )
-}
-
-function SignInItem() {
- return
-
-
-
-
-}
-
-export function NotLoggedMenu() {
- const [dropDownLabel, setDropDownLabel] = useState("LTC")
- const { showSnackBar } = UtilsContext.useUtilsComponents()
-
- useEffect(() => {
- initFlowbite()
-
- const { chain, network } = Auth.defaultConfiguration()
- setDropDownLabel(formatChainAndNetwork(chain, network))
- }, [])
-
- const setChainAndNetwork = (chain: Chain, network: Network) => {
- try {
- localStorage.setItem("URL", Auth.getUrl(chain, network))
- localStorage.setItem("CHAIN", chain)
- localStorage.setItem("NETWORK", network)
- setDropDownLabel(formatChainAndNetwork(chain, network))
- window.location.href = "/"
- } catch (err) {
- showSnackBar("Error setting chain and network", false)
- Modal.get(modalId).show()
- }
- }
-
- function CoinSelectionItem({ chain, network }: { chain: Chain, network: Network }) {
- return
- setChainAndNetwork(chain, network)}
- className="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
- >
- {chain} {network}
-
-
- }
-
- return (
- <>
-
-
-
-
- {dropDownLabel}
-
-
-
-
-
-
-
-
-
- >
- )
-}
-
-function WalletItem() {
- return
-
-
-
-
-}
-
-function Item({ dest, name }: { dest: string, name: string }) {
- return
-
- {name}
-
-
-}
-
-export function LoggedInMenu() {
- return (
-
- )
-}
-
-function NavbarDropdownButton() {
- return
- Open main menu
-
-
-
-
-}
-
-export function Logo({ name = 'TBC 404' }) {
- return
-
-
- {name}
-
-
-}
-
-export function Navbar() {
- useEffect(() => {
- initFlowbite()
- }, [])
-
- return (
- <>
-
-
-
-
-
- {Auth.isLoggedIn() ? : }
-
-
-
- >
- )
-}
diff --git a/packages/TBC404-app/src/contracts/token.ts b/packages/TBC404-app/src/contracts/token.ts
deleted file mode 100644
index 3c1a2c2cb..000000000
--- a/packages/TBC404-app/src/contracts/token.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-export class Token extends Contract {
- constructor(to: string, img: string, supply: number, totalSupply: number, name: string, symbol = '') {
- super({ _owners: [to], img, totalSupply, supply, name, symbol })
- }
-
- transfer(to: string, amount: number): Token {
- if (this.supply < amount) throw new Error()
- this.supply -= amount
- return new Token(to, this.img, amount, this.totalSupply, this.name, this.symbol)
- }
-}
\ No newline at end of file
diff --git a/packages/TBC404-app/src/index.css b/packages/TBC404-app/src/index.css
deleted file mode 100644
index 313433e44..000000000
--- a/packages/TBC404-app/src/index.css
+++ /dev/null
@@ -1,16 +0,0 @@
-@tailwind base;
-@tailwind components;
-@tailwind utilities;
-body {
- margin: 0;
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
- "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
- sans-serif;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-
-code {
- font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
- monospace;
-}
diff --git a/packages/TBC404-app/src/index.tsx b/packages/TBC404-app/src/index.tsx
deleted file mode 100644
index 032464fb6..000000000
--- a/packages/TBC404-app/src/index.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import React from 'react';
-import ReactDOM from 'react-dom/client';
-import './index.css';
-import App from './App';
-import reportWebVitals from './reportWebVitals';
-
-const root = ReactDOM.createRoot(
- document.getElementById('root') as HTMLElement
-);
-root.render(
-
-
-
-);
-
-// If you want to start measuring performance in your app, pass a function
-// to log results (for example: reportWebVitals(console.log))
-// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
-reportWebVitals();
diff --git a/packages/TBC404-app/src/logo.svg b/packages/TBC404-app/src/logo.svg
deleted file mode 100644
index 9dfc1c058..000000000
--- a/packages/TBC404-app/src/logo.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/packages/TBC404-app/src/react-app-env.d.ts b/packages/TBC404-app/src/react-app-env.d.ts
deleted file mode 100644
index 6431bc5fc..000000000
--- a/packages/TBC404-app/src/react-app-env.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-///
diff --git a/packages/TBC404-app/src/reportWebVitals.ts b/packages/TBC404-app/src/reportWebVitals.ts
deleted file mode 100644
index 49a2a16e0..000000000
--- a/packages/TBC404-app/src/reportWebVitals.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { ReportHandler } from 'web-vitals';
-
-const reportWebVitals = (onPerfEntry?: ReportHandler) => {
- if (onPerfEntry && onPerfEntry instanceof Function) {
- import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
- getCLS(onPerfEntry);
- getFID(onPerfEntry);
- getFCP(onPerfEntry);
- getLCP(onPerfEntry);
- getTTFB(onPerfEntry);
- });
- }
-};
-
-export default reportWebVitals;
diff --git a/packages/TBC404-app/src/setupTests.ts b/packages/TBC404-app/src/setupTests.ts
deleted file mode 100644
index 8f2609b7b..000000000
--- a/packages/TBC404-app/src/setupTests.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-// jest-dom adds custom jest matchers for asserting on DOM nodes.
-// allows you to do things like:
-// expect(element).toHaveTextContent(/react/i)
-// learn more: https://github.com/testing-library/jest-dom
-import '@testing-library/jest-dom';
diff --git a/packages/TBC404-app/src/types/common.ts b/packages/TBC404-app/src/types/common.ts
deleted file mode 100644
index 5eb750411..000000000
--- a/packages/TBC404-app/src/types/common.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export type Chain = "LTC" | "BTC" | "DOGE"
-export type Network = "testnet" | "mainnet" | "regtest"
diff --git a/packages/TBC404-app/src/types/global.d.ts b/packages/TBC404-app/src/types/global.d.ts
deleted file mode 100644
index e191d51fa..000000000
--- a/packages/TBC404-app/src/types/global.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-declare var Contract: any;
diff --git a/packages/TBC404-app/tailwind.config.js b/packages/TBC404-app/tailwind.config.js
deleted file mode 100644
index 1a612e113..000000000
--- a/packages/TBC404-app/tailwind.config.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/** @type {import('tailwindcss').Config} */
-module.exports = {
- content: ["./src/**/*.{js,jsx,ts,tsx}", "../components/built/**/*.{js,jsx,ts,tsx}"],
- darkMode: "media",
- theme: {
- extend: {
- colors: {
- "blue-1": "#000F38",
- "blue-2": "#002A99",
- "blue-3": "#0046FF",
- "blue-4": "#A7BFFF",
- },
- },
- },
- plugins: [],
-}
diff --git a/packages/TBC404-app/tsconfig.json b/packages/TBC404-app/tsconfig.json
deleted file mode 100644
index 9d379a3c4..000000000
--- a/packages/TBC404-app/tsconfig.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "compilerOptions": {
- "target": "es5",
- "lib": ["dom", "dom.iterable", "esnext"],
- "allowJs": true,
- "skipLibCheck": true,
- "esModuleInterop": true,
- "allowSyntheticDefaultImports": true,
- "strict": true,
- "forceConsistentCasingInFileNames": true,
- "noFallthroughCasesInSwitch": true,
- "module": "esnext",
- "moduleResolution": "node",
- "resolveJsonModule": true,
- "isolatedModules": true,
- "noEmit": true,
- "jsx": "react-jsx"
- },
- "include": ["src"]
-}
diff --git a/packages/TBC404/.eslintrc b/packages/TBC404/.eslintrc
deleted file mode 100644
index 3d60a7dac..000000000
--- a/packages/TBC404/.eslintrc
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- "parser": "@typescript-eslint/parser",
- "extends": [
- "airbnb-base",
- "plugin:prettier/recommended",
- "prettier",
- "plugin:@typescript-eslint/recommended",
- "plugin:import/typescript"
- ],
- "plugins": [
- "@typescript-eslint"
- ],
- "env": {
- "jest": true
- },
- "rules": {
- "semi": [
- "error",
- "never"
- ],
- "@typescript-eslint/no-extra-semi": "off",
- "@typescript-eslint/ban-ts-comment": "off",
- "@typescript-eslint/no-explicit-any": "off",
- "import/extensions": "off",
- "lines-between-class-members": "off",
- "import/prefer-default-export": "off",
- "no-underscore-dangle": [
- "error",
- {
- "allowAfterThis": true,
- "allow": [
- "_readers",
- "_owners",
- "_amount",
- "_id",
- "_rev",
- "_root"
- ]
- }
- ]
- }
-}
diff --git a/packages/TBC404/.gitignore b/packages/TBC404/.gitignore
deleted file mode 100644
index 68c52a986..000000000
--- a/packages/TBC404/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/node_modules
-.DS_Store
-build
diff --git a/packages/TBC404/.mocharc.json b/packages/TBC404/.mocharc.json
deleted file mode 100644
index 39f800d33..000000000
--- a/packages/TBC404/.mocharc.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "extension": ["ts"],
- "node-option": [
- "experimental-specifier-resolution=node",
- "loader=ts-node/esm"
- ],
- "require": ["dotenv/config"],
- "spec": "test/*.test.ts",
- "timeout": "30000000"
-}
diff --git a/packages/TBC404/.prettierrc b/packages/TBC404/.prettierrc
deleted file mode 100644
index a65b64ade..000000000
--- a/packages/TBC404/.prettierrc
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "printWidth": 100,
- "semi": false,
- "singleQuote": true,
- "trailingComma": "none"
-}
diff --git a/packages/TBC404/LICENSE b/packages/TBC404/LICENSE
deleted file mode 100644
index 037b71e3f..000000000
--- a/packages/TBC404/LICENSE
+++ /dev/null
@@ -1,7 +0,0 @@
-Copyright 2022 BCDB Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/packages/TBC404/README.md b/packages/TBC404/README.md
deleted file mode 100644
index 4960f5315..000000000
--- a/packages/TBC404/README.md
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
TBC Node.js Template
-
- A smart contract for NFTs with partial ownership
-
- website · docs
-
-
-
-## Prerequisites
-
-You need to have [git](https://www.git-scm.com/) and [node.js](https://nodejs.org/) installed.
-
-## Installation
-
-
-
-```sh
-# Download the monorepo
-git clone https://github.com/bitcoin-computer/monorepo.git
-
-# Move into monorepo folder
-cd monorepo
-
-# Install the dependencies
-npm install
-```
-
-
-
-## Usage
-
-You can use the commands below in the folder `packages/nodejs-template`.
-
-### Run the Tests
-
-
-
-```bash
-npm run test
-```
-
-
-
-### Check the Types
-
-
-
-```bash
-npm run types
-```
-
-
-
-### Run the Linter
-
-
-
-```bash
-npm run lint
-```
-
-
-
-## Documentation
-
-Have a look at the [docs](https://docs.bitcoincomputer.io/) for the Bitcoin Computer.
-
-## Getting Help
-
-If you have any questions, please let us know on Telegram , Twitter , or by email clemens@bitcoincomputer.io.
-
-## Development Status
-See [here](https://github.com/bitcoin-computer/monorepo/tree/main/packages/lib#development-status).
-
-## Price
-
-See [here](https://www.npmjs.com/package/@bitcoin-computer/lib#price).
-
-## Contributing
-
-This project is intended as a starting point for new development so we want to keep it simple. If you have found a bug please create an [issue](https://github.com/bitcoin-computer/monorepo/issues). If you have a bug fix or a UX improvement please create a pull request [here](https://github.com/bitcoin-computer/monorepo/pulls).
-
-If you want to add a feature we recommend to create a fork. Let us know if you have built something cool and we can link to your project.
-
-## MIT License
-
-Copyright (c) 2022 BCDB Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-[node]: https://github.com/bitcoin-computer/monorepo/tree/main/packages/node
-
-
-[ts-badge]: https://img.shields.io/badge/TypeScript-4.5-blue.svg
-[nodejs-badge]: https://img.shields.io/badge/Node.js->=%2016.13-blue.svg
-[nodejs]: https://nodejs.org/dist/latest-v14.x/docs/api/
-[gha-badge]: https://github.com/bitcoin-computer/bitcoin-computer-nodejs-template/actions/workflows/nodejs.yml/badge.svg
-[bitcoin-computer]: http://bitcoincomputer.io/
-[node-typescript-boilerplate]: https://github.com/jsynowiec/node-typescript-boilerplate
-[typescript]: https://www.typescriptlang.org/
-[typescript-4-5]: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html
-[license-badge]: https://img.shields.io/badge/license-APLv2-blue.svg
-[license]: https://github.com/bitcoin-computer/bitcoin-computer-nodejs-template/blob/main/LICENSE
-[eslint]: https://eslint.org
diff --git a/packages/TBC404/package.json b/packages/TBC404/package.json
deleted file mode 100644
index 8282ede75..000000000
--- a/packages/TBC404/package.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "name": "@bitcoin-computer/TBC404",
- "version": "0.19.0-beta.0",
- "description": "Minimalistic boilerplate to quick-start Bitcoin Computer development.",
- "scripts": {
- "start": "node build/src/main.js",
- "prebuild": "npm run lint",
- "build": "tsc -p tsconfig.release.json",
- "lint": "eslint --fix . --ext .ts,.tsx",
- "test": "mocha --config .mocharc.json",
- "test-and-show": "../../scripts/test-and-show.sh tbc404-test.log",
- "types": "tsc --noEmit"
- },
- "type": "module",
- "dependencies": {
- "@bitcoin-computer/lib": "^0.19.0-beta.0"
- },
- "devDependencies": {
- "@types/mocha": "^9.1.1",
- "@types/node": "~18.0.0",
- "@typescript-eslint/eslint-plugin": "^5.10.0",
- "@typescript-eslint/parser": "^5.10.0",
- "chai": "^4.3.6",
- "chai-match-pattern": "^1.3.0",
- "dotenv": "^16.0.0",
- "eslint": "^8.7.0",
- "eslint-config-airbnb-typescript": "^17.0.0",
- "eslint-config-prettier": "~8.5.0",
- "eslint-plugin-import": "^2.25.4",
- "eslint-plugin-prettier": "^4.0.0",
- "mocha": "^10.0.0",
- "prettier": "~2.7.1",
- "ts-node": "^10.8.1",
- "tslib": "~2.4.0",
- "tsutils": "~3.21.0",
- "typescript": "~4.7.2"
- },
- "author": "Clemens Ley ",
- "license": "MIT",
- "volta": {
- "node": "16.13.0"
- },
- "gitHead": "af40117bcb9616e631910f68c3b617aef629f027"
-}
diff --git a/packages/TBC404/src/main.ts b/packages/TBC404/src/main.ts
deleted file mode 100644
index 9c395df6a..000000000
--- a/packages/TBC404/src/main.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { Contract } from '@bitcoin-computer/lib'
-
-class Counter extends Contract {
- n: number
-
- constructor() {
- super({ n: 0 })
- }
-
- inc() {
- this.n += 1
- }
-}
-
-export { Counter }
diff --git a/packages/TBC404/test/main.test.ts b/packages/TBC404/test/main.test.ts
deleted file mode 100644
index 125f081d4..000000000
--- a/packages/TBC404/test/main.test.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-/* eslint-disable no-unused-expressions */
-/* eslint-disable import/no-extraneous-dependencies */
-import { expect } from 'chai'
-import * as chai from 'chai'
-import chaiMatchPattern from 'chai-match-pattern'
-import { Computer } from '@bitcoin-computer/lib'
-import dotenv from 'dotenv'
-import { Counter } from '../src/main'
-
-// If you want to connect to your local Bitcoin Computer Node, create a .env file
-// in the monorepo root level and add the following line:
-// BCN_URL=http://localhost:1031
-
-dotenv.config({ path: '../../.env' })
-
-const url = process.env.BCN_URL
-
-chai.use(chaiMatchPattern)
-const _ = chaiMatchPattern.getLodashModule()
-
-describe('Bitcoin Computer', () => {
- it('should export a function', () => {
- expect(Computer).not.to.be.undefined
- expect(typeof Computer).eq('function')
- })
-
- it('should create a computer object', () => {
- const computer = new Computer({ url })
- expect(computer).not.to.be.undefined
- expect(typeof computer).eq('object')
- })
-
- it('should create a Javascript object', () => {
- expect(Counter).not.to.be.undefined
- expect(typeof Counter).eq('function')
- const counter = new Counter()
- expect(counter.n).eq(0)
- })
-
- it('should create a smart object', async () => {
- const computer = new Computer({ url })
-
- await computer.faucet(1e7)
- const counter = await computer.new(Counter)
- // @ts-ignore
- expect(counter).to.matchPattern({
- n: 0,
- _id: _.isString,
- _rev: _.isString,
- _root: _.isString,
- _amount: _.isNumber,
- _owners: _.isArray,
- })
- })
-
- it('should update a smart object', async () => {
- const computer = new Computer({ url })
-
- await computer.faucet(1e7)
- const counter = await computer.new(Counter)
- await counter.inc()
- // @ts-ignore
- expect(counter).to.matchPattern({
- n: 1,
- _id: _.isString,
- _rev: _.isString,
- _root: _.isString,
- _amount: _.isNumber,
- _owners: _.isArray,
- })
- })
-})
diff --git a/packages/TBC404/tsconfig.json b/packages/TBC404/tsconfig.json
deleted file mode 100644
index d25092993..000000000
--- a/packages/TBC404/tsconfig.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "compilerOptions": {
- "target": "ES6",
- "module": "esnext",
- "resolveJsonModule": true,
- "moduleResolution": "node",
- "esModuleInterop": true,
- "experimentalDecorators": true,
- "skipLibCheck": true,
- "lib": [
- "esnext",
- "DOM"
- ]
- },
- "include": [
- "src/**/*",
- "test/**/*"
- ]
-}
diff --git a/packages/TBC404/tsconfig.release.json b/packages/TBC404/tsconfig.release.json
deleted file mode 100644
index a7ed494c9..000000000
--- a/packages/TBC404/tsconfig.release.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "extends": "./tsconfig.json",
- "compilerOptions": {
- "rootDir": ".",
- "outDir": "build",
- "removeComments": true
- },
- "include": [
- "src/**/*"
- ]
-}
diff --git a/packages/TBC721-app/.env.example b/packages/TBC721-app/.env.example
deleted file mode 100644
index 5e18b690b..000000000
--- a/packages/TBC721-app/.env.example
+++ /dev/null
@@ -1 +0,0 @@
-MNEMONIC=abstract core glare crime whale wheat snow drink orient excite already buddy copy protect toilet
diff --git a/packages/TBC721-app/.gitignore b/packages/TBC721-app/.gitignore
deleted file mode 100644
index 274ff2da6..000000000
--- a/packages/TBC721-app/.gitignore
+++ /dev/null
@@ -1,21 +0,0 @@
-# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
-
-# dependencies
-/node_modules
-/.pnp
-.pnp.js
-
-# testing
-/coverage
-
-# production
-/build
-
-# misc
-.DS_Store
-.env.local
-.env.development.local
-.env.test.local
-.env.production.local
-
-*.log*
diff --git a/packages/TBC721-app/.prettierrc b/packages/TBC721-app/.prettierrc
deleted file mode 100644
index b7a412b57..000000000
--- a/packages/TBC721-app/.prettierrc
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "printWidth": 100,
- "semi": false,
- "singleQuote": false,
- "trailingComma": "none"
-}
diff --git a/packages/TBC721-app/README.md b/packages/TBC721-app/README.md
deleted file mode 100644
index 6bb8f12b1..000000000
--- a/packages/TBC721-app/README.md
+++ /dev/null
@@ -1,105 +0,0 @@
-
-
TBC NFT App
-
- A web application for creating, storing and sending non-fungible tokens
-
- website · docs
-
-
-
-
-
-> [!WARNING]
-> This app needs refactoring and is not ready for use
-
-## Prerequisites
-
-You need to have [git](https://www.git-scm.com/) and [node.js](https://nodejs.org/) installed.
-
-## Installation
-
-
-
-```sh
-# Download the monorepo
-git clone https://github.com/bitcoin-computer/monorepo.git
-
-# Move into monorepo folder
-cd monorepo
-
-# Install the dependencies
-npm install
-```
-
-
-
-## Usage
-
-
-### Start the Server
-
-Run the command below and open [http://localhost:3000](http://localhost:3000).
-
-
-
-```bash
-# Move to the package
-cd packages/TBC721-app
-
-# Start the app
-npm run start
-```
-
-
-
-
-
-## Video
-
-You can watch us writing the first version of this app in this [video](http://www.youtube.com/watch?feature=player_embedded&v=SnTwevzmRrs
-).
-
-## Documentation
-
-Have a look at the [docs](https://docs.bitcoincomputer.io/) for the Bitcoin Computer.
-
-## Getting Help
-
-If you have any questions, please let us know on Telegram , Twitter , or by email clemens@bitcoincomputer.io.
-
-## Development Status
-See [here](https://github.com/bitcoin-computer/monorepo/tree/main/packages/lib#development-status).
-
-## Price
-
-See [here](https://www.npmjs.com/package/@bitcoin-computer/lib#price).
-
-## Contributing
-
-This project is intended as a starting point for new development so we want to keep it simple. If you have found a bug please create an [issue](https://github.com/bitcoin-computer/monorepo/issues). If you have a bug fix or a UX improvement please create a pull request [here](https://github.com/bitcoin-computer/monorepo/pulls).
-
-If you want to add a feature we recommend to create a fork. Let us know if you have built something cool and we can link to your project.
-
-## MIT License
-
-Copyright (c) 2022 BCDB Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-[node]: https://github.com/bitcoin-computer/monorepo/tree/main/packages/node
diff --git a/packages/TBC721-app/package.json b/packages/TBC721-app/package.json
deleted file mode 100644
index 47a05bfa5..000000000
--- a/packages/TBC721-app/package.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "name": "@bitcoin-computer/TBC721-app",
- "version": "0.19.0-beta.0",
- "private": true,
- "dependencies": {
- "@bitcoin-computer/lib": "^0.19.0-beta.0",
- "react": "^18.2.0",
- "react-dom": "^18.2.0",
- "react-icons": "^5.0.1",
- "react-router-dom": "^6.22.1",
- "react-scripts": "5.0.1",
- "web-vitals": "^3.5.2"
- },
- "scripts": {
- "start": "react-scripts start",
- "build": "react-scripts build",
- "eject": "react-scripts eject",
- "deploy": "node --experimental-modules scripts/deploy.mjs"
- },
- "eslintConfig": {
- "extends": "react-app"
- },
- "browserslist": {
- "production": [
- ">0.2%",
- "not dead",
- "not op_mini all"
- ],
- "development": [
- "last 1 chrome version",
- "last 1 firefox version",
- "last 1 safari version"
- ]
- }
-}
diff --git a/packages/TBC721-app/postcss.config.js b/packages/TBC721-app/postcss.config.js
deleted file mode 100644
index 33ad091d2..000000000
--- a/packages/TBC721-app/postcss.config.js
+++ /dev/null
@@ -1,6 +0,0 @@
-module.exports = {
- plugins: {
- tailwindcss: {},
- autoprefixer: {},
- },
-}
diff --git a/packages/TBC721-app/public/BitcoinComputer-Logo.png b/packages/TBC721-app/public/BitcoinComputer-Logo.png
deleted file mode 100644
index 539aeba1a..000000000
Binary files a/packages/TBC721-app/public/BitcoinComputer-Logo.png and /dev/null differ
diff --git a/packages/TBC721-app/public/favicon.ico b/packages/TBC721-app/public/favicon.ico
deleted file mode 100644
index e6e12e617..000000000
Binary files a/packages/TBC721-app/public/favicon.ico and /dev/null differ
diff --git a/packages/TBC721-app/public/index.html b/packages/TBC721-app/public/index.html
deleted file mode 100644
index 78bcf56f4..000000000
--- a/packages/TBC721-app/public/index.html
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- React App
-
-
- You need to enable JavaScript to run this app.
-
-
-
-
diff --git a/packages/TBC721-app/public/logo.png b/packages/TBC721-app/public/logo.png
deleted file mode 100644
index 64678214a..000000000
Binary files a/packages/TBC721-app/public/logo.png and /dev/null differ
diff --git a/packages/TBC721-app/public/logo192.png b/packages/TBC721-app/public/logo192.png
deleted file mode 100644
index fa313abf5..000000000
Binary files a/packages/TBC721-app/public/logo192.png and /dev/null differ
diff --git a/packages/TBC721-app/public/logo512.png b/packages/TBC721-app/public/logo512.png
deleted file mode 100644
index bd5d4b5e2..000000000
Binary files a/packages/TBC721-app/public/logo512.png and /dev/null differ
diff --git a/packages/TBC721-app/public/manifest.json b/packages/TBC721-app/public/manifest.json
deleted file mode 100644
index 080d6c77a..000000000
--- a/packages/TBC721-app/public/manifest.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "short_name": "React App",
- "name": "Create React App Sample",
- "icons": [
- {
- "src": "favicon.ico",
- "sizes": "64x64 32x32 24x24 16x16",
- "type": "image/x-icon"
- },
- {
- "src": "logo192.png",
- "type": "image/png",
- "sizes": "192x192"
- },
- {
- "src": "logo512.png",
- "type": "image/png",
- "sizes": "512x512"
- }
- ],
- "start_url": ".",
- "display": "standalone",
- "theme_color": "#000000",
- "background_color": "#ffffff"
-}
diff --git a/packages/TBC721-app/public/nft-main-page.png b/packages/TBC721-app/public/nft-main-page.png
deleted file mode 100644
index 3ccd8ffb9..000000000
Binary files a/packages/TBC721-app/public/nft-main-page.png and /dev/null differ
diff --git a/packages/TBC721-app/public/placeholder.png b/packages/TBC721-app/public/placeholder.png
deleted file mode 100644
index 1a920d058..000000000
Binary files a/packages/TBC721-app/public/placeholder.png and /dev/null differ
diff --git a/packages/TBC721-app/public/robots.txt b/packages/TBC721-app/public/robots.txt
deleted file mode 100644
index 01b0f9a10..000000000
--- a/packages/TBC721-app/public/robots.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-# https://www.robotstxt.org/robotstxt.html
-User-agent: *
diff --git a/packages/TBC721-app/public/small-placeholder.png b/packages/TBC721-app/public/small-placeholder.png
deleted file mode 100644
index fe74514de..000000000
Binary files a/packages/TBC721-app/public/small-placeholder.png and /dev/null differ
diff --git a/packages/TBC721-app/scripts/deploy.mjs b/packages/TBC721-app/scripts/deploy.mjs
deleted file mode 100644
index 624bdc025..000000000
--- a/packages/TBC721-app/scripts/deploy.mjs
+++ /dev/null
@@ -1,85 +0,0 @@
-import { config } from 'dotenv';
-import { Computer } from '@bitcoin-computer/lib'
-import { Payment } from '../src/contracts/payment-contract.mjs'
-import { Royalty } from '../src/contracts/royalty-contract.mjs'
-import { Offer } from '../src/contracts/offer-contract.mjs'
-import { NFT } from '../src/contracts/nft-contract.mjs'
-import readline from 'readline';
-
-config()
-
-const mnemonic = process.env.MNEMONIC;
-const chain = process.env.CHAIN || 'LTC'
-const network = process.env.NETWORK || 'regtest'
-const url = process.env.BCN_URL || 'http://127.0.0.1:1031'
-
-if (!mnemonic) {
- throw new Error('Please set your MNEMONIC in a .env file')
-}
-
-const computer = new Computer({ mnemonic, chain, network, url })
-
-// Prompt the user to confirm an action
-const rl = readline.createInterface({
- input: process.stdin,
- output: process.stdout,
-});
-
-const paymentModule = `export ${Payment.toString()};`
-const royaltyModule = (paymentModSpec) => `import { Payment } from '${paymentModSpec}';
-export ${Royalty.toString()};`
-const offerModule = `export ${Offer.toString()};`
-const nftModule = (royaltyModSpec) => `import { Royalty } from '${royaltyModSpec}';
-export ${NFT.toString()};`
-
-const balance = await computer.wallet.getBalance()
-
-// Summary
-console.log(`
-Chain \x1b[2m${chain}\x1b[0m
-Network \x1b[2m${network}\x1b[0m
-Url \x1b[2m${url}\x1b[0m
-Address \x1b[2m${computer.wallet.address}\x1b[0m
-Mnemonic \x1b[2m${mnemonic}\x1b[0m
-Balance \x1b[2m${balance/1e8}\x1b[0m
-
-Payment Contract
-\x1b[2m${paymentModule}\x1b[0m
-
-Royalty Contract
-\x1b[2m${royaltyModule('')}\x1b[0m
-
-Nft Contract
-\x1b[2m${nftModule('')}\x1b[0m
-
-Offer Contract
-\x1b[2m${offerModule}\x1b[0m
-`)
-
-const q = `
-Do you want to deploy the contracts? (y/n)
-`
-rl.question(q, async (answer) => {
- if (answer === 'y') {
- console.log('\n Deploying contracts...')
-
- const paymentModSpec = await computer.export(paymentModule)
- const royaltyModSpec = await computer.export(royaltyModule(paymentModSpec))
- const nftModSpec = await computer.export(nftModule(royaltyModSpec))
- const offerModSpec = await computer.export(offerModule)
-
- console.log(`
-Export successful
-\x1b[2mYou can copy these module specifiers into src/App.js\x1b[0m
-
-const paymentModSpec = \x1b[2m'${paymentModSpec}'\x1b[0m
-const royaltyModSpec = \x1b[2m'${royaltyModSpec}'\x1b[0m
-const nftModSpec = \x1b[2m'${nftModSpec}'\x1b[0m
-const offerModSpec = \x1b[2m'${offerModSpec}'\x1b[0m
-`)
-
- } else {
- console.log('Aborting...');
- }
- rl.close();
-});
diff --git a/packages/TBC721-app/src/App.css b/packages/TBC721-app/src/App.css
deleted file mode 100644
index c3658cb87..000000000
--- a/packages/TBC721-app/src/App.css
+++ /dev/null
@@ -1,39 +0,0 @@
-.App {
- text-align: left;
- margin: 20px;
- line-height: 30px;
-}
-
-input[type=string] {
- padding: 5px;
- margin-bottom: 5px;
- font-size: inherit;
- width: 100%;
-}
-
-button[type=submit] {
- -webkit-appearance: none;
- -moz-appearance: none;
- appearance: none;
- padding: 10px 20px;
- margin: 20px 10px 0 0;
- font-size: inherit;
-}
-
-.flex-container {
- padding: 0;
- margin: 0;
- list-style: none;
-
- -ms-box-orient: horizontal;
- display: -webkit-box;
- display: -moz-box;
- display: -ms-flexbox;
- display: -moz-flex;
- display: -webkit-flex;
- display: flex;
- -webkit-flex-wrap: wrap;
- flex-wrap: wrap;
- -webkit-flex-direction: row;
- flex-direction: row;
-}
diff --git a/packages/TBC721-app/src/App.js b/packages/TBC721-app/src/App.js
deleted file mode 100644
index 80afd1676..000000000
--- a/packages/TBC721-app/src/App.js
+++ /dev/null
@@ -1,78 +0,0 @@
-import React, { useState } from "react"
-import { Computer } from "@bitcoin-computer/lib"
-import Mint from "./components/nfts/mintNft"
-import Nfts from "./components/nfts/nfts"
-import { BrowserRouter, Route, Routes, Navigate } from "react-router-dom"
-import Nft from "./components/nfts/nft"
-import NavbarWrapper from "./components/navbar/navbarWrapper"
-import Payments from "./components/payments/payments"
-import Payment from "./components/payments/payment"
-import Offers from "./components/offers/offers"
-import Royalties from "./components/royalties"
-import OfferDetails from "./components/offers/offer"
-
-function App() {
- const paymentModSpec = '2f00bfcf0c143b77541ae693d6dc2e450b3ce6cad516c133eb6f0bac4429dcf1:0'
- const royaltyModSpec = '7c07ae23b1b66d09a075a998d1e572a7d1369ffd523b802de87ac7c239a6e8b0:0'
- const nftModSpec = 'e7a4700d01def7cf485f252cb5e23fd2dfded9dca2a14442e1c3ce6106cfd789:0'
- const offerModSpec = 'f383920dbfee428380a2ddf237d4f3e0583dde3bfde00beb14058ec117a23b05:0'
-
- const mnemonic = localStorage.getItem("BIP_39_KEY") || ""
- const chain = localStorage.getItem("CHAIN") || ""
- const getConf = () => ({
- chain,
- mnemonic,
- })
- const config = getConf()
- const [computer, setComputer] = useState(mnemonic ? new Computer(config) : null)
-
- return (
-
-
-
-
- {['/', '/nfts'].map(path => ( }
- />))}
-
- }
- />
- } />
- }
- />
- }
- />
- }
- />
- }
- />
- }
- />
- } />
-
-
-
- )
-}
-
-export default App
diff --git a/packages/TBC721-app/src/App.test.js b/packages/TBC721-app/src/App.test.js
deleted file mode 100644
index 1a07d1457..000000000
--- a/packages/TBC721-app/src/App.test.js
+++ /dev/null
@@ -1,14 +0,0 @@
-import React from "react"
-import ReactDOM from "react-dom/client"
-import App from "./App"
-
-it("renders without crashing", () => {
- const div = document.createElement("div")
- const root = ReactDOM.createRoot(div)
-
- root.render(
-
-
-
- )
-})
diff --git a/packages/TBC721-app/src/auth/Login.js b/packages/TBC721-app/src/auth/Login.js
deleted file mode 100644
index ee9059c9f..000000000
--- a/packages/TBC721-app/src/auth/Login.js
+++ /dev/null
@@ -1,98 +0,0 @@
-import React, { useState } from "react"
-import { useNavigate } from "react-router-dom"
-import { Computer } from "@bitcoin-computer/lib"
-import SnackBar from "../component/util/snackBar"
-
-function Login(props) {
- const { config, setComputer } = props
- const [show, setShow] = useState(false)
- const [success, setSuccess] = useState(false)
- const [message, setMessage] = useState("")
- // Clear the local storage
- localStorage.removeItem("BIP_39_KEY")
- localStorage.removeItem("CHAIN")
-
- const navigate = useNavigate()
- const [password, setPassword] = useState("")
- const [chain] = useState("LTC")
-
- const login = () => {
- if (!password) {
- setMessage("Please provide valid password")
- setSuccess(false)
- setShow(true)
- return
- }
- localStorage.setItem("BIP_39_KEY", password)
- localStorage.setItem("CHAIN", chain)
- const computer = new Computer({
- ...config,
- mnemonic: localStorage.getItem("BIP_39_KEY"),
- })
- setComputer(computer)
- navigate(`/`)
- }
-
- return (
-
-
-
-
-
-
- Litecoin Art
-
-
-
-
- Don&apost forget to write down your seed.
-
- {/*link to generate BIP39 Seed*/}
-
-
- Generate BIP39 Seed
-
-
- {/*the input field for password*/}
-
setPassword(e.target.value)}
- />
- {/*dropdown to select the crypto*/}
- {/*
{
- setChain(e.target.value)
- }}
- id="chain"
- className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
- >
- LTC
- */}
-
- {/*login button*/}
-
-
- Log In
-
-
-
- {show && (
-
- )}
-
- )
-}
-
-export default Login
diff --git a/packages/TBC721-app/src/auth/login-new.js b/packages/TBC721-app/src/auth/login-new.js
deleted file mode 100644
index b88d5c1a7..000000000
--- a/packages/TBC721-app/src/auth/login-new.js
+++ /dev/null
@@ -1,137 +0,0 @@
-import React, { useState } from "react"
-import { Computer } from "@bitcoin-computer/lib"
-import SnackBar from "../components/util/snackBar"
-
-function LoginNew(props) {
- const { config, setComputer, showLogin, setShowLogin } = props
- const [show, setShow] = useState(false)
- const [success, setSuccess] = useState(false)
- const [message, setMessage] = useState("")
-
- // Clear the local storage
- localStorage.removeItem("BIP_39_KEY")
- localStorage.removeItem("CHAIN")
-
- // const navigate = useNavigate();
- const [password, setPassword] = useState("")
- const [chain, setChain] = useState("LTC")
-
- const closeModal = () => {
- setShowLogin(false)
- }
-
- const login = () => {
- if (!password) {
- setMessage("Please provide valid password")
- setSuccess(false)
- setShow(true)
- return
- }
- localStorage.setItem("BIP_39_KEY", password)
- localStorage.setItem("CHAIN", chain)
- console.log({
- ...config,
- chain: chain,
- mnemonic: localStorage.getItem("BIP_39_KEY"),
- })
- const computer = new Computer({
- ...config,
- chain: chain,
- mnemonic: localStorage.getItem("BIP_39_KEY"),
- })
- setComputer(computer)
- setShowLogin(false)
- }
-
- return (
- <>
- {showLogin && (
-
-
-
-
-
- Litecoin ART
-
-
-
-
-
- Close modal
-
-
-
-
-
Don&apost forget to write down your seed.
- {/*link to generate BIP39 Seed*/}
-
-
- Generate BIP39 Seed
-
-
- {/*the input field for password*/}
-
setPassword(e.target.value)}
- />
- {/*dropdown to select the crypto*/}
-
{
- setChain(e.target.value)
- }}
- id="chain"
- className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
- >
- LTC
- BTC
-
-
- {/*login button*/}
-
-
- Log In
-
-
-
-
-
-
- )}
- {show && }
- >
- )
-}
-
-export default LoginNew
diff --git a/packages/TBC721-app/src/brc.js b/packages/TBC721-app/src/brc.js
deleted file mode 100644
index 406ada6c7..000000000
--- a/packages/TBC721-app/src/brc.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import React, { useState } from "react";
-import { TBC721 } from "./tbc721";
-
-function BRCTest(props) {
- const { computer } = props;
- const [tbc721] = useState(new TBC721(computer));
- const [balace, setBalance] = useState(0);
-
- const mint = async () => {
- await tbc721.mint(computer.getPublicKey(), "Vivek", "VIV");
- setBalance(await tbc721.balanceOf(computer.getPublicKey()));
- };
-
- return (
-
-
balance: {balace}
-
mint()}>mint
-
- );
-}
-
-export default BRCTest;
diff --git a/packages/TBC721-app/src/brc721.js b/packages/TBC721-app/src/brc721.js
deleted file mode 100644
index 513d3e171..000000000
--- a/packages/TBC721-app/src/brc721.js
+++ /dev/null
@@ -1,44 +0,0 @@
-import { NFT } from "./nft";
-
-export class TBC721 {
- computer;
- masterNFT;
-
- constructor(computer) {
- this.computer = computer;
- }
-
- async mint(to, name, symbol) {
- if (!this.masterNFT && name && symbol) {
- this.masterNFT = this.computer.new(NFT, [to, name, symbol]);
- return this.masterNFT;
- }
- if (this.masterNFT.name !== name || this.masterNFT.symbol !== symbol) {
- throw new Error("Name or symbol mismatch when minting token.");
- }
- return this.masterNFT.mint(to);
- }
-
- async balanceOf(publicKey) {
- const revs = await this.computer.queryRevs({ publicKey, contract: NFT });
- const objects = await Promise.all(
- revs.map((rev) => this.computer.sync(rev))
- );
- objects.flatMap((object) =>
- object._root === this.masterNFT._root ? [object] : []
- );
- return objects.length;
- }
-
- async ownerOf(tokenId) {
- const rev = await this.computer.idToRev(tokenId);
- const obj = await this.computer.sync(rev);
- return obj._owners;
- }
-
- async transfer(to, tokenId) {
- const [rev] = await this.computer.getLatestRevs([tokenId]);
- const obj = await this.computer.sync(rev);
- await obj.transfer(to);
- }
-}
diff --git a/packages/TBC721-app/src/common/RequireAuth.js b/packages/TBC721-app/src/common/RequireAuth.js
deleted file mode 100644
index 0cf5fa158..000000000
--- a/packages/TBC721-app/src/common/RequireAuth.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import { Navigate, Outlet } from "react-router-dom";
-
-function getAuth() {
- return localStorage.getItem("BIP_39_KEY");
-}
-
-export function RequireAuth({ children, redirectTo }) {
- let isAuthenticated = getAuth();
- return isAuthenticated ? : ;
-}
diff --git a/packages/TBC721-app/src/component/artworks/allArtworks.js b/packages/TBC721-app/src/component/artworks/allArtworks.js
deleted file mode 100644
index bbd2d321c..000000000
--- a/packages/TBC721-app/src/component/artworks/allArtworks.js
+++ /dev/null
@@ -1,95 +0,0 @@
-import React, { useState, useEffect } from "react"
-import Loader from "../util/loader"
-import Artworks from "./artworks"
-import { useNavigate, useParams } from "react-router-dom"
-
-function AllArtworks({ computer, nftMod }) {
- const navigate = useNavigate()
- let params = useParams()
- const [publicKey] = useState(params.publicKey)
- const [artworks, setArtworks] = useState([])
- const [loading, setLoading] = useState(true)
- const [title, setTitle] = useState("")
-
- const [pageNum, setPageNum] = useState(0)
- const [isNextAvailable, setIsNextAvailable] = useState(true)
- const [isPrevAvailable, setIsPrevAvailable] = useState(pageNum > 0)
-
- const artsPerPage = 4
-
- useEffect(() => {
- const fetch = async () => {
- // todo: investigate why this is evaluated twice
- try {
- const myPage = computer && publicKey === computer.getPublicKey()
- if(myPage) setTitle("My Art")
- if(!myPage && publicKey) setTitle("Art Found")
- if(!myPage && !publicKey) setTitle("All Art")
-
- setLoading(true)
- if (computer) {
- const revs = await computer.query({
- mod: nftMod,
- ...publicKey ? { publicKey } : {},
- limit: artsPerPage + 1,
- offset: pageNum * artsPerPage,
- })
- setArtworks(await Promise.all(revs.map((rev) => computer.sync(rev))))
- }
- } catch (error) {
- console.log(error)
- } finally {
- setLoading(false)
- }
- }
- fetch()
- }, [])
-
- const handleNext = async () => {
- setPageNum(pageNum + 1)
- }
-
- const handlePrev = async () => {
- setIsNextAvailable(true)
- setPageNum(pageNum - 1)
- }
-
- return (
-
-
-
-
-
-
{title}
-
-
-
-
-
- Prev
-
-
-
-
- Next
-
-
-
-
-
- {loading ?
:
}
-
-
-
- )
-}
-
-export default AllArtworks
diff --git a/packages/TBC721-app/src/component/artworks/artwork.js b/packages/TBC721-app/src/component/artworks/artwork.js
deleted file mode 100644
index a103729ce..000000000
--- a/packages/TBC721-app/src/component/artworks/artwork.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// eslint-disable-next-line no-undef
-export default class Artwork extends Contract {
- constructor(title, artist, url) {
- super({ title, artist, url})
- }
-
- setOwner(owner) {
- this._owners = [owner]
- }
-}
diff --git a/packages/TBC721-app/src/component/artworks/artworkDetails.js b/packages/TBC721-app/src/component/artworks/artworkDetails.js
deleted file mode 100644
index c5a9e7012..000000000
--- a/packages/TBC721-app/src/component/artworks/artworkDetails.js
+++ /dev/null
@@ -1,141 +0,0 @@
-import React, { useState, useEffect } from "react"
-import { useNavigate, useParams } from "react-router-dom"
-import Loader from "../util/loader"
-import { Computer } from "@bitcoin-computer/lib"
-
-function ArtworkDetails({ computer, nftModSpec, paymentModSpec, offerModSpec }) {
- const navigate = useNavigate()
- let params = useParams()
- const [artwork, setArtwork] = useState({})
- const [txnId] = useState(params.txnId)
- const [outNum] = useState(params.outNum)
- const [message, setMessage] = useState("")
- const [loading, setLoading] = useState(true)
- const [amount, setAmount] = useState(0.1)
-
- useEffect(() => {
- (async () => {
- if (computer) {
- try {
- const artwork = await computer.sync(`${txnId}/${outNum}`)
- console.log('Synced to artwork')
- setArtwork(artwork)
- setLoading(false)
- } catch (error) {
- console.log(error)
- }
- }
- })()
- }, [])
-
- const handleSubmit = async (e) => {
- e.preventDefault()
- const target = await computer.sync(artwork._rev)
-
- console.log(`Creating the payment`)
- // broadcast the payment
- const paymentTx = await computer.encode({
- exp: `new Payment('${artwork._owners[0]}', ${amount*1e8})`, mod: paymentModSpec })
- await computer.fund(paymentTx)
- await computer.sign(paymentTx)
- const paymentTxId = await computer.broadcast(paymentTx)
- const payment = await computer.sync(`${paymentTxId}/0`)
- console.log('Created payment', payment)
-
- // build the swap transaction
- const txB = await computer.encodeCall({
- target,
- property: "sell",
- args: [payment]
- })
- await computer.fund(txB)
- await computer.sign(txB)
- console.log('Partially signed swap tx', txB)
-
- // build the offer transaction
- const txJsonB = txB.toObject(true);
- const txStringB = JSON.stringify(txJsonB);
- const txOfferB = await computer.encode({ exp: `new Offer('${txStringB}', '${artwork._owners[0]}', 'https://rltc.node.bitcoincomputer.io')`, mod: offerModSpec })
-
-
- for(let tries = 0; tries < 3; tries++) {
- try {
- await computer.fund(txOfferB, { exclude: await computer.getUtxos(txB) });
- break
- } catch (error) {
- // prepare the utxo set
- await computer.send(70000, computer.getAddress())
- console.log(`Retrying funding the offer transaction...`)
- }
- }
-
- await computer.sign(txOfferB);
- const offerTxId = await computer.broadcast(txOfferB);
- console.log('broadcasted offer', offerTxId)
- const offer = await computer.sync(`${offerTxId}/0`);
- console.log('Sent offer', offer)
- };
-
- return (
-
-
-
-
- {txnId}/{outNum}
-
-
- {artwork.title}
-
-
-
-
- {loading ?
:
}
-
-
-
-
Artist
-
- {artwork.artist}
-
- {/*
- Make an Offer
-
-
*/}
-
-
-
-
-
- )
-}
-
-export default ArtworkDetails
diff --git a/packages/TBC721-app/src/component/artworks/artworkForm.js b/packages/TBC721-app/src/component/artworks/artworkForm.js
deleted file mode 100644
index 8eb3520b9..000000000
--- a/packages/TBC721-app/src/component/artworks/artworkForm.js
+++ /dev/null
@@ -1,156 +0,0 @@
-import React, { useState } from "react";
-import Artwork from "./artwork";
-import { useNavigate } from "react-router-dom";
-import SnackBar from "../util/snackBar";
-import Loader from "../util/loader";
-
-function ArtworkForm(props) {
- const navigate = useNavigate();
- const { computer } = props;
- const [title, setTitle] = useState("");
- const [artist, setArtist] = useState("");
- const [url, setUrl] = useState("");
- const [disabled, setDisabled] = useState(false);
- const [show, setShow] = useState(false);
- const [success, setSuccess] = useState(false);
- const [message, setMessage] = useState("");
- const [loading, setLoading] = useState(false);
-
- const handleSubmit = async (evt) => {
- evt.preventDefault();
- try {
- setDisabled(true);
- if (!title) {
- setMessage("Provide valid title.");
- setSuccess(false);
- setShow(true);
- return;
- }
- if (!artist) {
- setMessage("Provide valid artist.");
- setSuccess(false);
- setShow(true);
- return;
- }
- if (!url) {
- setMessage("Provide valid url.");
- setSuccess(false);
- setShow(true);
- return;
- }
- setLoading(true);
- await computer.new(Artwork, [title, artist, url]);
-
- setMessage("NFT minted.");
- setSuccess(true);
- setShow(true);
- setTimeout(() => {
- setLoading(false);
- navigate("/");
- }, 2000);
- } catch (err) {
- setLoading(false);
- setDisabled(false);
- setMessage(err.message);
- setSuccess(false);
- setShow(true);
- }
- };
-
- return (
-
-
-
-
-
-
Create a new artwork
-
-
-
-
- {!url && (
-
- )}
- {url &&
}
-
-
-
-
-
- {show && (
-
- )}
- {loading &&
}
-
- );
-}
-
-export default ArtworkForm;
diff --git a/packages/TBC721-app/src/component/artworks/artworks.js b/packages/TBC721-app/src/component/artworks/artworks.js
deleted file mode 100644
index 03650bf21..000000000
--- a/packages/TBC721-app/src/component/artworks/artworks.js
+++ /dev/null
@@ -1,16 +0,0 @@
-import React from "react"
-import Card from "./card"
-
-function Artworks({ artworks }) {
- return (
-
-
- {artworks.map((artwork, index) => (
-
- ))}
-
-
- )
-}
-
-export default Artworks
diff --git a/packages/TBC721-app/src/component/artworks/card.css b/packages/TBC721-app/src/component/artworks/card.css
deleted file mode 100644
index 10cf5d331..000000000
--- a/packages/TBC721-app/src/component/artworks/card.css
+++ /dev/null
@@ -1,13 +0,0 @@
-.card {
- box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
- width: 200px;
- margin: 0 20px 40px;
-}
-
-.container {
- padding: 0 10px 10px;
-}
-
-.card > img {
- width: 200px;
-}
diff --git a/packages/TBC721-app/src/component/artworks/card.js b/packages/TBC721-app/src/component/artworks/card.js
deleted file mode 100644
index b9451aa5b..000000000
--- a/packages/TBC721-app/src/component/artworks/card.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import React, { useState } from "react"
-import { useNavigate } from "react-router-dom"
-
-function ArtworkCard({ artwork, rev }) {
- const [revId] = useState(rev)
- const navigate = useNavigate()
-
- const openArtPage = (evt) => {
- evt.preventDefault()
- navigate(`/art/${revId}`)
- }
-
- if(!artwork) return <>>
- return (
-
-
-
-
-
-
-
{artwork.title}
-
{artwork.artist}
-
-
-
)
-}
-
-export default ArtworkCard
diff --git a/packages/TBC721-app/src/component/artworks/mint.js b/packages/TBC721-app/src/component/artworks/mint.js
deleted file mode 100644
index ec9a19e14..000000000
--- a/packages/TBC721-app/src/component/artworks/mint.js
+++ /dev/null
@@ -1,142 +0,0 @@
-import React, { useState } from "react"
-import { useNavigate } from "react-router-dom"
-import Loader from "../util/loader"
-
-function Mint({ computer, nftModSpec }) {
- const navigate = useNavigate()
- const [title, setTitle] = useState("Apes in the Orange Grove")
- const [artist, setArtist] = useState("Henri Rousseau")
- const [url, setUrl] = useState(
- "https://uploads1.wikiart.org/images/henri-rousseau/apes-in-the-orange-grove.jpg!Large.jpg"
- )
- const [royalty, setRoyalty] = useState(0.1)
-
- const handleMissing = (s) => {
- console.log(`Provide valid ${s}.`)
- return
- }
-
- const handleSubmit = async (evt) => {
- evt.preventDefault()
- try {
- if (!title) return handleMissing("title")
- if (!artist) return handleMissing("artist")
- if (!url) return handleMissing("url")
-
- const creator = computer.getPublicKey()
- const exp = `new NFT('${title}', '${artist}', '${url}', '${creator}', ${royalty})`
- const { tx } = await computer.encode({ exp, mod: nftModSpec})
- const txId = await computer.broadcast(tx)
- const nft = await computer.sync(`${txId}/0`)
- console.log('Minted NFT: ', nft)
- navigate(`/${computer.getPublicKey()}`)
- } catch (err) {
- console.log(err)
- }
- }
-
- return (
-
-
-
-
-
-
- {url &&
}
-
-
-
-
-
-
- )
-}
-
-export default Mint
diff --git a/packages/TBC721-app/src/component/navbar/navbar.js b/packages/TBC721-app/src/component/navbar/navbar.js
deleted file mode 100644
index ff3cc897c..000000000
--- a/packages/TBC721-app/src/component/navbar/navbar.js
+++ /dev/null
@@ -1,170 +0,0 @@
-import { NavLink, useNavigate } from "react-router-dom"
-import { useState, useEffect } from "react"
-
-export default function Navbar({ setIsOpen, computer }) {
- const [publicKeyInput, setPublicKeyInput] = useState("")
- const navigate = useNavigate()
- const logout = () => {
- localStorage.removeItem("BIP_39_KEY")
- localStorage.removeItem("CHAIN")
- setPublicKeyInput("")
- setLoggedIn(false)
- setIsOpen(false)
- navigate("/auth/login")
- }
- const [loggedIn, setLoggedIn] = useState(localStorage.getItem("BIP_39_KEY") !== null)
- const [logInPage, setLogInPage] = useState(false)
-
- useEffect(() => {
- setLoggedIn(localStorage.getItem("BIP_39_KEY") !== null)
- if (window.location.pathname === "/auth/login") {
- setLogInPage(true)
- } else {
- setLogInPage(false)
- }
- }, [loggedIn, computer])
-
- const search = (event) => {
- var code = event.keyCode || event.which
- if (code === 13) {
- navigate(`/${publicKeyInput}`)
- window.location.reload()
- }
- }
- const myArts = () => {
- setPublicKeyInput("")
- }
- return (
-
-
-
-
-
-
- {!logInPage && (
-
-
-
-
setPublicKeyInput(e.target.value)}
- onKeyDown={(e) => search(e)}
- />
-
-
- )}
- {loggedIn && (
- <>
-
-
- My Art
-
-
-
- setPublicKeyInput("")}
- >
- Mint
-
-
-
- setPublicKeyInput("")}
- >
- Payments
-
-
-
- setPublicKeyInput("")}
- >
- Offers
-
-
-
- setPublicKeyInput("")}
- >
- Royalties
-
-
-
- { setIsOpen(true) }}
- className="block py-2 pr-4 text-gray-700 rounded hover:text-gray-900 cursor-pointer"
- >
- Wallet
-
-
-
-
- Log Out
-
-
- >
- )}
- {!loggedIn && !logInPage && (
-
- {
- setLogInPage(true)
- navigate("/auth/login")
- }}
- type="button"
- className="block py-2 pr-4 text-gray-700 rounded hover:text-gray-900 cursor-pointer"
- >
- Log In
-
-
- )}
-
-
-
-
-
- )
-}
diff --git a/packages/TBC721-app/src/component/navbar/navbarWrapper.js b/packages/TBC721-app/src/component/navbar/navbarWrapper.js
deleted file mode 100644
index ec01b91ee..000000000
--- a/packages/TBC721-app/src/component/navbar/navbarWrapper.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import { useState } from "react"
-import Navbar from "./navbar"
-import Wallet from "../wallet"
-
-export default function NavbarWrapper({ computer }) {
- const [loggedIn] = useState(localStorage.getItem("BIP_39_KEY") !== null)
- const [isOpen, setIsOpen] = useState(false && loggedIn)
-
- return (
-
-
-
-
- )
-}
diff --git a/packages/TBC721-app/src/component/offers.js b/packages/TBC721-app/src/component/offers.js
deleted file mode 100644
index 8228682a0..000000000
--- a/packages/TBC721-app/src/component/offers.js
+++ /dev/null
@@ -1,76 +0,0 @@
-import React, { useState, useEffect } from "react"
-import { useNavigate } from 'react-router-dom'
-// import { Bitcore } from 'litecore-lib'
-
-function Payments({ computer, offerModSpec }) {
- const navigate = useNavigate()
- const [offers, setOffers] = useState([])
-
- useEffect(() => {
- if (!computer) navigate('/')
-
- console.log('offerModSpec in offer', offerModSpec)
-
- const fetch = async () => {
- const revs = await computer.query({
- mod: offerModSpec,
- publicKey: computer.getPublicKey()
- })
- setOffers(await Promise.all(revs.map(rev => computer.sync(rev))))
- }
- fetch()
- }, [navigate])
-
- useEffect(() => console.log('Offers', offers), [offers])
-
- const handleAccept = (offer) =>
- async (evt) => {
- evt.preventDefault()
-
- const txA = await computer.txFromJSON({ json: JSON.parse(offer.tx) })
-
- // computer.sign(txA)
- const txId2 = await computer.broadcast(txA)
-
- console.log('Accepted offer', txId2)
- }
-
- return (
-
-
Offers
-
-
-
-
- Artwork
-
-
- Amount
-
- Action
-
-
-
- {offers.map(offer => {
- return (
-
-
- Todo
-
-
- {offer._amount/1e8}
-
-
- accept
-
-
- )
- })}
-
-
-
-
-)
-}
-
-export default Payments
diff --git a/packages/TBC721-app/src/component/payments.js b/packages/TBC721-app/src/component/payments.js
deleted file mode 100644
index 41cce5476..000000000
--- a/packages/TBC721-app/src/component/payments.js
+++ /dev/null
@@ -1,59 +0,0 @@
-import React, { useState, useEffect } from "react"
-import { useNavigate } from 'react-router-dom'
-
-function Payments({ computer, paymentModSpec }) {
- const navigate = useNavigate()
- const [payments, setPayments] = useState([])
-
- useEffect(() => {
- if (!computer) navigate('/')
-
- console.log('paymentModSpec in payment', paymentModSpec)
-
- const fetch = async () => {
- const revs = await computer.query({
- mod: paymentModSpec,
- publicKey: computer.getPublicKey()
- })
- setPayments(await Promise.all(revs.map(rev => computer.sync(rev))))
- }
- fetch()
- }, [navigate])
-
- useEffect(() => console.log('Payments', payments), [payments])
-
- return (
-
-
Payments
-
-
-
-
- Artwork
-
-
- Amount
-
-
-
-
- {payments.map(payment => {
- return (
-
-
- Todo
-
-
- {payment._amount/1e8}
-
-
- )
- })}
-
-
-
-
-)
-}
-
-export default Payments
diff --git a/packages/TBC721-app/src/component/royalties.js b/packages/TBC721-app/src/component/royalties.js
deleted file mode 100644
index 9788f576b..000000000
--- a/packages/TBC721-app/src/component/royalties.js
+++ /dev/null
@@ -1,57 +0,0 @@
-import React, { useState, useEffect } from "react"
-import { useNavigate } from 'react-router-dom'
-
-function Royalties({ computer, royaltyModSpec }) {
- const navigate = useNavigate()
- const [royalties, setRoyalties] = useState([])
-
- useEffect(() => {
- if (!computer) navigate('/')
-
- const fetch = async () => {
- const revs = await computer.query({
- mod: royaltyModSpec,
- publicKey: computer.getPublicKey()
- })
- setRoyalties(await Promise.all(revs.map(rev => computer.sync(rev))))
- }
- fetch()
- }, [navigate])
-
- useEffect(() => console.log('Royalties', royalties), [royalties])
-
- return (
-
-
Royalties
-
-
-
-
- Artwork
-
-
- Amount
-
-
-
-
- {royalties.map(royalty => {
- return (
-
-
- Todo
-
-
- {royalty._amount/1e8}
-
-
- )
- })}
-
-
-
-
-)
-}
-
-export default Royalties
diff --git a/packages/TBC721-app/src/component/util/loader.js b/packages/TBC721-app/src/component/util/loader.js
deleted file mode 100644
index 5cca8e7ff..000000000
--- a/packages/TBC721-app/src/component/util/loader.js
+++ /dev/null
@@ -1,24 +0,0 @@
-function Loader() {
- return (
-
- )
-}
-
-export default Loader
diff --git a/packages/TBC721-app/src/component/util/snackBar.js b/packages/TBC721-app/src/component/util/snackBar.js
deleted file mode 100644
index 36d742198..000000000
--- a/packages/TBC721-app/src/component/util/snackBar.js
+++ /dev/null
@@ -1,46 +0,0 @@
-function SnackBar(props) {
- const { message, success, setShow, callback } = props
-
- const closeMessage = (evt) => {
- evt.preventDefault()
- setShow(false)
- }
-
- setTimeout(async () => {
- setShow(false)
- if (callback) callback()
- }, 4000)
-
- return (
-
-
{message}
-
-
- Close
-
-
-
-
- )
-}
-
-export default SnackBar
diff --git a/packages/TBC721-app/src/component/util/util.js b/packages/TBC721-app/src/component/util/util.js
deleted file mode 100644
index 51c50fd78..000000000
--- a/packages/TBC721-app/src/component/util/util.js
+++ /dev/null
@@ -1,30 +0,0 @@
-// contain same elements
-export function areEqual(oldRevs, newRevs) {
- let n = oldRevs.length;
- let m = newRevs.length;
-
- if (n !== m) return false;
-
- let map = new Map();
- let count = 0;
- for (let i = 0; i < n; i++) {
- if (!map.get(oldRevs[i])) {
- map.set(oldRevs[i], 1);
- } else {
- count = map.get(oldRevs[i]);
- count++;
- map.set(oldRevs[i], count);
- }
- }
- for (let i = 0; i < n; i++) {
- if (!map.has(newRevs[i])) return false;
-
- if (map.get(newRevs[i]) === 0) return false;
-
- count = map.get(newRevs[i]);
- --count;
- map.set(newRevs[i], count);
- }
-
- return true;
-}
diff --git a/packages/TBC721-app/src/component/wallet.js b/packages/TBC721-app/src/component/wallet.js
deleted file mode 100644
index c76b805af..000000000
--- a/packages/TBC721-app/src/component/wallet.js
+++ /dev/null
@@ -1,100 +0,0 @@
-import React, { useEffect, useState } from "react"
-import { GrClose, GrRefresh } from "react-icons/gr"
-import { FaCopy } from "react-icons/fa"
-
-export default function Wallet({ computer, isOpen, setIsOpen }) {
- const [message, setMessage] = useState("")
- const [balance, setBalance] = useState(0)
-
- useEffect(() => {
- (async () => {
- await refreshBalance()
- })()
- }, [])
-
- const refreshBalance = async () => {
- try {
- if (computer) setBalance(await computer.getBalance())
- } catch (err) {
- console.log(err)
- console.log("error occurred while fetching wallet details: ", err)
- }
- }
-
- const copyAddress = () => {
- navigator.clipboard.writeText(computer.getAddress().toString())
- }
-
- const copyKey = () => {
- navigator.clipboard.writeText(computer.getPublicKey().toString())
- }
- return (
-
-
-
-
- { setIsOpen(false) }}
- className="justify-end text-2xl mt-4 mr-4 hover:text-slate-500 cursor-pointer"
- >
-
-
-
- Balance
-
-
-
- {balance / 1e8}
- LTC
-
-
-
-
-
-
- Address
-
- {computer ? computer.getAddress() : ''}
-
- {/* */}
-
-
-
- Public Key
-
- {computer ? computer.getPublicKey() : ''}
-
- {/* */}
-
-
-
- {
- setIsOpen(false)
- }}
- >
-
- )
-}
diff --git a/packages/TBC721-app/src/component/wallet/wallet.js b/packages/TBC721-app/src/component/wallet/wallet.js
deleted file mode 100644
index 163536d3a..000000000
--- a/packages/TBC721-app/src/component/wallet/wallet.js
+++ /dev/null
@@ -1,134 +0,0 @@
-import React, { useEffect, useState } from "react";
-import { GrClose, GrRefresh } from "react-icons/gr";
-import SnackBar from "../util/snackBar";
-import { FaCopy } from "react-icons/fa";
-
-export default function Wallet({ computer, isOpen, setIsOpen }) {
- const [show, setShow] = useState(false);
- const [success, setSuccess] = useState(false);
- const [message, setMessage] = useState("");
- const [balance, setBalance] = useState(0);
-
- useEffect(() => {
- (async () => {
- await refreshBalance();
- })();
-
- // eslint-disable-next-line
- }, [computer]);
-
- const refreshBalance = async () => {
- try {
- if (computer) {
- const newBalance = await computer.getBalance();
- console.log("new balance: ", newBalance);
- console.log("public key: ", computer.getPublicKey());
- setBalance(newBalance);
- }
- } catch (err) {
- setSuccess(false);
- setMessage(err.message);
- setShow(true);
- console.log("error occurred while fetching wallet details: ", err);
- }
- };
-
- const copyAddress = () => {
- navigator.clipboard.writeText(computer.getAddress().toString());
- setSuccess(true);
- setMessage("Copied");
- setShow(true);
- };
-
- const copyKey = () => {
- navigator.clipboard.writeText(computer.getPublicKey().toString());
- setSuccess(true);
- setMessage("Copied");
- setShow(true);
- };
- return (
-
-
-
-
-
Wallet
- {
- setIsOpen(false);
- }}
- className="float-right text-2xl mt-4 mr-4 hover:text-slate-500 cursor-pointer"
- >
-
-
-
- Total Balance
-
-
-
- {balance / 1e8}
-
- LTC
-
-
-
-
-
-
- Address :
-
-
- {computer.getAddress().toString().substring(0, 16) +
- "..." +
- computer.getAddress().toString().slice(-8)}
-
-
-
-
-
-
-
- Public Key :
-
-
- {computer.getPublicKey().toString().substring(0, 20) +
- "..." +
- computer.getPublicKey().toString().slice(-8)}
-
-
-
-
-
-
- {
- setIsOpen(false);
- }}
- >
- {show && (
-
- )}
-
- );
-}
diff --git a/packages/TBC721-app/src/component/wallet/walletInfo.js b/packages/TBC721-app/src/component/wallet/walletInfo.js
deleted file mode 100644
index 7a23deb26..000000000
--- a/packages/TBC721-app/src/component/wallet/walletInfo.js
+++ /dev/null
@@ -1,85 +0,0 @@
-import React, { useState, useEffect } from "react";
-import { FaCopy } from "react-icons/fa";
-import SnackBar from "../util/snackBar";
-
-function WalletInfo(props) {
- const { computer } = props;
- const [balance, setBalance] = useState(0);
-
- const [show, setShow] = useState(false);
- const [success, setSuccess] = useState(false);
- const [message, setMessage] = useState("");
-
- useEffect(() => {
- (async () => {
- try {
- if (computer) {
- const newBalance = await computer.getBalance();
- console.log("new balance: ", newBalance);
- console.log("public key: ", computer.getPublicKey());
- setBalance(newBalance);
- }
- } catch (err) {
- console.log("error occurred while fetching wallet details: ", err);
- }
- })();
-
- // eslint-disable-next-line
- }, [computer]);
-
- const copyAddress = () => {
- navigator.clipboard.writeText(computer.getAddress().toString());
- setSuccess(true);
- setMessage("Copied");
- setShow(true);
- };
-
- const copyKey = () => {
- navigator.clipboard.writeText(computer.getPublicKey().toString());
- setSuccess(true);
- setMessage("Copied");
- setShow(true);
- };
-
- return (
-
-
-
Wallet
-
-
Address
-
-
{computer.getAddress().toString()}
-
-
-
-
-
Public Key
-
-
{computer.getPublicKey().toString()}
-
-
-
-
-
Balance
-
-
- {balance / 1e8}
- {" LTC"}
-
-
-
-
- {show && (
-
- )}
-
- );
-}
-
-export default WalletInfo;
diff --git a/packages/TBC721-app/src/components/navbar/navbar.js b/packages/TBC721-app/src/components/navbar/navbar.js
deleted file mode 100644
index cb720c8b7..000000000
--- a/packages/TBC721-app/src/components/navbar/navbar.js
+++ /dev/null
@@ -1,170 +0,0 @@
-import { NavLink, useNavigate } from "react-router-dom"
-import { useState, useEffect } from "react"
-
-export default function Navbar({ setIsOpen, computer }) {
- const [publicKeyInput, setPublicKeyInput] = useState("")
- const navigate = useNavigate()
- const logout = () => {
- localStorage.removeItem("BIP_39_KEY")
- localStorage.removeItem("CHAIN")
- setPublicKeyInput("")
- setLoggedIn(false)
- setIsOpen(false)
- navigate("/auth/login")
- }
- const [loggedIn, setLoggedIn] = useState(localStorage.getItem("BIP_39_KEY") !== null)
- const [logInPage, setLogInPage] = useState(false)
-
- useEffect(() => {
- setLoggedIn(localStorage.getItem("BIP_39_KEY") !== null)
- if (window.location.pathname === "/auth/login") {
- setLogInPage(true)
- } else {
- setLogInPage(false)
- }
- }, [loggedIn, computer])
-
- const search = (event) => {
- var code = event.keyCode || event.which
- if (code === 13) {
- navigate(`/${publicKeyInput}`)
- window.location.reload()
- }
- }
- const myArts = () => {
- setPublicKeyInput("")
- }
- return (
-
-
-
-
-
-
- {!logInPage && (
-
-
-
-
setPublicKeyInput(e.target.value)}
- onKeyDown={(e) => search(e)}
- />
-
-
- )}
- {loggedIn && (
- <>
-
-
- My NFTs
-
-
-
- setPublicKeyInput("")}
- >
- Mint
-
-
-
- setPublicKeyInput("")}
- >
- Payments
-
-
-
- setPublicKeyInput("")}
- >
- Offers
-
-
-
- setPublicKeyInput("")}
- >
- Royalties
-
-
-
- { setIsOpen(true) }}
- className="block py-2 pr-4 text-gray-700 rounded hover:text-gray-900 cursor-pointer"
- >
- Wallet
-
-
-
-
- Log Out
-
-
- >
- )}
- {!loggedIn && !logInPage && (
-
- {
- setLogInPage(true)
- navigate("/auth/login")
- }}
- type="button"
- className="block py-2 pr-4 text-gray-700 rounded hover:text-gray-900 cursor-pointer"
- >
- Log In
-
-
- )}
-
-
-
-
-
- )
-}
diff --git a/packages/TBC721-app/src/components/navbar/navbarNew.js b/packages/TBC721-app/src/components/navbar/navbarNew.js
deleted file mode 100644
index 38b800edf..000000000
--- a/packages/TBC721-app/src/components/navbar/navbarNew.js
+++ /dev/null
@@ -1,236 +0,0 @@
-import { useEffect, useState } from "react"
-import { NavLink, useNavigate } from "react-router-dom"
-
-export default function NavbarNew({ setIsOpen, computer, setShowLogin }) {
- const [publicKeyInput, setPublicKeyInput] = useState("")
- const [showNavBar, setShowNavBar] = useState(true)
- const [dropDownHidden, setDropDownHidden] = useState(true)
-
- const navigate = useNavigate()
-
- const logout = () => {
- localStorage.removeItem("BIP_39_KEY")
- localStorage.removeItem("CHAIN")
- setPublicKeyInput("")
- setLoggedIn(false)
- setIsOpen(false)
- window.location.reload()
- }
- const [loggedIn, setLoggedIn] = useState(localStorage.getItem("BIP_39_KEY") !== null)
-
- useEffect(() => {
- setLoggedIn(localStorage.getItem("BIP_39_KEY") !== null)
- }, [loggedIn, computer])
-
- const search = (event) => {
- var code = event.keyCode || event.which
- if (code === 13) {
- navigate('/nfts', { search: new URLSearchParams({ publicKey: publicKeyInput }).toString() });
- window.location.reload()
- }
- }
-
- const openMenu = (evt) => {
- evt.preventDefault()
- setShowNavBar(!showNavBar)
- }
-
- const openDrowdown = (evt) => {
- evt.preventDefault()
- setDropDownHidden(!dropDownHidden)
- }
-
- return (
-
-
-
-
-
-
- <>
-
-
-
setPublicKeyInput(e.target.value)}
- onKeyDown={(e) => search(e)}
- />
-
-
- Open menu
-
-
-
-
- >
-
-
-
-
- setPublicKeyInput("")}
- >
- Mint
-
-
- setDropDownHidden(false)}
- onMouseLeave={() => setDropDownHidden(true)}
- >
-
- Mine
-
-
-
-
-
-
-
-
- Nfts
-
-
-
- setPublicKeyInput("")}
- >
- Offers Sent
-
-
-
- setPublicKeyInput("")}
- >
- Offers Received
-
-
-
- setPublicKeyInput("")}
- >
- Royalties
-
-
-
- {
- if (loggedIn) {
- logout()
- } else {
- setShowLogin(true)
- }
- }}
- >
- {loggedIn ? "Log Out" : "Log In"}
-
-
-
-
-
-
-
- {
- setIsOpen(true)
- }}
- className="block py-2 pl-3 pr-4 text-gray-700 rounded md:bg-transparent hover:text-gray-900 cursor-pointer md:p-0 dark:text-white"
- >
- Wallet
-
-
- {/*
- {
- if (loggedIn) {
- logout();
- } else {
- setShowLogin(true);
- }
- }}
- type="button"
- className="block py-2 pl-3 pr-4 text-gray-700 rounded md:bg-transparent hover:text-gray-900 cursor-pointer md:p-0 dark:text-white"
- >
- {loggedIn ? "Log Out" : "Log In"}
-
- */}
-
-
-
-
- )
-}
diff --git a/packages/TBC721-app/src/components/navbar/navbarWrapper.js b/packages/TBC721-app/src/components/navbar/navbarWrapper.js
deleted file mode 100644
index 7897a3a57..000000000
--- a/packages/TBC721-app/src/components/navbar/navbarWrapper.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import { useState } from "react"
-import Wallet from "../wallet"
-import NavbarNew from "./navbarNew"
-import LoginNew from "../../auth/login-new"
-
-export default function NavbarWrapper({ computer, config, setComputer }) {
- const [loggedIn] = useState(localStorage.getItem("BIP_39_KEY") !== null)
- const [isOpen, setIsOpen] = useState(false && loggedIn)
- const [showLogin, setShowLogin] = useState(false)
-
- return (
-
-
-
- {showLogin && (
-
- )}
-
- )
-}
diff --git a/packages/TBC721-app/src/components/nfts/mintNft.js b/packages/TBC721-app/src/components/nfts/mintNft.js
deleted file mode 100644
index cea0552b8..000000000
--- a/packages/TBC721-app/src/components/nfts/mintNft.js
+++ /dev/null
@@ -1,141 +0,0 @@
-import React, { useState } from "react"
-import { useNavigate } from "react-router-dom"
-
-function Mint({ computer, nftModSpec }) {
- const navigate = useNavigate()
- const [title, setTitle] = useState("Apes in the Orange Grove")
- const [artist, setArtist] = useState("Henri Rousseau")
- const [url, setUrl] = useState(
- "https://uploads1.wikiart.org/images/henri-rousseau/apes-in-the-orange-grove.jpg!Large.jpg"
- )
- const [royalty, setRoyalty] = useState(0.1)
-
- const handleMissing = (s) => {
- console.log(`Provide valid ${s}.`)
- return
- }
-
- const mintNft = async (evt) => {
- evt.preventDefault()
- try {
- if (!title) return handleMissing("title")
- if (!artist) return handleMissing("artist")
- if (!url) return handleMissing("url")
-
- const creator = computer.getPublicKey()
- const exp = `new NFT('${title}', '${artist}', '${url}', '${creator}', ${royalty})`
- const { tx } = await computer.encode({ exp, mod: nftModSpec })
- const txId = await computer.broadcast(tx)
- const nft = await computer.sync(`${txId}:0`)
- console.log("Minted NFT: ", nft)
- navigate(`../../nfts?${new URLSearchParams({ publicKey: computer.getPublicKey() }).toString()}`)
- } catch (err) {
- console.log(err)
- }
- }
-
- return (
-
-
-
-
-
-
- {url &&
}
-
-
-
-
-
-
- )
-}
-
-export default Mint
diff --git a/packages/TBC721-app/src/components/nfts/nft.js b/packages/TBC721-app/src/components/nfts/nft.js
deleted file mode 100644
index be24c8298..000000000
--- a/packages/TBC721-app/src/components/nfts/nft.js
+++ /dev/null
@@ -1,85 +0,0 @@
-import React, { useState, useEffect } from "react";
-import { useNavigate, useParams } from "react-router-dom";
-import Loader from "../util/loader";
-import { Computer } from "@bitcoin-computer/lib";
-import MakeOffer from '../offers/makeOffer'
-
-function Nft({
- computer,
- nftModSpec,
- paymentModSpec,
- offerModSpec,
-}) {
- const navigate = useNavigate();
- let params = useParams();
- const [nft, setNft] = useState(null);
- const [rev] = useState(params.rev);
- const [message, setMessage] = useState("");
- const [loading, setLoading] = useState(true);
-
- useEffect(() => {
- ;(async () => {
- if (computer) {
- try {
- const nft = await computer.sync(rev)
- console.log("Synced to nft", nft)
- setNft(nft)
- setLoading(false)
- } catch (error) {
- console.log(error)
- }
- }
- })()
- }, [computer, rev])
-
- const Title = () => {
- if (!nft)
- return
- return {nft?.title}
- }
-
- const Artist = () => {
- if (!nft)
- return
- return {nft?.artist}
- }
-
- const Rev = () => ({rev})
-
- return (
-
-
-
-
-
- {!nft ? (
-
- ) : (
-
- )}
-
- {/*
*/}
-
-
-
- )
-}
-
-export default Nft
diff --git a/packages/TBC721-app/src/components/nfts/nftCard.js b/packages/TBC721-app/src/components/nfts/nftCard.js
deleted file mode 100644
index 40fe162b3..000000000
--- a/packages/TBC721-app/src/components/nfts/nftCard.js
+++ /dev/null
@@ -1,34 +0,0 @@
-import React, { useState, useEffect } from "react"
-import { Link } from 'react-router-dom';
-
-function NftCard({ rev, computer }) {
- const [nft, setNft] = useState(null)
-
- // Fetch the nft
- useEffect(() => {
- const fetch = async () => {
- setNft(await computer.sync(rev))
- }
- fetch()
- }, [])
-
- const Image = () => {
- if (!nft)
- return ()
- return ( )
- }
-
- return (
-
-
-
-
{nft ? nft.title : 'Validating...'}
-
{nft ? nft.artist : 'Validating...'}
-
-
- )
-}
-
-export default NftCard
diff --git a/packages/TBC721-app/src/components/nfts/nfts.js b/packages/TBC721-app/src/components/nfts/nfts.js
deleted file mode 100644
index b475afb0d..000000000
--- a/packages/TBC721-app/src/components/nfts/nfts.js
+++ /dev/null
@@ -1,101 +0,0 @@
-import React, { useState, useEffect } from "react"
-import Loader from "../util/loader"
-import NftCard from "./nftCard"
-import { useLocation } from "react-router-dom"
-
-
-function Nfts({ computer, nftMod }) {
- const location = useLocation()
- const searchParams = new URLSearchParams(location.search)
- const publicKey = searchParams.get('publicKey')
- const nftsPerPage = 4
-
- const [revs, setRevs] = useState(null)
- const [pageNum, setPageNum] = useState(0)
- const [isNextAvailable, setIsNextAvailable] = useState(true)
- const [isPrevAvailable] = useState(pageNum > 0)
-
- useEffect(() => {
- const fetch = async () => {
- try {
- if (computer) {
- setRevs(await computer.query({
- mod: nftMod,
- ...(publicKey ? { publicKey } : {}),
- offset: nftsPerPage * pageNum,
- limit: nftsPerPage + 1,
- }))
- }
- } catch (error) {
- console.log(error)
- }
- }
- fetch()
- }, [])
-
- const handleNext = async () => {
- setPageNum(pageNum + 1)
- }
-
- const handlePrev = async () => {
- setIsNextAvailable(true)
- setPageNum(pageNum - 1)
- }
-
- const Title = () => {
- if(!publicKey) return (<>>)
- return (
- User {publicKey}
-
)
- }
-
- const NftGrid = ({ computer }) => {
- if (!revs) return
- if (revs.length === 0) return (
-
-
-
Click mint to create the first NFT
-
-
- )
- return (
-
- {revs.map((rev) => (
-
- ))}
-
-
- )
- }
-
- const Pagination = () => (
-
-
-
- Prev
-
-
-
-
- Next
-
-
-
- )
-
- return (<>
-
-
-
- >)
-}
-
-export default Nfts
diff --git a/packages/TBC721-app/src/components/offers/makeOffer.js b/packages/TBC721-app/src/components/offers/makeOffer.js
deleted file mode 100644
index 092b5e766..000000000
--- a/packages/TBC721-app/src/components/offers/makeOffer.js
+++ /dev/null
@@ -1,84 +0,0 @@
-import React, { useState } from "react"
-import Button from "../util/button"
-
-function MakeOffer({
- computer,
- nft,
- paymentModSpec,
- offerModSpec,
-}) {
- const [amount, setAmount] = useState(0.1)
-
- const handleSubmit = async (e) => {
- e.preventDefault()
- await computer.send(amount * 1e8, computer.getAddress())
- // Create a payment owned by buyer
- const paymentTx = await computer.encode({
- exp: `new Payment('${computer.getPublicKey()}', ${amount * 1e8}, '${nft._rev}')`,
- mod: paymentModSpec
- })
- await computer.fund(paymentTx)
- await computer.sign(paymentTx)
- const paymentTxId = await computer.broadcast(paymentTx)
- const payment = await computer.sync(`${paymentTxId}:0`)
- console.log('Created payment', payment)
-
- // Build the swap transaction
- const swapTx = await computer.encodeCall({
- target: nft,
- property: 'sell',
- args: [payment]
- })
-
- await computer.fund(swapTx)
- computer.sign(swapTx)
- console.log('Partially signed swap tx', swapTx)
-
- // Build the offer transaction to send swap transaction to seller
- const swapTxJson = swapTx.toObject(true)
- const swapTxString = JSON.stringify(swapTxJson)
- const offerTx = await computer.encode({
- exp: `new Offer('${nft.title}', ${amount * 1e8}, '${nft._owners[0]}', '${swapTxString}')`,
- mod: offerModSpec
- })
- const exclude = await computer.getUtxos(swapTx)
- await computer.fund(offerTx, { exclude })
- await computer.sign(offerTx)
- const offerTxId = await computer.broadcast(offerTx)
- const offer = await computer.sync(`${offerTxId}:0`)
- console.log('Sent offer', offer)
- }
-
- return (<>
-
- Make an Offer
-
-
- >)
-}
-
-export default MakeOffer
diff --git a/packages/TBC721-app/src/components/offers/offer.js b/packages/TBC721-app/src/components/offers/offer.js
deleted file mode 100644
index 31329d99b..000000000
--- a/packages/TBC721-app/src/components/offers/offer.js
+++ /dev/null
@@ -1,195 +0,0 @@
-import React, { useState, useEffect } from "react"
-import { useParams } from "react-router-dom"
-import Button from "../util/button"
-
-function OfferDetails ({ computer }) {
- let params = useParams()
- const [offerRev] = useState(params.rev)
- const [offerNotFound, setOfferNotFound] = useState(null)
- const [offer, setOffer] = useState(null)
- const [offerDeleted, setOfferDeleted] = useState(null)
- const [offerUnspent, setOfferUnspent] = useState(null)
-
- const [nftRev, setNftRev] = useState('')
- const [nftNotFound, setNftNotFound] = useState(null)
- const [nft, setNft] = useState(null)
- const [nftDeleted, setNftDeleted] = useState(null)
- const [nftUnspent, setNftUnspent] = useState(null)
-
- const [paymentRev, setPaymentRev] = useState('')
- const [paymentNotFound, setPaymentNotFound] = useState(null)
- const [payment, setPayment] = useState(null)
- const [paymentUnspent, setPaymentUnspent] = useState(null)
- const [paymentDeleted, setPaymentDeleted] = useState(null)
-
- const [swapTx, setSwapTx] = useState(null)
-
- // Fetch the offer
- useEffect(() => {
- const fetch = async () => {
- if (!offerRev) return
- try {
- setOffer(await computer.sync(offerRev))
- } catch {
- setOfferNotFound(true)
- }
- }
- fetch()
- }, [])
-
- // Check offer status
- useEffect(() => {
- const fetch = async () => {
- if (!offer?._id) return
- const [rev] = await computer.idsToRevs([offer._id])
- setOfferDeleted(!rev)
- setOfferUnspent(rev === offerRev)
- }
- fetch()
- }, [offer])
-
- // Parse swapTx from offer
- useEffect(() => {
- const fetch = async () => {
- if (!offer?.swapTx) return
- const json = JSON.parse(offer.swapTx)
- setSwapTx(await computer.txFromJSON({ json }))
- }
- fetch()
- }, [offer])
-
- // Decode the swapTx to get the nftRev and paymentRev
- useEffect(() => {
- const fetch = async () => {
- if (!swapTx?.inputs) return
- const { env } = await computer.decode(swapTx)
- const nftRev = env.__bc__
- if (nftRev !== undefined) setNftRev(nftRev)
- const paymentRev = env.__bc0__
- if (paymentRev !== undefined) setPaymentRev(paymentRev)
- }
- fetch()
- }, [swapTx])
-
- // Fetch the nft
- useEffect(() => {
- const fetch = async () => {
- if (!nftRev) return
- try {
- setNft(await computer.sync(nftRev))
- } catch {
- setNftNotFound(true)
- }
- }
- fetch()
- }, [nftRev])
-
- // Check nft status
- useEffect(() => {
- const fetch = async () => {
- if (!nft?._id) return
- const [rev] = await computer.idsToRevs([nft._id])
- setNftDeleted(!rev)
- setNftUnspent(rev === nftRev)
- }
- fetch()
- }, [nft, nftRev])
-
- // Fetch the payment
- useEffect(() => {
- const fetch = async () => {
- if (!paymentRev) return
- try {
- setPayment(await computer.sync(paymentRev))
- } catch {
- setPaymentNotFound(true)
- }
- }
- fetch()
- }, [paymentRev])
-
- // Check payment status
- useEffect(() => {
- const fetch = async () => {
- if (!payment?._id) return
- const [rev] = await computer.idsToRevs([payment._id])
- setPaymentDeleted(!rev)
- setPaymentUnspent(rev === paymentRev)
- }
- fetch()
- }, [payment, paymentRev])
-
- const handleAcceptOffer = async (evt) => {
- evt.preventDefault()
- try {
- computer.sign(swapTx)
- const offerTxId = await computer.broadcast(swapTx)
- console.log('Accepted offer', offerTxId)
- } catch (e) {
- console.log('Error accepting offer', e.message)
- } finally {
- window.location.reload()
- }
- }
-
- const handleDeleteOffer = async (evt) => {
- evt.preventDefault()
- try {
- const txId = await computer.delete([offerRev])
- console.log('Deleted offer', txId)
- } catch (e) {
- console.log('Error deleting offer', e.message)
- } finally {
- window.location.reload()
- }
- }
-
- const validating = [offer, offerDeleted, offerUnspent,
- nft, nftDeleted, nftUnspent,
- payment, paymentDeleted, paymentUnspent].includes(null)
-
- const getStatus = () => {
- if (validating) return 'Validating...'
-
- if (offerNotFound) return 'Offer not found'
- if (offerDeleted) return 'Offer deleted by seller'
- if (!offerUnspent) return 'Offer withdrawn by seller'
-
- if (paymentNotFound) return 'Payment not found'
- if (paymentDeleted) return 'Offer deleted by buyer'
- if (!paymentUnspent) return 'Offer withdrawn by buyer'
-
- if (nftNotFound) return 'Nft not found'
- if (nftDeleted) return 'Rejected by seller'
- if (!nftUnspent) return 'Rejected by seller'
-
- return 'Active'
- }
-
- if(offerNotFound) return (
-
Offer not found
- )
-
- return (
-
Offer Received
-
-
-
NFT
- {nft?.title ? nft.title : 'Validating...'}
-
-
-
Amount
- {payment?._amount ? payment._amount/1e8 : 'Validating...'}
-
-
-
Status
- {getStatus()}
-
-
-
-
{getStatus() === 'Active' ? 'Reject' : 'Delete'}
-
Accept
-
)
-}
-
-export default OfferDetails
diff --git a/packages/TBC721-app/src/components/offers/offerRow.js b/packages/TBC721-app/src/components/offers/offerRow.js
deleted file mode 100644
index e0f459466..000000000
--- a/packages/TBC721-app/src/components/offers/offerRow.js
+++ /dev/null
@@ -1,53 +0,0 @@
-import React, { useState, useEffect } from "react"
-import { Link } from 'react-router-dom';
-
-function OfferRow({ computer, offerRev }) {
- const [offer, setOffer] = useState({})
- const [swapTx, setSwapTx] = useState({})
- const [nftRev, setNftRev] = useState('Loading')
-
- // Fetch the offer
- useEffect(() => {
- const fetch = async () => {
- setOffer(await computer.sync(offerRev))
- }
- fetch()
- }, [])
-
- // Parse swapTx from offer
- useEffect(() => {
- const fetch = async () => {
- if(!offer?.swapTx) return
- const swapTxJson = JSON.parse(offer.swapTx)
- setSwapTx(await computer.txFromJSON({ json: swapTxJson }))
- }
- fetch()
- }, [offer])
-
- // Decode the swapTx to get the nftRev
- useEffect(() => {
- const fetch = async () => {
- if(!swapTx?.inputs) return
- const { env } = await computer.decode(swapTx)
- const nftRev = env.__bc__
- if (nftRev !== undefined) setNftRev(nftRev)
- }
- fetch()
- }, [swapTx])
-
-return (<>
-
-
- {offer.title}
-
-
- {String(offer.amount / 1e8)}
-
-
- show
-
-
- >)
-}
-
-export default OfferRow
diff --git a/packages/TBC721-app/src/components/offers/offers.js b/packages/TBC721-app/src/components/offers/offers.js
deleted file mode 100644
index cf152e41e..000000000
--- a/packages/TBC721-app/src/components/offers/offers.js
+++ /dev/null
@@ -1,45 +0,0 @@
-import { off } from "process"
-import React, { useState, useEffect } from "react"
-import { useNavigate } from 'react-router-dom'
-import OfferRow from "./offerRow"
-
-function Payments({ computer, offerModSpec }) {
- const navigate = useNavigate()
- const [offerRevs, setOfferRevs] = useState([])
-
- useEffect(() => {
- if (!computer) navigate('/')
- const fetch = async () => {
- const mod = offerModSpec
- const publicKey = computer.getPublicKey()
- setOfferRevs(await computer.query({ mod, publicKey }))
- }
- fetch()
- }, [navigate, computer, offerModSpec])
-
- return (
-
-
Offers Received
-
-
-
-
- NFT
-
-
- Amount
-
-
- Details
-
-
-
-
- {offerRevs.map(offerRev => )}
-
-
-
-)
-}
-
-export default Payments
diff --git a/packages/TBC721-app/src/components/payments.js b/packages/TBC721-app/src/components/payments.js
deleted file mode 100644
index 39a1bb9d0..000000000
--- a/packages/TBC721-app/src/components/payments.js
+++ /dev/null
@@ -1,64 +0,0 @@
-import React, { useState, useEffect } from "react"
-import { useNavigate } from "react-router-dom"
-
-function Payments({ computer, paymentModSpec }) {
- const navigate = useNavigate()
- const [payments, setPayments] = useState([])
-
- useEffect(() => {
- if (!computer) {
- navigate("/")
- } else {
- console.log("paymentModSpec in payment", paymentModSpec)
-
- const fetch = async () => {
- const revs = await computer.query({
- mod: paymentModSpec,
- publicKey: computer.getPublicKey(),
- })
- setPayments(await Promise.all(revs.map((rev) => computer.sync(rev))))
- }
- fetch()
- }
- }, [navigate, computer, paymentModSpec])
-
- useEffect(() => console.log("Payments", payments), [payments])
-
- return (
-
-
Payments
-
-
-
-
- NFT
-
-
- Amount
-
-
-
-
- {payments.map((payment) => {
- return (
-
-
- Todo
-
- {payment._amount / 1e8}
-
- )
- })}
-
-
-
- )
-}
-
-export default Payments
diff --git a/packages/TBC721-app/src/components/payments/payment.js b/packages/TBC721-app/src/components/payments/payment.js
deleted file mode 100644
index 534857be3..000000000
--- a/packages/TBC721-app/src/components/payments/payment.js
+++ /dev/null
@@ -1,99 +0,0 @@
-import React, { useState, useEffect } from "react"
-import { useParams } from "react-router-dom"
-import Button from "../util/button"
-
-function Payment({ computer }) {
- let params = useParams()
- const [paymentRev] = useState(params.rev)
- const [paymentNotFound, setPaymentNotFound] = useState(null)
- const [payment, setPayment] = useState(null)
- const [paymentDeleted, setPaymentDeleted] = useState(null)
- const [paymentUnspent, setPaymentUnspent] = useState(null)
-
- // Fetch the payment
- useEffect(() => {
- const fetch = async () => {
- if (!paymentRev) return
- try {
- setPayment(await computer.sync(paymentRev))
- } catch {
- setPaymentNotFound(true)
- }
- }
- fetch()
- }, [])
-
- // Check payment status
- useEffect(() => {
- const fetch = async () => {
- if (!payment?._id) return
- const [rev] = await computer.idsToRevs([payment._id])
- setPaymentDeleted(!rev)
- setPaymentUnspent(rev === paymentRev)
- }
- fetch()
- }, [payment])
-
- const handleAcceptPayment = async (evt) => {
- // evt.preventDefault()
- // try {
- // computer.sign(swapTx)
- // const offerTxId = await computer.broadcast(swapTx)
- // console.log('Accepted offer', offerTxId)
- // } catch (e) {
- // console.log('Error accepting offer', e.message)
- // } finally {
- // window.location.reload()
- // }
- }
-
- const handleDeletePayment = async (evt) => {
- // evt.preventDefault()
- // try {
- // const txId = await computer.delete([offerRev])
- // console.log('Deleted offer', txId)
- // } catch (e) {
- // console.log('Error deleting offer', e.message)
- // } finally {
- // window.location.reload()
- // }
- }
-
- const getStatus = () => {
- // if (validating) return 'Validating...'
-
- if (paymentNotFound) return 'Payment not found'
- if (paymentDeleted) return 'Offer deleted by buyer'
- if (!paymentUnspent) return 'Offer withdrawn by buyer'
-
- return 'Active'
- }
-
- const handleWithdraw = async (e) => {
- e.preventDefault()
- const txId = await computer.delete([paymentRev])
- console.log('Withdrawn to address', computer.getPublicKey(), 'tx id', txId)
- }
-
- if (paymentNotFound) return (
-
Payment not found
- )
-
- return (
-
Offer Sent
-
-
-
Amount
- {payment ? payment._amount / 1e8 : 'Validating...'}
-
-
-
Nft Rev
- {payment ? payment.nftRev : 'Validating...'}
-
-
-
-
Withdraw
-
)
-}
-
-export default Payment
diff --git a/packages/TBC721-app/src/components/payments/paymentRow.js b/packages/TBC721-app/src/components/payments/paymentRow.js
deleted file mode 100644
index f182b978e..000000000
--- a/packages/TBC721-app/src/components/payments/paymentRow.js
+++ /dev/null
@@ -1,45 +0,0 @@
-import React, { useState, useEffect } from "react"
-import { Link } from 'react-router-dom';
-
-function PaymentRow({ computer, paymentRev }) {
- const [payment, setPayment] = useState(null)
- const [nft, setNft] = useState(null)
-
- // Fetch the payment
- useEffect(() => {
- const fetch = async () => {
- setPayment(await computer.sync(paymentRev))
- }
- fetch()
- }, [])
-
- useEffect(() => {
- if(!payment) return
- const fetch = async () => {
- setNft(await computer.sync(payment.nftRev))
- }
- fetch()
- }, [payment])
-
- const NftTitle = () => {
- if(!nft && !payment) return Loading...
- if(!nft && payment) return Loading...
- return {nft.title}
- }
-
- return (<>
-
-
-
-
-
- {payment ? payment._amount / 1e8 : 'Loading...'}
-
-
- show
-
-
- >)
-}
-
-export default PaymentRow
diff --git a/packages/TBC721-app/src/components/payments/payments.js b/packages/TBC721-app/src/components/payments/payments.js
deleted file mode 100644
index b72d64794..000000000
--- a/packages/TBC721-app/src/components/payments/payments.js
+++ /dev/null
@@ -1,48 +0,0 @@
-import React, { useState, useEffect } from "react"
-import { useNavigate } from "react-router-dom"
-import PaymentRow from "./paymentRow"
-
-function Payments({ computer, paymentModSpec }) {
- const navigate = useNavigate()
- const [payments, setPayments] = useState([])
- const [paymentRevs, setPaymentRevs] = useState([])
-
- useEffect(() => {
- if (!computer) navigate("/")
-
- const fetch = async () => {
- const mod = paymentModSpec
- const publicKey = computer.getPublicKey()
- setPaymentRevs(await computer.query({ mod, publicKey }))
- }
- fetch()
- }, [navigate, computer, paymentModSpec])
-
- useEffect(() => console.log("Payments", payments), [payments])
-
- return (
-
-
Offers Sent
-
-
-
-
- NFT
-
-
- Amount
-
-
- Details
-
-
-
-
- {paymentRevs.map((paymentRev) => )}
-
-
-
- )
-}
-
-export default Payments
diff --git a/packages/TBC721-app/src/components/royalties.js b/packages/TBC721-app/src/components/royalties.js
deleted file mode 100644
index 7673c0cee..000000000
--- a/packages/TBC721-app/src/components/royalties.js
+++ /dev/null
@@ -1,62 +0,0 @@
-import React, { useState, useEffect } from "react"
-import { useNavigate } from "react-router-dom"
-
-function Royalties({ computer, royaltyModSpec }) {
- const navigate = useNavigate()
- const [royalties, setRoyalties] = useState([])
-
- useEffect(() => {
- if (!computer) {
- navigate("/")
- } else {
- const fetch = async () => {
- const revs = await computer.query({
- mod: royaltyModSpec,
- publicKey: computer.getPublicKey(),
- })
- setRoyalties(await Promise.all(revs.map((rev) => computer.sync(rev))))
- }
- fetch()
- }
- }, [navigate, computer, royaltyModSpec])
-
- useEffect(() => console.log("Royalties", royalties), [royalties])
-
- return (
-
-
Royalties
-
-
-
-
- NFT
-
-
- Amount
-
-
-
-
- {royalties.map((royalty) => {
- return (
-
-
- Todo
-
- {royalty._amount / 1e8}
-
- )
- })}
-
-
-
- )
-}
-
-export default Royalties
diff --git a/packages/TBC721-app/src/components/util/button.js b/packages/TBC721-app/src/components/util/button.js
deleted file mode 100644
index 7c6b73ee9..000000000
--- a/packages/TBC721-app/src/components/util/button.js
+++ /dev/null
@@ -1,24 +0,0 @@
-function Button ({ onClick, disabled, children, color = 'blue' }) {
-
- const ButtonBlue = ({ onClick, disabled, children }) => {
- if (disabled)
- return ({children} )
- return ({children} )
- }
-
- const ButtonWhite = ({ onClick, disabled, children }) => {
- if (disabled)
- return ({children} )
- return ({children} )
- }
-
- if (color === 'blue') {
- return {children}
- } else if (color === 'white') {
- return {children}
- } else {
- throw new Error('Invalid button color')
- }
-}
-
-export default Button
diff --git a/packages/TBC721-app/src/components/util/loader.js b/packages/TBC721-app/src/components/util/loader.js
deleted file mode 100644
index 5cca8e7ff..000000000
--- a/packages/TBC721-app/src/components/util/loader.js
+++ /dev/null
@@ -1,24 +0,0 @@
-function Loader() {
- return (
-
- )
-}
-
-export default Loader
diff --git a/packages/TBC721-app/src/components/util/snackBar.js b/packages/TBC721-app/src/components/util/snackBar.js
deleted file mode 100644
index b1c4e1c46..000000000
--- a/packages/TBC721-app/src/components/util/snackBar.js
+++ /dev/null
@@ -1,41 +0,0 @@
-function SnackBar(props) {
- const { message, success, setShow, callback } = props
-
- const closeMessage = (evt) => {
- evt.preventDefault()
- setShow(false)
- }
-
- setTimeout(async () => {
- setShow(false)
- if (callback) callback()
- }, 4000)
-
- return (
-
-
{message}
-
-
- Close
-
-
-
-
- )
-}
-
-export default SnackBar
diff --git a/packages/TBC721-app/src/components/wallet.js b/packages/TBC721-app/src/components/wallet.js
deleted file mode 100644
index 3a7ec3bf6..000000000
--- a/packages/TBC721-app/src/components/wallet.js
+++ /dev/null
@@ -1,89 +0,0 @@
-import React, { useCallback, useEffect, useState } from "react"
-import { GrClose, GrRefresh } from "react-icons/gr"
-
-export default function Wallet({ computer, isOpen, setIsOpen }) {
- const [balance, setBalance] = useState(0)
-
- const refreshBalance = useCallback(async () => {
- try {
- if (computer) setBalance(await computer.getBalance())
- } catch (err) {
- console.log(err)
- console.log("error occurred while fetching wallet details: ", err)
- }
- }, [computer])
-
- useEffect(() => {
- ;(async () => {
- await refreshBalance()
- })()
- }, [refreshBalance])
-
- return (
-
-
-
-
- {
- setIsOpen(false)
- }}
- className="justify-end text-2xl mt-4 mr-4 hover:text-slate-500 cursor-pointer"
- >
-
-
-
Balance
-
-
- {balance / 1e8}
- LTC
-
-
-
-
-
-
- Address
-
- {computer ? computer.getAddress() : ""}
- {/* */}
-
-
-
- Public Key
-
- {computer ? computer.getPublicKey() : ""}
- {/* */}
-
-
-
- {
- setIsOpen(false)
- }}
- >
-
- )
-}
diff --git a/packages/TBC721-app/src/contracts/nft-contract.mjs b/packages/TBC721-app/src/contracts/nft-contract.mjs
deleted file mode 100644
index 87391490f..000000000
--- a/packages/TBC721-app/src/contracts/nft-contract.mjs
+++ /dev/null
@@ -1,19 +0,0 @@
-export class NFT extends Contract {
- constructor(title, artist, url, creator, royalty) {
- super({ title, artist, url, creator, royalty });
- }
-
- transfer(owner) {
- this._owners = [owner];
- }
-
- sell(payment) {
- const { _owners: tokenOwners } = this;
- const { _owners: paymentOwners } = payment;
- this._owners = paymentOwners;
- payment.transfer(tokenOwners[0]);
-
- // eslint-disable-next-line no-undef
- return new Royalty(this.creator, this.royalty * payment._amount, '');
- }
-}
diff --git a/packages/TBC721-app/src/contracts/nft.mjs b/packages/TBC721-app/src/contracts/nft.mjs
deleted file mode 100644
index 93b38f873..000000000
--- a/packages/TBC721-app/src/contracts/nft.mjs
+++ /dev/null
@@ -1,19 +0,0 @@
-export class NFT extends Contract {
- constructor(title, artist, url, creator, royalty) {
- super({ title, artist, url, creator, royalty });
- }
-
- transfer(owner) {
- this._owners = [owner];
- }
-
- sell(p) {
- const { _owners: ownersToken } = this;
- const { _owners: ownersPayment } = p;
- this._owners = ownersPayment;
- p.transfer(ownersToken);
-
- // eslint-disable-next-line no-undef
- return new Royalty(this.creator, this.royalty * p._amount);
- }
-}
diff --git a/packages/TBC721-app/src/contracts/offer-contract.mjs b/packages/TBC721-app/src/contracts/offer-contract.mjs
deleted file mode 100644
index a340dd495..000000000
--- a/packages/TBC721-app/src/contracts/offer-contract.mjs
+++ /dev/null
@@ -1,11 +0,0 @@
-export class Offer extends Contract {
- constructor(title, amount, recipient, swapTx) {
- super({
- title,
- amount,
- swapTx,
- _owners: [recipient],
- _url: 'http://127.0.0.1:1031'
- })
- }
-}
diff --git a/packages/TBC721-app/src/contracts/offer.mjs b/packages/TBC721-app/src/contracts/offer.mjs
deleted file mode 100644
index 49407336d..000000000
--- a/packages/TBC721-app/src/contracts/offer.mjs
+++ /dev/null
@@ -1,9 +0,0 @@
-export class Offer extends Contract {
- constructor(tx, recipient, url) {
- super({
- tx,
- _owners: [recipient],
- _url: url
- })
- }
-}
diff --git a/packages/TBC721-app/src/contracts/payment-contract.mjs b/packages/TBC721-app/src/contracts/payment-contract.mjs
deleted file mode 100644
index 660cbe210..000000000
--- a/packages/TBC721-app/src/contracts/payment-contract.mjs
+++ /dev/null
@@ -1,13 +0,0 @@
-export class Payment extends Contract {
- constructor(to, amount, nftRev) {
- super({
- _owners: [to],
- _amount: amount,
- nftRev: nftRev
- });
- }
-
- transfer(to) {
- this._owners = [to]
- }
-}
diff --git a/packages/TBC721-app/src/contracts/payment.mjs b/packages/TBC721-app/src/contracts/payment.mjs
deleted file mode 100644
index 3ac76136c..000000000
--- a/packages/TBC721-app/src/contracts/payment.mjs
+++ /dev/null
@@ -1,12 +0,0 @@
-export class Payment extends Contract {
- constructor(to, amount) {
- super({
- _owners: [to],
- _amount: amount,
- });
- }
-
- transfer(to) {
- this._owners = to;
- }
-}
diff --git a/packages/TBC721-app/src/contracts/royalty-contract.mjs b/packages/TBC721-app/src/contracts/royalty-contract.mjs
deleted file mode 100644
index 878a7cb15..000000000
--- a/packages/TBC721-app/src/contracts/royalty-contract.mjs
+++ /dev/null
@@ -1,3 +0,0 @@
-import { Payment } from './payment-contract.mjs'
-
-export class Royalty extends Payment {}
diff --git a/packages/TBC721-app/src/contracts/royalty.mjs b/packages/TBC721-app/src/contracts/royalty.mjs
deleted file mode 100644
index 2ee607676..000000000
--- a/packages/TBC721-app/src/contracts/royalty.mjs
+++ /dev/null
@@ -1 +0,0 @@
-export class Royalty extends Contract {}
diff --git a/packages/TBC721-app/src/index.css b/packages/TBC721-app/src/index.css
deleted file mode 100644
index 9e4b1f18f..000000000
--- a/packages/TBC721-app/src/index.css
+++ /dev/null
@@ -1,17 +0,0 @@
-@tailwind base;
-@tailwind components;
-@tailwind utilities;
-
-body {
- margin: 0;
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
- "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
- sans-serif;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-
-code {
- font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
- monospace;
-}
diff --git a/packages/TBC721-app/src/index.js b/packages/TBC721-app/src/index.js
deleted file mode 100644
index c7b3b931d..000000000
--- a/packages/TBC721-app/src/index.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import React from "react"
-import ReactDOM from "react-dom/client"
-import "./index.css"
-import App from "./App"
-import * as serviceWorker from "./serviceWorker"
-
-const root = ReactDOM.createRoot(document.getElementById("root"))
-
-root.render(
-
-
-
-)
-
-// If you want your app to work offline and load faster, you can change
-// unregister() to register() below. Note this comes with some pitfalls.
-// Learn more about service workers: https://bit.ly/CRA-PWA
-serviceWorker.unregister()
diff --git a/packages/TBC721-app/src/loader.css b/packages/TBC721-app/src/loader.css
deleted file mode 100644
index 796bd5ccf..000000000
--- a/packages/TBC721-app/src/loader.css
+++ /dev/null
@@ -1,44 +0,0 @@
-.loader-wrapper {
- position: absolute;
- height: 100%;
- width: 100%;
- align-content: center;
- background-color: #000;
- color: #fff;
- opacity: .5;
-}
-
-.loader {
- position: absolute;
- top: 45%;
- left: 40%;
- border: 16px solid #f3f3f3;
- border-radius: 50%;
- border-top: 16px solid #3498db;
- width: 120px;
- height: 120px;
- -webkit-animation: spin 2s linear infinite;
- /* Safari */
- animation: spin 2s linear infinite;
-}
-
-/* Safari */
-@-webkit-keyframes spin {
- 0% {
- -webkit-transform: rotate(0deg);
- }
-
- 100% {
- -webkit-transform: rotate(360deg);
- }
-}
-
-@keyframes spin {
- 0% {
- transform: rotate(0deg);
- }
-
- 100% {
- transform: rotate(360deg);
- }
-}
\ No newline at end of file
diff --git a/packages/TBC721-app/src/loader.js b/packages/TBC721-app/src/loader.js
deleted file mode 100644
index a7b59be86..000000000
--- a/packages/TBC721-app/src/loader.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import React from "react";
-import "./loader.css";
-const Loader = () => {
- return (
- // eslint-disable-next-line
-
- );
-};
-
-export default Loader;
diff --git a/packages/TBC721-app/src/serviceWorker.js b/packages/TBC721-app/src/serviceWorker.js
deleted file mode 100644
index f8c7e50c2..000000000
--- a/packages/TBC721-app/src/serviceWorker.js
+++ /dev/null
@@ -1,135 +0,0 @@
-// This optional code is used to register a service worker.
-// register() is not called by default.
-
-// This lets the app load faster on subsequent visits in production, and gives
-// it offline capabilities. However, it also means that developers (and users)
-// will only see deployed updates on subsequent visits to a page, after all the
-// existing tabs open on the page have been closed, since previously cached
-// resources are updated in the background.
-
-// To learn more about the benefits of this model and instructions on how to
-// opt-in, read https://bit.ly/CRA-PWA
-
-const isLocalhost = Boolean(
- window.location.hostname === 'localhost' ||
- // [::1] is the IPv6 localhost address.
- window.location.hostname === '[::1]' ||
- // 127.0.0.1/8 is considered localhost for IPv4.
- window.location.hostname.match(
- /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
- )
-);
-
-export function register(config) {
- if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
- // The URL constructor is available in all browsers that support SW.
- const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
- if (publicUrl.origin !== window.location.origin) {
- // Our service worker won't work if PUBLIC_URL is on a different origin
- // from what our page is served on. This might happen if a CDN is used to
- // serve assets; see https://github.com/facebook/create-react-app/issues/2374
- return;
- }
-
- window.addEventListener('load', () => {
- const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
-
- if (isLocalhost) {
- // This is running on localhost. Let's check if a service worker still exists or not.
- checkValidServiceWorker(swUrl, config);
-
- // Add some additional logging to localhost, pointing developers to the
- // service worker/PWA documentation.
- navigator.serviceWorker.ready.then(() => {
- console.log(
- 'This web app is being served cache-first by a service ' +
- 'worker. To learn more, visit https://bit.ly/CRA-PWA'
- );
- });
- } else {
- // Is not localhost. Just register service worker
- registerValidSW(swUrl, config);
- }
- });
- }
-}
-
-function registerValidSW(swUrl, config) {
- navigator.serviceWorker
- .register(swUrl)
- .then(registration => {
- registration.onupdatefound = () => {
- const installingWorker = registration.installing;
- if (installingWorker == null) {
- return;
- }
- installingWorker.onstatechange = () => {
- if (installingWorker.state === 'installed') {
- if (navigator.serviceWorker.controller) {
- // At this point, the updated precached content has been fetched,
- // but the previous service worker will still serve the older
- // content until all client tabs are closed.
- console.log(
- 'New content is available and will be used when all ' +
- 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
- );
-
- // Execute callback
- if (config && config.onUpdate) {
- config.onUpdate(registration);
- }
- } else {
- // At this point, everything has been precached.
- // It's the perfect time to display a
- // "Content is cached for offline use." message.
- console.log('Content is cached for offline use.');
-
- // Execute callback
- if (config && config.onSuccess) {
- config.onSuccess(registration);
- }
- }
- }
- };
- };
- })
- .catch(error => {
- console.error('Error during service worker registration:', error);
- });
-}
-
-function checkValidServiceWorker(swUrl, config) {
- // Check if the service worker can be found. If it can't reload the page.
- fetch(swUrl)
- .then(response => {
- // Ensure service worker exists, and that we really are getting a JS file.
- const contentType = response.headers.get('content-type');
- if (
- response.status === 404 ||
- (contentType != null && contentType.indexOf('javascript') === -1)
- ) {
- // No service worker found. Probably a different app. Reload the page.
- navigator.serviceWorker.ready.then(registration => {
- registration.unregister().then(() => {
- window.location.reload();
- });
- });
- } else {
- // Service worker found. Proceed as normal.
- registerValidSW(swUrl, config);
- }
- })
- .catch(() => {
- console.log(
- 'No internet connection found. App is running in offline mode.'
- );
- });
-}
-
-export function unregister() {
- if ('serviceWorker' in navigator) {
- navigator.serviceWorker.ready.then(registration => {
- registration.unregister();
- });
- }
-}
diff --git a/packages/TBC721-app/tailwind.config.js b/packages/TBC721-app/tailwind.config.js
deleted file mode 100644
index b6052f9b6..000000000
--- a/packages/TBC721-app/tailwind.config.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/** @type {import('tailwindcss').Config} */
-module.exports = {
- content: ["./src/**/*.{js,jsx,ts,tsx}"],
- theme: {
- extend: {
- height: {
- 100: "26.6rem",
- 120: "40rem",
- },
- width: {
- 100: "26.6rem",
- },
- colors: {
- 'grey1': '#393939',
- 'grey2': '#999999',
- 'grey3': '#d5d5d5',
- 'grey4': '#f1f1f1',
- },
- },
- },
- plugins: [],
-};
diff --git a/packages/docs/downloads.md b/packages/docs/downloads.md
index 9371c75e0..28f8c21f7 100644
--- a/packages/docs/downloads.md
+++ b/packages/docs/downloads.md
@@ -22,8 +22,8 @@ The monorepo contains the following packages
* [Wallet](https://github.com/bitcoin-computer/monorepo/tree/main/packages/wallet#readme) - A non-custodial wallet
* [Blockchain Explorer](https://github.com/bitcoin-computer/monorepo/tree/main/packages/explorer#readme) - A block explorer with smart contract support
* [Chat](https://github.com/bitcoin-computer/monorepo/tree/main/packages/chat#readme) - A p2p chat via Bitcoin and Litecoin
-* [TBC20 App](https://github.com/bitcoin-computer/monorepo/tree/main/packages/TBC20-app#readme) - An app for minting, sending, and storing fungible tokens
-* [TBC721 App](https://github.com/bitcoin-computer/monorepo/tree/main/packages/TBC721-app#readme) - An app for minting, sending, and storing non-fungible tokens
+* [Non Fungible Token App](https://github.com/bitcoin-computer/monorepo/tree/main/packages/ft#readme) - An app for minting, sending, and storing fungible tokens
+* [Fungible Token App](https://github.com/bitcoin-computer/monorepo/tree/main/packages/nft#readme) - An app for minting, sending, and storing non-fungible tokens
## Standard Contracts
* [TBC20 contract](https://github.com/bitcoin-computer/monorepo/tree/main/packages/TBC20#readme) - An implementation of the ERC20 Fungible Token Standard
diff --git a/packages/TBC20-app/.eslintrc b/packages/ft/.eslintrc
similarity index 100%
rename from packages/TBC20-app/.eslintrc
rename to packages/ft/.eslintrc
diff --git a/packages/TBC20-app/.gitignore b/packages/ft/.gitignore
similarity index 100%
rename from packages/TBC20-app/.gitignore
rename to packages/ft/.gitignore
diff --git a/packages/TBC20-app/.prettierrc b/packages/ft/.prettierrc
similarity index 100%
rename from packages/TBC20-app/.prettierrc
rename to packages/ft/.prettierrc
diff --git a/packages/TBC20-app/.vscode/settings.json b/packages/ft/.vscode/settings.json
similarity index 100%
rename from packages/TBC20-app/.vscode/settings.json
rename to packages/ft/.vscode/settings.json
diff --git a/packages/TBC20-app/README.md b/packages/ft/README.md
similarity index 99%
rename from packages/TBC20-app/README.md
rename to packages/ft/README.md
index b0e269483..c70b4c1c9 100644
--- a/packages/TBC20-app/README.md
+++ b/packages/ft/README.md
@@ -45,7 +45,7 @@ Run the command below and open [http://localhost:1032](http://localhost:1032)
```bash
# Move to the package
-cd packages/TBC20-app
+cd packages/ft
# Start the app
npm run start
diff --git a/packages/TBC20-app/package.json b/packages/ft/package.json
similarity index 100%
rename from packages/TBC20-app/package.json
rename to packages/ft/package.json
diff --git a/packages/TBC20-app/public/favicon.ico b/packages/ft/public/favicon.ico
similarity index 100%
rename from packages/TBC20-app/public/favicon.ico
rename to packages/ft/public/favicon.ico
diff --git a/packages/TBC20-app/public/index.html b/packages/ft/public/index.html
similarity index 100%
rename from packages/TBC20-app/public/index.html
rename to packages/ft/public/index.html
diff --git a/packages/TBC20-app/public/logo192.png b/packages/ft/public/logo192.png
similarity index 100%
rename from packages/TBC20-app/public/logo192.png
rename to packages/ft/public/logo192.png
diff --git a/packages/TBC20-app/public/logo512.png b/packages/ft/public/logo512.png
similarity index 100%
rename from packages/TBC20-app/public/logo512.png
rename to packages/ft/public/logo512.png
diff --git a/packages/TBC20-app/public/manifest.json b/packages/ft/public/manifest.json
similarity index 100%
rename from packages/TBC20-app/public/manifest.json
rename to packages/ft/public/manifest.json
diff --git a/packages/TBC20-app/public/robots.txt b/packages/ft/public/robots.txt
similarity index 100%
rename from packages/TBC20-app/public/robots.txt
rename to packages/ft/public/robots.txt
diff --git a/packages/TBC20-app/src/App.test.tsx b/packages/ft/src/App.test.tsx
similarity index 100%
rename from packages/TBC20-app/src/App.test.tsx
rename to packages/ft/src/App.test.tsx
diff --git a/packages/TBC20-app/src/App.tsx b/packages/ft/src/App.tsx
similarity index 100%
rename from packages/TBC20-app/src/App.tsx
rename to packages/ft/src/App.tsx
diff --git a/packages/TBC20-app/src/Card.tsx b/packages/ft/src/Card.tsx
similarity index 100%
rename from packages/TBC20-app/src/Card.tsx
rename to packages/ft/src/Card.tsx
diff --git a/packages/TBC20-app/src/Login.tsx b/packages/ft/src/Login.tsx
similarity index 100%
rename from packages/TBC20-app/src/Login.tsx
rename to packages/ft/src/Login.tsx
diff --git a/packages/TBC20-app/src/MintToken.tsx b/packages/ft/src/MintToken.tsx
similarity index 100%
rename from packages/TBC20-app/src/MintToken.tsx
rename to packages/ft/src/MintToken.tsx
diff --git a/packages/TBC20-app/src/Modal.tsx b/packages/ft/src/Modal.tsx
similarity index 100%
rename from packages/TBC20-app/src/Modal.tsx
rename to packages/ft/src/Modal.tsx
diff --git a/packages/TBC20-app/src/SendToken.tsx b/packages/ft/src/SendToken.tsx
similarity index 100%
rename from packages/TBC20-app/src/SendToken.tsx
rename to packages/ft/src/SendToken.tsx
diff --git a/packages/TBC20-app/src/Wallet.tsx b/packages/ft/src/Wallet.tsx
similarity index 100%
rename from packages/TBC20-app/src/Wallet.tsx
rename to packages/ft/src/Wallet.tsx
diff --git a/packages/TBC20-app/src/bitcoin-computer-lib.d.ts b/packages/ft/src/bitcoin-computer-lib.d.ts
similarity index 100%
rename from packages/TBC20-app/src/bitcoin-computer-lib.d.ts
rename to packages/ft/src/bitcoin-computer-lib.d.ts
diff --git a/packages/TBC20-app/src/global.d.ts b/packages/ft/src/global.d.ts
similarity index 100%
rename from packages/TBC20-app/src/global.d.ts
rename to packages/ft/src/global.d.ts
diff --git a/packages/TBC20-app/src/index.css b/packages/ft/src/index.css
similarity index 100%
rename from packages/TBC20-app/src/index.css
rename to packages/ft/src/index.css
diff --git a/packages/TBC20-app/src/index.tsx b/packages/ft/src/index.tsx
similarity index 100%
rename from packages/TBC20-app/src/index.tsx
rename to packages/ft/src/index.tsx
diff --git a/packages/TBC20-app/src/logo.svg b/packages/ft/src/logo.svg
similarity index 100%
rename from packages/TBC20-app/src/logo.svg
rename to packages/ft/src/logo.svg
diff --git a/packages/TBC20-app/src/react-app-env.d.ts b/packages/ft/src/react-app-env.d.ts
similarity index 100%
rename from packages/TBC20-app/src/react-app-env.d.ts
rename to packages/ft/src/react-app-env.d.ts
diff --git a/packages/TBC20-app/src/serviceWorker.js b/packages/ft/src/serviceWorker.js
similarity index 100%
rename from packages/TBC20-app/src/serviceWorker.js
rename to packages/ft/src/serviceWorker.js
diff --git a/packages/TBC20-app/src/setupTests.tsx b/packages/ft/src/setupTests.tsx
similarity index 100%
rename from packages/TBC20-app/src/setupTests.tsx
rename to packages/ft/src/setupTests.tsx
diff --git a/packages/TBC20-app/src/token-sc.js b/packages/ft/src/token-sc.js
similarity index 100%
rename from packages/TBC20-app/src/token-sc.js
rename to packages/ft/src/token-sc.js
diff --git a/packages/TBC20-app/src/types.tsx b/packages/ft/src/types.tsx
similarity index 100%
rename from packages/TBC20-app/src/types.tsx
rename to packages/ft/src/types.tsx
diff --git a/packages/TBC20-app/src/useInterval.tsx b/packages/ft/src/useInterval.tsx
similarity index 100%
rename from packages/TBC20-app/src/useInterval.tsx
rename to packages/ft/src/useInterval.tsx
diff --git a/packages/TBC20-app/src/utils.tsx b/packages/ft/src/utils.tsx
similarity index 100%
rename from packages/TBC20-app/src/utils.tsx
rename to packages/ft/src/utils.tsx
diff --git a/packages/TBC20-app/tsconfig.json b/packages/ft/tsconfig.json
similarity index 100%
rename from packages/TBC20-app/tsconfig.json
rename to packages/ft/tsconfig.json
diff --git a/packages/website/src/tabs.tsx b/packages/website/src/tabs.tsx
index da7f01ddd..e57628097 100644
--- a/packages/website/src/tabs.tsx
+++ b/packages/website/src/tabs.tsx
@@ -80,7 +80,7 @@ export default function BasicTabs() {
- A keyword property "_owners" is set to a public key. The holder of that public key is the owner of the object in the sense the corresponding private key is required to update the object. To send the NFT to another user, the current owner can reassign the "_owners" property to the new owner's public key. More on Github .
+ A keyword property "_owners" is set to a public key. The holder of that public key is the owner of the object in the sense the corresponding private key is required to update the object. To send the NFT to another user, the current owner can reassign the "_owners" property to the new owner's public key. More on Github .
@@ -98,7 +98,7 @@ export default function BasicTabs() {
- The only function is a "send" function. This function checks that the supply of the token is above the amount to be sent. If so the amount stored in this instance is decreased by "amount". Then a new instance of the token class is created. The owner of the new token is set to the recipient. The full code is available on Github .
+ The only function is a "send" function. This function checks that the supply of the token is above the amount to be sent. If so the amount stored in this instance is decreased by "amount". Then a new instance of the token class is created. The owner of the new token is set to the recipient. The full code is available on Github .