@@ -15,8 +15,6 @@ namespace Program
1515 {
1616 public partial class WorldProgram
1717 {
18- public static readonly PublicKey CPI_AUTH_ADDRESS = new ( "B2f2y3QTBv346wE6nWKor72AUhUvFF6mPk7TWCF2QVhi" ) ;
19-
2018 public static Solana . Unity . Rpc . Models . TransactionInstruction AddEntity ( AddEntityAccounts accounts , PublicKey programId = null )
2119 {
2220 programId ??= new ( ID ) ;
@@ -29,14 +27,18 @@ public static Solana.Unity.Rpc.Models.TransactionInstruction AddEntity(AddEntity
2927 return AddEntity ( accounts , System . Text . Encoding . UTF8 . GetBytes ( extraSeed ) , programId ) ;
3028 }
3129
32- public static PublicKey FindBufferPda ( ) {
30+ public static PublicKey FindCpiAuthPda ( ) {
3331 PublicKey . TryFindProgramAddress ( new [ ]
3432 {
35- Encoding . UTF8 . GetBytes ( "buffer " ) ,
33+ Encoding . UTF8 . GetBytes ( "cpi_auth " ) ,
3634 } , new PublicKey ( ID ) , out var pda , out _ ) ;
3735 return pda ;
3836 }
3937
38+ public static PublicKey FindBufferPda ( PublicKey account ) {
39+ return FindBufferPda ( account , new PublicKey ( ID ) ) ;
40+ }
41+
4042 public static PublicKey FindSessionTokenPda ( PublicKey sessionSigner , PublicKey authority )
4143 {
4244 PublicKey . TryFindProgramAddress ( new [ ]
@@ -233,8 +235,8 @@ public static Solana.Unity.Rpc.Models.TransactionInstruction ApplySystem(
233235 Solana . Unity . Rpc . Models . TransactionInstruction instruction ;
234236 if ( sessionToken != null ) {
235237 var apply = new ApplyWithSessionAccounts ( ) {
236- CpiAuth = CPI_AUTH_ADDRESS ,
237- Buffer = FindBufferPda ( ) ,
238+ CpiAuth = WorldProgram . FindCpiAuthPda ( ) ,
239+ Buffer = FindBufferPda ( authority ) ,
238240 BoltSystem = system ,
239241 Authority = authority ,
240242 World = world ,
@@ -243,8 +245,8 @@ public static Solana.Unity.Rpc.Models.TransactionInstruction ApplySystem(
243245 instruction = ApplyWithSession ( apply , args , programId ) ;
244246 } else {
245247 var apply = new ApplyAccounts ( ) {
246- CpiAuth = CPI_AUTH_ADDRESS ,
247- Buffer = FindBufferPda ( ) ,
248+ CpiAuth = WorldProgram . FindCpiAuthPda ( ) ,
249+ Buffer = FindBufferPda ( authority ) ,
248250 BoltSystem = system ,
249251 Authority = authority ,
250252 World = world ,
0 commit comments