From 98701770de314c705fa4719990700aec5ab40f69 Mon Sep 17 00:00:00 2001 From: Searoc Date: Thu, 12 Dec 2024 18:21:40 -0500 Subject: [PATCH] Add missed struct --- programs/pump/src/instructions.rs | 10 +++---- target/idl/pump.json | 45 +++++++++++++++++++++++++++++++ target/types/pump.ts | 45 +++++++++++++++++++++++++++++++ 3 files changed, 95 insertions(+), 5 deletions(-) diff --git a/programs/pump/src/instructions.rs b/programs/pump/src/instructions.rs index 2acad06..d71c4f2 100644 --- a/programs/pump/src/instructions.rs +++ b/programs/pump/src/instructions.rs @@ -1,4 +1,4 @@ -use crate::states::Global; +use crate::states::{BondingCurve, Global}; use anchor_lang::prelude::*; use anchor_spl::{ associated_token::AssociatedToken, @@ -54,7 +54,7 @@ pub struct Create<'info> { seeds = [SEED_BONDING_CURVE, &mint.key().to_bytes()], bump, )] - pub bonding_curve: SystemAccount<'info>, + pub bonding_curve: Account<'info, BondingCurve>, #[account( mut, @@ -117,7 +117,7 @@ pub struct Buy<'info> { seeds = [SEED_BONDING_CURVE, &mint.key().to_bytes()], bump, )] - pub bonding_curve: SystemAccount<'info>, + pub bonding_curve: Account<'info, BondingCurve>, #[account( mut, @@ -161,7 +161,7 @@ pub struct Sell<'info> { seeds = [SEED_BONDING_CURVE, &mint.key().to_bytes()], bump, )] - pub bonding_curve: SystemAccount<'info>, + pub bonding_curve: Account<'info, BondingCurve>, #[account( mut, @@ -199,7 +199,7 @@ pub struct Withdraw<'info> { seeds = [SEED_BONDING_CURVE, &mint.key().to_bytes()], bump, )] - pub bonding_curve: SystemAccount<'info>, + pub bonding_curve: Account<'info, BondingCurve>, #[account( mut, diff --git a/target/idl/pump.json b/target/idl/pump.json index c3db6f0..8a441ab 100644 --- a/target/idl/pump.json +++ b/target/idl/pump.json @@ -1063,6 +1063,19 @@ } ], "accounts": [ + { + "name": "BondingCurve", + "discriminator": [ + 23, + 183, + 248, + 55, + 96, + 216, + 172, + 96 + ] + }, { "name": "Global", "discriminator": [ @@ -1174,6 +1187,38 @@ } ], "types": [ + { + "name": "BondingCurve", + "type": { + "kind": "struct", + "fields": [ + { + "name": "virtual_token_reserves", + "type": "u64" + }, + { + "name": "virtual_sol_reserves", + "type": "u64" + }, + { + "name": "real_token_reserves", + "type": "u64" + }, + { + "name": "real_sol_reserves", + "type": "u64" + }, + { + "name": "token_total_suply", + "type": "u64" + }, + { + "name": "complete", + "type": "bool" + } + ] + } + }, { "name": "CompleteEvent", "type": { diff --git a/target/types/pump.ts b/target/types/pump.ts index b043cd8..12faa20 100644 --- a/target/types/pump.ts +++ b/target/types/pump.ts @@ -1069,6 +1069,19 @@ export type Pump = { } ], "accounts": [ + { + "name": "bondingCurve", + "discriminator": [ + 23, + 183, + 248, + 55, + 96, + 216, + 172, + 96 + ] + }, { "name": "global", "discriminator": [ @@ -1180,6 +1193,38 @@ export type Pump = { } ], "types": [ + { + "name": "bondingCurve", + "type": { + "kind": "struct", + "fields": [ + { + "name": "virtualTokenReserves", + "type": "u64" + }, + { + "name": "virtualSolReserves", + "type": "u64" + }, + { + "name": "realTokenReserves", + "type": "u64" + }, + { + "name": "realSolReserves", + "type": "u64" + }, + { + "name": "tokenTotalSuply", + "type": "u64" + }, + { + "name": "complete", + "type": "bool" + } + ] + } + }, { "name": "completeEvent", "type": {