Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-solana-contract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
- name: Run tests
run: cargo-test-sbf
- name: Run sdk tests
run: cargo test --package pyth-solana-receiver-state
run: cargo test --package pyth-solana-receiver-sdk
18 changes: 18 additions & 0 deletions .github/workflows/publish-pyth-solana-receiver-state.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish Pyth SDK for the Solana Receiver to crates.io

on:
push:
tags:
- pyth-solana-receiver-sdk-v*
jobs:
publish-pyth-solana-receiver-sdk:
name: Publish Pyth SDK for the Solana Receiver
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- run: cargo publish --token ${CARGO_REGISTRY_TOKEN}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
working-directory: "target_chains/solana/pyth_solana_receiver_sdk"
18 changes: 18 additions & 0 deletions .github/workflows/publish-pythnet-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish Pythnet SDK to crates.io

on:
push:
tags:
- pythnet-sdk-v*
jobs:
publish-pythnet-sdk:
name: Publish Pythnet SDK
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- run: cargo publish --token ${CARGO_REGISTRY_TOKEN}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
working-directory: "pythnet/pythnet_sdk"
6 changes: 3 additions & 3 deletions target_chains/solana/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion target_chains/solana/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = [
"programs/*",
"cli/",
"program_simulator/",
"pyth_solana_receiver_state/"
"pyth_solana_receiver_sdk/"
]

[profile.release]
Expand Down
2 changes: 1 addition & 1 deletion target_chains/solana/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ serde_wormhole = { workspace = true }
hex = "0.4.3"
borsh = "0.9.3" # Old version of borsh needed for wormhole-solana
wormhole-core-bridge-solana = {workspace = true}
pyth-solana-receiver-state = {path = "../pyth_solana_receiver_state"}
pyth-solana-receiver-sdk = {path = "../pyth_solana_receiver_sdk"}
4 changes: 2 additions & 2 deletions target_chains/solana/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use {
PostUpdateAtomicParams,
PostUpdateParams,
},
pyth_solana_receiver_state::config::DataSource,
pyth_solana_receiver_sdk::config::DataSource,
pythnet_sdk::wire::v1::MerklePriceUpdate,
serde_wormhole::RawMessage,
solana_client::{
Expand Down Expand Up @@ -184,7 +184,7 @@ fn main() -> Result<()> {
program_id: pyth_solana_receiver::ID,
accounts: initialize_pyth_receiver_accounts,
data: pyth_solana_receiver::instruction::Initialize {
initial_config: pyth_solana_receiver_state::config::Config {
initial_config: pyth_solana_receiver_sdk::config::Config {
governance_authority: payer.pubkey(),
target_governance_authority: None,
wormhole,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ solana-program = { workspace = true }
byteorder = "1.4.3"
wormhole-core-bridge-solana = {workspace = true}
wormhole-raw-vaas = {version = "0.1.3", features = ["ruint", "on-chain"], default-features = false }
pyth-solana-receiver-state = { path = "../../pyth_solana_receiver_state"}
pyth-solana-receiver-sdk = { path = "../../pyth_solana_receiver_sdk"}

[dev-dependencies]
pyth-sdk = "0.8.0"
Expand Down
4 changes: 2 additions & 2 deletions target_chains/solana/programs/pyth-solana-receiver/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use {
crate::error::ReceiverError,
anchor_lang::prelude::*,
pyth_solana_receiver_state::{
pyth_solana_receiver_sdk::{
config::{
Config,
DataSource,
Expand Down Expand Up @@ -47,7 +47,7 @@ use {
pub mod error;
pub mod sdk;

declare_id!(pyth_solana_receiver_state::ID);
declare_id!(pyth_solana_receiver_sdk::ID);

#[program]
pub mod pyth_solana_receiver {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use {
system_program,
InstructionData,
},
pyth_solana_receiver_state::config::{
pyth_solana_receiver_sdk::config::{
Config,
DataSource,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use {
},
ID,
},
pyth_solana_receiver_state::config::{
pyth_solana_receiver_sdk::config::{
Config,
DataSource,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use {
},
sdk::get_config_address,
},
pyth_solana_receiver_state::config::{
pyth_solana_receiver_sdk::config::{
Config,
DataSource,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use {
DEFAULT_TREASURY_ID,
},
},
pyth_solana_receiver_state::{
pyth_solana_receiver_sdk::{
config::DataSource,
price_update::{
PriceUpdateV1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use {
DEFAULT_TREASURY_ID,
},
},
pyth_solana_receiver_state::price_update::{
pyth_solana_receiver_sdk::price_update::{
PriceUpdateV1,
VerificationLevel,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use {
SECONDARY_TREASURY_ID,
},
},
pyth_solana_receiver_state::price_update::{
pyth_solana_receiver_sdk::price_update::{
PriceUpdateV1,
VerificationLevel,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "pyth-solana-receiver-state"
name = "pyth-solana-receiver-sdk"
version = "0.1.0"
edition = "2021"

[lib]
crate-type = ["lib"]
name = "pyth_solana_receiver_state"
name = "pyth_solana_receiver_sdk"


[dependencies]
anchor-lang = ">=0.28.0"
hex = "*"
pythnet-sdk = { path = "../../../pythnet/pythnet_sdk"}
pythnet-sdk = { path = "../../../pythnet/pythnet_sdk", version = "2.0.0"}
solana-program = "*"
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl PriceUpdateV1 {
///
/// # Example
/// ```
/// use pyth_solana_receiver_state::price_update::{get_feed_id_from_hex, VerificationLevel, PriceUpdateV1};
/// use pyth_solana_receiver_sdk::price_update::{get_feed_id_from_hex, VerificationLevel, PriceUpdateV1};
/// use anchor_lang::prelude::*;
///
/// const MAXIMUM_AGE : u64 = 30;
Expand Down Expand Up @@ -152,7 +152,7 @@ impl PriceUpdateV1 {
///
/// # Example
/// ```
/// use pyth_solana_receiver_state::price_update::{get_feed_id_from_hex, PriceUpdateV1};
/// use pyth_solana_receiver_sdk::price_update::{get_feed_id_from_hex, PriceUpdateV1};
/// use anchor_lang::prelude::*;
///
/// const MAXIMUM_AGE : u64 = 30;
Expand Down Expand Up @@ -193,7 +193,7 @@ impl PriceUpdateV1 {
/// # Example
///
/// ```
/// use pyth_solana_receiver_state::price_update::get_feed_id_from_hex;
/// use pyth_solana_receiver_sdk::price_update::get_feed_id_from_hex;
/// let feed_id = get_feed_id_from_hex("0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d").unwrap();
/// ```
pub fn get_feed_id_from_hex(input: &str) -> std::result::Result<FeedId, GetPriceError> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class PythTransactionBuilder extends TransactionBuilder {
* @param priceUpdateDataArray the output of the `@pythnetwork/price-service-client`'s `PriceServiceConnection.getLatestVaas`. This is an array of verifiable price updates.
*
* Partially verified price updates are price updates where not all the guardian signatures have been verified. By default this methods checks `DEFAULT_REDUCED_GUARDIAN_SET_SIZE` signatures when posting the VAA.
* If you are a on-chain program developer, make sure you understand the risks of consuming partially verified price updates here: {@link https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/solana/pyth_solana_receiver_state/src/price_update.rs}.
* If you are a on-chain program developer, make sure you understand the risks of consuming partially verified price updates here: {@link https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/solana/pyth_solana_receiver_sdk/src/price_update.rs}.
*
* @example
* ```typescript
Expand Down Expand Up @@ -282,7 +282,7 @@ export class PythSolanaReceiver {
* Build a series of helper instructions that post price updates to the Pyth Solana Receiver program and another series to close the price update accounts.
*
* This function uses partially verified price updates. Partially verified price updates are price updates where not all the guardian signatures have been verified. By default this methods checks `DEFAULT_REDUCED_GUARDIAN_SET_SIZE` signatures when posting the VAA.
* If you are a on-chain program developer, make sure you understand the risks of consuming partially verified price updates here: {@link https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/solana/pyth_solana_receiver_state/src/price_update.rs}.
* If you are a on-chain program developer, make sure you understand the risks of consuming partially verified price updates here: {@link https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/solana/pyth_solana_receiver_sdk/src/price_update.rs}.
*
* @param priceUpdateDataArray the output of the `@pythnetwork/price-service-client`'s `PriceServiceConnection.getLatestVaas`. This is an array of verifiable price updates.
* @returns `postInstructions`: the instructions to post the price updates, these should be called before consuming the price updates
Expand Down