From db1deb2e63652a3ed5da8d8cf1c25b5b38488869 Mon Sep 17 00:00:00 2001 From: Michael Danenberg <56533526+danenbm@users.noreply.github.com> Date: Wed, 24 Apr 2024 12:17:21 -0700 Subject: [PATCH] Regenerate IDL and clients --- clients/js/src/generated/types/baseOracle.ts | 6 ++ .../src/generated/types/baseOracleInitInfo.ts | 6 ++ .../generated/types/baseOracleUpdateInfo.ts | 6 ++ .../types/externalValidationResult.ts | 26 +++++ clients/js/src/generated/types/index.ts | 3 + .../src/generated/types/oracleValidation.ts | 76 +++++++++++++++ .../types/validationResultsOffset.ts | 74 ++++++++++++++ .../types/external_validation_result.rs | 20 ++++ clients/rust/src/generated/types/mod.rs | 6 ++ clients/rust/src/generated/types/oracle.rs | 2 + .../src/generated/types/oracle_init_info.rs | 2 + .../src/generated/types/oracle_update_info.rs | 2 + .../src/generated/types/oracle_validation.rs | 21 ++++ .../types/validation_results_offset.rs | 17 ++++ idls/mpl_core.json | 96 +++++++++++++++++++ 15 files changed, 363 insertions(+) create mode 100644 clients/js/src/generated/types/externalValidationResult.ts create mode 100644 clients/js/src/generated/types/oracleValidation.ts create mode 100644 clients/js/src/generated/types/validationResultsOffset.ts create mode 100644 clients/rust/src/generated/types/external_validation_result.rs create mode 100644 clients/rust/src/generated/types/oracle_validation.rs create mode 100644 clients/rust/src/generated/types/validation_results_offset.rs diff --git a/clients/js/src/generated/types/baseOracle.ts b/clients/js/src/generated/types/baseOracle.ts index f426a8b2..c0a584b0 100644 --- a/clients/js/src/generated/types/baseOracle.ts +++ b/clients/js/src/generated/types/baseOracle.ts @@ -16,17 +16,22 @@ import { import { BaseExtraAccount, BaseExtraAccountArgs, + ValidationResultsOffset, + ValidationResultsOffsetArgs, getBaseExtraAccountSerializer, + getValidationResultsOffsetSerializer, } from '.'; export type BaseOracle = { baseAddress: PublicKey; pda: Option; + resultsOffset: ValidationResultsOffset; }; export type BaseOracleArgs = { baseAddress: PublicKey; pda: OptionOrNullable; + resultsOffset: ValidationResultsOffsetArgs; }; export function getBaseOracleSerializer(): Serializer< @@ -37,6 +42,7 @@ export function getBaseOracleSerializer(): Serializer< [ ['baseAddress', publicKeySerializer()], ['pda', option(getBaseExtraAccountSerializer())], + ['resultsOffset', getValidationResultsOffsetSerializer()], ], { description: 'BaseOracle' } ) as Serializer; diff --git a/clients/js/src/generated/types/baseOracleInitInfo.ts b/clients/js/src/generated/types/baseOracleInitInfo.ts index cd852958..4c4f9c07 100644 --- a/clients/js/src/generated/types/baseOracleInitInfo.ts +++ b/clients/js/src/generated/types/baseOracleInitInfo.ts @@ -24,10 +24,13 @@ import { ExternalCheckResultArgs, HookableLifecycleEvent, HookableLifecycleEventArgs, + ValidationResultsOffset, + ValidationResultsOffsetArgs, getBaseExtraAccountSerializer, getBasePluginAuthoritySerializer, getExternalCheckResultSerializer, getHookableLifecycleEventSerializer, + getValidationResultsOffsetSerializer, } from '.'; export type BaseOracleInitInfo = { @@ -35,6 +38,7 @@ export type BaseOracleInitInfo = { initPluginAuthority: Option; lifecycleChecks: Option>; pda: Option; + resultsOffset: Option; }; export type BaseOracleInitInfoArgs = { @@ -44,6 +48,7 @@ export type BaseOracleInitInfoArgs = { Array<[HookableLifecycleEventArgs, ExternalCheckResultArgs]> >; pda: OptionOrNullable; + resultsOffset: OptionOrNullable; }; export function getBaseOracleInitInfoSerializer(): Serializer< @@ -66,6 +71,7 @@ export function getBaseOracleInitInfoSerializer(): Serializer< ), ], ['pda', option(getBaseExtraAccountSerializer())], + ['resultsOffset', option(getValidationResultsOffsetSerializer())], ], { description: 'BaseOracleInitInfo' } ) as Serializer; diff --git a/clients/js/src/generated/types/baseOracleUpdateInfo.ts b/clients/js/src/generated/types/baseOracleUpdateInfo.ts index 1a1276bd..cbb4dbad 100644 --- a/clients/js/src/generated/types/baseOracleUpdateInfo.ts +++ b/clients/js/src/generated/types/baseOracleUpdateInfo.ts @@ -21,14 +21,18 @@ import { ExternalCheckResultArgs, HookableLifecycleEvent, HookableLifecycleEventArgs, + ValidationResultsOffset, + ValidationResultsOffsetArgs, getBaseExtraAccountSerializer, getExternalCheckResultSerializer, getHookableLifecycleEventSerializer, + getValidationResultsOffsetSerializer, } from '.'; export type BaseOracleUpdateInfo = { lifecycleChecks: Option>; pda: Option; + resultsOffset: Option; }; export type BaseOracleUpdateInfoArgs = { @@ -36,6 +40,7 @@ export type BaseOracleUpdateInfoArgs = { Array<[HookableLifecycleEventArgs, ExternalCheckResultArgs]> >; pda: OptionOrNullable; + resultsOffset: OptionOrNullable; }; export function getBaseOracleUpdateInfoSerializer(): Serializer< @@ -56,6 +61,7 @@ export function getBaseOracleUpdateInfoSerializer(): Serializer< ), ], ['pda', option(getBaseExtraAccountSerializer())], + ['resultsOffset', option(getValidationResultsOffsetSerializer())], ], { description: 'BaseOracleUpdateInfo' } ) as Serializer; diff --git a/clients/js/src/generated/types/externalValidationResult.ts b/clients/js/src/generated/types/externalValidationResult.ts new file mode 100644 index 00000000..f60f5189 --- /dev/null +++ b/clients/js/src/generated/types/externalValidationResult.ts @@ -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, { + description: 'ExternalValidationResult', + }) as Serializer; +} diff --git a/clients/js/src/generated/types/index.ts b/clients/js/src/generated/types/index.ts index 996a3755..da6227e9 100644 --- a/clients/js/src/generated/types/index.ts +++ b/clients/js/src/generated/types/index.ts @@ -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'; @@ -51,3 +53,4 @@ export * from './registryRecord'; export * from './transferDelegate'; export * from './updateDelegate'; export * from './validationResult'; +export * from './validationResultsOffset'; diff --git a/clients/js/src/generated/types/oracleValidation.ts b/clients/js/src/generated/types/oracleValidation.ts new file mode 100644 index 00000000..16984db5 --- /dev/null +++ b/clients/js/src/generated/types/oracleValidation.ts @@ -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( + [ + [ + 'V1', + struct>([ + ['create', getExternalValidationResultSerializer()], + ['transfer', getExternalValidationResultSerializer()], + ['burn', getExternalValidationResultSerializer()], + ['update', getExternalValidationResultSerializer()], + ]), + ], + ], + { description: 'OracleValidation' } + ) as Serializer; +} + +// Data Enum Helpers. +export function oracleValidation( + kind: 'V1', + data: GetDataEnumKindContent +): GetDataEnumKind; +export function oracleValidation( + kind: K, + data?: any +): Extract { + return Array.isArray(data) + ? { __kind: kind, fields: data } + : { __kind: kind, ...(data ?? {}) }; +} +export function isOracleValidation( + kind: K, + value: OracleValidation +): value is OracleValidation & { __kind: K } { + return value.__kind === kind; +} diff --git a/clients/js/src/generated/types/validationResultsOffset.ts b/clients/js/src/generated/types/validationResultsOffset.ts new file mode 100644 index 00000000..114d58b4 --- /dev/null +++ b/clients/js/src/generated/types/validationResultsOffset.ts @@ -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( + [ + ['NoOffset', unit()], + ['Anchor', unit()], + [ + 'Custom', + struct>([ + ['fields', tuple([u64()])], + ]), + ], + ], + { description: 'ValidationResultsOffset' } + ) as Serializer; +} + +// Data Enum Helpers. +export function validationResultsOffset( + kind: 'NoOffset' +): GetDataEnumKind; +export function validationResultsOffset( + kind: 'Anchor' +): GetDataEnumKind; +export function validationResultsOffset( + kind: 'Custom', + data: GetDataEnumKindContent['fields'] +): GetDataEnumKind; +export function validationResultsOffset< + K extends ValidationResultsOffsetArgs['__kind'], +>(kind: K, data?: any): Extract { + 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; +} diff --git a/clients/rust/src/generated/types/external_validation_result.rs b/clients/rust/src/generated/types/external_validation_result.rs new file mode 100644 index 00000000..d24f011d --- /dev/null +++ b/clients/rust/src/generated/types/external_validation_result.rs @@ -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, +} diff --git a/clients/rust/src/generated/types/mod.rs b/clients/rust/src/generated/types/mod.rs index d6c13756..d5503d6c 100644 --- a/clients/rust/src/generated/types/mod.rs +++ b/clients/rust/src/generated/types/mod.rs @@ -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; @@ -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; @@ -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::*; @@ -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::*; @@ -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::*; @@ -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::*; diff --git a/clients/rust/src/generated/types/oracle.rs b/clients/rust/src/generated/types/oracle.rs index e14745b0..2a95fa48 100644 --- a/clients/rust/src/generated/types/oracle.rs +++ b/clients/rust/src/generated/types/oracle.rs @@ -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; @@ -19,4 +20,5 @@ pub struct Oracle { )] pub base_address: Pubkey, pub pda: Option, + pub results_offset: ValidationResultsOffset, } diff --git a/clients/rust/src/generated/types/oracle_init_info.rs b/clients/rust/src/generated/types/oracle_init_info.rs index 20b3b287..f96c00e1 100644 --- a/clients/rust/src/generated/types/oracle_init_info.rs +++ b/clients/rust/src/generated/types/oracle_init_info.rs @@ -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; @@ -24,4 +25,5 @@ pub struct OracleInitInfo { pub init_plugin_authority: Option, pub lifecycle_checks: Option>, pub pda: Option, + pub results_offset: Option, } diff --git a/clients/rust/src/generated/types/oracle_update_info.rs b/clients/rust/src/generated/types/oracle_update_info.rs index 3cb3437a..9813f5a0 100644 --- a/clients/rust/src/generated/types/oracle_update_info.rs +++ b/clients/rust/src/generated/types/oracle_update_info.rs @@ -8,6 +8,7 @@ use crate::generated::types::ExternalCheckResult; use crate::generated::types::ExtraAccount; use crate::generated::types::HookableLifecycleEvent; +use crate::generated::types::ValidationResultsOffset; use borsh::BorshDeserialize; use borsh::BorshSerialize; @@ -16,4 +17,5 @@ use borsh::BorshSerialize; pub struct OracleUpdateInfo { pub lifecycle_checks: Option>, pub pda: Option, + pub results_offset: Option, } diff --git a/clients/rust/src/generated/types/oracle_validation.rs b/clients/rust/src/generated/types/oracle_validation.rs new file mode 100644 index 00000000..c971c96c --- /dev/null +++ b/clients/rust/src/generated/types/oracle_validation.rs @@ -0,0 +1,21 @@ +//! 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 crate::generated::types::ExternalValidationResult; +use borsh::BorshDeserialize; +use borsh::BorshSerialize; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +pub enum OracleValidation { + V1 { + create: ExternalValidationResult, + transfer: ExternalValidationResult, + burn: ExternalValidationResult, + update: ExternalValidationResult, + }, +} diff --git a/clients/rust/src/generated/types/validation_results_offset.rs b/clients/rust/src/generated/types/validation_results_offset.rs new file mode 100644 index 00000000..15de75cb --- /dev/null +++ b/clients/rust/src/generated/types/validation_results_offset.rs @@ -0,0 +1,17 @@ +//! 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; + +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +pub enum ValidationResultsOffset { + NoOffset, + Anchor, + Custom(u64), +} diff --git a/idls/mpl_core.json b/idls/mpl_core.json index b5d4a870..fb26b598 100644 --- a/idls/mpl_core.json +++ b/idls/mpl_core.json @@ -2396,6 +2396,12 @@ "defined": "ExtraAccount" } } + }, + { + "name": "resultsOffset", + "type": { + "defined": "ValidationResultsOffset" + } } ] } @@ -2441,6 +2447,14 @@ "defined": "ExtraAccount" } } + }, + { + "name": "resultsOffset", + "type": { + "option": { + "defined": "ValidationResultsOffset" + } + } } ] } @@ -2474,6 +2488,14 @@ "defined": "ExtraAccount" } } + }, + { + "name": "resultsOffset", + "type": { + "option": { + "defined": "ValidationResultsOffset" + } + } } ] } @@ -3739,6 +3761,80 @@ ] } }, + { + "name": "ExternalValidationResult", + "type": { + "kind": "enum", + "variants": [ + { + "name": "Approved" + }, + { + "name": "Rejected" + }, + { + "name": "Pass" + } + ] + } + }, + { + "name": "ValidationResultsOffset", + "type": { + "kind": "enum", + "variants": [ + { + "name": "NoOffset" + }, + { + "name": "Anchor" + }, + { + "name": "Custom", + "fields": [ + "u64" + ] + } + ] + } + }, + { + "name": "OracleValidation", + "type": { + "kind": "enum", + "variants": [ + { + "name": "V1", + "fields": [ + { + "name": "create", + "type": { + "defined": "ExternalValidationResult" + } + }, + { + "name": "transfer", + "type": { + "defined": "ExternalValidationResult" + } + }, + { + "name": "burn", + "type": { + "defined": "ExternalValidationResult" + } + }, + { + "name": "update", + "type": { + "defined": "ExternalValidationResult" + } + } + ] + } + ] + } + }, { "name": "RuleSet", "type": {