@intent-engine/core 0.1.41 → 0.1.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/client/accounts/claimBoard.d.ts +4 -0
- package/dist/generated/client/accounts/claimBoard.js +5 -1
- package/dist/generated/client/accounts/claimBoard.js.map +1 -1
- package/dist/generated/client/accounts/config.d.ts +4 -0
- package/dist/generated/client/accounts/config.js +5 -1
- package/dist/generated/client/accounts/config.js.map +1 -1
- package/dist/generated/client/accounts/index.d.ts +1 -0
- package/dist/generated/client/accounts/index.js +1 -0
- package/dist/generated/client/accounts/index.js.map +1 -1
- package/dist/generated/client/accounts/intent.d.ts +6 -2
- package/dist/generated/client/accounts/intent.js +8 -4
- package/dist/generated/client/accounts/intent.js.map +1 -1
- package/dist/generated/client/accounts/mintCap.d.ts +6 -0
- package/dist/generated/client/accounts/mintCap.js +8 -2
- package/dist/generated/client/accounts/mintCap.js.map +1 -1
- package/dist/generated/client/accounts/profile.d.ts +2 -2
- package/dist/generated/client/accounts/profile.js +2 -2
- package/dist/generated/client/accounts/profile.js.map +1 -1
- package/dist/generated/client/accounts/standby.d.ts +42 -0
- package/dist/generated/client/accounts/standby.js +69 -0
- package/dist/generated/client/accounts/standby.js.map +1 -0
- package/dist/generated/client/errors/intentEngine.d.ts +33 -1
- package/dist/generated/client/errors/intentEngine.js +48 -0
- package/dist/generated/client/errors/intentEngine.js.map +1 -1
- package/dist/generated/client/events/accountMigrated.d.ts +38 -0
- package/dist/generated/client/events/accountMigrated.js +50 -0
- package/dist/generated/client/events/accountMigrated.js.map +1 -0
- package/dist/generated/client/events/committeeFloorSet.d.ts +26 -0
- package/dist/generated/client/events/committeeFloorSet.js +38 -0
- package/dist/generated/client/events/committeeFloorSet.js.map +1 -0
- package/dist/generated/client/events/index.d.ts +5 -0
- package/dist/generated/client/events/index.js +5 -0
- package/dist/generated/client/events/index.js.map +1 -1
- package/dist/generated/client/events/legacyClosed.d.ts +30 -0
- package/dist/generated/client/events/legacyClosed.js +42 -0
- package/dist/generated/client/events/legacyClosed.js.map +1 -0
- package/dist/generated/client/events/lineLeft.d.ts +30 -0
- package/dist/generated/client/events/lineLeft.js +42 -0
- package/dist/generated/client/events/lineLeft.js.map +1 -0
- package/dist/generated/client/events/mintCapSet.d.ts +4 -0
- package/dist/generated/client/events/mintCapSet.js +4 -0
- package/dist/generated/client/events/mintCapSet.js.map +1 -1
- package/dist/generated/client/events/profileSet.d.ts +1 -0
- package/dist/generated/client/events/profileSet.js +2 -0
- package/dist/generated/client/events/profileSet.js.map +1 -1
- package/dist/generated/client/events/stoodBy.d.ts +32 -0
- package/dist/generated/client/events/stoodBy.js +46 -0
- package/dist/generated/client/events/stoodBy.js.map +1 -0
- package/dist/generated/client/instructions/advance.d.ts +79 -0
- package/dist/generated/client/instructions/advance.js +167 -0
- package/dist/generated/client/instructions/advance.js.map +1 -0
- package/dist/generated/client/instructions/beginFill.d.ts +13 -9
- package/dist/generated/client/instructions/beginFill.js +15 -2
- package/dist/generated/client/instructions/beginFill.js.map +1 -1
- package/dist/generated/client/instructions/cancelIntent.d.ts +13 -9
- package/dist/generated/client/instructions/cancelIntent.js +15 -2
- package/dist/generated/client/instructions/cancelIntent.js.map +1 -1
- package/dist/generated/client/instructions/claimJob.d.ts +13 -9
- package/dist/generated/client/instructions/claimJob.js +15 -2
- package/dist/generated/client/instructions/claimJob.js.map +1 -1
- package/dist/generated/client/instructions/closeIntent.d.ts +13 -9
- package/dist/generated/client/instructions/closeIntent.js +21 -2
- package/dist/generated/client/instructions/closeIntent.js.map +1 -1
- package/dist/generated/client/instructions/closeLegacy.d.ts +61 -0
- package/dist/generated/client/instructions/closeLegacy.js +113 -0
- package/dist/generated/client/instructions/closeLegacy.js.map +1 -0
- package/dist/generated/client/instructions/createIntent.d.ts +14 -10
- package/dist/generated/client/instructions/createIntent.js +15 -2
- package/dist/generated/client/instructions/createIntent.js.map +1 -1
- package/dist/generated/client/instructions/createIntentSigned.d.ts +14 -10
- package/dist/generated/client/instructions/createIntentSigned.js +15 -2
- package/dist/generated/client/instructions/createIntentSigned.js.map +1 -1
- package/dist/generated/client/instructions/dropClaim.d.ts +29 -9
- package/dist/generated/client/instructions/dropClaim.js +41 -2
- package/dist/generated/client/instructions/dropClaim.js.map +1 -1
- package/dist/generated/client/instructions/expireIntent.d.ts +13 -9
- package/dist/generated/client/instructions/expireIntent.js +21 -2
- package/dist/generated/client/instructions/expireIntent.js.map +1 -1
- package/dist/generated/client/instructions/fillAttested.d.ts +13 -9
- package/dist/generated/client/instructions/fillAttested.js +15 -2
- package/dist/generated/client/instructions/fillAttested.js.map +1 -1
- package/dist/generated/client/instructions/fillAttestedCommittee.d.ts +13 -9
- package/dist/generated/client/instructions/fillAttestedCommittee.js +15 -2
- package/dist/generated/client/instructions/fillAttestedCommittee.js.map +1 -1
- package/dist/generated/client/instructions/fillAttestedSplit.d.ts +13 -9
- package/dist/generated/client/instructions/fillAttestedSplit.js +15 -2
- package/dist/generated/client/instructions/fillAttestedSplit.js.map +1 -1
- package/dist/generated/client/instructions/fillAttestedSplitCommittee.d.ts +13 -9
- package/dist/generated/client/instructions/fillAttestedSplitCommittee.js +15 -2
- package/dist/generated/client/instructions/fillAttestedSplitCommittee.js.map +1 -1
- package/dist/generated/client/instructions/fillIntent.d.ts +13 -9
- package/dist/generated/client/instructions/fillIntent.js +15 -2
- package/dist/generated/client/instructions/fillIntent.js.map +1 -1
- package/dist/generated/client/instructions/index.d.ts +6 -0
- package/dist/generated/client/instructions/index.js +6 -0
- package/dist/generated/client/instructions/index.js.map +1 -1
- package/dist/generated/client/instructions/leave.d.ts +68 -0
- package/dist/generated/client/instructions/leave.js +142 -0
- package/dist/generated/client/instructions/leave.js.map +1 -0
- package/dist/generated/client/instructions/migrate.d.ts +52 -0
- package/dist/generated/client/instructions/migrate.js +109 -0
- package/dist/generated/client/instructions/migrate.js.map +1 -0
- package/dist/generated/client/instructions/setCommitteeFloor.d.ts +53 -0
- package/dist/generated/client/instructions/setCommitteeFloor.js +96 -0
- package/dist/generated/client/instructions/setCommitteeFloor.js.map +1 -0
- package/dist/generated/client/instructions/setMintCap.d.ts +4 -0
- package/dist/generated/client/instructions/setMintCap.js +2 -0
- package/dist/generated/client/instructions/setMintCap.js.map +1 -1
- package/dist/generated/client/instructions/standBy.d.ts +76 -0
- package/dist/generated/client/instructions/standBy.js +176 -0
- package/dist/generated/client/instructions/standBy.js.map +1 -0
- package/dist/generated/client/pdas/entry.d.ts +15 -0
- package/dist/generated/client/pdas/entry.js +20 -0
- package/dist/generated/client/pdas/entry.js.map +1 -0
- package/dist/generated/client/pdas/index.d.ts +1 -0
- package/dist/generated/client/pdas/index.js +1 -0
- package/dist/generated/client/pdas/index.js.map +1 -1
- package/dist/generated/client/programs/intentEngine.d.ts +190 -146
- package/dist/generated/client/programs/intentEngine.js +259 -146
- package/dist/generated/client/programs/intentEngine.js.map +1 -1
- package/dist/generated/client/types/profileFields.d.ts +1 -0
- package/dist/generated/client/types/profileFields.js +2 -0
- package/dist/generated/client/types/profileFields.js.map +1 -1
- package/dist/src/claims.d.ts +33 -3
- package/dist/src/claims.js +54 -2
- package/dist/src/claims.js.map +1 -1
- package/dist/src/committee-floors.d.ts +21 -0
- package/dist/src/committee-floors.js +27 -0
- package/dist/src/committee-floors.js.map +1 -0
- package/dist/src/committee.d.ts +4 -4
- package/dist/src/committee.js +14 -17
- package/dist/src/committee.js.map +1 -1
- package/dist/src/encryption-key.d.ts +28 -0
- package/dist/src/encryption-key.js +94 -0
- package/dist/src/encryption-key.js.map +1 -0
- package/dist/src/errors.d.ts +1 -1
- package/dist/src/errors.js +3 -0
- package/dist/src/errors.js.map +1 -1
- package/dist/src/events.d.ts +6 -1
- package/dist/src/events.js +7 -1
- package/dist/src/events.js.map +1 -1
- package/dist/src/fill-builders.d.ts +7 -5
- package/dist/src/fill-builders.js +4 -0
- package/dist/src/fill-builders.js.map +1 -1
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/intent-builders.d.ts +8 -6
- package/dist/src/intent-builders.js +6 -1
- package/dist/src/intent-builders.js.map +1 -1
- package/dist/src/memo.d.ts +7 -1
- package/dist/src/memo.js +18 -4
- package/dist/src/memo.js.map +1 -1
- package/dist/src/migrate.d.ts +25 -0
- package/dist/src/migrate.js +46 -0
- package/dist/src/migrate.js.map +1 -0
- package/dist/src/mint-caps.d.ts +5 -1
- package/dist/src/mint-caps.js +13 -2
- package/dist/src/mint-caps.js.map +1 -1
- package/dist/src/profile.d.ts +2 -0
- package/dist/src/profile.js +13 -4
- package/dist/src/profile.js.map +1 -1
- package/dist/src/sealed-delivery.d.ts +54 -10
- package/dist/src/sealed-delivery.js +183 -55
- package/dist/src/sealed-delivery.js.map +1 -1
- package/dist/src/sealed.d.ts +1 -0
- package/dist/src/sealed.js +2 -2
- package/dist/src/sealed.js.map +1 -1
- package/dist/src/sig.d.ts +17 -4
- package/dist/src/sig.js +80 -10
- package/dist/src/sig.js.map +1 -1
- package/dist/src/state.d.ts +3 -3
- package/dist/src/state.js +3 -3
- package/dist/src/versions.d.ts +56 -0
- package/dist/src/versions.js +126 -0
- package/dist/src/versions.js.map +1 -0
- package/generated/idl.json +996 -45
- package/package.json +2 -1
|
@@ -0,0 +1,68 @@
|
|
|
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 LEAVE_DISCRIMINATOR: ReadonlyUint8Array;
|
|
12
|
+
export declare function getLeaveDiscriminatorBytes(): ReadonlyUint8Array;
|
|
13
|
+
export type LeaveInstruction<TProgram extends string = typeof INTENT_ENGINE_PROGRAM_ADDRESS, TAccountCaller extends string | AccountMeta<string> = string, TAccountIntent extends string | AccountMeta<string> = string, TAccountEntry extends string | AccountMeta<string> = string, TAccountWorker 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
|
+
TAccountCaller extends string ? ReadonlySignerAccount<TAccountCaller> & AccountSignerMeta<TAccountCaller> : TAccountCaller,
|
|
15
|
+
TAccountIntent extends string ? ReadonlyAccount<TAccountIntent> : TAccountIntent,
|
|
16
|
+
TAccountEntry extends string ? WritableAccount<TAccountEntry> : TAccountEntry,
|
|
17
|
+
TAccountWorker extends string ? WritableAccount<TAccountWorker> : TAccountWorker,
|
|
18
|
+
TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,
|
|
19
|
+
TAccountProgram extends string ? ReadonlyAccount<TAccountProgram> : TAccountProgram,
|
|
20
|
+
...TRemainingAccounts
|
|
21
|
+
]>;
|
|
22
|
+
export type LeaveInstructionData = {
|
|
23
|
+
discriminator: ReadonlyUint8Array;
|
|
24
|
+
seq: number;
|
|
25
|
+
};
|
|
26
|
+
export type LeaveInstructionDataArgs = {
|
|
27
|
+
seq: number;
|
|
28
|
+
};
|
|
29
|
+
export declare function getLeaveInstructionDataEncoder(): FixedSizeEncoder<LeaveInstructionDataArgs>;
|
|
30
|
+
export declare function getLeaveInstructionDataDecoder(): FixedSizeDecoder<LeaveInstructionData>;
|
|
31
|
+
export declare function getLeaveInstructionDataCodec(): FixedSizeCodec<LeaveInstructionDataArgs, LeaveInstructionData>;
|
|
32
|
+
export type LeaveAsyncInput<TAccountCaller extends InstructionSignerInput = InstructionSignerInput, TAccountIntent extends InstructionAccountInput = InstructionAccountInput, TAccountEntry extends InstructionAccountInput = InstructionAccountInput, TAccountWorker extends InstructionAccountInput = InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput = InstructionAccountInput, TAccountProgram extends InstructionAccountInput = InstructionAccountInput> = {
|
|
33
|
+
caller: TAccountCaller;
|
|
34
|
+
intent: TAccountIntent;
|
|
35
|
+
entry?: TAccountEntry;
|
|
36
|
+
worker: TAccountWorker;
|
|
37
|
+
eventAuthority: TAccountEventAuthority;
|
|
38
|
+
program: TAccountProgram;
|
|
39
|
+
seq: LeaveInstructionDataArgs["seq"];
|
|
40
|
+
};
|
|
41
|
+
export declare function getLeaveInstructionAsync<TAccountCaller extends InstructionSignerInput, TAccountIntent extends InstructionAccountInput, TAccountEntry extends InstructionAccountInput, TAccountWorker extends InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput, TAccountProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof INTENT_ENGINE_PROGRAM_ADDRESS>(input: LeaveAsyncInput<TAccountCaller, TAccountIntent, TAccountEntry, TAccountWorker, TAccountEventAuthority, TAccountProgram>, config?: {
|
|
42
|
+
programAddress?: TProgramAddress;
|
|
43
|
+
}): Promise<LeaveInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountCaller, InstructionAccountInputAddress<TAccountCaller>>, ResolvedInstructionAccountMeta<TAccountIntent, InstructionAccountInputAddress<TAccountIntent>>, ResolvedInstructionAccountMeta<TAccountEntry, InstructionAccountInputAddress<TAccountEntry>>, ResolvedInstructionAccountMeta<TAccountWorker, InstructionAccountInputAddress<TAccountWorker>>, ResolvedInstructionAccountMeta<TAccountEventAuthority, InstructionAccountInputAddress<TAccountEventAuthority>>, ResolvedInstructionAccountMeta<TAccountProgram, InstructionAccountInputAddress<TAccountProgram>>>>;
|
|
44
|
+
export type LeaveInput<TAccountCaller extends InstructionSignerInput = InstructionSignerInput, TAccountIntent extends InstructionAccountInput = InstructionAccountInput, TAccountEntry extends InstructionAccountInput = InstructionAccountInput, TAccountWorker extends InstructionAccountInput = InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput = InstructionAccountInput, TAccountProgram extends InstructionAccountInput = InstructionAccountInput> = {
|
|
45
|
+
caller: TAccountCaller;
|
|
46
|
+
intent: TAccountIntent;
|
|
47
|
+
entry: TAccountEntry;
|
|
48
|
+
worker: TAccountWorker;
|
|
49
|
+
eventAuthority: TAccountEventAuthority;
|
|
50
|
+
program: TAccountProgram;
|
|
51
|
+
seq: LeaveInstructionDataArgs["seq"];
|
|
52
|
+
};
|
|
53
|
+
export declare function getLeaveInstruction<TAccountCaller extends InstructionSignerInput, TAccountIntent extends InstructionAccountInput, TAccountEntry extends InstructionAccountInput, TAccountWorker extends InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput, TAccountProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof INTENT_ENGINE_PROGRAM_ADDRESS>(input: LeaveInput<TAccountCaller, TAccountIntent, TAccountEntry, TAccountWorker, TAccountEventAuthority, TAccountProgram>, config?: {
|
|
54
|
+
programAddress?: TProgramAddress;
|
|
55
|
+
}): LeaveInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountCaller, InstructionAccountInputAddress<TAccountCaller>>, ResolvedInstructionAccountMeta<TAccountIntent, InstructionAccountInputAddress<TAccountIntent>>, ResolvedInstructionAccountMeta<TAccountEntry, InstructionAccountInputAddress<TAccountEntry>>, ResolvedInstructionAccountMeta<TAccountWorker, InstructionAccountInputAddress<TAccountWorker>>, ResolvedInstructionAccountMeta<TAccountEventAuthority, InstructionAccountInputAddress<TAccountEventAuthority>>, ResolvedInstructionAccountMeta<TAccountProgram, InstructionAccountInputAddress<TAccountProgram>>>;
|
|
56
|
+
export type ParsedLeaveInstruction<TProgram extends string = typeof INTENT_ENGINE_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
57
|
+
programAddress: Address<TProgram>;
|
|
58
|
+
accounts: {
|
|
59
|
+
caller: TAccountMetas[0];
|
|
60
|
+
intent: TAccountMetas[1];
|
|
61
|
+
entry: TAccountMetas[2];
|
|
62
|
+
worker: TAccountMetas[3];
|
|
63
|
+
eventAuthority: TAccountMetas[4];
|
|
64
|
+
program: TAccountMetas[5];
|
|
65
|
+
};
|
|
66
|
+
data: LeaveInstructionData;
|
|
67
|
+
};
|
|
68
|
+
export declare function parseLeaveInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedLeaveInstruction<TProgram, TAccountMetas>;
|
|
@@ -0,0 +1,142 @@
|
|
|
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, getNonNullResolvedInstructionInput, } from "@solana/kit/program-client-core";
|
|
10
|
+
import { findEntryPda } from "../pdas/index.js";
|
|
11
|
+
import { INTENT_ENGINE_PROGRAM_ADDRESS } from "../programs/index.js";
|
|
12
|
+
export const LEAVE_DISCRIMINATOR = new Uint8Array([
|
|
13
|
+
59, 234, 148, 108, 107, 149, 173, 112,
|
|
14
|
+
]);
|
|
15
|
+
export function getLeaveDiscriminatorBytes() {
|
|
16
|
+
return fixEncoderSize(getBytesEncoder(), 8).encode(LEAVE_DISCRIMINATOR);
|
|
17
|
+
}
|
|
18
|
+
export function getLeaveInstructionDataEncoder() {
|
|
19
|
+
return transformEncoder(getStructEncoder([
|
|
20
|
+
["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
|
|
21
|
+
["seq", getU32Encoder()],
|
|
22
|
+
]), (value) => ({ ...value, discriminator: LEAVE_DISCRIMINATOR }));
|
|
23
|
+
}
|
|
24
|
+
export function getLeaveInstructionDataDecoder() {
|
|
25
|
+
return getStructDecoder([
|
|
26
|
+
["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
|
|
27
|
+
["seq", getU32Decoder()],
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
export function getLeaveInstructionDataCodec() {
|
|
31
|
+
return combineCodec(getLeaveInstructionDataEncoder(), getLeaveInstructionDataDecoder());
|
|
32
|
+
}
|
|
33
|
+
export async function getLeaveInstructionAsync(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
|
+
caller: { value: input.caller ?? null, isSigner: true, isWritable: false },
|
|
41
|
+
intent: { value: input.intent ?? null, isSigner: false, isWritable: false },
|
|
42
|
+
entry: { value: input.entry ?? null, isSigner: false, isWritable: true },
|
|
43
|
+
worker: { value: input.worker ?? null, isSigner: false, isWritable: true },
|
|
44
|
+
eventAuthority: {
|
|
45
|
+
value: input.eventAuthority ?? null,
|
|
46
|
+
isSigner: false,
|
|
47
|
+
isWritable: false,
|
|
48
|
+
},
|
|
49
|
+
program: {
|
|
50
|
+
value: input.program ?? null,
|
|
51
|
+
isSigner: false,
|
|
52
|
+
isWritable: false,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
const accounts = originalAccounts;
|
|
56
|
+
// Original args.
|
|
57
|
+
const args = { ...input };
|
|
58
|
+
// Resolve default values.
|
|
59
|
+
if (!accounts.entry.value) {
|
|
60
|
+
accounts.entry.value = await findEntryPda({
|
|
61
|
+
intent: getAddressFromResolvedInstructionAccount("intent", accounts.intent.value),
|
|
62
|
+
seq: getNonNullResolvedInstructionInput("seq", args.seq),
|
|
63
|
+
}, { programAddress });
|
|
64
|
+
}
|
|
65
|
+
return Object.freeze({
|
|
66
|
+
accounts: [
|
|
67
|
+
getAccountMeta("caller", accounts.caller),
|
|
68
|
+
getAccountMeta("intent", accounts.intent),
|
|
69
|
+
getAccountMeta("entry", accounts.entry),
|
|
70
|
+
getAccountMeta("worker", accounts.worker),
|
|
71
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
72
|
+
getAccountMeta("program", accounts.program),
|
|
73
|
+
],
|
|
74
|
+
data: getLeaveInstructionDataEncoder().encode(args),
|
|
75
|
+
programAddress,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
export function getLeaveInstruction(input, config) {
|
|
79
|
+
// Program address.
|
|
80
|
+
const programAddress = config?.programAddress ?? INTENT_ENGINE_PROGRAM_ADDRESS;
|
|
81
|
+
// Account meta helper.
|
|
82
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
83
|
+
// Original accounts.
|
|
84
|
+
const originalAccounts = {
|
|
85
|
+
caller: { value: input.caller ?? null, isSigner: true, isWritable: false },
|
|
86
|
+
intent: { value: input.intent ?? null, isSigner: false, isWritable: false },
|
|
87
|
+
entry: { value: input.entry ?? null, isSigner: false, isWritable: true },
|
|
88
|
+
worker: { value: input.worker ?? null, isSigner: false, isWritable: true },
|
|
89
|
+
eventAuthority: {
|
|
90
|
+
value: input.eventAuthority ?? null,
|
|
91
|
+
isSigner: false,
|
|
92
|
+
isWritable: false,
|
|
93
|
+
},
|
|
94
|
+
program: {
|
|
95
|
+
value: input.program ?? null,
|
|
96
|
+
isSigner: false,
|
|
97
|
+
isWritable: false,
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
const accounts = originalAccounts;
|
|
101
|
+
// Original args.
|
|
102
|
+
const args = { ...input };
|
|
103
|
+
return Object.freeze({
|
|
104
|
+
accounts: [
|
|
105
|
+
getAccountMeta("caller", accounts.caller),
|
|
106
|
+
getAccountMeta("intent", accounts.intent),
|
|
107
|
+
getAccountMeta("entry", accounts.entry),
|
|
108
|
+
getAccountMeta("worker", accounts.worker),
|
|
109
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
110
|
+
getAccountMeta("program", accounts.program),
|
|
111
|
+
],
|
|
112
|
+
data: getLeaveInstructionDataEncoder().encode(args),
|
|
113
|
+
programAddress,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
export function parseLeaveInstruction(instruction) {
|
|
117
|
+
if (instruction.accounts.length < 6) {
|
|
118
|
+
throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
119
|
+
actualAccountMetas: instruction.accounts.length,
|
|
120
|
+
expectedAccountMetas: 6,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
let accountIndex = 0;
|
|
124
|
+
const getNextAccount = () => {
|
|
125
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
126
|
+
accountIndex += 1;
|
|
127
|
+
return accountMeta;
|
|
128
|
+
};
|
|
129
|
+
return {
|
|
130
|
+
programAddress: instruction.programAddress,
|
|
131
|
+
accounts: {
|
|
132
|
+
caller: getNextAccount(),
|
|
133
|
+
intent: getNextAccount(),
|
|
134
|
+
entry: getNextAccount(),
|
|
135
|
+
worker: getNextAccount(),
|
|
136
|
+
eventAuthority: getNextAccount(),
|
|
137
|
+
program: getNextAccount(),
|
|
138
|
+
},
|
|
139
|
+
data: getLeaveInstructionDataDecoder().decode(instruction.data),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=leave.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leave.js","sourceRoot":"","sources":["../../../../generated/client/instructions/leave.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,EACxC,kCAAkC,GAMnC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAErE,MAAM,CAAC,MAAM,mBAAmB,GAAuB,IAAI,UAAU,CAAC;IACpE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;CACtC,CAAC,CAAC;AAEH,MAAM,UAAU,0BAA0B;IACxC,OAAO,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAC1E,CAAC;AA6CD,MAAM,UAAU,8BAA8B;IAC5C,OAAO,gBAAgB,CACrB,gBAAgB,CAAC;QACf,CAAC,eAAe,EAAE,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC;QACvD,CAAC,KAAK,EAAE,aAAa,EAAE,CAAC;KACzB,CAAC,EACF,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,CAAC,CAC9D,CAAC;AACJ,CAAC;AAED,MAAM,U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C;YACzD,cAAc,CAAC,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC;SAC5C;QACD,IAAI,EAAE,8BAA8B,EAAE,CAAC,MAAM,CAC3C,IAAgC,CACjC;QACD,cAAc;KA2Bf,CAAC,CAAC;AACL,CAAC;AAkBD,MAAM,UAAU,qBAAqB,CAInC,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,MAAM,EAAE,cAAc,EAAE;YACxB,MAAM,EAAE,cAAc,EAAE;YACxB,KAAK,EAAE,cAAc,EAAE;YACvB,MAAM,EAAE,cAAc,EAAE;YACxB,cAAc,EAAE,cAAc,EAAE;YAChC,OAAO,EAAE,cAAc,EAAE;SAC1B;QACD,IAAI,EAAE,8BAA8B,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;KAChE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 MIGRATE_DISCRIMINATOR: ReadonlyUint8Array;
|
|
12
|
+
export declare function getMigrateDiscriminatorBytes(): ReadonlyUint8Array;
|
|
13
|
+
export type MigrateInstruction<TProgram extends string = typeof INTENT_ENGINE_PROGRAM_ADDRESS, TAccountPayer extends string | AccountMeta<string> = string, TAccountAccount extends string | AccountMeta<string> = string, TAccountConfig 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
|
+
TAccountAccount extends string ? WritableAccount<TAccountAccount> : TAccountAccount,
|
|
16
|
+
TAccountConfig extends string ? ReadonlyAccount<TAccountConfig> : TAccountConfig,
|
|
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 MigrateInstructionData = {
|
|
23
|
+
discriminator: ReadonlyUint8Array;
|
|
24
|
+
};
|
|
25
|
+
export type MigrateInstructionDataArgs = {};
|
|
26
|
+
export declare function getMigrateInstructionDataEncoder(): FixedSizeEncoder<MigrateInstructionDataArgs>;
|
|
27
|
+
export declare function getMigrateInstructionDataDecoder(): FixedSizeDecoder<MigrateInstructionData>;
|
|
28
|
+
export declare function getMigrateInstructionDataCodec(): FixedSizeCodec<MigrateInstructionDataArgs, MigrateInstructionData>;
|
|
29
|
+
export type MigrateInput<TAccountPayer extends InstructionSignerInput = InstructionSignerInput, TAccountAccount extends InstructionAccountInput = InstructionAccountInput, TAccountConfig extends InstructionAccountInput = InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput = InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput = InstructionAccountInput, TAccountProgram extends InstructionAccountInput = InstructionAccountInput> = {
|
|
30
|
+
payer: TAccountPayer;
|
|
31
|
+
account: TAccountAccount;
|
|
32
|
+
config?: TAccountConfig;
|
|
33
|
+
systemProgram?: TAccountSystemProgram;
|
|
34
|
+
eventAuthority: TAccountEventAuthority;
|
|
35
|
+
program: TAccountProgram;
|
|
36
|
+
};
|
|
37
|
+
export declare function getMigrateInstruction<TAccountPayer extends InstructionSignerInput, TAccountAccount extends InstructionAccountInput, TAccountConfig extends InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput, TAccountProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof INTENT_ENGINE_PROGRAM_ADDRESS>(input: MigrateInput<TAccountPayer, TAccountAccount, TAccountConfig, TAccountSystemProgram, TAccountEventAuthority, TAccountProgram>, config?: {
|
|
38
|
+
programAddress?: TProgramAddress;
|
|
39
|
+
}): MigrateInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountPayer, InstructionAccountInputAddress<TAccountPayer>>, ResolvedInstructionAccountMeta<TAccountAccount, InstructionAccountInputAddress<TAccountAccount>>, ResolvedInstructionAccountMeta<TAccountConfig, InstructionAccountInputAddress<TAccountConfig>>, ResolvedInstructionAccountMeta<TAccountSystemProgram, InstructionAccountInputAddress<TAccountSystemProgram>>, ResolvedInstructionAccountMeta<TAccountEventAuthority, InstructionAccountInputAddress<TAccountEventAuthority>>, ResolvedInstructionAccountMeta<TAccountProgram, InstructionAccountInputAddress<TAccountProgram>>>;
|
|
40
|
+
export type ParsedMigrateInstruction<TProgram extends string = typeof INTENT_ENGINE_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
41
|
+
programAddress: Address<TProgram>;
|
|
42
|
+
accounts: {
|
|
43
|
+
payer: TAccountMetas[0];
|
|
44
|
+
account: TAccountMetas[1];
|
|
45
|
+
config?: TAccountMetas[2] | undefined;
|
|
46
|
+
systemProgram: TAccountMetas[3];
|
|
47
|
+
eventAuthority: TAccountMetas[4];
|
|
48
|
+
program: TAccountMetas[5];
|
|
49
|
+
};
|
|
50
|
+
data: MigrateInstructionData;
|
|
51
|
+
};
|
|
52
|
+
export declare function parseMigrateInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedMigrateInstruction<TProgram, TAccountMetas>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { combineCodec, fixDecoderSize, fixEncoderSize, 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 MIGRATE_DISCRIMINATOR = new Uint8Array([
|
|
12
|
+
155, 234, 231, 146, 236, 158, 162, 30,
|
|
13
|
+
]);
|
|
14
|
+
export function getMigrateDiscriminatorBytes() {
|
|
15
|
+
return fixEncoderSize(getBytesEncoder(), 8).encode(MIGRATE_DISCRIMINATOR);
|
|
16
|
+
}
|
|
17
|
+
export function getMigrateInstructionDataEncoder() {
|
|
18
|
+
return transformEncoder(getStructEncoder([["discriminator", fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({ ...value, discriminator: MIGRATE_DISCRIMINATOR }));
|
|
19
|
+
}
|
|
20
|
+
export function getMigrateInstructionDataDecoder() {
|
|
21
|
+
return getStructDecoder([
|
|
22
|
+
["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
25
|
+
export function getMigrateInstructionDataCodec() {
|
|
26
|
+
return combineCodec(getMigrateInstructionDataEncoder(), getMigrateInstructionDataDecoder());
|
|
27
|
+
}
|
|
28
|
+
export function getMigrateInstruction(input, config) {
|
|
29
|
+
// Program address.
|
|
30
|
+
const programAddress = config?.programAddress ?? INTENT_ENGINE_PROGRAM_ADDRESS;
|
|
31
|
+
// Account meta helper.
|
|
32
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
33
|
+
// Original accounts.
|
|
34
|
+
const originalAccounts = {
|
|
35
|
+
payer: { value: input.payer ?? null, isSigner: true, isWritable: true },
|
|
36
|
+
account: {
|
|
37
|
+
value: input.account ?? null,
|
|
38
|
+
isSigner: false,
|
|
39
|
+
isWritable: true,
|
|
40
|
+
},
|
|
41
|
+
config: { value: input.config ?? null, isSigner: false, isWritable: false },
|
|
42
|
+
systemProgram: {
|
|
43
|
+
value: input.systemProgram ?? null,
|
|
44
|
+
isSigner: false,
|
|
45
|
+
isWritable: false,
|
|
46
|
+
},
|
|
47
|
+
eventAuthority: {
|
|
48
|
+
value: input.eventAuthority ?? null,
|
|
49
|
+
isSigner: false,
|
|
50
|
+
isWritable: false,
|
|
51
|
+
},
|
|
52
|
+
program: {
|
|
53
|
+
value: input.program ?? null,
|
|
54
|
+
isSigner: false,
|
|
55
|
+
isWritable: false,
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
const accounts = originalAccounts;
|
|
59
|
+
// Resolve default values.
|
|
60
|
+
if (!accounts.systemProgram.value) {
|
|
61
|
+
accounts.systemProgram.value =
|
|
62
|
+
"11111111111111111111111111111111";
|
|
63
|
+
}
|
|
64
|
+
return Object.freeze({
|
|
65
|
+
accounts: [
|
|
66
|
+
getAccountMeta("payer", accounts.payer),
|
|
67
|
+
getAccountMeta("account", accounts.account),
|
|
68
|
+
getAccountMeta("config", accounts.config),
|
|
69
|
+
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
70
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
71
|
+
getAccountMeta("program", accounts.program),
|
|
72
|
+
],
|
|
73
|
+
data: getMigrateInstructionDataEncoder().encode({}),
|
|
74
|
+
programAddress,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
export function parseMigrateInstruction(instruction) {
|
|
78
|
+
if (instruction.accounts.length < 6) {
|
|
79
|
+
throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
80
|
+
actualAccountMetas: instruction.accounts.length,
|
|
81
|
+
expectedAccountMetas: 6,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
let accountIndex = 0;
|
|
85
|
+
const getNextAccount = () => {
|
|
86
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
87
|
+
accountIndex += 1;
|
|
88
|
+
return accountMeta;
|
|
89
|
+
};
|
|
90
|
+
const getNextOptionalAccount = () => {
|
|
91
|
+
const accountMeta = getNextAccount();
|
|
92
|
+
return accountMeta.address === INTENT_ENGINE_PROGRAM_ADDRESS
|
|
93
|
+
? undefined
|
|
94
|
+
: accountMeta;
|
|
95
|
+
};
|
|
96
|
+
return {
|
|
97
|
+
programAddress: instruction.programAddress,
|
|
98
|
+
accounts: {
|
|
99
|
+
payer: getNextAccount(),
|
|
100
|
+
account: getNextAccount(),
|
|
101
|
+
config: getNextOptionalAccount(),
|
|
102
|
+
systemProgram: getNextAccount(),
|
|
103
|
+
eventAuthority: getNextAccount(),
|
|
104
|
+
program: getNextAccount(),
|
|
105
|
+
},
|
|
106
|
+
data: getMigrateInstructionDataDecoder().decode(instruction.data),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=migrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../../../generated/client/instructions/migrate.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,GAMtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAErE,MAAM,CAAC,MAAM,qBAAqB,GAAuB,IAAI,UAAU,CAAC;IACtE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;CACtC,CAAC,CAAC;AAEH,MAAM,UAAU,4BAA4B;IAC1C,OAAO,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAC5E,CAAC;AA2CD,MAAM,UAAU,gCAAgC;IAC9C,OAAO,gBAAgB,CACrB,gBAAgB,CAAC,CAAC,CAAC,eAAe,EAAE,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MAAM,WAAW,GAAI,WAAW,CAAC,QAA0B,CAAC,YAAY,CAAE,CAAC;QAC3E,YAAY,IAAI,CAAC,CAAC;QAClB,OAAO,WAAW,CAAC;IACrB,CAAC,CAAC;IACF,MAAM,sBAAsB,GAAG,GAAG,EAAE;QAClC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;QACrC,OAAO,WAAW,CAAC,OAAO,KAAK,6BAA6B;YAC1D,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,WAAW,CAAC;IAClB,CAAC,CAAC;IACF,OAAO;QACL,cAAc,EAAE,WAAW,CAAC,cAAc;QAC1C,QAAQ,EAAE;YACR,KAAK,EAAE,cAAc,EAAE;YACvB,OAAO,EAAE,cAAc,EAAE;YACzB,MAAM,EAAE,sBAAsB,EAAE;YAChC,aAAa,EAAE,cAAc,EAAE;YAC/B,cAAc,EAAE,cAAc,EAAE;YAChC,OAAO,EAAE,cAAc,EAAE;SAC1B;QACD,IAAI,EAAE,gCAAgC,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;KAClE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
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_COMMITTEE_FLOOR_DISCRIMINATOR: ReadonlyUint8Array;
|
|
12
|
+
export declare function getSetCommitteeFloorDiscriminatorBytes(): ReadonlyUint8Array;
|
|
13
|
+
export type SetCommitteeFloorInstruction<TProgram extends string = typeof INTENT_ENGINE_PROGRAM_ADDRESS, TAccountAdmin extends string | AccountMeta<string> = string, TAccountConfig extends string | AccountMeta<string> = "6As2PgaNQ2DdSZMcrZeUJZ7RfyE2kXnVd33yxbgXULYz", TAccountMint 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
|
+
TAccountAdmin extends string ? ReadonlySignerAccount<TAccountAdmin> & AccountSignerMeta<TAccountAdmin> : TAccountAdmin,
|
|
15
|
+
TAccountConfig extends string ? WritableAccount<TAccountConfig> : TAccountConfig,
|
|
16
|
+
TAccountMint extends string ? ReadonlyAccount<TAccountMint> : TAccountMint,
|
|
17
|
+
TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,
|
|
18
|
+
TAccountProgram extends string ? ReadonlyAccount<TAccountProgram> : TAccountProgram,
|
|
19
|
+
...TRemainingAccounts
|
|
20
|
+
]>;
|
|
21
|
+
export type SetCommitteeFloorInstructionData = {
|
|
22
|
+
discriminator: ReadonlyUint8Array;
|
|
23
|
+
floor: bigint;
|
|
24
|
+
};
|
|
25
|
+
export type SetCommitteeFloorInstructionDataArgs = {
|
|
26
|
+
floor: number | bigint;
|
|
27
|
+
};
|
|
28
|
+
export declare function getSetCommitteeFloorInstructionDataEncoder(): FixedSizeEncoder<SetCommitteeFloorInstructionDataArgs>;
|
|
29
|
+
export declare function getSetCommitteeFloorInstructionDataDecoder(): FixedSizeDecoder<SetCommitteeFloorInstructionData>;
|
|
30
|
+
export declare function getSetCommitteeFloorInstructionDataCodec(): FixedSizeCodec<SetCommitteeFloorInstructionDataArgs, SetCommitteeFloorInstructionData>;
|
|
31
|
+
export type SetCommitteeFloorInput<TAccountAdmin extends InstructionSignerInput = InstructionSignerInput, TAccountConfig extends InstructionAccountInput = InstructionAccountInput, TAccountMint extends InstructionAccountInput = InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput = InstructionAccountInput, TAccountProgram extends InstructionAccountInput = InstructionAccountInput> = {
|
|
32
|
+
admin: TAccountAdmin;
|
|
33
|
+
config?: TAccountConfig;
|
|
34
|
+
mint: TAccountMint;
|
|
35
|
+
eventAuthority: TAccountEventAuthority;
|
|
36
|
+
program: TAccountProgram;
|
|
37
|
+
floor: SetCommitteeFloorInstructionDataArgs["floor"];
|
|
38
|
+
};
|
|
39
|
+
export declare function getSetCommitteeFloorInstruction<TAccountAdmin extends InstructionSignerInput, TAccountConfig extends InstructionAccountInput, TAccountMint extends InstructionAccountInput, TAccountEventAuthority extends InstructionAccountInput, TAccountProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof INTENT_ENGINE_PROGRAM_ADDRESS>(input: SetCommitteeFloorInput<TAccountAdmin, TAccountConfig, TAccountMint, TAccountEventAuthority, TAccountProgram>, config?: {
|
|
40
|
+
programAddress?: TProgramAddress;
|
|
41
|
+
}): SetCommitteeFloorInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountAdmin, InstructionAccountInputAddress<TAccountAdmin>>, ResolvedInstructionAccountMeta<TAccountConfig, InstructionAccountInputAddress<TAccountConfig>>, ResolvedInstructionAccountMeta<TAccountMint, InstructionAccountInputAddress<TAccountMint>>, ResolvedInstructionAccountMeta<TAccountEventAuthority, InstructionAccountInputAddress<TAccountEventAuthority>>, ResolvedInstructionAccountMeta<TAccountProgram, InstructionAccountInputAddress<TAccountProgram>>>;
|
|
42
|
+
export type ParsedSetCommitteeFloorInstruction<TProgram extends string = typeof INTENT_ENGINE_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
43
|
+
programAddress: Address<TProgram>;
|
|
44
|
+
accounts: {
|
|
45
|
+
admin: TAccountMetas[0];
|
|
46
|
+
config: TAccountMetas[1];
|
|
47
|
+
mint: TAccountMetas[2];
|
|
48
|
+
eventAuthority: TAccountMetas[3];
|
|
49
|
+
program: TAccountMetas[4];
|
|
50
|
+
};
|
|
51
|
+
data: SetCommitteeFloorInstructionData;
|
|
52
|
+
};
|
|
53
|
+
export declare function parseSetCommitteeFloorInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedSetCommitteeFloorInstruction<TProgram, TAccountMetas>;
|
|
@@ -0,0 +1,96 @@
|
|
|
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, getU64Decoder, getU64Encoder, 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_COMMITTEE_FLOOR_DISCRIMINATOR = new Uint8Array([124, 248, 31, 82, 112, 216, 14, 173]);
|
|
12
|
+
export function getSetCommitteeFloorDiscriminatorBytes() {
|
|
13
|
+
return fixEncoderSize(getBytesEncoder(), 8).encode(SET_COMMITTEE_FLOOR_DISCRIMINATOR);
|
|
14
|
+
}
|
|
15
|
+
export function getSetCommitteeFloorInstructionDataEncoder() {
|
|
16
|
+
return transformEncoder(getStructEncoder([
|
|
17
|
+
["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
|
|
18
|
+
["floor", getU64Encoder()],
|
|
19
|
+
]), (value) => ({ ...value, discriminator: SET_COMMITTEE_FLOOR_DISCRIMINATOR }));
|
|
20
|
+
}
|
|
21
|
+
export function getSetCommitteeFloorInstructionDataDecoder() {
|
|
22
|
+
return getStructDecoder([
|
|
23
|
+
["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
|
|
24
|
+
["floor", getU64Decoder()],
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
export function getSetCommitteeFloorInstructionDataCodec() {
|
|
28
|
+
return combineCodec(getSetCommitteeFloorInstructionDataEncoder(), getSetCommitteeFloorInstructionDataDecoder());
|
|
29
|
+
}
|
|
30
|
+
export function getSetCommitteeFloorInstruction(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
|
+
mint: { value: input.mint ?? null, isSigner: false, isWritable: false },
|
|
40
|
+
eventAuthority: {
|
|
41
|
+
value: input.eventAuthority ?? null,
|
|
42
|
+
isSigner: false,
|
|
43
|
+
isWritable: false,
|
|
44
|
+
},
|
|
45
|
+
program: {
|
|
46
|
+
value: input.program ?? null,
|
|
47
|
+
isSigner: false,
|
|
48
|
+
isWritable: false,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
const accounts = originalAccounts;
|
|
52
|
+
// Original args.
|
|
53
|
+
const args = { ...input };
|
|
54
|
+
// Resolve default values.
|
|
55
|
+
if (!accounts.config.value) {
|
|
56
|
+
accounts.config.value =
|
|
57
|
+
"6As2PgaNQ2DdSZMcrZeUJZ7RfyE2kXnVd33yxbgXULYz";
|
|
58
|
+
}
|
|
59
|
+
return Object.freeze({
|
|
60
|
+
accounts: [
|
|
61
|
+
getAccountMeta("admin", accounts.admin),
|
|
62
|
+
getAccountMeta("config", accounts.config),
|
|
63
|
+
getAccountMeta("mint", accounts.mint),
|
|
64
|
+
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
65
|
+
getAccountMeta("program", accounts.program),
|
|
66
|
+
],
|
|
67
|
+
data: getSetCommitteeFloorInstructionDataEncoder().encode(args),
|
|
68
|
+
programAddress,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
export function parseSetCommitteeFloorInstruction(instruction) {
|
|
72
|
+
if (instruction.accounts.length < 5) {
|
|
73
|
+
throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
74
|
+
actualAccountMetas: instruction.accounts.length,
|
|
75
|
+
expectedAccountMetas: 5,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
let accountIndex = 0;
|
|
79
|
+
const getNextAccount = () => {
|
|
80
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
81
|
+
accountIndex += 1;
|
|
82
|
+
return accountMeta;
|
|
83
|
+
};
|
|
84
|
+
return {
|
|
85
|
+
programAddress: instruction.programAddress,
|
|
86
|
+
accounts: {
|
|
87
|
+
admin: getNextAccount(),
|
|
88
|
+
config: getNextAccount(),
|
|
89
|
+
mint: getNextAccount(),
|
|
90
|
+
eventAuthority: getNextAccount(),
|
|
91
|
+
program: getNextAccount(),
|
|
92
|
+
},
|
|
93
|
+
data: getSetCommitteeFloorInstructionDataDecoder().decode(instruction.data),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=setCommitteeFloor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setCommitteeFloor.js","sourceRoot":"","sources":["../../../../generated/client/instructions/setCommitteeFloor.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,GAMtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAErE,MAAM,CAAC,MAAM,iCAAiC,GAC5C,IAAI,UAAU,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;AAExD,MAAM,UAAU,sCAAsC;IACpD,OAAO,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAChD,iCAAiC,CAClC,CAAC;AACJ,CAAC;AA0CD,MAAM,UAAU,0CAA0C;IACxD,OAAO,gBAAgB,CACrB,gBAAgB,CAAC;QACf,CAAC,eAAe,EAAE,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC;QACvD,CAAC,OAAO,EAAE,aAAa,EAAE,CAAC;KAC3B,CAAC,EACF,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,aAAa,EAAE,iCAAiC,EAAE,CAAC,CAC5E,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,0CAA0C;IACxD,OAAO,gBAAgB,CAAC;QACtB,CAAC,eAAe,EAAE,cAAc,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC;QACvD,CAAC,OAAO,EAAE,aAAa,EAAE,CAAC;KAC3B,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU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AAC"}
|
|
@@ -26,11 +26,13 @@ export type SetMintCapInstructionData = {
|
|
|
26
26
|
maxPerOrder: bigint;
|
|
27
27
|
windowCap: bigint;
|
|
28
28
|
windowSecs: number;
|
|
29
|
+
totalLimit: bigint;
|
|
29
30
|
};
|
|
30
31
|
export type SetMintCapInstructionDataArgs = {
|
|
31
32
|
maxPerOrder: number | bigint;
|
|
32
33
|
windowCap: number | bigint;
|
|
33
34
|
windowSecs: number;
|
|
35
|
+
totalLimit: number | bigint;
|
|
34
36
|
};
|
|
35
37
|
export declare function getSetMintCapInstructionDataEncoder(): FixedSizeEncoder<SetMintCapInstructionDataArgs>;
|
|
36
38
|
export declare function getSetMintCapInstructionDataDecoder(): FixedSizeDecoder<SetMintCapInstructionData>;
|
|
@@ -47,6 +49,7 @@ export type SetMintCapAsyncInput<TAccountAdmin extends InstructionSignerInput =
|
|
|
47
49
|
maxPerOrder: SetMintCapInstructionDataArgs["maxPerOrder"];
|
|
48
50
|
windowCap: SetMintCapInstructionDataArgs["windowCap"];
|
|
49
51
|
windowSecs: SetMintCapInstructionDataArgs["windowSecs"];
|
|
52
|
+
totalLimit: SetMintCapInstructionDataArgs["totalLimit"];
|
|
50
53
|
};
|
|
51
54
|
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
55
|
programAddress?: TProgramAddress;
|
|
@@ -63,6 +66,7 @@ export type SetMintCapInput<TAccountAdmin extends InstructionSignerInput = Instr
|
|
|
63
66
|
maxPerOrder: SetMintCapInstructionDataArgs["maxPerOrder"];
|
|
64
67
|
windowCap: SetMintCapInstructionDataArgs["windowCap"];
|
|
65
68
|
windowSecs: SetMintCapInstructionDataArgs["windowSecs"];
|
|
69
|
+
totalLimit: SetMintCapInstructionDataArgs["totalLimit"];
|
|
66
70
|
};
|
|
67
71
|
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
72
|
programAddress?: TProgramAddress;
|
|
@@ -21,6 +21,7 @@ export function getSetMintCapInstructionDataEncoder() {
|
|
|
21
21
|
["maxPerOrder", getU64Encoder()],
|
|
22
22
|
["windowCap", getU64Encoder()],
|
|
23
23
|
["windowSecs", getU32Encoder()],
|
|
24
|
+
["totalLimit", getU64Encoder()],
|
|
24
25
|
]), (value) => ({ ...value, discriminator: SET_MINT_CAP_DISCRIMINATOR }));
|
|
25
26
|
}
|
|
26
27
|
export function getSetMintCapInstructionDataDecoder() {
|
|
@@ -29,6 +30,7 @@ export function getSetMintCapInstructionDataDecoder() {
|
|
|
29
30
|
["maxPerOrder", getU64Decoder()],
|
|
30
31
|
["windowCap", getU64Decoder()],
|
|
31
32
|
["windowSecs", getU32Decoder()],
|
|
33
|
+
["totalLimit", getU64Decoder()],
|
|
32
34
|
]);
|
|
33
35
|
}
|
|
34
36
|
export function getSetMintCapInstructionDataCodec() {
|