Public docs
WebsiteTAAL PlatformWhatsOnChain
  • Welcome
  • Introduction
    • Get an API Key
  • Core Products
    • WhatsOnChain
      • Health
      • Chain Info
      • Block
      • Transaction
      • Mempool
      • (Un)Spent Transaction Outputs
      • Address
      • Script
      • Exchange Rate
      • Search
      • WoC Widgets
      • WoC Plugins
      • On-Chain Data
      • Output Tags
      • Stats
      • WebSockets
        • WoC Sockets V1 (Deprecated)
        • WoC Sockets V2 (Beta)
      • Tokens
        • 1Sat Ordinals (Beta)
        • BSV-21 (Beta)
        • STAS Tokens (Beta)
      • Change Log
      • Community Libraries
    • Transaction Processing
      • ARC Endpoints
      • Transaction format and fee rate
    • TAAL Wallet
      • Introduction
      • Architecture
      • Terminology
      • UI Elements
      • Tutorial
    • 1Sat Ordinals tokens API
      • Introduction
      • Terminology
      • Flow Diagram
      • Basic Tutorial - Node
      • Basic Tutorial - Postman
      • API
  • Resources
    • FAQ
    • Support
    • Glossary
    • Acronyms and Abbreviations
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Core Products
  2. 1Sat Ordinals tokens API

Basic Tutorial - Node

PreviousFlow DiagramNextBasic Tutorial - Postman

Last updated 11 months ago

Was this helpful?

Github Repository

mkdir 1sat-tutorial

cd 1sat-tutorial

Demo code using our 1Sat Token Studio API can be found on Github so you can clone our repository or if you want to do it manually, we need to make now a node project

npm init

and answer in the questions.

Let’s add the dependencies npm install bsv@1.5.4 npm install axios

Make sure your package.json looks like this (you might need to change the type to “module” and add a new entry to run the tutorial- "tutorial": "node index.js"

{ "name": "1sat-tutorial", "version": "1.0.0", "description": "1sat-tutorial", "type": "module", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "tutorial": "node index.js" }, "author": "TAAL", "license": "ISC", "dependencies": { "dependencies": { "axios": "^1.7.2", "bsv": "^1.5.4" } }

Now we are ready to start coding. Create the main file you specified during the setup e.g. index.jsin the root of the 1sat-tutorial folder as well as the helping file 1sat_utils.cjs using your editor or IDE of choice.

  1. Copy the code from our files and paste.

  2. in index.js you will need to replace the sample API key from your TAAL API Key

  3. You can also tune which steps to run, only the creation of a single/standalone token, the inscription of a collection with one item or individual steps you may want to debug in depth e.g.

    const STEPS_TO_TEST =[ 'single', 'collection']; ///const STEPS_TO_TEST =['1.1','1.2','1.3','1.4','1.5', '1.6', '1.7']; //const STEPS_TO_TEST =['2.1','2.2','2.3','2.4','2.5', '2.6', '2.7', '2.8', '2.9'];

You can test now. If all was properly configured you should see something like this:

Add label

https://github.com/TAAL-GmbH/1sat-tutorial