UNPKG

@nosana/kit

Version:

Nosana KIT

110 lines 5.49 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 { containsBytes, fixEncoderSize, getBytesEncoder, } from '@solana/kit'; export const NOSANA_JOBS_PROGRAM_ADDRESS = ''; export const NosanaJobsAccount = { MarketAccount: "MarketAccount", JobAccount: "JobAccount", RunAccount: "RunAccount", }; export function identifyNosanaJobsAccount(account) { const data = 'data' in account ? account.data : account; if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([201, 78, 187, 225, 240, 198, 201, 251])), 0)) { return NosanaJobsAccount.MarketAccount; } if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([91, 16, 162, 5, 45, 210, 125, 65])), 0)) { return NosanaJobsAccount.JobAccount; } if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([194, 169, 110, 230, 235, 11, 225, 22])), 0)) { return NosanaJobsAccount.RunAccount; } throw new Error('The provided account could not be identified as a nosanaJobs account.'); } export const NosanaJobsInstruction = { Open: "Open", Update: "Update", Close: "Close", CloseAdmin: "CloseAdmin", Assign: "Assign", List: "List", Delist: "Delist", Recover: "Recover", Extend: "Extend", End: "End", Work: "Work", Stop: "Stop", Claim: "Claim", Complete: "Complete", Finish: "Finish", Quit: "Quit", QuitAdmin: "QuitAdmin", Clean: "Clean", CleanAdmin: "CleanAdmin", }; export function identifyNosanaJobsInstruction(instruction) { const data = 'data' in instruction ? instruction.data : instruction; if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([228, 220, 155, 71, 199, 189, 60, 45])), 0)) { return NosanaJobsInstruction.Open; } if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([219, 200, 88, 176, 158, 63, 253, 127])), 0)) { return NosanaJobsInstruction.Update; } if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([98, 165, 201, 177, 108, 65, 206, 96])), 0)) { return NosanaJobsInstruction.Close; } if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([202, 182, 185, 142, 208, 161, 145, 189])), 0)) { return NosanaJobsInstruction.CloseAdmin; } if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([73, 66, 125, 203, 81, 41, 64, 135])), 0)) { return NosanaJobsInstruction.Assign; } if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([54, 174, 193, 67, 17, 41, 132, 38])), 0)) { return NosanaJobsInstruction.List; } if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([55, 136, 205, 107, 107, 173, 4, 31])), 0)) { return NosanaJobsInstruction.Delist; } if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([108, 216, 38, 58, 109, 146, 116, 17])), 0)) { return NosanaJobsInstruction.Recover; } if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([228, 127, 0, 1, 227, 154, 54, 168])), 0)) { return NosanaJobsInstruction.Extend; } if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([180, 160, 249, 217, 194, 121, 70, 16])), 0)) { return NosanaJobsInstruction.End; } if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([15, 67, 45, 195, 215, 137, 229, 47])), 0)) { return NosanaJobsInstruction.Work; } if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([42, 133, 32, 60, 171, 253, 184, 155])), 0)) { return NosanaJobsInstruction.Stop; } if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([62, 198, 214, 193, 213, 159, 108, 210])), 0)) { return NosanaJobsInstruction.Claim; } if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([0, 77, 224, 147, 136, 25, 88, 76])), 0)) { return NosanaJobsInstruction.Complete; } if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([67, 74, 170, 132, 125, 233, 182, 37])), 0)) { return NosanaJobsInstruction.Finish; } if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([191, 103, 141, 240, 80, 129, 103, 153])), 0)) { return NosanaJobsInstruction.Quit; } if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([103, 238, 110, 8, 182, 20, 56, 196])), 0)) { return NosanaJobsInstruction.QuitAdmin; } if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([250, 191, 56, 128, 150, 251, 1, 103])), 0)) { return NosanaJobsInstruction.Clean; } if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([245, 90, 188, 68, 253, 235, 171, 105])), 0)) { return NosanaJobsInstruction.CleanAdmin; } throw new Error('The provided instruction could not be identified as a nosanaJobs instruction.'); } //# sourceMappingURL=nosanaJobs.js.map