@nosana/jobs-program 2.0.64

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 (69) hide show
  1. package/dist/accounts/index.d.ts +10 -0
  2. package/dist/accounts/index.js +10 -0
  3. package/dist/accounts/jobAccount.d.ts +51 -0
  4. package/dist/accounts/jobAccount.js +76 -0
  5. package/dist/accounts/marketAccount.d.ts +50 -0
  6. package/dist/accounts/marketAccount.js +73 -0
  7. package/dist/accounts/runAccount.d.ts +39 -0
  8. package/dist/accounts/runAccount.js +64 -0
  9. package/dist/errors/index.d.ts +8 -0
  10. package/dist/errors/index.js +8 -0
  11. package/dist/errors/nosanaJobs.d.ts +57 -0
  12. package/dist/errors/nosanaJobs.js +80 -0
  13. package/dist/index.d.ts +12 -0
  14. package/dist/index.js +12 -0
  15. package/dist/instructions/assign.d.ts +95 -0
  16. package/dist/instructions/assign.js +134 -0
  17. package/dist/instructions/claim.d.ts +72 -0
  18. package/dist/instructions/claim.js +103 -0
  19. package/dist/instructions/clean.d.ts +48 -0
  20. package/dist/instructions/clean.js +74 -0
  21. package/dist/instructions/cleanAdmin.d.ts +48 -0
  22. package/dist/instructions/cleanAdmin.js +74 -0
  23. package/dist/instructions/close.d.ts +56 -0
  24. package/dist/instructions/close.js +87 -0
  25. package/dist/instructions/closeAdmin.d.ts +56 -0
  26. package/dist/instructions/closeAdmin.js +87 -0
  27. package/dist/instructions/complete.d.ts +48 -0
  28. package/dist/instructions/complete.js +73 -0
  29. package/dist/instructions/delist.d.ts +64 -0
  30. package/dist/instructions/delist.js +95 -0
  31. package/dist/instructions/end.d.ts +72 -0
  32. package/dist/instructions/end.js +103 -0
  33. package/dist/instructions/extend.d.ts +80 -0
  34. package/dist/instructions/extend.js +116 -0
  35. package/dist/instructions/finish.d.ts +80 -0
  36. package/dist/instructions/finish.js +113 -0
  37. package/dist/instructions/index.d.ts +26 -0
  38. package/dist/instructions/index.js +26 -0
  39. package/dist/instructions/list.d.ts +91 -0
  40. package/dist/instructions/list.js +130 -0
  41. package/dist/instructions/open.d.ts +84 -0
  42. package/dist/instructions/open.js +121 -0
  43. package/dist/instructions/quit.d.ts +52 -0
  44. package/dist/instructions/quit.js +78 -0
  45. package/dist/instructions/quitAdmin.d.ts +48 -0
  46. package/dist/instructions/quitAdmin.js +74 -0
  47. package/dist/instructions/recover.d.ts +64 -0
  48. package/dist/instructions/recover.js +95 -0
  49. package/dist/instructions/stop.d.ts +48 -0
  50. package/dist/instructions/stop.js +74 -0
  51. package/dist/instructions/update.d.ts +64 -0
  52. package/dist/instructions/update.js +88 -0
  53. package/dist/instructions/work.d.ts +68 -0
  54. package/dist/instructions/work.js +99 -0
  55. package/dist/programs/index.d.ts +8 -0
  56. package/dist/programs/index.js +8 -0
  57. package/dist/programs/nosanaJobs.d.ts +83 -0
  58. package/dist/programs/nosanaJobs.js +109 -0
  59. package/dist/shared/index.d.ts +49 -0
  60. package/dist/shared/index.js +86 -0
  61. package/dist/types/index.d.ts +10 -0
  62. package/dist/types/index.js +10 -0
  63. package/dist/types/jobState.d.ts +19 -0
  64. package/dist/types/jobState.js +23 -0
  65. package/dist/types/jobType.d.ts +22 -0
  66. package/dist/types/jobType.js +26 -0
  67. package/dist/types/queueType.d.ts +19 -0
  68. package/dist/types/queueType.js +23 -0
  69. package/package.json +37 -0
@@ -0,0 +1,103 @@
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, transformEncoder, } from "@solana/kit";
9
+ import { NOSANA_JOBS_PROGRAM_ADDRESS } from "../programs/index.js";
10
+ import { getAccountMetaFactory } from "../shared/index.js";
11
+ export const END_INSTRUCTION_ACCOUNTS = {
12
+ job: 0,
13
+ market: 1,
14
+ run: 2,
15
+ deposit: 3,
16
+ user: 4,
17
+ vault: 5,
18
+ payer: 6,
19
+ authority: 7,
20
+ tokenProgram: 8,
21
+ };
22
+ export const END_DISCRIMINATOR = new Uint8Array([
23
+ 180, 160, 249, 217, 194, 121, 70, 16,
24
+ ]);
25
+ export function getEndDiscriminatorBytes() {
26
+ return fixEncoderSize(getBytesEncoder(), 8).encode(END_DISCRIMINATOR);
27
+ }
28
+ export function getEndInstructionDataEncoder() {
29
+ return transformEncoder(getStructEncoder([["discriminator", fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({ ...value, discriminator: END_DISCRIMINATOR }));
30
+ }
31
+ export function getEndInstructionDataDecoder() {
32
+ return getStructDecoder([
33
+ ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
34
+ ]);
35
+ }
36
+ export function getEndInstructionDataCodec() {
37
+ return combineCodec(getEndInstructionDataEncoder(), getEndInstructionDataDecoder());
38
+ }
39
+ export function getEndInstruction(input, config) {
40
+ // Program address.
41
+ const programAddress = config?.programAddress ?? NOSANA_JOBS_PROGRAM_ADDRESS;
42
+ // Original accounts.
43
+ const originalAccounts = {
44
+ job: { value: input.job ?? null, isWritable: true },
45
+ market: { value: input.market ?? null, isWritable: false },
46
+ run: { value: input.run ?? null, isWritable: true },
47
+ deposit: { value: input.deposit ?? null, isWritable: true },
48
+ user: { value: input.user ?? null, isWritable: true },
49
+ vault: { value: input.vault ?? null, isWritable: true },
50
+ payer: { value: input.payer ?? null, isWritable: true },
51
+ authority: { value: input.authority ?? null, isWritable: true },
52
+ tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
53
+ };
54
+ const accounts = originalAccounts;
55
+ // Resolve default values.
56
+ if (!accounts.tokenProgram.value) {
57
+ accounts.tokenProgram.value =
58
+ "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
59
+ }
60
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
61
+ return Object.freeze({
62
+ accounts: [
63
+ getAccountMeta(accounts.job),
64
+ getAccountMeta(accounts.market),
65
+ getAccountMeta(accounts.run),
66
+ getAccountMeta(accounts.deposit),
67
+ getAccountMeta(accounts.user),
68
+ getAccountMeta(accounts.vault),
69
+ getAccountMeta(accounts.payer),
70
+ getAccountMeta(accounts.authority),
71
+ getAccountMeta(accounts.tokenProgram),
72
+ ],
73
+ data: getEndInstructionDataEncoder().encode({}),
74
+ programAddress,
75
+ });
76
+ }
77
+ export function parseEndInstruction(instruction) {
78
+ if (instruction.accounts.length < 9) {
79
+ // TODO: Coded error.
80
+ throw new Error("Not enough accounts");
81
+ }
82
+ let accountIndex = 0;
83
+ const getNextAccount = () => {
84
+ const accountMeta = instruction.accounts[accountIndex];
85
+ accountIndex += 1;
86
+ return accountMeta;
87
+ };
88
+ return {
89
+ programAddress: instruction.programAddress,
90
+ accounts: {
91
+ job: getNextAccount(),
92
+ market: getNextAccount(),
93
+ run: getNextAccount(),
94
+ deposit: getNextAccount(),
95
+ user: getNextAccount(),
96
+ vault: getNextAccount(),
97
+ payer: getNextAccount(),
98
+ authority: getNextAccount(),
99
+ tokenProgram: getNextAccount(),
100
+ },
101
+ data: getEndInstructionDataDecoder().decode(instruction.data),
102
+ };
103
+ }
@@ -0,0 +1,80 @@
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 TransactionSigner, type WritableAccount } from "@solana/kit";
9
+ import { NOSANA_JOBS_PROGRAM_ADDRESS } from "../programs/index.js";
10
+ export declare const EXTEND_INSTRUCTION_ACCOUNTS: {
11
+ readonly job: 0;
12
+ readonly market: 1;
13
+ readonly user: 2;
14
+ readonly vault: 3;
15
+ readonly rewardsReflection: 4;
16
+ readonly rewardsVault: 5;
17
+ readonly authority: 6;
18
+ readonly payer: 7;
19
+ readonly rewardsProgram: 8;
20
+ readonly tokenProgram: 9;
21
+ };
22
+ export type ExtendInstructionAccountName = keyof typeof EXTEND_INSTRUCTION_ACCOUNTS;
23
+ export declare const EXTEND_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
24
+ export declare function getExtendDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
25
+ export type ExtendInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGRAM_ADDRESS, TAccountJob extends string | AccountMeta<string> = string, TAccountMarket extends string | AccountMeta<string> = string, TAccountUser extends string | AccountMeta<string> = string, TAccountVault extends string | AccountMeta<string> = string, TAccountRewardsReflection extends string | AccountMeta<string> = string, TAccountRewardsVault extends string | AccountMeta<string> = string, TAccountAuthority extends string | AccountMeta<string> = string, TAccountPayer extends string | AccountMeta<string> = string, TAccountRewardsProgram extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
26
+ TAccountJob extends string ? WritableAccount<TAccountJob> : TAccountJob,
27
+ TAccountMarket extends string ? ReadonlyAccount<TAccountMarket> : TAccountMarket,
28
+ TAccountUser extends string ? WritableAccount<TAccountUser> : TAccountUser,
29
+ TAccountVault extends string ? WritableAccount<TAccountVault> : TAccountVault,
30
+ TAccountRewardsReflection extends string ? WritableAccount<TAccountRewardsReflection> : TAccountRewardsReflection,
31
+ TAccountRewardsVault extends string ? WritableAccount<TAccountRewardsVault> : TAccountRewardsVault,
32
+ TAccountAuthority extends string ? ReadonlySignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority,
33
+ TAccountPayer extends string ? ReadonlySignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer> : TAccountPayer,
34
+ TAccountRewardsProgram extends string ? ReadonlyAccount<TAccountRewardsProgram> : TAccountRewardsProgram,
35
+ TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
36
+ ...TRemainingAccounts
37
+ ]>;
38
+ export type ExtendInstructionData = {
39
+ discriminator: ReadonlyUint8Array;
40
+ timeout: bigint;
41
+ };
42
+ export type ExtendInstructionDataArgs = {
43
+ timeout: number | bigint;
44
+ };
45
+ export declare function getExtendInstructionDataEncoder(): FixedSizeEncoder<ExtendInstructionDataArgs>;
46
+ export declare function getExtendInstructionDataDecoder(): FixedSizeDecoder<ExtendInstructionData>;
47
+ export declare function getExtendInstructionDataCodec(): FixedSizeCodec<ExtendInstructionDataArgs, ExtendInstructionData>;
48
+ export type ExtendInput<TAccountJob extends string = string, TAccountMarket extends string = string, TAccountUser extends string = string, TAccountVault extends string = string, TAccountRewardsReflection extends string = string, TAccountRewardsVault extends string = string, TAccountAuthority extends string = string, TAccountPayer extends string = string, TAccountRewardsProgram extends string = string, TAccountTokenProgram extends string = string> = {
49
+ job: Address<TAccountJob>;
50
+ market: Address<TAccountMarket>;
51
+ user: Address<TAccountUser>;
52
+ vault: Address<TAccountVault>;
53
+ rewardsReflection: Address<TAccountRewardsReflection>;
54
+ rewardsVault: Address<TAccountRewardsVault>;
55
+ authority: TransactionSigner<TAccountAuthority>;
56
+ payer: TransactionSigner<TAccountPayer>;
57
+ rewardsProgram: Address<TAccountRewardsProgram>;
58
+ tokenProgram?: Address<TAccountTokenProgram>;
59
+ timeout: ExtendInstructionDataArgs["timeout"];
60
+ };
61
+ export declare function getExtendInstruction<TAccountJob extends string, TAccountMarket extends string, TAccountUser extends string, TAccountVault extends string, TAccountRewardsReflection extends string, TAccountRewardsVault extends string, TAccountAuthority extends string, TAccountPayer extends string, TAccountRewardsProgram extends string, TAccountTokenProgram extends string, TProgramAddress extends Address = typeof NOSANA_JOBS_PROGRAM_ADDRESS>(input: ExtendInput<TAccountJob, TAccountMarket, TAccountUser, TAccountVault, TAccountRewardsReflection, TAccountRewardsVault, TAccountAuthority, TAccountPayer, TAccountRewardsProgram, TAccountTokenProgram>, config?: {
62
+ programAddress?: TProgramAddress;
63
+ }): ExtendInstruction<TProgramAddress, TAccountJob, TAccountMarket, TAccountUser, TAccountVault, TAccountRewardsReflection, TAccountRewardsVault, TAccountAuthority, TAccountPayer, TAccountRewardsProgram, TAccountTokenProgram>;
64
+ export type ParsedExtendInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
65
+ programAddress: Address<TProgram>;
66
+ accounts: {
67
+ job: TAccountMetas[0];
68
+ market: TAccountMetas[1];
69
+ user: TAccountMetas[2];
70
+ vault: TAccountMetas[3];
71
+ rewardsReflection: TAccountMetas[4];
72
+ rewardsVault: TAccountMetas[5];
73
+ authority: TAccountMetas[6];
74
+ payer: TAccountMetas[7];
75
+ rewardsProgram: TAccountMetas[8];
76
+ tokenProgram: TAccountMetas[9];
77
+ };
78
+ data: ExtendInstructionData;
79
+ };
80
+ export declare function parseExtendInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedExtendInstruction<TProgram, TAccountMetas>;
@@ -0,0 +1,116 @@
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, getI64Decoder, getI64Encoder, getStructDecoder, getStructEncoder, transformEncoder, } from "@solana/kit";
9
+ import { NOSANA_JOBS_PROGRAM_ADDRESS } from "../programs/index.js";
10
+ import { getAccountMetaFactory } from "../shared/index.js";
11
+ export const EXTEND_INSTRUCTION_ACCOUNTS = {
12
+ job: 0,
13
+ market: 1,
14
+ user: 2,
15
+ vault: 3,
16
+ rewardsReflection: 4,
17
+ rewardsVault: 5,
18
+ authority: 6,
19
+ payer: 7,
20
+ rewardsProgram: 8,
21
+ tokenProgram: 9,
22
+ };
23
+ export const EXTEND_DISCRIMINATOR = new Uint8Array([
24
+ 228, 127, 0, 1, 227, 154, 54, 168,
25
+ ]);
26
+ export function getExtendDiscriminatorBytes() {
27
+ return fixEncoderSize(getBytesEncoder(), 8).encode(EXTEND_DISCRIMINATOR);
28
+ }
29
+ export function getExtendInstructionDataEncoder() {
30
+ return transformEncoder(getStructEncoder([
31
+ ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
32
+ ["timeout", getI64Encoder()],
33
+ ]), (value) => ({ ...value, discriminator: EXTEND_DISCRIMINATOR }));
34
+ }
35
+ export function getExtendInstructionDataDecoder() {
36
+ return getStructDecoder([
37
+ ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
38
+ ["timeout", getI64Decoder()],
39
+ ]);
40
+ }
41
+ export function getExtendInstructionDataCodec() {
42
+ return combineCodec(getExtendInstructionDataEncoder(), getExtendInstructionDataDecoder());
43
+ }
44
+ export function getExtendInstruction(input, config) {
45
+ // Program address.
46
+ const programAddress = config?.programAddress ?? NOSANA_JOBS_PROGRAM_ADDRESS;
47
+ // Original accounts.
48
+ const originalAccounts = {
49
+ job: { value: input.job ?? null, isWritable: true },
50
+ market: { value: input.market ?? null, isWritable: false },
51
+ user: { value: input.user ?? null, isWritable: true },
52
+ vault: { value: input.vault ?? null, isWritable: true },
53
+ rewardsReflection: {
54
+ value: input.rewardsReflection ?? null,
55
+ isWritable: true,
56
+ },
57
+ rewardsVault: { value: input.rewardsVault ?? null, isWritable: true },
58
+ authority: { value: input.authority ?? null, isWritable: false },
59
+ payer: { value: input.payer ?? null, isWritable: false },
60
+ rewardsProgram: { value: input.rewardsProgram ?? null, isWritable: false },
61
+ tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
62
+ };
63
+ const accounts = originalAccounts;
64
+ // Original args.
65
+ const args = { ...input };
66
+ // Resolve default values.
67
+ if (!accounts.tokenProgram.value) {
68
+ accounts.tokenProgram.value =
69
+ "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
70
+ }
71
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
72
+ return Object.freeze({
73
+ accounts: [
74
+ getAccountMeta(accounts.job),
75
+ getAccountMeta(accounts.market),
76
+ getAccountMeta(accounts.user),
77
+ getAccountMeta(accounts.vault),
78
+ getAccountMeta(accounts.rewardsReflection),
79
+ getAccountMeta(accounts.rewardsVault),
80
+ getAccountMeta(accounts.authority),
81
+ getAccountMeta(accounts.payer),
82
+ getAccountMeta(accounts.rewardsProgram),
83
+ getAccountMeta(accounts.tokenProgram),
84
+ ],
85
+ data: getExtendInstructionDataEncoder().encode(args),
86
+ programAddress,
87
+ });
88
+ }
89
+ export function parseExtendInstruction(instruction) {
90
+ if (instruction.accounts.length < 10) {
91
+ // TODO: Coded error.
92
+ throw new Error("Not enough accounts");
93
+ }
94
+ let accountIndex = 0;
95
+ const getNextAccount = () => {
96
+ const accountMeta = instruction.accounts[accountIndex];
97
+ accountIndex += 1;
98
+ return accountMeta;
99
+ };
100
+ return {
101
+ programAddress: instruction.programAddress,
102
+ accounts: {
103
+ job: getNextAccount(),
104
+ market: getNextAccount(),
105
+ user: getNextAccount(),
106
+ vault: getNextAccount(),
107
+ rewardsReflection: getNextAccount(),
108
+ rewardsVault: getNextAccount(),
109
+ authority: getNextAccount(),
110
+ payer: getNextAccount(),
111
+ rewardsProgram: getNextAccount(),
112
+ tokenProgram: getNextAccount(),
113
+ },
114
+ data: getExtendInstructionDataDecoder().decode(instruction.data),
115
+ };
116
+ }
@@ -0,0 +1,80 @@
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 TransactionSigner, type WritableAccount } from "@solana/kit";
9
+ import { NOSANA_JOBS_PROGRAM_ADDRESS } from "../programs/index.js";
10
+ export declare const FINISH_INSTRUCTION_ACCOUNTS: {
11
+ readonly job: 0;
12
+ readonly run: 1;
13
+ readonly market: 2;
14
+ readonly vault: 3;
15
+ readonly deposit: 4;
16
+ readonly user: 5;
17
+ readonly payerRun: 6;
18
+ readonly payerJob: 7;
19
+ readonly authority: 8;
20
+ readonly tokenProgram: 9;
21
+ };
22
+ export type FinishInstructionAccountName = keyof typeof FINISH_INSTRUCTION_ACCOUNTS;
23
+ export declare const FINISH_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
24
+ export declare function getFinishDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
25
+ export type FinishInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGRAM_ADDRESS, TAccountJob extends string | AccountMeta<string> = string, TAccountRun extends string | AccountMeta<string> = string, TAccountMarket extends string | AccountMeta<string> = string, TAccountVault extends string | AccountMeta<string> = string, TAccountDeposit extends string | AccountMeta<string> = string, TAccountUser extends string | AccountMeta<string> = string, TAccountPayerRun extends string | AccountMeta<string> = string, TAccountPayerJob extends string | AccountMeta<string> = string, TAccountAuthority extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
26
+ TAccountJob extends string ? WritableAccount<TAccountJob> : TAccountJob,
27
+ TAccountRun extends string ? WritableAccount<TAccountRun> : TAccountRun,
28
+ TAccountMarket extends string ? ReadonlyAccount<TAccountMarket> : TAccountMarket,
29
+ TAccountVault extends string ? WritableAccount<TAccountVault> : TAccountVault,
30
+ TAccountDeposit extends string ? WritableAccount<TAccountDeposit> : TAccountDeposit,
31
+ TAccountUser extends string ? WritableAccount<TAccountUser> : TAccountUser,
32
+ TAccountPayerRun extends string ? WritableAccount<TAccountPayerRun> : TAccountPayerRun,
33
+ TAccountPayerJob extends string ? WritableAccount<TAccountPayerJob> : TAccountPayerJob,
34
+ TAccountAuthority extends string ? ReadonlySignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority,
35
+ TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
36
+ ...TRemainingAccounts
37
+ ]>;
38
+ export type FinishInstructionData = {
39
+ discriminator: ReadonlyUint8Array;
40
+ ipfsResult: ReadonlyUint8Array;
41
+ };
42
+ export type FinishInstructionDataArgs = {
43
+ ipfsResult: ReadonlyUint8Array;
44
+ };
45
+ export declare function getFinishInstructionDataEncoder(): FixedSizeEncoder<FinishInstructionDataArgs>;
46
+ export declare function getFinishInstructionDataDecoder(): FixedSizeDecoder<FinishInstructionData>;
47
+ export declare function getFinishInstructionDataCodec(): FixedSizeCodec<FinishInstructionDataArgs, FinishInstructionData>;
48
+ export type FinishInput<TAccountJob extends string = string, TAccountRun extends string = string, TAccountMarket extends string = string, TAccountVault extends string = string, TAccountDeposit extends string = string, TAccountUser extends string = string, TAccountPayerRun extends string = string, TAccountPayerJob extends string = string, TAccountAuthority extends string = string, TAccountTokenProgram extends string = string> = {
49
+ job: Address<TAccountJob>;
50
+ run: Address<TAccountRun>;
51
+ market: Address<TAccountMarket>;
52
+ vault: Address<TAccountVault>;
53
+ deposit: Address<TAccountDeposit>;
54
+ user: Address<TAccountUser>;
55
+ payerRun: Address<TAccountPayerRun>;
56
+ payerJob: Address<TAccountPayerJob>;
57
+ authority: TransactionSigner<TAccountAuthority>;
58
+ tokenProgram?: Address<TAccountTokenProgram>;
59
+ ipfsResult: FinishInstructionDataArgs["ipfsResult"];
60
+ };
61
+ export declare function getFinishInstruction<TAccountJob extends string, TAccountRun extends string, TAccountMarket extends string, TAccountVault extends string, TAccountDeposit extends string, TAccountUser extends string, TAccountPayerRun extends string, TAccountPayerJob extends string, TAccountAuthority extends string, TAccountTokenProgram extends string, TProgramAddress extends Address = typeof NOSANA_JOBS_PROGRAM_ADDRESS>(input: FinishInput<TAccountJob, TAccountRun, TAccountMarket, TAccountVault, TAccountDeposit, TAccountUser, TAccountPayerRun, TAccountPayerJob, TAccountAuthority, TAccountTokenProgram>, config?: {
62
+ programAddress?: TProgramAddress;
63
+ }): FinishInstruction<TProgramAddress, TAccountJob, TAccountRun, TAccountMarket, TAccountVault, TAccountDeposit, TAccountUser, TAccountPayerRun, TAccountPayerJob, TAccountAuthority, TAccountTokenProgram>;
64
+ export type ParsedFinishInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
65
+ programAddress: Address<TProgram>;
66
+ accounts: {
67
+ job: TAccountMetas[0];
68
+ run: TAccountMetas[1];
69
+ market: TAccountMetas[2];
70
+ vault: TAccountMetas[3];
71
+ deposit: TAccountMetas[4];
72
+ user: TAccountMetas[5];
73
+ payerRun: TAccountMetas[6];
74
+ payerJob: TAccountMetas[7];
75
+ authority: TAccountMetas[8];
76
+ tokenProgram: TAccountMetas[9];
77
+ };
78
+ data: FinishInstructionData;
79
+ };
80
+ export declare function parseFinishInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedFinishInstruction<TProgram, TAccountMetas>;
@@ -0,0 +1,113 @@
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, transformEncoder, } from "@solana/kit";
9
+ import { NOSANA_JOBS_PROGRAM_ADDRESS } from "../programs/index.js";
10
+ import { getAccountMetaFactory } from "../shared/index.js";
11
+ export const FINISH_INSTRUCTION_ACCOUNTS = {
12
+ job: 0,
13
+ run: 1,
14
+ market: 2,
15
+ vault: 3,
16
+ deposit: 4,
17
+ user: 5,
18
+ payerRun: 6,
19
+ payerJob: 7,
20
+ authority: 8,
21
+ tokenProgram: 9,
22
+ };
23
+ export const FINISH_DISCRIMINATOR = new Uint8Array([
24
+ 67, 74, 170, 132, 125, 233, 182, 37,
25
+ ]);
26
+ export function getFinishDiscriminatorBytes() {
27
+ return fixEncoderSize(getBytesEncoder(), 8).encode(FINISH_DISCRIMINATOR);
28
+ }
29
+ export function getFinishInstructionDataEncoder() {
30
+ return transformEncoder(getStructEncoder([
31
+ ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
32
+ ["ipfsResult", fixEncoderSize(getBytesEncoder(), 32)],
33
+ ]), (value) => ({ ...value, discriminator: FINISH_DISCRIMINATOR }));
34
+ }
35
+ export function getFinishInstructionDataDecoder() {
36
+ return getStructDecoder([
37
+ ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
38
+ ["ipfsResult", fixDecoderSize(getBytesDecoder(), 32)],
39
+ ]);
40
+ }
41
+ export function getFinishInstructionDataCodec() {
42
+ return combineCodec(getFinishInstructionDataEncoder(), getFinishInstructionDataDecoder());
43
+ }
44
+ export function getFinishInstruction(input, config) {
45
+ // Program address.
46
+ const programAddress = config?.programAddress ?? NOSANA_JOBS_PROGRAM_ADDRESS;
47
+ // Original accounts.
48
+ const originalAccounts = {
49
+ job: { value: input.job ?? null, isWritable: true },
50
+ run: { value: input.run ?? null, isWritable: true },
51
+ market: { value: input.market ?? null, isWritable: false },
52
+ vault: { value: input.vault ?? null, isWritable: true },
53
+ deposit: { value: input.deposit ?? null, isWritable: true },
54
+ user: { value: input.user ?? null, isWritable: true },
55
+ payerRun: { value: input.payerRun ?? null, isWritable: true },
56
+ payerJob: { value: input.payerJob ?? null, isWritable: true },
57
+ authority: { value: input.authority ?? null, isWritable: false },
58
+ tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
59
+ };
60
+ const accounts = originalAccounts;
61
+ // Original args.
62
+ const args = { ...input };
63
+ // Resolve default values.
64
+ if (!accounts.tokenProgram.value) {
65
+ accounts.tokenProgram.value =
66
+ "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
67
+ }
68
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
69
+ return Object.freeze({
70
+ accounts: [
71
+ getAccountMeta(accounts.job),
72
+ getAccountMeta(accounts.run),
73
+ getAccountMeta(accounts.market),
74
+ getAccountMeta(accounts.vault),
75
+ getAccountMeta(accounts.deposit),
76
+ getAccountMeta(accounts.user),
77
+ getAccountMeta(accounts.payerRun),
78
+ getAccountMeta(accounts.payerJob),
79
+ getAccountMeta(accounts.authority),
80
+ getAccountMeta(accounts.tokenProgram),
81
+ ],
82
+ data: getFinishInstructionDataEncoder().encode(args),
83
+ programAddress,
84
+ });
85
+ }
86
+ export function parseFinishInstruction(instruction) {
87
+ if (instruction.accounts.length < 10) {
88
+ // TODO: Coded error.
89
+ throw new Error("Not enough accounts");
90
+ }
91
+ let accountIndex = 0;
92
+ const getNextAccount = () => {
93
+ const accountMeta = instruction.accounts[accountIndex];
94
+ accountIndex += 1;
95
+ return accountMeta;
96
+ };
97
+ return {
98
+ programAddress: instruction.programAddress,
99
+ accounts: {
100
+ job: getNextAccount(),
101
+ run: getNextAccount(),
102
+ market: getNextAccount(),
103
+ vault: getNextAccount(),
104
+ deposit: getNextAccount(),
105
+ user: getNextAccount(),
106
+ payerRun: getNextAccount(),
107
+ payerJob: getNextAccount(),
108
+ authority: getNextAccount(),
109
+ tokenProgram: getNextAccount(),
110
+ },
111
+ data: getFinishInstructionDataDecoder().decode(instruction.data),
112
+ };
113
+ }
@@ -0,0 +1,26 @@
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
+ export * from "./assign.js";
9
+ export * from "./claim.js";
10
+ export * from "./clean.js";
11
+ export * from "./cleanAdmin.js";
12
+ export * from "./close.js";
13
+ export * from "./closeAdmin.js";
14
+ export * from "./complete.js";
15
+ export * from "./delist.js";
16
+ export * from "./end.js";
17
+ export * from "./extend.js";
18
+ export * from "./finish.js";
19
+ export * from "./list.js";
20
+ export * from "./open.js";
21
+ export * from "./quit.js";
22
+ export * from "./quitAdmin.js";
23
+ export * from "./recover.js";
24
+ export * from "./stop.js";
25
+ export * from "./update.js";
26
+ export * from "./work.js";
@@ -0,0 +1,26 @@
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
+ export * from "./assign.js";
9
+ export * from "./claim.js";
10
+ export * from "./clean.js";
11
+ export * from "./cleanAdmin.js";
12
+ export * from "./close.js";
13
+ export * from "./closeAdmin.js";
14
+ export * from "./complete.js";
15
+ export * from "./delist.js";
16
+ export * from "./end.js";
17
+ export * from "./extend.js";
18
+ export * from "./finish.js";
19
+ export * from "./list.js";
20
+ export * from "./open.js";
21
+ export * from "./quit.js";
22
+ export * from "./quitAdmin.js";
23
+ export * from "./recover.js";
24
+ export * from "./stop.js";
25
+ export * from "./update.js";
26
+ export * from "./work.js";
@@ -0,0 +1,91 @@
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 TransactionSigner, type WritableAccount, type WritableSignerAccount } from "@solana/kit";
9
+ import { NOSANA_JOBS_PROGRAM_ADDRESS } from "../programs/index.js";
10
+ export declare const LIST_INSTRUCTION_ACCOUNTS: {
11
+ readonly job: 0;
12
+ readonly market: 1;
13
+ readonly run: 2;
14
+ readonly user: 3;
15
+ readonly vault: 4;
16
+ readonly payer: 5;
17
+ readonly rewardsReflection: 6;
18
+ readonly rewardsVault: 7;
19
+ readonly authority: 8;
20
+ readonly rewardsProgram: 9;
21
+ readonly tokenProgram: 10;
22
+ readonly systemProgram: 11;
23
+ };
24
+ export type ListInstructionAccountName = keyof typeof LIST_INSTRUCTION_ACCOUNTS;
25
+ export declare const LIST_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
26
+ export declare function getListDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
27
+ export type ListInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGRAM_ADDRESS, TAccountJob extends string | AccountMeta<string> = string, TAccountMarket extends string | AccountMeta<string> = string, TAccountRun extends string | AccountMeta<string> = string, TAccountUser extends string | AccountMeta<string> = string, TAccountVault extends string | AccountMeta<string> = string, TAccountPayer extends string | AccountMeta<string> = string, TAccountRewardsReflection extends string | AccountMeta<string> = string, TAccountRewardsVault extends string | AccountMeta<string> = string, TAccountAuthority extends string | AccountMeta<string> = string, TAccountRewardsProgram extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
28
+ TAccountJob extends string ? WritableSignerAccount<TAccountJob> & AccountSignerMeta<TAccountJob> : TAccountJob,
29
+ TAccountMarket extends string ? WritableAccount<TAccountMarket> : TAccountMarket,
30
+ TAccountRun extends string ? WritableSignerAccount<TAccountRun> & AccountSignerMeta<TAccountRun> : TAccountRun,
31
+ TAccountUser extends string ? WritableAccount<TAccountUser> : TAccountUser,
32
+ TAccountVault extends string ? WritableAccount<TAccountVault> : TAccountVault,
33
+ TAccountPayer extends string ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer> : TAccountPayer,
34
+ TAccountRewardsReflection extends string ? WritableAccount<TAccountRewardsReflection> : TAccountRewardsReflection,
35
+ TAccountRewardsVault extends string ? WritableAccount<TAccountRewardsVault> : TAccountRewardsVault,
36
+ TAccountAuthority extends string ? ReadonlySignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority,
37
+ TAccountRewardsProgram extends string ? ReadonlyAccount<TAccountRewardsProgram> : TAccountRewardsProgram,
38
+ TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
39
+ TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
40
+ ...TRemainingAccounts
41
+ ]>;
42
+ export type ListInstructionData = {
43
+ discriminator: ReadonlyUint8Array;
44
+ ipfsJob: ReadonlyUint8Array;
45
+ timeout: bigint;
46
+ };
47
+ export type ListInstructionDataArgs = {
48
+ ipfsJob: ReadonlyUint8Array;
49
+ timeout: number | bigint;
50
+ };
51
+ export declare function getListInstructionDataEncoder(): FixedSizeEncoder<ListInstructionDataArgs>;
52
+ export declare function getListInstructionDataDecoder(): FixedSizeDecoder<ListInstructionData>;
53
+ export declare function getListInstructionDataCodec(): FixedSizeCodec<ListInstructionDataArgs, ListInstructionData>;
54
+ export type ListInput<TAccountJob extends string = string, TAccountMarket extends string = string, TAccountRun extends string = string, TAccountUser extends string = string, TAccountVault extends string = string, TAccountPayer extends string = string, TAccountRewardsReflection extends string = string, TAccountRewardsVault extends string = string, TAccountAuthority extends string = string, TAccountRewardsProgram extends string = string, TAccountTokenProgram extends string = string, TAccountSystemProgram extends string = string> = {
55
+ job: TransactionSigner<TAccountJob>;
56
+ market: Address<TAccountMarket>;
57
+ run: TransactionSigner<TAccountRun>;
58
+ user: Address<TAccountUser>;
59
+ vault: Address<TAccountVault>;
60
+ payer: TransactionSigner<TAccountPayer>;
61
+ rewardsReflection: Address<TAccountRewardsReflection>;
62
+ rewardsVault: Address<TAccountRewardsVault>;
63
+ authority: TransactionSigner<TAccountAuthority>;
64
+ rewardsProgram: Address<TAccountRewardsProgram>;
65
+ tokenProgram?: Address<TAccountTokenProgram>;
66
+ systemProgram?: Address<TAccountSystemProgram>;
67
+ ipfsJob: ListInstructionDataArgs["ipfsJob"];
68
+ timeout: ListInstructionDataArgs["timeout"];
69
+ };
70
+ export declare function getListInstruction<TAccountJob extends string, TAccountMarket extends string, TAccountRun extends string, TAccountUser extends string, TAccountVault extends string, TAccountPayer extends string, TAccountRewardsReflection extends string, TAccountRewardsVault extends string, TAccountAuthority extends string, TAccountRewardsProgram extends string, TAccountTokenProgram extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof NOSANA_JOBS_PROGRAM_ADDRESS>(input: ListInput<TAccountJob, TAccountMarket, TAccountRun, TAccountUser, TAccountVault, TAccountPayer, TAccountRewardsReflection, TAccountRewardsVault, TAccountAuthority, TAccountRewardsProgram, TAccountTokenProgram, TAccountSystemProgram>, config?: {
71
+ programAddress?: TProgramAddress;
72
+ }): ListInstruction<TProgramAddress, TAccountJob, TAccountMarket, TAccountRun, TAccountUser, TAccountVault, TAccountPayer, TAccountRewardsReflection, TAccountRewardsVault, TAccountAuthority, TAccountRewardsProgram, TAccountTokenProgram, TAccountSystemProgram>;
73
+ export type ParsedListInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
74
+ programAddress: Address<TProgram>;
75
+ accounts: {
76
+ job: TAccountMetas[0];
77
+ market: TAccountMetas[1];
78
+ run: TAccountMetas[2];
79
+ user: TAccountMetas[3];
80
+ vault: TAccountMetas[4];
81
+ payer: TAccountMetas[5];
82
+ rewardsReflection: TAccountMetas[6];
83
+ rewardsVault: TAccountMetas[7];
84
+ authority: TAccountMetas[8];
85
+ rewardsProgram: TAccountMetas[9];
86
+ tokenProgram: TAccountMetas[10];
87
+ systemProgram: TAccountMetas[11];
88
+ };
89
+ data: ListInstructionData;
90
+ };
91
+ export declare function parseListInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedListInstruction<TProgram, TAccountMetas>;