@intent-engine/core 0.1.26 → 0.1.27

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.
Files changed (179) hide show
  1. package/dist/generated/client/accounts/claimBoard.d.ts +50 -0
  2. package/dist/generated/client/accounts/claimBoard.js +77 -0
  3. package/dist/generated/client/accounts/claimBoard.js.map +1 -0
  4. package/dist/generated/client/accounts/committee.d.ts +48 -0
  5. package/dist/generated/client/accounts/committee.js +75 -0
  6. package/dist/generated/client/accounts/committee.js.map +1 -0
  7. package/dist/generated/client/accounts/config.d.ts +2 -0
  8. package/dist/generated/client/accounts/config.js +4 -2
  9. package/dist/generated/client/accounts/config.js.map +1 -1
  10. package/dist/generated/client/accounts/index.d.ts +4 -0
  11. package/dist/generated/client/accounts/index.js +4 -0
  12. package/dist/generated/client/accounts/index.js.map +1 -1
  13. package/dist/generated/client/accounts/intent.d.ts +2 -0
  14. package/dist/generated/client/accounts/intent.js +4 -2
  15. package/dist/generated/client/accounts/intent.js.map +1 -1
  16. package/dist/generated/client/accounts/mintCap.d.ts +48 -0
  17. package/dist/generated/client/accounts/mintCap.js +75 -0
  18. package/dist/generated/client/accounts/mintCap.js.map +1 -0
  19. package/dist/generated/client/accounts/profile.d.ts +48 -0
  20. package/dist/generated/client/accounts/profile.js +81 -0
  21. package/dist/generated/client/accounts/profile.js.map +1 -0
  22. package/dist/generated/client/errors/intentEngine.d.ts +31 -1
  23. package/dist/generated/client/errors/intentEngine.js +45 -0
  24. package/dist/generated/client/errors/intentEngine.js.map +1 -1
  25. package/dist/generated/client/events/capsRequiredSet.d.ts +22 -0
  26. package/dist/generated/client/events/capsRequiredSet.js +32 -0
  27. package/dist/generated/client/events/capsRequiredSet.js.map +1 -0
  28. package/dist/generated/client/events/claimDropped.d.ts +28 -0
  29. package/dist/generated/client/events/claimDropped.js +40 -0
  30. package/dist/generated/client/events/claimDropped.js.map +1 -0
  31. package/dist/generated/client/events/claimsClosed.d.ts +23 -0
  32. package/dist/generated/client/events/claimsClosed.js +38 -0
  33. package/dist/generated/client/events/claimsClosed.js.map +1 -0
  34. package/dist/generated/client/events/claimsOpened.d.ts +30 -0
  35. package/dist/generated/client/events/claimsOpened.js +42 -0
  36. package/dist/generated/client/events/claimsOpened.js.map +1 -0
  37. package/dist/generated/client/events/committeeAttested.d.ts +24 -0
  38. package/dist/generated/client/events/committeeAttested.js +40 -0
  39. package/dist/generated/client/events/committeeAttested.js.map +1 -0
  40. package/dist/generated/client/events/committeeCreated.d.ts +25 -0
  41. package/dist/generated/client/events/committeeCreated.js +42 -0
  42. package/dist/generated/client/events/committeeCreated.js.map +1 -0
  43. package/dist/generated/client/events/index.d.ts +11 -0
  44. package/dist/generated/client/events/index.js +11 -0
  45. package/dist/generated/client/events/index.js.map +1 -1
  46. package/dist/generated/client/events/jobClaimed.d.ts +30 -0
  47. package/dist/generated/client/events/jobClaimed.js +42 -0
  48. package/dist/generated/client/events/jobClaimed.js.map +1 -0
  49. package/dist/generated/client/events/mintCapSet.d.ts +36 -0
  50. package/dist/generated/client/events/mintCapSet.js +48 -0
  51. package/dist/generated/client/events/mintCapSet.js.map +1 -0
  52. package/dist/generated/client/events/profileClosed.d.ts +22 -0
  53. package/dist/generated/client/events/profileClosed.js +32 -0
  54. package/dist/generated/client/events/profileClosed.js.map +1 -0
  55. package/dist/generated/client/events/profileSet.d.ts +26 -0
  56. package/dist/generated/client/events/profileSet.js +50 -0
  57. package/dist/generated/client/events/profileSet.js.map +1 -0
  58. package/dist/generated/client/events/stakeMoved.d.ts +32 -0
  59. package/dist/generated/client/events/stakeMoved.js +44 -0
  60. package/dist/generated/client/events/stakeMoved.js.map +1 -0
  61. package/dist/generated/client/instructions/claimJob.d.ts +72 -0
  62. package/dist/generated/client/instructions/claimJob.js +163 -0
  63. package/dist/generated/client/instructions/claimJob.js.map +1 -0
  64. package/dist/generated/client/instructions/closeProfile.d.ts +55 -0
  65. package/dist/generated/client/instructions/closeProfile.js +131 -0
  66. package/dist/generated/client/instructions/closeProfile.js.map +1 -0
  67. package/dist/generated/client/instructions/createCommittee.d.ts +76 -0
  68. package/dist/generated/client/instructions/createCommittee.js +163 -0
  69. package/dist/generated/client/instructions/createCommittee.js.map +1 -0
  70. package/dist/generated/client/instructions/createIntent.d.ts +13 -9
  71. package/dist/generated/client/instructions/createIntent.js +21 -2
  72. package/dist/generated/client/instructions/createIntent.js.map +1 -1
  73. package/dist/generated/client/instructions/createIntentByAgent.d.ts +13 -9
  74. package/dist/generated/client/instructions/createIntentByAgent.js +21 -2
  75. package/dist/generated/client/instructions/createIntentByAgent.js.map +1 -1
  76. package/dist/generated/client/instructions/createIntentSigned.d.ts +13 -9
  77. package/dist/generated/client/instructions/createIntentSigned.js +15 -2
  78. package/dist/generated/client/instructions/createIntentSigned.js.map +1 -1
  79. package/dist/generated/client/instructions/createProfile.d.ts +65 -0
  80. package/dist/generated/client/instructions/createProfile.js +162 -0
  81. package/dist/generated/client/instructions/createProfile.js.map +1 -0
  82. package/dist/generated/client/instructions/dropClaim.d.ts +59 -0
  83. package/dist/generated/client/instructions/dropClaim.js +128 -0
  84. package/dist/generated/client/instructions/dropClaim.js.map +1 -0
  85. package/dist/generated/client/instructions/fillAttested.d.ts +17 -9
  86. package/dist/generated/client/instructions/fillAttested.js +20 -2
  87. package/dist/generated/client/instructions/fillAttested.js.map +1 -1
  88. package/dist/generated/client/instructions/fillAttestedCommittee.d.ts +124 -0
  89. package/dist/generated/client/instructions/fillAttestedCommittee.js +271 -0
  90. package/dist/generated/client/instructions/fillAttestedCommittee.js.map +1 -0
  91. package/dist/generated/client/instructions/fillAttestedSplit.d.ts +22 -17
  92. package/dist/generated/client/instructions/fillAttestedSplit.js +24 -7
  93. package/dist/generated/client/instructions/fillAttestedSplit.js.map +1 -1
  94. package/dist/generated/client/instructions/fillAttestedSplitCommittee.d.ts +157 -0
  95. package/dist/generated/client/instructions/fillAttestedSplitCommittee.js +373 -0
  96. package/dist/generated/client/instructions/fillAttestedSplitCommittee.js.map +1 -0
  97. package/dist/generated/client/instructions/index.d.ts +12 -0
  98. package/dist/generated/client/instructions/index.js +12 -0
  99. package/dist/generated/client/instructions/index.js.map +1 -1
  100. package/dist/generated/client/instructions/openClaims.d.ts +72 -0
  101. package/dist/generated/client/instructions/openClaims.js +160 -0
  102. package/dist/generated/client/instructions/openClaims.js.map +1 -0
  103. package/dist/generated/client/instructions/setCapsRequired.d.ts +50 -0
  104. package/dist/generated/client/instructions/setCapsRequired.js +93 -0
  105. package/dist/generated/client/instructions/setCapsRequired.js.map +1 -0
  106. package/dist/generated/client/instructions/setMintCap.d.ts +84 -0
  107. package/dist/generated/client/instructions/setMintCap.js +188 -0
  108. package/dist/generated/client/instructions/setMintCap.js.map +1 -0
  109. package/dist/generated/client/instructions/settleClaims.d.ts +63 -0
  110. package/dist/generated/client/instructions/settleClaims.js +139 -0
  111. package/dist/generated/client/instructions/settleClaims.js.map +1 -0
  112. package/dist/generated/client/instructions/updateProfile.d.ts +61 -0
  113. package/dist/generated/client/instructions/updateProfile.js +140 -0
  114. package/dist/generated/client/instructions/updateProfile.js.map +1 -0
  115. package/dist/generated/client/pdas/board.d.ts +14 -0
  116. package/dist/generated/client/pdas/board.js +19 -0
  117. package/dist/generated/client/pdas/board.js.map +1 -0
  118. package/dist/generated/client/pdas/committee.d.ts +14 -0
  119. package/dist/generated/client/pdas/committee.js +19 -0
  120. package/dist/generated/client/pdas/committee.js.map +1 -0
  121. package/dist/generated/client/pdas/index.d.ts +4 -0
  122. package/dist/generated/client/pdas/index.js +4 -0
  123. package/dist/generated/client/pdas/index.js.map +1 -1
  124. package/dist/generated/client/pdas/mintCap.d.ts +14 -0
  125. package/dist/generated/client/pdas/mintCap.js +19 -0
  126. package/dist/generated/client/pdas/mintCap.js.map +1 -0
  127. package/dist/generated/client/pdas/profile.d.ts +14 -0
  128. package/dist/generated/client/pdas/profile.js +19 -0
  129. package/dist/generated/client/pdas/profile.js.map +1 -0
  130. package/dist/generated/client/programs/intentEngine.d.ts +190 -92
  131. package/dist/generated/client/programs/intentEngine.js +336 -91
  132. package/dist/generated/client/programs/intentEngine.js.map +1 -1
  133. package/dist/generated/client/types/index.d.ts +2 -0
  134. package/dist/generated/client/types/index.js +2 -0
  135. package/dist/generated/client/types/index.js.map +1 -1
  136. package/dist/generated/client/types/profileFields.d.ts +18 -0
  137. package/dist/generated/client/types/profileFields.js +34 -0
  138. package/dist/generated/client/types/profileFields.js.map +1 -0
  139. package/dist/generated/client/types/splitClaim.d.ts +16 -0
  140. package/dist/generated/client/types/splitClaim.js +24 -0
  141. package/dist/generated/client/types/splitClaim.js.map +1 -0
  142. package/dist/src/builders.d.ts +1 -1
  143. package/dist/src/builders.js +1 -1
  144. package/dist/src/builders.js.map +1 -1
  145. package/dist/src/claims.d.ts +47 -0
  146. package/dist/src/claims.js +69 -0
  147. package/dist/src/claims.js.map +1 -0
  148. package/dist/src/committee.d.ts +40 -0
  149. package/dist/src/committee.js +145 -0
  150. package/dist/src/committee.js.map +1 -0
  151. package/dist/src/describe.d.ts +1 -0
  152. package/dist/src/describe.js +3 -0
  153. package/dist/src/describe.js.map +1 -1
  154. package/dist/src/errors.d.ts +1 -1
  155. package/dist/src/errors.js +5 -0
  156. package/dist/src/errors.js.map +1 -1
  157. package/dist/src/events.d.ts +12 -1
  158. package/dist/src/events.js +15 -1
  159. package/dist/src/events.js.map +1 -1
  160. package/dist/src/fill-builders.d.ts +15 -3
  161. package/dist/src/fill-builders.js +37 -53
  162. package/dist/src/fill-builders.js.map +1 -1
  163. package/dist/src/index.d.ts +3 -0
  164. package/dist/src/index.js +3 -0
  165. package/dist/src/index.js.map +1 -1
  166. package/dist/src/intent-builders.d.ts +7 -3
  167. package/dist/src/intent-builders.js +11 -4
  168. package/dist/src/intent-builders.js.map +1 -1
  169. package/dist/src/memo.d.ts +9 -0
  170. package/dist/src/memo.js +28 -0
  171. package/dist/src/memo.js.map +1 -1
  172. package/dist/src/mint-caps.d.ts +31 -0
  173. package/dist/src/mint-caps.js +73 -0
  174. package/dist/src/mint-caps.js.map +1 -0
  175. package/dist/src/state.d.ts +3 -0
  176. package/dist/src/state.js +5 -0
  177. package/dist/src/state.js.map +1 -1
  178. package/generated/idl.json +1990 -63
  179. package/package.json +3 -3
@@ -0,0 +1,72 @@
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
+ import { type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlyUint8Array, type WritableAccount, type WritableSignerAccount } from "@solana/kit";
9
+ import { type InstructionAccountInput, type InstructionAccountInputAddress, type InstructionSignerInput, type ResolvedInstructionAccountMeta } from "@solana/kit/program-client-core";
10
+ import { INTENT_ENGINE_PROGRAM_ADDRESS } from "../programs/index.js";
11
+ export declare const CLAIM_JOB_DISCRIMINATOR: ReadonlyUint8Array;
12
+ export declare function getClaimJobDiscriminatorBytes(): ReadonlyUint8Array;
13
+ export type ClaimJobInstruction<TProgram extends string = typeof INTENT_ENGINE_PROGRAM_ADDRESS, TAccountWorker extends string | AccountMeta<string> = string, TAccountIntent extends string | AccountMeta<string> = string, TAccountBoard extends string | AccountMeta<string> = string, TAccountOwner extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TAccountEventAuthority extends string | AccountMeta<string> = string, TAccountProgram extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
14
+ TAccountWorker extends string ? WritableSignerAccount<TAccountWorker> & AccountSignerMeta<TAccountWorker> : TAccountWorker,
15
+ TAccountIntent extends string ? ReadonlyAccount<TAccountIntent> : TAccountIntent,
16
+ TAccountBoard extends string ? WritableAccount<TAccountBoard> : TAccountBoard,
17
+ TAccountOwner extends string ? WritableAccount<TAccountOwner> : TAccountOwner,
18
+ TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
19
+ TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,
20
+ TAccountProgram extends string ? ReadonlyAccount<TAccountProgram> : TAccountProgram,
21
+ ...TRemainingAccounts
22
+ ]>;
23
+ export type ClaimJobInstructionData = {
24
+ discriminator: ReadonlyUint8Array;
25
+ secs: number;
26
+ };
27
+ export type ClaimJobInstructionDataArgs = {
28
+ secs: number;
29
+ };
30
+ export declare function getClaimJobInstructionDataEncoder(): FixedSizeEncoder<ClaimJobInstructionDataArgs>;
31
+ export declare function getClaimJobInstructionDataDecoder(): FixedSizeDecoder<ClaimJobInstructionData>;
32
+ export declare function getClaimJobInstructionDataCodec(): FixedSizeCodec<ClaimJobInstructionDataArgs, ClaimJobInstructionData>;
33
+ export type ClaimJobAsyncInput<TAccountWorker extends InstructionSignerInput = InstructionSignerInput, TAccountIntent extends InstructionAccountInput = InstructionAccountInput, TAccountBoard extends InstructionAccountInput = InstructionAccountInput, TAccountOwner extends InstructionAccountInput = InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput = InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput = InstructionAccountInput, TAccountProgram extends InstructionAccountInput = InstructionAccountInput> = {
34
+ worker: TAccountWorker;
35
+ intent: TAccountIntent;
36
+ board?: TAccountBoard;
37
+ owner: TAccountOwner;
38
+ systemProgram?: TAccountSystemProgram;
39
+ eventAuthority: TAccountEventAuthority;
40
+ program: TAccountProgram;
41
+ secs: ClaimJobInstructionDataArgs["secs"];
42
+ };
43
+ export declare function getClaimJobInstructionAsync<TAccountWorker extends InstructionSignerInput, TAccountIntent extends InstructionAccountInput, TAccountBoard extends InstructionAccountInput, TAccountOwner extends InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput, TAccountProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof INTENT_ENGINE_PROGRAM_ADDRESS>(input: ClaimJobAsyncInput<TAccountWorker, TAccountIntent, TAccountBoard, TAccountOwner, TAccountSystemProgram, TAccountEventAuthority, TAccountProgram>, config?: {
44
+ programAddress?: TProgramAddress;
45
+ }): Promise<ClaimJobInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountWorker, InstructionAccountInputAddress<TAccountWorker>>, ResolvedInstructionAccountMeta<TAccountIntent, InstructionAccountInputAddress<TAccountIntent>>, ResolvedInstructionAccountMeta<TAccountBoard, InstructionAccountInputAddress<TAccountBoard>>, ResolvedInstructionAccountMeta<TAccountOwner, InstructionAccountInputAddress<TAccountOwner>>, ResolvedInstructionAccountMeta<TAccountSystemProgram, InstructionAccountInputAddress<TAccountSystemProgram>>, ResolvedInstructionAccountMeta<TAccountEventAuthority, InstructionAccountInputAddress<TAccountEventAuthority>>, ResolvedInstructionAccountMeta<TAccountProgram, InstructionAccountInputAddress<TAccountProgram>>>>;
46
+ export type ClaimJobInput<TAccountWorker extends InstructionSignerInput = InstructionSignerInput, TAccountIntent extends InstructionAccountInput = InstructionAccountInput, TAccountBoard extends InstructionAccountInput = InstructionAccountInput, TAccountOwner extends InstructionAccountInput = InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput = InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput = InstructionAccountInput, TAccountProgram extends InstructionAccountInput = InstructionAccountInput> = {
47
+ worker: TAccountWorker;
48
+ intent: TAccountIntent;
49
+ board: TAccountBoard;
50
+ owner: TAccountOwner;
51
+ systemProgram?: TAccountSystemProgram;
52
+ eventAuthority: TAccountEventAuthority;
53
+ program: TAccountProgram;
54
+ secs: ClaimJobInstructionDataArgs["secs"];
55
+ };
56
+ export declare function getClaimJobInstruction<TAccountWorker extends InstructionSignerInput, TAccountIntent extends InstructionAccountInput, TAccountBoard extends InstructionAccountInput, TAccountOwner extends InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput, TAccountProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof INTENT_ENGINE_PROGRAM_ADDRESS>(input: ClaimJobInput<TAccountWorker, TAccountIntent, TAccountBoard, TAccountOwner, TAccountSystemProgram, TAccountEventAuthority, TAccountProgram>, config?: {
57
+ programAddress?: TProgramAddress;
58
+ }): ClaimJobInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountWorker, InstructionAccountInputAddress<TAccountWorker>>, ResolvedInstructionAccountMeta<TAccountIntent, InstructionAccountInputAddress<TAccountIntent>>, ResolvedInstructionAccountMeta<TAccountBoard, InstructionAccountInputAddress<TAccountBoard>>, ResolvedInstructionAccountMeta<TAccountOwner, InstructionAccountInputAddress<TAccountOwner>>, ResolvedInstructionAccountMeta<TAccountSystemProgram, InstructionAccountInputAddress<TAccountSystemProgram>>, ResolvedInstructionAccountMeta<TAccountEventAuthority, InstructionAccountInputAddress<TAccountEventAuthority>>, ResolvedInstructionAccountMeta<TAccountProgram, InstructionAccountInputAddress<TAccountProgram>>>;
59
+ export type ParsedClaimJobInstruction<TProgram extends string = typeof INTENT_ENGINE_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
60
+ programAddress: Address<TProgram>;
61
+ accounts: {
62
+ worker: TAccountMetas[0];
63
+ intent: TAccountMetas[1];
64
+ board: TAccountMetas[2];
65
+ owner: TAccountMetas[3];
66
+ systemProgram: TAccountMetas[4];
67
+ eventAuthority: TAccountMetas[5];
68
+ program: TAccountMetas[6];
69
+ };
70
+ data: ClaimJobInstructionData;
71
+ };
72
+ export declare function parseClaimJobInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedClaimJobInstruction<TProgram, TAccountMetas>;
@@ -0,0 +1,163 @@
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
+ import { combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SolanaError, transformEncoder, } from "@solana/kit";
9
+ import { getAccountMetaFactory, getAddressFromResolvedInstructionAccount, } from "@solana/kit/program-client-core";
10
+ import { findBoardPda } from "../pdas/index.js";
11
+ import { INTENT_ENGINE_PROGRAM_ADDRESS } from "../programs/index.js";
12
+ export const CLAIM_JOB_DISCRIMINATOR = new Uint8Array([
13
+ 9, 160, 5, 231, 116, 123, 198, 14,
14
+ ]);
15
+ export function getClaimJobDiscriminatorBytes() {
16
+ return fixEncoderSize(getBytesEncoder(), 8).encode(CLAIM_JOB_DISCRIMINATOR);
17
+ }
18
+ export function getClaimJobInstructionDataEncoder() {
19
+ return transformEncoder(getStructEncoder([
20
+ ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
21
+ ["secs", getU32Encoder()],
22
+ ]), (value) => ({ ...value, discriminator: CLAIM_JOB_DISCRIMINATOR }));
23
+ }
24
+ export function getClaimJobInstructionDataDecoder() {
25
+ return getStructDecoder([
26
+ ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
27
+ ["secs", getU32Decoder()],
28
+ ]);
29
+ }
30
+ export function getClaimJobInstructionDataCodec() {
31
+ return combineCodec(getClaimJobInstructionDataEncoder(), getClaimJobInstructionDataDecoder());
32
+ }
33
+ export async function getClaimJobInstructionAsync(input, config) {
34
+ // Program address.
35
+ const programAddress = config?.programAddress ?? INTENT_ENGINE_PROGRAM_ADDRESS;
36
+ // Account meta helper.
37
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
38
+ // Original accounts.
39
+ const originalAccounts = {
40
+ worker: { value: input.worker ?? null, isSigner: true, isWritable: true },
41
+ intent: { value: input.intent ?? null, isSigner: false, isWritable: false },
42
+ board: { value: input.board ?? null, isSigner: false, isWritable: true },
43
+ owner: { value: input.owner ?? null, isSigner: false, isWritable: true },
44
+ systemProgram: {
45
+ value: input.systemProgram ?? null,
46
+ isSigner: false,
47
+ isWritable: false,
48
+ },
49
+ eventAuthority: {
50
+ value: input.eventAuthority ?? null,
51
+ isSigner: false,
52
+ isWritable: false,
53
+ },
54
+ program: {
55
+ value: input.program ?? null,
56
+ isSigner: false,
57
+ isWritable: false,
58
+ },
59
+ };
60
+ const accounts = originalAccounts;
61
+ // Original args.
62
+ const args = { ...input };
63
+ // Resolve default values.
64
+ if (!accounts.board.value) {
65
+ accounts.board.value = await findBoardPda({
66
+ intent: getAddressFromResolvedInstructionAccount("intent", accounts.intent.value),
67
+ }, { programAddress });
68
+ }
69
+ if (!accounts.systemProgram.value) {
70
+ accounts.systemProgram.value =
71
+ "11111111111111111111111111111111";
72
+ }
73
+ return Object.freeze({
74
+ accounts: [
75
+ getAccountMeta("worker", accounts.worker),
76
+ getAccountMeta("intent", accounts.intent),
77
+ getAccountMeta("board", accounts.board),
78
+ getAccountMeta("owner", accounts.owner),
79
+ getAccountMeta("systemProgram", accounts.systemProgram),
80
+ getAccountMeta("eventAuthority", accounts.eventAuthority),
81
+ getAccountMeta("program", accounts.program),
82
+ ],
83
+ data: getClaimJobInstructionDataEncoder().encode(args),
84
+ programAddress,
85
+ });
86
+ }
87
+ export function getClaimJobInstruction(input, config) {
88
+ // Program address.
89
+ const programAddress = config?.programAddress ?? INTENT_ENGINE_PROGRAM_ADDRESS;
90
+ // Account meta helper.
91
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
92
+ // Original accounts.
93
+ const originalAccounts = {
94
+ worker: { value: input.worker ?? null, isSigner: true, isWritable: true },
95
+ intent: { value: input.intent ?? null, isSigner: false, isWritable: false },
96
+ board: { value: input.board ?? null, isSigner: false, isWritable: true },
97
+ owner: { value: input.owner ?? null, isSigner: false, isWritable: true },
98
+ systemProgram: {
99
+ value: input.systemProgram ?? null,
100
+ isSigner: false,
101
+ isWritable: false,
102
+ },
103
+ eventAuthority: {
104
+ value: input.eventAuthority ?? null,
105
+ isSigner: false,
106
+ isWritable: false,
107
+ },
108
+ program: {
109
+ value: input.program ?? null,
110
+ isSigner: false,
111
+ isWritable: false,
112
+ },
113
+ };
114
+ const accounts = originalAccounts;
115
+ // Original args.
116
+ const args = { ...input };
117
+ // Resolve default values.
118
+ if (!accounts.systemProgram.value) {
119
+ accounts.systemProgram.value =
120
+ "11111111111111111111111111111111";
121
+ }
122
+ return Object.freeze({
123
+ accounts: [
124
+ getAccountMeta("worker", accounts.worker),
125
+ getAccountMeta("intent", accounts.intent),
126
+ getAccountMeta("board", accounts.board),
127
+ getAccountMeta("owner", accounts.owner),
128
+ getAccountMeta("systemProgram", accounts.systemProgram),
129
+ getAccountMeta("eventAuthority", accounts.eventAuthority),
130
+ getAccountMeta("program", accounts.program),
131
+ ],
132
+ data: getClaimJobInstructionDataEncoder().encode(args),
133
+ programAddress,
134
+ });
135
+ }
136
+ export function parseClaimJobInstruction(instruction) {
137
+ if (instruction.accounts.length < 7) {
138
+ throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
139
+ actualAccountMetas: instruction.accounts.length,
140
+ expectedAccountMetas: 7,
141
+ });
142
+ }
143
+ let accountIndex = 0;
144
+ const getNextAccount = () => {
145
+ const accountMeta = instruction.accounts[accountIndex];
146
+ accountIndex += 1;
147
+ return accountMeta;
148
+ };
149
+ return {
150
+ programAddress: instruction.programAddress,
151
+ accounts: {
152
+ worker: getNextAccount(),
153
+ intent: getNextAccount(),
154
+ board: getNextAccount(),
155
+ owner: getNextAccount(),
156
+ systemProgram: getNextAccount(),
157
+ eventAuthority: getNextAccount(),
158
+ program: getNextAccount(),
159
+ },
160
+ data: getClaimJobInstructionDataDecoder().decode(instruction.data),
161
+ };
162
+ }
163
+ //# sourceMappingURL=claimJob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claimJob.js","sourceRoot":"","sources":["../../../../generated/client/instructions/claimJob.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,yDAAyD,EACzD,WAAW,EACX,gBAAgB,GAcjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qBAAqB,EACrB,wCAAwC,GAMzC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAErE,MAAM,CAAC,MAAM,uBAAuB,GAAuB,IAAI,UAAU,CAAC;IACxE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;CAClC,CAAC,CAAC;AAEH,MAAM,UAAU,6BAA6B;IAC3C,OAAO,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;AAC9E,CAAC;AAkDD,MAAM,UAAU,iCAAiC;IAC/C,OAAO,gBAAgB,CACrB,gBAAgB,CAAC;QACf,CAAC,eAAe,EAAE,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC;QACvD,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC;KAC1B,CAAC,EACF,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,aAAa,EAAE,uBAAuB,EAAE,CAAC,CAClE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iCAAiC;IAC/C,OAAO,gBAAgB,CAAC;QACtB,CAAC,eAAe,EA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xB,MAAM,EAAE,cAAc,EAAE;YACxB,KAAK,EAAE,cAAc,EAAE;YACvB,KAAK,EAAE,cAAc,EAAE;YACvB,aAAa,EAAE,cAAc,EAAE;YAC/B,cAAc,EAAE,cAAc,EAAE;YAChC,OAAO,EAAE,cAAc,EAAE;SAC1B;QACD,IAAI,EAAE,iCAAiC,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;KACnE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,55 @@
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
+ import { type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlyUint8Array, type WritableAccount, type WritableSignerAccount } from "@solana/kit";
9
+ import { type InstructionAccountInput, type InstructionAccountInputAddress, type InstructionSignerInput, type ResolvedInstructionAccountMeta } from "@solana/kit/program-client-core";
10
+ import { INTENT_ENGINE_PROGRAM_ADDRESS } from "../programs/index.js";
11
+ export declare const CLOSE_PROFILE_DISCRIMINATOR: ReadonlyUint8Array;
12
+ export declare function getCloseProfileDiscriminatorBytes(): ReadonlyUint8Array;
13
+ export type CloseProfileInstruction<TProgram extends string = typeof INTENT_ENGINE_PROGRAM_ADDRESS, TAccountWallet extends string | AccountMeta<string> = string, TAccountProfile extends string | AccountMeta<string> = string, TAccountEventAuthority extends string | AccountMeta<string> = string, TAccountProgram extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
14
+ TAccountWallet extends string ? WritableSignerAccount<TAccountWallet> & AccountSignerMeta<TAccountWallet> : TAccountWallet,
15
+ TAccountProfile extends string ? WritableAccount<TAccountProfile> : TAccountProfile,
16
+ TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,
17
+ TAccountProgram extends string ? ReadonlyAccount<TAccountProgram> : TAccountProgram,
18
+ ...TRemainingAccounts
19
+ ]>;
20
+ export type CloseProfileInstructionData = {
21
+ discriminator: ReadonlyUint8Array;
22
+ };
23
+ export type CloseProfileInstructionDataArgs = {};
24
+ export declare function getCloseProfileInstructionDataEncoder(): FixedSizeEncoder<CloseProfileInstructionDataArgs>;
25
+ export declare function getCloseProfileInstructionDataDecoder(): FixedSizeDecoder<CloseProfileInstructionData>;
26
+ export declare function getCloseProfileInstructionDataCodec(): FixedSizeCodec<CloseProfileInstructionDataArgs, CloseProfileInstructionData>;
27
+ export type CloseProfileAsyncInput<TAccountWallet extends InstructionSignerInput = InstructionSignerInput, TAccountProfile extends InstructionAccountInput = InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput = InstructionAccountInput, TAccountProgram extends InstructionAccountInput = InstructionAccountInput> = {
28
+ wallet: TAccountWallet;
29
+ profile?: TAccountProfile;
30
+ eventAuthority: TAccountEventAuthority;
31
+ program: TAccountProgram;
32
+ };
33
+ export declare function getCloseProfileInstructionAsync<TAccountWallet extends InstructionSignerInput, TAccountProfile extends InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput, TAccountProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof INTENT_ENGINE_PROGRAM_ADDRESS>(input: CloseProfileAsyncInput<TAccountWallet, TAccountProfile, TAccountEventAuthority, TAccountProgram>, config?: {
34
+ programAddress?: TProgramAddress;
35
+ }): Promise<CloseProfileInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountWallet, InstructionAccountInputAddress<TAccountWallet>>, ResolvedInstructionAccountMeta<TAccountProfile, InstructionAccountInputAddress<TAccountProfile>>, ResolvedInstructionAccountMeta<TAccountEventAuthority, InstructionAccountInputAddress<TAccountEventAuthority>>, ResolvedInstructionAccountMeta<TAccountProgram, InstructionAccountInputAddress<TAccountProgram>>>>;
36
+ export type CloseProfileInput<TAccountWallet extends InstructionSignerInput = InstructionSignerInput, TAccountProfile extends InstructionAccountInput = InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput = InstructionAccountInput, TAccountProgram extends InstructionAccountInput = InstructionAccountInput> = {
37
+ wallet: TAccountWallet;
38
+ profile: TAccountProfile;
39
+ eventAuthority: TAccountEventAuthority;
40
+ program: TAccountProgram;
41
+ };
42
+ export declare function getCloseProfileInstruction<TAccountWallet extends InstructionSignerInput, TAccountProfile extends InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput, TAccountProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof INTENT_ENGINE_PROGRAM_ADDRESS>(input: CloseProfileInput<TAccountWallet, TAccountProfile, TAccountEventAuthority, TAccountProgram>, config?: {
43
+ programAddress?: TProgramAddress;
44
+ }): CloseProfileInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountWallet, InstructionAccountInputAddress<TAccountWallet>>, ResolvedInstructionAccountMeta<TAccountProfile, InstructionAccountInputAddress<TAccountProfile>>, ResolvedInstructionAccountMeta<TAccountEventAuthority, InstructionAccountInputAddress<TAccountEventAuthority>>, ResolvedInstructionAccountMeta<TAccountProgram, InstructionAccountInputAddress<TAccountProgram>>>;
45
+ export type ParsedCloseProfileInstruction<TProgram extends string = typeof INTENT_ENGINE_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
46
+ programAddress: Address<TProgram>;
47
+ accounts: {
48
+ wallet: TAccountMetas[0];
49
+ profile: TAccountMetas[1];
50
+ eventAuthority: TAccountMetas[2];
51
+ program: TAccountMetas[3];
52
+ };
53
+ data: CloseProfileInstructionData;
54
+ };
55
+ export declare function parseCloseProfileInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedCloseProfileInstruction<TProgram, TAccountMetas>;
@@ -0,0 +1,131 @@
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
+ import { combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SolanaError, transformEncoder, } from "@solana/kit";
9
+ import { getAccountMetaFactory, getAddressFromResolvedInstructionAccount, } from "@solana/kit/program-client-core";
10
+ import { findProfilePda } from "../pdas/index.js";
11
+ import { INTENT_ENGINE_PROGRAM_ADDRESS } from "../programs/index.js";
12
+ export const CLOSE_PROFILE_DISCRIMINATOR = new Uint8Array([
13
+ 167, 36, 181, 8, 136, 158, 46, 207,
14
+ ]);
15
+ export function getCloseProfileDiscriminatorBytes() {
16
+ return fixEncoderSize(getBytesEncoder(), 8).encode(CLOSE_PROFILE_DISCRIMINATOR);
17
+ }
18
+ export function getCloseProfileInstructionDataEncoder() {
19
+ return transformEncoder(getStructEncoder([["discriminator", fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({ ...value, discriminator: CLOSE_PROFILE_DISCRIMINATOR }));
20
+ }
21
+ export function getCloseProfileInstructionDataDecoder() {
22
+ return getStructDecoder([
23
+ ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
24
+ ]);
25
+ }
26
+ export function getCloseProfileInstructionDataCodec() {
27
+ return combineCodec(getCloseProfileInstructionDataEncoder(), getCloseProfileInstructionDataDecoder());
28
+ }
29
+ export async function getCloseProfileInstructionAsync(input, config) {
30
+ // Program address.
31
+ const programAddress = config?.programAddress ?? INTENT_ENGINE_PROGRAM_ADDRESS;
32
+ // Account meta helper.
33
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
34
+ // Original accounts.
35
+ const originalAccounts = {
36
+ wallet: { value: input.wallet ?? null, isSigner: true, isWritable: true },
37
+ profile: {
38
+ value: input.profile ?? null,
39
+ isSigner: false,
40
+ isWritable: true,
41
+ },
42
+ eventAuthority: {
43
+ value: input.eventAuthority ?? null,
44
+ isSigner: false,
45
+ isWritable: false,
46
+ },
47
+ program: {
48
+ value: input.program ?? null,
49
+ isSigner: false,
50
+ isWritable: false,
51
+ },
52
+ };
53
+ const accounts = originalAccounts;
54
+ // Resolve default values.
55
+ if (!accounts.profile.value) {
56
+ accounts.profile.value = await findProfilePda({
57
+ wallet: getAddressFromResolvedInstructionAccount("wallet", accounts.wallet.value),
58
+ }, { programAddress });
59
+ }
60
+ return Object.freeze({
61
+ accounts: [
62
+ getAccountMeta("wallet", accounts.wallet),
63
+ getAccountMeta("profile", accounts.profile),
64
+ getAccountMeta("eventAuthority", accounts.eventAuthority),
65
+ getAccountMeta("program", accounts.program),
66
+ ],
67
+ data: getCloseProfileInstructionDataEncoder().encode({}),
68
+ programAddress,
69
+ });
70
+ }
71
+ export function getCloseProfileInstruction(input, config) {
72
+ // Program address.
73
+ const programAddress = config?.programAddress ?? INTENT_ENGINE_PROGRAM_ADDRESS;
74
+ // Account meta helper.
75
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
76
+ // Original accounts.
77
+ const originalAccounts = {
78
+ wallet: { value: input.wallet ?? null, isSigner: true, isWritable: true },
79
+ profile: {
80
+ value: input.profile ?? null,
81
+ isSigner: false,
82
+ isWritable: true,
83
+ },
84
+ eventAuthority: {
85
+ value: input.eventAuthority ?? null,
86
+ isSigner: false,
87
+ isWritable: false,
88
+ },
89
+ program: {
90
+ value: input.program ?? null,
91
+ isSigner: false,
92
+ isWritable: false,
93
+ },
94
+ };
95
+ const accounts = originalAccounts;
96
+ return Object.freeze({
97
+ accounts: [
98
+ getAccountMeta("wallet", accounts.wallet),
99
+ getAccountMeta("profile", accounts.profile),
100
+ getAccountMeta("eventAuthority", accounts.eventAuthority),
101
+ getAccountMeta("program", accounts.program),
102
+ ],
103
+ data: getCloseProfileInstructionDataEncoder().encode({}),
104
+ programAddress,
105
+ });
106
+ }
107
+ export function parseCloseProfileInstruction(instruction) {
108
+ if (instruction.accounts.length < 4) {
109
+ throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
110
+ actualAccountMetas: instruction.accounts.length,
111
+ expectedAccountMetas: 4,
112
+ });
113
+ }
114
+ let accountIndex = 0;
115
+ const getNextAccount = () => {
116
+ const accountMeta = instruction.accounts[accountIndex];
117
+ accountIndex += 1;
118
+ return accountMeta;
119
+ };
120
+ return {
121
+ programAddress: instruction.programAddress,
122
+ accounts: {
123
+ wallet: getNextAccount(),
124
+ profile: getNextAccount(),
125
+ eventAuthority: getNextAccount(),
126
+ program: getNextAccount(),
127
+ },
128
+ data: getCloseProfileInstructionDataDecoder().decode(instruction.data),
129
+ };
130
+ }
131
+ //# sourceMappingURL=closeProfile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"closeProfile.js","sourceRoot":"","sources":["../../../../generated/client/instructions/closeProfile.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,yDAAyD,EACzD,WAAW,EACX,gBAAgB,GAcjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qBAAqB,EACrB,wCAAwC,GAMzC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAErE,MAAM,CAAC,MAAM,2BAA2B,GAAuB,IAAI,UAAU,CAAC;IAC5E,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG;CACnC,CAAC,CAAC;AAEH,MAAM,UAAU,iCAAiC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AAY,IAAI,CAAC,CAAC;QAClB,OAAO,WAAW,CAAC;IACrB,CAAC,CAAC;IACF,OAAO;QACL,cAAc,EAAE,WAAW,CAAC,cAAc;QAC1C,QAAQ,EAAE;YACR,MAAM,EAAE,cAAc,EAAE;YACxB,OAAO,EAAE,cAAc,EAAE;YACzB,cAAc,EAAE,cAAc,EAAE;YAChC,OAAO,EAAE,cAAc,EAAE;SAC1B;QACD,IAAI,EAAE,qCAAqC,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;KACvE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,76 @@
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
+ import { type AccountMeta, type AccountSignerMeta, type Address, type Codec, type Decoder, type Encoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlyUint8Array, type WritableAccount, type WritableSignerAccount } from "@solana/kit";
9
+ import { type InstructionAccountInput, type InstructionAccountInputAddress, type InstructionSignerInput, type ResolvedInstructionAccountMeta } from "@solana/kit/program-client-core";
10
+ import { INTENT_ENGINE_PROGRAM_ADDRESS } from "../programs/index.js";
11
+ export declare const CREATE_COMMITTEE_DISCRIMINATOR: ReadonlyUint8Array;
12
+ export declare function getCreateCommitteeDiscriminatorBytes(): ReadonlyUint8Array;
13
+ export type CreateCommitteeInstruction<TProgram extends string = typeof INTENT_ENGINE_PROGRAM_ADDRESS, TAccountPayer extends string | AccountMeta<string> = string, TAccountCommittee extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TAccountEventAuthority extends string | AccountMeta<string> = string, TAccountProgram extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
14
+ TAccountPayer extends string ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer> : TAccountPayer,
15
+ TAccountCommittee extends string ? WritableAccount<TAccountCommittee> : TAccountCommittee,
16
+ TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
17
+ TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,
18
+ TAccountProgram extends string ? ReadonlyAccount<TAccountProgram> : TAccountProgram,
19
+ ...TRemainingAccounts
20
+ ]>;
21
+ export type CreateCommitteeInstructionData = {
22
+ discriminator: ReadonlyUint8Array;
23
+ id: ReadonlyUint8Array;
24
+ members: Array<Address>;
25
+ threshold: number;
26
+ feeWallet: Address;
27
+ };
28
+ export type CreateCommitteeInstructionDataArgs = {
29
+ id: ReadonlyUint8Array;
30
+ members: Array<Address>;
31
+ threshold: number;
32
+ feeWallet: Address;
33
+ };
34
+ export declare function getCreateCommitteeInstructionDataEncoder(): Encoder<CreateCommitteeInstructionDataArgs>;
35
+ export declare function getCreateCommitteeInstructionDataDecoder(): Decoder<CreateCommitteeInstructionData>;
36
+ export declare function getCreateCommitteeInstructionDataCodec(): Codec<CreateCommitteeInstructionDataArgs, CreateCommitteeInstructionData>;
37
+ export type CreateCommitteeAsyncInput<TAccountPayer extends InstructionSignerInput = InstructionSignerInput, TAccountCommittee extends InstructionAccountInput = InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput = InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput = InstructionAccountInput, TAccountProgram extends InstructionAccountInput = InstructionAccountInput> = {
38
+ payer: TAccountPayer;
39
+ committee?: TAccountCommittee;
40
+ systemProgram?: TAccountSystemProgram;
41
+ eventAuthority: TAccountEventAuthority;
42
+ program: TAccountProgram;
43
+ id: CreateCommitteeInstructionDataArgs["id"];
44
+ members: CreateCommitteeInstructionDataArgs["members"];
45
+ threshold: CreateCommitteeInstructionDataArgs["threshold"];
46
+ feeWallet: CreateCommitteeInstructionDataArgs["feeWallet"];
47
+ };
48
+ export declare function getCreateCommitteeInstructionAsync<TAccountPayer extends InstructionSignerInput, TAccountCommittee extends InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput, TAccountProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof INTENT_ENGINE_PROGRAM_ADDRESS>(input: CreateCommitteeAsyncInput<TAccountPayer, TAccountCommittee, TAccountSystemProgram, TAccountEventAuthority, TAccountProgram>, config?: {
49
+ programAddress?: TProgramAddress;
50
+ }): Promise<CreateCommitteeInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountPayer, InstructionAccountInputAddress<TAccountPayer>>, ResolvedInstructionAccountMeta<TAccountCommittee, InstructionAccountInputAddress<TAccountCommittee>>, ResolvedInstructionAccountMeta<TAccountSystemProgram, InstructionAccountInputAddress<TAccountSystemProgram>>, ResolvedInstructionAccountMeta<TAccountEventAuthority, InstructionAccountInputAddress<TAccountEventAuthority>>, ResolvedInstructionAccountMeta<TAccountProgram, InstructionAccountInputAddress<TAccountProgram>>>>;
51
+ export type CreateCommitteeInput<TAccountPayer extends InstructionSignerInput = InstructionSignerInput, TAccountCommittee extends InstructionAccountInput = InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput = InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput = InstructionAccountInput, TAccountProgram extends InstructionAccountInput = InstructionAccountInput> = {
52
+ payer: TAccountPayer;
53
+ committee: TAccountCommittee;
54
+ systemProgram?: TAccountSystemProgram;
55
+ eventAuthority: TAccountEventAuthority;
56
+ program: TAccountProgram;
57
+ id: CreateCommitteeInstructionDataArgs["id"];
58
+ members: CreateCommitteeInstructionDataArgs["members"];
59
+ threshold: CreateCommitteeInstructionDataArgs["threshold"];
60
+ feeWallet: CreateCommitteeInstructionDataArgs["feeWallet"];
61
+ };
62
+ export declare function getCreateCommitteeInstruction<TAccountPayer extends InstructionSignerInput, TAccountCommittee extends InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput, TAccountProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof INTENT_ENGINE_PROGRAM_ADDRESS>(input: CreateCommitteeInput<TAccountPayer, TAccountCommittee, TAccountSystemProgram, TAccountEventAuthority, TAccountProgram>, config?: {
63
+ programAddress?: TProgramAddress;
64
+ }): CreateCommitteeInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountPayer, InstructionAccountInputAddress<TAccountPayer>>, ResolvedInstructionAccountMeta<TAccountCommittee, InstructionAccountInputAddress<TAccountCommittee>>, ResolvedInstructionAccountMeta<TAccountSystemProgram, InstructionAccountInputAddress<TAccountSystemProgram>>, ResolvedInstructionAccountMeta<TAccountEventAuthority, InstructionAccountInputAddress<TAccountEventAuthority>>, ResolvedInstructionAccountMeta<TAccountProgram, InstructionAccountInputAddress<TAccountProgram>>>;
65
+ export type ParsedCreateCommitteeInstruction<TProgram extends string = typeof INTENT_ENGINE_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
66
+ programAddress: Address<TProgram>;
67
+ accounts: {
68
+ payer: TAccountMetas[0];
69
+ committee: TAccountMetas[1];
70
+ systemProgram: TAccountMetas[2];
71
+ eventAuthority: TAccountMetas[3];
72
+ program: TAccountMetas[4];
73
+ };
74
+ data: CreateCommitteeInstructionData;
75
+ };
76
+ export declare function parseCreateCommitteeInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedCreateCommitteeInstruction<TProgram, TAccountMetas>;