GithubHelp home page GithubHelp logo

protokol / nft Goto Github PK

View Code? Open in Web Editor NEW
22.0 11.0 4.0 581.36 MB

Digital Assets (NFT) Creation And Exchange Support For Any ARK Core Bridgechain

Home Page: https://www.protokol.com

License: Other

TypeScript 98.28% JavaScript 1.40% Shell 0.17% Dockerfile 0.15%
nft exchange ark core server dapps typescript blockchain-technology trade bridgechain

nft's People

Contributors

amacar avatar kovaczan avatar kristjank avatar lubejmatej avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nft's Issues

feat(core-json-rpc): implement json-rpc-client for Protokol and ARK Support

๐Ÿš€ feature request

Relevant Package

This feature request is for a new package @protokol/core-json-rpc client. The purpose of this package is to add standard json schema based interface with additional support for transaction types developed and maintained by protokol. As some of the core packages are not yet published we will develop the first iteration of this package inside this repo.

Description

TBD: On Hold for NOW

Describe the solution you'd like

If you have a solution in mind, please describe it.

Describe alternatives you've considered

Have you considered any alternative solutions or workarounds?

bug(nft-exchange-api): show auction wallet endpoints not working

๐Ÿž bug report

Affected Package

The issue is caused by package @protokol/nft-exchange-api.

Is this a regression?

No

Description

showAuctionWallet endpoints (bids/auctions) tests are passing but endpoints are not working when running in testnet

๐Ÿ”ฌ Minimal Reproduction

Go to any .../{id}/wallets endpoint

๐Ÿ”ฅ Exception or Error

{
  "statusCode": 404,
  "error": "Not Found",
  "message": "Bid Not Found"
}

or

{
  "statusCode": 404,
  "error": "Not Found",
  "message": "Auction Not Found"
}

๐ŸŒ Your Environment

Package Version:

1.0.0-beta.4

ARK CORE Version:

3.0.0-next.0

Anything else relevant?

bug: quickly sending nft-transfer causes blocks to fail

Scenario:

  • send nft-transfer transaction via generator-api
  • send another nft-transfer transaction (just hit send again in the insomnia) - repeat...

Error

  • why duplicate transaction fails
  • why it is accepted in the pool if it is the same - thinking the error is with new nonce, but same asset - so it fails... we should add more logic to throw if it can not be applied//

Needs more testing also

bug(nft-exchange-api): transform query parameter doen't work in nft-exchange-api endpoints

๐Ÿž bug report

Affected Package

The issue is caused by package @protokol/nft-exchange-api

Is this a regression?

No

Description

When querying for transform false, it doesn't return raw response.
Check all nft-exchange-api responses.

๐Ÿ”ฌ Minimal Reproduction

๐Ÿ”ฅ Exception or Error


http://116.203.193.15:4003/api/nft/exchange/auctions?transform=false

๐ŸŒ Your Environment

Core Version:

1.0.0-beta.3

Anything else relevant?

exchange-transactions: introduce lockBalance

As a trader I am not able to see how much of my tokens are locked for trading purposes, I can only see my reduced balance, but not not the locked part.

Introduce a new wallet attribute to handle lockBalance for the bids open by the user.
nft.exchange.lockBalance

Update tests to show and display correct values. Test should include wallet balance summary tests

nft-exchange: enable multi asset auctions

Currently we can only offer one item per auction.

We want to improve this so that a user can offer multiple assets for auction. The rules of the auction are all or none. Meaning that a bid is valid for all the items in the listed auction.

When bid is accepted - items get transferred to the selected bidder.

bug(nft-exchange-api): trades search by bidId searches by auctionId

๐Ÿž bug report

Affected Package

The issue is caused by package @protokol/nft-exchange-api

Is this a regression?

No

Description

When searching for trades by bidId the endpoint returns results filtered by auctionId.

๐Ÿ”ฌ Minimal Reproduction

Search for trades with any bidId => you get back all the trades

๐Ÿ”ฅ Exception or Error

No error is thrown, but the response is wrong (all trades are returned).

๐ŸŒ Your Environment

Core Version:

1.0.0-beta.3

Anything else relevant?

LockedBalance should be adjusted to the correct value after canceling an auction

๐Ÿž bug report

Affected Package

The issue is caused by package @protokol/nft-exchange-transactions

Is this a regression?

No

Description

LockedBalance is adjusted incorrectly when canceling an auction with bids.

๐Ÿ”ฌ Minimal Reproduction

Make an auction with bids. Then cancel the auction and check lockedBalanced for each bid wallet. It should be decreased to the same value as before making a bid but it is increased instead.

๐ŸŒ Your Environment

Core Version:


1.0.0-beta.3

exchange-api: auction search functionality

๐Ÿš€ feature request

Relevant Package

This feature request is for @protokol/nft-exchange-api to soften the search parameters with nftIds.

Description

Change the search so we can search with options like:

nftIds contains nftIds instead of exact array match.

This change would allow us to return multiple auctions where this item was listed, and not just an exact one.

Last relevant PR on this is #66

Describe the solution you'd like

see above

Describe alternatives you've considered

Have you considered any alternative solutions or workarounds?

docs: update api documentation

๐Ÿ“š Docs bug report

Description

Update documentation to be in line with the API changes from #64

๐Ÿ”ฌ Minimal Reproduction

Mising API response and structure changes.

bug: bid can be canceled by anyone and not just by the issuer

๐Ÿž bug report

Affected Package

The issue is caused by package @protokol/nft-exchange-transactions

Is this a regression?

No

Description

Only the issuer of the bid should be able to cancel his bid, but in current implementation anyone can cancel a bid.

๐Ÿ”ฌ Minimal Reproduction

๐Ÿ”ฅ Exception or Error





๐ŸŒ Your Environment

Core Version:

1.0.0-beta.3

Anything else relevant?

feat(nft-exchange-api): show trades with single query to save some query time

๐Ÿš€ feature request

Relevant Package

This feature request is for @protokol/nft-exchange-api

Description

Show trades currently uses two queries to get auction and bid
https://github.com/protokol/nft-plugins/blob/develop/packages/nft-exchange-api/src/controllers/trades.ts#L40
It could be modified into a single query and filtered inside controller or transformer.
It will also make testing of this method easier
https://github.com/protokol/nft-plugins/blob/develop/packages/nft-exchange-api/__tests__/unit/controllers/trades.test.ts#L88

Describe the solution you'd like

Make a single query for auction and bid and filter inside controller or transformer.

bug(nft-base-api): api call on get all assets when transaction is burned

๐Ÿž bug report

Affected Package

The issue is caused by package @protokol/nft-base-api

Is this a regression?

No

Description

Scenario:

  1. Make a collection
  2. Make an asset
  3. Burn that asset
  4. Make api call on all assets /assets
    It fails because burn transaction removes it from wallet indexer but resource still requires it to search all asset transactions

๐Ÿ”ฌ Minimal Reproduction

๐Ÿ”ฅ Exception or Error


[2020-06-15 07:14:02.784] ERROR: Error: Wallet ad20de6ad3704f736423270406aace230e1401b7932b45eaba68844a86a0d527 doesn't exist in index nftTokenIndexer
    at WalletRepository.findByIndex (/home/zan/ark/nfts/core-nft/packages/core-state/dist/wallets/wallet-repository.js:76:19)
    at AssetResource.transform (/home/zan/ark/nfts/core-nft/protokol/packages/nft-base-api/dist/resources/assets.js:35:51)
    at AssetsController.toResource (/home/zan/ark/nfts/core-nft/packages/core-api/dist/controllers/controller.js:56:45)
    at /home/zan/ark/nfts/core-nft/packages/core-api/dist/controllers/controller.js:61:40
    at Array.map ()
    at AssetsController.toCollection (/home/zan/ark/nfts/core-nft/packages/core-api/dist/controllers/controller.js:61:21)
    at AssetsController.toPagination (/home/zan/ark/nfts/core-nft/packages/core-api/dist/controllers/controller.js:65:27)
    at AssetsController.index (/home/zan/ark/nfts/core-nft/protokol/packages/nft-base-api/dist/controllers/assets.js:29:21)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async exports.Manager.execute (/home/zan/ark/nfts/core-nft/node_modules/@hapi/hapi/lib/toolkit.js:64:28)

๐ŸŒ Your Environment

Core Version:


core-nft commit 5988
nft-base-api version 1.0.0-beta.3

Anything else relevant?

bug(nft-base-transaction): prevent creating an auction without nft items

๐Ÿž bug report

Affected Package

The issue is caused by package @protokol/nft-base-transaction

Is this a regression?

No

Description

It is possible to create an auction with empty nftIds array.

๐Ÿ”ฌ Minimal Reproduction

Construct create-auction transaction with empty nftIds array and broadcast it to network. It will be accepted even though it shouldn't be.

๐ŸŒ Your Environment

Core Version:

1.0.0-beta.3

docs (package.json): add additional information to all packages

๐Ÿ“š Docs bug report

Description

Current package.json are missing some of additional information. Please add additional info section to all

packages (code samples are done on the root level):

Keywords:

 "keywords": [
    "protokol",
    "ark",
    "core",
    "sdk",
    "nft",
    "blockchain"
  ],

Repository information:

  "repository": {
    "type": "git",
    "url": "https://github.com/protokol/nft-plugins.git"
  },

Bugs

  "bugs": {
    "url": "https://github.com/protokol/nft-plugins/issues"
  },

Homepage

  "homepage": "https://docs.protokol.com/nft/",

bug: remove eslintc.json from nft-exchange-transactions and nft-exchange-crypto

๐Ÿž bug report

Affected Package

The issue is caused by package @protokol/nft-exchange-transactions and @protokol/nft-exchange-crypto

Is this a regression?

No

Description

Remove eslintrc.json because it can be used from core.

๐Ÿ”ฌ Minimal Reproduction

๐Ÿ”ฅ Exception or Error





๐ŸŒ Your Environment

Core Version:

1.0.0-beta.3

Anything else relevant?

feat(nft-tx-tester-cli): implement nft-transaction-tester

๐Ÿš€ feature request

Relevant Package

This is a feature request is for a new package called @protokol/nft-tx-tester-cli.

Description

A clear and concise description of the problem or missing capability...

Mirror (fork is not possible due to our repo structure) the existing work from https://github.com/sebastijankuzner/core-tx-tester/tree/develop and add additional functionalities, namely builders that support creating and broadcasting of our transaction types.

This tool will be used as a base to quickly create any of the supported NFT transaction types.

Try to keep our changes in separate files, doing it like this - we can keep changes from upstream easily integrated.

Describe the solution you'd like

Extend the branch https://github.com/sebastijankuzner/core-tx-tester/tree/develop and add all our NFT transaction types:

  • NFTRegisterCollection
  • NFTCreateToken
  • NFTTransfer
  • NFTBurn
  • NFTAuction
  • NFTAuctionCancel
  • NFTBid
  • NFTBidCancel
  • NFTAcceptTrade

Tester already provides some configuration options, and storage of them.

Keep in mind to include a template or default JSONSchema we can use - so we don't have to specify it during the transaction creation process but it takes it from some folder.

Also consider including the faker package https://www.npmjs.com/package/faker - to generate random token attributes when creating tokens. There are some good hero name generators and marvel themed ones also - if we want to pick something for the tests.

Use our @protokol/nft-client to build transaction types and send data to the node server.

Describe alternatives you've considered

Have you considered any alternative solutions or workarounds?

No

base-transactions: add authorizedRegistrators property to RegisterCollection transaction

Add allowed registrator property on the plugin and not on the blockchain level. This is for the intermediate term, as it helps us to centralize who is allowed to register new collections of assets on the blockchain.

{
    "authorizedRegistrators": ["PK1", "PK2",...."PKn"]
}

default value is [] - meaning anyone can send the transaction to the blockchain.

Conditions:

  • if value in [""] - only allow PK in list to sendTransactions
  • if value === [] - anyone can send transaction

Note

This is not an optimal solution, as it can affect the bootstrap process. We will address this in a separate issue.

feat(nft-exchange-api): fetching all auctions/bids return only active ones

๐Ÿš€ feature request

Relevant Package

This feature request is for @protokol/nft-exchange-api

Description

When you fetch all auctions/bids (.../api/nft/exchange/auctions/.../api/nft/exchange/bids) return only active ones.

Describe the solution you'd like

It would be nice to return only active ones when fetching all auctions/bids.

feature: transaction validation in relation to pool logic and order

๐Ÿš€ feature request

Relevant Package

All -transaction packages.

Description

Handle logic of transaction order and which transactions can be accepted into a pool, in relation to:

  • If burn is in pool for a nftId - MUST NOT allow to issue transfer for the same nftID. Display error to user.
  • If burn is in pool for a nftId - MUST NOT allow to open an auction for the same nftId. Display error to user.
  • If a nftId is active in transfer or auction - MUST NOT allow to open a NFT Burn transcation for that specific ID. Display error to user
  • If accept Trade is in active pool - MUST NOT receive new sell offers for the nftId

Describe the solution you'd like

Additional transaction-pool checks for order or keeping one of transaction of X type in pool. Implement logic in throwIfCannotEnterPool.

  • Implement tests for all conditional logic!!!

Describe alternatives you've considered

Have you considered any alternative solutions or workarounds?

base-api: align assets endpoints response

Align or update collections endpoint response.

  • add ownerPK property, so we can immediately browse for owner of nftId id needed. ownerPublicKey points to a wallet owning that NFT ID. Get the ownerPK from walletIndex
  • remove senderPublicKey property as it is not clear in terms of listing assets
  • double check affected endpoints
  • update tests
  • update documentation

feat: implement nft-client package to support API calls

๐Ÿš€ feature request

Implement a new nft-client package to support API calls from base-api and exchange-api

Relevant Package

Define new package @protoko/nft-client

Describe the solution you'd like

Cover the design and functionalities exposed by our api plugins.

  • initial client package implementation
  • setup tests for package functionality e2e
  • setup base tests

feat(test): add additional functional tests

๐Ÿš€ feature request

Relevant Package

This feature request is to add additional functional tests to our packages.
  • @protokol/nft-exchange-transactions
  • @protokol/nft-base-transaction

Description

See the list of tests to add to functional logic. Look at the description below:

Describe the solution you'd like

If you have a solution in mind, please describe it.
  • if item is on auction / cannot issue burn for token
  • bid on your auction / not possible
  • if auction is canceled / not possible to bid on item
  • if auction is canceled / accept trade is not allowed
  • if auction is canceled / bid is not allowed
  • if bid is canceled / cannot accept trade
  • more items in pool / 2x burn transaction in pool test what happens ? // this about doing the same for transfer logic...

Refactor schema saving part

Refactor and address schema saving optimization and how to approach the problem of:

  • saving it in the wallet or global cache
  • remove validation outside
  • cache validated schema so we can just call validate part on the incoming token creation schema

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.