dacplayproject / cpp-play2

New updates have been move to https://github.com/dacplayproject
MIT License
4 stars 0 forks source link

Add buy_chips api and sell_chips api #27

Open hackfisher opened 7 years ago

hackfisher commented 7 years ago

Game asset has a new property called "collateral",

this chip asset is atomically calculated from current_supply and its collateral.

hackfisher commented 7 years ago

References Line in Play1.0:

https://github.com/bitsuperlab/cpp-play/blob/master/libraries/blockchain/market_operations.cpp#L136

clar commented 7 years ago

https://github.com/bitsuperlab/cpp-play2/commit/0574ebcfd8a34d77a288d906756501f6a101420a

clar commented 7 years ago

test:

create_asset "nathan" "DICE" 5 100 "100" {"core_exchange_rate" : { "base": { "amount": 1, "asset_id": "1.3.0"},"quote": {"amount": 1, "asset_id": "1.3.1"}}} {} true

list_account_balances nathan

buy_game_chips nathan DICE 1000 true