Skip to content

pkrasam/sample-api-scripts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

103 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gitpod ready-to-code

Sample API scripts

This repo contains sample scripts in various languages. These scripts use the Vega core and wallet APIs to interact with Vega core nodes and wallet servers.

Gitpod

Get started with the sample API scripts with zero configuration. Click on the "Gitpod ready-to-code" button above.

Getting started

  1. Copy or rename the credentials-template file as credentials.
    Note: When running on Gitpod this is already done for you.
  2. Edit the credentials file. (nano and vim are installed, or use the built-in Gitpod text editor.)
  3. Import the credentials into your local environment: source credentials

And you're good to go. Now choose a sample program to run from the following (see the link in the Folder column to learn how to run each sample script):

Sample scripts

Script description Languages API transport Folder & README
Orders by reference bash, python3 Vega node [REST, gRPC] / get-by-reference
List market details and market data bash, python3 Vega node [REST, gRPC] / get-markets-and-market-data
List orders and trades bash, python3 Vega node [REST, gRPC] / get-orders-and-trades
Vega statistics bash, python3 Vega node [REST, gRPC] / get-statistics
List parties bash, python3 Vega node [REST, gRPC] / parties-and-accounts
Stream market data python3 Vega node [GraphQL] / stream-marketdata
Stream orders and trades python3 Vega node [GraphQL] / stream-orders-and-trades
Interact with Vega wallet API bash, python3 Vega wallet [REST] / wallet
Submit, amend and cancel orders bash, python3 Vega wallet [REST], Vega node [REST, gRPC] / submit-amend-cancel-orders
Submit order (tutorial, inc send tx) bash, python3 Vega wallet [REST], Vega node [REST, gRPC] / submit-order
Vega/blockchain time bash, python3 Vega node [REST, gRPC] / vega-time
Streaming events bash, python3 Vega node [GraphQL, gRPC] / stream-events
Fees estimation bash, python3 Vega node [REST, gRPC] / fees-estimation
Propose, vote and enact new markets bash, python3 Vega node [REST] / propose-markets

Troubleshooting

Python/terminal: If you get No module named 'helpers'..., you should source credentials and check with echo "$PYTHONPATH" than it shows ".".

Contributing or raising issues

Please reach out to us on the community forums or Discord chat to enquire further about how to get involved with Vega.

If you have found an issue or would like to suggest an improvement with our public code samples, please raise an issue in the Sample-API-Scripts repository. If you'd like to submit a PR we welcome additional sample code.

About

Sample API scripts

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 76.0%
  • Shell 23.9%
  • Dockerfile 0.1%