@metaplex-foundation/mpl-token-metadata
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -89,4 +89,7 @@ /// <reference types="node" /> | ||
}): Promise<Metadata[]>; | ||
static findByMint(connection: Connection, mint: AnyPublicKey): Promise<Metadata>; | ||
static findByOwner(connection: Connection, owner: AnyPublicKey): Promise<Metadata[]>; | ||
static findByOwnerV2(connection: Connection, owner: AnyPublicKey): Promise<Metadata[]>; | ||
static findByOwnerV3(connection: Connection, owner: AnyPublicKey): Promise<Metadata[]>; | ||
static findInfoByOwner(connection: Connection, owner: AnyPublicKey): Promise<Map<AnyPublicKey, AccountInfo<Buffer>>>; | ||
static findDataByOwner(connection: Connection, owner: AnyPublicKey): Promise<MetadataData[]>; | ||
@@ -93,0 +96,0 @@ static getEdition(connection: Connection, mint: AnyPublicKey): Promise<Edition | MasterEdition>; |
@@ -164,2 +164,8 @@ "use strict"; | ||
} | ||
static findByMint(connection, mint) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const pda = yield Metadata.getPDA(mint); | ||
return Metadata.load(connection, pda); | ||
}); | ||
} | ||
static findByOwner(connection, owner) { | ||
@@ -186,4 +192,10 @@ return __awaiter(this, void 0, void 0, function* () { | ||
} | ||
static findDataByOwner(connection, owner) { | ||
static findByOwnerV3(connection, owner) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const tokenInfo = yield Metadata.findInfoByOwner(connection, owner); | ||
return Array.from(tokenInfo.entries()).map(([pubkey, info]) => new Metadata(pubkey, info)); | ||
}); | ||
} | ||
static findInfoByOwner(connection, owner) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const accounts = yield mpl_core_1.TokenAccount.getTokenAccountsByOwner(connection, owner); | ||
@@ -195,3 +207,8 @@ const metadataPdaLookups = accounts.reduce((memo, { data }) => { | ||
const metadataAddresses = yield Promise.all(metadataPdaLookups); | ||
const tokenInfo = yield mpl_core_1.Account.getInfos(connection, metadataAddresses); | ||
return mpl_core_1.Account.getInfos(connection, metadataAddresses); | ||
}); | ||
} | ||
static findDataByOwner(connection, owner) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const tokenInfo = yield Metadata.findInfoByOwner(connection, owner); | ||
return Array.from(tokenInfo.values()).map((m) => MetadataData.deserialize(m.data)); | ||
@@ -198,0 +215,0 @@ }); |
@@ -10,8 +10,8 @@ import { PublicKey } from '@solana/web3.js'; | ||
static readonly PUBKEY: PublicKey; | ||
static find_edition_account(mint: PublicKey, edition_number: string): Promise<[PublicKey, number]>; | ||
static find_master_edition_account(mint: PublicKey): Promise<[PublicKey, number]>; | ||
static find_metadata_account(mint: PublicKey): Promise<[PublicKey, number]>; | ||
static find_use_authority_account(mint: PublicKey, authority: PublicKey): Promise<[PublicKey, number]>; | ||
static find_collection_authority_account(mint: PublicKey, authority: PublicKey): Promise<[PublicKey, number]>; | ||
static find_program_as_burner_account(): Promise<[PublicKey, number]>; | ||
static findEditionAccount(mint: PublicKey, editionNumber: string): Promise<[PublicKey, number]>; | ||
static findMasterEditionAccount(mint: PublicKey): Promise<[PublicKey, number]>; | ||
static findMetadataAccount(mint: PublicKey): Promise<[PublicKey, number]>; | ||
static findUseAuthorityAccount(mint: PublicKey, authority: PublicKey): Promise<[PublicKey, number]>; | ||
static findCollectionAuthorityAccount(mint: PublicKey, authority: PublicKey): Promise<[PublicKey, number]>; | ||
static findProgramAsBurnerAccount(): Promise<[PublicKey, number]>; | ||
} |
@@ -16,3 +16,3 @@ "use strict"; | ||
class MetadataProgram extends mpl_core_1.Program { | ||
static find_edition_account(mint, edition_number) { | ||
static findEditionAccount(mint, editionNumber) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -24,7 +24,7 @@ return web3_js_1.PublicKey.findProgramAddress([ | ||
Buffer.from(MetadataProgram.EDITION, 'utf8'), | ||
Buffer.from(edition_number, 'utf8'), | ||
Buffer.from(editionNumber, 'utf8'), | ||
], MetadataProgram.PUBKEY); | ||
}); | ||
} | ||
static find_master_edition_account(mint) { | ||
static findMasterEditionAccount(mint) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -39,3 +39,3 @@ return web3_js_1.PublicKey.findProgramAddress([ | ||
} | ||
static find_metadata_account(mint) { | ||
static findMetadataAccount(mint) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -49,3 +49,3 @@ return web3_js_1.PublicKey.findProgramAddress([ | ||
} | ||
static find_use_authority_account(mint, authority) { | ||
static findUseAuthorityAccount(mint, authority) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -61,3 +61,3 @@ return web3_js_1.PublicKey.findProgramAddress([ | ||
} | ||
static find_collection_authority_account(mint, authority) { | ||
static findCollectionAuthorityAccount(mint, authority) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -73,3 +73,3 @@ return web3_js_1.PublicKey.findProgramAddress([ | ||
} | ||
static find_program_as_burner_account() { | ||
static findProgramAsBurnerAccount() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -76,0 +76,0 @@ return web3_js_1.PublicKey.findProgramAddress([ |
@@ -21,1 +21,2 @@ export * from './CreateMetadata'; | ||
export * from './ThawDelegatedAccount'; | ||
export * from './RemoveCreatorVerification'; |
@@ -33,2 +33,3 @@ "use strict"; | ||
__exportStar(require("./ThawDelegatedAccount"), exports); | ||
__exportStar(require("./RemoveCreatorVerification"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -110,3 +110,3 @@ "use strict"; | ||
yield (0, amman_1.airdrop)(connection, delegatedAuthority.publicKey, 2); | ||
const dARecord = yield mpl_token_metadata_1.MetadataProgram.find_collection_authority_account(collectionNft.mint.publicKey, delegatedAuthority.publicKey); | ||
const dARecord = yield mpl_token_metadata_1.MetadataProgram.findCollectionAuthorityAccount(collectionNft.mint.publicKey, delegatedAuthority.publicKey); | ||
const collectionVerifyCollectionTransaction = new mpl_token_metadata_1.VerifyCollection({ feePayer: payer.publicKey }, { | ||
@@ -144,3 +144,3 @@ metadata: collectionMemberNft.metadata, | ||
yield (0, amman_1.airdrop)(connection, delegatedAuthority.publicKey, 2); | ||
const dARecord = yield mpl_token_metadata_1.MetadataProgram.find_collection_authority_account(collectionNft.mint.publicKey, delegatedAuthority.publicKey); | ||
const dARecord = yield mpl_token_metadata_1.MetadataProgram.findCollectionAuthorityAccount(collectionNft.mint.publicKey, delegatedAuthority.publicKey); | ||
const collectionVerifyCollectionTransaction = new transactions_1.SetAndVerifyCollectionCollection({ feePayer: delegatedAuthority.publicKey }, { | ||
@@ -180,3 +180,3 @@ metadata: collectionMemberNft.metadata, | ||
yield (0, amman_1.airdrop)(connection, delegatedAuthority.publicKey, 2); | ||
const dARecord = yield mpl_token_metadata_1.MetadataProgram.find_collection_authority_account(collectionNft.mint.publicKey, delegatedAuthority.publicKey); | ||
const dARecord = yield mpl_token_metadata_1.MetadataProgram.findCollectionAuthorityAccount(collectionNft.mint.publicKey, delegatedAuthority.publicKey); | ||
const approveTransaction = new mpl_token_metadata_1.ApproveCollectionAuthority({ feePayer: payer.publicKey }, { | ||
@@ -225,3 +225,3 @@ collectionAuthorityRecord: dARecord[0], | ||
yield (0, amman_1.airdrop)(connection, delegatedAuthority.publicKey, 2); | ||
const dARecord = yield mpl_token_metadata_1.MetadataProgram.find_collection_authority_account(collectionNft.mint.publicKey, delegatedAuthority.publicKey); | ||
const dARecord = yield mpl_token_metadata_1.MetadataProgram.findCollectionAuthorityAccount(collectionNft.mint.publicKey, delegatedAuthority.publicKey); | ||
const approveTransaction = new mpl_token_metadata_1.ApproveCollectionAuthority({ feePayer: payer.publicKey }, { | ||
@@ -228,0 +228,0 @@ collectionAuthorityRecord: dARecord[0], |
{ | ||
"name": "@metaplex-foundation/mpl-token-metadata", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "MPL Token Metadata JavaScript API.", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/mpl-token-metadata.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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
235385
125
3656