@nosana/jobs-program 2.14.2 → 2.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accounts/index.d.ts +1 -0
- package/dist/accounts/index.d.ts.map +1 -1
- package/dist/accounts/index.js +1 -0
- package/dist/accounts/jobAccount.d.ts +0 -1
- package/dist/accounts/jobAccount.d.ts.map +1 -1
- package/dist/accounts/marketAccount.d.ts +0 -1
- package/dist/accounts/marketAccount.d.ts.map +1 -1
- package/dist/accounts/marketSettingsAccount.d.ts +31 -0
- package/dist/accounts/marketSettingsAccount.d.ts.map +1 -0
- package/dist/accounts/marketSettingsAccount.js +59 -0
- package/dist/accounts/runAccount.d.ts +0 -1
- package/dist/accounts/runAccount.d.ts.map +1 -1
- package/dist/errors/nosanaJobs.d.ts +27 -17
- package/dist/errors/nosanaJobs.d.ts.map +1 -1
- package/dist/errors/nosanaJobs.js +31 -16
- package/dist/instructions/assign.d.ts +43 -5
- package/dist/instructions/assign.d.ts.map +1 -1
- package/dist/instructions/assign.js +105 -3
- package/dist/instructions/cleanAdmin.d.ts +2 -2
- package/dist/instructions/cleanAdmin.d.ts.map +1 -1
- package/dist/instructions/cleanAdmin.js +5 -0
- package/dist/instructions/close.d.ts +19 -4
- package/dist/instructions/close.d.ts.map +1 -1
- package/dist/instructions/close.js +54 -3
- package/dist/instructions/closeAdmin.d.ts +20 -5
- package/dist/instructions/closeAdmin.d.ts.map +1 -1
- package/dist/instructions/closeAdmin.js +62 -3
- package/dist/instructions/closeSettings.d.ts +57 -0
- package/dist/instructions/closeSettings.d.ts.map +1 -0
- package/dist/instructions/closeSettings.js +105 -0
- package/dist/instructions/extend.d.ts +2 -2
- package/dist/instructions/extend.d.ts.map +1 -1
- package/dist/instructions/extend.js +4 -0
- package/dist/instructions/index.d.ts +2 -1
- package/dist/instructions/index.d.ts.map +1 -1
- package/dist/instructions/index.js +2 -1
- package/dist/instructions/list.d.ts +42 -5
- package/dist/instructions/list.d.ts.map +1 -1
- package/dist/instructions/list.js +103 -3
- package/dist/instructions/open.d.ts +20 -2
- package/dist/instructions/open.d.ts.map +1 -1
- package/dist/instructions/open.js +65 -2
- package/dist/instructions/quitAdmin.d.ts +2 -2
- package/dist/instructions/quitAdmin.d.ts.map +1 -1
- package/dist/instructions/quitAdmin.js +5 -0
- package/dist/instructions/setSettings.d.ts +67 -0
- package/dist/instructions/setSettings.d.ts.map +1 -0
- package/dist/instructions/setSettings.js +132 -0
- package/dist/programs/nosanaJobs.d.ts +42 -38
- package/dist/programs/nosanaJobs.d.ts.map +1 -1
- package/dist/programs/nosanaJobs.js +52 -44
- package/dist/types/index.d.ts +2 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -3
- package/dist/types/reflectionAccount.d.ts +27 -0
- package/dist/types/reflectionAccount.d.ts.map +1 -0
- package/dist/types/reflectionAccount.js +29 -0
- package/dist/types/stakeAccount.d.ts +31 -0
- package/dist/types/stakeAccount.d.ts.map +1 -0
- package/dist/types/stakeAccount.js +33 -0
- package/package.json +2 -2
- package/dist/instructions/claim.d.ts +0 -73
- package/dist/instructions/claim.d.ts.map +0 -1
- package/dist/instructions/claim.js +0 -103
- package/dist/types/jobState.d.ts +0 -20
- package/dist/types/jobState.d.ts.map +0 -1
- package/dist/types/jobState.js +0 -23
- package/dist/types/jobType.d.ts +0 -23
- package/dist/types/jobType.d.ts.map +0 -1
- package/dist/types/jobType.js +0 -26
- package/dist/types/queueType.d.ts +0 -20
- package/dist/types/queueType.d.ts.map +0 -1
- package/dist/types/queueType.js +0 -23
|
@@ -8,17 +8,21 @@
|
|
|
8
8
|
import { containsBytes, fixEncoderSize, getBytesEncoder, } from "@solana/kit";
|
|
9
9
|
export const NOSANA_JOBS_PROGRAM_ADDRESS = "nosJhNRqr2bc9g1nfGDcXXTXvYUmxD4cVwy2pMWhrYM";
|
|
10
10
|
export const NosanaJobsAccount = {
|
|
11
|
-
MarketAccount: "MarketAccount",
|
|
12
11
|
JobAccount: "JobAccount",
|
|
12
|
+
MarketAccount: "MarketAccount",
|
|
13
|
+
MarketSettingsAccount: "MarketSettingsAccount",
|
|
13
14
|
RunAccount: "RunAccount",
|
|
14
15
|
};
|
|
15
16
|
export function identifyNosanaJobsAccount(account) {
|
|
16
17
|
const data = "data" in account ? account.data : account;
|
|
18
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([91, 16, 162, 5, 45, 210, 125, 65])), 0)) {
|
|
19
|
+
return NosanaJobsAccount.JobAccount;
|
|
20
|
+
}
|
|
17
21
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([201, 78, 187, 225, 240, 198, 201, 251])), 0)) {
|
|
18
22
|
return NosanaJobsAccount.MarketAccount;
|
|
19
23
|
}
|
|
20
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
21
|
-
return NosanaJobsAccount.
|
|
24
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([93, 239, 237, 124, 189, 185, 255, 195])), 0)) {
|
|
25
|
+
return NosanaJobsAccount.MarketSettingsAccount;
|
|
22
26
|
}
|
|
23
27
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([194, 169, 110, 230, 235, 11, 225, 22])), 0)) {
|
|
24
28
|
return NosanaJobsAccount.RunAccount;
|
|
@@ -26,33 +30,37 @@ export function identifyNosanaJobsAccount(account) {
|
|
|
26
30
|
throw new Error("The provided account could not be identified as a nosanaJobs account.");
|
|
27
31
|
}
|
|
28
32
|
export const NosanaJobsInstruction = {
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
Assign: "Assign",
|
|
34
|
+
Clean: "Clean",
|
|
35
|
+
CleanAdmin: "CleanAdmin",
|
|
31
36
|
Close: "Close",
|
|
32
37
|
CloseAdmin: "CloseAdmin",
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
CloseSettings: "CloseSettings",
|
|
39
|
+
Complete: "Complete",
|
|
35
40
|
Delist: "Delist",
|
|
36
|
-
Recover: "Recover",
|
|
37
|
-
Extend: "Extend",
|
|
38
41
|
End: "End",
|
|
39
|
-
|
|
40
|
-
Stop: "Stop",
|
|
41
|
-
Claim: "Claim",
|
|
42
|
-
Complete: "Complete",
|
|
42
|
+
Extend: "Extend",
|
|
43
43
|
Finish: "Finish",
|
|
44
|
+
List: "List",
|
|
45
|
+
Open: "Open",
|
|
44
46
|
Quit: "Quit",
|
|
45
47
|
QuitAdmin: "QuitAdmin",
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
Recover: "Recover",
|
|
49
|
+
SetSettings: "SetSettings",
|
|
50
|
+
Stop: "Stop",
|
|
51
|
+
Update: "Update",
|
|
52
|
+
Work: "Work",
|
|
48
53
|
};
|
|
49
54
|
export function identifyNosanaJobsInstruction(instruction) {
|
|
50
55
|
const data = "data" in instruction ? instruction.data : instruction;
|
|
51
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
52
|
-
return NosanaJobsInstruction.
|
|
56
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([73, 66, 125, 203, 81, 41, 64, 135])), 0)) {
|
|
57
|
+
return NosanaJobsInstruction.Assign;
|
|
53
58
|
}
|
|
54
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
55
|
-
return NosanaJobsInstruction.
|
|
59
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([250, 191, 56, 128, 150, 251, 1, 103])), 0)) {
|
|
60
|
+
return NosanaJobsInstruction.Clean;
|
|
61
|
+
}
|
|
62
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([245, 90, 188, 68, 253, 235, 171, 105])), 0)) {
|
|
63
|
+
return NosanaJobsInstruction.CleanAdmin;
|
|
56
64
|
}
|
|
57
65
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([98, 165, 201, 177, 108, 65, 206, 96])), 0)) {
|
|
58
66
|
return NosanaJobsInstruction.Close;
|
|
@@ -60,50 +68,50 @@ export function identifyNosanaJobsInstruction(instruction) {
|
|
|
60
68
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([202, 182, 185, 142, 208, 161, 145, 189])), 0)) {
|
|
61
69
|
return NosanaJobsInstruction.CloseAdmin;
|
|
62
70
|
}
|
|
63
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
64
|
-
return NosanaJobsInstruction.
|
|
71
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([228, 148, 106, 225, 101, 49, 44, 129])), 0)) {
|
|
72
|
+
return NosanaJobsInstruction.CloseSettings;
|
|
65
73
|
}
|
|
66
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
67
|
-
return NosanaJobsInstruction.
|
|
74
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([0, 77, 224, 147, 136, 25, 88, 76])), 0)) {
|
|
75
|
+
return NosanaJobsInstruction.Complete;
|
|
68
76
|
}
|
|
69
77
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([55, 136, 205, 107, 107, 173, 4, 31])), 0)) {
|
|
70
78
|
return NosanaJobsInstruction.Delist;
|
|
71
79
|
}
|
|
72
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([108, 216, 38, 58, 109, 146, 116, 17])), 0)) {
|
|
73
|
-
return NosanaJobsInstruction.Recover;
|
|
74
|
-
}
|
|
75
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([228, 127, 0, 1, 227, 154, 54, 168])), 0)) {
|
|
76
|
-
return NosanaJobsInstruction.Extend;
|
|
77
|
-
}
|
|
78
80
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([180, 160, 249, 217, 194, 121, 70, 16])), 0)) {
|
|
79
81
|
return NosanaJobsInstruction.End;
|
|
80
82
|
}
|
|
81
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
82
|
-
return NosanaJobsInstruction.
|
|
83
|
-
}
|
|
84
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([42, 133, 32, 60, 171, 253, 184, 155])), 0)) {
|
|
85
|
-
return NosanaJobsInstruction.Stop;
|
|
86
|
-
}
|
|
87
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([62, 198, 214, 193, 213, 159, 108, 210])), 0)) {
|
|
88
|
-
return NosanaJobsInstruction.Claim;
|
|
89
|
-
}
|
|
90
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([0, 77, 224, 147, 136, 25, 88, 76])), 0)) {
|
|
91
|
-
return NosanaJobsInstruction.Complete;
|
|
83
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([228, 127, 0, 1, 227, 154, 54, 168])), 0)) {
|
|
84
|
+
return NosanaJobsInstruction.Extend;
|
|
92
85
|
}
|
|
93
86
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([67, 74, 170, 132, 125, 233, 182, 37])), 0)) {
|
|
94
87
|
return NosanaJobsInstruction.Finish;
|
|
95
88
|
}
|
|
89
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([54, 174, 193, 67, 17, 41, 132, 38])), 0)) {
|
|
90
|
+
return NosanaJobsInstruction.List;
|
|
91
|
+
}
|
|
92
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([228, 220, 155, 71, 199, 189, 60, 45])), 0)) {
|
|
93
|
+
return NosanaJobsInstruction.Open;
|
|
94
|
+
}
|
|
96
95
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([191, 103, 141, 240, 80, 129, 103, 153])), 0)) {
|
|
97
96
|
return NosanaJobsInstruction.Quit;
|
|
98
97
|
}
|
|
99
98
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([103, 238, 110, 8, 182, 20, 56, 196])), 0)) {
|
|
100
99
|
return NosanaJobsInstruction.QuitAdmin;
|
|
101
100
|
}
|
|
102
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
103
|
-
return NosanaJobsInstruction.
|
|
101
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([108, 216, 38, 58, 109, 146, 116, 17])), 0)) {
|
|
102
|
+
return NosanaJobsInstruction.Recover;
|
|
104
103
|
}
|
|
105
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
106
|
-
return NosanaJobsInstruction.
|
|
104
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([123, 181, 85, 122, 226, 162, 130, 249])), 0)) {
|
|
105
|
+
return NosanaJobsInstruction.SetSettings;
|
|
106
|
+
}
|
|
107
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([42, 133, 32, 60, 171, 253, 184, 155])), 0)) {
|
|
108
|
+
return NosanaJobsInstruction.Stop;
|
|
109
|
+
}
|
|
110
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([219, 200, 88, 176, 158, 63, 253, 127])), 0)) {
|
|
111
|
+
return NosanaJobsInstruction.Update;
|
|
112
|
+
}
|
|
113
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([15, 67, 45, 195, 215, 137, 229, 47])), 0)) {
|
|
114
|
+
return NosanaJobsInstruction.Work;
|
|
107
115
|
}
|
|
108
116
|
throw new Error("The provided instruction could not be identified as a nosanaJobs instruction.");
|
|
109
117
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @see https://github.com/codama-idl/codama
|
|
7
7
|
*/
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./
|
|
10
|
-
export * from "./queueType.js";
|
|
8
|
+
export * from "./reflectionAccount.js";
|
|
9
|
+
export * from "./stakeAccount.js";
|
|
11
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC"}
|
package/dist/types/index.js
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
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 FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
|
|
9
|
+
/** The `ReflectionAccount` struct holds all the information on the reflection pool. */
|
|
10
|
+
export type ReflectionAccount = {
|
|
11
|
+
rate: bigint;
|
|
12
|
+
totalReflection: bigint;
|
|
13
|
+
totalXnos: bigint;
|
|
14
|
+
vault: Address;
|
|
15
|
+
vaultBump: number;
|
|
16
|
+
};
|
|
17
|
+
export type ReflectionAccountArgs = {
|
|
18
|
+
rate: number | bigint;
|
|
19
|
+
totalReflection: number | bigint;
|
|
20
|
+
totalXnos: number | bigint;
|
|
21
|
+
vault: Address;
|
|
22
|
+
vaultBump: number;
|
|
23
|
+
};
|
|
24
|
+
export declare function getReflectionAccountEncoder(): FixedSizeEncoder<ReflectionAccountArgs>;
|
|
25
|
+
export declare function getReflectionAccountDecoder(): FixedSizeDecoder<ReflectionAccount>;
|
|
26
|
+
export declare function getReflectionAccountCodec(): FixedSizeCodec<ReflectionAccountArgs, ReflectionAccount>;
|
|
27
|
+
//# sourceMappingURL=reflectionAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reflectionAccount.d.ts","sourceRoot":"","sources":["../../src/types/reflectionAccount.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAUL,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AAErB,uFAAuF;AACvF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAgB,2BAA2B,IAAI,gBAAgB,CAAC,qBAAqB,CAAC,CAQrF;AAED,wBAAgB,2BAA2B,IAAI,gBAAgB,CAAC,iBAAiB,CAAC,CAQjF;AAED,wBAAgB,yBAAyB,IAAI,cAAc,CACzD,qBAAqB,EACrB,iBAAiB,CAClB,CAKA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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, getAddressDecoder, getAddressEncoder, getStructDecoder, getStructEncoder, getU128Decoder, getU128Encoder, getU8Decoder, getU8Encoder, } from "@solana/kit";
|
|
9
|
+
export function getReflectionAccountEncoder() {
|
|
10
|
+
return getStructEncoder([
|
|
11
|
+
["rate", getU128Encoder()],
|
|
12
|
+
["totalReflection", getU128Encoder()],
|
|
13
|
+
["totalXnos", getU128Encoder()],
|
|
14
|
+
["vault", getAddressEncoder()],
|
|
15
|
+
["vaultBump", getU8Encoder()],
|
|
16
|
+
]);
|
|
17
|
+
}
|
|
18
|
+
export function getReflectionAccountDecoder() {
|
|
19
|
+
return getStructDecoder([
|
|
20
|
+
["rate", getU128Decoder()],
|
|
21
|
+
["totalReflection", getU128Decoder()],
|
|
22
|
+
["totalXnos", getU128Decoder()],
|
|
23
|
+
["vault", getAddressDecoder()],
|
|
24
|
+
["vaultBump", getU8Decoder()],
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
export function getReflectionAccountCodec() {
|
|
28
|
+
return combineCodec(getReflectionAccountEncoder(), getReflectionAccountDecoder());
|
|
29
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
|
|
9
|
+
/** The `StakeAccount` struct holds all the information for any given stake. */
|
|
10
|
+
export type StakeAccount = {
|
|
11
|
+
amount: bigint;
|
|
12
|
+
authority: Address;
|
|
13
|
+
duration: bigint;
|
|
14
|
+
timeUnstake: bigint;
|
|
15
|
+
vault: Address;
|
|
16
|
+
vaultBump: number;
|
|
17
|
+
xnos: bigint;
|
|
18
|
+
};
|
|
19
|
+
export type StakeAccountArgs = {
|
|
20
|
+
amount: number | bigint;
|
|
21
|
+
authority: Address;
|
|
22
|
+
duration: number | bigint;
|
|
23
|
+
timeUnstake: number | bigint;
|
|
24
|
+
vault: Address;
|
|
25
|
+
vaultBump: number;
|
|
26
|
+
xnos: number | bigint;
|
|
27
|
+
};
|
|
28
|
+
export declare function getStakeAccountEncoder(): FixedSizeEncoder<StakeAccountArgs>;
|
|
29
|
+
export declare function getStakeAccountDecoder(): FixedSizeDecoder<StakeAccount>;
|
|
30
|
+
export declare function getStakeAccountCodec(): FixedSizeCodec<StakeAccountArgs, StakeAccount>;
|
|
31
|
+
//# sourceMappingURL=stakeAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stakeAccount.d.ts","sourceRoot":"","sources":["../../src/types/stakeAccount.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAcL,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AAErB,+EAA+E;AAC/E,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAAC;AAEF,wBAAgB,sBAAsB,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,CAU3E;AAED,wBAAgB,sBAAsB,IAAI,gBAAgB,CAAC,YAAY,CAAC,CAUvE;AAED,wBAAgB,oBAAoB,IAAI,cAAc,CACpD,gBAAgB,EAChB,YAAY,CACb,CAEA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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, getAddressDecoder, getAddressEncoder, getI64Decoder, getI64Encoder, getStructDecoder, getStructEncoder, getU128Decoder, getU128Encoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, } from "@solana/kit";
|
|
9
|
+
export function getStakeAccountEncoder() {
|
|
10
|
+
return getStructEncoder([
|
|
11
|
+
["amount", getU64Encoder()],
|
|
12
|
+
["authority", getAddressEncoder()],
|
|
13
|
+
["duration", getU64Encoder()],
|
|
14
|
+
["timeUnstake", getI64Encoder()],
|
|
15
|
+
["vault", getAddressEncoder()],
|
|
16
|
+
["vaultBump", getU8Encoder()],
|
|
17
|
+
["xnos", getU128Encoder()],
|
|
18
|
+
]);
|
|
19
|
+
}
|
|
20
|
+
export function getStakeAccountDecoder() {
|
|
21
|
+
return getStructDecoder([
|
|
22
|
+
["amount", getU64Decoder()],
|
|
23
|
+
["authority", getAddressDecoder()],
|
|
24
|
+
["duration", getU64Decoder()],
|
|
25
|
+
["timeUnstake", getI64Decoder()],
|
|
26
|
+
["vault", getAddressDecoder()],
|
|
27
|
+
["vaultBump", getU8Decoder()],
|
|
28
|
+
["xnos", getU128Decoder()],
|
|
29
|
+
]);
|
|
30
|
+
}
|
|
31
|
+
export function getStakeAccountCodec() {
|
|
32
|
+
return combineCodec(getStakeAccountEncoder(), getStakeAccountDecoder());
|
|
33
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nosana/jobs-program",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.23.0",
|
|
4
4
|
"description": "Nosana Jobs program generated client",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"dist",
|
|
43
43
|
"package.json"
|
|
44
44
|
],
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "02ebc341d679774aee4b37bcd1fa0a8f6f1076a5"
|
|
46
46
|
}
|
|
@@ -1,73 +0,0 @@
|
|
|
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 CLAIM_INSTRUCTION_ACCOUNTS: {
|
|
11
|
-
readonly job: 0;
|
|
12
|
-
readonly run: 1;
|
|
13
|
-
readonly market: 2;
|
|
14
|
-
readonly stake: 3;
|
|
15
|
-
readonly nft: 4;
|
|
16
|
-
readonly metadata: 5;
|
|
17
|
-
readonly payer: 6;
|
|
18
|
-
readonly authority: 7;
|
|
19
|
-
readonly systemProgram: 8;
|
|
20
|
-
};
|
|
21
|
-
export type ClaimInstructionAccountName = keyof typeof CLAIM_INSTRUCTION_ACCOUNTS;
|
|
22
|
-
export declare const CLAIM_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
23
|
-
export declare function getClaimDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
|
|
24
|
-
export type ClaimInstruction<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, TAccountStake extends string | AccountMeta<string> = string, TAccountNft extends string | AccountMeta<string> = string, TAccountMetadata extends string | AccountMeta<string> = string, TAccountPayer extends string | AccountMeta<string> = string, TAccountAuthority extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
25
|
-
TAccountJob extends string ? WritableAccount<TAccountJob> : TAccountJob,
|
|
26
|
-
TAccountRun extends string ? WritableSignerAccount<TAccountRun> & AccountSignerMeta<TAccountRun> : TAccountRun,
|
|
27
|
-
TAccountMarket extends string ? ReadonlyAccount<TAccountMarket> : TAccountMarket,
|
|
28
|
-
TAccountStake extends string ? ReadonlyAccount<TAccountStake> : TAccountStake,
|
|
29
|
-
TAccountNft extends string ? ReadonlyAccount<TAccountNft> : TAccountNft,
|
|
30
|
-
TAccountMetadata extends string ? ReadonlyAccount<TAccountMetadata> : TAccountMetadata,
|
|
31
|
-
TAccountPayer extends string ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer> : TAccountPayer,
|
|
32
|
-
TAccountAuthority extends string ? ReadonlySignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority,
|
|
33
|
-
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
34
|
-
...TRemainingAccounts
|
|
35
|
-
]>;
|
|
36
|
-
export type ClaimInstructionData = {
|
|
37
|
-
discriminator: ReadonlyUint8Array;
|
|
38
|
-
};
|
|
39
|
-
export type ClaimInstructionDataArgs = {};
|
|
40
|
-
export declare function getClaimInstructionDataEncoder(): FixedSizeEncoder<ClaimInstructionDataArgs>;
|
|
41
|
-
export declare function getClaimInstructionDataDecoder(): FixedSizeDecoder<ClaimInstructionData>;
|
|
42
|
-
export declare function getClaimInstructionDataCodec(): FixedSizeCodec<ClaimInstructionDataArgs, ClaimInstructionData>;
|
|
43
|
-
export type ClaimInput<TAccountJob extends string = string, TAccountRun extends string = string, TAccountMarket extends string = string, TAccountStake extends string = string, TAccountNft extends string = string, TAccountMetadata extends string = string, TAccountPayer extends string = string, TAccountAuthority extends string = string, TAccountSystemProgram extends string = string> = {
|
|
44
|
-
job: Address<TAccountJob>;
|
|
45
|
-
run: TransactionSigner<TAccountRun>;
|
|
46
|
-
market: Address<TAccountMarket>;
|
|
47
|
-
stake: Address<TAccountStake>;
|
|
48
|
-
nft: Address<TAccountNft>;
|
|
49
|
-
metadata: Address<TAccountMetadata>;
|
|
50
|
-
payer: TransactionSigner<TAccountPayer>;
|
|
51
|
-
authority: TransactionSigner<TAccountAuthority>;
|
|
52
|
-
systemProgram?: Address<TAccountSystemProgram>;
|
|
53
|
-
};
|
|
54
|
-
export declare function getClaimInstruction<TAccountJob extends string, TAccountRun extends string, TAccountMarket extends string, TAccountStake extends string, TAccountNft extends string, TAccountMetadata extends string, TAccountPayer extends string, TAccountAuthority extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof NOSANA_JOBS_PROGRAM_ADDRESS>(input: ClaimInput<TAccountJob, TAccountRun, TAccountMarket, TAccountStake, TAccountNft, TAccountMetadata, TAccountPayer, TAccountAuthority, TAccountSystemProgram>, config?: {
|
|
55
|
-
programAddress?: TProgramAddress;
|
|
56
|
-
}): ClaimInstruction<TProgramAddress, TAccountJob, TAccountRun, TAccountMarket, TAccountStake, TAccountNft, TAccountMetadata, TAccountPayer, TAccountAuthority, TAccountSystemProgram>;
|
|
57
|
-
export type ParsedClaimInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
58
|
-
programAddress: Address<TProgram>;
|
|
59
|
-
accounts: {
|
|
60
|
-
job: TAccountMetas[0];
|
|
61
|
-
run: TAccountMetas[1];
|
|
62
|
-
market: TAccountMetas[2];
|
|
63
|
-
stake: TAccountMetas[3];
|
|
64
|
-
nft: TAccountMetas[4];
|
|
65
|
-
metadata: TAccountMetas[5];
|
|
66
|
-
payer: TAccountMetas[6];
|
|
67
|
-
authority: TAccountMetas[7];
|
|
68
|
-
systemProgram: TAccountMetas[8];
|
|
69
|
-
};
|
|
70
|
-
data: ClaimInstructionData;
|
|
71
|
-
};
|
|
72
|
-
export declare function parseClaimInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedClaimInstruction<TProgram, TAccountMetas>;
|
|
73
|
-
//# sourceMappingURL=claim.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../../src/instructions/claim.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EASL,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAA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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 CLAIM_INSTRUCTION_ACCOUNTS = {
|
|
12
|
-
job: 0,
|
|
13
|
-
run: 1,
|
|
14
|
-
market: 2,
|
|
15
|
-
stake: 3,
|
|
16
|
-
nft: 4,
|
|
17
|
-
metadata: 5,
|
|
18
|
-
payer: 6,
|
|
19
|
-
authority: 7,
|
|
20
|
-
systemProgram: 8,
|
|
21
|
-
};
|
|
22
|
-
export const CLAIM_DISCRIMINATOR = new Uint8Array([
|
|
23
|
-
62, 198, 214, 193, 213, 159, 108, 210,
|
|
24
|
-
]);
|
|
25
|
-
export function getClaimDiscriminatorBytes() {
|
|
26
|
-
return fixEncoderSize(getBytesEncoder(), 8).encode(CLAIM_DISCRIMINATOR);
|
|
27
|
-
}
|
|
28
|
-
export function getClaimInstructionDataEncoder() {
|
|
29
|
-
return transformEncoder(getStructEncoder([["discriminator", fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({ ...value, discriminator: CLAIM_DISCRIMINATOR }));
|
|
30
|
-
}
|
|
31
|
-
export function getClaimInstructionDataDecoder() {
|
|
32
|
-
return getStructDecoder([
|
|
33
|
-
["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
|
|
34
|
-
]);
|
|
35
|
-
}
|
|
36
|
-
export function getClaimInstructionDataCodec() {
|
|
37
|
-
return combineCodec(getClaimInstructionDataEncoder(), getClaimInstructionDataDecoder());
|
|
38
|
-
}
|
|
39
|
-
export function getClaimInstruction(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
|
-
run: { value: input.run ?? null, isWritable: true },
|
|
46
|
-
market: { value: input.market ?? null, isWritable: false },
|
|
47
|
-
stake: { value: input.stake ?? null, isWritable: false },
|
|
48
|
-
nft: { value: input.nft ?? null, isWritable: false },
|
|
49
|
-
metadata: { value: input.metadata ?? null, isWritable: false },
|
|
50
|
-
payer: { value: input.payer ?? null, isWritable: true },
|
|
51
|
-
authority: { value: input.authority ?? null, isWritable: false },
|
|
52
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
53
|
-
};
|
|
54
|
-
const accounts = originalAccounts;
|
|
55
|
-
// Resolve default values.
|
|
56
|
-
if (!accounts.systemProgram.value) {
|
|
57
|
-
accounts.systemProgram.value =
|
|
58
|
-
"11111111111111111111111111111111";
|
|
59
|
-
}
|
|
60
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
61
|
-
return Object.freeze({
|
|
62
|
-
accounts: [
|
|
63
|
-
getAccountMeta(accounts.job),
|
|
64
|
-
getAccountMeta(accounts.run),
|
|
65
|
-
getAccountMeta(accounts.market),
|
|
66
|
-
getAccountMeta(accounts.stake),
|
|
67
|
-
getAccountMeta(accounts.nft),
|
|
68
|
-
getAccountMeta(accounts.metadata),
|
|
69
|
-
getAccountMeta(accounts.payer),
|
|
70
|
-
getAccountMeta(accounts.authority),
|
|
71
|
-
getAccountMeta(accounts.systemProgram),
|
|
72
|
-
],
|
|
73
|
-
data: getClaimInstructionDataEncoder().encode({}),
|
|
74
|
-
programAddress,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
export function parseClaimInstruction(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
|
-
run: getNextAccount(),
|
|
93
|
-
market: getNextAccount(),
|
|
94
|
-
stake: getNextAccount(),
|
|
95
|
-
nft: getNextAccount(),
|
|
96
|
-
metadata: getNextAccount(),
|
|
97
|
-
payer: getNextAccount(),
|
|
98
|
-
authority: getNextAccount(),
|
|
99
|
-
systemProgram: getNextAccount(),
|
|
100
|
-
},
|
|
101
|
-
data: getClaimInstructionDataDecoder().decode(instruction.data),
|
|
102
|
-
};
|
|
103
|
-
}
|
package/dist/types/jobState.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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 FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
|
|
9
|
-
/** The `JobState` describes the status of a job. */
|
|
10
|
-
export declare const JobState: {
|
|
11
|
-
readonly Queued: "Queued";
|
|
12
|
-
readonly Done: "Done";
|
|
13
|
-
readonly Stopped: "Stopped";
|
|
14
|
-
};
|
|
15
|
-
export type JobState = (typeof JobState)[keyof typeof JobState];
|
|
16
|
-
export type JobStateArgs = JobState;
|
|
17
|
-
export declare function getJobStateEncoder(): FixedSizeEncoder<JobStateArgs>;
|
|
18
|
-
export declare function getJobStateDecoder(): FixedSizeDecoder<JobState>;
|
|
19
|
-
export declare function getJobStateCodec(): FixedSizeCodec<JobStateArgs, JobState>;
|
|
20
|
-
//# sourceMappingURL=jobState.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jobState.d.ts","sourceRoot":"","sources":["../../src/types/jobState.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AAErB,oDAAoD;AACpD,eAAO,MAAM,QAAQ;;;;CAIX,CAAC;AACX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAEhE,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;AAEpC,wBAAgB,kBAAkB,IAAI,gBAAgB,CAAC,YAAY,CAAC,CAEnE;AAED,wBAAgB,kBAAkB,IAAI,gBAAgB,CAAC,QAAQ,CAAC,CAE/D;AAED,wBAAgB,gBAAgB,IAAI,cAAc,CAAC,YAAY,EAAE,QAAQ,CAAC,CAEzE"}
|
package/dist/types/jobState.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
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, getEnumDecoder, getEnumEncoder, } from "@solana/kit";
|
|
9
|
-
/** The `JobState` describes the status of a job. */
|
|
10
|
-
export const JobState = {
|
|
11
|
-
Queued: "Queued",
|
|
12
|
-
Done: "Done",
|
|
13
|
-
Stopped: "Stopped",
|
|
14
|
-
};
|
|
15
|
-
export function getJobStateEncoder() {
|
|
16
|
-
return getEnumEncoder(JobState);
|
|
17
|
-
}
|
|
18
|
-
export function getJobStateDecoder() {
|
|
19
|
-
return getEnumDecoder(JobState);
|
|
20
|
-
}
|
|
21
|
-
export function getJobStateCodec() {
|
|
22
|
-
return combineCodec(getJobStateEncoder(), getJobStateDecoder());
|
|
23
|
-
}
|
package/dist/types/jobType.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
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 FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
|
|
9
|
-
/** The `JobType` describes the type of any job. */
|
|
10
|
-
export declare const JobType: {
|
|
11
|
-
readonly Default: "Default";
|
|
12
|
-
readonly Small: "Small";
|
|
13
|
-
readonly Medium: "Medium";
|
|
14
|
-
readonly Large: "Large";
|
|
15
|
-
readonly Gpu: "Gpu";
|
|
16
|
-
readonly Unknown: "Unknown";
|
|
17
|
-
};
|
|
18
|
-
export type JobType = (typeof JobType)[keyof typeof JobType];
|
|
19
|
-
export type JobTypeArgs = JobType;
|
|
20
|
-
export declare function getJobTypeEncoder(): FixedSizeEncoder<JobTypeArgs>;
|
|
21
|
-
export declare function getJobTypeDecoder(): FixedSizeDecoder<JobType>;
|
|
22
|
-
export declare function getJobTypeCodec(): FixedSizeCodec<JobTypeArgs, JobType>;
|
|
23
|
-
//# sourceMappingURL=jobType.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jobType.d.ts","sourceRoot":"","sources":["../../src/types/jobType.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AAErB,mDAAmD;AACnD,eAAO,MAAM,OAAO;;;;;;;CAOV,CAAC;AACX,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;AAE7D,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC;AAElC,wBAAgB,iBAAiB,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAEjE;AAED,wBAAgB,iBAAiB,IAAI,gBAAgB,CAAC,OAAO,CAAC,CAE7D;AAED,wBAAgB,eAAe,IAAI,cAAc,CAAC,WAAW,EAAE,OAAO,CAAC,CAEtE"}
|
package/dist/types/jobType.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
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, getEnumDecoder, getEnumEncoder, } from "@solana/kit";
|
|
9
|
-
/** The `JobType` describes the type of any job. */
|
|
10
|
-
export const JobType = {
|
|
11
|
-
Default: "Default",
|
|
12
|
-
Small: "Small",
|
|
13
|
-
Medium: "Medium",
|
|
14
|
-
Large: "Large",
|
|
15
|
-
Gpu: "Gpu",
|
|
16
|
-
Unknown: "Unknown",
|
|
17
|
-
};
|
|
18
|
-
export function getJobTypeEncoder() {
|
|
19
|
-
return getEnumEncoder(JobType);
|
|
20
|
-
}
|
|
21
|
-
export function getJobTypeDecoder() {
|
|
22
|
-
return getEnumDecoder(JobType);
|
|
23
|
-
}
|
|
24
|
-
export function getJobTypeCodec() {
|
|
25
|
-
return combineCodec(getJobTypeEncoder(), getJobTypeDecoder());
|
|
26
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
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 FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
|
|
9
|
-
/** The `QueueType` describes the type of queue */
|
|
10
|
-
export declare const QueueType: {
|
|
11
|
-
readonly Job: "Job";
|
|
12
|
-
readonly Node: "Node";
|
|
13
|
-
readonly Empty: "Empty";
|
|
14
|
-
};
|
|
15
|
-
export type QueueType = (typeof QueueType)[keyof typeof QueueType];
|
|
16
|
-
export type QueueTypeArgs = QueueType;
|
|
17
|
-
export declare function getQueueTypeEncoder(): FixedSizeEncoder<QueueTypeArgs>;
|
|
18
|
-
export declare function getQueueTypeDecoder(): FixedSizeDecoder<QueueType>;
|
|
19
|
-
export declare function getQueueTypeCodec(): FixedSizeCodec<QueueTypeArgs, QueueType>;
|
|
20
|
-
//# sourceMappingURL=queueType.d.ts.map
|