@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,57 @@
|
|
|
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, type WritableSignerAccount } from '@solana/kit';
|
|
9
|
+
import { NOSANA_JOBS_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
+
export declare const WORK_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
11
|
+
export declare function getWorkDiscriminatorBytes(): ReadonlyUint8Array;
|
|
12
|
+
export type WorkInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGRAM_ADDRESS, TAccountRun extends string | IAccountMeta<string> = string, TAccountMarket extends string | IAccountMeta<string> = string, TAccountPayer extends string | IAccountMeta<string> = string, TAccountStake extends string | IAccountMeta<string> = string, TAccountNft extends string | IAccountMeta<string> = string, TAccountMetadata extends string | IAccountMeta<string> = string, TAccountAuthority extends string | IAccountMeta<string> = string, TAccountSystemProgram extends string | IAccountMeta<string> = '11111111111111111111111111111111', TRemainingAccounts extends readonly IAccountMeta<string>[] = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<[
|
|
13
|
+
TAccountRun extends string ? WritableSignerAccount<TAccountRun> & IAccountSignerMeta<TAccountRun> : TAccountRun,
|
|
14
|
+
TAccountMarket extends string ? WritableAccount<TAccountMarket> : TAccountMarket,
|
|
15
|
+
TAccountPayer extends string ? WritableSignerAccount<TAccountPayer> & IAccountSignerMeta<TAccountPayer> : TAccountPayer,
|
|
16
|
+
TAccountStake extends string ? ReadonlyAccount<TAccountStake> : TAccountStake,
|
|
17
|
+
TAccountNft extends string ? ReadonlyAccount<TAccountNft> : TAccountNft,
|
|
18
|
+
TAccountMetadata extends string ? ReadonlyAccount<TAccountMetadata> : TAccountMetadata,
|
|
19
|
+
TAccountAuthority extends string ? ReadonlySignerAccount<TAccountAuthority> & IAccountSignerMeta<TAccountAuthority> : TAccountAuthority,
|
|
20
|
+
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
21
|
+
...TRemainingAccounts
|
|
22
|
+
]>;
|
|
23
|
+
export type WorkInstructionData = {
|
|
24
|
+
discriminator: ReadonlyUint8Array;
|
|
25
|
+
};
|
|
26
|
+
export type WorkInstructionDataArgs = {};
|
|
27
|
+
export declare function getWorkInstructionDataEncoder(): Encoder<WorkInstructionDataArgs>;
|
|
28
|
+
export declare function getWorkInstructionDataDecoder(): Decoder<WorkInstructionData>;
|
|
29
|
+
export declare function getWorkInstructionDataCodec(): Codec<WorkInstructionDataArgs, WorkInstructionData>;
|
|
30
|
+
export type WorkInput<TAccountRun extends string = string, TAccountMarket extends string = string, TAccountPayer extends string = string, TAccountStake extends string = string, TAccountNft extends string = string, TAccountMetadata extends string = string, TAccountAuthority extends string = string, TAccountSystemProgram extends string = string> = {
|
|
31
|
+
run: TransactionSigner<TAccountRun>;
|
|
32
|
+
market: Address<TAccountMarket>;
|
|
33
|
+
payer: TransactionSigner<TAccountPayer>;
|
|
34
|
+
stake: Address<TAccountStake>;
|
|
35
|
+
nft: Address<TAccountNft>;
|
|
36
|
+
metadata: Address<TAccountMetadata>;
|
|
37
|
+
authority: TransactionSigner<TAccountAuthority>;
|
|
38
|
+
systemProgram?: Address<TAccountSystemProgram>;
|
|
39
|
+
};
|
|
40
|
+
export declare function getWorkInstruction<TAccountRun extends string, TAccountMarket extends string, TAccountPayer extends string, TAccountStake extends string, TAccountNft extends string, TAccountMetadata extends string, TAccountAuthority extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof NOSANA_JOBS_PROGRAM_ADDRESS>(input: WorkInput<TAccountRun, TAccountMarket, TAccountPayer, TAccountStake, TAccountNft, TAccountMetadata, TAccountAuthority, TAccountSystemProgram>, config?: {
|
|
41
|
+
programAddress?: TProgramAddress;
|
|
42
|
+
}): WorkInstruction<TProgramAddress, TAccountRun, TAccountMarket, TAccountPayer, TAccountStake, TAccountNft, TAccountMetadata, TAccountAuthority, TAccountSystemProgram>;
|
|
43
|
+
export type ParsedWorkInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGRAM_ADDRESS, TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[]> = {
|
|
44
|
+
programAddress: Address<TProgram>;
|
|
45
|
+
accounts: {
|
|
46
|
+
run: TAccountMetas[0];
|
|
47
|
+
market: TAccountMetas[1];
|
|
48
|
+
payer: TAccountMetas[2];
|
|
49
|
+
stake: TAccountMetas[3];
|
|
50
|
+
nft: TAccountMetas[4];
|
|
51
|
+
metadata: TAccountMetas[5];
|
|
52
|
+
authority: TAccountMetas[6];
|
|
53
|
+
systemProgram: TAccountMetas[7];
|
|
54
|
+
};
|
|
55
|
+
data: WorkInstructionData;
|
|
56
|
+
};
|
|
57
|
+
export declare function parseWorkInstruction<TProgram extends string, TAccountMetas extends readonly IAccountMeta[]>(instruction: IInstruction<TProgram> & IInstructionWithAccounts<TAccountMetas> & IInstructionWithData<Uint8Array>): ParsedWorkInstruction<TProgram, TAccountMetas>;
|
|
@@ -0,0 +1,99 @@
|
|
|
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.WORK_DISCRIMINATOR = void 0;
|
|
11
|
+
exports.getWorkDiscriminatorBytes = getWorkDiscriminatorBytes;
|
|
12
|
+
exports.getWorkInstructionDataEncoder = getWorkInstructionDataEncoder;
|
|
13
|
+
exports.getWorkInstructionDataDecoder = getWorkInstructionDataDecoder;
|
|
14
|
+
exports.getWorkInstructionDataCodec = getWorkInstructionDataCodec;
|
|
15
|
+
exports.getWorkInstruction = getWorkInstruction;
|
|
16
|
+
exports.parseWorkInstruction = parseWorkInstruction;
|
|
17
|
+
const kit_1 = require("@solana/kit");
|
|
18
|
+
const programs_1 = require("../programs");
|
|
19
|
+
const shared_1 = require("../shared");
|
|
20
|
+
exports.WORK_DISCRIMINATOR = new Uint8Array([
|
|
21
|
+
15, 67, 45, 195, 215, 137, 229, 47,
|
|
22
|
+
]);
|
|
23
|
+
function getWorkDiscriminatorBytes() {
|
|
24
|
+
return (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(exports.WORK_DISCRIMINATOR);
|
|
25
|
+
}
|
|
26
|
+
function getWorkInstructionDataEncoder() {
|
|
27
|
+
return (0, kit_1.transformEncoder)((0, kit_1.getStructEncoder)([['discriminator', (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8)]]), (value) => ({ ...value, discriminator: exports.WORK_DISCRIMINATOR }));
|
|
28
|
+
}
|
|
29
|
+
function getWorkInstructionDataDecoder() {
|
|
30
|
+
return (0, kit_1.getStructDecoder)([
|
|
31
|
+
['discriminator', (0, kit_1.fixDecoderSize)((0, kit_1.getBytesDecoder)(), 8)],
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
function getWorkInstructionDataCodec() {
|
|
35
|
+
return (0, kit_1.combineCodec)(getWorkInstructionDataEncoder(), getWorkInstructionDataDecoder());
|
|
36
|
+
}
|
|
37
|
+
function getWorkInstruction(input, config) {
|
|
38
|
+
// Program address.
|
|
39
|
+
const programAddress = config?.programAddress ?? programs_1.NOSANA_JOBS_PROGRAM_ADDRESS;
|
|
40
|
+
// Original accounts.
|
|
41
|
+
const originalAccounts = {
|
|
42
|
+
run: { value: input.run ?? null, isWritable: true },
|
|
43
|
+
market: { value: input.market ?? null, isWritable: true },
|
|
44
|
+
payer: { value: input.payer ?? null, isWritable: true },
|
|
45
|
+
stake: { value: input.stake ?? null, isWritable: false },
|
|
46
|
+
nft: { value: input.nft ?? null, isWritable: false },
|
|
47
|
+
metadata: { value: input.metadata ?? null, isWritable: false },
|
|
48
|
+
authority: { value: input.authority ?? null, isWritable: false },
|
|
49
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
50
|
+
};
|
|
51
|
+
const accounts = originalAccounts;
|
|
52
|
+
// Resolve default values.
|
|
53
|
+
if (!accounts.systemProgram.value) {
|
|
54
|
+
accounts.systemProgram.value =
|
|
55
|
+
'11111111111111111111111111111111';
|
|
56
|
+
}
|
|
57
|
+
const getAccountMeta = (0, shared_1.getAccountMetaFactory)(programAddress, 'programId');
|
|
58
|
+
const instruction = {
|
|
59
|
+
accounts: [
|
|
60
|
+
getAccountMeta(accounts.run),
|
|
61
|
+
getAccountMeta(accounts.market),
|
|
62
|
+
getAccountMeta(accounts.payer),
|
|
63
|
+
getAccountMeta(accounts.stake),
|
|
64
|
+
getAccountMeta(accounts.nft),
|
|
65
|
+
getAccountMeta(accounts.metadata),
|
|
66
|
+
getAccountMeta(accounts.authority),
|
|
67
|
+
getAccountMeta(accounts.systemProgram),
|
|
68
|
+
],
|
|
69
|
+
programAddress,
|
|
70
|
+
data: getWorkInstructionDataEncoder().encode({}),
|
|
71
|
+
};
|
|
72
|
+
return instruction;
|
|
73
|
+
}
|
|
74
|
+
function parseWorkInstruction(instruction) {
|
|
75
|
+
if (instruction.accounts.length < 8) {
|
|
76
|
+
// TODO: Coded error.
|
|
77
|
+
throw new Error('Not enough accounts');
|
|
78
|
+
}
|
|
79
|
+
let accountIndex = 0;
|
|
80
|
+
const getNextAccount = () => {
|
|
81
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
82
|
+
accountIndex += 1;
|
|
83
|
+
return accountMeta;
|
|
84
|
+
};
|
|
85
|
+
return {
|
|
86
|
+
programAddress: instruction.programAddress,
|
|
87
|
+
accounts: {
|
|
88
|
+
run: getNextAccount(),
|
|
89
|
+
market: getNextAccount(),
|
|
90
|
+
payer: getNextAccount(),
|
|
91
|
+
stake: getNextAccount(),
|
|
92
|
+
nft: getNextAccount(),
|
|
93
|
+
metadata: getNextAccount(),
|
|
94
|
+
authority: getNextAccount(),
|
|
95
|
+
systemProgram: getNextAccount(),
|
|
96
|
+
},
|
|
97
|
+
data: getWorkInstructionDataDecoder().decode(instruction.data),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
21
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
__exportStar(require("./nosanaJobs"), exports);
|
|
@@ -0,0 +1,78 @@
|
|
|
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 ReadonlyUint8Array } from '@solana/kit';
|
|
9
|
+
import { type ParsedClaimInstruction, type ParsedCleanAdminInstruction, type ParsedCleanInstruction, type ParsedCloseAdminInstruction, type ParsedCloseInstruction, type ParsedCompleteInstruction, type ParsedDelistInstruction, type ParsedEndInstruction, type ParsedExtendInstruction, type ParsedFinishInstruction, type ParsedListInstruction, type ParsedOpenInstruction, type ParsedQuitAdminInstruction, type ParsedQuitInstruction, type ParsedRecoverInstruction, type ParsedStopInstruction, type ParsedUpdateInstruction, type ParsedWorkInstruction } from '../instructions';
|
|
10
|
+
export declare const NOSANA_JOBS_PROGRAM_ADDRESS: Address<"nosJTmGQxvwXy23vng5UjkTbfv91Bzf9jEuro78dAGR">;
|
|
11
|
+
export declare enum NosanaJobsAccount {
|
|
12
|
+
MarketAccount = 0,
|
|
13
|
+
JobAccount = 1,
|
|
14
|
+
RunAccount = 2
|
|
15
|
+
}
|
|
16
|
+
export declare function identifyNosanaJobsAccount(account: {
|
|
17
|
+
data: ReadonlyUint8Array;
|
|
18
|
+
} | ReadonlyUint8Array): NosanaJobsAccount;
|
|
19
|
+
export declare enum NosanaJobsInstruction {
|
|
20
|
+
Open = 0,
|
|
21
|
+
Update = 1,
|
|
22
|
+
Close = 2,
|
|
23
|
+
CloseAdmin = 3,
|
|
24
|
+
List = 4,
|
|
25
|
+
Delist = 5,
|
|
26
|
+
Recover = 6,
|
|
27
|
+
Extend = 7,
|
|
28
|
+
End = 8,
|
|
29
|
+
Work = 9,
|
|
30
|
+
Stop = 10,
|
|
31
|
+
Claim = 11,
|
|
32
|
+
Complete = 12,
|
|
33
|
+
Finish = 13,
|
|
34
|
+
Quit = 14,
|
|
35
|
+
QuitAdmin = 15,
|
|
36
|
+
Clean = 16,
|
|
37
|
+
CleanAdmin = 17
|
|
38
|
+
}
|
|
39
|
+
export declare function identifyNosanaJobsInstruction(instruction: {
|
|
40
|
+
data: ReadonlyUint8Array;
|
|
41
|
+
} | ReadonlyUint8Array): NosanaJobsInstruction;
|
|
42
|
+
export type ParsedNosanaJobsInstruction<TProgram extends string = 'nosJTmGQxvwXy23vng5UjkTbfv91Bzf9jEuro78dAGR'> = ({
|
|
43
|
+
instructionType: NosanaJobsInstruction.Open;
|
|
44
|
+
} & ParsedOpenInstruction<TProgram>) | ({
|
|
45
|
+
instructionType: NosanaJobsInstruction.Update;
|
|
46
|
+
} & ParsedUpdateInstruction<TProgram>) | ({
|
|
47
|
+
instructionType: NosanaJobsInstruction.Close;
|
|
48
|
+
} & ParsedCloseInstruction<TProgram>) | ({
|
|
49
|
+
instructionType: NosanaJobsInstruction.CloseAdmin;
|
|
50
|
+
} & ParsedCloseAdminInstruction<TProgram>) | ({
|
|
51
|
+
instructionType: NosanaJobsInstruction.List;
|
|
52
|
+
} & ParsedListInstruction<TProgram>) | ({
|
|
53
|
+
instructionType: NosanaJobsInstruction.Delist;
|
|
54
|
+
} & ParsedDelistInstruction<TProgram>) | ({
|
|
55
|
+
instructionType: NosanaJobsInstruction.Recover;
|
|
56
|
+
} & ParsedRecoverInstruction<TProgram>) | ({
|
|
57
|
+
instructionType: NosanaJobsInstruction.Extend;
|
|
58
|
+
} & ParsedExtendInstruction<TProgram>) | ({
|
|
59
|
+
instructionType: NosanaJobsInstruction.End;
|
|
60
|
+
} & ParsedEndInstruction<TProgram>) | ({
|
|
61
|
+
instructionType: NosanaJobsInstruction.Work;
|
|
62
|
+
} & ParsedWorkInstruction<TProgram>) | ({
|
|
63
|
+
instructionType: NosanaJobsInstruction.Stop;
|
|
64
|
+
} & ParsedStopInstruction<TProgram>) | ({
|
|
65
|
+
instructionType: NosanaJobsInstruction.Claim;
|
|
66
|
+
} & ParsedClaimInstruction<TProgram>) | ({
|
|
67
|
+
instructionType: NosanaJobsInstruction.Complete;
|
|
68
|
+
} & ParsedCompleteInstruction<TProgram>) | ({
|
|
69
|
+
instructionType: NosanaJobsInstruction.Finish;
|
|
70
|
+
} & ParsedFinishInstruction<TProgram>) | ({
|
|
71
|
+
instructionType: NosanaJobsInstruction.Quit;
|
|
72
|
+
} & ParsedQuitInstruction<TProgram>) | ({
|
|
73
|
+
instructionType: NosanaJobsInstruction.QuitAdmin;
|
|
74
|
+
} & ParsedQuitAdminInstruction<TProgram>) | ({
|
|
75
|
+
instructionType: NosanaJobsInstruction.Clean;
|
|
76
|
+
} & ParsedCleanInstruction<TProgram>) | ({
|
|
77
|
+
instructionType: NosanaJobsInstruction.CleanAdmin;
|
|
78
|
+
} & ParsedCleanAdminInstruction<TProgram>);
|
|
@@ -0,0 +1,112 @@
|
|
|
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.NosanaJobsInstruction = exports.NosanaJobsAccount = exports.NOSANA_JOBS_PROGRAM_ADDRESS = void 0;
|
|
11
|
+
exports.identifyNosanaJobsAccount = identifyNosanaJobsAccount;
|
|
12
|
+
exports.identifyNosanaJobsInstruction = identifyNosanaJobsInstruction;
|
|
13
|
+
const kit_1 = require("@solana/kit");
|
|
14
|
+
exports.NOSANA_JOBS_PROGRAM_ADDRESS = 'nosJTmGQxvwXy23vng5UjkTbfv91Bzf9jEuro78dAGR';
|
|
15
|
+
var NosanaJobsAccount;
|
|
16
|
+
(function (NosanaJobsAccount) {
|
|
17
|
+
NosanaJobsAccount[NosanaJobsAccount["MarketAccount"] = 0] = "MarketAccount";
|
|
18
|
+
NosanaJobsAccount[NosanaJobsAccount["JobAccount"] = 1] = "JobAccount";
|
|
19
|
+
NosanaJobsAccount[NosanaJobsAccount["RunAccount"] = 2] = "RunAccount";
|
|
20
|
+
})(NosanaJobsAccount || (exports.NosanaJobsAccount = NosanaJobsAccount = {}));
|
|
21
|
+
function identifyNosanaJobsAccount(account) {
|
|
22
|
+
const data = 'data' in account ? account.data : account;
|
|
23
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([201, 78, 187, 225, 240, 198, 201, 251])), 0)) {
|
|
24
|
+
return NosanaJobsAccount.MarketAccount;
|
|
25
|
+
}
|
|
26
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([91, 16, 162, 5, 45, 210, 125, 65])), 0)) {
|
|
27
|
+
return NosanaJobsAccount.JobAccount;
|
|
28
|
+
}
|
|
29
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([194, 169, 110, 230, 235, 11, 225, 22])), 0)) {
|
|
30
|
+
return NosanaJobsAccount.RunAccount;
|
|
31
|
+
}
|
|
32
|
+
throw new Error('The provided account could not be identified as a nosanaJobs account.');
|
|
33
|
+
}
|
|
34
|
+
var NosanaJobsInstruction;
|
|
35
|
+
(function (NosanaJobsInstruction) {
|
|
36
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Open"] = 0] = "Open";
|
|
37
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Update"] = 1] = "Update";
|
|
38
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Close"] = 2] = "Close";
|
|
39
|
+
NosanaJobsInstruction[NosanaJobsInstruction["CloseAdmin"] = 3] = "CloseAdmin";
|
|
40
|
+
NosanaJobsInstruction[NosanaJobsInstruction["List"] = 4] = "List";
|
|
41
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Delist"] = 5] = "Delist";
|
|
42
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Recover"] = 6] = "Recover";
|
|
43
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Extend"] = 7] = "Extend";
|
|
44
|
+
NosanaJobsInstruction[NosanaJobsInstruction["End"] = 8] = "End";
|
|
45
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Work"] = 9] = "Work";
|
|
46
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Stop"] = 10] = "Stop";
|
|
47
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Claim"] = 11] = "Claim";
|
|
48
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Complete"] = 12] = "Complete";
|
|
49
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Finish"] = 13] = "Finish";
|
|
50
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Quit"] = 14] = "Quit";
|
|
51
|
+
NosanaJobsInstruction[NosanaJobsInstruction["QuitAdmin"] = 15] = "QuitAdmin";
|
|
52
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Clean"] = 16] = "Clean";
|
|
53
|
+
NosanaJobsInstruction[NosanaJobsInstruction["CleanAdmin"] = 17] = "CleanAdmin";
|
|
54
|
+
})(NosanaJobsInstruction || (exports.NosanaJobsInstruction = NosanaJobsInstruction = {}));
|
|
55
|
+
function identifyNosanaJobsInstruction(instruction) {
|
|
56
|
+
const data = 'data' in instruction ? instruction.data : instruction;
|
|
57
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([228, 220, 155, 71, 199, 189, 60, 45])), 0)) {
|
|
58
|
+
return NosanaJobsInstruction.Open;
|
|
59
|
+
}
|
|
60
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([219, 200, 88, 176, 158, 63, 253, 127])), 0)) {
|
|
61
|
+
return NosanaJobsInstruction.Update;
|
|
62
|
+
}
|
|
63
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([98, 165, 201, 177, 108, 65, 206, 96])), 0)) {
|
|
64
|
+
return NosanaJobsInstruction.Close;
|
|
65
|
+
}
|
|
66
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([202, 182, 185, 142, 208, 161, 145, 189])), 0)) {
|
|
67
|
+
return NosanaJobsInstruction.CloseAdmin;
|
|
68
|
+
}
|
|
69
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([54, 174, 193, 67, 17, 41, 132, 38])), 0)) {
|
|
70
|
+
return NosanaJobsInstruction.List;
|
|
71
|
+
}
|
|
72
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([55, 136, 205, 107, 107, 173, 4, 31])), 0)) {
|
|
73
|
+
return NosanaJobsInstruction.Delist;
|
|
74
|
+
}
|
|
75
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([108, 216, 38, 58, 109, 146, 116, 17])), 0)) {
|
|
76
|
+
return NosanaJobsInstruction.Recover;
|
|
77
|
+
}
|
|
78
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([228, 127, 0, 1, 227, 154, 54, 168])), 0)) {
|
|
79
|
+
return NosanaJobsInstruction.Extend;
|
|
80
|
+
}
|
|
81
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([180, 160, 249, 217, 194, 121, 70, 16])), 0)) {
|
|
82
|
+
return NosanaJobsInstruction.End;
|
|
83
|
+
}
|
|
84
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([15, 67, 45, 195, 215, 137, 229, 47])), 0)) {
|
|
85
|
+
return NosanaJobsInstruction.Work;
|
|
86
|
+
}
|
|
87
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([42, 133, 32, 60, 171, 253, 184, 155])), 0)) {
|
|
88
|
+
return NosanaJobsInstruction.Stop;
|
|
89
|
+
}
|
|
90
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([62, 198, 214, 193, 213, 159, 108, 210])), 0)) {
|
|
91
|
+
return NosanaJobsInstruction.Claim;
|
|
92
|
+
}
|
|
93
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([0, 77, 224, 147, 136, 25, 88, 76])), 0)) {
|
|
94
|
+
return NosanaJobsInstruction.Complete;
|
|
95
|
+
}
|
|
96
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([67, 74, 170, 132, 125, 233, 182, 37])), 0)) {
|
|
97
|
+
return NosanaJobsInstruction.Finish;
|
|
98
|
+
}
|
|
99
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([191, 103, 141, 240, 80, 129, 103, 153])), 0)) {
|
|
100
|
+
return NosanaJobsInstruction.Quit;
|
|
101
|
+
}
|
|
102
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([103, 238, 110, 8, 182, 20, 56, 196])), 0)) {
|
|
103
|
+
return NosanaJobsInstruction.QuitAdmin;
|
|
104
|
+
}
|
|
105
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([250, 191, 56, 128, 150, 251, 1, 103])), 0)) {
|
|
106
|
+
return NosanaJobsInstruction.Clean;
|
|
107
|
+
}
|
|
108
|
+
if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([245, 90, 188, 68, 253, 235, 171, 105])), 0)) {
|
|
109
|
+
return NosanaJobsInstruction.CleanAdmin;
|
|
110
|
+
}
|
|
111
|
+
throw new Error('The provided instruction could not be identified as a nosanaJobs instruction.');
|
|
112
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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 IAccountMeta, type IAccountSignerMeta, type ProgramDerivedAddress, type TransactionSigner } from '@solana/kit';
|
|
9
|
+
/**
|
|
10
|
+
* Asserts that the given value is not null or undefined.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function expectSome<T>(value: T | null | undefined): T;
|
|
14
|
+
/**
|
|
15
|
+
* Asserts that the given value is a PublicKey.
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare function expectAddress<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): Address<T>;
|
|
19
|
+
/**
|
|
20
|
+
* Asserts that the given value is a PDA.
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export declare function expectProgramDerivedAddress<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): ProgramDerivedAddress<T>;
|
|
24
|
+
/**
|
|
25
|
+
* Asserts that the given value is a TransactionSigner.
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export declare function expectTransactionSigner<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): TransactionSigner<T>;
|
|
29
|
+
/**
|
|
30
|
+
* Defines an instruction account to resolve.
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export type ResolvedAccount<T extends string = string, U extends Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null = Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null> = {
|
|
34
|
+
isWritable: boolean;
|
|
35
|
+
value: U;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Defines an instruction that stores additional bytes on-chain.
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export type IInstructionWithByteDelta = {
|
|
42
|
+
byteDelta: number;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Get account metas and signers from resolved accounts.
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
export declare function getAccountMetaFactory(programAddress: Address, optionalAccountStrategy: 'omitted' | 'programId'): (account: ResolvedAccount) => IAccountMeta | IAccountSignerMeta | undefined;
|
|
49
|
+
export declare function isTransactionSigner<TAddress extends string = string>(value: Address<TAddress> | ProgramDerivedAddress<TAddress> | TransactionSigner<TAddress>): value is TransactionSigner<TAddress>;
|
|
@@ -0,0 +1,94 @@
|
|
|
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.expectSome = expectSome;
|
|
11
|
+
exports.expectAddress = expectAddress;
|
|
12
|
+
exports.expectProgramDerivedAddress = expectProgramDerivedAddress;
|
|
13
|
+
exports.expectTransactionSigner = expectTransactionSigner;
|
|
14
|
+
exports.getAccountMetaFactory = getAccountMetaFactory;
|
|
15
|
+
exports.isTransactionSigner = isTransactionSigner;
|
|
16
|
+
const kit_1 = require("@solana/kit");
|
|
17
|
+
/**
|
|
18
|
+
* Asserts that the given value is not null or undefined.
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
function expectSome(value) {
|
|
22
|
+
if (value == null) {
|
|
23
|
+
throw new Error('Expected a value but received null or undefined.');
|
|
24
|
+
}
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Asserts that the given value is a PublicKey.
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
function expectAddress(value) {
|
|
32
|
+
if (!value) {
|
|
33
|
+
throw new Error('Expected a Address.');
|
|
34
|
+
}
|
|
35
|
+
if (typeof value === 'object' && 'address' in value) {
|
|
36
|
+
return value.address;
|
|
37
|
+
}
|
|
38
|
+
if (Array.isArray(value)) {
|
|
39
|
+
return value[0];
|
|
40
|
+
}
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Asserts that the given value is a PDA.
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
function expectProgramDerivedAddress(value) {
|
|
48
|
+
if (!value || !Array.isArray(value) || !(0, kit_1.isProgramDerivedAddress)(value)) {
|
|
49
|
+
throw new Error('Expected a ProgramDerivedAddress.');
|
|
50
|
+
}
|
|
51
|
+
return value;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Asserts that the given value is a TransactionSigner.
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
function expectTransactionSigner(value) {
|
|
58
|
+
if (!value || !isTransactionSigner(value)) {
|
|
59
|
+
throw new Error('Expected a TransactionSigner.');
|
|
60
|
+
}
|
|
61
|
+
return value;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get account metas and signers from resolved accounts.
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
function getAccountMetaFactory(programAddress, optionalAccountStrategy) {
|
|
68
|
+
return (account) => {
|
|
69
|
+
if (!account.value) {
|
|
70
|
+
if (optionalAccountStrategy === 'omitted')
|
|
71
|
+
return;
|
|
72
|
+
return Object.freeze({
|
|
73
|
+
address: programAddress,
|
|
74
|
+
role: kit_1.AccountRole.READONLY,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
const writableRole = account.isWritable
|
|
78
|
+
? kit_1.AccountRole.WRITABLE
|
|
79
|
+
: kit_1.AccountRole.READONLY;
|
|
80
|
+
return Object.freeze({
|
|
81
|
+
address: expectAddress(account.value),
|
|
82
|
+
role: isTransactionSigner(account.value)
|
|
83
|
+
? (0, kit_1.upgradeRoleToSigner)(writableRole)
|
|
84
|
+
: writableRole,
|
|
85
|
+
...(isTransactionSigner(account.value) ? { signer: account.value } : {}),
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function isTransactionSigner(value) {
|
|
90
|
+
return (!!value &&
|
|
91
|
+
typeof value === 'object' &&
|
|
92
|
+
'address' in value &&
|
|
93
|
+
(0, kit_1.isTransactionSigner)(value));
|
|
94
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
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 './jobState';
|
|
9
|
+
export * from './jobType';
|
|
10
|
+
export * from './queueType';
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
21
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
__exportStar(require("./jobState"), exports);
|
|
25
|
+
__exportStar(require("./jobType"), exports);
|
|
26
|
+
__exportStar(require("./queueType"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
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 Codec, type Decoder, type Encoder } from '@solana/kit';
|
|
9
|
+
/** The `JobState` describes the status of a job. */
|
|
10
|
+
export declare enum JobState {
|
|
11
|
+
Queued = 0,
|
|
12
|
+
Done = 1,
|
|
13
|
+
Stopped = 2
|
|
14
|
+
}
|
|
15
|
+
export type JobStateArgs = JobState;
|
|
16
|
+
export declare function getJobStateEncoder(): Encoder<JobStateArgs>;
|
|
17
|
+
export declare function getJobStateDecoder(): Decoder<JobState>;
|
|
18
|
+
export declare function getJobStateCodec(): Codec<JobStateArgs, JobState>;
|
|
@@ -0,0 +1,30 @@
|
|
|
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.JobState = void 0;
|
|
11
|
+
exports.getJobStateEncoder = getJobStateEncoder;
|
|
12
|
+
exports.getJobStateDecoder = getJobStateDecoder;
|
|
13
|
+
exports.getJobStateCodec = getJobStateCodec;
|
|
14
|
+
const kit_1 = require("@solana/kit");
|
|
15
|
+
/** The `JobState` describes the status of a job. */
|
|
16
|
+
var JobState;
|
|
17
|
+
(function (JobState) {
|
|
18
|
+
JobState[JobState["Queued"] = 0] = "Queued";
|
|
19
|
+
JobState[JobState["Done"] = 1] = "Done";
|
|
20
|
+
JobState[JobState["Stopped"] = 2] = "Stopped";
|
|
21
|
+
})(JobState || (exports.JobState = JobState = {}));
|
|
22
|
+
function getJobStateEncoder() {
|
|
23
|
+
return (0, kit_1.getEnumEncoder)(JobState);
|
|
24
|
+
}
|
|
25
|
+
function getJobStateDecoder() {
|
|
26
|
+
return (0, kit_1.getEnumDecoder)(JobState);
|
|
27
|
+
}
|
|
28
|
+
function getJobStateCodec() {
|
|
29
|
+
return (0, kit_1.combineCodec)(getJobStateEncoder(), getJobStateDecoder());
|
|
30
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 Codec, type Decoder, type Encoder } from '@solana/kit';
|
|
9
|
+
/** The `JobType` describes the type of any job. */
|
|
10
|
+
export declare enum JobType {
|
|
11
|
+
Default = 0,
|
|
12
|
+
Small = 1,
|
|
13
|
+
Medium = 2,
|
|
14
|
+
Large = 3,
|
|
15
|
+
Gpu = 4,
|
|
16
|
+
Unknown = 5
|
|
17
|
+
}
|
|
18
|
+
export type JobTypeArgs = JobType;
|
|
19
|
+
export declare function getJobTypeEncoder(): Encoder<JobTypeArgs>;
|
|
20
|
+
export declare function getJobTypeDecoder(): Decoder<JobType>;
|
|
21
|
+
export declare function getJobTypeCodec(): Codec<JobTypeArgs, JobType>;
|