Steem Smart Contract - Javascript Exchange Method

in #steemengine6 years ago (edited)

Some people have been looking for a way to list coins for an exchange.

  • This method will allow exchanges to list Steem smart contract tokens.
  • This script is released under an MIT license

This is the previous method for https://freedomex.io

This project will allow a single endpoint for exchanges using:

ssc-exchange-method
ssc-proxie-script
dsteem
and more.


Basic methods with out ssc-exchange-proxie

Deposit and withdraw history

curl -XPOST -H "Content-type: application/json" -d '{"method": "GET", "params": {"symbol": "TOKENNAME"}}' 'http://localhost:5000'

Withdraw method

curl -XPOST -H "Content-type: application/json" -d '{"method":"withdraw", "params": {"wif": "activekey", "symbol":"TOKENNAME", "to": "username", "quantity": "0.001", "memo": "Exchange Testing"}}' 'http://localhost:5000'


Advanced methods using ssc-exchange-proxie

Get balance for specific coin rpc method

curl -XPOST -H "Content-type: application/json" -d '{ "jsonrpc": "2.0", "method": "contracts.findOne", "params": { "contract": "tokens", "table": "balances", "query": { "account": "username", "symbol": "COINNAME" } }, "id": 1 }' 'http://localhost:3000/rpc'

f2a6c4c45858ea791aafbc42ccf42cff.png

Get all account balances

curl -XPOST -H "Content-type: application/json" -d '{ "jsonrpc": "2.0", "method": "contracts.find", "params": { "contract": "tokens", "table": "balances", "query": { "account": "username" } }, "id": 1 }' 'http://localhost:3000/rpc'

Account history by id rpc method

curl -XPOST -H "Content-type: application/json" -d '{ "jsonrpc": "2.0", "method": "blockchain.getTransactionInfo", "params": { "txid": “taxid” }, "id": 1 }' 'http://localhost:3000/rpc'

You can find out more on the GitHub:

https://github.com/steemdevelopment/ssc-exchange-method

Feel free to contribute if you have any good ideas

Sort:  
  • This article looks more like a blog post, you may want to include code samples and explanations of coding choices if you want to make a development post.
  • This article could use an introduction image that represents the project.
  • Your repository needs an open source license to be considered open source.
  • You need to list your pull request or commit list in you articles for evaluation.
  • I could not find one comment in the code, please think of other open source contributors who may want to contribute.
  • No invitation for others to contribute.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

The github rep link is at the bottom of the post.

A license has been added.

There isn't much code to comment it's pretty straight forward but we could update it. Any javascript developer should pretty much understand the script since the script only has a few commands.

Also at the bottom of the post is a clear invitation for people to contribute

Thank you for your review, @helo! Keep up the good work!

Very cool! Thanks for the new protocal! @harpagon wil be pleased so will @instructor2121 @aggroed and @yabapmatt at https://steem-engine.com which will use this along with https://freedomex.io

Crazy with Dan saying Steemit is being reinvented on EOS with MEOS, that everyone in DC wants to talk with him and Block.one and that... Steemit 's time is running out.....

@ned what say you to this @steemitblog ?

but what about steem @dan ? I think you will still find a place in your heart and in EOS ecosystem for steem, via Inter Blockchain COmmunication ? Maybe can can set up some new standards for that troo? :D

Hi @steemdevelopment!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

This is sweet!

I sent you 1,000 WONKA bars, a token of deserved award. You can see your token balance at steem-engine.com. Feel free to share this virtual chocloate with others.

Congratulations @steemdevelopment! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You made your First Comment
You received more than 50 upvotes. Your next target is to reach 100 upvotes.

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Hey, @steemdevelopment!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.15
TRX 0.16
JST 0.028
BTC 68300.72
ETH 2426.77
USDT 1.00
SBD 2.36