@nosana/kit 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +21 -0
- package/README.md +159 -0
- package/dist/config/defaultConfigs.d.ts +2 -0
- package/dist/config/defaultConfigs.js +47 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.js +19 -0
- package/dist/config/types.d.ts +43 -0
- package/dist/config/types.js +16 -0
- package/dist/config/utils.d.ts +3 -0
- package/dist/config/utils.js +35 -0
- package/dist/errors/NosanaError.d.ts +16 -0
- package/dist/errors/NosanaError.js +22 -0
- package/dist/generated_clients/jobs/accounts/index.d.ts +10 -0
- package/dist/generated_clients/jobs/accounts/index.js +26 -0
- package/dist/generated_clients/jobs/accounts/jobAccount.d.ts +47 -0
- package/dist/generated_clients/jobs/accounts/jobAccount.js +86 -0
- package/dist/generated_clients/jobs/accounts/marketAccount.d.ts +46 -0
- package/dist/generated_clients/jobs/accounts/marketAccount.js +82 -0
- package/dist/generated_clients/jobs/accounts/runAccount.d.ts +35 -0
- package/dist/generated_clients/jobs/accounts/runAccount.js +74 -0
- package/dist/generated_clients/jobs/errors/index.d.ts +8 -0
- package/dist/generated_clients/jobs/errors/index.js +24 -0
- package/dist/generated_clients/jobs/errors/nosanaJobs.d.ts +57 -0
- package/dist/generated_clients/jobs/errors/nosanaJobs.js +85 -0
- package/dist/generated_clients/jobs/index.d.ts +12 -0
- package/dist/generated_clients/jobs/index.js +28 -0
- package/dist/generated_clients/jobs/instructions/claim.d.ts +60 -0
- package/dist/generated_clients/jobs/instructions/claim.js +102 -0
- package/dist/generated_clients/jobs/instructions/clean.d.ts +42 -0
- package/dist/generated_clients/jobs/instructions/clean.js +79 -0
- package/dist/generated_clients/jobs/instructions/cleanAdmin.d.ts +42 -0
- package/dist/generated_clients/jobs/instructions/cleanAdmin.js +79 -0
- package/dist/generated_clients/jobs/instructions/close.d.ts +48 -0
- package/dist/generated_clients/jobs/instructions/close.js +90 -0
- package/dist/generated_clients/jobs/instructions/closeAdmin.d.ts +48 -0
- package/dist/generated_clients/jobs/instructions/closeAdmin.js +90 -0
- package/dist/generated_clients/jobs/instructions/complete.d.ts +43 -0
- package/dist/generated_clients/jobs/instructions/complete.js +82 -0
- package/dist/generated_clients/jobs/instructions/delist.d.ts +54 -0
- package/dist/generated_clients/jobs/instructions/delist.js +96 -0
- package/dist/generated_clients/jobs/instructions/end.d.ts +60 -0
- package/dist/generated_clients/jobs/instructions/end.js +102 -0
- package/dist/generated_clients/jobs/instructions/extend.d.ts +64 -0
- package/dist/generated_clients/jobs/instructions/extend.js +111 -0
- package/dist/generated_clients/jobs/instructions/finish.d.ts +67 -0
- package/dist/generated_clients/jobs/instructions/finish.js +111 -0
- package/dist/generated_clients/jobs/instructions/index.d.ts +25 -0
- package/dist/generated_clients/jobs/instructions/index.js +41 -0
- package/dist/generated_clients/jobs/instructions/list.d.ts +76 -0
- package/dist/generated_clients/jobs/instructions/list.js +126 -0
- package/dist/generated_clients/jobs/instructions/open.d.ts +73 -0
- package/dist/generated_clients/jobs/instructions/open.js +121 -0
- package/dist/generated_clients/jobs/instructions/quit.d.ts +45 -0
- package/dist/generated_clients/jobs/instructions/quit.js +82 -0
- package/dist/generated_clients/jobs/instructions/quitAdmin.d.ts +42 -0
- package/dist/generated_clients/jobs/instructions/quitAdmin.js +79 -0
- package/dist/generated_clients/jobs/instructions/recover.d.ts +54 -0
- package/dist/generated_clients/jobs/instructions/recover.js +96 -0
- package/dist/generated_clients/jobs/instructions/stop.d.ts +42 -0
- package/dist/generated_clients/jobs/instructions/stop.js +79 -0
- package/dist/generated_clients/jobs/instructions/update.d.ts +58 -0
- package/dist/generated_clients/jobs/instructions/update.js +93 -0
- package/dist/generated_clients/jobs/instructions/work.d.ts +57 -0
- package/dist/generated_clients/jobs/instructions/work.js +99 -0
- package/dist/generated_clients/jobs/programs/index.d.ts +8 -0
- package/dist/generated_clients/jobs/programs/index.js +24 -0
- package/dist/generated_clients/jobs/programs/nosanaJobs.d.ts +78 -0
- package/dist/generated_clients/jobs/programs/nosanaJobs.js +112 -0
- package/dist/generated_clients/jobs/shared/index.d.ts +49 -0
- package/dist/generated_clients/jobs/shared/index.js +94 -0
- package/dist/generated_clients/jobs/types/index.d.ts +10 -0
- package/dist/generated_clients/jobs/types/index.js +26 -0
- package/dist/generated_clients/jobs/types/jobState.d.ts +18 -0
- package/dist/generated_clients/jobs/types/jobState.js +30 -0
- package/dist/generated_clients/jobs/types/jobType.d.ts +21 -0
- package/dist/generated_clients/jobs/types/jobType.js +33 -0
- package/dist/generated_clients/jobs/types/queueType.d.ts +18 -0
- package/dist/generated_clients/jobs/types/queueType.js +30 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +43 -0
- package/dist/ipfs/IPFS.d.ts +19 -0
- package/dist/ipfs/IPFS.js +47 -0
- package/dist/logger/Logger.d.ts +24 -0
- package/dist/logger/Logger.js +63 -0
- package/dist/programs/BaseProgram.d.ts +20 -0
- package/dist/programs/BaseProgram.js +39 -0
- package/dist/programs/JobsProgram.d.ts +118 -0
- package/dist/programs/JobsProgram.js +611 -0
- package/dist/solana/SolanaUtils.d.ts +15 -0
- package/dist/solana/SolanaUtils.js +48 -0
- package/dist/utils/index.d.ts +19 -0
- package/dist/utils/index.js +17 -0
- package/examples/node/monitor.ts +143 -0
- package/examples/node/package-lock.json +245 -0
- package/examples/node/package.json +16 -0
- package/examples/node/retrieve.ts +18 -0
- package/package.json +47 -0
- package/scripts/generate-clients.ts +9 -0
|
@@ -0,0 +1,54 @@
|
|
|
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 Address, type Codec, type Decoder, type Encoder, type IAccountMeta, type IAccountSignerMeta, type IInstruction, type IInstructionWithAccounts, type IInstructionWithData, type ReadonlyAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount, type WritableSignerAccount } from '@solana/kit';
|
|
9
|
+
import { NOSANA_JOBS_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
+
export declare const DELIST_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
11
|
+
export declare function getDelistDiscriminatorBytes(): ReadonlyUint8Array;
|
|
12
|
+
export type DelistInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGRAM_ADDRESS, TAccountJob extends string | IAccountMeta<string> = string, TAccountMarket extends string | IAccountMeta<string> = string, TAccountDeposit extends string | IAccountMeta<string> = string, TAccountPayer extends string | IAccountMeta<string> = string, TAccountVault extends string | IAccountMeta<string> = string, TAccountTokenProgram extends string | IAccountMeta<string> = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', TAccountAuthority extends string | IAccountMeta<string> = string, TRemainingAccounts extends readonly IAccountMeta<string>[] = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<[
|
|
13
|
+
TAccountJob extends string ? WritableAccount<TAccountJob> : TAccountJob,
|
|
14
|
+
TAccountMarket extends string ? WritableAccount<TAccountMarket> : TAccountMarket,
|
|
15
|
+
TAccountDeposit extends string ? WritableAccount<TAccountDeposit> : TAccountDeposit,
|
|
16
|
+
TAccountPayer extends string ? WritableAccount<TAccountPayer> : TAccountPayer,
|
|
17
|
+
TAccountVault extends string ? WritableAccount<TAccountVault> : TAccountVault,
|
|
18
|
+
TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
|
|
19
|
+
TAccountAuthority extends string ? WritableSignerAccount<TAccountAuthority> & IAccountSignerMeta<TAccountAuthority> : TAccountAuthority,
|
|
20
|
+
...TRemainingAccounts
|
|
21
|
+
]>;
|
|
22
|
+
export type DelistInstructionData = {
|
|
23
|
+
discriminator: ReadonlyUint8Array;
|
|
24
|
+
};
|
|
25
|
+
export type DelistInstructionDataArgs = {};
|
|
26
|
+
export declare function getDelistInstructionDataEncoder(): Encoder<DelistInstructionDataArgs>;
|
|
27
|
+
export declare function getDelistInstructionDataDecoder(): Decoder<DelistInstructionData>;
|
|
28
|
+
export declare function getDelistInstructionDataCodec(): Codec<DelistInstructionDataArgs, DelistInstructionData>;
|
|
29
|
+
export type DelistInput<TAccountJob extends string = string, TAccountMarket extends string = string, TAccountDeposit extends string = string, TAccountPayer extends string = string, TAccountVault extends string = string, TAccountTokenProgram extends string = string, TAccountAuthority extends string = string> = {
|
|
30
|
+
job: Address<TAccountJob>;
|
|
31
|
+
market: Address<TAccountMarket>;
|
|
32
|
+
deposit: Address<TAccountDeposit>;
|
|
33
|
+
payer: Address<TAccountPayer>;
|
|
34
|
+
vault: Address<TAccountVault>;
|
|
35
|
+
tokenProgram?: Address<TAccountTokenProgram>;
|
|
36
|
+
authority: TransactionSigner<TAccountAuthority>;
|
|
37
|
+
};
|
|
38
|
+
export declare function getDelistInstruction<TAccountJob extends string, TAccountMarket extends string, TAccountDeposit extends string, TAccountPayer extends string, TAccountVault extends string, TAccountTokenProgram extends string, TAccountAuthority extends string, TProgramAddress extends Address = typeof NOSANA_JOBS_PROGRAM_ADDRESS>(input: DelistInput<TAccountJob, TAccountMarket, TAccountDeposit, TAccountPayer, TAccountVault, TAccountTokenProgram, TAccountAuthority>, config?: {
|
|
39
|
+
programAddress?: TProgramAddress;
|
|
40
|
+
}): DelistInstruction<TProgramAddress, TAccountJob, TAccountMarket, TAccountDeposit, TAccountPayer, TAccountVault, TAccountTokenProgram, TAccountAuthority>;
|
|
41
|
+
export type ParsedDelistInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGRAM_ADDRESS, TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[]> = {
|
|
42
|
+
programAddress: Address<TProgram>;
|
|
43
|
+
accounts: {
|
|
44
|
+
job: TAccountMetas[0];
|
|
45
|
+
market: TAccountMetas[1];
|
|
46
|
+
deposit: TAccountMetas[2];
|
|
47
|
+
payer: TAccountMetas[3];
|
|
48
|
+
vault: TAccountMetas[4];
|
|
49
|
+
tokenProgram: TAccountMetas[5];
|
|
50
|
+
authority: TAccountMetas[6];
|
|
51
|
+
};
|
|
52
|
+
data: DelistInstructionData;
|
|
53
|
+
};
|
|
54
|
+
export declare function parseDelistInstruction<TProgram extends string, TAccountMetas extends readonly IAccountMeta[]>(instruction: IInstruction<TProgram> & IInstructionWithAccounts<TAccountMetas> & IInstructionWithData<Uint8Array>): ParsedDelistInstruction<TProgram, TAccountMetas>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code was AUTOGENERATED using the codama library.
|
|
4
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
5
|
+
* to add features, then rerun codama to update it.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/codama-idl/codama
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.DELIST_DISCRIMINATOR = void 0;
|
|
11
|
+
exports.getDelistDiscriminatorBytes = getDelistDiscriminatorBytes;
|
|
12
|
+
exports.getDelistInstructionDataEncoder = getDelistInstructionDataEncoder;
|
|
13
|
+
exports.getDelistInstructionDataDecoder = getDelistInstructionDataDecoder;
|
|
14
|
+
exports.getDelistInstructionDataCodec = getDelistInstructionDataCodec;
|
|
15
|
+
exports.getDelistInstruction = getDelistInstruction;
|
|
16
|
+
exports.parseDelistInstruction = parseDelistInstruction;
|
|
17
|
+
const kit_1 = require("@solana/kit");
|
|
18
|
+
const programs_1 = require("../programs");
|
|
19
|
+
const shared_1 = require("../shared");
|
|
20
|
+
exports.DELIST_DISCRIMINATOR = new Uint8Array([
|
|
21
|
+
55, 136, 205, 107, 107, 173, 4, 31,
|
|
22
|
+
]);
|
|
23
|
+
function getDelistDiscriminatorBytes() {
|
|
24
|
+
return (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(exports.DELIST_DISCRIMINATOR);
|
|
25
|
+
}
|
|
26
|
+
function getDelistInstructionDataEncoder() {
|
|
27
|
+
return (0, kit_1.transformEncoder)((0, kit_1.getStructEncoder)([['discriminator', (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8)]]), (value) => ({ ...value, discriminator: exports.DELIST_DISCRIMINATOR }));
|
|
28
|
+
}
|
|
29
|
+
function getDelistInstructionDataDecoder() {
|
|
30
|
+
return (0, kit_1.getStructDecoder)([
|
|
31
|
+
['discriminator', (0, kit_1.fixDecoderSize)((0, kit_1.getBytesDecoder)(), 8)],
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
function getDelistInstructionDataCodec() {
|
|
35
|
+
return (0, kit_1.combineCodec)(getDelistInstructionDataEncoder(), getDelistInstructionDataDecoder());
|
|
36
|
+
}
|
|
37
|
+
function getDelistInstruction(input, config) {
|
|
38
|
+
// Program address.
|
|
39
|
+
const programAddress = config?.programAddress ?? programs_1.NOSANA_JOBS_PROGRAM_ADDRESS;
|
|
40
|
+
// Original accounts.
|
|
41
|
+
const originalAccounts = {
|
|
42
|
+
job: { value: input.job ?? null, isWritable: true },
|
|
43
|
+
market: { value: input.market ?? null, isWritable: true },
|
|
44
|
+
deposit: { value: input.deposit ?? null, isWritable: true },
|
|
45
|
+
payer: { value: input.payer ?? null, isWritable: true },
|
|
46
|
+
vault: { value: input.vault ?? null, isWritable: true },
|
|
47
|
+
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
48
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
49
|
+
};
|
|
50
|
+
const accounts = originalAccounts;
|
|
51
|
+
// Resolve default values.
|
|
52
|
+
if (!accounts.tokenProgram.value) {
|
|
53
|
+
accounts.tokenProgram.value =
|
|
54
|
+
'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
|
|
55
|
+
}
|
|
56
|
+
const getAccountMeta = (0, shared_1.getAccountMetaFactory)(programAddress, 'programId');
|
|
57
|
+
const instruction = {
|
|
58
|
+
accounts: [
|
|
59
|
+
getAccountMeta(accounts.job),
|
|
60
|
+
getAccountMeta(accounts.market),
|
|
61
|
+
getAccountMeta(accounts.deposit),
|
|
62
|
+
getAccountMeta(accounts.payer),
|
|
63
|
+
getAccountMeta(accounts.vault),
|
|
64
|
+
getAccountMeta(accounts.tokenProgram),
|
|
65
|
+
getAccountMeta(accounts.authority),
|
|
66
|
+
],
|
|
67
|
+
programAddress,
|
|
68
|
+
data: getDelistInstructionDataEncoder().encode({}),
|
|
69
|
+
};
|
|
70
|
+
return instruction;
|
|
71
|
+
}
|
|
72
|
+
function parseDelistInstruction(instruction) {
|
|
73
|
+
if (instruction.accounts.length < 7) {
|
|
74
|
+
// TODO: Coded error.
|
|
75
|
+
throw new Error('Not enough accounts');
|
|
76
|
+
}
|
|
77
|
+
let accountIndex = 0;
|
|
78
|
+
const getNextAccount = () => {
|
|
79
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
80
|
+
accountIndex += 1;
|
|
81
|
+
return accountMeta;
|
|
82
|
+
};
|
|
83
|
+
return {
|
|
84
|
+
programAddress: instruction.programAddress,
|
|
85
|
+
accounts: {
|
|
86
|
+
job: getNextAccount(),
|
|
87
|
+
market: getNextAccount(),
|
|
88
|
+
deposit: getNextAccount(),
|
|
89
|
+
payer: getNextAccount(),
|
|
90
|
+
vault: getNextAccount(),
|
|
91
|
+
tokenProgram: getNextAccount(),
|
|
92
|
+
authority: getNextAccount(),
|
|
93
|
+
},
|
|
94
|
+
data: getDelistInstructionDataDecoder().decode(instruction.data),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
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 Address, type Codec, type Decoder, type Encoder, type IAccountMeta, type IAccountSignerMeta, type IInstruction, type IInstructionWithAccounts, type IInstructionWithData, type ReadonlyAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount, type WritableSignerAccount } from '@solana/kit';
|
|
9
|
+
import { NOSANA_JOBS_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
+
export declare const END_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
11
|
+
export declare function getEndDiscriminatorBytes(): ReadonlyUint8Array;
|
|
12
|
+
export type EndInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGRAM_ADDRESS, TAccountJob extends string | IAccountMeta<string> = string, TAccountMarket extends string | IAccountMeta<string> = string, TAccountRun extends string | IAccountMeta<string> = string, TAccountDeposit extends string | IAccountMeta<string> = string, TAccountUser extends string | IAccountMeta<string> = string, TAccountVault extends string | IAccountMeta<string> = string, TAccountPayer extends string | IAccountMeta<string> = string, TAccountAuthority extends string | IAccountMeta<string> = string, TAccountTokenProgram extends string | IAccountMeta<string> = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', TRemainingAccounts extends readonly IAccountMeta<string>[] = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<[
|
|
13
|
+
TAccountJob extends string ? WritableAccount<TAccountJob> : TAccountJob,
|
|
14
|
+
TAccountMarket extends string ? ReadonlyAccount<TAccountMarket> : TAccountMarket,
|
|
15
|
+
TAccountRun extends string ? WritableAccount<TAccountRun> : TAccountRun,
|
|
16
|
+
TAccountDeposit extends string ? WritableAccount<TAccountDeposit> : TAccountDeposit,
|
|
17
|
+
TAccountUser extends string ? WritableAccount<TAccountUser> : TAccountUser,
|
|
18
|
+
TAccountVault extends string ? WritableAccount<TAccountVault> : TAccountVault,
|
|
19
|
+
TAccountPayer extends string ? WritableAccount<TAccountPayer> : TAccountPayer,
|
|
20
|
+
TAccountAuthority extends string ? WritableSignerAccount<TAccountAuthority> & IAccountSignerMeta<TAccountAuthority> : TAccountAuthority,
|
|
21
|
+
TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
|
|
22
|
+
...TRemainingAccounts
|
|
23
|
+
]>;
|
|
24
|
+
export type EndInstructionData = {
|
|
25
|
+
discriminator: ReadonlyUint8Array;
|
|
26
|
+
};
|
|
27
|
+
export type EndInstructionDataArgs = {};
|
|
28
|
+
export declare function getEndInstructionDataEncoder(): Encoder<EndInstructionDataArgs>;
|
|
29
|
+
export declare function getEndInstructionDataDecoder(): Decoder<EndInstructionData>;
|
|
30
|
+
export declare function getEndInstructionDataCodec(): Codec<EndInstructionDataArgs, EndInstructionData>;
|
|
31
|
+
export type EndInput<TAccountJob extends string = string, TAccountMarket extends string = string, TAccountRun extends string = string, TAccountDeposit extends string = string, TAccountUser extends string = string, TAccountVault extends string = string, TAccountPayer extends string = string, TAccountAuthority extends string = string, TAccountTokenProgram extends string = string> = {
|
|
32
|
+
job: Address<TAccountJob>;
|
|
33
|
+
market: Address<TAccountMarket>;
|
|
34
|
+
run: Address<TAccountRun>;
|
|
35
|
+
deposit: Address<TAccountDeposit>;
|
|
36
|
+
user: Address<TAccountUser>;
|
|
37
|
+
vault: Address<TAccountVault>;
|
|
38
|
+
payer: Address<TAccountPayer>;
|
|
39
|
+
authority: TransactionSigner<TAccountAuthority>;
|
|
40
|
+
tokenProgram?: Address<TAccountTokenProgram>;
|
|
41
|
+
};
|
|
42
|
+
export declare function getEndInstruction<TAccountJob extends string, TAccountMarket extends string, TAccountRun extends string, TAccountDeposit extends string, TAccountUser extends string, TAccountVault extends string, TAccountPayer extends string, TAccountAuthority extends string, TAccountTokenProgram extends string, TProgramAddress extends Address = typeof NOSANA_JOBS_PROGRAM_ADDRESS>(input: EndInput<TAccountJob, TAccountMarket, TAccountRun, TAccountDeposit, TAccountUser, TAccountVault, TAccountPayer, TAccountAuthority, TAccountTokenProgram>, config?: {
|
|
43
|
+
programAddress?: TProgramAddress;
|
|
44
|
+
}): EndInstruction<TProgramAddress, TAccountJob, TAccountMarket, TAccountRun, TAccountDeposit, TAccountUser, TAccountVault, TAccountPayer, TAccountAuthority, TAccountTokenProgram>;
|
|
45
|
+
export type ParsedEndInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGRAM_ADDRESS, TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[]> = {
|
|
46
|
+
programAddress: Address<TProgram>;
|
|
47
|
+
accounts: {
|
|
48
|
+
job: TAccountMetas[0];
|
|
49
|
+
market: TAccountMetas[1];
|
|
50
|
+
run: TAccountMetas[2];
|
|
51
|
+
deposit: TAccountMetas[3];
|
|
52
|
+
user: TAccountMetas[4];
|
|
53
|
+
vault: TAccountMetas[5];
|
|
54
|
+
payer: TAccountMetas[6];
|
|
55
|
+
authority: TAccountMetas[7];
|
|
56
|
+
tokenProgram: TAccountMetas[8];
|
|
57
|
+
};
|
|
58
|
+
data: EndInstructionData;
|
|
59
|
+
};
|
|
60
|
+
export declare function parseEndInstruction<TProgram extends string, TAccountMetas extends readonly IAccountMeta[]>(instruction: IInstruction<TProgram> & IInstructionWithAccounts<TAccountMetas> & IInstructionWithData<Uint8Array>): ParsedEndInstruction<TProgram, TAccountMetas>;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code was AUTOGENERATED using the codama library.
|
|
4
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
5
|
+
* to add features, then rerun codama to update it.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/codama-idl/codama
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.END_DISCRIMINATOR = void 0;
|
|
11
|
+
exports.getEndDiscriminatorBytes = getEndDiscriminatorBytes;
|
|
12
|
+
exports.getEndInstructionDataEncoder = getEndInstructionDataEncoder;
|
|
13
|
+
exports.getEndInstructionDataDecoder = getEndInstructionDataDecoder;
|
|
14
|
+
exports.getEndInstructionDataCodec = getEndInstructionDataCodec;
|
|
15
|
+
exports.getEndInstruction = getEndInstruction;
|
|
16
|
+
exports.parseEndInstruction = parseEndInstruction;
|
|
17
|
+
const kit_1 = require("@solana/kit");
|
|
18
|
+
const programs_1 = require("../programs");
|
|
19
|
+
const shared_1 = require("../shared");
|
|
20
|
+
exports.END_DISCRIMINATOR = new Uint8Array([
|
|
21
|
+
180, 160, 249, 217, 194, 121, 70, 16,
|
|
22
|
+
]);
|
|
23
|
+
function getEndDiscriminatorBytes() {
|
|
24
|
+
return (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(exports.END_DISCRIMINATOR);
|
|
25
|
+
}
|
|
26
|
+
function getEndInstructionDataEncoder() {
|
|
27
|
+
return (0, kit_1.transformEncoder)((0, kit_1.getStructEncoder)([['discriminator', (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8)]]), (value) => ({ ...value, discriminator: exports.END_DISCRIMINATOR }));
|
|
28
|
+
}
|
|
29
|
+
function getEndInstructionDataDecoder() {
|
|
30
|
+
return (0, kit_1.getStructDecoder)([
|
|
31
|
+
['discriminator', (0, kit_1.fixDecoderSize)((0, kit_1.getBytesDecoder)(), 8)],
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
function getEndInstructionDataCodec() {
|
|
35
|
+
return (0, kit_1.combineCodec)(getEndInstructionDataEncoder(), getEndInstructionDataDecoder());
|
|
36
|
+
}
|
|
37
|
+
function getEndInstruction(input, config) {
|
|
38
|
+
// Program address.
|
|
39
|
+
const programAddress = config?.programAddress ?? programs_1.NOSANA_JOBS_PROGRAM_ADDRESS;
|
|
40
|
+
// Original accounts.
|
|
41
|
+
const originalAccounts = {
|
|
42
|
+
job: { value: input.job ?? null, isWritable: true },
|
|
43
|
+
market: { value: input.market ?? null, isWritable: false },
|
|
44
|
+
run: { value: input.run ?? null, isWritable: true },
|
|
45
|
+
deposit: { value: input.deposit ?? null, isWritable: true },
|
|
46
|
+
user: { value: input.user ?? null, isWritable: true },
|
|
47
|
+
vault: { value: input.vault ?? null, isWritable: true },
|
|
48
|
+
payer: { value: input.payer ?? null, isWritable: true },
|
|
49
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
50
|
+
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
51
|
+
};
|
|
52
|
+
const accounts = originalAccounts;
|
|
53
|
+
// Resolve default values.
|
|
54
|
+
if (!accounts.tokenProgram.value) {
|
|
55
|
+
accounts.tokenProgram.value =
|
|
56
|
+
'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
|
|
57
|
+
}
|
|
58
|
+
const getAccountMeta = (0, shared_1.getAccountMetaFactory)(programAddress, 'programId');
|
|
59
|
+
const instruction = {
|
|
60
|
+
accounts: [
|
|
61
|
+
getAccountMeta(accounts.job),
|
|
62
|
+
getAccountMeta(accounts.market),
|
|
63
|
+
getAccountMeta(accounts.run),
|
|
64
|
+
getAccountMeta(accounts.deposit),
|
|
65
|
+
getAccountMeta(accounts.user),
|
|
66
|
+
getAccountMeta(accounts.vault),
|
|
67
|
+
getAccountMeta(accounts.payer),
|
|
68
|
+
getAccountMeta(accounts.authority),
|
|
69
|
+
getAccountMeta(accounts.tokenProgram),
|
|
70
|
+
],
|
|
71
|
+
programAddress,
|
|
72
|
+
data: getEndInstructionDataEncoder().encode({}),
|
|
73
|
+
};
|
|
74
|
+
return instruction;
|
|
75
|
+
}
|
|
76
|
+
function parseEndInstruction(instruction) {
|
|
77
|
+
if (instruction.accounts.length < 9) {
|
|
78
|
+
// TODO: Coded error.
|
|
79
|
+
throw new Error('Not enough accounts');
|
|
80
|
+
}
|
|
81
|
+
let accountIndex = 0;
|
|
82
|
+
const getNextAccount = () => {
|
|
83
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
84
|
+
accountIndex += 1;
|
|
85
|
+
return accountMeta;
|
|
86
|
+
};
|
|
87
|
+
return {
|
|
88
|
+
programAddress: instruction.programAddress,
|
|
89
|
+
accounts: {
|
|
90
|
+
job: getNextAccount(),
|
|
91
|
+
market: getNextAccount(),
|
|
92
|
+
run: getNextAccount(),
|
|
93
|
+
deposit: getNextAccount(),
|
|
94
|
+
user: getNextAccount(),
|
|
95
|
+
vault: getNextAccount(),
|
|
96
|
+
payer: getNextAccount(),
|
|
97
|
+
authority: getNextAccount(),
|
|
98
|
+
tokenProgram: getNextAccount(),
|
|
99
|
+
},
|
|
100
|
+
data: getEndInstructionDataDecoder().decode(instruction.data),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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 Address, type Codec, type Decoder, type Encoder, type IAccountMeta, type IAccountSignerMeta, type IInstruction, type IInstructionWithAccounts, type IInstructionWithData, type ReadonlyAccount, type ReadonlySignerAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount } from '@solana/kit';
|
|
9
|
+
import { NOSANA_JOBS_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
+
export declare const EXTEND_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
11
|
+
export declare function getExtendDiscriminatorBytes(): ReadonlyUint8Array;
|
|
12
|
+
export type ExtendInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGRAM_ADDRESS, TAccountJob extends string | IAccountMeta<string> = string, TAccountMarket extends string | IAccountMeta<string> = string, TAccountUser extends string | IAccountMeta<string> = string, TAccountVault extends string | IAccountMeta<string> = string, TAccountRewardsReflection extends string | IAccountMeta<string> = string, TAccountRewardsVault extends string | IAccountMeta<string> = string, TAccountAuthority extends string | IAccountMeta<string> = string, TAccountRewardsProgram extends string | IAccountMeta<string> = string, TAccountTokenProgram extends string | IAccountMeta<string> = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', TRemainingAccounts extends readonly IAccountMeta<string>[] = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<[
|
|
13
|
+
TAccountJob extends string ? WritableAccount<TAccountJob> : TAccountJob,
|
|
14
|
+
TAccountMarket extends string ? ReadonlyAccount<TAccountMarket> : TAccountMarket,
|
|
15
|
+
TAccountUser extends string ? WritableAccount<TAccountUser> : TAccountUser,
|
|
16
|
+
TAccountVault extends string ? WritableAccount<TAccountVault> : TAccountVault,
|
|
17
|
+
TAccountRewardsReflection extends string ? WritableAccount<TAccountRewardsReflection> : TAccountRewardsReflection,
|
|
18
|
+
TAccountRewardsVault extends string ? WritableAccount<TAccountRewardsVault> : TAccountRewardsVault,
|
|
19
|
+
TAccountAuthority extends string ? ReadonlySignerAccount<TAccountAuthority> & IAccountSignerMeta<TAccountAuthority> : TAccountAuthority,
|
|
20
|
+
TAccountRewardsProgram extends string ? ReadonlyAccount<TAccountRewardsProgram> : TAccountRewardsProgram,
|
|
21
|
+
TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
|
|
22
|
+
...TRemainingAccounts
|
|
23
|
+
]>;
|
|
24
|
+
export type ExtendInstructionData = {
|
|
25
|
+
discriminator: ReadonlyUint8Array;
|
|
26
|
+
timeout: bigint;
|
|
27
|
+
};
|
|
28
|
+
export type ExtendInstructionDataArgs = {
|
|
29
|
+
timeout: number | bigint;
|
|
30
|
+
};
|
|
31
|
+
export declare function getExtendInstructionDataEncoder(): Encoder<ExtendInstructionDataArgs>;
|
|
32
|
+
export declare function getExtendInstructionDataDecoder(): Decoder<ExtendInstructionData>;
|
|
33
|
+
export declare function getExtendInstructionDataCodec(): Codec<ExtendInstructionDataArgs, ExtendInstructionData>;
|
|
34
|
+
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, TAccountRewardsProgram extends string = string, TAccountTokenProgram extends string = string> = {
|
|
35
|
+
job: Address<TAccountJob>;
|
|
36
|
+
market: Address<TAccountMarket>;
|
|
37
|
+
user: Address<TAccountUser>;
|
|
38
|
+
vault: Address<TAccountVault>;
|
|
39
|
+
rewardsReflection: Address<TAccountRewardsReflection>;
|
|
40
|
+
rewardsVault: Address<TAccountRewardsVault>;
|
|
41
|
+
authority: TransactionSigner<TAccountAuthority>;
|
|
42
|
+
rewardsProgram: Address<TAccountRewardsProgram>;
|
|
43
|
+
tokenProgram?: Address<TAccountTokenProgram>;
|
|
44
|
+
timeout: ExtendInstructionDataArgs['timeout'];
|
|
45
|
+
};
|
|
46
|
+
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, TAccountRewardsProgram extends string, TAccountTokenProgram extends string, TProgramAddress extends Address = typeof NOSANA_JOBS_PROGRAM_ADDRESS>(input: ExtendInput<TAccountJob, TAccountMarket, TAccountUser, TAccountVault, TAccountRewardsReflection, TAccountRewardsVault, TAccountAuthority, TAccountRewardsProgram, TAccountTokenProgram>, config?: {
|
|
47
|
+
programAddress?: TProgramAddress;
|
|
48
|
+
}): ExtendInstruction<TProgramAddress, TAccountJob, TAccountMarket, TAccountUser, TAccountVault, TAccountRewardsReflection, TAccountRewardsVault, TAccountAuthority, TAccountRewardsProgram, TAccountTokenProgram>;
|
|
49
|
+
export type ParsedExtendInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGRAM_ADDRESS, TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[]> = {
|
|
50
|
+
programAddress: Address<TProgram>;
|
|
51
|
+
accounts: {
|
|
52
|
+
job: TAccountMetas[0];
|
|
53
|
+
market: TAccountMetas[1];
|
|
54
|
+
user: TAccountMetas[2];
|
|
55
|
+
vault: TAccountMetas[3];
|
|
56
|
+
rewardsReflection: TAccountMetas[4];
|
|
57
|
+
rewardsVault: TAccountMetas[5];
|
|
58
|
+
authority: TAccountMetas[6];
|
|
59
|
+
rewardsProgram: TAccountMetas[7];
|
|
60
|
+
tokenProgram: TAccountMetas[8];
|
|
61
|
+
};
|
|
62
|
+
data: ExtendInstructionData;
|
|
63
|
+
};
|
|
64
|
+
export declare function parseExtendInstruction<TProgram extends string, TAccountMetas extends readonly IAccountMeta[]>(instruction: IInstruction<TProgram> & IInstructionWithAccounts<TAccountMetas> & IInstructionWithData<Uint8Array>): ParsedExtendInstruction<TProgram, TAccountMetas>;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code was AUTOGENERATED using the codama library.
|
|
4
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
5
|
+
* to add features, then rerun codama to update it.
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/codama-idl/codama
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.EXTEND_DISCRIMINATOR = void 0;
|
|
11
|
+
exports.getExtendDiscriminatorBytes = getExtendDiscriminatorBytes;
|
|
12
|
+
exports.getExtendInstructionDataEncoder = getExtendInstructionDataEncoder;
|
|
13
|
+
exports.getExtendInstructionDataDecoder = getExtendInstructionDataDecoder;
|
|
14
|
+
exports.getExtendInstructionDataCodec = getExtendInstructionDataCodec;
|
|
15
|
+
exports.getExtendInstruction = getExtendInstruction;
|
|
16
|
+
exports.parseExtendInstruction = parseExtendInstruction;
|
|
17
|
+
const kit_1 = require("@solana/kit");
|
|
18
|
+
const programs_1 = require("../programs");
|
|
19
|
+
const shared_1 = require("../shared");
|
|
20
|
+
exports.EXTEND_DISCRIMINATOR = new Uint8Array([
|
|
21
|
+
228, 127, 0, 1, 227, 154, 54, 168,
|
|
22
|
+
]);
|
|
23
|
+
function getExtendDiscriminatorBytes() {
|
|
24
|
+
return (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(exports.EXTEND_DISCRIMINATOR);
|
|
25
|
+
}
|
|
26
|
+
function getExtendInstructionDataEncoder() {
|
|
27
|
+
return (0, kit_1.transformEncoder)((0, kit_1.getStructEncoder)([
|
|
28
|
+
['discriminator', (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8)],
|
|
29
|
+
['timeout', (0, kit_1.getI64Encoder)()],
|
|
30
|
+
]), (value) => ({ ...value, discriminator: exports.EXTEND_DISCRIMINATOR }));
|
|
31
|
+
}
|
|
32
|
+
function getExtendInstructionDataDecoder() {
|
|
33
|
+
return (0, kit_1.getStructDecoder)([
|
|
34
|
+
['discriminator', (0, kit_1.fixDecoderSize)((0, kit_1.getBytesDecoder)(), 8)],
|
|
35
|
+
['timeout', (0, kit_1.getI64Decoder)()],
|
|
36
|
+
]);
|
|
37
|
+
}
|
|
38
|
+
function getExtendInstructionDataCodec() {
|
|
39
|
+
return (0, kit_1.combineCodec)(getExtendInstructionDataEncoder(), getExtendInstructionDataDecoder());
|
|
40
|
+
}
|
|
41
|
+
function getExtendInstruction(input, config) {
|
|
42
|
+
// Program address.
|
|
43
|
+
const programAddress = config?.programAddress ?? programs_1.NOSANA_JOBS_PROGRAM_ADDRESS;
|
|
44
|
+
// Original accounts.
|
|
45
|
+
const originalAccounts = {
|
|
46
|
+
job: { value: input.job ?? null, isWritable: true },
|
|
47
|
+
market: { value: input.market ?? null, isWritable: false },
|
|
48
|
+
user: { value: input.user ?? null, isWritable: true },
|
|
49
|
+
vault: { value: input.vault ?? null, isWritable: true },
|
|
50
|
+
rewardsReflection: {
|
|
51
|
+
value: input.rewardsReflection ?? null,
|
|
52
|
+
isWritable: true,
|
|
53
|
+
},
|
|
54
|
+
rewardsVault: { value: input.rewardsVault ?? null, isWritable: true },
|
|
55
|
+
authority: { value: input.authority ?? null, isWritable: false },
|
|
56
|
+
rewardsProgram: { value: input.rewardsProgram ?? null, isWritable: false },
|
|
57
|
+
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
58
|
+
};
|
|
59
|
+
const accounts = originalAccounts;
|
|
60
|
+
// Original args.
|
|
61
|
+
const args = { ...input };
|
|
62
|
+
// Resolve default values.
|
|
63
|
+
if (!accounts.tokenProgram.value) {
|
|
64
|
+
accounts.tokenProgram.value =
|
|
65
|
+
'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
|
|
66
|
+
}
|
|
67
|
+
const getAccountMeta = (0, shared_1.getAccountMetaFactory)(programAddress, 'programId');
|
|
68
|
+
const instruction = {
|
|
69
|
+
accounts: [
|
|
70
|
+
getAccountMeta(accounts.job),
|
|
71
|
+
getAccountMeta(accounts.market),
|
|
72
|
+
getAccountMeta(accounts.user),
|
|
73
|
+
getAccountMeta(accounts.vault),
|
|
74
|
+
getAccountMeta(accounts.rewardsReflection),
|
|
75
|
+
getAccountMeta(accounts.rewardsVault),
|
|
76
|
+
getAccountMeta(accounts.authority),
|
|
77
|
+
getAccountMeta(accounts.rewardsProgram),
|
|
78
|
+
getAccountMeta(accounts.tokenProgram),
|
|
79
|
+
],
|
|
80
|
+
programAddress,
|
|
81
|
+
data: getExtendInstructionDataEncoder().encode(args),
|
|
82
|
+
};
|
|
83
|
+
return instruction;
|
|
84
|
+
}
|
|
85
|
+
function parseExtendInstruction(instruction) {
|
|
86
|
+
if (instruction.accounts.length < 9) {
|
|
87
|
+
// TODO: Coded error.
|
|
88
|
+
throw new Error('Not enough accounts');
|
|
89
|
+
}
|
|
90
|
+
let accountIndex = 0;
|
|
91
|
+
const getNextAccount = () => {
|
|
92
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
93
|
+
accountIndex += 1;
|
|
94
|
+
return accountMeta;
|
|
95
|
+
};
|
|
96
|
+
return {
|
|
97
|
+
programAddress: instruction.programAddress,
|
|
98
|
+
accounts: {
|
|
99
|
+
job: getNextAccount(),
|
|
100
|
+
market: getNextAccount(),
|
|
101
|
+
user: getNextAccount(),
|
|
102
|
+
vault: getNextAccount(),
|
|
103
|
+
rewardsReflection: getNextAccount(),
|
|
104
|
+
rewardsVault: getNextAccount(),
|
|
105
|
+
authority: getNextAccount(),
|
|
106
|
+
rewardsProgram: getNextAccount(),
|
|
107
|
+
tokenProgram: getNextAccount(),
|
|
108
|
+
},
|
|
109
|
+
data: getExtendInstructionDataDecoder().decode(instruction.data),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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 Address, type Codec, type Decoder, type Encoder, type IAccountMeta, type IAccountSignerMeta, type IInstruction, type IInstructionWithAccounts, type IInstructionWithData, type ReadonlyAccount, type ReadonlySignerAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount } from '@solana/kit';
|
|
9
|
+
import { NOSANA_JOBS_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
+
export declare const FINISH_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
11
|
+
export declare function getFinishDiscriminatorBytes(): ReadonlyUint8Array;
|
|
12
|
+
export type FinishInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGRAM_ADDRESS, TAccountJob extends string | IAccountMeta<string> = string, TAccountRun extends string | IAccountMeta<string> = string, TAccountMarket extends string | IAccountMeta<string> = string, TAccountVault extends string | IAccountMeta<string> = string, TAccountDeposit extends string | IAccountMeta<string> = string, TAccountUser extends string | IAccountMeta<string> = string, TAccountPayer extends string | IAccountMeta<string> = string, TAccountProject extends string | IAccountMeta<string> = string, TAccountAuthority extends string | IAccountMeta<string> = string, TAccountTokenProgram extends string | IAccountMeta<string> = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', TRemainingAccounts extends readonly IAccountMeta<string>[] = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<[
|
|
13
|
+
TAccountJob extends string ? WritableAccount<TAccountJob> : TAccountJob,
|
|
14
|
+
TAccountRun extends string ? WritableAccount<TAccountRun> : TAccountRun,
|
|
15
|
+
TAccountMarket extends string ? ReadonlyAccount<TAccountMarket> : TAccountMarket,
|
|
16
|
+
TAccountVault extends string ? WritableAccount<TAccountVault> : TAccountVault,
|
|
17
|
+
TAccountDeposit extends string ? WritableAccount<TAccountDeposit> : TAccountDeposit,
|
|
18
|
+
TAccountUser extends string ? WritableAccount<TAccountUser> : TAccountUser,
|
|
19
|
+
TAccountPayer extends string ? WritableAccount<TAccountPayer> : TAccountPayer,
|
|
20
|
+
TAccountProject extends string ? WritableAccount<TAccountProject> : TAccountProject,
|
|
21
|
+
TAccountAuthority extends string ? ReadonlySignerAccount<TAccountAuthority> & IAccountSignerMeta<TAccountAuthority> : TAccountAuthority,
|
|
22
|
+
TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
|
|
23
|
+
...TRemainingAccounts
|
|
24
|
+
]>;
|
|
25
|
+
export type FinishInstructionData = {
|
|
26
|
+
discriminator: ReadonlyUint8Array;
|
|
27
|
+
ipfsResult: ReadonlyUint8Array;
|
|
28
|
+
};
|
|
29
|
+
export type FinishInstructionDataArgs = {
|
|
30
|
+
ipfsResult: ReadonlyUint8Array;
|
|
31
|
+
};
|
|
32
|
+
export declare function getFinishInstructionDataEncoder(): Encoder<FinishInstructionDataArgs>;
|
|
33
|
+
export declare function getFinishInstructionDataDecoder(): Decoder<FinishInstructionData>;
|
|
34
|
+
export declare function getFinishInstructionDataCodec(): Codec<FinishInstructionDataArgs, FinishInstructionData>;
|
|
35
|
+
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, TAccountPayer extends string = string, TAccountProject extends string = string, TAccountAuthority extends string = string, TAccountTokenProgram extends string = string> = {
|
|
36
|
+
job: Address<TAccountJob>;
|
|
37
|
+
run: Address<TAccountRun>;
|
|
38
|
+
market: Address<TAccountMarket>;
|
|
39
|
+
vault: Address<TAccountVault>;
|
|
40
|
+
deposit: Address<TAccountDeposit>;
|
|
41
|
+
user: Address<TAccountUser>;
|
|
42
|
+
payer: Address<TAccountPayer>;
|
|
43
|
+
project: Address<TAccountProject>;
|
|
44
|
+
authority: TransactionSigner<TAccountAuthority>;
|
|
45
|
+
tokenProgram?: Address<TAccountTokenProgram>;
|
|
46
|
+
ipfsResult: FinishInstructionDataArgs['ipfsResult'];
|
|
47
|
+
};
|
|
48
|
+
export declare function getFinishInstruction<TAccountJob extends string, TAccountRun extends string, TAccountMarket extends string, TAccountVault extends string, TAccountDeposit extends string, TAccountUser extends string, TAccountPayer extends string, TAccountProject extends string, TAccountAuthority extends string, TAccountTokenProgram extends string, TProgramAddress extends Address = typeof NOSANA_JOBS_PROGRAM_ADDRESS>(input: FinishInput<TAccountJob, TAccountRun, TAccountMarket, TAccountVault, TAccountDeposit, TAccountUser, TAccountPayer, TAccountProject, TAccountAuthority, TAccountTokenProgram>, config?: {
|
|
49
|
+
programAddress?: TProgramAddress;
|
|
50
|
+
}): FinishInstruction<TProgramAddress, TAccountJob, TAccountRun, TAccountMarket, TAccountVault, TAccountDeposit, TAccountUser, TAccountPayer, TAccountProject, TAccountAuthority, TAccountTokenProgram>;
|
|
51
|
+
export type ParsedFinishInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGRAM_ADDRESS, TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[]> = {
|
|
52
|
+
programAddress: Address<TProgram>;
|
|
53
|
+
accounts: {
|
|
54
|
+
job: TAccountMetas[0];
|
|
55
|
+
run: TAccountMetas[1];
|
|
56
|
+
market: TAccountMetas[2];
|
|
57
|
+
vault: TAccountMetas[3];
|
|
58
|
+
deposit: TAccountMetas[4];
|
|
59
|
+
user: TAccountMetas[5];
|
|
60
|
+
payer: TAccountMetas[6];
|
|
61
|
+
project: TAccountMetas[7];
|
|
62
|
+
authority: TAccountMetas[8];
|
|
63
|
+
tokenProgram: TAccountMetas[9];
|
|
64
|
+
};
|
|
65
|
+
data: FinishInstructionData;
|
|
66
|
+
};
|
|
67
|
+
export declare function parseFinishInstruction<TProgram extends string, TAccountMetas extends readonly IAccountMeta[]>(instruction: IInstruction<TProgram> & IInstructionWithAccounts<TAccountMetas> & IInstructionWithData<Uint8Array>): ParsedFinishInstruction<TProgram, TAccountMetas>;
|