Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Wallet API

License

NotificationsYou must be signed in to change notification settings

mfinancecombr/wallet-api

Repository files navigation

This is a small project for learning more Rust. It is a rewrite ofthis project started in Go by my friendMarcelometal Jorge Vieira.

Building and running

This package uses Rocket, which currently only builds with Rust nightly. Thisis about to change but, for now, if you are usingrustup make sure you havethe nightly toolchain installed and run this on the project's directory:

rustup overrideset nightly

Otherwise make sure you always add+nightly when calling cargo. The followingcommand will build and run the HTTP server:

cargo +nightly run

Doc

If all goes well you should now be able to look at the Swagger UI nicelyprovided byrocket-okapi:

http://localhost:8000/swagger-ui/

Examples

Adding broker

curl 'http://localhost:8000/api/v1/brokers' \-XPOST \-H 'Content-Type: application/json' \-d'{"name":"CLEAR"}'

Adding portfolio

curl 'http://localhost:8000/api/v1/portfolios' \-XPOST \-H 'Content-Type: application/json' \-d'{"name":"default"}'

Adding stock events

curl 'http://localhost:8000/api/v1/events' \-XPOST \-H 'Content-Type: application/json' \-d'{      "eventType": "stock-operation",      "time": "2020-10-05T00:00:00.000Z",      "symbol": "BMGB4",      "detail":{          "price": 4,          "quantity": 500,          "fees": 0,          "type": "purchase",          "portfolios": ["PORTFOLIO-ID"],          "broker": "BROKER-ID"      }  }'

Obtaining the current position for a stock

curl http://localhost:8000/api/v1/stocks/position/PETR4

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp