@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 OPEN_CLAIMS_DISCRIMINATOR: ReadonlyUint8Array;
12
+ export declare function getOpenClaimsDiscriminatorBytes(): ReadonlyUint8Array;
13
+ export type OpenClaimsInstruction<TProgram extends string = typeof INTENT_ENGINE_PROGRAM_ADDRESS, TAccountOwner extends string | AccountMeta<string> = string, TAccountIntent extends string | AccountMeta<string> = string, TAccountBoard 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
+ TAccountOwner extends string ? WritableSignerAccount<TAccountOwner> & AccountSignerMeta<TAccountOwner> : TAccountOwner,
15
+ TAccountIntent extends string ? WritableAccount<TAccountIntent> : TAccountIntent,
16
+ TAccountBoard extends string ? WritableAccount<TAccountBoard> : TAccountBoard,
17
+ TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
18
+ TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,
19
+ TAccountProgram extends string ? ReadonlyAccount<TAccountProgram> : TAccountProgram,
20
+ ...TRemainingAccounts
21
+ ]>;
22
+ export type OpenClaimsInstructionData = {
23
+ discriminator: ReadonlyUint8Array;
24
+ maxSecs: number;
25
+ stake: bigint;
26
+ };
27
+ export type OpenClaimsInstructionDataArgs = {
28
+ maxSecs: number;
29
+ stake: number | bigint;
30
+ };
31
+ export declare function getOpenClaimsInstructionDataEncoder(): FixedSizeEncoder<OpenClaimsInstructionDataArgs>;
32
+ export declare function getOpenClaimsInstructionDataDecoder(): FixedSizeDecoder<OpenClaimsInstructionData>;
33
+ export declare function getOpenClaimsInstructionDataCodec(): FixedSizeCodec<OpenClaimsInstructionDataArgs, OpenClaimsInstructionData>;
34
+ export type OpenClaimsAsyncInput<TAccountOwner extends InstructionSignerInput = InstructionSignerInput, TAccountIntent extends InstructionAccountInput = InstructionAccountInput, TAccountBoard extends InstructionAccountInput = InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput = InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput = InstructionAccountInput, TAccountProgram extends InstructionAccountInput = InstructionAccountInput> = {
35
+ owner: TAccountOwner;
36
+ intent: TAccountIntent;
37
+ board?: TAccountBoard;
38
+ systemProgram?: TAccountSystemProgram;
39
+ eventAuthority: TAccountEventAuthority;
40
+ program: TAccountProgram;
41
+ maxSecs: OpenClaimsInstructionDataArgs["maxSecs"];
42
+ stake: OpenClaimsInstructionDataArgs["stake"];
43
+ };
44
+ export declare function getOpenClaimsInstructionAsync<TAccountOwner extends InstructionSignerInput, TAccountIntent extends InstructionAccountInput, TAccountBoard extends InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput, TAccountProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof INTENT_ENGINE_PROGRAM_ADDRESS>(input: OpenClaimsAsyncInput<TAccountOwner, TAccountIntent, TAccountBoard, TAccountSystemProgram, TAccountEventAuthority, TAccountProgram>, config?: {
45
+ programAddress?: TProgramAddress;
46
+ }): Promise<OpenClaimsInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountOwner, InstructionAccountInputAddress<TAccountOwner>>, ResolvedInstructionAccountMeta<TAccountIntent, InstructionAccountInputAddress<TAccountIntent>>, ResolvedInstructionAccountMeta<TAccountBoard, InstructionAccountInputAddress<TAccountBoard>>, ResolvedInstructionAccountMeta<TAccountSystemProgram, InstructionAccountInputAddress<TAccountSystemProgram>>, ResolvedInstructionAccountMeta<TAccountEventAuthority, InstructionAccountInputAddress<TAccountEventAuthority>>, ResolvedInstructionAccountMeta<TAccountProgram, InstructionAccountInputAddress<TAccountProgram>>>>;
47
+ export type OpenClaimsInput<TAccountOwner extends InstructionSignerInput = InstructionSignerInput, TAccountIntent extends InstructionAccountInput = InstructionAccountInput, TAccountBoard extends InstructionAccountInput = InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput = InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput = InstructionAccountInput, TAccountProgram extends InstructionAccountInput = InstructionAccountInput> = {
48
+ owner: TAccountOwner;
49
+ intent: TAccountIntent;
50
+ board: TAccountBoard;
51
+ systemProgram?: TAccountSystemProgram;
52
+ eventAuthority: TAccountEventAuthority;
53
+ program: TAccountProgram;
54
+ maxSecs: OpenClaimsInstructionDataArgs["maxSecs"];
55
+ stake: OpenClaimsInstructionDataArgs["stake"];
56
+ };
57
+ export declare function getOpenClaimsInstruction<TAccountOwner extends InstructionSignerInput, TAccountIntent extends InstructionAccountInput, TAccountBoard extends InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput, TAccountProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof INTENT_ENGINE_PROGRAM_ADDRESS>(input: OpenClaimsInput<TAccountOwner, TAccountIntent, TAccountBoard, TAccountSystemProgram, TAccountEventAuthority, TAccountProgram>, config?: {
58
+ programAddress?: TProgramAddress;
59
+ }): OpenClaimsInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountOwner, InstructionAccountInputAddress<TAccountOwner>>, ResolvedInstructionAccountMeta<TAccountIntent, InstructionAccountInputAddress<TAccountIntent>>, ResolvedInstructionAccountMeta<TAccountBoard, InstructionAccountInputAddress<TAccountBoard>>, ResolvedInstructionAccountMeta<TAccountSystemProgram, InstructionAccountInputAddress<TAccountSystemProgram>>, ResolvedInstructionAccountMeta<TAccountEventAuthority, InstructionAccountInputAddress<TAccountEventAuthority>>, ResolvedInstructionAccountMeta<TAccountProgram, InstructionAccountInputAddress<TAccountProgram>>>;
60
+ export type ParsedOpenClaimsInstruction<TProgram extends string = typeof INTENT_ENGINE_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
61
+ programAddress: Address<TProgram>;
62
+ accounts: {
63
+ owner: TAccountMetas[0];
64
+ intent: TAccountMetas[1];
65
+ board: TAccountMetas[2];
66
+ systemProgram: TAccountMetas[3];
67
+ eventAuthority: TAccountMetas[4];
68
+ program: TAccountMetas[5];
69
+ };
70
+ data: OpenClaimsInstructionData;
71
+ };
72
+ export declare function parseOpenClaimsInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedOpenClaimsInstruction<TProgram, TAccountMetas>;
@@ -0,0 +1,160 @@
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, getU64Decoder, getU64Encoder, 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 OPEN_CLAIMS_DISCRIMINATOR = new Uint8Array([
13
+ 111, 108, 90, 115, 178, 90, 24, 228,
14
+ ]);
15
+ export function getOpenClaimsDiscriminatorBytes() {
16
+ return fixEncoderSize(getBytesEncoder(), 8).encode(OPEN_CLAIMS_DISCRIMINATOR);
17
+ }
18
+ export function getOpenClaimsInstructionDataEncoder() {
19
+ return transformEncoder(getStructEncoder([
20
+ ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
21
+ ["maxSecs", getU32Encoder()],
22
+ ["stake", getU64Encoder()],
23
+ ]), (value) => ({ ...value, discriminator: OPEN_CLAIMS_DISCRIMINATOR }));
24
+ }
25
+ export function getOpenClaimsInstructionDataDecoder() {
26
+ return getStructDecoder([
27
+ ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
28
+ ["maxSecs", getU32Decoder()],
29
+ ["stake", getU64Decoder()],
30
+ ]);
31
+ }
32
+ export function getOpenClaimsInstructionDataCodec() {
33
+ return combineCodec(getOpenClaimsInstructionDataEncoder(), getOpenClaimsInstructionDataDecoder());
34
+ }
35
+ export async function getOpenClaimsInstructionAsync(input, config) {
36
+ // Program address.
37
+ const programAddress = config?.programAddress ?? INTENT_ENGINE_PROGRAM_ADDRESS;
38
+ // Account meta helper.
39
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
40
+ // Original accounts.
41
+ const originalAccounts = {
42
+ owner: { value: input.owner ?? null, isSigner: true, isWritable: true },
43
+ intent: { value: input.intent ?? null, isSigner: false, isWritable: true },
44
+ board: { value: input.board ?? null, isSigner: false, isWritable: true },
45
+ systemProgram: {
46
+ value: input.systemProgram ?? null,
47
+ isSigner: false,
48
+ isWritable: false,
49
+ },
50
+ eventAuthority: {
51
+ value: input.eventAuthority ?? null,
52
+ isSigner: false,
53
+ isWritable: false,
54
+ },
55
+ program: {
56
+ value: input.program ?? null,
57
+ isSigner: false,
58
+ isWritable: false,
59
+ },
60
+ };
61
+ const accounts = originalAccounts;
62
+ // Original args.
63
+ const args = { ...input };
64
+ // Resolve default values.
65
+ if (!accounts.board.value) {
66
+ accounts.board.value = await findBoardPda({
67
+ intent: getAddressFromResolvedInstructionAccount("intent", accounts.intent.value),
68
+ }, { programAddress });
69
+ }
70
+ if (!accounts.systemProgram.value) {
71
+ accounts.systemProgram.value =
72
+ "11111111111111111111111111111111";
73
+ }
74
+ return Object.freeze({
75
+ accounts: [
76
+ getAccountMeta("owner", accounts.owner),
77
+ getAccountMeta("intent", accounts.intent),
78
+ getAccountMeta("board", accounts.board),
79
+ getAccountMeta("systemProgram", accounts.systemProgram),
80
+ getAccountMeta("eventAuthority", accounts.eventAuthority),
81
+ getAccountMeta("program", accounts.program),
82
+ ],
83
+ data: getOpenClaimsInstructionDataEncoder().encode(args),
84
+ programAddress,
85
+ });
86
+ }
87
+ export function getOpenClaimsInstruction(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
+ owner: { value: input.owner ?? null, isSigner: true, isWritable: true },
95
+ intent: { value: input.intent ?? null, isSigner: false, isWritable: true },
96
+ board: { value: input.board ?? null, isSigner: false, isWritable: true },
97
+ systemProgram: {
98
+ value: input.systemProgram ?? null,
99
+ isSigner: false,
100
+ isWritable: false,
101
+ },
102
+ eventAuthority: {
103
+ value: input.eventAuthority ?? null,
104
+ isSigner: false,
105
+ isWritable: false,
106
+ },
107
+ program: {
108
+ value: input.program ?? null,
109
+ isSigner: false,
110
+ isWritable: false,
111
+ },
112
+ };
113
+ const accounts = originalAccounts;
114
+ // Original args.
115
+ const args = { ...input };
116
+ // Resolve default values.
117
+ if (!accounts.systemProgram.value) {
118
+ accounts.systemProgram.value =
119
+ "11111111111111111111111111111111";
120
+ }
121
+ return Object.freeze({
122
+ accounts: [
123
+ getAccountMeta("owner", accounts.owner),
124
+ getAccountMeta("intent", accounts.intent),
125
+ getAccountMeta("board", accounts.board),
126
+ getAccountMeta("systemProgram", accounts.systemProgram),
127
+ getAccountMeta("eventAuthority", accounts.eventAuthority),
128
+ getAccountMeta("program", accounts.program),
129
+ ],
130
+ data: getOpenClaimsInstructionDataEncoder().encode(args),
131
+ programAddress,
132
+ });
133
+ }
134
+ export function parseOpenClaimsInstruction(instruction) {
135
+ if (instruction.accounts.length < 6) {
136
+ throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
137
+ actualAccountMetas: instruction.accounts.length,
138
+ expectedAccountMetas: 6,
139
+ });
140
+ }
141
+ let accountIndex = 0;
142
+ const getNextAccount = () => {
143
+ const accountMeta = instruction.accounts[accountIndex];
144
+ accountIndex += 1;
145
+ return accountMeta;
146
+ };
147
+ return {
148
+ programAddress: instruction.programAddress,
149
+ accounts: {
150
+ owner: getNextAccount(),
151
+ intent: getNextAccount(),
152
+ board: getNextAccount(),
153
+ systemProgram: getNextAccount(),
154
+ eventAuthority: getNextAccount(),
155
+ program: getNextAccount(),
156
+ },
157
+ data: getOpenClaimsInstructionDataDecoder().decode(instruction.data),
158
+ };
159
+ }
160
+ //# sourceMappingURL=openClaims.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openClaims.js","sourceRoot":"","sources":["../../../../generated/client/instructions/openClaims.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,g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AQ,CAAC,OAAO,CAAC;SAC5C;QACD,IAAI,EAAE,mCAAmC,EAAE,CAAC,MAAM,CAChD,IAAqC,CACtC;QACD,cAAc;KA2Bf,CAAC,CAAC;AACL,CAAC;AAkBD,MAAM,UAAU,0BAA0B,CAIxC,WAEyC;IAEzC,IAAI,WAAW,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,WAAW,CACnB,yDAAyD,EACzD;YACE,kBAAkB,EAAE,WAAW,CAAC,QAAQ,CAAC,MAAM;YAC/C,oBAAoB,EAAE,CAAC;SACxB,CACF,CAAC;IACJ,CAAC;IACD,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,MAAM,WAAW,GAAI,WAAW,CAAC,QAA0B,CAAC,YAAY,CAAE,CAAC;QAC3E,YAAY,IAAI,CAAC,CAAC;QAClB,OAAO,WAAW,CAAC;IACrB,CAAC,CAAC;IACF,OAAO;QACL,cAAc,EAAE,WAAW,CAAC,cAAc;QAC1C,QAAQ,EAAE;YACR,KAAK,EAAE,cAAc,EAAE;YACvB,MAAM,EAAE,cAAc,EAAE;YACxB,KAAK,EAAE,cAAc,EAAE;YACvB,aAAa,EAAE,cAAc,EAAE;YAC/B,cAAc,EAAE,cAAc,EAAE;YAChC,OAAO,EAAE,cAAc,EAAE;SAC1B;QACD,IAAI,EAAE,mCAAmC,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;KACrE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,50 @@
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 ReadonlySignerAccount, type ReadonlyUint8Array, type WritableAccount } 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 SET_CAPS_REQUIRED_DISCRIMINATOR: ReadonlyUint8Array;
12
+ export declare function getSetCapsRequiredDiscriminatorBytes(): ReadonlyUint8Array;
13
+ export type SetCapsRequiredInstruction<TProgram extends string = typeof INTENT_ENGINE_PROGRAM_ADDRESS, TAccountAdmin extends string | AccountMeta<string> = string, TAccountConfig extends string | AccountMeta<string> = "6As2PgaNQ2DdSZMcrZeUJZ7RfyE2kXnVd33yxbgXULYz", TAccountEventAuthority extends string | AccountMeta<string> = string, TAccountProgram extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
14
+ TAccountAdmin extends string ? ReadonlySignerAccount<TAccountAdmin> & AccountSignerMeta<TAccountAdmin> : TAccountAdmin,
15
+ TAccountConfig extends string ? WritableAccount<TAccountConfig> : TAccountConfig,
16
+ TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,
17
+ TAccountProgram extends string ? ReadonlyAccount<TAccountProgram> : TAccountProgram,
18
+ ...TRemainingAccounts
19
+ ]>;
20
+ export type SetCapsRequiredInstructionData = {
21
+ discriminator: ReadonlyUint8Array;
22
+ required: boolean;
23
+ };
24
+ export type SetCapsRequiredInstructionDataArgs = {
25
+ required: boolean;
26
+ };
27
+ export declare function getSetCapsRequiredInstructionDataEncoder(): FixedSizeEncoder<SetCapsRequiredInstructionDataArgs>;
28
+ export declare function getSetCapsRequiredInstructionDataDecoder(): FixedSizeDecoder<SetCapsRequiredInstructionData>;
29
+ export declare function getSetCapsRequiredInstructionDataCodec(): FixedSizeCodec<SetCapsRequiredInstructionDataArgs, SetCapsRequiredInstructionData>;
30
+ export type SetCapsRequiredInput<TAccountAdmin extends InstructionSignerInput = InstructionSignerInput, TAccountConfig extends InstructionAccountInput = InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput = InstructionAccountInput, TAccountProgram extends InstructionAccountInput = InstructionAccountInput> = {
31
+ admin: TAccountAdmin;
32
+ config?: TAccountConfig;
33
+ eventAuthority: TAccountEventAuthority;
34
+ program: TAccountProgram;
35
+ required: SetCapsRequiredInstructionDataArgs["required"];
36
+ };
37
+ export declare function getSetCapsRequiredInstruction<TAccountAdmin extends InstructionSignerInput, TAccountConfig extends InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput, TAccountProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof INTENT_ENGINE_PROGRAM_ADDRESS>(input: SetCapsRequiredInput<TAccountAdmin, TAccountConfig, TAccountEventAuthority, TAccountProgram>, config?: {
38
+ programAddress?: TProgramAddress;
39
+ }): SetCapsRequiredInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountAdmin, InstructionAccountInputAddress<TAccountAdmin>>, ResolvedInstructionAccountMeta<TAccountConfig, InstructionAccountInputAddress<TAccountConfig>>, ResolvedInstructionAccountMeta<TAccountEventAuthority, InstructionAccountInputAddress<TAccountEventAuthority>>, ResolvedInstructionAccountMeta<TAccountProgram, InstructionAccountInputAddress<TAccountProgram>>>;
40
+ export type ParsedSetCapsRequiredInstruction<TProgram extends string = typeof INTENT_ENGINE_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
41
+ programAddress: Address<TProgram>;
42
+ accounts: {
43
+ admin: TAccountMetas[0];
44
+ config: TAccountMetas[1];
45
+ eventAuthority: TAccountMetas[2];
46
+ program: TAccountMetas[3];
47
+ };
48
+ data: SetCapsRequiredInstructionData;
49
+ };
50
+ export declare function parseSetCapsRequiredInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedSetCapsRequiredInstruction<TProgram, TAccountMetas>;
@@ -0,0 +1,93 @@
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, getBooleanDecoder, getBooleanEncoder, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SolanaError, transformEncoder, } from "@solana/kit";
9
+ import { getAccountMetaFactory, } from "@solana/kit/program-client-core";
10
+ import { INTENT_ENGINE_PROGRAM_ADDRESS } from "../programs/index.js";
11
+ export const SET_CAPS_REQUIRED_DISCRIMINATOR = new Uint8Array([28, 67, 121, 59, 229, 49, 30, 239]);
12
+ export function getSetCapsRequiredDiscriminatorBytes() {
13
+ return fixEncoderSize(getBytesEncoder(), 8).encode(SET_CAPS_REQUIRED_DISCRIMINATOR);
14
+ }
15
+ export function getSetCapsRequiredInstructionDataEncoder() {
16
+ return transformEncoder(getStructEncoder([
17
+ ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
18
+ ["required", getBooleanEncoder()],
19
+ ]), (value) => ({ ...value, discriminator: SET_CAPS_REQUIRED_DISCRIMINATOR }));
20
+ }
21
+ export function getSetCapsRequiredInstructionDataDecoder() {
22
+ return getStructDecoder([
23
+ ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
24
+ ["required", getBooleanDecoder()],
25
+ ]);
26
+ }
27
+ export function getSetCapsRequiredInstructionDataCodec() {
28
+ return combineCodec(getSetCapsRequiredInstructionDataEncoder(), getSetCapsRequiredInstructionDataDecoder());
29
+ }
30
+ export function getSetCapsRequiredInstruction(input, config) {
31
+ // Program address.
32
+ const programAddress = config?.programAddress ?? INTENT_ENGINE_PROGRAM_ADDRESS;
33
+ // Account meta helper.
34
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
35
+ // Original accounts.
36
+ const originalAccounts = {
37
+ admin: { value: input.admin ?? null, isSigner: true, isWritable: false },
38
+ config: { value: input.config ?? null, isSigner: false, isWritable: true },
39
+ eventAuthority: {
40
+ value: input.eventAuthority ?? null,
41
+ isSigner: false,
42
+ isWritable: false,
43
+ },
44
+ program: {
45
+ value: input.program ?? null,
46
+ isSigner: false,
47
+ isWritable: false,
48
+ },
49
+ };
50
+ const accounts = originalAccounts;
51
+ // Original args.
52
+ const args = { ...input };
53
+ // Resolve default values.
54
+ if (!accounts.config.value) {
55
+ accounts.config.value =
56
+ "6As2PgaNQ2DdSZMcrZeUJZ7RfyE2kXnVd33yxbgXULYz";
57
+ }
58
+ return Object.freeze({
59
+ accounts: [
60
+ getAccountMeta("admin", accounts.admin),
61
+ getAccountMeta("config", accounts.config),
62
+ getAccountMeta("eventAuthority", accounts.eventAuthority),
63
+ getAccountMeta("program", accounts.program),
64
+ ],
65
+ data: getSetCapsRequiredInstructionDataEncoder().encode(args),
66
+ programAddress,
67
+ });
68
+ }
69
+ export function parseSetCapsRequiredInstruction(instruction) {
70
+ if (instruction.accounts.length < 4) {
71
+ throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
72
+ actualAccountMetas: instruction.accounts.length,
73
+ expectedAccountMetas: 4,
74
+ });
75
+ }
76
+ let accountIndex = 0;
77
+ const getNextAccount = () => {
78
+ const accountMeta = instruction.accounts[accountIndex];
79
+ accountIndex += 1;
80
+ return accountMeta;
81
+ };
82
+ return {
83
+ programAddress: instruction.programAddress,
84
+ accounts: {
85
+ admin: getNextAccount(),
86
+ config: getNextAccount(),
87
+ eventAuthority: getNextAccount(),
88
+ program: getNextAccount(),
89
+ },
90
+ data: getSetCapsRequiredInstructionDataDecoder().decode(instruction.data),
91
+ };
92
+ }
93
+ //# sourceMappingURL=setCapsRequired.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setCapsRequired.js","sourceRoot":"","sources":["../../../../generated/client/instructions/setCapsRequired.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,yDAAyD,EACzD,WAAW,EACX,gBAAgB,GAcjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qBAAqB,GAMtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAErE,MAAM,CAAC,MAAM,+BAA+B,GAC1C,IAAI,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;AAEtD,MAAM,UAAU,oCAAoC;IAClD,OAAO,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAChD,+BAA+B,CAChC,CAAC;AACJ,CAAC;AAsCD,MAAM,UAAU,wCAAwC;IACtD,OAAO,gBAAgB,CACrB,gBAAgB,CAAC;QACf,CAAC,eAAe,EAAE,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC;QACvD,CAAC,UAAU,EAAE,iBAAiB,EAAE,CAAC;KAClC,CAAC,EACF,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,aAAa,EAAE,+BAA+B,EAAE,CAAC,CAC1E,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wCAAwC;IACtD,OAAO,gBAAgB,CAAC;QACtB,CAAC,eAAe,EAAE,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC;QACvD,CAAC,UAAU,EAAE,iBAAiB,EAAE,C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EAAE,QAAQ,CAAC,KAAK,CAAC;YACvC,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC;YACzC,cAAc,CAAC,gBAAgB,EAAE,QAAQ,CAAC,cAAc,CAAC;YACzD,cAAc,CAAC,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC;SAC5C;QACD,IAAI,EAAE,wCAAwC,EAAE,CAAC,MAAM,CACrD,IAA0C,CAC3C;QACD,cAAc;KAmBf,CAAC,CAAC;AACL,CAAC;AAgBD,MAAM,UAAU,+BAA+B,CAI7C,WAEyC;IAEzC,IAAI,WAAW,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,WAAW,CACnB,yDAAyD,EACzD;YACE,kBAAkB,EAAE,WAAW,CAAC,QAAQ,CAAC,MAAM;YAC/C,oBAAoB,EAAE,CAAC;SACxB,CACF,CAAC;IACJ,CAAC;IACD,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,MAAM,WAAW,GAAI,WAAW,CAAC,QAA0B,CAAC,YAAY,CAAE,CAAC;QAC3E,YAAY,IAAI,CAAC,CAAC;QAClB,OAAO,WAAW,CAAC;IACrB,CAAC,CAAC;IACF,OAAO;QACL,cAAc,EAAE,WAAW,CAAC,cAAc;QAC1C,QAAQ,EAAE;YACR,KAAK,EAAE,cAAc,EAAE;YACvB,MAAM,EAAE,cAAc,EAAE;YACxB,cAAc,EAAE,cAAc,EAAE;YAChC,OAAO,EAAE,cAAc,EAAE;SAC1B;QACD,IAAI,EAAE,wCAAwC,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;KAC1E,CAAC;AACJ,CAAC"}
@@ -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
+ import { type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlySignerAccount, 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 SET_MINT_CAP_DISCRIMINATOR: ReadonlyUint8Array;
12
+ export declare function getSetMintCapDiscriminatorBytes(): ReadonlyUint8Array;
13
+ export type SetMintCapInstruction<TProgram extends string = typeof INTENT_ENGINE_PROGRAM_ADDRESS, TAccountAdmin extends string | AccountMeta<string> = string, TAccountPayer extends string | AccountMeta<string> = string, TAccountConfig extends string | AccountMeta<string> = "6As2PgaNQ2DdSZMcrZeUJZ7RfyE2kXnVd33yxbgXULYz", TAccountMint extends string | AccountMeta<string> = string, TAccountMintCap 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
+ TAccountAdmin extends string ? ReadonlySignerAccount<TAccountAdmin> & AccountSignerMeta<TAccountAdmin> : TAccountAdmin,
15
+ TAccountPayer extends string ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer> : TAccountPayer,
16
+ TAccountConfig extends string ? ReadonlyAccount<TAccountConfig> : TAccountConfig,
17
+ TAccountMint extends string ? ReadonlyAccount<TAccountMint> : TAccountMint,
18
+ TAccountMintCap extends string ? WritableAccount<TAccountMintCap> : TAccountMintCap,
19
+ TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
20
+ TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,
21
+ TAccountProgram extends string ? ReadonlyAccount<TAccountProgram> : TAccountProgram,
22
+ ...TRemainingAccounts
23
+ ]>;
24
+ export type SetMintCapInstructionData = {
25
+ discriminator: ReadonlyUint8Array;
26
+ maxPerOrder: bigint;
27
+ windowCap: bigint;
28
+ windowSecs: number;
29
+ };
30
+ export type SetMintCapInstructionDataArgs = {
31
+ maxPerOrder: number | bigint;
32
+ windowCap: number | bigint;
33
+ windowSecs: number;
34
+ };
35
+ export declare function getSetMintCapInstructionDataEncoder(): FixedSizeEncoder<SetMintCapInstructionDataArgs>;
36
+ export declare function getSetMintCapInstructionDataDecoder(): FixedSizeDecoder<SetMintCapInstructionData>;
37
+ export declare function getSetMintCapInstructionDataCodec(): FixedSizeCodec<SetMintCapInstructionDataArgs, SetMintCapInstructionData>;
38
+ export type SetMintCapAsyncInput<TAccountAdmin extends InstructionSignerInput = InstructionSignerInput, TAccountPayer extends InstructionSignerInput = InstructionSignerInput, TAccountConfig extends InstructionAccountInput = InstructionAccountInput, TAccountMint extends InstructionAccountInput = InstructionAccountInput, TAccountMintCap extends InstructionAccountInput = InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput = InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput = InstructionAccountInput, TAccountProgram extends InstructionAccountInput = InstructionAccountInput> = {
39
+ admin: TAccountAdmin;
40
+ payer: TAccountPayer;
41
+ config?: TAccountConfig;
42
+ mint: TAccountMint;
43
+ mintCap?: TAccountMintCap;
44
+ systemProgram?: TAccountSystemProgram;
45
+ eventAuthority: TAccountEventAuthority;
46
+ program: TAccountProgram;
47
+ maxPerOrder: SetMintCapInstructionDataArgs["maxPerOrder"];
48
+ windowCap: SetMintCapInstructionDataArgs["windowCap"];
49
+ windowSecs: SetMintCapInstructionDataArgs["windowSecs"];
50
+ };
51
+ export declare function getSetMintCapInstructionAsync<TAccountAdmin extends InstructionSignerInput, TAccountPayer extends InstructionSignerInput, TAccountConfig extends InstructionAccountInput, TAccountMint extends InstructionAccountInput, TAccountMintCap extends InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput, TAccountProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof INTENT_ENGINE_PROGRAM_ADDRESS>(input: SetMintCapAsyncInput<TAccountAdmin, TAccountPayer, TAccountConfig, TAccountMint, TAccountMintCap, TAccountSystemProgram, TAccountEventAuthority, TAccountProgram>, config?: {
52
+ programAddress?: TProgramAddress;
53
+ }): Promise<SetMintCapInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountAdmin, InstructionAccountInputAddress<TAccountAdmin>>, ResolvedInstructionAccountMeta<TAccountPayer, InstructionAccountInputAddress<TAccountPayer>>, ResolvedInstructionAccountMeta<TAccountConfig, InstructionAccountInputAddress<TAccountConfig>>, ResolvedInstructionAccountMeta<TAccountMint, InstructionAccountInputAddress<TAccountMint>>, ResolvedInstructionAccountMeta<TAccountMintCap, InstructionAccountInputAddress<TAccountMintCap>>, ResolvedInstructionAccountMeta<TAccountSystemProgram, InstructionAccountInputAddress<TAccountSystemProgram>>, ResolvedInstructionAccountMeta<TAccountEventAuthority, InstructionAccountInputAddress<TAccountEventAuthority>>, ResolvedInstructionAccountMeta<TAccountProgram, InstructionAccountInputAddress<TAccountProgram>>>>;
54
+ export type SetMintCapInput<TAccountAdmin extends InstructionSignerInput = InstructionSignerInput, TAccountPayer extends InstructionSignerInput = InstructionSignerInput, TAccountConfig extends InstructionAccountInput = InstructionAccountInput, TAccountMint extends InstructionAccountInput = InstructionAccountInput, TAccountMintCap extends InstructionAccountInput = InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput = InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput = InstructionAccountInput, TAccountProgram extends InstructionAccountInput = InstructionAccountInput> = {
55
+ admin: TAccountAdmin;
56
+ payer: TAccountPayer;
57
+ config?: TAccountConfig;
58
+ mint: TAccountMint;
59
+ mintCap: TAccountMintCap;
60
+ systemProgram?: TAccountSystemProgram;
61
+ eventAuthority: TAccountEventAuthority;
62
+ program: TAccountProgram;
63
+ maxPerOrder: SetMintCapInstructionDataArgs["maxPerOrder"];
64
+ windowCap: SetMintCapInstructionDataArgs["windowCap"];
65
+ windowSecs: SetMintCapInstructionDataArgs["windowSecs"];
66
+ };
67
+ export declare function getSetMintCapInstruction<TAccountAdmin extends InstructionSignerInput, TAccountPayer extends InstructionSignerInput, TAccountConfig extends InstructionAccountInput, TAccountMint extends InstructionAccountInput, TAccountMintCap extends InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput, TAccountProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof INTENT_ENGINE_PROGRAM_ADDRESS>(input: SetMintCapInput<TAccountAdmin, TAccountPayer, TAccountConfig, TAccountMint, TAccountMintCap, TAccountSystemProgram, TAccountEventAuthority, TAccountProgram>, config?: {
68
+ programAddress?: TProgramAddress;
69
+ }): SetMintCapInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountAdmin, InstructionAccountInputAddress<TAccountAdmin>>, ResolvedInstructionAccountMeta<TAccountPayer, InstructionAccountInputAddress<TAccountPayer>>, ResolvedInstructionAccountMeta<TAccountConfig, InstructionAccountInputAddress<TAccountConfig>>, ResolvedInstructionAccountMeta<TAccountMint, InstructionAccountInputAddress<TAccountMint>>, ResolvedInstructionAccountMeta<TAccountMintCap, InstructionAccountInputAddress<TAccountMintCap>>, ResolvedInstructionAccountMeta<TAccountSystemProgram, InstructionAccountInputAddress<TAccountSystemProgram>>, ResolvedInstructionAccountMeta<TAccountEventAuthority, InstructionAccountInputAddress<TAccountEventAuthority>>, ResolvedInstructionAccountMeta<TAccountProgram, InstructionAccountInputAddress<TAccountProgram>>>;
70
+ export type ParsedSetMintCapInstruction<TProgram extends string = typeof INTENT_ENGINE_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
71
+ programAddress: Address<TProgram>;
72
+ accounts: {
73
+ admin: TAccountMetas[0];
74
+ payer: TAccountMetas[1];
75
+ config: TAccountMetas[2];
76
+ mint: TAccountMetas[3];
77
+ mintCap: TAccountMetas[4];
78
+ systemProgram: TAccountMetas[5];
79
+ eventAuthority: TAccountMetas[6];
80
+ program: TAccountMetas[7];
81
+ };
82
+ data: SetMintCapInstructionData;
83
+ };
84
+ export declare function parseSetMintCapInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedSetMintCapInstruction<TProgram, TAccountMetas>;