@nosana/kit 0.1.7 → 1.0.2
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 +41 -9
- package/.prettierignore +17 -0
- package/README.md +729 -59
- package/dist/config/defaultConfigs.d.ts +1 -1
- package/dist/config/defaultConfigs.js +2 -2
- package/dist/config/types.d.ts +1 -1
- package/dist/config/utils.d.ts +1 -1
- package/dist/config/utils.js +5 -5
- package/dist/errors/NosanaError.d.ts +1 -1
- package/dist/generated_clients/jobs/instructions/assign.d.ts +79 -0
- package/dist/generated_clients/jobs/instructions/assign.js +120 -0
- package/dist/generated_clients/jobs/instructions/extend.d.ts +9 -6
- package/dist/generated_clients/jobs/instructions/extend.js +4 -1
- package/dist/generated_clients/jobs/instructions/finish.d.ts +10 -10
- package/dist/generated_clients/jobs/instructions/finish.js +6 -6
- package/dist/generated_clients/jobs/instructions/index.d.ts +1 -0
- package/dist/generated_clients/jobs/instructions/index.js +1 -0
- package/dist/generated_clients/jobs/programs/nosanaJobs.d.ts +18 -15
- package/dist/generated_clients/jobs/programs/nosanaJobs.js +18 -14
- package/dist/generated_clients/staking/accounts/index.d.ts +9 -0
- package/dist/generated_clients/staking/accounts/index.js +9 -0
- package/dist/generated_clients/staking/accounts/settingsAccount.d.ts +29 -0
- package/dist/generated_clients/staking/accounts/settingsAccount.js +55 -0
- package/dist/generated_clients/staking/accounts/stakeAccount.d.ts +39 -0
- package/dist/generated_clients/staking/accounts/stakeAccount.js +65 -0
- package/dist/generated_clients/staking/errors/index.d.ts +8 -0
- package/dist/generated_clients/staking/errors/index.js +8 -0
- package/dist/generated_clients/staking/errors/nosanaStaking.d.ts +45 -0
- package/dist/generated_clients/staking/errors/nosanaStaking.js +62 -0
- package/dist/generated_clients/staking/index.d.ts +11 -0
- package/dist/generated_clients/staking/index.js +11 -0
- package/dist/generated_clients/staking/instructions/close.d.ts +48 -0
- package/dist/generated_clients/staking/instructions/close.js +81 -0
- package/dist/generated_clients/staking/instructions/extend.d.ts +43 -0
- package/dist/generated_clients/staking/instructions/extend.js +73 -0
- package/dist/generated_clients/staking/instructions/index.d.ts +17 -0
- package/dist/generated_clients/staking/instructions/index.js +17 -0
- package/dist/generated_clients/staking/instructions/init.d.ts +45 -0
- package/dist/generated_clients/staking/instructions/init.js +82 -0
- package/dist/generated_clients/staking/instructions/restake.d.ts +42 -0
- package/dist/generated_clients/staking/instructions/restake.js +70 -0
- package/dist/generated_clients/staking/instructions/slash.d.ts +55 -0
- package/dist/generated_clients/staking/instructions/slash.js +90 -0
- package/dist/generated_clients/staking/instructions/stake.d.ts +64 -0
- package/dist/generated_clients/staking/instructions/stake.js +106 -0
- package/dist/generated_clients/staking/instructions/topup.d.ts +52 -0
- package/dist/generated_clients/staking/instructions/topup.js +87 -0
- package/dist/generated_clients/staking/instructions/unstake.d.ts +42 -0
- package/dist/generated_clients/staking/instructions/unstake.js +70 -0
- package/dist/generated_clients/staking/instructions/updateSettings.d.ts +45 -0
- package/dist/generated_clients/staking/instructions/updateSettings.js +73 -0
- package/dist/generated_clients/staking/instructions/withdraw.d.ts +48 -0
- package/dist/generated_clients/staking/instructions/withdraw.js +81 -0
- package/dist/generated_clients/staking/programs/index.d.ts +8 -0
- package/dist/generated_clients/staking/programs/index.js +8 -0
- package/dist/generated_clients/staking/programs/nosanaStaking.d.ts +53 -0
- package/dist/generated_clients/staking/programs/nosanaStaking.js +71 -0
- package/dist/generated_clients/staking/shared/index.d.ts +49 -0
- package/dist/generated_clients/staking/shared/index.js +86 -0
- package/dist/index.d.ts +12 -4
- package/dist/index.js +18 -136
- package/dist/ipfs/IPFS.js +3 -0
- package/dist/programs/BaseProgram.d.ts +1 -1
- package/dist/programs/BaseProgram.js +3 -7
- package/dist/programs/JobsProgram.d.ts +37 -37
- package/dist/programs/JobsProgram.js +63 -67
- package/dist/programs/StakeProgram.d.ts +29 -0
- package/dist/programs/StakeProgram.js +91 -0
- package/dist/services/NosService.d.ts +48 -0
- package/dist/services/NosService.js +134 -0
- package/dist/{solana/SolanaUtils.d.ts → services/SolanaService.d.ts} +5 -5
- package/dist/{solana/SolanaUtils.js → services/SolanaService.js} +17 -7
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +2 -0
- package/dist/utils/walletConverter.d.ts +9 -0
- package/dist/utils/walletConverter.js +141 -0
- package/eslint.config.js +49 -0
- package/examples/node/README.md +115 -0
- package/examples/node/nos-service.ts +117 -0
- package/examples/node/package.json +3 -1
- package/examples/node/retrieve.ts +2 -2
- package/examples/node/stake-program.ts +84 -0
- package/package.json +11 -8
- package/scripts/generate-clients.ts +20 -7
- package/vitest.config.ts +31 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ClientConfig, NosanaNetwork } from
|
|
1
|
+
import { ClientConfig, NosanaNetwork } from './types';
|
|
2
2
|
export declare const DEFAULT_CONFIGS: Record<NosanaNetwork, ClientConfig>;
|
package/dist/config/types.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare enum NosanaLogLevel {
|
|
|
11
11
|
DEBUG = 4
|
|
12
12
|
}
|
|
13
13
|
export interface SolanaConfig {
|
|
14
|
-
cluster: SolanaClusterMoniker |
|
|
14
|
+
cluster: SolanaClusterMoniker | 'mainnet-beta' | 'localhost';
|
|
15
15
|
rpcEndpoint: string;
|
|
16
16
|
wsEndpoint?: string;
|
|
17
17
|
commitment?: 'processed' | 'confirmed' | 'finalized';
|
package/dist/config/utils.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ClientConfig, NosanaNetwork, PartialClientConfig } from
|
|
1
|
+
import { ClientConfig, NosanaNetwork, PartialClientConfig } from './types.js';
|
|
2
2
|
export declare const mergeConfigs: (defaultConfig: ClientConfig, customConfig?: PartialClientConfig) => ClientConfig;
|
|
3
3
|
export declare const getNosanaConfig: (network?: NosanaNetwork, config?: PartialClientConfig) => ClientConfig;
|
package/dist/config/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ErrorCodes, NosanaError } from
|
|
2
|
-
import { DEFAULT_CONFIGS } from
|
|
3
|
-
import { NosanaNetwork } from
|
|
1
|
+
import { ErrorCodes, NosanaError } from '../errors/NosanaError.js';
|
|
2
|
+
import { DEFAULT_CONFIGS } from './defaultConfigs.js';
|
|
3
|
+
import { NosanaNetwork } from './types.js';
|
|
4
4
|
export const mergeConfigs = (defaultConfig, customConfig) => {
|
|
5
5
|
if (!customConfig)
|
|
6
6
|
return defaultConfig;
|
|
@@ -27,8 +27,8 @@ export const getNosanaConfig = (network = NosanaNetwork.MAINNET, config) => {
|
|
|
27
27
|
// Example: Initialize with default (Mainnet) or specific network, or custom config
|
|
28
28
|
// const defaultConfig = getNosanaConfig();
|
|
29
29
|
// const devConfig = getNosanaConfig(NosanaNetwork.DEVNET);
|
|
30
|
-
// const customConfig = getNosanaConfig(NosanaNetwork.MAINNET, {
|
|
31
|
-
// solana: {
|
|
30
|
+
// const customConfig = getNosanaConfig(NosanaNetwork.MAINNET, {
|
|
31
|
+
// solana: {
|
|
32
32
|
// rpcEndpoint: 'your-custom-rpc-endpoint-url',
|
|
33
33
|
// },
|
|
34
34
|
// ipfs: {
|
|
@@ -14,4 +14,4 @@ export declare const ErrorCodes: {
|
|
|
14
14
|
readonly FILE_ERROR: "FILE_ERROR";
|
|
15
15
|
readonly WALLET_CONVERSION_ERROR: "WALLET_CONVERSION_ERROR";
|
|
16
16
|
};
|
|
17
|
-
export type ErrorCode = typeof ErrorCodes[keyof typeof ErrorCodes];
|
|
17
|
+
export type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];
|
|
@@ -0,0 +1,79 @@
|
|
|
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 ASSIGN_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
11
|
+
export declare function getAssignDiscriminatorBytes(): ReadonlyUint8Array;
|
|
12
|
+
export type AssignInstruction<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, TAccountNode extends string | IAccountMeta<string> = string, TAccountUser extends string | IAccountMeta<string> = string, TAccountVault extends string | IAccountMeta<string> = string, TAccountPayer 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', TAccountSystemProgram extends string | IAccountMeta<string> = '11111111111111111111111111111111', TRemainingAccounts extends readonly IAccountMeta<string>[] = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<[
|
|
13
|
+
TAccountJob extends string ? WritableSignerAccount<TAccountJob> & IAccountSignerMeta<TAccountJob> : TAccountJob,
|
|
14
|
+
TAccountMarket extends string ? WritableAccount<TAccountMarket> : TAccountMarket,
|
|
15
|
+
TAccountRun extends string ? WritableSignerAccount<TAccountRun> & IAccountSignerMeta<TAccountRun> : TAccountRun,
|
|
16
|
+
TAccountNode extends string ? ReadonlyAccount<TAccountNode> : TAccountNode,
|
|
17
|
+
TAccountUser extends string ? WritableAccount<TAccountUser> : TAccountUser,
|
|
18
|
+
TAccountVault extends string ? WritableAccount<TAccountVault> : TAccountVault,
|
|
19
|
+
TAccountPayer extends string ? WritableSignerAccount<TAccountPayer> & IAccountSignerMeta<TAccountPayer> : TAccountPayer,
|
|
20
|
+
TAccountRewardsReflection extends string ? WritableAccount<TAccountRewardsReflection> : TAccountRewardsReflection,
|
|
21
|
+
TAccountRewardsVault extends string ? WritableAccount<TAccountRewardsVault> : TAccountRewardsVault,
|
|
22
|
+
TAccountAuthority extends string ? ReadonlySignerAccount<TAccountAuthority> & IAccountSignerMeta<TAccountAuthority> : TAccountAuthority,
|
|
23
|
+
TAccountRewardsProgram extends string ? ReadonlyAccount<TAccountRewardsProgram> : TAccountRewardsProgram,
|
|
24
|
+
TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
|
|
25
|
+
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
26
|
+
...TRemainingAccounts
|
|
27
|
+
]>;
|
|
28
|
+
export type AssignInstructionData = {
|
|
29
|
+
discriminator: ReadonlyUint8Array;
|
|
30
|
+
ipfsJob: ReadonlyUint8Array;
|
|
31
|
+
timeout: bigint;
|
|
32
|
+
};
|
|
33
|
+
export type AssignInstructionDataArgs = {
|
|
34
|
+
ipfsJob: ReadonlyUint8Array;
|
|
35
|
+
timeout: number | bigint;
|
|
36
|
+
};
|
|
37
|
+
export declare function getAssignInstructionDataEncoder(): Encoder<AssignInstructionDataArgs>;
|
|
38
|
+
export declare function getAssignInstructionDataDecoder(): Decoder<AssignInstructionData>;
|
|
39
|
+
export declare function getAssignInstructionDataCodec(): Codec<AssignInstructionDataArgs, AssignInstructionData>;
|
|
40
|
+
export type AssignInput<TAccountJob extends string = string, TAccountMarket extends string = string, TAccountRun extends string = string, TAccountNode extends string = string, TAccountUser extends string = string, TAccountVault extends string = string, TAccountPayer extends string = string, TAccountRewardsReflection extends string = string, TAccountRewardsVault extends string = string, TAccountAuthority extends string = string, TAccountRewardsProgram extends string = string, TAccountTokenProgram extends string = string, TAccountSystemProgram extends string = string> = {
|
|
41
|
+
job: TransactionSigner<TAccountJob>;
|
|
42
|
+
market: Address<TAccountMarket>;
|
|
43
|
+
run: TransactionSigner<TAccountRun>;
|
|
44
|
+
node: Address<TAccountNode>;
|
|
45
|
+
user: Address<TAccountUser>;
|
|
46
|
+
vault: Address<TAccountVault>;
|
|
47
|
+
payer: TransactionSigner<TAccountPayer>;
|
|
48
|
+
rewardsReflection: Address<TAccountRewardsReflection>;
|
|
49
|
+
rewardsVault: Address<TAccountRewardsVault>;
|
|
50
|
+
authority: TransactionSigner<TAccountAuthority>;
|
|
51
|
+
rewardsProgram: Address<TAccountRewardsProgram>;
|
|
52
|
+
tokenProgram?: Address<TAccountTokenProgram>;
|
|
53
|
+
systemProgram?: Address<TAccountSystemProgram>;
|
|
54
|
+
ipfsJob: AssignInstructionDataArgs['ipfsJob'];
|
|
55
|
+
timeout: AssignInstructionDataArgs['timeout'];
|
|
56
|
+
};
|
|
57
|
+
export declare function getAssignInstruction<TAccountJob extends string, TAccountMarket extends string, TAccountRun extends string, TAccountNode extends string, TAccountUser extends string, TAccountVault extends string, TAccountPayer extends string, TAccountRewardsReflection extends string, TAccountRewardsVault extends string, TAccountAuthority extends string, TAccountRewardsProgram extends string, TAccountTokenProgram extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof NOSANA_JOBS_PROGRAM_ADDRESS>(input: AssignInput<TAccountJob, TAccountMarket, TAccountRun, TAccountNode, TAccountUser, TAccountVault, TAccountPayer, TAccountRewardsReflection, TAccountRewardsVault, TAccountAuthority, TAccountRewardsProgram, TAccountTokenProgram, TAccountSystemProgram>, config?: {
|
|
58
|
+
programAddress?: TProgramAddress;
|
|
59
|
+
}): AssignInstruction<TProgramAddress, TAccountJob, TAccountMarket, TAccountRun, TAccountNode, TAccountUser, TAccountVault, TAccountPayer, TAccountRewardsReflection, TAccountRewardsVault, TAccountAuthority, TAccountRewardsProgram, TAccountTokenProgram, TAccountSystemProgram>;
|
|
60
|
+
export type ParsedAssignInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGRAM_ADDRESS, TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[]> = {
|
|
61
|
+
programAddress: Address<TProgram>;
|
|
62
|
+
accounts: {
|
|
63
|
+
job: TAccountMetas[0];
|
|
64
|
+
market: TAccountMetas[1];
|
|
65
|
+
run: TAccountMetas[2];
|
|
66
|
+
node: TAccountMetas[3];
|
|
67
|
+
user: TAccountMetas[4];
|
|
68
|
+
vault: TAccountMetas[5];
|
|
69
|
+
payer: TAccountMetas[6];
|
|
70
|
+
rewardsReflection: TAccountMetas[7];
|
|
71
|
+
rewardsVault: TAccountMetas[8];
|
|
72
|
+
authority: TAccountMetas[9];
|
|
73
|
+
rewardsProgram: TAccountMetas[10];
|
|
74
|
+
tokenProgram: TAccountMetas[11];
|
|
75
|
+
systemProgram: TAccountMetas[12];
|
|
76
|
+
};
|
|
77
|
+
data: AssignInstructionData;
|
|
78
|
+
};
|
|
79
|
+
export declare function parseAssignInstruction<TProgram extends string, TAccountMetas extends readonly IAccountMeta[]>(instruction: IInstruction<TProgram> & IInstructionWithAccounts<TAccountMetas> & IInstructionWithData<Uint8Array>): ParsedAssignInstruction<TProgram, TAccountMetas>;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { combineCodec, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getI64Decoder, getI64Encoder, getStructDecoder, getStructEncoder, transformEncoder, } from '@solana/kit';
|
|
9
|
+
import { NOSANA_JOBS_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
+
import { getAccountMetaFactory } from '../shared';
|
|
11
|
+
export const ASSIGN_DISCRIMINATOR = new Uint8Array([
|
|
12
|
+
73, 66, 125, 203, 81, 41, 64, 135,
|
|
13
|
+
]);
|
|
14
|
+
export function getAssignDiscriminatorBytes() {
|
|
15
|
+
return fixEncoderSize(getBytesEncoder(), 8).encode(ASSIGN_DISCRIMINATOR);
|
|
16
|
+
}
|
|
17
|
+
export function getAssignInstructionDataEncoder() {
|
|
18
|
+
return transformEncoder(getStructEncoder([
|
|
19
|
+
['discriminator', fixEncoderSize(getBytesEncoder(), 8)],
|
|
20
|
+
['ipfsJob', fixEncoderSize(getBytesEncoder(), 32)],
|
|
21
|
+
['timeout', getI64Encoder()],
|
|
22
|
+
]), (value) => ({ ...value, discriminator: ASSIGN_DISCRIMINATOR }));
|
|
23
|
+
}
|
|
24
|
+
export function getAssignInstructionDataDecoder() {
|
|
25
|
+
return getStructDecoder([
|
|
26
|
+
['discriminator', fixDecoderSize(getBytesDecoder(), 8)],
|
|
27
|
+
['ipfsJob', fixDecoderSize(getBytesDecoder(), 32)],
|
|
28
|
+
['timeout', getI64Decoder()],
|
|
29
|
+
]);
|
|
30
|
+
}
|
|
31
|
+
export function getAssignInstructionDataCodec() {
|
|
32
|
+
return combineCodec(getAssignInstructionDataEncoder(), getAssignInstructionDataDecoder());
|
|
33
|
+
}
|
|
34
|
+
export function getAssignInstruction(input, config) {
|
|
35
|
+
// Program address.
|
|
36
|
+
const programAddress = config?.programAddress ?? NOSANA_JOBS_PROGRAM_ADDRESS;
|
|
37
|
+
// Original accounts.
|
|
38
|
+
const originalAccounts = {
|
|
39
|
+
job: { value: input.job ?? null, isWritable: true },
|
|
40
|
+
market: { value: input.market ?? null, isWritable: true },
|
|
41
|
+
run: { value: input.run ?? null, isWritable: true },
|
|
42
|
+
node: { value: input.node ?? null, isWritable: false },
|
|
43
|
+
user: { value: input.user ?? null, isWritable: true },
|
|
44
|
+
vault: { value: input.vault ?? null, isWritable: true },
|
|
45
|
+
payer: { value: input.payer ?? null, isWritable: true },
|
|
46
|
+
rewardsReflection: {
|
|
47
|
+
value: input.rewardsReflection ?? null,
|
|
48
|
+
isWritable: true,
|
|
49
|
+
},
|
|
50
|
+
rewardsVault: { value: input.rewardsVault ?? null, isWritable: true },
|
|
51
|
+
authority: { value: input.authority ?? null, isWritable: false },
|
|
52
|
+
rewardsProgram: { value: input.rewardsProgram ?? null, isWritable: false },
|
|
53
|
+
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
54
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
55
|
+
};
|
|
56
|
+
const accounts = originalAccounts;
|
|
57
|
+
// Original args.
|
|
58
|
+
const args = { ...input };
|
|
59
|
+
// Resolve default values.
|
|
60
|
+
if (!accounts.tokenProgram.value) {
|
|
61
|
+
accounts.tokenProgram.value =
|
|
62
|
+
'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
|
|
63
|
+
}
|
|
64
|
+
if (!accounts.systemProgram.value) {
|
|
65
|
+
accounts.systemProgram.value =
|
|
66
|
+
'11111111111111111111111111111111';
|
|
67
|
+
}
|
|
68
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');
|
|
69
|
+
const instruction = {
|
|
70
|
+
accounts: [
|
|
71
|
+
getAccountMeta(accounts.job),
|
|
72
|
+
getAccountMeta(accounts.market),
|
|
73
|
+
getAccountMeta(accounts.run),
|
|
74
|
+
getAccountMeta(accounts.node),
|
|
75
|
+
getAccountMeta(accounts.user),
|
|
76
|
+
getAccountMeta(accounts.vault),
|
|
77
|
+
getAccountMeta(accounts.payer),
|
|
78
|
+
getAccountMeta(accounts.rewardsReflection),
|
|
79
|
+
getAccountMeta(accounts.rewardsVault),
|
|
80
|
+
getAccountMeta(accounts.authority),
|
|
81
|
+
getAccountMeta(accounts.rewardsProgram),
|
|
82
|
+
getAccountMeta(accounts.tokenProgram),
|
|
83
|
+
getAccountMeta(accounts.systemProgram),
|
|
84
|
+
],
|
|
85
|
+
programAddress,
|
|
86
|
+
data: getAssignInstructionDataEncoder().encode(args),
|
|
87
|
+
};
|
|
88
|
+
return instruction;
|
|
89
|
+
}
|
|
90
|
+
export function parseAssignInstruction(instruction) {
|
|
91
|
+
if (instruction.accounts.length < 13) {
|
|
92
|
+
// TODO: Coded error.
|
|
93
|
+
throw new Error('Not enough accounts');
|
|
94
|
+
}
|
|
95
|
+
let accountIndex = 0;
|
|
96
|
+
const getNextAccount = () => {
|
|
97
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
98
|
+
accountIndex += 1;
|
|
99
|
+
return accountMeta;
|
|
100
|
+
};
|
|
101
|
+
return {
|
|
102
|
+
programAddress: instruction.programAddress,
|
|
103
|
+
accounts: {
|
|
104
|
+
job: getNextAccount(),
|
|
105
|
+
market: getNextAccount(),
|
|
106
|
+
run: getNextAccount(),
|
|
107
|
+
node: getNextAccount(),
|
|
108
|
+
user: getNextAccount(),
|
|
109
|
+
vault: getNextAccount(),
|
|
110
|
+
payer: getNextAccount(),
|
|
111
|
+
rewardsReflection: getNextAccount(),
|
|
112
|
+
rewardsVault: getNextAccount(),
|
|
113
|
+
authority: getNextAccount(),
|
|
114
|
+
rewardsProgram: getNextAccount(),
|
|
115
|
+
tokenProgram: getNextAccount(),
|
|
116
|
+
systemProgram: getNextAccount(),
|
|
117
|
+
},
|
|
118
|
+
data: getAssignInstructionDataDecoder().decode(instruction.data),
|
|
119
|
+
};
|
|
120
|
+
}
|
|
@@ -9,7 +9,7 @@ import { type Address, type Codec, type Decoder, type Encoder, type IAccountMeta
|
|
|
9
9
|
import { NOSANA_JOBS_PROGRAM_ADDRESS } from '../programs';
|
|
10
10
|
export declare const EXTEND_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
11
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<[
|
|
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, TAccountPayer 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
13
|
TAccountJob extends string ? WritableAccount<TAccountJob> : TAccountJob,
|
|
14
14
|
TAccountMarket extends string ? ReadonlyAccount<TAccountMarket> : TAccountMarket,
|
|
15
15
|
TAccountUser extends string ? WritableAccount<TAccountUser> : TAccountUser,
|
|
@@ -17,6 +17,7 @@ export type ExtendInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGR
|
|
|
17
17
|
TAccountRewardsReflection extends string ? WritableAccount<TAccountRewardsReflection> : TAccountRewardsReflection,
|
|
18
18
|
TAccountRewardsVault extends string ? WritableAccount<TAccountRewardsVault> : TAccountRewardsVault,
|
|
19
19
|
TAccountAuthority extends string ? ReadonlySignerAccount<TAccountAuthority> & IAccountSignerMeta<TAccountAuthority> : TAccountAuthority,
|
|
20
|
+
TAccountPayer extends string ? ReadonlySignerAccount<TAccountPayer> & IAccountSignerMeta<TAccountPayer> : TAccountPayer,
|
|
20
21
|
TAccountRewardsProgram extends string ? ReadonlyAccount<TAccountRewardsProgram> : TAccountRewardsProgram,
|
|
21
22
|
TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
|
|
22
23
|
...TRemainingAccounts
|
|
@@ -31,7 +32,7 @@ export type ExtendInstructionDataArgs = {
|
|
|
31
32
|
export declare function getExtendInstructionDataEncoder(): Encoder<ExtendInstructionDataArgs>;
|
|
32
33
|
export declare function getExtendInstructionDataDecoder(): Decoder<ExtendInstructionData>;
|
|
33
34
|
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
|
+
export type ExtendInput<TAccountJob extends string = string, TAccountMarket extends string = string, TAccountUser extends string = string, TAccountVault extends string = string, TAccountRewardsReflection extends string = string, TAccountRewardsVault extends string = string, TAccountAuthority extends string = string, TAccountPayer extends string = string, TAccountRewardsProgram extends string = string, TAccountTokenProgram extends string = string> = {
|
|
35
36
|
job: Address<TAccountJob>;
|
|
36
37
|
market: Address<TAccountMarket>;
|
|
37
38
|
user: Address<TAccountUser>;
|
|
@@ -39,13 +40,14 @@ export type ExtendInput<TAccountJob extends string = string, TAccountMarket exte
|
|
|
39
40
|
rewardsReflection: Address<TAccountRewardsReflection>;
|
|
40
41
|
rewardsVault: Address<TAccountRewardsVault>;
|
|
41
42
|
authority: TransactionSigner<TAccountAuthority>;
|
|
43
|
+
payer: TransactionSigner<TAccountPayer>;
|
|
42
44
|
rewardsProgram: Address<TAccountRewardsProgram>;
|
|
43
45
|
tokenProgram?: Address<TAccountTokenProgram>;
|
|
44
46
|
timeout: ExtendInstructionDataArgs['timeout'];
|
|
45
47
|
};
|
|
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?: {
|
|
48
|
+
export declare function getExtendInstruction<TAccountJob extends string, TAccountMarket extends string, TAccountUser extends string, TAccountVault extends string, TAccountRewardsReflection extends string, TAccountRewardsVault extends string, TAccountAuthority extends string, TAccountPayer extends string, TAccountRewardsProgram extends string, TAccountTokenProgram extends string, TProgramAddress extends Address = typeof NOSANA_JOBS_PROGRAM_ADDRESS>(input: ExtendInput<TAccountJob, TAccountMarket, TAccountUser, TAccountVault, TAccountRewardsReflection, TAccountRewardsVault, TAccountAuthority, TAccountPayer, TAccountRewardsProgram, TAccountTokenProgram>, config?: {
|
|
47
49
|
programAddress?: TProgramAddress;
|
|
48
|
-
}): ExtendInstruction<TProgramAddress, TAccountJob, TAccountMarket, TAccountUser, TAccountVault, TAccountRewardsReflection, TAccountRewardsVault, TAccountAuthority, TAccountRewardsProgram, TAccountTokenProgram>;
|
|
50
|
+
}): ExtendInstruction<TProgramAddress, TAccountJob, TAccountMarket, TAccountUser, TAccountVault, TAccountRewardsReflection, TAccountRewardsVault, TAccountAuthority, TAccountPayer, TAccountRewardsProgram, TAccountTokenProgram>;
|
|
49
51
|
export type ParsedExtendInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGRAM_ADDRESS, TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[]> = {
|
|
50
52
|
programAddress: Address<TProgram>;
|
|
51
53
|
accounts: {
|
|
@@ -56,8 +58,9 @@ export type ParsedExtendInstruction<TProgram extends string = typeof NOSANA_JOBS
|
|
|
56
58
|
rewardsReflection: TAccountMetas[4];
|
|
57
59
|
rewardsVault: TAccountMetas[5];
|
|
58
60
|
authority: TAccountMetas[6];
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
payer: TAccountMetas[7];
|
|
62
|
+
rewardsProgram: TAccountMetas[8];
|
|
63
|
+
tokenProgram: TAccountMetas[9];
|
|
61
64
|
};
|
|
62
65
|
data: ExtendInstructionData;
|
|
63
66
|
};
|
|
@@ -44,6 +44,7 @@ export function getExtendInstruction(input, config) {
|
|
|
44
44
|
},
|
|
45
45
|
rewardsVault: { value: input.rewardsVault ?? null, isWritable: true },
|
|
46
46
|
authority: { value: input.authority ?? null, isWritable: false },
|
|
47
|
+
payer: { value: input.payer ?? null, isWritable: false },
|
|
47
48
|
rewardsProgram: { value: input.rewardsProgram ?? null, isWritable: false },
|
|
48
49
|
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
49
50
|
};
|
|
@@ -65,6 +66,7 @@ export function getExtendInstruction(input, config) {
|
|
|
65
66
|
getAccountMeta(accounts.rewardsReflection),
|
|
66
67
|
getAccountMeta(accounts.rewardsVault),
|
|
67
68
|
getAccountMeta(accounts.authority),
|
|
69
|
+
getAccountMeta(accounts.payer),
|
|
68
70
|
getAccountMeta(accounts.rewardsProgram),
|
|
69
71
|
getAccountMeta(accounts.tokenProgram),
|
|
70
72
|
],
|
|
@@ -74,7 +76,7 @@ export function getExtendInstruction(input, config) {
|
|
|
74
76
|
return instruction;
|
|
75
77
|
}
|
|
76
78
|
export function parseExtendInstruction(instruction) {
|
|
77
|
-
if (instruction.accounts.length <
|
|
79
|
+
if (instruction.accounts.length < 10) {
|
|
78
80
|
// TODO: Coded error.
|
|
79
81
|
throw new Error('Not enough accounts');
|
|
80
82
|
}
|
|
@@ -94,6 +96,7 @@ export function parseExtendInstruction(instruction) {
|
|
|
94
96
|
rewardsReflection: getNextAccount(),
|
|
95
97
|
rewardsVault: getNextAccount(),
|
|
96
98
|
authority: getNextAccount(),
|
|
99
|
+
payer: getNextAccount(),
|
|
97
100
|
rewardsProgram: getNextAccount(),
|
|
98
101
|
tokenProgram: getNextAccount(),
|
|
99
102
|
},
|
|
@@ -9,15 +9,15 @@ import { type Address, type Codec, type Decoder, type Encoder, type IAccountMeta
|
|
|
9
9
|
import { NOSANA_JOBS_PROGRAM_ADDRESS } from '../programs';
|
|
10
10
|
export declare const FINISH_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
11
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,
|
|
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, TAccountPayerRun extends string | IAccountMeta<string> = string, TAccountPayerJob 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
13
|
TAccountJob extends string ? WritableAccount<TAccountJob> : TAccountJob,
|
|
14
14
|
TAccountRun extends string ? WritableAccount<TAccountRun> : TAccountRun,
|
|
15
15
|
TAccountMarket extends string ? ReadonlyAccount<TAccountMarket> : TAccountMarket,
|
|
16
16
|
TAccountVault extends string ? WritableAccount<TAccountVault> : TAccountVault,
|
|
17
17
|
TAccountDeposit extends string ? WritableAccount<TAccountDeposit> : TAccountDeposit,
|
|
18
18
|
TAccountUser extends string ? WritableAccount<TAccountUser> : TAccountUser,
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
TAccountPayerRun extends string ? WritableAccount<TAccountPayerRun> : TAccountPayerRun,
|
|
20
|
+
TAccountPayerJob extends string ? WritableAccount<TAccountPayerJob> : TAccountPayerJob,
|
|
21
21
|
TAccountAuthority extends string ? ReadonlySignerAccount<TAccountAuthority> & IAccountSignerMeta<TAccountAuthority> : TAccountAuthority,
|
|
22
22
|
TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
|
|
23
23
|
...TRemainingAccounts
|
|
@@ -32,22 +32,22 @@ export type FinishInstructionDataArgs = {
|
|
|
32
32
|
export declare function getFinishInstructionDataEncoder(): Encoder<FinishInstructionDataArgs>;
|
|
33
33
|
export declare function getFinishInstructionDataDecoder(): Decoder<FinishInstructionData>;
|
|
34
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,
|
|
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, TAccountPayerRun extends string = string, TAccountPayerJob extends string = string, TAccountAuthority extends string = string, TAccountTokenProgram extends string = string> = {
|
|
36
36
|
job: Address<TAccountJob>;
|
|
37
37
|
run: Address<TAccountRun>;
|
|
38
38
|
market: Address<TAccountMarket>;
|
|
39
39
|
vault: Address<TAccountVault>;
|
|
40
40
|
deposit: Address<TAccountDeposit>;
|
|
41
41
|
user: Address<TAccountUser>;
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
payerRun: Address<TAccountPayerRun>;
|
|
43
|
+
payerJob: Address<TAccountPayerJob>;
|
|
44
44
|
authority: TransactionSigner<TAccountAuthority>;
|
|
45
45
|
tokenProgram?: Address<TAccountTokenProgram>;
|
|
46
46
|
ipfsResult: FinishInstructionDataArgs['ipfsResult'];
|
|
47
47
|
};
|
|
48
|
-
export declare function getFinishInstruction<TAccountJob extends string, TAccountRun extends string, TAccountMarket extends string, TAccountVault extends string, TAccountDeposit extends string, TAccountUser extends string,
|
|
48
|
+
export declare function getFinishInstruction<TAccountJob extends string, TAccountRun extends string, TAccountMarket extends string, TAccountVault extends string, TAccountDeposit extends string, TAccountUser extends string, TAccountPayerRun extends string, TAccountPayerJob extends string, TAccountAuthority extends string, TAccountTokenProgram extends string, TProgramAddress extends Address = typeof NOSANA_JOBS_PROGRAM_ADDRESS>(input: FinishInput<TAccountJob, TAccountRun, TAccountMarket, TAccountVault, TAccountDeposit, TAccountUser, TAccountPayerRun, TAccountPayerJob, TAccountAuthority, TAccountTokenProgram>, config?: {
|
|
49
49
|
programAddress?: TProgramAddress;
|
|
50
|
-
}): FinishInstruction<TProgramAddress, TAccountJob, TAccountRun, TAccountMarket, TAccountVault, TAccountDeposit, TAccountUser,
|
|
50
|
+
}): FinishInstruction<TProgramAddress, TAccountJob, TAccountRun, TAccountMarket, TAccountVault, TAccountDeposit, TAccountUser, TAccountPayerRun, TAccountPayerJob, TAccountAuthority, TAccountTokenProgram>;
|
|
51
51
|
export type ParsedFinishInstruction<TProgram extends string = typeof NOSANA_JOBS_PROGRAM_ADDRESS, TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[]> = {
|
|
52
52
|
programAddress: Address<TProgram>;
|
|
53
53
|
accounts: {
|
|
@@ -57,8 +57,8 @@ export type ParsedFinishInstruction<TProgram extends string = typeof NOSANA_JOBS
|
|
|
57
57
|
vault: TAccountMetas[3];
|
|
58
58
|
deposit: TAccountMetas[4];
|
|
59
59
|
user: TAccountMetas[5];
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
payerRun: TAccountMetas[6];
|
|
61
|
+
payerJob: TAccountMetas[7];
|
|
62
62
|
authority: TAccountMetas[8];
|
|
63
63
|
tokenProgram: TAccountMetas[9];
|
|
64
64
|
};
|
|
@@ -40,8 +40,8 @@ export function getFinishInstruction(input, config) {
|
|
|
40
40
|
vault: { value: input.vault ?? null, isWritable: true },
|
|
41
41
|
deposit: { value: input.deposit ?? null, isWritable: true },
|
|
42
42
|
user: { value: input.user ?? null, isWritable: true },
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
payerRun: { value: input.payerRun ?? null, isWritable: true },
|
|
44
|
+
payerJob: { value: input.payerJob ?? null, isWritable: true },
|
|
45
45
|
authority: { value: input.authority ?? null, isWritable: false },
|
|
46
46
|
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
47
47
|
};
|
|
@@ -62,8 +62,8 @@ export function getFinishInstruction(input, config) {
|
|
|
62
62
|
getAccountMeta(accounts.vault),
|
|
63
63
|
getAccountMeta(accounts.deposit),
|
|
64
64
|
getAccountMeta(accounts.user),
|
|
65
|
-
getAccountMeta(accounts.
|
|
66
|
-
getAccountMeta(accounts.
|
|
65
|
+
getAccountMeta(accounts.payerRun),
|
|
66
|
+
getAccountMeta(accounts.payerJob),
|
|
67
67
|
getAccountMeta(accounts.authority),
|
|
68
68
|
getAccountMeta(accounts.tokenProgram),
|
|
69
69
|
],
|
|
@@ -92,8 +92,8 @@ export function parseFinishInstruction(instruction) {
|
|
|
92
92
|
vault: getNextAccount(),
|
|
93
93
|
deposit: getNextAccount(),
|
|
94
94
|
user: getNextAccount(),
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
payerRun: getNextAccount(),
|
|
96
|
+
payerJob: getNextAccount(),
|
|
97
97
|
authority: getNextAccount(),
|
|
98
98
|
tokenProgram: getNextAccount(),
|
|
99
99
|
},
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @see https://github.com/codama-idl/codama
|
|
7
7
|
*/
|
|
8
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';
|
|
9
|
+
import { type ParsedAssignInstruction, 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
10
|
export declare const NOSANA_JOBS_PROGRAM_ADDRESS: Address<"nosJTmGQxvwXy23vng5UjkTbfv91Bzf9jEuro78dAGR">;
|
|
11
11
|
export declare enum NosanaJobsAccount {
|
|
12
12
|
MarketAccount = 0,
|
|
@@ -21,20 +21,21 @@ export declare enum NosanaJobsInstruction {
|
|
|
21
21
|
Update = 1,
|
|
22
22
|
Close = 2,
|
|
23
23
|
CloseAdmin = 3,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
Assign = 4,
|
|
25
|
+
List = 5,
|
|
26
|
+
Delist = 6,
|
|
27
|
+
Recover = 7,
|
|
28
|
+
Extend = 8,
|
|
29
|
+
End = 9,
|
|
30
|
+
Work = 10,
|
|
31
|
+
Stop = 11,
|
|
32
|
+
Claim = 12,
|
|
33
|
+
Complete = 13,
|
|
34
|
+
Finish = 14,
|
|
35
|
+
Quit = 15,
|
|
36
|
+
QuitAdmin = 16,
|
|
37
|
+
Clean = 17,
|
|
38
|
+
CleanAdmin = 18
|
|
38
39
|
}
|
|
39
40
|
export declare function identifyNosanaJobsInstruction(instruction: {
|
|
40
41
|
data: ReadonlyUint8Array;
|
|
@@ -48,6 +49,8 @@ export type ParsedNosanaJobsInstruction<TProgram extends string = 'nosJTmGQxvwXy
|
|
|
48
49
|
} & ParsedCloseInstruction<TProgram>) | ({
|
|
49
50
|
instructionType: NosanaJobsInstruction.CloseAdmin;
|
|
50
51
|
} & ParsedCloseAdminInstruction<TProgram>) | ({
|
|
52
|
+
instructionType: NosanaJobsInstruction.Assign;
|
|
53
|
+
} & ParsedAssignInstruction<TProgram>) | ({
|
|
51
54
|
instructionType: NosanaJobsInstruction.List;
|
|
52
55
|
} & ParsedListInstruction<TProgram>) | ({
|
|
53
56
|
instructionType: NosanaJobsInstruction.Delist;
|
|
@@ -32,20 +32,21 @@ export var NosanaJobsInstruction;
|
|
|
32
32
|
NosanaJobsInstruction[NosanaJobsInstruction["Update"] = 1] = "Update";
|
|
33
33
|
NosanaJobsInstruction[NosanaJobsInstruction["Close"] = 2] = "Close";
|
|
34
34
|
NosanaJobsInstruction[NosanaJobsInstruction["CloseAdmin"] = 3] = "CloseAdmin";
|
|
35
|
-
NosanaJobsInstruction[NosanaJobsInstruction["
|
|
36
|
-
NosanaJobsInstruction[NosanaJobsInstruction["
|
|
37
|
-
NosanaJobsInstruction[NosanaJobsInstruction["
|
|
38
|
-
NosanaJobsInstruction[NosanaJobsInstruction["
|
|
39
|
-
NosanaJobsInstruction[NosanaJobsInstruction["
|
|
40
|
-
NosanaJobsInstruction[NosanaJobsInstruction["
|
|
41
|
-
NosanaJobsInstruction[NosanaJobsInstruction["
|
|
42
|
-
NosanaJobsInstruction[NosanaJobsInstruction["
|
|
43
|
-
NosanaJobsInstruction[NosanaJobsInstruction["
|
|
44
|
-
NosanaJobsInstruction[NosanaJobsInstruction["
|
|
45
|
-
NosanaJobsInstruction[NosanaJobsInstruction["
|
|
46
|
-
NosanaJobsInstruction[NosanaJobsInstruction["
|
|
47
|
-
NosanaJobsInstruction[NosanaJobsInstruction["
|
|
48
|
-
NosanaJobsInstruction[NosanaJobsInstruction["
|
|
35
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Assign"] = 4] = "Assign";
|
|
36
|
+
NosanaJobsInstruction[NosanaJobsInstruction["List"] = 5] = "List";
|
|
37
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Delist"] = 6] = "Delist";
|
|
38
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Recover"] = 7] = "Recover";
|
|
39
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Extend"] = 8] = "Extend";
|
|
40
|
+
NosanaJobsInstruction[NosanaJobsInstruction["End"] = 9] = "End";
|
|
41
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Work"] = 10] = "Work";
|
|
42
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Stop"] = 11] = "Stop";
|
|
43
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Claim"] = 12] = "Claim";
|
|
44
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Complete"] = 13] = "Complete";
|
|
45
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Finish"] = 14] = "Finish";
|
|
46
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Quit"] = 15] = "Quit";
|
|
47
|
+
NosanaJobsInstruction[NosanaJobsInstruction["QuitAdmin"] = 16] = "QuitAdmin";
|
|
48
|
+
NosanaJobsInstruction[NosanaJobsInstruction["Clean"] = 17] = "Clean";
|
|
49
|
+
NosanaJobsInstruction[NosanaJobsInstruction["CleanAdmin"] = 18] = "CleanAdmin";
|
|
49
50
|
})(NosanaJobsInstruction || (NosanaJobsInstruction = {}));
|
|
50
51
|
export function identifyNosanaJobsInstruction(instruction) {
|
|
51
52
|
const data = 'data' in instruction ? instruction.data : instruction;
|
|
@@ -61,6 +62,9 @@ export function identifyNosanaJobsInstruction(instruction) {
|
|
|
61
62
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([202, 182, 185, 142, 208, 161, 145, 189])), 0)) {
|
|
62
63
|
return NosanaJobsInstruction.CloseAdmin;
|
|
63
64
|
}
|
|
65
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([73, 66, 125, 203, 81, 41, 64, 135])), 0)) {
|
|
66
|
+
return NosanaJobsInstruction.Assign;
|
|
67
|
+
}
|
|
64
68
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([54, 174, 193, 67, 17, 41, 132, 38])), 0)) {
|
|
65
69
|
return NosanaJobsInstruction.List;
|
|
66
70
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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 './settingsAccount';
|
|
9
|
+
export * from './stakeAccount';
|
|
@@ -0,0 +1,9 @@
|
|
|
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 './settingsAccount';
|
|
9
|
+
export * from './stakeAccount';
|
|
@@ -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 { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type Codec, type Decoder, type EncodedAccount, type Encoder, type FetchAccountConfig, type FetchAccountsConfig, type MaybeAccount, type MaybeEncodedAccount, type ReadonlyUint8Array } from '@solana/kit';
|
|
9
|
+
export declare const SETTINGS_ACCOUNT_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
10
|
+
export declare function getSettingsAccountDiscriminatorBytes(): ReadonlyUint8Array;
|
|
11
|
+
export type SettingsAccount = {
|
|
12
|
+
discriminator: ReadonlyUint8Array;
|
|
13
|
+
authority: Address;
|
|
14
|
+
tokenAccount: Address;
|
|
15
|
+
};
|
|
16
|
+
export type SettingsAccountArgs = {
|
|
17
|
+
authority: Address;
|
|
18
|
+
tokenAccount: Address;
|
|
19
|
+
};
|
|
20
|
+
export declare function getSettingsAccountEncoder(): Encoder<SettingsAccountArgs>;
|
|
21
|
+
export declare function getSettingsAccountDecoder(): Decoder<SettingsAccount>;
|
|
22
|
+
export declare function getSettingsAccountCodec(): Codec<SettingsAccountArgs, SettingsAccount>;
|
|
23
|
+
export declare function decodeSettingsAccount<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<SettingsAccount, TAddress>;
|
|
24
|
+
export declare function decodeSettingsAccount<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<SettingsAccount, TAddress>;
|
|
25
|
+
export declare function fetchSettingsAccount<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<SettingsAccount, TAddress>>;
|
|
26
|
+
export declare function fetchMaybeSettingsAccount<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<SettingsAccount, TAddress>>;
|
|
27
|
+
export declare function fetchAllSettingsAccount(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<SettingsAccount>[]>;
|
|
28
|
+
export declare function fetchAllMaybeSettingsAccount(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<SettingsAccount>[]>;
|
|
29
|
+
export declare function getSettingsAccountSize(): number;
|