GithubHelp home page GithubHelp logo

adiwallet's Introduction

AdiWallet - simple NFT wallet

This is a console application that acts as an NFT wallet.

  • You run the app which receives some subset of transactions, and processes them in such a way that enables the program to answer questions about NFT ownership. -The program executes only a single command each time it is run, and will persist state between runs.

Commands the program supports :

  • running transaction batch from a json file
  • running transaction batch inline (single or array of transactions)
  • reset wallet
  • information about a NFT
  • information about a Wallet For more info about the specifications check out the doc here

Domain Schema image

Notes:

  • I have made heavy usage of a functional library Louthy - functional programming library for C# in order to make usage of Railway Programming (shortcircuit the flow at first error)

  • Project structure

    • src:
      • AdiWallet.App - the console application
      • AdiWallet.Services - the place where logic logic resides
      • AdiWallet.Domain - the place where the domain model is placed ( all domain objects)
        • Commands - NftInfo, WalletInfo, Reset, ReadFile , ReadInline
        • Messages - Burn, Mint ,Transfer
        • Domain objects - Wallet , NFT , AppState (this one holds the state of the app and gets flushed to disk at the end of the program)
    • tests
      • AdiWallet.Tests - contains XUnit tests for most of the logic
        • tests for deserializing the messages
        • tests for running one message , a batch of messages
        • tests for the other commands , and testing if the resulting state written on disk is right

Setting up:

  • Windows:
    • dotnet publish -c Release -r win10-x64 -o

Go to the [target-folder] and open a Command Prompt terminal

Run : AdiWallet.App.exe [arguments]

Example of running the program with some commands:

`AdiWallet.App.exe --nft somenft`

`AdiWallet.App.exe --wallet somewallet`

`AdiWallet.App.exe --read-file myfile.json`

`AdiWallet.App.exe --read-inline "{\"Type\": \"Mint\", \"TokenId\": \"ab\", \"Address\": \"adi\"},{\"Type\": \"Transfer\", \"From\": \"adi\",\"To\": \"dan\", \"TokenId\": \"ab\"},{\"Type\": \"Burn\", \"TokenId\": \"ab\"}]"`

`AdiWallet.App.exe reset`

The project contains unit tests which can be run by going in the root directory of the source folder and running :

dotnet test

adiwallet's People

Contributors

sanzor avatar

Watchers

 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.