@1upmonster/duel 0.1.7 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin.d.ts +20 -42
- package/dist/admin.js +82 -118
- package/dist/encryption.js +1 -2
- package/dist/generated/duel/accounts/index.d.ts +10 -0
- package/dist/generated/duel/accounts/index.js +11 -0
- package/dist/generated/duel/accounts/matchTicket.d.ts +38 -0
- package/dist/generated/duel/accounts/matchTicket.js +45 -0
- package/dist/generated/duel/accounts/queue.d.ts +42 -0
- package/dist/generated/duel/accounts/queue.js +45 -0
- package/dist/generated/duel/accounts/tenant.d.ts +41 -0
- package/dist/generated/duel/accounts/tenant.js +44 -0
- package/dist/generated/duel/errors/duel.d.ts +33 -0
- package/dist/generated/duel/errors/duel.js +37 -0
- package/dist/generated/duel/errors/index.d.ts +8 -0
- package/dist/generated/duel/errors/index.js +9 -0
- package/dist/generated/duel/index.d.ts +12 -0
- package/dist/generated/duel/index.js +13 -0
- package/dist/generated/duel/instructions/cancelTicket.d.ts +45 -0
- package/dist/generated/duel/instructions/cancelTicket.js +56 -0
- package/dist/generated/duel/instructions/closeTicket.d.ts +45 -0
- package/dist/generated/duel/instructions/closeTicket.js +56 -0
- package/dist/generated/duel/instructions/commitTickets.d.ts +39 -0
- package/dist/generated/duel/instructions/commitTickets.js +50 -0
- package/dist/generated/duel/instructions/createTicket.d.ts +48 -0
- package/dist/generated/duel/instructions/createTicket.js +63 -0
- package/dist/generated/duel/instructions/delegateQueue.d.ts +69 -0
- package/dist/generated/duel/instructions/delegateQueue.js +90 -0
- package/dist/generated/duel/instructions/delegateTicket.d.ts +69 -0
- package/dist/generated/duel/instructions/delegateTicket.js +90 -0
- package/dist/generated/duel/instructions/flushMatches.d.ts +37 -0
- package/dist/generated/duel/instructions/flushMatches.js +43 -0
- package/dist/generated/duel/instructions/index.d.ts +18 -0
- package/dist/generated/duel/instructions/index.js +19 -0
- package/dist/generated/duel/instructions/initializeQueue.d.ts +48 -0
- package/dist/generated/duel/instructions/initializeQueue.js +63 -0
- package/dist/generated/duel/instructions/initializeTenant.d.ts +70 -0
- package/dist/generated/duel/instructions/initializeTenant.js +67 -0
- package/dist/generated/duel/instructions/joinQueue.d.ts +51 -0
- package/dist/generated/duel/instructions/joinQueue.js +56 -0
- package/dist/generated/duel/instructions/processUndelegation.d.ts +43 -0
- package/dist/generated/duel/instructions/processUndelegation.js +49 -0
- package/dist/generated/duel/programs/duel.d.ts +88 -0
- package/dist/generated/duel/programs/duel.js +138 -0
- package/dist/generated/duel/programs/index.d.ts +8 -0
- package/dist/generated/duel/programs/index.js +9 -0
- package/dist/generated/duel/types/accountType.d.ts +25 -0
- package/dist/generated/duel/types/accountType.js +25 -0
- package/dist/generated/duel/types/index.d.ts +13 -0
- package/dist/generated/duel/types/index.js +14 -0
- package/dist/generated/duel/types/matchEntry.d.ts +23 -0
- package/dist/generated/duel/types/matchEntry.js +18 -0
- package/dist/generated/duel/types/matchFound.d.ts +23 -0
- package/dist/generated/duel/types/matchFound.js +18 -0
- package/dist/generated/duel/types/pendingMatch.d.ts +21 -0
- package/dist/generated/duel/types/pendingMatch.js +18 -0
- package/dist/generated/duel/types/queueEntry.d.ts +19 -0
- package/dist/generated/duel/types/queueEntry.js +18 -0
- package/dist/generated/duel/types/ticketStatus.d.ts +40 -0
- package/dist/generated/duel/types/ticketStatus.js +25 -0
- package/dist/generated/rps-game/accounts/gameSession.d.ts +40 -0
- package/dist/generated/rps-game/accounts/gameSession.js +45 -0
- package/dist/generated/rps-game/accounts/index.d.ts +9 -0
- package/dist/generated/rps-game/accounts/index.js +10 -0
- package/dist/generated/rps-game/accounts/playerProfile.d.ts +36 -0
- package/dist/generated/rps-game/accounts/playerProfile.js +47 -0
- package/dist/generated/rps-game/errors/index.d.ts +8 -0
- package/dist/generated/rps-game/errors/index.js +9 -0
- package/dist/generated/rps-game/errors/rpsGame.d.ts +25 -0
- package/dist/generated/rps-game/errors/rpsGame.js +29 -0
- package/dist/generated/rps-game/index.d.ts +12 -0
- package/dist/generated/rps-game/index.js +13 -0
- package/dist/generated/rps-game/instructions/closePlayer.d.ts +45 -0
- package/dist/generated/rps-game/instructions/closePlayer.js +56 -0
- package/dist/generated/rps-game/instructions/delegatePda.d.ts +69 -0
- package/dist/generated/rps-game/instructions/delegatePda.js +90 -0
- package/dist/generated/rps-game/instructions/index.d.ts +16 -0
- package/dist/generated/rps-game/instructions/index.js +17 -0
- package/dist/generated/rps-game/instructions/initializePlayer.d.ts +48 -0
- package/dist/generated/rps-game/instructions/initializePlayer.js +63 -0
- package/dist/generated/rps-game/instructions/makeChoice.d.ts +44 -0
- package/dist/generated/rps-game/instructions/makeChoice.js +46 -0
- package/dist/generated/rps-game/instructions/onMatchFound.d.ts +43 -0
- package/dist/generated/rps-game/instructions/onMatchFound.js +45 -0
- package/dist/generated/rps-game/instructions/persistResults.d.ts +43 -0
- package/dist/generated/rps-game/instructions/persistResults.js +50 -0
- package/dist/generated/rps-game/instructions/processUndelegation.d.ts +43 -0
- package/dist/generated/rps-game/instructions/processUndelegation.js +49 -0
- package/dist/generated/rps-game/instructions/startGame.d.ts +54 -0
- package/dist/generated/rps-game/instructions/startGame.js +67 -0
- package/dist/generated/rps-game/instructions/startGameWithTicket.d.ts +57 -0
- package/dist/generated/rps-game/instructions/startGameWithTicket.js +67 -0
- package/dist/generated/rps-game/programs/index.d.ts +8 -0
- package/dist/generated/rps-game/programs/index.js +9 -0
- package/dist/generated/rps-game/programs/rpsGame.d.ts +78 -0
- package/dist/generated/rps-game/programs/rpsGame.js +118 -0
- package/dist/generated/rps-game/types/accountType.d.ts +34 -0
- package/dist/generated/rps-game/types/accountType.js +25 -0
- package/dist/generated/rps-game/types/choice.d.ts +17 -0
- package/dist/generated/rps-game/types/choice.js +25 -0
- package/dist/generated/rps-game/types/gameResult.d.ts +26 -0
- package/dist/generated/rps-game/types/gameResult.js +25 -0
- package/dist/generated/rps-game/types/index.d.ts +10 -0
- package/dist/generated/rps-game/types/index.js +11 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -2
- package/dist/player.d.ts +21 -49
- package/dist/player.js +61 -141
- package/dist/tee.d.ts +14 -0
- package/dist/tee.js +62 -0
- package/dist/transaction.d.ts +11 -0
- package/dist/transaction.js +50 -0
- package/dist/utils.d.ts +4 -4
- package/dist/utils.js +23 -8
- package/package.json +4 -7
- package/src/admin.ts +129 -164
- package/src/duel.json +66 -2
- package/src/encryption.ts +0 -3
- package/src/generated/duel/accounts/index.ts +11 -0
- package/src/generated/duel/accounts/matchTicket.ts +77 -0
- package/src/generated/duel/accounts/queue.ts +77 -0
- package/src/generated/duel/accounts/tenant.ts +76 -0
- package/src/generated/duel/errors/duel.ts +48 -0
- package/src/generated/duel/errors/index.ts +9 -0
- package/src/generated/duel/index.ts +13 -0
- package/src/generated/duel/instructions/cancelTicket.ts +100 -0
- package/src/generated/duel/instructions/closeTicket.ts +100 -0
- package/src/generated/duel/instructions/commitTickets.ts +84 -0
- package/src/generated/duel/instructions/createTicket.ts +109 -0
- package/src/generated/duel/instructions/delegateQueue.ts +157 -0
- package/src/generated/duel/instructions/delegateTicket.ts +157 -0
- package/src/generated/duel/instructions/flushMatches.ts +76 -0
- package/src/generated/duel/instructions/index.ts +19 -0
- package/src/generated/duel/instructions/initializeQueue.ts +109 -0
- package/src/generated/duel/instructions/initializeTenant.ts +126 -0
- package/src/generated/duel/instructions/joinQueue.ts +106 -0
- package/src/generated/duel/instructions/processUndelegation.ts +86 -0
- package/src/generated/duel/programs/duel.ts +104 -0
- package/src/generated/duel/programs/index.ts +9 -0
- package/src/generated/duel/types/accountType.ts +36 -0
- package/src/generated/duel/types/index.ts +14 -0
- package/src/generated/duel/types/matchEntry.ts +25 -0
- package/src/generated/duel/types/matchFound.ts +25 -0
- package/src/generated/duel/types/pendingMatch.ts +25 -0
- package/src/generated/duel/types/queueEntry.ts +25 -0
- package/src/generated/duel/types/ticketStatus.ts +38 -0
- package/src/generated/rps-game/accounts/gameSession.ts +77 -0
- package/src/generated/rps-game/accounts/index.ts +10 -0
- package/src/generated/rps-game/accounts/playerProfile.ts +80 -0
- package/src/generated/rps-game/errors/index.ts +9 -0
- package/src/generated/rps-game/errors/rpsGame.ts +40 -0
- package/src/generated/rps-game/index.ts +13 -0
- package/src/generated/rps-game/instructions/closePlayer.ts +100 -0
- package/src/generated/rps-game/instructions/delegatePda.ts +157 -0
- package/src/generated/rps-game/instructions/index.ts +17 -0
- package/src/generated/rps-game/instructions/initializePlayer.ts +109 -0
- package/src/generated/rps-game/instructions/makeChoice.ts +84 -0
- package/src/generated/rps-game/instructions/onMatchFound.ts +79 -0
- package/src/generated/rps-game/instructions/persistResults.ts +88 -0
- package/src/generated/rps-game/instructions/processUndelegation.ts +86 -0
- package/src/generated/rps-game/instructions/startGame.ts +118 -0
- package/src/generated/rps-game/instructions/startGameWithTicket.ts +121 -0
- package/src/generated/rps-game/programs/index.ts +9 -0
- package/src/generated/rps-game/programs/rpsGame.ts +95 -0
- package/src/generated/rps-game/types/accountType.ts +36 -0
- package/src/generated/rps-game/types/choice.ts +25 -0
- package/src/generated/rps-game/types/gameResult.ts +37 -0
- package/src/generated/rps-game/types/index.ts +11 -0
- package/src/index.ts +2 -1
- package/src/player.ts +96 -193
- package/src/rps_game.json +991 -0
- package/src/tee.ts +79 -0
- package/src/transaction.ts +90 -0
- package/src/utils.ts +35 -20
- package/tsconfig.json +2 -2
- package/dist/client.d.ts +0 -54
- package/dist/client.js +0 -265
- package/dist/duel.json +0 -517
- package/dist/private_matchmaking.json +0 -534
- package/dist/types.d.ts +0 -635
- package/dist/types.js +0 -2
- package/src/types.ts +0 -300
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { combineCodec, fixDecoderSize, fixEncoderSize, getAddressEncoder, getBytesDecoder, getBytesEncoder, getProgramDerivedAddress, getStructDecoder, getStructEncoder, SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SolanaError, transformEncoder, type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount, type WritableSignerAccount } from '@solana/kit';
|
|
10
|
+
import { getAccountMetaFactory, getAddressFromResolvedInstructionAccount, type ResolvedInstructionAccount } from '@solana/program-client-core';
|
|
11
|
+
import { RPS_GAME_PROGRAM_ADDRESS } from '../programs';
|
|
12
|
+
|
|
13
|
+
export const INITIALIZE_PLAYER_DISCRIMINATOR = new Uint8Array([79, 249, 88, 177, 220, 62, 56, 128]);
|
|
14
|
+
|
|
15
|
+
export function getInitializePlayerDiscriminatorBytes() { return fixEncoderSize(getBytesEncoder(), 8).encode(INITIALIZE_PLAYER_DISCRIMINATOR); }
|
|
16
|
+
|
|
17
|
+
export type InitializePlayerInstruction<TProgram extends string = typeof RPS_GAME_PROGRAM_ADDRESS, TAccountProfile extends string | AccountMeta<string> = string, TAccountPlayer extends string | AccountMeta<string> = string, TAccountPayer extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> =
|
|
18
|
+
Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[TAccountProfile extends string ? WritableAccount<TAccountProfile> : TAccountProfile, TAccountPlayer extends string ? WritableSignerAccount<TAccountPlayer> & AccountSignerMeta<TAccountPlayer> : TAccountPlayer, TAccountPayer extends string ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer> : TAccountPayer, TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram, ...TRemainingAccounts]>;
|
|
19
|
+
|
|
20
|
+
export type InitializePlayerInstructionData = { discriminator: ReadonlyUint8Array; };
|
|
21
|
+
|
|
22
|
+
export type InitializePlayerInstructionDataArgs = { };
|
|
23
|
+
|
|
24
|
+
export function getInitializePlayerInstructionDataEncoder(): FixedSizeEncoder<InitializePlayerInstructionDataArgs> {
|
|
25
|
+
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({ ...value, discriminator: INITIALIZE_PLAYER_DISCRIMINATOR }));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function getInitializePlayerInstructionDataDecoder(): FixedSizeDecoder<InitializePlayerInstructionData> {
|
|
29
|
+
return getStructDecoder([['discriminator', fixDecoderSize(getBytesDecoder(), 8)]]);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function getInitializePlayerInstructionDataCodec(): FixedSizeCodec<InitializePlayerInstructionDataArgs, InitializePlayerInstructionData> {
|
|
33
|
+
return combineCodec(getInitializePlayerInstructionDataEncoder(), getInitializePlayerInstructionDataDecoder());
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type InitializePlayerAsyncInput<TAccountProfile extends string = string, TAccountPlayer extends string = string, TAccountPayer extends string = string, TAccountSystemProgram extends string = string> = {
|
|
37
|
+
profile?: Address<TAccountProfile>;
|
|
38
|
+
player: TransactionSigner<TAccountPlayer>;
|
|
39
|
+
payer: TransactionSigner<TAccountPayer>;
|
|
40
|
+
systemProgram?: Address<TAccountSystemProgram>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export async function getInitializePlayerInstructionAsync<TAccountProfile extends string, TAccountPlayer extends string, TAccountPayer extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof RPS_GAME_PROGRAM_ADDRESS>(input: InitializePlayerAsyncInput<TAccountProfile, TAccountPlayer, TAccountPayer, TAccountSystemProgram>, config?: { programAddress?: TProgramAddress } ): Promise<InitializePlayerInstruction<TProgramAddress, TAccountProfile, TAccountPlayer, TAccountPayer, TAccountSystemProgram>> {
|
|
44
|
+
// Program address.
|
|
45
|
+
const programAddress = config?.programAddress ?? RPS_GAME_PROGRAM_ADDRESS;
|
|
46
|
+
|
|
47
|
+
// Original accounts.
|
|
48
|
+
const originalAccounts = { profile: { value: input.profile ?? null, isWritable: true }, player: { value: input.player ?? null, isWritable: true }, payer: { value: input.payer ?? null, isWritable: true }, systemProgram: { value: input.systemProgram ?? null, isWritable: false } }
|
|
49
|
+
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
// Resolve default values.
|
|
53
|
+
if (!accounts.profile.value) {
|
|
54
|
+
accounts.profile.value = await getProgramDerivedAddress({ programAddress, seeds: [getBytesEncoder().encode(new Uint8Array([112, 108, 97, 121, 101, 114, 95, 112, 114, 111, 102, 105, 108, 101, 95, 118, 51, 53])), getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("player", accounts.player.value))] });
|
|
55
|
+
}
|
|
56
|
+
if (!accounts.systemProgram.value) {
|
|
57
|
+
accounts.systemProgram.value = '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
61
|
+
return Object.freeze({ accounts: [getAccountMeta("profile", accounts.profile), getAccountMeta("player", accounts.player), getAccountMeta("payer", accounts.payer), getAccountMeta("systemProgram", accounts.systemProgram)], data: getInitializePlayerInstructionDataEncoder().encode({}), programAddress } as InitializePlayerInstruction<TProgramAddress, TAccountProfile, TAccountPlayer, TAccountPayer, TAccountSystemProgram>);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export type InitializePlayerInput<TAccountProfile extends string = string, TAccountPlayer extends string = string, TAccountPayer extends string = string, TAccountSystemProgram extends string = string> = {
|
|
65
|
+
profile: Address<TAccountProfile>;
|
|
66
|
+
player: TransactionSigner<TAccountPlayer>;
|
|
67
|
+
payer: TransactionSigner<TAccountPayer>;
|
|
68
|
+
systemProgram?: Address<TAccountSystemProgram>;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function getInitializePlayerInstruction<TAccountProfile extends string, TAccountPlayer extends string, TAccountPayer extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof RPS_GAME_PROGRAM_ADDRESS>(input: InitializePlayerInput<TAccountProfile, TAccountPlayer, TAccountPayer, TAccountSystemProgram>, config?: { programAddress?: TProgramAddress } ): InitializePlayerInstruction<TProgramAddress, TAccountProfile, TAccountPlayer, TAccountPayer, TAccountSystemProgram> {
|
|
72
|
+
// Program address.
|
|
73
|
+
const programAddress = config?.programAddress ?? RPS_GAME_PROGRAM_ADDRESS;
|
|
74
|
+
|
|
75
|
+
// Original accounts.
|
|
76
|
+
const originalAccounts = { profile: { value: input.profile ?? null, isWritable: true }, player: { value: input.player ?? null, isWritable: true }, payer: { value: input.payer ?? null, isWritable: true }, systemProgram: { value: input.systemProgram ?? null, isWritable: false } }
|
|
77
|
+
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
// Resolve default values.
|
|
81
|
+
if (!accounts.systemProgram.value) {
|
|
82
|
+
accounts.systemProgram.value = '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
86
|
+
return Object.freeze({ accounts: [getAccountMeta("profile", accounts.profile), getAccountMeta("player", accounts.player), getAccountMeta("payer", accounts.payer), getAccountMeta("systemProgram", accounts.systemProgram)], data: getInitializePlayerInstructionDataEncoder().encode({}), programAddress } as InitializePlayerInstruction<TProgramAddress, TAccountProfile, TAccountPlayer, TAccountPayer, TAccountSystemProgram>);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type ParsedInitializePlayerInstruction<TProgram extends string = typeof RPS_GAME_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = { programAddress: Address<TProgram>;
|
|
90
|
+
accounts: {
|
|
91
|
+
profile: TAccountMetas[0];
|
|
92
|
+
player: TAccountMetas[1];
|
|
93
|
+
payer: TAccountMetas[2];
|
|
94
|
+
systemProgram: TAccountMetas[3];
|
|
95
|
+
};
|
|
96
|
+
data: InitializePlayerInstructionData; };
|
|
97
|
+
|
|
98
|
+
export function parseInitializePlayerInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedInitializePlayerInstruction<TProgram, TAccountMetas> {
|
|
99
|
+
if (instruction.accounts.length < 4) {
|
|
100
|
+
throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, { actualAccountMetas: instruction.accounts.length, expectedAccountMetas: 4 });
|
|
101
|
+
}
|
|
102
|
+
let accountIndex = 0;
|
|
103
|
+
const getNextAccount = () => {
|
|
104
|
+
const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;
|
|
105
|
+
accountIndex += 1;
|
|
106
|
+
return accountMeta;
|
|
107
|
+
}
|
|
108
|
+
return { programAddress: instruction.programAddress, accounts: { profile: getNextAccount(), player: getNextAccount(), payer: getNextAccount(), systemProgram: getNextAccount() }, data: getInitializePlayerInstructionDataDecoder().decode(instruction.data) };
|
|
109
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SolanaError, transformEncoder, type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlySignerAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount } from '@solana/kit';
|
|
10
|
+
import { getAccountMetaFactory, type ResolvedInstructionAccount } from '@solana/program-client-core';
|
|
11
|
+
import { RPS_GAME_PROGRAM_ADDRESS } from '../programs';
|
|
12
|
+
import { getChoiceDecoder, getChoiceEncoder, type Choice, type ChoiceArgs } from '../types';
|
|
13
|
+
|
|
14
|
+
export const MAKE_CHOICE_DISCRIMINATOR = new Uint8Array([207, 18, 251, 32, 135, 122, 160, 77]);
|
|
15
|
+
|
|
16
|
+
export function getMakeChoiceDiscriminatorBytes() { return fixEncoderSize(getBytesEncoder(), 8).encode(MAKE_CHOICE_DISCRIMINATOR); }
|
|
17
|
+
|
|
18
|
+
export type MakeChoiceInstruction<TProgram extends string = typeof RPS_GAME_PROGRAM_ADDRESS, TAccountGameSession extends string | AccountMeta<string> = string, TAccountPlayer1Profile extends string | AccountMeta<string> = string, TAccountPlayer2Profile extends string | AccountMeta<string> = string, TAccountPlayer extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> =
|
|
19
|
+
Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[TAccountGameSession extends string ? WritableAccount<TAccountGameSession> : TAccountGameSession, TAccountPlayer1Profile extends string ? WritableAccount<TAccountPlayer1Profile> : TAccountPlayer1Profile, TAccountPlayer2Profile extends string ? WritableAccount<TAccountPlayer2Profile> : TAccountPlayer2Profile, TAccountPlayer extends string ? ReadonlySignerAccount<TAccountPlayer> & AccountSignerMeta<TAccountPlayer> : TAccountPlayer, ...TRemainingAccounts]>;
|
|
20
|
+
|
|
21
|
+
export type MakeChoiceInstructionData = { discriminator: ReadonlyUint8Array; choice: Choice; };
|
|
22
|
+
|
|
23
|
+
export type MakeChoiceInstructionDataArgs = { choice: ChoiceArgs; };
|
|
24
|
+
|
|
25
|
+
export function getMakeChoiceInstructionDataEncoder(): FixedSizeEncoder<MakeChoiceInstructionDataArgs> {
|
|
26
|
+
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)], ['choice', getChoiceEncoder()]]), (value) => ({ ...value, discriminator: MAKE_CHOICE_DISCRIMINATOR }));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function getMakeChoiceInstructionDataDecoder(): FixedSizeDecoder<MakeChoiceInstructionData> {
|
|
30
|
+
return getStructDecoder([['discriminator', fixDecoderSize(getBytesDecoder(), 8)], ['choice', getChoiceDecoder()]]);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function getMakeChoiceInstructionDataCodec(): FixedSizeCodec<MakeChoiceInstructionDataArgs, MakeChoiceInstructionData> {
|
|
34
|
+
return combineCodec(getMakeChoiceInstructionDataEncoder(), getMakeChoiceInstructionDataDecoder());
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type MakeChoiceInput<TAccountGameSession extends string = string, TAccountPlayer1Profile extends string = string, TAccountPlayer2Profile extends string = string, TAccountPlayer extends string = string> = {
|
|
38
|
+
gameSession: Address<TAccountGameSession>;
|
|
39
|
+
player1Profile: Address<TAccountPlayer1Profile>;
|
|
40
|
+
player2Profile: Address<TAccountPlayer2Profile>;
|
|
41
|
+
player: TransactionSigner<TAccountPlayer>;
|
|
42
|
+
choice: MakeChoiceInstructionDataArgs["choice"];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function getMakeChoiceInstruction<TAccountGameSession extends string, TAccountPlayer1Profile extends string, TAccountPlayer2Profile extends string, TAccountPlayer extends string, TProgramAddress extends Address = typeof RPS_GAME_PROGRAM_ADDRESS>(input: MakeChoiceInput<TAccountGameSession, TAccountPlayer1Profile, TAccountPlayer2Profile, TAccountPlayer>, config?: { programAddress?: TProgramAddress } ): MakeChoiceInstruction<TProgramAddress, TAccountGameSession, TAccountPlayer1Profile, TAccountPlayer2Profile, TAccountPlayer> {
|
|
46
|
+
// Program address.
|
|
47
|
+
const programAddress = config?.programAddress ?? RPS_GAME_PROGRAM_ADDRESS;
|
|
48
|
+
|
|
49
|
+
// Original accounts.
|
|
50
|
+
const originalAccounts = { gameSession: { value: input.gameSession ?? null, isWritable: true }, player1Profile: { value: input.player1Profile ?? null, isWritable: true }, player2Profile: { value: input.player2Profile ?? null, isWritable: true }, player: { value: input.player ?? null, isWritable: false } }
|
|
51
|
+
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
// Original args.
|
|
55
|
+
const args = { ...input, };
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
61
|
+
return Object.freeze({ accounts: [getAccountMeta("gameSession", accounts.gameSession), getAccountMeta("player1Profile", accounts.player1Profile), getAccountMeta("player2Profile", accounts.player2Profile), getAccountMeta("player", accounts.player)], data: getMakeChoiceInstructionDataEncoder().encode(args as MakeChoiceInstructionDataArgs), programAddress } as MakeChoiceInstruction<TProgramAddress, TAccountGameSession, TAccountPlayer1Profile, TAccountPlayer2Profile, TAccountPlayer>);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export type ParsedMakeChoiceInstruction<TProgram extends string = typeof RPS_GAME_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = { programAddress: Address<TProgram>;
|
|
65
|
+
accounts: {
|
|
66
|
+
gameSession: TAccountMetas[0];
|
|
67
|
+
player1Profile: TAccountMetas[1];
|
|
68
|
+
player2Profile: TAccountMetas[2];
|
|
69
|
+
player: TAccountMetas[3];
|
|
70
|
+
};
|
|
71
|
+
data: MakeChoiceInstructionData; };
|
|
72
|
+
|
|
73
|
+
export function parseMakeChoiceInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedMakeChoiceInstruction<TProgram, TAccountMetas> {
|
|
74
|
+
if (instruction.accounts.length < 4) {
|
|
75
|
+
throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, { actualAccountMetas: instruction.accounts.length, expectedAccountMetas: 4 });
|
|
76
|
+
}
|
|
77
|
+
let accountIndex = 0;
|
|
78
|
+
const getNextAccount = () => {
|
|
79
|
+
const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;
|
|
80
|
+
accountIndex += 1;
|
|
81
|
+
return accountMeta;
|
|
82
|
+
}
|
|
83
|
+
return { programAddress: instruction.programAddress, accounts: { gameSession: getNextAccount(), player1Profile: getNextAccount(), player2Profile: getNextAccount(), player: getNextAccount() }, data: getMakeChoiceInstructionDataDecoder().decode(instruction.data) };
|
|
84
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { combineCodec, fixDecoderSize, fixEncoderSize, getAddressDecoder, getAddressEncoder, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SolanaError, transformEncoder, type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlySignerAccount, type ReadonlyUint8Array, type TransactionSigner } from '@solana/kit';
|
|
10
|
+
import { getAccountMetaFactory, type ResolvedInstructionAccount } from '@solana/program-client-core';
|
|
11
|
+
import { RPS_GAME_PROGRAM_ADDRESS } from '../programs';
|
|
12
|
+
|
|
13
|
+
export const ON_MATCH_FOUND_DISCRIMINATOR = new Uint8Array([66, 209, 170, 159, 10, 195, 34, 214]);
|
|
14
|
+
|
|
15
|
+
export function getOnMatchFoundDiscriminatorBytes() { return fixEncoderSize(getBytesEncoder(), 8).encode(ON_MATCH_FOUND_DISCRIMINATOR); }
|
|
16
|
+
|
|
17
|
+
export type OnMatchFoundInstruction<TProgram extends string = typeof RPS_GAME_PROGRAM_ADDRESS, TAccountSigner extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> =
|
|
18
|
+
Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[TAccountSigner extends string ? ReadonlySignerAccount<TAccountSigner> & AccountSignerMeta<TAccountSigner> : TAccountSigner, ...TRemainingAccounts]>;
|
|
19
|
+
|
|
20
|
+
export type OnMatchFoundInstructionData = { discriminator: ReadonlyUint8Array; player1: Address; player2: Address; matchId: bigint; };
|
|
21
|
+
|
|
22
|
+
export type OnMatchFoundInstructionDataArgs = { player1: Address; player2: Address; matchId: number | bigint; };
|
|
23
|
+
|
|
24
|
+
export function getOnMatchFoundInstructionDataEncoder(): FixedSizeEncoder<OnMatchFoundInstructionDataArgs> {
|
|
25
|
+
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)], ['player1', getAddressEncoder()], ['player2', getAddressEncoder()], ['matchId', getU64Encoder()]]), (value) => ({ ...value, discriminator: ON_MATCH_FOUND_DISCRIMINATOR }));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function getOnMatchFoundInstructionDataDecoder(): FixedSizeDecoder<OnMatchFoundInstructionData> {
|
|
29
|
+
return getStructDecoder([['discriminator', fixDecoderSize(getBytesDecoder(), 8)], ['player1', getAddressDecoder()], ['player2', getAddressDecoder()], ['matchId', getU64Decoder()]]);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function getOnMatchFoundInstructionDataCodec(): FixedSizeCodec<OnMatchFoundInstructionDataArgs, OnMatchFoundInstructionData> {
|
|
33
|
+
return combineCodec(getOnMatchFoundInstructionDataEncoder(), getOnMatchFoundInstructionDataDecoder());
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type OnMatchFoundInput<TAccountSigner extends string = string> = {
|
|
37
|
+
signer: TransactionSigner<TAccountSigner>;
|
|
38
|
+
player1: OnMatchFoundInstructionDataArgs["player1"];
|
|
39
|
+
player2: OnMatchFoundInstructionDataArgs["player2"];
|
|
40
|
+
matchId: OnMatchFoundInstructionDataArgs["matchId"];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function getOnMatchFoundInstruction<TAccountSigner extends string, TProgramAddress extends Address = typeof RPS_GAME_PROGRAM_ADDRESS>(input: OnMatchFoundInput<TAccountSigner>, config?: { programAddress?: TProgramAddress } ): OnMatchFoundInstruction<TProgramAddress, TAccountSigner> {
|
|
44
|
+
// Program address.
|
|
45
|
+
const programAddress = config?.programAddress ?? RPS_GAME_PROGRAM_ADDRESS;
|
|
46
|
+
|
|
47
|
+
// Original accounts.
|
|
48
|
+
const originalAccounts = { signer: { value: input.signer ?? null, isWritable: false } }
|
|
49
|
+
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
// Original args.
|
|
53
|
+
const args = { ...input, };
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
59
|
+
return Object.freeze({ accounts: [getAccountMeta("signer", accounts.signer)], data: getOnMatchFoundInstructionDataEncoder().encode(args as OnMatchFoundInstructionDataArgs), programAddress } as OnMatchFoundInstruction<TProgramAddress, TAccountSigner>);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export type ParsedOnMatchFoundInstruction<TProgram extends string = typeof RPS_GAME_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = { programAddress: Address<TProgram>;
|
|
63
|
+
accounts: {
|
|
64
|
+
signer: TAccountMetas[0];
|
|
65
|
+
};
|
|
66
|
+
data: OnMatchFoundInstructionData; };
|
|
67
|
+
|
|
68
|
+
export function parseOnMatchFoundInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedOnMatchFoundInstruction<TProgram, TAccountMetas> {
|
|
69
|
+
if (instruction.accounts.length < 1) {
|
|
70
|
+
throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, { actualAccountMetas: instruction.accounts.length, expectedAccountMetas: 1 });
|
|
71
|
+
}
|
|
72
|
+
let accountIndex = 0;
|
|
73
|
+
const getNextAccount = () => {
|
|
74
|
+
const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;
|
|
75
|
+
accountIndex += 1;
|
|
76
|
+
return accountMeta;
|
|
77
|
+
}
|
|
78
|
+
return { programAddress: instruction.programAddress, accounts: { signer: getNextAccount() }, data: getOnMatchFoundInstructionDataDecoder().decode(instruction.data) };
|
|
79
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SolanaError, transformEncoder, type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount, type WritableSignerAccount } from '@solana/kit';
|
|
10
|
+
import { getAccountMetaFactory, type ResolvedInstructionAccount } from '@solana/program-client-core';
|
|
11
|
+
import { RPS_GAME_PROGRAM_ADDRESS } from '../programs';
|
|
12
|
+
|
|
13
|
+
export const PERSIST_RESULTS_DISCRIMINATOR = new Uint8Array([9, 175, 42, 217, 2, 48, 80, 81]);
|
|
14
|
+
|
|
15
|
+
export function getPersistResultsDiscriminatorBytes() { return fixEncoderSize(getBytesEncoder(), 8).encode(PERSIST_RESULTS_DISCRIMINATOR); }
|
|
16
|
+
|
|
17
|
+
export type PersistResultsInstruction<TProgram extends string = typeof RPS_GAME_PROGRAM_ADDRESS, TAccountGameSession extends string | AccountMeta<string> = string, TAccountPlayer1Profile extends string | AccountMeta<string> = string, TAccountPlayer2Profile extends string | AccountMeta<string> = string, TAccountPayer extends string | AccountMeta<string> = string, TAccountMagicProgram extends string | AccountMeta<string> = "Magic11111111111111111111111111111111111111", TAccountMagicContext extends string | AccountMeta<string> = "MagicContext1111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> =
|
|
18
|
+
Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[TAccountGameSession extends string ? WritableAccount<TAccountGameSession> : TAccountGameSession, TAccountPlayer1Profile extends string ? WritableAccount<TAccountPlayer1Profile> : TAccountPlayer1Profile, TAccountPlayer2Profile extends string ? WritableAccount<TAccountPlayer2Profile> : TAccountPlayer2Profile, TAccountPayer extends string ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer> : TAccountPayer, TAccountMagicProgram extends string ? ReadonlyAccount<TAccountMagicProgram> : TAccountMagicProgram, TAccountMagicContext extends string ? WritableAccount<TAccountMagicContext> : TAccountMagicContext, ...TRemainingAccounts]>;
|
|
19
|
+
|
|
20
|
+
export type PersistResultsInstructionData = { discriminator: ReadonlyUint8Array; };
|
|
21
|
+
|
|
22
|
+
export type PersistResultsInstructionDataArgs = { };
|
|
23
|
+
|
|
24
|
+
export function getPersistResultsInstructionDataEncoder(): FixedSizeEncoder<PersistResultsInstructionDataArgs> {
|
|
25
|
+
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({ ...value, discriminator: PERSIST_RESULTS_DISCRIMINATOR }));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function getPersistResultsInstructionDataDecoder(): FixedSizeDecoder<PersistResultsInstructionData> {
|
|
29
|
+
return getStructDecoder([['discriminator', fixDecoderSize(getBytesDecoder(), 8)]]);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function getPersistResultsInstructionDataCodec(): FixedSizeCodec<PersistResultsInstructionDataArgs, PersistResultsInstructionData> {
|
|
33
|
+
return combineCodec(getPersistResultsInstructionDataEncoder(), getPersistResultsInstructionDataDecoder());
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type PersistResultsInput<TAccountGameSession extends string = string, TAccountPlayer1Profile extends string = string, TAccountPlayer2Profile extends string = string, TAccountPayer extends string = string, TAccountMagicProgram extends string = string, TAccountMagicContext extends string = string> = {
|
|
37
|
+
gameSession: Address<TAccountGameSession>;
|
|
38
|
+
player1Profile: Address<TAccountPlayer1Profile>;
|
|
39
|
+
player2Profile: Address<TAccountPlayer2Profile>;
|
|
40
|
+
payer: TransactionSigner<TAccountPayer>;
|
|
41
|
+
magicProgram?: Address<TAccountMagicProgram>;
|
|
42
|
+
magicContext?: Address<TAccountMagicContext>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function getPersistResultsInstruction<TAccountGameSession extends string, TAccountPlayer1Profile extends string, TAccountPlayer2Profile extends string, TAccountPayer extends string, TAccountMagicProgram extends string, TAccountMagicContext extends string, TProgramAddress extends Address = typeof RPS_GAME_PROGRAM_ADDRESS>(input: PersistResultsInput<TAccountGameSession, TAccountPlayer1Profile, TAccountPlayer2Profile, TAccountPayer, TAccountMagicProgram, TAccountMagicContext>, config?: { programAddress?: TProgramAddress } ): PersistResultsInstruction<TProgramAddress, TAccountGameSession, TAccountPlayer1Profile, TAccountPlayer2Profile, TAccountPayer, TAccountMagicProgram, TAccountMagicContext> {
|
|
46
|
+
// Program address.
|
|
47
|
+
const programAddress = config?.programAddress ?? RPS_GAME_PROGRAM_ADDRESS;
|
|
48
|
+
|
|
49
|
+
// Original accounts.
|
|
50
|
+
const originalAccounts = { gameSession: { value: input.gameSession ?? null, isWritable: true }, player1Profile: { value: input.player1Profile ?? null, isWritable: true }, player2Profile: { value: input.player2Profile ?? null, isWritable: true }, payer: { value: input.payer ?? null, isWritable: true }, magicProgram: { value: input.magicProgram ?? null, isWritable: false }, magicContext: { value: input.magicContext ?? null, isWritable: true } }
|
|
51
|
+
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
// Resolve default values.
|
|
55
|
+
if (!accounts.magicProgram.value) {
|
|
56
|
+
accounts.magicProgram.value = 'Magic11111111111111111111111111111111111111' as Address<'Magic11111111111111111111111111111111111111'>;
|
|
57
|
+
}
|
|
58
|
+
if (!accounts.magicContext.value) {
|
|
59
|
+
accounts.magicContext.value = 'MagicContext1111111111111111111111111111111' as Address<'MagicContext1111111111111111111111111111111'>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
63
|
+
return Object.freeze({ accounts: [getAccountMeta("gameSession", accounts.gameSession), getAccountMeta("player1Profile", accounts.player1Profile), getAccountMeta("player2Profile", accounts.player2Profile), getAccountMeta("payer", accounts.payer), getAccountMeta("magicProgram", accounts.magicProgram), getAccountMeta("magicContext", accounts.magicContext)], data: getPersistResultsInstructionDataEncoder().encode({}), programAddress } as PersistResultsInstruction<TProgramAddress, TAccountGameSession, TAccountPlayer1Profile, TAccountPlayer2Profile, TAccountPayer, TAccountMagicProgram, TAccountMagicContext>);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type ParsedPersistResultsInstruction<TProgram extends string = typeof RPS_GAME_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = { programAddress: Address<TProgram>;
|
|
67
|
+
accounts: {
|
|
68
|
+
gameSession: TAccountMetas[0];
|
|
69
|
+
player1Profile: TAccountMetas[1];
|
|
70
|
+
player2Profile: TAccountMetas[2];
|
|
71
|
+
payer: TAccountMetas[3];
|
|
72
|
+
magicProgram: TAccountMetas[4];
|
|
73
|
+
magicContext: TAccountMetas[5];
|
|
74
|
+
};
|
|
75
|
+
data: PersistResultsInstructionData; };
|
|
76
|
+
|
|
77
|
+
export function parsePersistResultsInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedPersistResultsInstruction<TProgram, TAccountMetas> {
|
|
78
|
+
if (instruction.accounts.length < 6) {
|
|
79
|
+
throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, { actualAccountMetas: instruction.accounts.length, expectedAccountMetas: 6 });
|
|
80
|
+
}
|
|
81
|
+
let accountIndex = 0;
|
|
82
|
+
const getNextAccount = () => {
|
|
83
|
+
const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;
|
|
84
|
+
accountIndex += 1;
|
|
85
|
+
return accountMeta;
|
|
86
|
+
}
|
|
87
|
+
return { programAddress: instruction.programAddress, accounts: { gameSession: getNextAccount(), player1Profile: getNextAccount(), player2Profile: getNextAccount(), payer: getNextAccount(), magicProgram: getNextAccount(), magicContext: getNextAccount() }, data: getPersistResultsInstructionDataDecoder().decode(instruction.data) };
|
|
88
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { addDecoderSizePrefix, addEncoderSizePrefix, combineCodec, fixDecoderSize, fixEncoderSize, getArrayDecoder, getArrayEncoder, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SolanaError, transformEncoder, type AccountMeta, type Address, type Codec, type Decoder, type Encoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlyUint8Array, type WritableAccount } from '@solana/kit';
|
|
10
|
+
import { getAccountMetaFactory, type ResolvedInstructionAccount } from '@solana/program-client-core';
|
|
11
|
+
import { RPS_GAME_PROGRAM_ADDRESS } from '../programs';
|
|
12
|
+
|
|
13
|
+
export const PROCESS_UNDELEGATION_DISCRIMINATOR = new Uint8Array([196, 28, 41, 206, 48, 37, 51, 167]);
|
|
14
|
+
|
|
15
|
+
export function getProcessUndelegationDiscriminatorBytes() { return fixEncoderSize(getBytesEncoder(), 8).encode(PROCESS_UNDELEGATION_DISCRIMINATOR); }
|
|
16
|
+
|
|
17
|
+
export type ProcessUndelegationInstruction<TProgram extends string = typeof RPS_GAME_PROGRAM_ADDRESS, TAccountBaseAccount extends string | AccountMeta<string> = string, TAccountBuffer extends string | AccountMeta<string> = string, TAccountPayer extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> =
|
|
18
|
+
Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[TAccountBaseAccount extends string ? WritableAccount<TAccountBaseAccount> : TAccountBaseAccount, TAccountBuffer extends string ? ReadonlyAccount<TAccountBuffer> : TAccountBuffer, TAccountPayer extends string ? WritableAccount<TAccountPayer> : TAccountPayer, TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram, ...TRemainingAccounts]>;
|
|
19
|
+
|
|
20
|
+
export type ProcessUndelegationInstructionData = { discriminator: ReadonlyUint8Array; accountSeeds: Array<ReadonlyUint8Array>; };
|
|
21
|
+
|
|
22
|
+
export type ProcessUndelegationInstructionDataArgs = { accountSeeds: Array<ReadonlyUint8Array>; };
|
|
23
|
+
|
|
24
|
+
export function getProcessUndelegationInstructionDataEncoder(): Encoder<ProcessUndelegationInstructionDataArgs> {
|
|
25
|
+
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)], ['accountSeeds', getArrayEncoder(addEncoderSizePrefix(getBytesEncoder(), getU32Encoder()))]]), (value) => ({ ...value, discriminator: PROCESS_UNDELEGATION_DISCRIMINATOR }));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function getProcessUndelegationInstructionDataDecoder(): Decoder<ProcessUndelegationInstructionData> {
|
|
29
|
+
return getStructDecoder([['discriminator', fixDecoderSize(getBytesDecoder(), 8)], ['accountSeeds', getArrayDecoder(addDecoderSizePrefix(getBytesDecoder(), getU32Decoder()))]]);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function getProcessUndelegationInstructionDataCodec(): Codec<ProcessUndelegationInstructionDataArgs, ProcessUndelegationInstructionData> {
|
|
33
|
+
return combineCodec(getProcessUndelegationInstructionDataEncoder(), getProcessUndelegationInstructionDataDecoder());
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type ProcessUndelegationInput<TAccountBaseAccount extends string = string, TAccountBuffer extends string = string, TAccountPayer extends string = string, TAccountSystemProgram extends string = string> = {
|
|
37
|
+
baseAccount: Address<TAccountBaseAccount>;
|
|
38
|
+
buffer: Address<TAccountBuffer>;
|
|
39
|
+
payer: Address<TAccountPayer>;
|
|
40
|
+
systemProgram?: Address<TAccountSystemProgram>;
|
|
41
|
+
accountSeeds: ProcessUndelegationInstructionDataArgs["accountSeeds"];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function getProcessUndelegationInstruction<TAccountBaseAccount extends string, TAccountBuffer extends string, TAccountPayer extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof RPS_GAME_PROGRAM_ADDRESS>(input: ProcessUndelegationInput<TAccountBaseAccount, TAccountBuffer, TAccountPayer, TAccountSystemProgram>, config?: { programAddress?: TProgramAddress } ): ProcessUndelegationInstruction<TProgramAddress, TAccountBaseAccount, TAccountBuffer, TAccountPayer, TAccountSystemProgram> {
|
|
45
|
+
// Program address.
|
|
46
|
+
const programAddress = config?.programAddress ?? RPS_GAME_PROGRAM_ADDRESS;
|
|
47
|
+
|
|
48
|
+
// Original accounts.
|
|
49
|
+
const originalAccounts = { baseAccount: { value: input.baseAccount ?? null, isWritable: true }, buffer: { value: input.buffer ?? null, isWritable: false }, payer: { value: input.payer ?? null, isWritable: true }, systemProgram: { value: input.systemProgram ?? null, isWritable: false } }
|
|
50
|
+
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
// Original args.
|
|
54
|
+
const args = { ...input, };
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
// Resolve default values.
|
|
58
|
+
if (!accounts.systemProgram.value) {
|
|
59
|
+
accounts.systemProgram.value = '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
63
|
+
return Object.freeze({ accounts: [getAccountMeta("baseAccount", accounts.baseAccount), getAccountMeta("buffer", accounts.buffer), getAccountMeta("payer", accounts.payer), getAccountMeta("systemProgram", accounts.systemProgram)], data: getProcessUndelegationInstructionDataEncoder().encode(args as ProcessUndelegationInstructionDataArgs), programAddress } as ProcessUndelegationInstruction<TProgramAddress, TAccountBaseAccount, TAccountBuffer, TAccountPayer, TAccountSystemProgram>);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type ParsedProcessUndelegationInstruction<TProgram extends string = typeof RPS_GAME_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = { programAddress: Address<TProgram>;
|
|
67
|
+
accounts: {
|
|
68
|
+
baseAccount: TAccountMetas[0];
|
|
69
|
+
buffer: TAccountMetas[1];
|
|
70
|
+
payer: TAccountMetas[2];
|
|
71
|
+
systemProgram: TAccountMetas[3];
|
|
72
|
+
};
|
|
73
|
+
data: ProcessUndelegationInstructionData; };
|
|
74
|
+
|
|
75
|
+
export function parseProcessUndelegationInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedProcessUndelegationInstruction<TProgram, TAccountMetas> {
|
|
76
|
+
if (instruction.accounts.length < 4) {
|
|
77
|
+
throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, { actualAccountMetas: instruction.accounts.length, expectedAccountMetas: 4 });
|
|
78
|
+
}
|
|
79
|
+
let accountIndex = 0;
|
|
80
|
+
const getNextAccount = () => {
|
|
81
|
+
const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;
|
|
82
|
+
accountIndex += 1;
|
|
83
|
+
return accountMeta;
|
|
84
|
+
}
|
|
85
|
+
return { programAddress: instruction.programAddress, accounts: { baseAccount: getNextAccount(), buffer: getNextAccount(), payer: getNextAccount(), systemProgram: getNextAccount() }, data: getProcessUndelegationInstructionDataDecoder().decode(instruction.data) };
|
|
86
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { combineCodec, fixDecoderSize, fixEncoderSize, getAddressDecoder, getAddressEncoder, getBytesDecoder, getBytesEncoder, getProgramDerivedAddress, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SolanaError, transformEncoder, type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount, type WritableSignerAccount } from '@solana/kit';
|
|
10
|
+
import { getAccountMetaFactory, getAddressFromResolvedInstructionAccount, getNonNullResolvedInstructionInput, type ResolvedInstructionAccount } from '@solana/program-client-core';
|
|
11
|
+
import { RPS_GAME_PROGRAM_ADDRESS } from '../programs';
|
|
12
|
+
|
|
13
|
+
export const START_GAME_DISCRIMINATOR = new Uint8Array([249, 47, 252, 172, 184, 162, 245, 14]);
|
|
14
|
+
|
|
15
|
+
export function getStartGameDiscriminatorBytes() { return fixEncoderSize(getBytesEncoder(), 8).encode(START_GAME_DISCRIMINATOR); }
|
|
16
|
+
|
|
17
|
+
export type StartGameInstruction<TProgram extends string = typeof RPS_GAME_PROGRAM_ADDRESS, TAccountGameSession extends string | AccountMeta<string> = string, TAccountPlayer extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> =
|
|
18
|
+
Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[TAccountGameSession extends string ? WritableAccount<TAccountGameSession> : TAccountGameSession, TAccountPlayer extends string ? WritableSignerAccount<TAccountPlayer> & AccountSignerMeta<TAccountPlayer> : TAccountPlayer, TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram, ...TRemainingAccounts]>;
|
|
19
|
+
|
|
20
|
+
export type StartGameInstructionData = { discriminator: ReadonlyUint8Array; gameId: bigint; opponent: Address; };
|
|
21
|
+
|
|
22
|
+
export type StartGameInstructionDataArgs = { gameId: number | bigint; opponent: Address; };
|
|
23
|
+
|
|
24
|
+
export function getStartGameInstructionDataEncoder(): FixedSizeEncoder<StartGameInstructionDataArgs> {
|
|
25
|
+
return transformEncoder(getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)], ['gameId', getU64Encoder()], ['opponent', getAddressEncoder()]]), (value) => ({ ...value, discriminator: START_GAME_DISCRIMINATOR }));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function getStartGameInstructionDataDecoder(): FixedSizeDecoder<StartGameInstructionData> {
|
|
29
|
+
return getStructDecoder([['discriminator', fixDecoderSize(getBytesDecoder(), 8)], ['gameId', getU64Decoder()], ['opponent', getAddressDecoder()]]);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function getStartGameInstructionDataCodec(): FixedSizeCodec<StartGameInstructionDataArgs, StartGameInstructionData> {
|
|
33
|
+
return combineCodec(getStartGameInstructionDataEncoder(), getStartGameInstructionDataDecoder());
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type StartGameAsyncInput<TAccountGameSession extends string = string, TAccountPlayer extends string = string, TAccountSystemProgram extends string = string> = {
|
|
37
|
+
gameSession?: Address<TAccountGameSession>;
|
|
38
|
+
player: TransactionSigner<TAccountPlayer>;
|
|
39
|
+
systemProgram?: Address<TAccountSystemProgram>;
|
|
40
|
+
gameId: StartGameInstructionDataArgs["gameId"];
|
|
41
|
+
opponent: StartGameInstructionDataArgs["opponent"];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export async function getStartGameInstructionAsync<TAccountGameSession extends string, TAccountPlayer extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof RPS_GAME_PROGRAM_ADDRESS>(input: StartGameAsyncInput<TAccountGameSession, TAccountPlayer, TAccountSystemProgram>, config?: { programAddress?: TProgramAddress } ): Promise<StartGameInstruction<TProgramAddress, TAccountGameSession, TAccountPlayer, TAccountSystemProgram>> {
|
|
45
|
+
// Program address.
|
|
46
|
+
const programAddress = config?.programAddress ?? RPS_GAME_PROGRAM_ADDRESS;
|
|
47
|
+
|
|
48
|
+
// Original accounts.
|
|
49
|
+
const originalAccounts = { gameSession: { value: input.gameSession ?? null, isWritable: true }, player: { value: input.player ?? null, isWritable: true }, systemProgram: { value: input.systemProgram ?? null, isWritable: false } }
|
|
50
|
+
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
// Original args.
|
|
54
|
+
const args = { ...input, };
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
// Resolve default values.
|
|
58
|
+
if (!accounts.gameSession.value) {
|
|
59
|
+
accounts.gameSession.value = await getProgramDerivedAddress({ programAddress, seeds: [getBytesEncoder().encode(new Uint8Array([103, 97, 109, 101, 95, 115, 101, 115, 115, 105, 111, 110, 95, 118, 49])), getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("player", accounts.player.value)), getAddressEncoder().encode(getNonNullResolvedInstructionInput("opponent", args.opponent)), getU64Encoder().encode(getNonNullResolvedInstructionInput("gameId", args.gameId))] });
|
|
60
|
+
}
|
|
61
|
+
if (!accounts.systemProgram.value) {
|
|
62
|
+
accounts.systemProgram.value = '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
66
|
+
return Object.freeze({ accounts: [getAccountMeta("gameSession", accounts.gameSession), getAccountMeta("player", accounts.player), getAccountMeta("systemProgram", accounts.systemProgram)], data: getStartGameInstructionDataEncoder().encode(args as StartGameInstructionDataArgs), programAddress } as StartGameInstruction<TProgramAddress, TAccountGameSession, TAccountPlayer, TAccountSystemProgram>);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type StartGameInput<TAccountGameSession extends string = string, TAccountPlayer extends string = string, TAccountSystemProgram extends string = string> = {
|
|
70
|
+
gameSession: Address<TAccountGameSession>;
|
|
71
|
+
player: TransactionSigner<TAccountPlayer>;
|
|
72
|
+
systemProgram?: Address<TAccountSystemProgram>;
|
|
73
|
+
gameId: StartGameInstructionDataArgs["gameId"];
|
|
74
|
+
opponent: StartGameInstructionDataArgs["opponent"];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function getStartGameInstruction<TAccountGameSession extends string, TAccountPlayer extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof RPS_GAME_PROGRAM_ADDRESS>(input: StartGameInput<TAccountGameSession, TAccountPlayer, TAccountSystemProgram>, config?: { programAddress?: TProgramAddress } ): StartGameInstruction<TProgramAddress, TAccountGameSession, TAccountPlayer, TAccountSystemProgram> {
|
|
78
|
+
// Program address.
|
|
79
|
+
const programAddress = config?.programAddress ?? RPS_GAME_PROGRAM_ADDRESS;
|
|
80
|
+
|
|
81
|
+
// Original accounts.
|
|
82
|
+
const originalAccounts = { gameSession: { value: input.gameSession ?? null, isWritable: true }, player: { value: input.player ?? null, isWritable: true }, systemProgram: { value: input.systemProgram ?? null, isWritable: false } }
|
|
83
|
+
const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
// Original args.
|
|
87
|
+
const args = { ...input, };
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
// Resolve default values.
|
|
91
|
+
if (!accounts.systemProgram.value) {
|
|
92
|
+
accounts.systemProgram.value = '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
96
|
+
return Object.freeze({ accounts: [getAccountMeta("gameSession", accounts.gameSession), getAccountMeta("player", accounts.player), getAccountMeta("systemProgram", accounts.systemProgram)], data: getStartGameInstructionDataEncoder().encode(args as StartGameInstructionDataArgs), programAddress } as StartGameInstruction<TProgramAddress, TAccountGameSession, TAccountPlayer, TAccountSystemProgram>);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export type ParsedStartGameInstruction<TProgram extends string = typeof RPS_GAME_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = { programAddress: Address<TProgram>;
|
|
100
|
+
accounts: {
|
|
101
|
+
gameSession: TAccountMetas[0];
|
|
102
|
+
player: TAccountMetas[1];
|
|
103
|
+
systemProgram: TAccountMetas[2];
|
|
104
|
+
};
|
|
105
|
+
data: StartGameInstructionData; };
|
|
106
|
+
|
|
107
|
+
export function parseStartGameInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedStartGameInstruction<TProgram, TAccountMetas> {
|
|
108
|
+
if (instruction.accounts.length < 3) {
|
|
109
|
+
throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, { actualAccountMetas: instruction.accounts.length, expectedAccountMetas: 3 });
|
|
110
|
+
}
|
|
111
|
+
let accountIndex = 0;
|
|
112
|
+
const getNextAccount = () => {
|
|
113
|
+
const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;
|
|
114
|
+
accountIndex += 1;
|
|
115
|
+
return accountMeta;
|
|
116
|
+
}
|
|
117
|
+
return { programAddress: instruction.programAddress, accounts: { gameSession: getNextAccount(), player: getNextAccount(), systemProgram: getNextAccount() }, data: getStartGameInstructionDataDecoder().decode(instruction.data) };
|
|
118
|
+
}
|