Coder Social home page Coder Social logo

solnet.pyth's Introduction

Build .NET6 Release .NET6
Build .NET5 Release .NET5 Coverage Status
Code License Follow on Twitter Discord

What is Solnet.Pyth?

Solnet is Solana's .NET integration library, a number of packages that implement features to interact with Solana from .Net applications.

Solnet.Pyth is a package within the same Solnet. namespace that implements a Client for Pyth, this project is in a separate repository so it is contained, as the goal for Solnet was to be a core SDK.

Features

  • Decoding of Pyth data structures
  • PythClient with methods that make it easy to get data and decode it
  • Factory pattern for PythClient

Requirements

  • net 6.0

Dependencies

  • Solnet.Wallet v6.0.13
  • Solnet.Rpc v6.0.13
  • Solnet.Programs v6.0.13

API

The IPythClient API follows the following structure:

JSON RPC

GetMappingAccountAsync(string account, Commitment commitment = Commitment.Finalized);
  • Gets the given MappingAccount. This is an asynchronous operation.
GetMappingAccount(string account, Commitment commitment = Commitment.Finalized);
  • Gets the given MappingAccount.
GetProductAccountAsync(string account, Commitment commitment = Commitment.Finalized);
  • Gets the given ProductAccount. This is an asynchronous operation.
GetProductAccount(string account, Commitment commitment = Commitment.Finalized);
  • Gets the given ProductAccount.
GetProductAccountsAsync(MappingAccount mappingAccount, Commitment commitment = Commitment.Finalized);
  • Gets a list of ProductAccounts from the given MappingAccount. This is an asynchronous operation.
GetProductAccounts(MappingAccount mappingAccount, Commitment commitment = Commitment.Finalized);
  • Gets a list of ProductAccounts from the given MappingAccount.
GetPriceDataAccountAsync(string account, Commitment commitment = Commitment.Finalized);
  • Gets the given PriceDataAccount. This is an asynchronous operation.
GetPriceDataAccount(string account, Commitment commitment = Commitment.Finalized);
  • Gets the given PriceDataAccount.
GetPriceDataAccountsAsync(List<ProductAccount> productAccounts, Commitment commitment = Commitment.Finalized);
  • Gets a list of PriceDataAccounts from the given list of ProductAccount. This is an asynchronous operation.
GetPriceDataAccounts(List<ProductAccount> productAccounts, Commitment commitment = Commitment.Finalized);
  • Gets a list of PriceDataAccounts from the given list ProductAccount.

Streaming JSON RPC

SubscribePriceDataAccountAsync(Action<Subscription, PriceDataAccount, ulong> action, string priceAccountAddress, Commitment commitment = Commitment.Finalized);
  • Subscribe to a live feed of a PriceDataAccount, the given action is called on every notification received. This is an asynchronous operation.
SubscribePriceDataAccount(Action<Subscription, PriceDataAccount, ulong> action, string priceAccountAddress, Commitment commitment = Commitment.Finalized);
  • Subscribe to a live feed of a PriceDataAccount, the given action is called on every notification received.
UnsubscribePriceDataAccountAsync(string priceAccountAddress);
  • Unsubscribe to a live feed of a PriceDataAccount. This is an asynchronous operation.
UnsubscribePriceDataAccount(string priceAccountAddress);
  • Unsubscribe to a live feed of a PriceDataAccount.

Examples

The Solnet.Pyth.Examples project features some examples on how to usethe ISerumClient, these examples include:

  • Streaming price data
  • Retrieving data from the various accounts:
    • MappingAccount
    • ProductAccount
    • PriceDataAccount

Contribution

We encourage everyone to contribute, submit issues, PRs, discuss. Every kind of help is welcome.

Contributors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details

solnet.pyth's People

Contributors

hoakbuilds avatar tiago18c avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.