seahorse-dev 0.1.1

Write Anchor-compatible Solana programs in Python
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
from seahorse.prelude import *
from seahorse.pyth import *

declare_id('EkY7qZD2RCr1LpUzADJkzbjGaWfbvGYB9eJe7DYCgGF8')


@instruction
def use_sol_usd_price(price_account: PriceAccount):
    price_feed = price_account.validate_price_feed('devnet-SOL/USD')
    price = price_feed.get_price()
    price = price.num()
    print(price)