generated from metaplex-foundation/solana-project-template
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
363 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
clients/js/src/generated/types/externalValidationResult.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* This code was AUTOGENERATED using the kinobi library. | ||
* Please DO NOT EDIT THIS FILE, instead use visitors | ||
* to add features, then rerun kinobi to update it. | ||
* | ||
* @see https://github.com/metaplex-foundation/kinobi | ||
*/ | ||
|
||
import { Serializer, scalarEnum } from '@metaplex-foundation/umi/serializers'; | ||
|
||
export enum ExternalValidationResult { | ||
Approved, | ||
Rejected, | ||
Pass, | ||
} | ||
|
||
export type ExternalValidationResultArgs = ExternalValidationResult; | ||
|
||
export function getExternalValidationResultSerializer(): Serializer< | ||
ExternalValidationResultArgs, | ||
ExternalValidationResult | ||
> { | ||
return scalarEnum<ExternalValidationResult>(ExternalValidationResult, { | ||
description: 'ExternalValidationResult', | ||
}) as Serializer<ExternalValidationResultArgs, ExternalValidationResult>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/** | ||
* This code was AUTOGENERATED using the kinobi library. | ||
* Please DO NOT EDIT THIS FILE, instead use visitors | ||
* to add features, then rerun kinobi to update it. | ||
* | ||
* @see https://github.com/metaplex-foundation/kinobi | ||
*/ | ||
|
||
import { | ||
GetDataEnumKind, | ||
GetDataEnumKindContent, | ||
Serializer, | ||
dataEnum, | ||
struct, | ||
} from '@metaplex-foundation/umi/serializers'; | ||
import { | ||
ExternalValidationResult, | ||
ExternalValidationResultArgs, | ||
getExternalValidationResultSerializer, | ||
} from '.'; | ||
|
||
export type OracleValidation = { | ||
__kind: 'V1'; | ||
create: ExternalValidationResult; | ||
transfer: ExternalValidationResult; | ||
burn: ExternalValidationResult; | ||
update: ExternalValidationResult; | ||
}; | ||
|
||
export type OracleValidationArgs = { | ||
__kind: 'V1'; | ||
create: ExternalValidationResultArgs; | ||
transfer: ExternalValidationResultArgs; | ||
burn: ExternalValidationResultArgs; | ||
update: ExternalValidationResultArgs; | ||
}; | ||
|
||
export function getOracleValidationSerializer(): Serializer< | ||
OracleValidationArgs, | ||
OracleValidation | ||
> { | ||
return dataEnum<OracleValidation>( | ||
[ | ||
[ | ||
'V1', | ||
struct<GetDataEnumKindContent<OracleValidation, 'V1'>>([ | ||
['create', getExternalValidationResultSerializer()], | ||
['transfer', getExternalValidationResultSerializer()], | ||
['burn', getExternalValidationResultSerializer()], | ||
['update', getExternalValidationResultSerializer()], | ||
]), | ||
], | ||
], | ||
{ description: 'OracleValidation' } | ||
) as Serializer<OracleValidationArgs, OracleValidation>; | ||
} | ||
|
||
// Data Enum Helpers. | ||
export function oracleValidation( | ||
kind: 'V1', | ||
data: GetDataEnumKindContent<OracleValidationArgs, 'V1'> | ||
): GetDataEnumKind<OracleValidationArgs, 'V1'>; | ||
export function oracleValidation<K extends OracleValidationArgs['__kind']>( | ||
kind: K, | ||
data?: any | ||
): Extract<OracleValidationArgs, { __kind: K }> { | ||
return Array.isArray(data) | ||
? { __kind: kind, fields: data } | ||
: { __kind: kind, ...(data ?? {}) }; | ||
} | ||
export function isOracleValidation<K extends OracleValidation['__kind']>( | ||
kind: K, | ||
value: OracleValidation | ||
): value is OracleValidation & { __kind: K } { | ||
return value.__kind === kind; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/** | ||
* This code was AUTOGENERATED using the kinobi library. | ||
* Please DO NOT EDIT THIS FILE, instead use visitors | ||
* to add features, then rerun kinobi to update it. | ||
* | ||
* @see https://github.com/metaplex-foundation/kinobi | ||
*/ | ||
|
||
import { | ||
GetDataEnumKind, | ||
GetDataEnumKindContent, | ||
Serializer, | ||
dataEnum, | ||
struct, | ||
tuple, | ||
u64, | ||
unit, | ||
} from '@metaplex-foundation/umi/serializers'; | ||
|
||
export type ValidationResultsOffset = | ||
| { __kind: 'NoOffset' } | ||
| { __kind: 'Anchor' } | ||
| { __kind: 'Custom'; fields: [bigint] }; | ||
|
||
export type ValidationResultsOffsetArgs = | ||
| { __kind: 'NoOffset' } | ||
| { __kind: 'Anchor' } | ||
| { __kind: 'Custom'; fields: [number | bigint] }; | ||
|
||
export function getValidationResultsOffsetSerializer(): Serializer< | ||
ValidationResultsOffsetArgs, | ||
ValidationResultsOffset | ||
> { | ||
return dataEnum<ValidationResultsOffset>( | ||
[ | ||
['NoOffset', unit()], | ||
['Anchor', unit()], | ||
[ | ||
'Custom', | ||
struct<GetDataEnumKindContent<ValidationResultsOffset, 'Custom'>>([ | ||
['fields', tuple([u64()])], | ||
]), | ||
], | ||
], | ||
{ description: 'ValidationResultsOffset' } | ||
) as Serializer<ValidationResultsOffsetArgs, ValidationResultsOffset>; | ||
} | ||
|
||
// Data Enum Helpers. | ||
export function validationResultsOffset( | ||
kind: 'NoOffset' | ||
): GetDataEnumKind<ValidationResultsOffsetArgs, 'NoOffset'>; | ||
export function validationResultsOffset( | ||
kind: 'Anchor' | ||
): GetDataEnumKind<ValidationResultsOffsetArgs, 'Anchor'>; | ||
export function validationResultsOffset( | ||
kind: 'Custom', | ||
data: GetDataEnumKindContent<ValidationResultsOffsetArgs, 'Custom'>['fields'] | ||
): GetDataEnumKind<ValidationResultsOffsetArgs, 'Custom'>; | ||
export function validationResultsOffset< | ||
K extends ValidationResultsOffsetArgs['__kind'], | ||
>(kind: K, data?: any): Extract<ValidationResultsOffsetArgs, { __kind: K }> { | ||
return Array.isArray(data) | ||
? { __kind: kind, fields: data } | ||
: { __kind: kind, ...(data ?? {}) }; | ||
} | ||
export function isValidationResultsOffset< | ||
K extends ValidationResultsOffset['__kind'], | ||
>( | ||
kind: K, | ||
value: ValidationResultsOffset | ||
): value is ValidationResultsOffset & { __kind: K } { | ||
return value.__kind === kind; | ||
} |
20 changes: 20 additions & 0 deletions
20
clients/rust/src/generated/types/external_validation_result.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//! This code was AUTOGENERATED using the kinobi library. | ||
//! Please DO NOT EDIT THIS FILE, instead use visitors | ||
//! to add features, then rerun kinobi to update it. | ||
//! | ||
//! [https://github.com/metaplex-foundation/kinobi] | ||
//! | ||
use borsh::BorshDeserialize; | ||
use borsh::BorshSerialize; | ||
use num_derive::FromPrimitive; | ||
|
||
#[derive( | ||
BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Hash, FromPrimitive, | ||
)] | ||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] | ||
pub enum ExternalValidationResult { | ||
Approved, | ||
Rejected, | ||
Pass, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.