Giter Site home page Giter Site logo

arthurqiuys / atomicals-js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from libvirgo/atomicals-js

0.0 0.0 0.0 3.44 MB

Atomicals CLI and Javascript Library

Home Page: https://atomicals.xyz

License: MIT License

JavaScript 1.00% TypeScript 98.75% HTML 0.10% Dockerfile 0.15%

atomicals-js's Introduction

Atomicals Javascript Library

atomicals.xyz Documentation: https://docs.atomicals.xyz

Atomicals

WARNING: STRONGLY RECOMMENDED TO USE YARN INSTEAD OF NPM

Use yarn package manager instead of npm. Instructions below (They are: npm install -g yarn)

In the latest version of the CLI processing library the option switches (the settings starting with --) are not processed correctly and it would lead to too small of a fee being set and result in your transactions not being mined.

Workaround: Use yarn instead of npm

Different between Official and this fork

this fork use Rust to calculate psbt, so it's faster than official one to mint-dft.

because of the reason, you should install Rust additional.

and for better use mint-dft in command line, change toaddr and funding to pass by command line arguments,

for example :

yarn run cli mint-dft sophon --url https://ep.nextdao.xyz/proxy --toaddr <address> --funding <WIF> --satsbyte 100
yarn cli mint-dft --help # for more information

Install, Build and Run Tests

Install

# Download the github repo:
git clone --recursive https://github.com/libvirgo/atomicals-js.git

cd atomicals-js

# Build:
# If you don't have yarn & node installed
# npm install -g node
# npm install -g yarn

yarn install
yarn run build

#See all commands at:

yarn run cli --help

Quick Start - Command Line (CLI)

First install packages and build, then follow the steps here to create your first Atomical and query the status. Use yarn clito get a list of all commands available.

0. Environment File (.env)

The environment file comes with defaults (.env.example), but it is highly recommend to install and operate your own ElectrumX server. Web browser communication is possible through the wss (secure websockets) interface of ElectrumX.

ELECTRUMX_WSS=wss://electrumx.atomicals.xyz:50012

// Optional (defaults to wallet.json)
WALLET_PATH=path-to-wallet.json

// The number of concurrent processes to be used. This should not exceed the number of CPU cores available. If not set, the default behavior is to use all available CPU cores minus one.
CONCURRENCY=4

ELECTRUMX_WSS: URL of the ElectrumX with Atomicals support. Note that only wss endpoints are accessible from web browsers.

1. Wallet Setup

The purpose of the wallet is to create p2tr (pay-to-taproot) spend scripts and to receive change from the transactions made for the various operations. Do not put more funds than you can afford to lose, as this is still beta!

To initialize a new wallet.json file that will store your address for receiving change use the wallet-init command. Alternatively, you may populate the wallet.json manually, ensuring that the address at m/44'/0'/0'/0/0 is equal to the address and the derivePath is set correctly.

Configure the path in the environment .env file to point to your wallet file. defaults to ./wallet.json

Default:

WALLET_PATH=.
WALLET_FILE=wallet.json

Update to wallets/ directory:

WALLET_PATH=./wallets
WALLET_FILE=wallet.json

Create the wallet:

yarn cli wallet-init

>>>

Wallet created at wallet.json
phrase: maple maple maple maple maple maple maple maple maple maple maple maple
Legacy address (for change): 1FXL2CJ9nAC...u3e9Evdsa2pKrPhkag
Derive Path: m/44'/0'/0'/0/0
WIF: L5Sa65gNR6QsBjqK.....r6o4YzcqNRnJ1p4a6GPxqQQ
------------------------------------------------------

2. Explore the CLI

yarn cli --help

3. Quick Commands

Get all of the commands available:

yarn cli --help

Read the documentation at https://docs.atomicals.xyz

ElectrumX Server RPC Interface

See updated ElectrumX (https://github.com/atomicals/atomicals-electrumx)

Any questions or ideas?

https://atomicals.xyz

https://x.com/atomicalsxyz (X - Formerly Twitter)

Donate to Atomicals Development

We greatly appreciate any donation to help support Atomicals Protocol development. We worked out of passion and kindness for the world, we believe this technology must exist and be free for all to use. Bitcoin is our one hope for freedom and digital sovereignty and we intend to do our best to make it a reality.

BTC: bc1pa5hvv3w3wjwfktd63zcng6yeccxg9aa90e34n9jrjw3thgc52reqxw6has

Donate to Atomicals Development

atomicals-js's People

Contributors

atomicals avatar alexv525 avatar libvirgo avatar momodaka avatar willxing avatar yixinrock avatar lucky2077 avatar neutronprotocol avatar lucia-w avatar seandong avatar 17y avatar arthurqiuys avatar justindhillon avatar halimao avatar doutv avatar ordinalsnew avatar zzallenn avatar atlaslabsapp avatar goudanwoo avatar eltociear avatar pan3da avatar yosg avatar betta-cyber avatar timqi avatar shuoer86 avatar taofengno1 avatar tongziqi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.