UNPKG

@nosana/kit

Version:

Nosana KIT

108 lines (107 loc) 6.55 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 = 'nosJTmGQxvwXy23vng5UjkTbfv91Bzf9jEuro78dAGR'; export var NosanaJobsAccount; (function (NosanaJobsAccount) { NosanaJobsAccount[NosanaJobsAccount["MarketAccount"] = 0] = "MarketAccount"; NosanaJobsAccount[NosanaJobsAccount["JobAccount"] = 1] = "JobAccount"; NosanaJobsAccount[NosanaJobsAccount["RunAccount"] = 2] = "RunAccount"; })(NosanaJobsAccount || (NosanaJobsAccount = {})); 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 var NosanaJobsInstruction; (function (NosanaJobsInstruction) { NosanaJobsInstruction[NosanaJobsInstruction["Open"] = 0] = "Open"; NosanaJobsInstruction[NosanaJobsInstruction["Update"] = 1] = "Update"; NosanaJobsInstruction[NosanaJobsInstruction["Close"] = 2] = "Close"; NosanaJobsInstruction[NosanaJobsInstruction["CloseAdmin"] = 3] = "CloseAdmin"; NosanaJobsInstruction[NosanaJobsInstruction["List"] = 4] = "List"; NosanaJobsInstruction[NosanaJobsInstruction["Delist"] = 5] = "Delist"; NosanaJobsInstruction[NosanaJobsInstruction["Recover"] = 6] = "Recover"; NosanaJobsInstruction[NosanaJobsInstruction["Extend"] = 7] = "Extend"; NosanaJobsInstruction[NosanaJobsInstruction["End"] = 8] = "End"; NosanaJobsInstruction[NosanaJobsInstruction["Work"] = 9] = "Work"; NosanaJobsInstruction[NosanaJobsInstruction["Stop"] = 10] = "Stop"; NosanaJobsInstruction[NosanaJobsInstruction["Claim"] = 11] = "Claim"; NosanaJobsInstruction[NosanaJobsInstruction["Complete"] = 12] = "Complete"; NosanaJobsInstruction[NosanaJobsInstruction["Finish"] = 13] = "Finish"; NosanaJobsInstruction[NosanaJobsInstruction["Quit"] = 14] = "Quit"; NosanaJobsInstruction[NosanaJobsInstruction["QuitAdmin"] = 15] = "QuitAdmin"; NosanaJobsInstruction[NosanaJobsInstruction["Clean"] = 16] = "Clean"; NosanaJobsInstruction[NosanaJobsInstruction["CleanAdmin"] = 17] = "CleanAdmin"; })(NosanaJobsInstruction || (NosanaJobsInstruction = {})); 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([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.'); }