Giter VIP home page Giter VIP logo

rmrk-tools's Introduction

RMRK Tools

Typescript implementation of the RMRK spec.

Usage

TBD

Read VS Write

Some applications (wallets, portfolios, galleries) might need only read functionality, while others will need both read and write (auction houses). Reading happens through the State object which can be populated in different ways. Writing happens though the Polkadot JS API object. Each has to be configured and injected separately, but once injected into the RMRK class' instance, the injections will be inherited by the underlying logic.

You can inject the State and API instances into Collection and NFT objects as well, but note that this is very inefficient as the RMRK class does this for you when building these objects, and also automatically calls the state's refresh function before every write.

State

Because RMRK relies on an append-only log of system remarks (blockchain graffiti), it is absolutely imperative that the current and latest state of all RMRK NFTs in the system is up to date and available to the library before performing any write operations like SEND or BUY.

This is made possible with the State object which defines an interface for fetching the current and past states. Three types of State are supported out of the box:

  • SQLState
  • LiveState
  • StaticState

Helper Tools

Fetch

Grabs all system.remark extrinsics in a block range and logs an array of them all, keyed by block.

Export functionality will be added soon (SQL and file, total and in chunks).

yarn fetch

Optional parameters:

  • --ws URL: websocket URL to connecto to, defaults to 127.0.0.1:9944
  • --from FROM: block from which to start, defaults to 0
  • --to TO: block until which to search, defaults to latest
  • --prefix PREFIX: limit return data to only remarks with this prefix

rmrk-tools's People

Contributors

swader 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.