generated from metaplex-foundation/solana-project-template
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Regenerate IDL and clients * Add Oracle validation type * Regenerate IDL and clients * Update JS SDK for ValidationResultsOffset * fix minor type issues --------- Co-authored-by: Nhan Phan <[email protected]>
- Loading branch information
Showing
28 changed files
with
493 additions
and
16 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
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
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
80 changes: 80 additions & 0 deletions
80
clients/js/src/generated/types/baseValidationResultsOffset.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,80 @@ | ||
/** | ||
* 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 BaseValidationResultsOffset = | ||
| { __kind: 'NoOffset' } | ||
| { __kind: 'Anchor' } | ||
| { __kind: 'Custom'; fields: [bigint] }; | ||
|
||
export type BaseValidationResultsOffsetArgs = | ||
| { __kind: 'NoOffset' } | ||
| { __kind: 'Anchor' } | ||
| { __kind: 'Custom'; fields: [number | bigint] }; | ||
|
||
export function getBaseValidationResultsOffsetSerializer(): Serializer< | ||
BaseValidationResultsOffsetArgs, | ||
BaseValidationResultsOffset | ||
> { | ||
return dataEnum<BaseValidationResultsOffset>( | ||
[ | ||
['NoOffset', unit()], | ||
['Anchor', unit()], | ||
[ | ||
'Custom', | ||
struct<GetDataEnumKindContent<BaseValidationResultsOffset, 'Custom'>>([ | ||
['fields', tuple([u64()])], | ||
]), | ||
], | ||
], | ||
{ description: 'BaseValidationResultsOffset' } | ||
) as Serializer<BaseValidationResultsOffsetArgs, BaseValidationResultsOffset>; | ||
} | ||
|
||
// Data Enum Helpers. | ||
export function baseValidationResultsOffset( | ||
kind: 'NoOffset' | ||
): GetDataEnumKind<BaseValidationResultsOffsetArgs, 'NoOffset'>; | ||
export function baseValidationResultsOffset( | ||
kind: 'Anchor' | ||
): GetDataEnumKind<BaseValidationResultsOffsetArgs, 'Anchor'>; | ||
export function baseValidationResultsOffset( | ||
kind: 'Custom', | ||
data: GetDataEnumKindContent< | ||
BaseValidationResultsOffsetArgs, | ||
'Custom' | ||
>['fields'] | ||
): GetDataEnumKind<BaseValidationResultsOffsetArgs, 'Custom'>; | ||
export function baseValidationResultsOffset< | ||
K extends BaseValidationResultsOffsetArgs['__kind'], | ||
>( | ||
kind: K, | ||
data?: any | ||
): Extract<BaseValidationResultsOffsetArgs, { __kind: K }> { | ||
return Array.isArray(data) | ||
? { __kind: kind, fields: data } | ||
: { __kind: kind, ...(data ?? {}) }; | ||
} | ||
export function isBaseValidationResultsOffset< | ||
K extends BaseValidationResultsOffset['__kind'], | ||
>( | ||
kind: K, | ||
value: BaseValidationResultsOffset | ||
): value is BaseValidationResultsOffset & { __kind: K } { | ||
return value.__kind === kind; | ||
} |
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
Oops, something went wrong.