khemrajrathore / e-commerce-tutorial

E-Commerce Simple For My Course

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Started Template - Near Smartcontract

  • Quickly build apps backed by the NEAR blockchain
  • Prerequisites

Init

cargo make call-self init

New Shop

cargo make call new_shop '{"name" : "tdtu shop", "desc": "shop danh cho nguoi hoc tdtu"}' --account-id eamondev.testnet

Get all shops

cargo make view get_all_shops

Get Shop by Id

cargo make call get_shop_by_id '{"owner": "eamondev.testnet"}' --account-id eamon.testnet

New Product

cargo make call new_product '{"product_id": "quan-3lo-01", "name" : "quan 3 lo sieu ben", "total_supply": 100, "price": 1, "desc" : "mo ta cua cai quan 3 lo ne"}' --account-id eamondev.testnet

get all products

cargo make view get_all_products

Get product by id

cargo make view get_product_by_id '{"product_id" : "quan-3lo-01"}'

Get product per shop

cargo make view get_products_by_owner '{"owner" : "eamondev.testnet"}'

Payment

cargo make call payment '{"product_id" : "quan-3lo-01"}' --account-id eamon.testnet --amount 200

update price

cargo make call update_price '{"new_price": 1, "product_id" : "quan-3lo-01"}' --account-id eamondev.testnet
near send dev-1688137082515-73052742077030 eamon.testnet 190
dev-1688561098681-55522353456979
near call {usdt_contract} ft_transfer_call '{"receiver_id": "dev-1688561098681-5552235345697", "amount" : 5, "memo": "memo ne", "msg" : "OK"}' --account-id eamondev.testnet --amount 5

About

E-Commerce Simple For My Course


Languages

Language:Rust 100.0%