#pragma warning disable CS1591 using System; using System.Collections.Generic; using System.Linq; using System.Numerics; using System.Threading.Tasks; using Solana.Unity; using Solana.Unity.Programs.Abstract; using Solana.Unity.Programs.Utilities; using Solana.Unity.Rpc; using Solana.Unity.Rpc.Builders; using Solana.Unity.Rpc.Core.Http; using Solana.Unity.Rpc.Core.Sockets; using Solana.Unity.Rpc.Types; using Solana.Unity.Wallet; using World; using World.Program; using World.Errors; using World.Accounts; using World.Types; namespace World { namespace Accounts { public partial class Entity { public static ulong ACCOUNT_DISCRIMINATOR => 1751670451238706478UL; public static ReadOnlySpan ACCOUNT_DISCRIMINATOR_BYTES => new byte[]{46, 157, 161, 161, 254, 46, 79, 24}; public static string ACCOUNT_DISCRIMINATOR_B58 => "8oEQa6zH67R"; public ulong Id { get; set; } public static Entity Deserialize(ReadOnlySpan _data) { int offset = 0; ulong accountHashValue = _data.GetU64(offset); offset += 8; if (accountHashValue != ACCOUNT_DISCRIMINATOR) { return null; } Entity result = new Entity(); result.Id = _data.GetU64(offset); offset += 8; return result; } } public partial class Registry { public static ulong ACCOUNT_DISCRIMINATOR => 15779688099924061743UL; public static ReadOnlySpan ACCOUNT_DISCRIMINATOR_BYTES => new byte[]{47, 174, 110, 246, 184, 182, 252, 218}; public static string ACCOUNT_DISCRIMINATOR_B58 => "8ya1XGY4XBP"; public ulong Worlds { get; set; } public static Registry Deserialize(ReadOnlySpan _data) { int offset = 0; ulong accountHashValue = _data.GetU64(offset); offset += 8; if (accountHashValue != ACCOUNT_DISCRIMINATOR) { return null; } Registry result = new Registry(); result.Worlds = _data.GetU64(offset); offset += 8; return result; } } public partial class World { public static ulong ACCOUNT_DISCRIMINATOR => 8978805993381703057UL; public static ReadOnlySpan ACCOUNT_DISCRIMINATOR_BYTES => new byte[]{145, 45, 170, 174, 122, 32, 155, 124}; public static string ACCOUNT_DISCRIMINATOR_B58 => "RHQudtaQtu1"; public ulong Id { get; set; } public ulong Entities { get; set; } public PublicKey[] Authorities { get; set; } public bool Permissionless { get; set; } public byte[] Systems { get; set; } public static World Deserialize(ReadOnlySpan _data) { int offset = 0; ulong accountHashValue = _data.GetU64(offset); offset += 8; if (accountHashValue != ACCOUNT_DISCRIMINATOR) { return null; } World result = new World(); result.Id = _data.GetU64(offset); offset += 8; result.Entities = _data.GetU64(offset); offset += 8; int resultAuthoritiesLength = (int)_data.GetU32(offset); offset += 4; result.Authorities = new PublicKey[resultAuthoritiesLength]; for (uint resultAuthoritiesIdx = 0; resultAuthoritiesIdx < resultAuthoritiesLength; resultAuthoritiesIdx++) { result.Authorities[resultAuthoritiesIdx] = _data.GetPubKey(offset); offset += 32; } result.Permissionless = _data.GetBool(offset); offset += 1; int resultSystemsLength = (int)_data.GetU32(offset); offset += 4; result.Systems = _data.GetBytes(offset, resultSystemsLength); offset += resultSystemsLength; return result; } } } namespace Errors { public enum WorldErrorKind : uint { InvalidAuthority = 6000U, InvalidSystemOutput = 6001U, WorldAccountMismatch = 6002U, TooManyAuthorities = 6003U, AuthorityNotFound = 6004U, SystemNotApproved = 6005U } } namespace Types { } public partial class WorldClient : TransactionalBaseClient { public WorldClient(IRpcClient rpcClient, IStreamingRpcClient streamingRpcClient, PublicKey programId = null) : base(rpcClient, streamingRpcClient, programId ?? new PublicKey(WorldProgram.ID)) { } public async Task>> GetEntitysAsync(string programAddress = WorldProgram.ID, Commitment commitment = Commitment.Confirmed) { var list = new List{new Solana.Unity.Rpc.Models.MemCmp{Bytes = Entity.ACCOUNT_DISCRIMINATOR_B58, Offset = 0}}; var res = await RpcClient.GetProgramAccountsAsync(programAddress, commitment, memCmpList: list); if (!res.WasSuccessful || !(res.Result?.Count > 0)) return new Solana.Unity.Programs.Models.ProgramAccountsResultWrapper>(res); List resultingAccounts = new List(res.Result.Count); resultingAccounts.AddRange(res.Result.Select(result => Entity.Deserialize(Convert.FromBase64String(result.Account.Data[0])))); return new Solana.Unity.Programs.Models.ProgramAccountsResultWrapper>(res, resultingAccounts); } public async Task>> GetRegistrysAsync(string programAddress = WorldProgram.ID, Commitment commitment = Commitment.Confirmed) { var list = new List{new Solana.Unity.Rpc.Models.MemCmp{Bytes = Registry.ACCOUNT_DISCRIMINATOR_B58, Offset = 0}}; var res = await RpcClient.GetProgramAccountsAsync(programAddress, commitment, memCmpList: list); if (!res.WasSuccessful || !(res.Result?.Count > 0)) return new Solana.Unity.Programs.Models.ProgramAccountsResultWrapper>(res); List resultingAccounts = new List(res.Result.Count); resultingAccounts.AddRange(res.Result.Select(result => Registry.Deserialize(Convert.FromBase64String(result.Account.Data[0])))); return new Solana.Unity.Programs.Models.ProgramAccountsResultWrapper>(res, resultingAccounts); } public async Task>> GetWorldsAsync(string programAddress = WorldProgram.ID, Commitment commitment = Commitment.Confirmed) { var list = new List{new Solana.Unity.Rpc.Models.MemCmp{Bytes = World.Accounts.World.ACCOUNT_DISCRIMINATOR_B58, Offset = 0}}; var res = await RpcClient.GetProgramAccountsAsync(programAddress, commitment, memCmpList: list); if (!res.WasSuccessful || !(res.Result?.Count > 0)) return new Solana.Unity.Programs.Models.ProgramAccountsResultWrapper>(res); List resultingAccounts = new List(res.Result.Count); resultingAccounts.AddRange(res.Result.Select(result => World.Accounts.World.Deserialize(Convert.FromBase64String(result.Account.Data[0])))); return new Solana.Unity.Programs.Models.ProgramAccountsResultWrapper>(res, resultingAccounts); } public async Task> GetEntityAsync(string accountAddress, Commitment commitment = Commitment.Finalized) { var res = await RpcClient.GetAccountInfoAsync(accountAddress, commitment); if (!res.WasSuccessful) return new Solana.Unity.Programs.Models.AccountResultWrapper(res); var resultingAccount = Entity.Deserialize(Convert.FromBase64String(res.Result.Value.Data[0])); return new Solana.Unity.Programs.Models.AccountResultWrapper(res, resultingAccount); } public async Task> GetRegistryAsync(string accountAddress, Commitment commitment = Commitment.Finalized) { var res = await RpcClient.GetAccountInfoAsync(accountAddress, commitment); if (!res.WasSuccessful) return new Solana.Unity.Programs.Models.AccountResultWrapper(res); var resultingAccount = Registry.Deserialize(Convert.FromBase64String(res.Result.Value.Data[0])); return new Solana.Unity.Programs.Models.AccountResultWrapper(res, resultingAccount); } public async Task> GetWorldAsync(string accountAddress, Commitment commitment = Commitment.Finalized) { var res = await RpcClient.GetAccountInfoAsync(accountAddress, commitment); if (!res.WasSuccessful) return new Solana.Unity.Programs.Models.AccountResultWrapper(res); var resultingAccount = World.Accounts.World.Deserialize(Convert.FromBase64String(res.Result.Value.Data[0])); return new Solana.Unity.Programs.Models.AccountResultWrapper(res, resultingAccount); } public async Task SubscribeEntityAsync(string accountAddress, Action, Entity> callback, Commitment commitment = Commitment.Finalized) { SubscriptionState res = await StreamingRpcClient.SubscribeAccountInfoAsync(accountAddress, (s, e) => { Entity parsingResult = null; if (e.Value?.Data?.Count > 0) parsingResult = Entity.Deserialize(Convert.FromBase64String(e.Value.Data[0])); callback(s, e, parsingResult); }, commitment); return res; } public async Task SubscribeRegistryAsync(string accountAddress, Action, Registry> callback, Commitment commitment = Commitment.Finalized) { SubscriptionState res = await StreamingRpcClient.SubscribeAccountInfoAsync(accountAddress, (s, e) => { Registry parsingResult = null; if (e.Value?.Data?.Count > 0) parsingResult = Registry.Deserialize(Convert.FromBase64String(e.Value.Data[0])); callback(s, e, parsingResult); }, commitment); return res; } public async Task SubscribeWorldAsync(string accountAddress, Action, World.Accounts.World> callback, Commitment commitment = Commitment.Finalized) { SubscriptionState res = await StreamingRpcClient.SubscribeAccountInfoAsync(accountAddress, (s, e) => { World.Accounts.World parsingResult = null; if (e.Value?.Data?.Count > 0) parsingResult = World.Accounts.World.Deserialize(Convert.FromBase64String(e.Value.Data[0])); callback(s, e, parsingResult); }, commitment); return res; } protected override Dictionary> BuildErrorsDictionary() { return new Dictionary>{{6000U, new ProgramError(WorldErrorKind.InvalidAuthority, "Invalid authority for instruction")}, {6001U, new ProgramError(WorldErrorKind.InvalidSystemOutput, "Invalid system output")}, {6002U, new ProgramError(WorldErrorKind.WorldAccountMismatch, "The provided world account does not match the expected PDA.")}, {6003U, new ProgramError(WorldErrorKind.TooManyAuthorities, "Exceed the maximum number of authorities.")}, {6004U, new ProgramError(WorldErrorKind.AuthorityNotFound, "The provided authority not found")}, {6005U, new ProgramError(WorldErrorKind.SystemNotApproved, "The system is not approved in this world instance")}, }; } } namespace Program { public class AddAuthorityAccounts { public PublicKey Authority { get; set; } public PublicKey NewAuthority { get; set; } public PublicKey World { get; set; } public PublicKey SystemProgram { get; set; } = new PublicKey("11111111111111111111111111111111"); } public class AddEntityAccounts { public PublicKey Payer { get; set; } public PublicKey Entity { get; set; } public PublicKey World { get; set; } public PublicKey SystemProgram { get; set; } = new PublicKey("11111111111111111111111111111111"); } public class ApplyAccounts { public PublicKey BoltSystem { get; set; } public PublicKey Authority { get; set; } public PublicKey InstructionSysvarAccount { get; set; } = new PublicKey("Sysvar1nstructions1111111111111111111111111"); public PublicKey World { get; set; } } public class ApplyWithSessionAccounts { public PublicKey BoltSystem { get; set; } public PublicKey Authority { get; set; } public PublicKey InstructionSysvarAccount { get; set; } = new PublicKey("Sysvar1nstructions1111111111111111111111111"); public PublicKey World { get; set; } public PublicKey SessionToken { get; set; } } public class ApproveSystemAccounts { public PublicKey Authority { get; set; } public PublicKey World { get; set; } public PublicKey System { get; set; } public PublicKey SystemProgram { get; set; } = new PublicKey("11111111111111111111111111111111"); } public class DestroyComponentAccounts { public PublicKey Authority { get; set; } public PublicKey Receiver { get; set; } public PublicKey ComponentProgram { get; set; } public PublicKey ComponentProgramData { get; set; } public PublicKey Entity { get; set; } public PublicKey Component { get; set; } public PublicKey InstructionSysvarAccount { get; set; } = new PublicKey("Sysvar1nstructions1111111111111111111111111"); public PublicKey SystemProgram { get; set; } = new PublicKey("11111111111111111111111111111111"); } public class InitializeComponentAccounts { public PublicKey Payer { get; set; } public PublicKey Data { get; set; } public PublicKey Entity { get; set; } public PublicKey ComponentProgram { get; set; } public PublicKey Authority { get; set; } public PublicKey InstructionSysvarAccount { get; set; } = new PublicKey("Sysvar1nstructions1111111111111111111111111"); public PublicKey SystemProgram { get; set; } = new PublicKey("11111111111111111111111111111111"); } public class InitializeNewWorldAccounts { public PublicKey Payer { get; set; } public PublicKey World { get; set; } public PublicKey Registry { get; set; } public PublicKey SystemProgram { get; set; } = new PublicKey("11111111111111111111111111111111"); } public class InitializeRegistryAccounts { public PublicKey Registry { get; set; } public PublicKey Payer { get; set; } public PublicKey SystemProgram { get; set; } = new PublicKey("11111111111111111111111111111111"); } public class RemoveAuthorityAccounts { public PublicKey Authority { get; set; } public PublicKey AuthorityToDelete { get; set; } public PublicKey World { get; set; } public PublicKey SystemProgram { get; set; } = new PublicKey("11111111111111111111111111111111"); } public class RemoveSystemAccounts { public PublicKey Authority { get; set; } public PublicKey World { get; set; } public PublicKey System { get; set; } public PublicKey SystemProgram { get; set; } = new PublicKey("11111111111111111111111111111111"); } public partial class WorldProgram { public const string ID = "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n"; public static Solana.Unity.Rpc.Models.TransactionInstruction AddAuthority(AddAuthorityAccounts accounts, ulong world_id, PublicKey programId = null) { programId ??= new(ID); List keys = new() {Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.Authority, true), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.NewAuthority, false), Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.World, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.SystemProgram, false)}; byte[] _data = new byte[1200]; int offset = 0; _data.WriteU64(13217455069452700133UL, offset); offset += 8; _data.WriteU64(world_id, offset); offset += 8; byte[] resultData = new byte[offset]; Array.Copy(_data, resultData, offset); return new Solana.Unity.Rpc.Models.TransactionInstruction{Keys = keys, ProgramId = programId.KeyBytes, Data = resultData}; } public static Solana.Unity.Rpc.Models.TransactionInstruction AddEntity(AddEntityAccounts accounts, byte[] extra_seed, PublicKey programId = null) { programId ??= new(ID); List keys = new() {Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.Payer, true), Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.Entity, false), Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.World, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.SystemProgram, false)}; byte[] _data = new byte[1200]; int offset = 0; _data.WriteU64(4121062988444201379UL, offset); offset += 8; if (extra_seed != null) { _data.WriteU8(1, offset); offset += 1; _data.WriteS32(extra_seed.Length, offset); offset += 4; _data.WriteSpan(extra_seed, offset); offset += extra_seed.Length; } else { _data.WriteU8(0, offset); offset += 1; } byte[] resultData = new byte[offset]; Array.Copy(_data, resultData, offset); return new Solana.Unity.Rpc.Models.TransactionInstruction{Keys = keys, ProgramId = programId.KeyBytes, Data = resultData}; } public static Solana.Unity.Rpc.Models.TransactionInstruction Apply(ApplyAccounts accounts, byte[] args, PublicKey programId = null) { programId ??= new(ID); List keys = new() {Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.BoltSystem, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.Authority, true), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.InstructionSysvarAccount, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.World, false)}; byte[] _data = new byte[1200]; int offset = 0; _data.WriteU64(16258613031726085112UL, offset); offset += 8; _data.WriteS32(args.Length, offset); offset += 4; _data.WriteSpan(args, offset); offset += args.Length; byte[] resultData = new byte[offset]; Array.Copy(_data, resultData, offset); return new Solana.Unity.Rpc.Models.TransactionInstruction{Keys = keys, ProgramId = programId.KeyBytes, Data = resultData}; } public static Solana.Unity.Rpc.Models.TransactionInstruction ApplyWithSession(ApplyWithSessionAccounts accounts, byte[] args, PublicKey programId = null) { programId ??= new(ID); List keys = new() {Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.BoltSystem, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.Authority, true), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.InstructionSysvarAccount, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.World, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.SessionToken, false)}; byte[] _data = new byte[1200]; int offset = 0; _data.WriteU64(7459768094276011477UL, offset); offset += 8; _data.WriteS32(args.Length, offset); offset += 4; _data.WriteSpan(args, offset); offset += args.Length; byte[] resultData = new byte[offset]; Array.Copy(_data, resultData, offset); return new Solana.Unity.Rpc.Models.TransactionInstruction{Keys = keys, ProgramId = programId.KeyBytes, Data = resultData}; } public static Solana.Unity.Rpc.Models.TransactionInstruction ApproveSystem(ApproveSystemAccounts accounts, PublicKey programId = null) { programId ??= new(ID); List keys = new() {Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.Authority, true), Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.World, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.System, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.SystemProgram, false)}; byte[] _data = new byte[1200]; int offset = 0; _data.WriteU64(8777308090533520754UL, offset); offset += 8; byte[] resultData = new byte[offset]; Array.Copy(_data, resultData, offset); return new Solana.Unity.Rpc.Models.TransactionInstruction{Keys = keys, ProgramId = programId.KeyBytes, Data = resultData}; } public static Solana.Unity.Rpc.Models.TransactionInstruction DestroyComponent(DestroyComponentAccounts accounts, PublicKey programId = null) { programId ??= new(ID); List keys = new() {Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.Authority, true), Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.Receiver, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.ComponentProgram, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.ComponentProgramData, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.Entity, false), Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.Component, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.InstructionSysvarAccount, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.SystemProgram, false)}; byte[] _data = new byte[1200]; int offset = 0; _data.WriteU64(5321952129328727336UL, offset); offset += 8; byte[] resultData = new byte[offset]; Array.Copy(_data, resultData, offset); return new Solana.Unity.Rpc.Models.TransactionInstruction{Keys = keys, ProgramId = programId.KeyBytes, Data = resultData}; } public static Solana.Unity.Rpc.Models.TransactionInstruction InitializeComponent(InitializeComponentAccounts accounts, PublicKey programId = null) { programId ??= new(ID); List keys = new() {Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.Payer, true), Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.Data, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.Entity, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.ComponentProgram, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.Authority, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.InstructionSysvarAccount, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.SystemProgram, false)}; byte[] _data = new byte[1200]; int offset = 0; _data.WriteU64(2179155133888827172UL, offset); offset += 8; byte[] resultData = new byte[offset]; Array.Copy(_data, resultData, offset); return new Solana.Unity.Rpc.Models.TransactionInstruction{Keys = keys, ProgramId = programId.KeyBytes, Data = resultData}; } public static Solana.Unity.Rpc.Models.TransactionInstruction InitializeNewWorld(InitializeNewWorldAccounts accounts, PublicKey programId = null) { programId ??= new(ID); List keys = new() {Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.Payer, true), Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.World, false), Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.Registry, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.SystemProgram, false)}; byte[] _data = new byte[1200]; int offset = 0; _data.WriteU64(7118163274173538327UL, offset); offset += 8; byte[] resultData = new byte[offset]; Array.Copy(_data, resultData, offset); return new Solana.Unity.Rpc.Models.TransactionInstruction{Keys = keys, ProgramId = programId.KeyBytes, Data = resultData}; } public static Solana.Unity.Rpc.Models.TransactionInstruction InitializeRegistry(InitializeRegistryAccounts accounts, PublicKey programId = null) { programId ??= new(ID); List keys = new() {Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.Registry, false), Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.Payer, true), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.SystemProgram, false)}; byte[] _data = new byte[1200]; int offset = 0; _data.WriteU64(4321548737212364221UL, offset); offset += 8; byte[] resultData = new byte[offset]; Array.Copy(_data, resultData, offset); return new Solana.Unity.Rpc.Models.TransactionInstruction{Keys = keys, ProgramId = programId.KeyBytes, Data = resultData}; } public static Solana.Unity.Rpc.Models.TransactionInstruction RemoveAuthority(RemoveAuthorityAccounts accounts, ulong world_id, PublicKey programId = null) { programId ??= new(ID); List keys = new() {Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.Authority, true), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.AuthorityToDelete, false), Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.World, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.SystemProgram, false)}; byte[] _data = new byte[1200]; int offset = 0; _data.WriteU64(15585545156648003826UL, offset); offset += 8; _data.WriteU64(world_id, offset); offset += 8; byte[] resultData = new byte[offset]; Array.Copy(_data, resultData, offset); return new Solana.Unity.Rpc.Models.TransactionInstruction{Keys = keys, ProgramId = programId.KeyBytes, Data = resultData}; } public static Solana.Unity.Rpc.Models.TransactionInstruction RemoveSystem(RemoveSystemAccounts accounts, PublicKey programId = null) { programId ??= new(ID); List keys = new() {Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.Authority, true), Solana.Unity.Rpc.Models.AccountMeta.Writable(accounts.World, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.System, false), Solana.Unity.Rpc.Models.AccountMeta.ReadOnly(accounts.SystemProgram, false)}; byte[] _data = new byte[1200]; int offset = 0; _data.WriteU64(8688994685429436634UL, offset); offset += 8; byte[] resultData = new byte[offset]; Array.Copy(_data, resultData, offset); return new Solana.Unity.Rpc.Models.TransactionInstruction{Keys = keys, ProgramId = programId.KeyBytes, Data = resultData}; } } } }