fix: BonkParams platform_onfig changed to platform_comfig
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "sol-trade-sdk"
|
name = "sol-trade-sdk"
|
||||||
version = "0.5.2"
|
version = "0.5.3"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = [
|
authors = [
|
||||||
"William <byteblock6@gmail.com>",
|
"William <byteblock6@gmail.com>",
|
||||||
|
|||||||
@@ -33,14 +33,14 @@ Add the dependency to your `Cargo.toml`:
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
# Add to your Cargo.toml
|
# Add to your Cargo.toml
|
||||||
sol-trade-sdk = { path = "./sol-trade-sdk", version = "0.5.2" }
|
sol-trade-sdk = { path = "./sol-trade-sdk", version = "0.5.3" }
|
||||||
```
|
```
|
||||||
|
|
||||||
### Use crates.io
|
### Use crates.io
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
# Add to your Cargo.toml
|
# Add to your Cargo.toml
|
||||||
sol-trade-sdk = "0.5.2"
|
sol-trade-sdk = "0.5.3"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage Examples
|
## Usage Examples
|
||||||
|
|||||||
+2
-2
@@ -33,14 +33,14 @@ git clone https://github.com/0xfnzero/sol-trade-sdk
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
# 添加到您的 Cargo.toml
|
# 添加到您的 Cargo.toml
|
||||||
sol-trade-sdk = { path = "./sol-trade-sdk", version = "0.5.2" }
|
sol-trade-sdk = { path = "./sol-trade-sdk", version = "0.5.3" }
|
||||||
```
|
```
|
||||||
|
|
||||||
### 使用 crates.io
|
### 使用 crates.io
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
# 添加到您的 Cargo.toml
|
# 添加到您的 Cargo.toml
|
||||||
sol-trade-sdk = "0.5.2"
|
sol-trade-sdk = "0.5.3"
|
||||||
```
|
```
|
||||||
|
|
||||||
## 使用示例
|
## 使用示例
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ impl BonkInstructionBuilder {
|
|||||||
solana_sdk::instruction::AccountMeta::new_readonly(accounts::AUTHORITY, false), // Authority (readonly)
|
solana_sdk::instruction::AccountMeta::new_readonly(accounts::AUTHORITY, false), // Authority (readonly)
|
||||||
solana_sdk::instruction::AccountMeta::new_readonly(accounts::GLOBAL_CONFIG, false), // Global Config (readonly)
|
solana_sdk::instruction::AccountMeta::new_readonly(accounts::GLOBAL_CONFIG, false), // Global Config (readonly)
|
||||||
solana_sdk::instruction::AccountMeta::new_readonly(
|
solana_sdk::instruction::AccountMeta::new_readonly(
|
||||||
protocol_params.platform_onfig,
|
protocol_params.platform_config,
|
||||||
false,
|
false,
|
||||||
), // Platform Config (readonly)
|
), // Platform Config (readonly)
|
||||||
solana_sdk::instruction::AccountMeta::new(pool_state, false), // Pool State
|
solana_sdk::instruction::AccountMeta::new(pool_state, false), // Pool State
|
||||||
@@ -264,7 +264,7 @@ impl BonkInstructionBuilder {
|
|||||||
solana_sdk::instruction::AccountMeta::new_readonly(accounts::AUTHORITY, false), // Authority (readonly)
|
solana_sdk::instruction::AccountMeta::new_readonly(accounts::AUTHORITY, false), // Authority (readonly)
|
||||||
solana_sdk::instruction::AccountMeta::new_readonly(accounts::GLOBAL_CONFIG, false), // Global Config (readonly)
|
solana_sdk::instruction::AccountMeta::new_readonly(accounts::GLOBAL_CONFIG, false), // Global Config (readonly)
|
||||||
solana_sdk::instruction::AccountMeta::new_readonly(
|
solana_sdk::instruction::AccountMeta::new_readonly(
|
||||||
protocol_params.platform_onfig,
|
protocol_params.platform_config,
|
||||||
false,
|
false,
|
||||||
), // Platform Config (readonly)
|
), // Platform Config (readonly)
|
||||||
solana_sdk::instruction::AccountMeta::new(pool_state, false), // Pool State
|
solana_sdk::instruction::AccountMeta::new(pool_state, false), // Pool State
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ pub struct BonkParams {
|
|||||||
/// Token program ID
|
/// Token program ID
|
||||||
/// Specifies the program used by the token, usually spl_token::ID or spl_token_2022::ID
|
/// Specifies the program used by the token, usually spl_token::ID or spl_token_2022::ID
|
||||||
pub mint_token_program: Pubkey,
|
pub mint_token_program: Pubkey,
|
||||||
pub platform_onfig: Pubkey,
|
pub platform_config: Pubkey,
|
||||||
pub platform_associated_account: Pubkey,
|
pub platform_associated_account: Pubkey,
|
||||||
pub creator_associated_account: Pubkey,
|
pub creator_associated_account: Pubkey,
|
||||||
pub auto_handle_wsol: bool,
|
pub auto_handle_wsol: bool,
|
||||||
@@ -296,14 +296,14 @@ pub struct BonkParams {
|
|||||||
impl BonkParams {
|
impl BonkParams {
|
||||||
pub fn immediate_sell(
|
pub fn immediate_sell(
|
||||||
mint_token_program: Pubkey,
|
mint_token_program: Pubkey,
|
||||||
platform_onfig: Pubkey,
|
platform_config: Pubkey,
|
||||||
platform_associated_account: Pubkey,
|
platform_associated_account: Pubkey,
|
||||||
creator_associated_account: Pubkey,
|
creator_associated_account: Pubkey,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
auto_handle_wsol: true,
|
auto_handle_wsol: true,
|
||||||
mint_token_program,
|
mint_token_program,
|
||||||
platform_onfig,
|
platform_config,
|
||||||
platform_associated_account,
|
platform_associated_account,
|
||||||
creator_associated_account,
|
creator_associated_account,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
@@ -316,7 +316,7 @@ impl BonkParams {
|
|||||||
real_base: trade_info.real_base_after as u128,
|
real_base: trade_info.real_base_after as u128,
|
||||||
real_quote: trade_info.real_quote_after as u128,
|
real_quote: trade_info.real_quote_after as u128,
|
||||||
mint_token_program: trade_info.base_token_program,
|
mint_token_program: trade_info.base_token_program,
|
||||||
platform_onfig: trade_info.platform_config,
|
platform_config: trade_info.platform_config,
|
||||||
platform_associated_account: trade_info.platform_associated_account,
|
platform_associated_account: trade_info.platform_associated_account,
|
||||||
creator_associated_account: trade_info.creator_associated_account,
|
creator_associated_account: trade_info.creator_associated_account,
|
||||||
auto_handle_wsol: true,
|
auto_handle_wsol: true,
|
||||||
@@ -366,7 +366,7 @@ impl BonkParams {
|
|||||||
real_base: real_base,
|
real_base: real_base,
|
||||||
real_quote: real_quote,
|
real_quote: real_quote,
|
||||||
mint_token_program: trade_info.base_token_program,
|
mint_token_program: trade_info.base_token_program,
|
||||||
platform_onfig: trade_info.platform_config,
|
platform_config: trade_info.platform_config,
|
||||||
platform_associated_account: trade_info.platform_associated_account,
|
platform_associated_account: trade_info.platform_associated_account,
|
||||||
creator_associated_account: trade_info.creator_associated_account,
|
creator_associated_account: trade_info.creator_associated_account,
|
||||||
auto_handle_wsol: true,
|
auto_handle_wsol: true,
|
||||||
@@ -393,7 +393,7 @@ impl BonkParams {
|
|||||||
real_base: pool_data.real_base as u128,
|
real_base: pool_data.real_base as u128,
|
||||||
real_quote: pool_data.real_quote as u128,
|
real_quote: pool_data.real_quote as u128,
|
||||||
mint_token_program: token_account.owner,
|
mint_token_program: token_account.owner,
|
||||||
platform_onfig: pool_data.platform_config,
|
platform_config: pool_data.platform_config,
|
||||||
platform_associated_account,
|
platform_associated_account,
|
||||||
creator_associated_account,
|
creator_associated_account,
|
||||||
auto_handle_wsol: true,
|
auto_handle_wsol: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user