/** * This code was GENERATED using the solita package. * Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality. * * See: https://github.com/metaplex-foundation/solita */ import * as web3 from '@solana/web3.js' import * as beet from '@convergence-rfq/beet' import * as beetSolana from '@convergence-rfq/beet-solana' /** * This type is used to derive the {@link CustomOptionalPubkey} type as well as the de/serializer. * However don't refer to it in your code but use the {@link CustomOptionalPubkey} type instead. * * @category userTypes * @category enums * @category generated * @private */ export type CustomOptionalPubkeyRecord = { Some: { value: beet.COption } None: void /* scalar variant */ } /** * Union type respresenting the CustomOptionalPubkey data enum defined in Rust. * * NOTE: that it includes a `__kind` property which allows to narrow types in * switch/if statements. * Additionally `isCustomOptionalPubkey*` type guards are exposed below to narrow to a specific variant. * * @category userTypes * @category enums * @category generated */ export type CustomOptionalPubkey = beet.DataEnumKeyAsKind export const isCustomOptionalPubkeySome = ( x: CustomOptionalPubkey ): x is CustomOptionalPubkey & { __kind: 'Some' } => x.__kind === 'Some' export const isCustomOptionalPubkeyNone = ( x: CustomOptionalPubkey ): x is CustomOptionalPubkey & { __kind: 'None' } => x.__kind === 'None' /** * @category userTypes * @category generated */ export const customOptionalPubkeyBeet = beet.dataEnum([ [ 'Some', new beet.FixableBeetArgsStruct( [['value', beet.coption(beetSolana.publicKey)]], 'CustomOptionalPubkeyRecord["Some"]' ), ], ['None', beet.unit], ]) as beet.FixableBeet