Skip to content

Commit

Permalink
Merge branch 'main' of github.com:blockiosaurus/blob-asset into main
Browse files Browse the repository at this point in the history
  • Loading branch information
blockiosaurus committed Feb 29, 2024
2 parents a9edef2 + 4bfae02 commit d83de81
Show file tree
Hide file tree
Showing 57 changed files with 273 additions and 242 deletions.
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion clients/js/src/generated/accounts/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export async function safeFetchAllAsset(

export function getAssetGpaBuilder(context: Pick<Context, 'rpc' | 'programs'>) {
const programId = context.programs.getPublicKey(
'mplCoreProgram',
'mplCore',
'CoREzp6dAdLVRKf3EM5tWrsXM2jQwRFeu5uhzsAyjYXL'
);
return gpaBuilder(context, programId)
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/accounts/collectionData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export function getCollectionDataGpaBuilder(
context: Pick<Context, 'rpc' | 'programs'>
) {
const programId = context.programs.getPublicKey(
'mplCoreProgram',
'mplCore',
'CoREzp6dAdLVRKf3EM5tWrsXM2jQwRFeu5uhzsAyjYXL'
);
return gpaBuilder(context, programId)
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/accounts/hashedAsset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export function getHashedAssetGpaBuilder(
context: Pick<Context, 'rpc' | 'programs'>
) {
const programId = context.programs.getPublicKey(
'mplCoreProgram',
'mplCore',
'CoREzp6dAdLVRKf3EM5tWrsXM2jQwRFeu5uhzsAyjYXL'
);
return gpaBuilder(context, programId)
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/accounts/pluginHeader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export function getPluginHeaderGpaBuilder(
context: Pick<Context, 'rpc' | 'programs'>
) {
const programId = context.programs.getPublicKey(
'mplCoreProgram',
'mplCore',
'CoREzp6dAdLVRKf3EM5tWrsXM2jQwRFeu5uhzsAyjYXL'
);
return gpaBuilder(context, programId)
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/accounts/pluginRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export function getPluginRegistryGpaBuilder(
context: Pick<Context, 'rpc' | 'programs'>
) {
const programId = context.programs.getPublicKey(
'mplCoreProgram',
'mplCore',
'CoREzp6dAdLVRKf3EM5tWrsXM2jQwRFeu5uhzsAyjYXL'
);
return gpaBuilder(context, programId)
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/errors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
* @see https://github.com/metaplex-foundation/kinobi
*/

export * from './mplCoreProgram';
export * from './mplCore';
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ nameToErrorMap.set('MissingUpdateAuthority', MissingUpdateAuthorityError);
* Attempts to resolve a custom program error from the provided error code.
* @category Errors
*/
export function getMplCoreProgramErrorFromCode(
export function getMplCoreErrorFromCode(
code: number,
program: Program,
cause?: Error
Expand All @@ -308,7 +308,7 @@ export function getMplCoreProgramErrorFromCode(
* Attempts to resolve a custom program error from the provided error name, i.e. 'Unauthorized'.
* @category Errors
*/
export function getMplCoreProgramErrorFromName(
export function getMplCoreErrorFromName(
name: string,
program: Program,
cause?: Error
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/addAuthority.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function addAuthority(
): TransactionBuilder {
// Program ID.
const programId = context.programs.getPublicKey(
'mplCoreProgram',
'mplCore',
'CoREzp6dAdLVRKf3EM5tWrsXM2jQwRFeu5uhzsAyjYXL'
);

Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/addPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function addPlugin(
): TransactionBuilder {
// Program ID.
const programId = context.programs.getPublicKey(
'mplCoreProgram',
'mplCore',
'CoREzp6dAdLVRKf3EM5tWrsXM2jQwRFeu5uhzsAyjYXL'
);

Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/burn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export function burn(
): TransactionBuilder {
// Program ID.
const programId = context.programs.getPublicKey(
'mplCoreProgram',
'mplCore',
'CoREzp6dAdLVRKf3EM5tWrsXM2jQwRFeu5uhzsAyjYXL'
);

Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/compress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function compress(
): TransactionBuilder {
// Program ID.
const programId = context.programs.getPublicKey(
'mplCoreProgram',
'mplCore',
'CoREzp6dAdLVRKf3EM5tWrsXM2jQwRFeu5uhzsAyjYXL'
);

Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function create(
): TransactionBuilder {
// Program ID.
const programId = context.programs.getPublicKey(
'mplCoreProgram',
'mplCore',
'CoREzp6dAdLVRKf3EM5tWrsXM2jQwRFeu5uhzsAyjYXL'
);

Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/createCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function createCollection(
): TransactionBuilder {
// Program ID.
const programId = context.programs.getPublicKey(
'mplCoreProgram',
'mplCore',
'CoREzp6dAdLVRKf3EM5tWrsXM2jQwRFeu5uhzsAyjYXL'
);

Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/decompress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function decompress(
): TransactionBuilder {
// Program ID.
const programId = context.programs.getPublicKey(
'mplCoreProgram',
'mplCore',
'CoREzp6dAdLVRKf3EM5tWrsXM2jQwRFeu5uhzsAyjYXL'
);

Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/removeAuthority.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function removeAuthority(
): TransactionBuilder {
// Program ID.
const programId = context.programs.getPublicKey(
'mplCoreProgram',
'mplCore',
'CoREzp6dAdLVRKf3EM5tWrsXM2jQwRFeu5uhzsAyjYXL'
);

Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/removePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function removePlugin(
): TransactionBuilder {
// Program ID.
const programId = context.programs.getPublicKey(
'mplCoreProgram',
'mplCore',
'CoREzp6dAdLVRKf3EM5tWrsXM2jQwRFeu5uhzsAyjYXL'
);

Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function transfer(
): TransactionBuilder {
// Program ID.
const programId = context.programs.getPublicKey(
'mplCoreProgram',
'mplCore',
'CoREzp6dAdLVRKf3EM5tWrsXM2jQwRFeu5uhzsAyjYXL'
);

Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function update(
): TransactionBuilder {
// Program ID.
const programId = context.programs.getPublicKey(
'mplCoreProgram',
'mplCore',
'CoREzp6dAdLVRKf3EM5tWrsXM2jQwRFeu5uhzsAyjYXL'
);

Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/updatePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function updatePlugin(
): TransactionBuilder {
// Program ID.
const programId = context.programs.getPublicKey(
'mplCoreProgram',
'mplCore',
'CoREzp6dAdLVRKf3EM5tWrsXM2jQwRFeu5uhzsAyjYXL'
);

Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/programs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
* @see https://github.com/metaplex-foundation/kinobi
*/

export * from './mplCoreProgram';
export * from './mplCore';
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,41 @@ import {
Program,
PublicKey,
} from '@metaplex-foundation/umi';
import {
getMplCoreProgramErrorFromCode,
getMplCoreProgramErrorFromName,
} from '../errors';
import { getMplCoreErrorFromCode, getMplCoreErrorFromName } from '../errors';

export const MPL_CORE_PROGRAM_PROGRAM_ID =
export const MPL_CORE_PROGRAM_ID =
'CoREzp6dAdLVRKf3EM5tWrsXM2jQwRFeu5uhzsAyjYXL' as PublicKey<'CoREzp6dAdLVRKf3EM5tWrsXM2jQwRFeu5uhzsAyjYXL'>;

export function createMplCoreProgramProgram(): Program {
export function createMplCoreProgram(): Program {
return {
name: 'mplCoreProgram',
publicKey: MPL_CORE_PROGRAM_PROGRAM_ID,
name: 'mplCore',
publicKey: MPL_CORE_PROGRAM_ID,
getErrorFromCode(code: number, cause?: Error) {
return getMplCoreProgramErrorFromCode(code, this, cause);
return getMplCoreErrorFromCode(code, this, cause);
},
getErrorFromName(name: string, cause?: Error) {
return getMplCoreProgramErrorFromName(name, this, cause);
return getMplCoreErrorFromName(name, this, cause);
},
isOnCluster() {
return true;
},
};
}

export function getMplCoreProgramProgram<T extends Program = Program>(
export function getMplCoreProgram<T extends Program = Program>(
context: Pick<Context, 'programs'>,
clusterFilter?: ClusterFilter
): T {
return context.programs.get<T>('mplCoreProgram', clusterFilter);
return context.programs.get<T>('mplCore', clusterFilter);
}

export function getMplCoreProgramProgramId(
export function getMplCoreProgramId(
context: Pick<Context, 'programs'>,
clusterFilter?: ClusterFilter
): PublicKey {
return context.programs.getPublicKey(
'mplCoreProgram',
MPL_CORE_PROGRAM_PROGRAM_ID,
'mplCore',
MPL_CORE_PROGRAM_ID,
clusterFilter
);
}
48 changes: 48 additions & 0 deletions clients/js/src/generated/types/hashablePluginSchema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* 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,
array,
struct,
u64,
} from '@metaplex-foundation/umi/serializers';
import {
Authority,
AuthorityArgs,
Plugin,
PluginArgs,
getAuthoritySerializer,
getPluginSerializer,
} from '.';

export type HashablePluginSchema = {
index: bigint;
authorities: Array<Authority>;
plugin: Plugin;
};

export type HashablePluginSchemaArgs = {
index: number | bigint;
authorities: Array<AuthorityArgs>;
plugin: PluginArgs;
};

export function getHashablePluginSchemaSerializer(): Serializer<
HashablePluginSchemaArgs,
HashablePluginSchema
> {
return struct<HashablePluginSchema>(
[
['index', u64()],
['authorities', array(getAuthoritySerializer())],
['plugin', getPluginSerializer()],
],
{ description: 'HashablePluginSchema' }
) as Serializer<HashablePluginSchemaArgs, HashablePluginSchema>;
}
10 changes: 3 additions & 7 deletions clients/js/src/generated/types/hashedAssetSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,13 @@ import {
bytes,
struct,
} from '@metaplex-foundation/umi/serializers';
import { PluginHash, PluginHashArgs, getPluginHashSerializer } from '.';

export type HashedAssetSchema = {
assetHash: Uint8Array;
pluginHashes: Array<PluginHash>;
pluginHashes: Array<Uint8Array>;
};

export type HashedAssetSchemaArgs = {
assetHash: Uint8Array;
pluginHashes: Array<PluginHashArgs>;
};
export type HashedAssetSchemaArgs = HashedAssetSchema;

export function getHashedAssetSchemaSerializer(): Serializer<
HashedAssetSchemaArgs,
Expand All @@ -31,7 +27,7 @@ export function getHashedAssetSchemaSerializer(): Serializer<
return struct<HashedAssetSchema>(
[
['assetHash', bytes({ size: 32 })],
['pluginHashes', array(getPluginHashSerializer())],
['pluginHashes', array(bytes({ size: 32 }))],
],
{ description: 'HashedAssetSchema' }
) as Serializer<HashedAssetSchemaArgs, HashedAssetSchema>;
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export * from './dataState';
export * from './externalPluginRecord';
export * from './extraAccounts';
export * from './freeze';
export * from './hashablePluginSchema';
export * from './hashedAssetSchema';
export * from './key';
export * from './plugin';
export * from './pluginHash';
export * from './pluginType';
export * from './registryRecord';
export * from './royalties';
Expand Down
Loading

0 comments on commit d83de81

Please sign in to comment.