Skip to content

Commit

Permalink
Regenerate IDL and clients
Browse files Browse the repository at this point in the history
  • Loading branch information
danenbm committed Apr 24, 2024
1 parent e4b41b4 commit db1deb2
Show file tree
Hide file tree
Showing 15 changed files with 363 additions and 0 deletions.
6 changes: 6 additions & 0 deletions clients/js/src/generated/types/baseOracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,22 @@ import {
import {
BaseExtraAccount,
BaseExtraAccountArgs,
ValidationResultsOffset,
ValidationResultsOffsetArgs,
getBaseExtraAccountSerializer,
getValidationResultsOffsetSerializer,
} from '.';

export type BaseOracle = {
baseAddress: PublicKey;
pda: Option<BaseExtraAccount>;
resultsOffset: ValidationResultsOffset;
};

export type BaseOracleArgs = {
baseAddress: PublicKey;
pda: OptionOrNullable<BaseExtraAccountArgs>;
resultsOffset: ValidationResultsOffsetArgs;
};

export function getBaseOracleSerializer(): Serializer<
Expand All @@ -37,6 +42,7 @@ export function getBaseOracleSerializer(): Serializer<
[
['baseAddress', publicKeySerializer()],
['pda', option(getBaseExtraAccountSerializer())],
['resultsOffset', getValidationResultsOffsetSerializer()],
],
{ description: 'BaseOracle' }
) as Serializer<BaseOracleArgs, BaseOracle>;
Expand Down
6 changes: 6 additions & 0 deletions clients/js/src/generated/types/baseOracleInitInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,21 @@ import {
ExternalCheckResultArgs,
HookableLifecycleEvent,
HookableLifecycleEventArgs,
ValidationResultsOffset,
ValidationResultsOffsetArgs,
getBaseExtraAccountSerializer,
getBasePluginAuthoritySerializer,
getExternalCheckResultSerializer,
getHookableLifecycleEventSerializer,
getValidationResultsOffsetSerializer,
} from '.';

export type BaseOracleInitInfo = {
baseAddress: PublicKey;
initPluginAuthority: Option<BasePluginAuthority>;
lifecycleChecks: Option<Array<[HookableLifecycleEvent, ExternalCheckResult]>>;
pda: Option<BaseExtraAccount>;
resultsOffset: Option<ValidationResultsOffset>;
};

export type BaseOracleInitInfoArgs = {
Expand All @@ -44,6 +48,7 @@ export type BaseOracleInitInfoArgs = {
Array<[HookableLifecycleEventArgs, ExternalCheckResultArgs]>
>;
pda: OptionOrNullable<BaseExtraAccountArgs>;
resultsOffset: OptionOrNullable<ValidationResultsOffsetArgs>;
};

export function getBaseOracleInitInfoSerializer(): Serializer<
Expand All @@ -66,6 +71,7 @@ export function getBaseOracleInitInfoSerializer(): Serializer<
),
],
['pda', option(getBaseExtraAccountSerializer())],
['resultsOffset', option(getValidationResultsOffsetSerializer())],
],
{ description: 'BaseOracleInitInfo' }
) as Serializer<BaseOracleInitInfoArgs, BaseOracleInitInfo>;
Expand Down
6 changes: 6 additions & 0 deletions clients/js/src/generated/types/baseOracleUpdateInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,26 @@ import {
ExternalCheckResultArgs,
HookableLifecycleEvent,
HookableLifecycleEventArgs,
ValidationResultsOffset,
ValidationResultsOffsetArgs,
getBaseExtraAccountSerializer,
getExternalCheckResultSerializer,
getHookableLifecycleEventSerializer,
getValidationResultsOffsetSerializer,
} from '.';

export type BaseOracleUpdateInfo = {
lifecycleChecks: Option<Array<[HookableLifecycleEvent, ExternalCheckResult]>>;
pda: Option<BaseExtraAccount>;
resultsOffset: Option<ValidationResultsOffset>;
};

export type BaseOracleUpdateInfoArgs = {
lifecycleChecks: OptionOrNullable<
Array<[HookableLifecycleEventArgs, ExternalCheckResultArgs]>
>;
pda: OptionOrNullable<BaseExtraAccountArgs>;
resultsOffset: OptionOrNullable<ValidationResultsOffsetArgs>;
};

export function getBaseOracleUpdateInfoSerializer(): Serializer<
Expand All @@ -56,6 +61,7 @@ export function getBaseOracleUpdateInfoSerializer(): Serializer<
),
],
['pda', option(getBaseExtraAccountSerializer())],
['resultsOffset', option(getValidationResultsOffsetSerializer())],
],
{ description: 'BaseOracleUpdateInfo' }
) as Serializer<BaseOracleUpdateInfoArgs, BaseOracleUpdateInfo>;
Expand Down
26 changes: 26 additions & 0 deletions clients/js/src/generated/types/externalValidationResult.ts
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>;
}
3 changes: 3 additions & 0 deletions clients/js/src/generated/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ export * from './externalPlugin';
export * from './externalPluginSchema';
export * from './externalPluginType';
export * from './externalRegistryRecord';
export * from './externalValidationResult';
export * from './freezeDelegate';
export * from './hashablePluginSchema';
export * from './hashedAssetSchema';
export * from './hookableLifecycleEvent';
export * from './key';
export * from './oracleValidation';
export * from './permanentBurnDelegate';
export * from './permanentFreezeDelegate';
export * from './permanentTransferDelegate';
Expand All @@ -51,3 +53,4 @@ export * from './registryRecord';
export * from './transferDelegate';
export * from './updateDelegate';
export * from './validationResult';
export * from './validationResultsOffset';
76 changes: 76 additions & 0 deletions clients/js/src/generated/types/oracleValidation.ts
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;
}
74 changes: 74 additions & 0 deletions clients/js/src/generated/types/validationResultsOffset.ts
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 clients/rust/src/generated/types/external_validation_result.rs
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,
}
6 changes: 6 additions & 0 deletions clients/rust/src/generated/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub(crate) mod r#external_plugin_schema;
pub(crate) mod r#external_plugin_type;
pub(crate) mod r#external_plugin_update_info;
pub(crate) mod r#external_registry_record;
pub(crate) mod r#external_validation_result;
pub(crate) mod r#extra_account;
pub(crate) mod r#freeze_delegate;
pub(crate) mod r#hashable_plugin_schema;
Expand All @@ -35,6 +36,7 @@ pub(crate) mod r#lifecycle_hook_update_info;
pub(crate) mod r#oracle;
pub(crate) mod r#oracle_init_info;
pub(crate) mod r#oracle_update_info;
pub(crate) mod r#oracle_validation;
pub(crate) mod r#permanent_burn_delegate;
pub(crate) mod r#permanent_freeze_delegate;
pub(crate) mod r#permanent_transfer_delegate;
Expand All @@ -50,6 +52,7 @@ pub(crate) mod r#transfer_delegate;
pub(crate) mod r#update_authority;
pub(crate) mod r#update_delegate;
pub(crate) mod r#validation_result;
pub(crate) mod r#validation_results_offset;

pub use self::r#attribute::*;
pub use self::r#attributes::*;
Expand All @@ -69,6 +72,7 @@ pub use self::r#external_plugin_schema::*;
pub use self::r#external_plugin_type::*;
pub use self::r#external_plugin_update_info::*;
pub use self::r#external_registry_record::*;
pub use self::r#external_validation_result::*;
pub use self::r#extra_account::*;
pub use self::r#freeze_delegate::*;
pub use self::r#hashable_plugin_schema::*;
Expand All @@ -81,6 +85,7 @@ pub use self::r#lifecycle_hook_update_info::*;
pub use self::r#oracle::*;
pub use self::r#oracle_init_info::*;
pub use self::r#oracle_update_info::*;
pub use self::r#oracle_validation::*;
pub use self::r#permanent_burn_delegate::*;
pub use self::r#permanent_freeze_delegate::*;
pub use self::r#permanent_transfer_delegate::*;
Expand All @@ -96,3 +101,4 @@ pub use self::r#transfer_delegate::*;
pub use self::r#update_authority::*;
pub use self::r#update_delegate::*;
pub use self::r#validation_result::*;
pub use self::r#validation_results_offset::*;
2 changes: 2 additions & 0 deletions clients/rust/src/generated/types/oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//!
use crate::generated::types::ExtraAccount;
use crate::generated::types::ValidationResultsOffset;
use borsh::BorshDeserialize;
use borsh::BorshSerialize;
use solana_program::pubkey::Pubkey;
Expand All @@ -19,4 +20,5 @@ pub struct Oracle {
)]
pub base_address: Pubkey,
pub pda: Option<ExtraAccount>,
pub results_offset: ValidationResultsOffset,
}
2 changes: 2 additions & 0 deletions clients/rust/src/generated/types/oracle_init_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use crate::generated::types::ExternalCheckResult;
use crate::generated::types::ExtraAccount;
use crate::generated::types::HookableLifecycleEvent;
use crate::generated::types::PluginAuthority;
use crate::generated::types::ValidationResultsOffset;
use borsh::BorshDeserialize;
use borsh::BorshSerialize;
use solana_program::pubkey::Pubkey;
Expand All @@ -24,4 +25,5 @@ pub struct OracleInitInfo {
pub init_plugin_authority: Option<PluginAuthority>,
pub lifecycle_checks: Option<Vec<(HookableLifecycleEvent, ExternalCheckResult)>>,
pub pda: Option<ExtraAccount>,
pub results_offset: Option<ValidationResultsOffset>,
}
Loading

0 comments on commit db1deb2

Please sign in to comment.