UNPKG

@nosana/kit

Version:

Nosana KIT

81 lines 5.31 kB
/** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ import { isProgramError, } from '@solana/kit'; import { NOSANA_JOBS_PROGRAM_ADDRESS } from '../programs/index.js'; /** InvalidMarketAccount: This market account is not valid. */ export const NOSANA_JOBS_ERROR__INVALID_MARKET_ACCOUNT = 0x1770; // 6000 /** MarketInWrongState: This market does not have the right status. */ export const NOSANA_JOBS_ERROR__MARKET_IN_WRONG_STATE = 0x1771; // 6001 /** NotInMarketQueue: Account cannot be find account in market queue. */ export const NOSANA_JOBS_ERROR__NOT_IN_MARKET_QUEUE = 0x1772; // 6002 /** InvalidJobAccount: This job account is not valid. */ export const NOSANA_JOBS_ERROR__INVALID_JOB_ACCOUNT = 0x1773; // 6003 /** JobInWrongState: This job does not have the right status. */ export const NOSANA_JOBS_ERROR__JOB_IN_WRONG_STATE = 0x1774; // 6004 /** JobNotExpired: The job has not yet expired. */ export const NOSANA_JOBS_ERROR__JOB_NOT_EXPIRED = 0x1775; // 6005 /** JobResultNull: The job result can not be null. */ export const NOSANA_JOBS_ERROR__JOB_RESULT_NULL = 0x1776; // 6006 /** JobInvalidProject: The job has a different project owner. */ export const NOSANA_JOBS_ERROR__JOB_INVALID_PROJECT = 0x1777; // 6007 /** JobTimeoutNotGreater: The new job timeout should be larger than the current one. */ export const NOSANA_JOBS_ERROR__JOB_TIMEOUT_NOT_GREATER = 0x1778; // 6008 /** JobInvalidRunAccount: The run account does not match the job. */ export const NOSANA_JOBS_ERROR__JOB_INVALID_RUN_ACCOUNT = 0x1779; // 6009 /** JobResultsAlreadySet: The job results are already set. */ export const NOSANA_JOBS_ERROR__JOB_RESULTS_ALREADY_SET = 0x177a; // 6010 /** NodeQueueDoesNotMatch: This node queue does not match. */ export const NOSANA_JOBS_ERROR__NODE_QUEUE_DOES_NOT_MATCH = 0x177b; // 6011 /** NodeStakeUnauthorized: This node is not authorizing this stake. */ export const NOSANA_JOBS_ERROR__NODE_STAKE_UNAUTHORIZED = 0x177c; // 6012 /** NodeNotEnoughStake: This node has not staked enough tokens. */ export const NOSANA_JOBS_ERROR__NODE_NOT_ENOUGH_STAKE = 0x177d; // 6013 /** NodeAlreadyQueued: This node is already present in the queue. */ export const NOSANA_JOBS_ERROR__NODE_ALREADY_QUEUED = 0x177e; // 6014 /** NodeNftWrongMetadata: This metadata does not have the correct address. */ export const NOSANA_JOBS_ERROR__NODE_NFT_WRONG_METADATA = 0x177f; // 6015 /** NodeNftWrongOwner: This NFT is not owned by this node. */ export const NOSANA_JOBS_ERROR__NODE_NFT_WRONG_OWNER = 0x1780; // 6016 /** NodeNftInvalidAmount: Access NFT amount cannot be 0. */ export const NOSANA_JOBS_ERROR__NODE_NFT_INVALID_AMOUNT = 0x1781; // 6017 /** NodeKeyInvalidCollection: This access key does not belong to a verified collection. */ export const NOSANA_JOBS_ERROR__NODE_KEY_INVALID_COLLECTION = 0x1782; // 6018 let nosanaJobsErrorMessages; if (process.env.NODE_ENV !== 'production') { nosanaJobsErrorMessages = { [NOSANA_JOBS_ERROR__INVALID_JOB_ACCOUNT]: `This job account is not valid.`, [NOSANA_JOBS_ERROR__INVALID_MARKET_ACCOUNT]: `This market account is not valid.`, [NOSANA_JOBS_ERROR__JOB_INVALID_PROJECT]: `The job has a different project owner.`, [NOSANA_JOBS_ERROR__JOB_INVALID_RUN_ACCOUNT]: `The run account does not match the job.`, [NOSANA_JOBS_ERROR__JOB_IN_WRONG_STATE]: `This job does not have the right status.`, [NOSANA_JOBS_ERROR__JOB_NOT_EXPIRED]: `The job has not yet expired.`, [NOSANA_JOBS_ERROR__JOB_RESULT_NULL]: `The job result can not be null.`, [NOSANA_JOBS_ERROR__JOB_RESULTS_ALREADY_SET]: `The job results are already set.`, [NOSANA_JOBS_ERROR__JOB_TIMEOUT_NOT_GREATER]: `The new job timeout should be larger than the current one.`, [NOSANA_JOBS_ERROR__MARKET_IN_WRONG_STATE]: `This market does not have the right status.`, [NOSANA_JOBS_ERROR__NODE_ALREADY_QUEUED]: `This node is already present in the queue.`, [NOSANA_JOBS_ERROR__NODE_KEY_INVALID_COLLECTION]: `This access key does not belong to a verified collection.`, [NOSANA_JOBS_ERROR__NODE_NFT_INVALID_AMOUNT]: `Access NFT amount cannot be 0.`, [NOSANA_JOBS_ERROR__NODE_NFT_WRONG_METADATA]: `This metadata does not have the correct address.`, [NOSANA_JOBS_ERROR__NODE_NFT_WRONG_OWNER]: `This NFT is not owned by this node.`, [NOSANA_JOBS_ERROR__NODE_NOT_ENOUGH_STAKE]: `This node has not staked enough tokens.`, [NOSANA_JOBS_ERROR__NODE_QUEUE_DOES_NOT_MATCH]: `This node queue does not match.`, [NOSANA_JOBS_ERROR__NODE_STAKE_UNAUTHORIZED]: `This node is not authorizing this stake.`, [NOSANA_JOBS_ERROR__NOT_IN_MARKET_QUEUE]: `Account cannot be find account in market queue.`, }; } export function getNosanaJobsErrorMessage(code) { if (process.env.NODE_ENV !== 'production') { return nosanaJobsErrorMessages[code]; } return 'Error message not available in production bundles.'; } export function isNosanaJobsError(error, transactionMessage, code) { return isProgramError(error, transactionMessage, NOSANA_JOBS_PROGRAM_ADDRESS, code); } //# sourceMappingURL=nosanaJobs.js.map