Socket
Socket
Sign inDemoInstall

@metaplex-foundation/mpl-candy-machine-core

Package Overview
Dependencies
86
Maintainers
10
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.2 to 0.2.0

dist/src/generated/instructions/initializeV2.d.ts

29

dist/src/generated/accounts/CandyMachine.d.ts
/// <reference types="node" />
import * as web3 from '@solana/web3.js';
import * as beet from '@metaplex-foundation/beet';
import * as web3 from '@solana/web3.js';
import * as beetSolana from '@metaplex-foundation/beet-solana';
import { AccountVersion } from '../types/AccountVersion';
import { CandyMachineData } from '../types/CandyMachineData';
export declare type CandyMachineArgs = {
features: beet.bignum;
version: AccountVersion;
tokenStandard: number;
features: number[];
authority: web3.PublicKey;

@@ -16,3 +19,5 @@ mintAuthority: web3.PublicKey;

export declare class CandyMachine implements CandyMachineArgs {
readonly features: beet.bignum;
readonly version: AccountVersion;
readonly tokenStandard: number;
readonly features: number[];
readonly authority: web3.PublicKey;

@@ -26,11 +31,5 @@ readonly mintAuthority: web3.PublicKey;

static fromAccountInfo(accountInfo: web3.AccountInfo<Buffer>, offset?: number): [CandyMachine, number];
static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey): Promise<CandyMachine>;
static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<{
features: any;
authority: any;
mintAuthority: any;
collectionMint: any;
itemsRedeemed: any;
data: any;
accountDiscriminator: any;
static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey, commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig): Promise<CandyMachine>;
static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<CandyMachineArgs & {
accountDiscriminator: number[];
}>;

@@ -42,5 +41,5 @@ static deserialize(buf: Buffer, offset?: number): [CandyMachine, number];

pretty(): {
features: number | {
toNumber: () => number;
};
version: string;
tokenStandard: number;
features: number[];
authority: string;

@@ -47,0 +46,0 @@ mintAuthority: string;

@@ -27,9 +27,12 @@ "use strict";

exports.candyMachineBeet = exports.CandyMachine = exports.candyMachineDiscriminator = void 0;
const web3 = __importStar(require("@solana/web3.js"));
const beet = __importStar(require("@metaplex-foundation/beet"));
const web3 = __importStar(require("@solana/web3.js"));
const beetSolana = __importStar(require("@metaplex-foundation/beet-solana"));
const AccountVersion_1 = require("../types/AccountVersion");
const CandyMachineData_1 = require("../types/CandyMachineData");
exports.candyMachineDiscriminator = [51, 173, 177, 113, 25, 241, 109, 189];
class CandyMachine {
constructor(features, authority, mintAuthority, collectionMint, itemsRedeemed, data) {
constructor(version, tokenStandard, features, authority, mintAuthority, collectionMint, itemsRedeemed, data) {
this.version = version;
this.tokenStandard = tokenStandard;
this.features = features;

@@ -43,3 +46,3 @@ this.authority = authority;

static fromArgs(args) {
return new CandyMachine(args.features, args.authority, args.mintAuthority, args.collectionMint, args.itemsRedeemed, args.data);
return new CandyMachine(args.version, args.tokenStandard, args.features, args.authority, args.mintAuthority, args.collectionMint, args.itemsRedeemed, args.data);
}

@@ -49,4 +52,4 @@ static fromAccountInfo(accountInfo, offset = 0) {

}
static async fromAccountAddress(connection, address) {
const accountInfo = await connection.getAccountInfo(address);
static async fromAccountAddress(connection, address, commitmentOrConfig) {
const accountInfo = await connection.getAccountInfo(address, commitmentOrConfig);
if (accountInfo == null) {

@@ -81,14 +84,5 @@ throw new Error(`Unable to find CandyMachine account at ${address}`);

return {
features: (() => {
const x = this.features;
if (typeof x.toNumber === 'function') {
try {
return x.toNumber();
}
catch (_) {
return x;
}
}
return x;
})(),
version: 'AccountVersion.' + AccountVersion_1.AccountVersion[this.version],
tokenStandard: this.tokenStandard,
features: this.features,
authority: this.authority.toBase58(),

@@ -116,3 +110,5 @@ mintAuthority: this.mintAuthority.toBase58(),

['accountDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)],
['features', beet.u64],
['version', AccountVersion_1.accountVersionBeet],
['tokenStandard', beet.u8],
['features', beet.uniformFixedSizeArray(beet.u8, 6)],
['authority', beetSolana.publicKey],

@@ -119,0 +115,0 @@ ['mintAuthority', beetSolana.publicKey],

@@ -110,4 +110,49 @@ declare type ErrorWithCode = Error & {

}
export declare class InstructionBuilderFailedError extends Error {
readonly code: number;
readonly name: string;
constructor();
}
export declare class MissingCollectionAuthorityRecordError extends Error {
readonly code: number;
readonly name: string;
constructor();
}
export declare class MissingMetadataDelegateRecordError extends Error {
readonly code: number;
readonly name: string;
constructor();
}
export declare class InvalidTokenStandardError extends Error {
readonly code: number;
readonly name: string;
constructor();
}
export declare class MissingTokenAccountError extends Error {
readonly code: number;
readonly name: string;
constructor();
}
export declare class MissingTokenRecordError extends Error {
readonly code: number;
readonly name: string;
constructor();
}
export declare class MissingInstructionsSysvarError extends Error {
readonly code: number;
readonly name: string;
constructor();
}
export declare class MissingSplAtaProgramError extends Error {
readonly code: number;
readonly name: string;
constructor();
}
export declare class InvalidAccountVersionError extends Error {
readonly code: number;
readonly name: string;
constructor();
}
export declare function errorFromCode(code: number): MaybeErrorWithCode;
export declare function errorFromName(name: string): MaybeErrorWithCode;
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.errorFromName = exports.errorFromCode = exports.NotFullyLoadedError = exports.CouldNotRetrieveConfigLineDataError = exports.CollectionKeyMismatchError = exports.CannotChangeSequentialIndexGenerationError = exports.CannotSwitchFromHiddenSettingsError = exports.CannotIncreaseLengthError = exports.MissingConfigLinesSettingsError = exports.ExceededLengthErrorError = exports.NoChangingCollectionDuringMintError = exports.MetadataAccountMustBeEmptyError = exports.IncorrectCollectionAuthorityError = exports.CannotSwitchToHiddenSettingsError = exports.CannotChangeNumberOfLinesError = exports.HiddenSettingsDoNotHaveConfigLinesError = exports.CandyMachineEmptyError = exports.TooManyCreatorsError = exports.NumericalOverflowErrorError = exports.IndexGreaterThanLengthError = exports.MintMismatchError = exports.UninitializedError = exports.IncorrectOwnerError = void 0;
exports.errorFromName = exports.errorFromCode = exports.InvalidAccountVersionError = exports.MissingSplAtaProgramError = exports.MissingInstructionsSysvarError = exports.MissingTokenRecordError = exports.MissingTokenAccountError = exports.InvalidTokenStandardError = exports.MissingMetadataDelegateRecordError = exports.MissingCollectionAuthorityRecordError = exports.InstructionBuilderFailedError = exports.NotFullyLoadedError = exports.CouldNotRetrieveConfigLineDataError = exports.CollectionKeyMismatchError = exports.CannotChangeSequentialIndexGenerationError = exports.CannotSwitchFromHiddenSettingsError = exports.CannotIncreaseLengthError = exports.MissingConfigLinesSettingsError = exports.ExceededLengthErrorError = exports.NoChangingCollectionDuringMintError = exports.MetadataAccountMustBeEmptyError = exports.IncorrectCollectionAuthorityError = exports.CannotSwitchToHiddenSettingsError = exports.CannotChangeNumberOfLinesError = exports.HiddenSettingsDoNotHaveConfigLinesError = exports.CandyMachineEmptyError = exports.TooManyCreatorsError = exports.NumericalOverflowErrorError = exports.IndexGreaterThanLengthError = exports.MintMismatchError = exports.UninitializedError = exports.IncorrectOwnerError = void 0;
const createErrorFromCodeLookup = new Map();

@@ -279,2 +279,119 @@ const createErrorFromNameLookup = new Map();

createErrorFromNameLookup.set('NotFullyLoaded', () => new NotFullyLoadedError());
class InstructionBuilderFailedError extends Error {
constructor() {
super('Instruction could not be created');
this.code = 0x1785;
this.name = 'InstructionBuilderFailed';
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, InstructionBuilderFailedError);
}
}
}
exports.InstructionBuilderFailedError = InstructionBuilderFailedError;
createErrorFromCodeLookup.set(0x1785, () => new InstructionBuilderFailedError());
createErrorFromNameLookup.set('InstructionBuilderFailed', () => new InstructionBuilderFailedError());
class MissingCollectionAuthorityRecordError extends Error {
constructor() {
super('Missing collection authority record');
this.code = 0x1786;
this.name = 'MissingCollectionAuthorityRecord';
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, MissingCollectionAuthorityRecordError);
}
}
}
exports.MissingCollectionAuthorityRecordError = MissingCollectionAuthorityRecordError;
createErrorFromCodeLookup.set(0x1786, () => new MissingCollectionAuthorityRecordError());
createErrorFromNameLookup.set('MissingCollectionAuthorityRecord', () => new MissingCollectionAuthorityRecordError());
class MissingMetadataDelegateRecordError extends Error {
constructor() {
super('Missing metadata delegate record');
this.code = 0x1787;
this.name = 'MissingMetadataDelegateRecord';
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, MissingMetadataDelegateRecordError);
}
}
}
exports.MissingMetadataDelegateRecordError = MissingMetadataDelegateRecordError;
createErrorFromCodeLookup.set(0x1787, () => new MissingMetadataDelegateRecordError());
createErrorFromNameLookup.set('MissingMetadataDelegateRecord', () => new MissingMetadataDelegateRecordError());
class InvalidTokenStandardError extends Error {
constructor() {
super('Invalid token standard');
this.code = 0x1788;
this.name = 'InvalidTokenStandard';
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, InvalidTokenStandardError);
}
}
}
exports.InvalidTokenStandardError = InvalidTokenStandardError;
createErrorFromCodeLookup.set(0x1788, () => new InvalidTokenStandardError());
createErrorFromNameLookup.set('InvalidTokenStandard', () => new InvalidTokenStandardError());
class MissingTokenAccountError extends Error {
constructor() {
super('Missing token account');
this.code = 0x1789;
this.name = 'MissingTokenAccount';
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, MissingTokenAccountError);
}
}
}
exports.MissingTokenAccountError = MissingTokenAccountError;
createErrorFromCodeLookup.set(0x1789, () => new MissingTokenAccountError());
createErrorFromNameLookup.set('MissingTokenAccount', () => new MissingTokenAccountError());
class MissingTokenRecordError extends Error {
constructor() {
super('Missing token record');
this.code = 0x178a;
this.name = 'MissingTokenRecord';
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, MissingTokenRecordError);
}
}
}
exports.MissingTokenRecordError = MissingTokenRecordError;
createErrorFromCodeLookup.set(0x178a, () => new MissingTokenRecordError());
createErrorFromNameLookup.set('MissingTokenRecord', () => new MissingTokenRecordError());
class MissingInstructionsSysvarError extends Error {
constructor() {
super('Missing instructions sysvar account');
this.code = 0x178b;
this.name = 'MissingInstructionsSysvar';
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, MissingInstructionsSysvarError);
}
}
}
exports.MissingInstructionsSysvarError = MissingInstructionsSysvarError;
createErrorFromCodeLookup.set(0x178b, () => new MissingInstructionsSysvarError());
createErrorFromNameLookup.set('MissingInstructionsSysvar', () => new MissingInstructionsSysvarError());
class MissingSplAtaProgramError extends Error {
constructor() {
super('Missing SPL ATA program');
this.code = 0x178c;
this.name = 'MissingSplAtaProgram';
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, MissingSplAtaProgramError);
}
}
}
exports.MissingSplAtaProgramError = MissingSplAtaProgramError;
createErrorFromCodeLookup.set(0x178c, () => new MissingSplAtaProgramError());
createErrorFromNameLookup.set('MissingSplAtaProgram', () => new MissingSplAtaProgramError());
class InvalidAccountVersionError extends Error {
constructor() {
super('Invalid account version');
this.code = 0x178d;
this.name = 'InvalidAccountVersion';
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, InvalidAccountVersionError);
}
}
}
exports.InvalidAccountVersionError = InvalidAccountVersionError;
createErrorFromCodeLookup.set(0x178d, () => new InvalidAccountVersionError());
createErrorFromNameLookup.set('InvalidAccountVersion', () => new InvalidAccountVersionError());
function errorFromCode(code) {

@@ -281,0 +398,0 @@ const createError = createErrorFromCodeLookup.get(code);

@@ -14,4 +14,5 @@ import * as beet from '@metaplex-foundation/beet';

authority: web3.PublicKey;
anchorRemainingAccounts?: web3.AccountMeta[];
};
export declare const addConfigLinesInstructionDiscriminator: number[];
export declare function createAddConfigLinesInstruction(accounts: AddConfigLinesInstructionAccounts, args: AddConfigLinesInstructionArgs, programId?: web3.PublicKey): web3.TransactionInstruction;

@@ -53,2 +53,7 @@ "use strict";

];
if (accounts.anchorRemainingAccounts != null) {
for (const acc of accounts.anchorRemainingAccounts) {
keys.push(acc);
}
}
const ix = new web3.TransactionInstruction({

@@ -55,0 +60,0 @@ programId,

export * from './addConfigLines';
export * from './initialize';
export * from './initializeV2';
export * from './mint';
export * from './mintV2';
export * from './setAuthority';
export * from './setCollection';
export * from './setCollectionV2';
export * from './setMintAuthority';
export * from './setTokenStandard';
export * from './update';
export * from './withdraw';

@@ -19,8 +19,12 @@ "use strict";

__exportStar(require("./initialize"), exports);
__exportStar(require("./initializeV2"), exports);
__exportStar(require("./mint"), exports);
__exportStar(require("./mintV2"), exports);
__exportStar(require("./setAuthority"), exports);
__exportStar(require("./setCollection"), exports);
__exportStar(require("./setCollectionV2"), exports);
__exportStar(require("./setMintAuthority"), exports);
__exportStar(require("./setTokenStandard"), exports);
__exportStar(require("./update"), exports);
__exportStar(require("./withdraw"), exports);
//# sourceMappingURL=index.js.map

@@ -22,4 +22,5 @@ import * as beet from '@metaplex-foundation/beet';

systemProgram?: web3.PublicKey;
anchorRemainingAccounts?: web3.AccountMeta[];
};
export declare const initializeInstructionDiscriminator: number[];
export declare function createInitializeInstruction(accounts: InitializeInstructionAccounts, args: InitializeInstructionArgs, programId?: web3.PublicKey): web3.TransactionInstruction;

@@ -98,2 +98,7 @@ "use strict";

];
if (accounts.anchorRemainingAccounts != null) {
for (const acc of accounts.anchorRemainingAccounts) {
keys.push(acc);
}
}
const ix = new web3.TransactionInstruction({

@@ -100,0 +105,0 @@ programId,

@@ -24,4 +24,5 @@ import * as beet from '@metaplex-foundation/beet';

recentSlothashes: web3.PublicKey;
anchorRemainingAccounts?: web3.AccountMeta[];
};
export declare const mintInstructionDiscriminator: number[];
export declare function createMintInstruction(accounts: MintInstructionAccounts, programId?: web3.PublicKey): web3.TransactionInstruction;

@@ -124,2 +124,7 @@ "use strict";

];
if (accounts.anchorRemainingAccounts != null) {
for (const acc of accounts.anchorRemainingAccounts) {
keys.push(acc);
}
}
const ix = new web3.TransactionInstruction({

@@ -126,0 +131,0 @@ programId,

@@ -12,4 +12,5 @@ import * as web3 from '@solana/web3.js';

authority: web3.PublicKey;
anchorRemainingAccounts?: web3.AccountMeta[];
};
export declare const setAuthorityInstructionDiscriminator: number[];
export declare function createSetAuthorityInstruction(accounts: SetAuthorityInstructionAccounts, args: SetAuthorityInstructionArgs, programId?: web3.PublicKey): web3.TransactionInstruction;

@@ -52,2 +52,7 @@ "use strict";

];
if (accounts.anchorRemainingAccounts != null) {
for (const acc of accounts.anchorRemainingAccounts) {
keys.push(acc);
}
}
const ix = new web3.TransactionInstruction({

@@ -54,0 +59,0 @@ programId,

@@ -21,4 +21,5 @@ import * as beet from '@metaplex-foundation/beet';

systemProgram?: web3.PublicKey;
anchorRemainingAccounts?: web3.AccountMeta[];
};
export declare const setCollectionInstructionDiscriminator: number[];
export declare function createSetCollectionInstruction(accounts: SetCollectionInstructionAccounts, programId?: web3.PublicKey): web3.TransactionInstruction;

@@ -108,2 +108,7 @@ "use strict";

];
if (accounts.anchorRemainingAccounts != null) {
for (const acc of accounts.anchorRemainingAccounts) {
keys.push(acc);
}
}
const ix = new web3.TransactionInstruction({

@@ -110,0 +115,0 @@ programId,

@@ -10,4 +10,5 @@ import * as beet from '@metaplex-foundation/beet';

mintAuthority: web3.PublicKey;
anchorRemainingAccounts?: web3.AccountMeta[];
};
export declare const setMintAuthorityInstructionDiscriminator: number[];
export declare function createSetMintAuthorityInstruction(accounts: SetMintAuthorityInstructionAccounts, programId?: web3.PublicKey): web3.TransactionInstruction;

@@ -52,2 +52,7 @@ "use strict";

];
if (accounts.anchorRemainingAccounts != null) {
for (const acc of accounts.anchorRemainingAccounts) {
keys.push(acc);
}
}
const ix = new web3.TransactionInstruction({

@@ -54,0 +59,0 @@ programId,

@@ -13,4 +13,5 @@ import * as beet from '@metaplex-foundation/beet';

authority: web3.PublicKey;
anchorRemainingAccounts?: web3.AccountMeta[];
};
export declare const updateInstructionDiscriminator: number[];
export declare function createUpdateInstruction(accounts: UpdateInstructionAccounts, args: UpdateInstructionArgs, programId?: web3.PublicKey): web3.TransactionInstruction;

@@ -52,2 +52,7 @@ "use strict";

];
if (accounts.anchorRemainingAccounts != null) {
for (const acc of accounts.anchorRemainingAccounts) {
keys.push(acc);
}
}
const ix = new web3.TransactionInstruction({

@@ -54,0 +59,0 @@ programId,

@@ -9,4 +9,5 @@ import * as beet from '@metaplex-foundation/beet';

authority: web3.PublicKey;
anchorRemainingAccounts?: web3.AccountMeta[];
};
export declare const withdrawInstructionDiscriminator: number[];
export declare function createWithdrawInstruction(accounts: WithdrawInstructionAccounts, programId?: web3.PublicKey): web3.TransactionInstruction;

@@ -47,2 +47,7 @@ "use strict";

];
if (accounts.anchorRemainingAccounts != null) {
for (const acc of accounts.anchorRemainingAccounts) {
keys.push(acc);
}
}
const ix = new web3.TransactionInstruction({

@@ -49,0 +54,0 @@ programId,

@@ -0,1 +1,2 @@

export * from './AccountVersion';
export * from './CandyMachineData';

@@ -2,0 +3,0 @@ export * from './ConfigLine';

@@ -17,2 +17,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./AccountVersion"), exports);
__exportStar(require("./CandyMachineData"), exports);

@@ -19,0 +20,0 @@ __exportStar(require("./ConfigLine"), exports);

{
"name": "@metaplex-foundation/mpl-candy-machine-core",
"version": "0.1.2",
"programVersion": "0.1.3",
"version": "0.2.0",
"programVersion": "0.2.0",
"description": "MPL Candy Machine Core JavaScript API. This MPL package is for the current generation of the Candy Machine Core (a.k.a. Candy Machine V3).",

@@ -11,5 +11,3 @@ "main": "dist/src/index.js",

"preversion": "yarn check:publish-ready",
"postversion": "git add package.json && git commit -m \"chore: update $npm_package_name to v$npm_package_version\" && git tag $npm_package_name@$npm_package_version",
"prepublishOnly": "yarn check:publish-ready",
"postpublish": "git push origin && git push origin --tags",
"build:docs": "typedoc",

@@ -45,4 +43,4 @@ "build": "rimraf dist && tsc -p tsconfig.json",

"dependencies": {
"@metaplex-foundation/beet": "^0.4.0",
"@metaplex-foundation/beet-solana": "^0.3.0",
"@metaplex-foundation/beet": "^0.7.0",
"@metaplex-foundation/beet-solana": "^0.4.0",
"@metaplex-foundation/cusper": "^0.0.2",

@@ -58,4 +56,5 @@ "@solana/web3.js": "^1.56.2",

"@metaplex-foundation/amman": "^0.12.0",
"@metaplex-foundation/js": "^0.15.0",
"@metaplex-foundation/solita": "^0.12.0",
"@metaplex-foundation/amman-client": "^0.2.2",
"@metaplex-foundation/js": "^0.18.0",
"@metaplex-foundation/solita": "^0.19.4",
"@solana/spl-token": "0.3.5",

@@ -62,0 +61,0 @@ "@types/bn.js": "^5.1.0",

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc