/** * 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 { addDecoderSizePrefix, addEncoderSizePrefix, combineCodec, getOptionDecoder, getOptionEncoder, getStructDecoder, getStructEncoder, getU16Decoder, getU16Encoder, getU32Decoder, getU32Encoder, getU8Decoder, getU8Encoder, getUtf8Decoder, getUtf8Encoder, type Codec, type Decoder, type Encoder, type Option, type OptionOrNullable, } from "@solana/kit"; export type DataV2 = { /** The name of the asset */ name: string; /** The symbol for the asset */ symbol: string; /** URI pointing to JSON representing the asset */ uri: string; /** * Royalty basis points that goes to creators in secondary sales * (0-10000) */ sellerFeeBasisPoints: number; /** UNUSED Array of creators, optional */ creators: Option; /** UNUSED Collection */ collection: Option; /** UNUSED Uses */ uses: Option; }; export type DataV2Args = { /** The name of the asset */ name: string; /** The symbol for the asset */ symbol: string; /** URI pointing to JSON representing the asset */ uri: string; /** * Royalty basis points that goes to creators in secondary sales * (0-10000) */ sellerFeeBasisPoints: number; /** UNUSED Array of creators, optional */ creators: OptionOrNullable; /** UNUSED Collection */ collection: OptionOrNullable; /** UNUSED Uses */ uses: OptionOrNullable; }; export function getDataV2Encoder(): Encoder { return getStructEncoder([ ["name", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())], ["symbol", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())], ["uri", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())], ["sellerFeeBasisPoints", getU16Encoder()], ["creators", getOptionEncoder(getU8Encoder())], ["collection", getOptionEncoder(getU8Encoder())], ["uses", getOptionEncoder(getU8Encoder())], ]); } export function getDataV2Decoder(): Decoder { return getStructDecoder([ ["name", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())], ["symbol", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())], ["uri", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())], ["sellerFeeBasisPoints", getU16Decoder()], ["creators", getOptionDecoder(getU8Decoder())], ["collection", getOptionDecoder(getU8Decoder())], ["uses", getOptionDecoder(getU8Decoder())], ]); } export function getDataV2Codec(): Codec { return combineCodec(getDataV2Encoder(), getDataV2Decoder()); }