@metaplex-foundation/mpl-core
Advanced tools
Comparing version 0.4.2 to 0.4.3
@@ -9,16 +9,5 @@ /** | ||
import { Account, Context, Pda, PublicKey, RpcAccount, RpcGetAccountOptions, RpcGetAccountsOptions } from '@metaplex-foundation/umi'; | ||
import { Serializer } from '@metaplex-foundation/umi/serializers'; | ||
import { ExternalPluginRecord, ExternalPluginRecordArgs, Key, KeyArgs, RegistryRecord, RegistryRecordArgs } from '../types'; | ||
import { PluginRegistryV1AccountData } from '../../hooked'; | ||
import { ExternalPluginRecordArgs, KeyArgs, RegistryRecordArgs } from '../types'; | ||
export type PluginRegistryV1 = Account<PluginRegistryV1AccountData>; | ||
export type PluginRegistryV1AccountData = { | ||
key: Key; | ||
registry: Array<RegistryRecord>; | ||
externalPlugins: Array<ExternalPluginRecord>; | ||
}; | ||
export type PluginRegistryV1AccountDataArgs = { | ||
key: KeyArgs; | ||
registry: Array<RegistryRecordArgs>; | ||
externalPlugins: Array<ExternalPluginRecordArgs>; | ||
}; | ||
export declare function getPluginRegistryV1AccountDataSerializer(): Serializer<PluginRegistryV1AccountDataArgs, PluginRegistryV1AccountData>; | ||
export declare function deserializePluginRegistryV1(rawAccount: RpcAccount): PluginRegistryV1; | ||
@@ -25,0 +14,0 @@ export declare function fetchPluginRegistryV1(context: Pick<Context, 'rpc'>, publicKey: PublicKey | Pda, options?: RpcGetAccountOptions): Promise<PluginRegistryV1>; |
@@ -10,16 +10,9 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getPluginRegistryV1GpaBuilder = exports.safeFetchAllPluginRegistryV1 = exports.fetchAllPluginRegistryV1 = exports.safeFetchPluginRegistryV1 = exports.fetchPluginRegistryV1 = exports.deserializePluginRegistryV1 = exports.getPluginRegistryV1AccountDataSerializer = void 0; | ||
exports.getPluginRegistryV1GpaBuilder = exports.safeFetchAllPluginRegistryV1 = exports.fetchAllPluginRegistryV1 = exports.safeFetchPluginRegistryV1 = exports.fetchPluginRegistryV1 = exports.deserializePluginRegistryV1 = void 0; | ||
const umi_1 = require("@metaplex-foundation/umi"); | ||
const serializers_1 = require("@metaplex-foundation/umi/serializers"); | ||
const hooked_1 = require("../../hooked"); | ||
const types_1 = require("../types"); | ||
function getPluginRegistryV1AccountDataSerializer() { | ||
return (0, serializers_1.struct)([ | ||
['key', (0, types_1.getKeySerializer)()], | ||
['registry', (0, serializers_1.array)((0, types_1.getRegistryRecordSerializer)())], | ||
['externalPlugins', (0, serializers_1.array)((0, types_1.getExternalPluginRecordSerializer)())], | ||
], { description: 'PluginRegistryV1AccountData' }); | ||
} | ||
exports.getPluginRegistryV1AccountDataSerializer = getPluginRegistryV1AccountDataSerializer; | ||
function deserializePluginRegistryV1(rawAccount) { | ||
return (0, umi_1.deserializeAccount)(rawAccount, getPluginRegistryV1AccountDataSerializer()); | ||
return (0, umi_1.deserializeAccount)(rawAccount, (0, hooked_1.getPluginRegistryV1AccountDataSerializer)()); | ||
} | ||
@@ -26,0 +19,0 @@ exports.deserializePluginRegistryV1 = deserializePluginRegistryV1; |
@@ -183,2 +183,8 @@ /** | ||
} | ||
/** ConflictingAuthority: Cannot specify both an update authority and collection on an asset */ | ||
export declare class ConflictingAuthorityError extends ProgramError { | ||
readonly name: string; | ||
readonly code: number; | ||
constructor(program: Program, cause?: Error); | ||
} | ||
/** | ||
@@ -185,0 +191,0 @@ * Attempts to resolve a custom program error from the provided error code. |
@@ -10,3 +10,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getMplCoreErrorFromName = exports.getMplCoreErrorFromCode = exports.InvalidPluginSettingError = exports.CannotRedelegateError = exports.NoApprovalsError = exports.MissingCollectionError = exports.InvalidAssetError = exports.NotAvailableError = exports.MissingSystemProgramError = exports.MissingNewOwnerError = exports.MissingUpdateAuthorityError = exports.InvalidCollectionError = exports.AlreadyDecompressedError = exports.AlreadyCompressedError = exports.NumericalOverflowErrorError = exports.PluginAlreadyExistsError = exports.CannotBurnCollectionError = exports.CannotMigratePrintsError = exports.CannotMigrateMasterWithSupplyError = exports.MissingCompressionProofError = exports.AssetIsFrozenError = exports.InvalidAuthorityError = exports.InvalidPluginError = exports.IncorrectAssetHashError = exports.IncorrectAccountError = exports.NumericalOverflowError = exports.PluginNotFoundError = exports.PluginsNotInitializedError = exports.SerializationErrorError = exports.DeserializationErrorError = exports.InvalidSystemProgramError = void 0; | ||
exports.getMplCoreErrorFromName = exports.getMplCoreErrorFromCode = exports.ConflictingAuthorityError = exports.InvalidPluginSettingError = exports.CannotRedelegateError = exports.NoApprovalsError = exports.MissingCollectionError = exports.InvalidAssetError = exports.NotAvailableError = exports.MissingSystemProgramError = exports.MissingNewOwnerError = exports.MissingUpdateAuthorityError = exports.InvalidCollectionError = exports.AlreadyDecompressedError = exports.AlreadyCompressedError = exports.NumericalOverflowErrorError = exports.PluginAlreadyExistsError = exports.CannotBurnCollectionError = exports.CannotMigratePrintsError = exports.CannotMigrateMasterWithSupplyError = exports.MissingCompressionProofError = exports.AssetIsFrozenError = exports.InvalidAuthorityError = exports.InvalidPluginError = exports.IncorrectAssetHashError = exports.IncorrectAccountError = exports.NumericalOverflowError = exports.PluginNotFoundError = exports.PluginsNotInitializedError = exports.SerializationErrorError = exports.DeserializationErrorError = exports.InvalidSystemProgramError = void 0; | ||
const umi_1 = require("@metaplex-foundation/umi"); | ||
@@ -334,2 +334,13 @@ const codeToErrorMap = new Map(); | ||
nameToErrorMap.set('InvalidPluginSetting', InvalidPluginSettingError); | ||
/** ConflictingAuthority: Cannot specify both an update authority and collection on an asset */ | ||
class ConflictingAuthorityError extends umi_1.ProgramError { | ||
constructor(program, cause) { | ||
super('Cannot specify both an update authority and collection on an asset', program, cause); | ||
this.name = 'ConflictingAuthority'; | ||
this.code = 0x1d; // 29 | ||
} | ||
} | ||
exports.ConflictingAuthorityError = ConflictingAuthorityError; | ||
codeToErrorMap.set(0x1d, ConflictingAuthorityError); | ||
nameToErrorMap.set('ConflictingAuthority', ConflictingAuthorityError); | ||
/** | ||
@@ -336,0 +347,0 @@ * Attempts to resolve a custom program error from the provided error code. |
@@ -7,2 +7,3 @@ "use strict"; | ||
const plugins_1 = require("../plugins"); | ||
const pluginRegistryV1Data_1 = require("./pluginRegistryV1Data"); | ||
const getAssetV1AccountDataSerializer = () => ({ | ||
@@ -28,3 +29,3 @@ description: 'AssetAccountData', | ||
[pluginRegistry, finalOffset] = | ||
(0, generated_1.getPluginRegistryV1AccountDataSerializer)().deserialize(buffer, Number(pluginHeader.pluginRegistryOffset)); | ||
(0, pluginRegistryV1Data_1.getPluginRegistryV1AccountDataSerializer)().deserialize(buffer, Number(pluginHeader.pluginRegistryOffset)); | ||
pluginsList = (0, plugins_1.registryRecordsToPluginsList)(pluginRegistry.registry, buffer); | ||
@@ -31,0 +32,0 @@ } |
@@ -7,2 +7,3 @@ "use strict"; | ||
const plugins_1 = require("../plugins"); | ||
const pluginRegistryV1Data_1 = require("./pluginRegistryV1Data"); | ||
const getCollectionV1AccountDataSerializer = () => ({ | ||
@@ -28,3 +29,3 @@ description: 'CollectionAccountData', | ||
[pluginRegistry, finalOffset] = | ||
(0, generated_1.getPluginRegistryV1AccountDataSerializer)().deserialize(buffer, Number(pluginHeader.pluginRegistryOffset)); | ||
(0, pluginRegistryV1Data_1.getPluginRegistryV1AccountDataSerializer)().deserialize(buffer, Number(pluginHeader.pluginRegistryOffset)); | ||
pluginsList = (0, plugins_1.registryRecordsToPluginsList)(pluginRegistry.registry, buffer); | ||
@@ -31,0 +32,0 @@ } |
export * from './assetAccountData'; | ||
export * from './collectionAccountData'; | ||
export * from './pluginRegistryV1Data'; |
@@ -19,2 +19,3 @@ "use strict"; | ||
__exportStar(require("./collectionAccountData"), exports); | ||
__exportStar(require("./pluginRegistryV1Data"), exports); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@metaplex-foundation/mpl-core", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "Digital Assets", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
388927
254
6303
25
9
18
8
18