Giter VIP home page Giter VIP logo

paras-marketplace-contract's Introduction

NFT Marketplace Implementation

Instructions

yarn && yarn test:deploy

Pre-reqs

Rust, cargo, near-cli, etc... Everything should work if you have NEAR development env for Rust contracts set up.

Tests Contract

Example Call

Deploy

near deploy --accountId marketplace.test.near

Nft init

near call --accountId marketplace.test.near marketplace.test.near new '{"owner_id":"marketplace.test.near","treasury_id":"treasury.test.near","approved_nft_contract_ids":["comic.test.near"],"paras_nft_contracts":["comic.test.near"],"current_fee":500}'

Set transaction fee (owner only)

near call --accountId marketplace.test.near marketplace.test.near set_transaction_fee '{"next_fee":500,"start_time":1644311100}'

Get transaction fee

near call --accountId marketplace.test.near marketplace.test.near get_transaction_fee

Nft sell (to NFT contract)

near call --accountId alice.test.near comic.test.near nft_approve '{"token_id":"1:10","account_id":"marketplace.test.near","msg":"{\"price\":\"3000000000000000000000000\",\"ft_token_id\":\"near\"}"}' --depositYocto 2610000000000000000000

Delete market data

near call --accountId alice.test.near marketplace.test.near delete_market_data '{"nft_contract_id":"comic.test.near", "token_id":"1:2"}' --depositYocto 1

Update market data

near call --accountId alice.test.near marketplace.test.near update_market_data '{"nft_contract_id":"comic.test.near", "token_id":"1:2", "ft_token_id":"near","price":"5000000000000000000000000"}' --depositYocto 1

Buy

near call --accountId bob.test.near marketplace.test.near buy '{"nft_contract_id":"comic.test.near","token_id":"1:10"}' --depositYocto 3000000000000000000000000 --gas 300000000000000

View

Get market data

near view marketplace.test.near get_market_data '{"nft_contract_id":"comic.test.near","token_id":"1:10"}'

paras-marketplace-contract's People

Contributors

emarai avatar joundy avatar willemneal 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.