diff --git a/clients/js/src/generated/instructions/captureV1.ts b/clients/js/src/generated/instructions/captureV1.ts index 28b0f78..b63a1ba 100644 --- a/clients/js/src/generated/instructions/captureV1.ts +++ b/clients/js/src/generated/instructions/captureV1.ts @@ -33,7 +33,7 @@ import { // Accounts. export type CaptureV1InstructionAccounts = { owner: Signer; - authority?: PublicKey | Pda; + authority?: PublicKey | Pda | Signer; escrow: PublicKey | Pda; asset: PublicKey | Pda; collection: PublicKey | Pda; @@ -172,7 +172,7 @@ export function captureV1( // Default values. if (!resolvedAccounts.authority.value) { - resolvedAccounts.authority.value = context.identity.publicKey; + resolvedAccounts.authority.value = context.identity; } if (!resolvedAccounts.userTokenAccount.value) { resolvedAccounts.userTokenAccount.value = findAssociatedTokenPda(context, { diff --git a/clients/js/src/generated/instructions/releaseV1.ts b/clients/js/src/generated/instructions/releaseV1.ts index 160493c..1362e2f 100644 --- a/clients/js/src/generated/instructions/releaseV1.ts +++ b/clients/js/src/generated/instructions/releaseV1.ts @@ -33,7 +33,7 @@ import { // Accounts. export type ReleaseV1InstructionAccounts = { owner: Signer; - authority?: PublicKey | Pda; + authority?: PublicKey | Pda | Signer; escrow: PublicKey | Pda; asset: PublicKey | Pda; collection: PublicKey | Pda; @@ -172,7 +172,7 @@ export function releaseV1( // Default values. if (!resolvedAccounts.authority.value) { - resolvedAccounts.authority.value = context.identity.publicKey; + resolvedAccounts.authority.value = context.identity; } if (!resolvedAccounts.userTokenAccount.value) { resolvedAccounts.userTokenAccount.value = findAssociatedTokenPda(context, { diff --git a/clients/rust/src/generated/instructions/capture_v1.rs b/clients/rust/src/generated/instructions/capture_v1.rs index fd657f7..cb73090 100644 --- a/clients/rust/src/generated/instructions/capture_v1.rs +++ b/clients/rust/src/generated/instructions/capture_v1.rs @@ -14,7 +14,7 @@ use borsh::{BorshDeserialize, BorshSerialize}; pub struct CaptureV1 { pub owner: solana_program::pubkey::Pubkey, - pub authority: solana_program::pubkey::Pubkey, + pub authority: (solana_program::pubkey::Pubkey, bool), pub escrow: solana_program::pubkey::Pubkey, @@ -59,8 +59,8 @@ impl CaptureV1 { self.owner, true, )); accounts.push(solana_program::instruction::AccountMeta::new( - self.authority, - false, + self.authority.0, + self.authority.1, )); accounts.push(solana_program::instruction::AccountMeta::new( self.escrow, @@ -146,7 +146,7 @@ impl CaptureV1InstructionData { /// ### Accounts: /// /// 0. `[writable, signer]` owner -/// 1. `[writable]` authority +/// 1. `[writable, signer]` authority /// 2. `[writable]` escrow /// 3. `[writable]` asset /// 4. `[writable]` collection @@ -164,7 +164,7 @@ impl CaptureV1InstructionData { #[derive(Default)] pub struct CaptureV1Builder { owner: Option, - authority: Option, + authority: Option<(solana_program::pubkey::Pubkey, bool)>, escrow: Option, asset: Option, collection: Option, @@ -192,8 +192,12 @@ impl CaptureV1Builder { self } #[inline(always)] - pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { - self.authority = Some(authority); + pub fn authority( + &mut self, + authority: solana_program::pubkey::Pubkey, + as_signer: bool, + ) -> &mut Self { + self.authority = Some((authority, as_signer)); self } #[inline(always)] @@ -360,7 +364,7 @@ impl CaptureV1Builder { pub struct CaptureV1CpiAccounts<'a, 'b> { pub owner: &'b solana_program::account_info::AccountInfo<'a>, - pub authority: &'b solana_program::account_info::AccountInfo<'a>, + pub authority: (&'b solana_program::account_info::AccountInfo<'a>, bool), pub escrow: &'b solana_program::account_info::AccountInfo<'a>, @@ -398,7 +402,7 @@ pub struct CaptureV1Cpi<'a, 'b> { pub owner: &'b solana_program::account_info::AccountInfo<'a>, - pub authority: &'b solana_program::account_info::AccountInfo<'a>, + pub authority: (&'b solana_program::account_info::AccountInfo<'a>, bool), pub escrow: &'b solana_program::account_info::AccountInfo<'a>, @@ -493,8 +497,8 @@ impl<'a, 'b> CaptureV1Cpi<'a, 'b> { true, )); accounts.push(solana_program::instruction::AccountMeta::new( - *self.authority.key, - false, + *self.authority.0.key, + self.authority.1, )); accounts.push(solana_program::instruction::AccountMeta::new( *self.escrow.key, @@ -569,7 +573,7 @@ impl<'a, 'b> CaptureV1Cpi<'a, 'b> { let mut account_infos = Vec::with_capacity(16 + 1 + remaining_accounts.len()); account_infos.push(self.__program.clone()); account_infos.push(self.owner.clone()); - account_infos.push(self.authority.clone()); + account_infos.push(self.authority.0.clone()); account_infos.push(self.escrow.clone()); account_infos.push(self.asset.clone()); account_infos.push(self.collection.clone()); @@ -601,7 +605,7 @@ impl<'a, 'b> CaptureV1Cpi<'a, 'b> { /// ### Accounts: /// /// 0. `[writable, signer]` owner -/// 1. `[writable]` authority +/// 1. `[writable, signer]` authority /// 2. `[writable]` escrow /// 3. `[writable]` asset /// 4. `[writable]` collection @@ -653,8 +657,9 @@ impl<'a, 'b> CaptureV1CpiBuilder<'a, 'b> { pub fn authority( &mut self, authority: &'b solana_program::account_info::AccountInfo<'a>, + as_signer: bool, ) -> &mut Self { - self.instruction.authority = Some(authority); + self.instruction.authority = Some((authority, as_signer)); self } #[inline(always)] @@ -876,7 +881,7 @@ impl<'a, 'b> CaptureV1CpiBuilder<'a, 'b> { struct CaptureV1CpiBuilderInstruction<'a, 'b> { __program: &'b solana_program::account_info::AccountInfo<'a>, owner: Option<&'b solana_program::account_info::AccountInfo<'a>>, - authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + authority: Option<(&'b solana_program::account_info::AccountInfo<'a>, bool)>, escrow: Option<&'b solana_program::account_info::AccountInfo<'a>>, asset: Option<&'b solana_program::account_info::AccountInfo<'a>>, collection: Option<&'b solana_program::account_info::AccountInfo<'a>>, diff --git a/clients/rust/src/generated/instructions/release_v1.rs b/clients/rust/src/generated/instructions/release_v1.rs index 7606b25..dbe072c 100644 --- a/clients/rust/src/generated/instructions/release_v1.rs +++ b/clients/rust/src/generated/instructions/release_v1.rs @@ -14,7 +14,7 @@ use borsh::{BorshDeserialize, BorshSerialize}; pub struct ReleaseV1 { pub owner: solana_program::pubkey::Pubkey, - pub authority: solana_program::pubkey::Pubkey, + pub authority: (solana_program::pubkey::Pubkey, bool), pub escrow: solana_program::pubkey::Pubkey, @@ -59,8 +59,8 @@ impl ReleaseV1 { self.owner, true, )); accounts.push(solana_program::instruction::AccountMeta::new( - self.authority, - false, + self.authority.0, + self.authority.1, )); accounts.push(solana_program::instruction::AccountMeta::new( self.escrow, @@ -146,7 +146,7 @@ impl ReleaseV1InstructionData { /// ### Accounts: /// /// 0. `[writable, signer]` owner -/// 1. `[writable]` authority +/// 1. `[writable, signer]` authority /// 2. `[writable]` escrow /// 3. `[writable]` asset /// 4. `[writable]` collection @@ -164,7 +164,7 @@ impl ReleaseV1InstructionData { #[derive(Default)] pub struct ReleaseV1Builder { owner: Option, - authority: Option, + authority: Option<(solana_program::pubkey::Pubkey, bool)>, escrow: Option, asset: Option, collection: Option, @@ -192,8 +192,12 @@ impl ReleaseV1Builder { self } #[inline(always)] - pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { - self.authority = Some(authority); + pub fn authority( + &mut self, + authority: solana_program::pubkey::Pubkey, + as_signer: bool, + ) -> &mut Self { + self.authority = Some((authority, as_signer)); self } #[inline(always)] @@ -360,7 +364,7 @@ impl ReleaseV1Builder { pub struct ReleaseV1CpiAccounts<'a, 'b> { pub owner: &'b solana_program::account_info::AccountInfo<'a>, - pub authority: &'b solana_program::account_info::AccountInfo<'a>, + pub authority: (&'b solana_program::account_info::AccountInfo<'a>, bool), pub escrow: &'b solana_program::account_info::AccountInfo<'a>, @@ -398,7 +402,7 @@ pub struct ReleaseV1Cpi<'a, 'b> { pub owner: &'b solana_program::account_info::AccountInfo<'a>, - pub authority: &'b solana_program::account_info::AccountInfo<'a>, + pub authority: (&'b solana_program::account_info::AccountInfo<'a>, bool), pub escrow: &'b solana_program::account_info::AccountInfo<'a>, @@ -493,8 +497,8 @@ impl<'a, 'b> ReleaseV1Cpi<'a, 'b> { true, )); accounts.push(solana_program::instruction::AccountMeta::new( - *self.authority.key, - false, + *self.authority.0.key, + self.authority.1, )); accounts.push(solana_program::instruction::AccountMeta::new( *self.escrow.key, @@ -569,7 +573,7 @@ impl<'a, 'b> ReleaseV1Cpi<'a, 'b> { let mut account_infos = Vec::with_capacity(16 + 1 + remaining_accounts.len()); account_infos.push(self.__program.clone()); account_infos.push(self.owner.clone()); - account_infos.push(self.authority.clone()); + account_infos.push(self.authority.0.clone()); account_infos.push(self.escrow.clone()); account_infos.push(self.asset.clone()); account_infos.push(self.collection.clone()); @@ -601,7 +605,7 @@ impl<'a, 'b> ReleaseV1Cpi<'a, 'b> { /// ### Accounts: /// /// 0. `[writable, signer]` owner -/// 1. `[writable]` authority +/// 1. `[writable, signer]` authority /// 2. `[writable]` escrow /// 3. `[writable]` asset /// 4. `[writable]` collection @@ -653,8 +657,9 @@ impl<'a, 'b> ReleaseV1CpiBuilder<'a, 'b> { pub fn authority( &mut self, authority: &'b solana_program::account_info::AccountInfo<'a>, + as_signer: bool, ) -> &mut Self { - self.instruction.authority = Some(authority); + self.instruction.authority = Some((authority, as_signer)); self } #[inline(always)] @@ -876,7 +881,7 @@ impl<'a, 'b> ReleaseV1CpiBuilder<'a, 'b> { struct ReleaseV1CpiBuilderInstruction<'a, 'b> { __program: &'b solana_program::account_info::AccountInfo<'a>, owner: Option<&'b solana_program::account_info::AccountInfo<'a>>, - authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + authority: Option<(&'b solana_program::account_info::AccountInfo<'a>, bool)>, escrow: Option<&'b solana_program::account_info::AccountInfo<'a>>, asset: Option<&'b solana_program::account_info::AccountInfo<'a>>, collection: Option<&'b solana_program::account_info::AccountInfo<'a>>, diff --git a/configs/kinobi.cjs b/configs/kinobi.cjs index 1d92f6c..4e5b1db 100644 --- a/configs/kinobi.cjs +++ b/configs/kinobi.cjs @@ -36,6 +36,7 @@ kinobi.update( }, captureV1: { accounts: { + authority: { isSigner: 'either' }, feeTokenAccount: { defaultValue: ataPdaDefault("token", "feeProjectAccount") }, escrowTokenAccount: { defaultValue: ataPdaDefault("token", "escrow") }, userTokenAccount: { defaultValue: ataPdaDefault("token", "owner") }, @@ -49,6 +50,7 @@ kinobi.update( }, releaseV1: { accounts: { + authority: { isSigner: 'either' }, feeTokenAccount: { defaultValue: ataPdaDefault("token", "feeProjectAccount") }, escrowTokenAccount: { defaultValue: ataPdaDefault("token", "escrow") }, userTokenAccount: { defaultValue: ataPdaDefault("token", "owner") },