@metaplex-foundation/mpl-token-metadata
Advanced tools
Comparing version 3.0.0-alpha.19 to 3.0.0-alpha.20
@@ -8,3 +8,3 @@ /** | ||
*/ | ||
import { Account, Context, PublicKey, RpcAccount, RpcGetAccountOptions, RpcGetAccountsOptions, Serializer } from '@metaplex-foundation/umi'; | ||
import { Account, Context, Pda, PublicKey, RpcAccount, RpcGetAccountOptions, RpcGetAccountsOptions, Serializer } from '@metaplex-foundation/umi'; | ||
import { Key, KeyArgs } from '../types'; | ||
@@ -30,1 +30,9 @@ export type EditionMarker = Account<EditionMarkerAccountData>; | ||
export declare function getEditionMarkerSize(): number; | ||
export declare function findEditionMarkerPda(context: Pick<Context, 'eddsa' | 'programs' | 'serializer'>, seeds: { | ||
/** The address of the mint account */ | ||
mint: PublicKey; | ||
/** The floor of the edition number divided by 248 as a string. I.e. ⌊edition/248⌋. */ | ||
editionMarker: string; | ||
}): Pda; | ||
export declare function fetchEditionMarkerFromSeeds(context: Pick<Context, 'eddsa' | 'programs' | 'rpc' | 'serializer'>, seeds: Parameters<typeof findEditionMarkerPda>[1], options?: RpcGetAccountOptions): Promise<EditionMarker>; | ||
export declare function safeFetchEditionMarkerFromSeeds(context: Pick<Context, 'eddsa' | 'programs' | 'rpc' | 'serializer'>, seeds: Parameters<typeof findEditionMarkerPda>[1], options?: RpcGetAccountOptions): Promise<EditionMarker | null>; |
@@ -10,3 +10,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getEditionMarkerSize = exports.getEditionMarkerGpaBuilder = exports.safeFetchAllEditionMarker = exports.fetchAllEditionMarker = exports.safeFetchEditionMarker = exports.fetchEditionMarker = exports.deserializeEditionMarker = exports.getEditionMarkerAccountDataSerializer = void 0; | ||
exports.safeFetchEditionMarkerFromSeeds = exports.fetchEditionMarkerFromSeeds = exports.findEditionMarkerPda = exports.getEditionMarkerSize = exports.getEditionMarkerGpaBuilder = exports.safeFetchAllEditionMarker = exports.fetchAllEditionMarker = exports.safeFetchEditionMarker = exports.fetchEditionMarker = exports.deserializeEditionMarker = exports.getEditionMarkerAccountDataSerializer = void 0; | ||
const umi_1 = require("@metaplex-foundation/umi"); | ||
@@ -70,2 +70,22 @@ const types_1 = require("../types"); | ||
exports.getEditionMarkerSize = getEditionMarkerSize; | ||
function findEditionMarkerPda(context, seeds) { | ||
const s = context.serializer; | ||
const programId = context.programs.getPublicKey('mplTokenMetadata', 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s'); | ||
return context.eddsa.findPda(programId, [ | ||
s.string({ size: 'variable' }).serialize('metadata'), | ||
programId.bytes, | ||
s.publicKey().serialize(seeds.mint), | ||
s.string({ size: 'variable' }).serialize('edition'), | ||
s.string({ size: 'variable' }).serialize(seeds.editionMarker), | ||
]); | ||
} | ||
exports.findEditionMarkerPda = findEditionMarkerPda; | ||
async function fetchEditionMarkerFromSeeds(context, seeds, options) { | ||
return fetchEditionMarker(context, findEditionMarkerPda(context, seeds), options); | ||
} | ||
exports.fetchEditionMarkerFromSeeds = fetchEditionMarkerFromSeeds; | ||
async function safeFetchEditionMarkerFromSeeds(context, seeds, options) { | ||
return safeFetchEditionMarker(context, findEditionMarkerPda(context, seeds), options); | ||
} | ||
exports.safeFetchEditionMarkerFromSeeds = safeFetchEditionMarkerFromSeeds; | ||
//# sourceMappingURL=editionMarker.js.map |
@@ -0,2 +1,3 @@ | ||
export * from './editionMarker'; | ||
export * from './metadataDelegateRoleSeed'; | ||
export * from './resolvers'; |
@@ -17,4 +17,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./editionMarker"), exports); | ||
__exportStar(require("./metadataDelegateRoleSeed"), exports); | ||
__exportStar(require("./resolvers"), exports); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@metaplex-foundation/mpl-token-metadata", | ||
"version": "3.0.0-alpha.19", | ||
"version": "3.0.0-alpha.20", | ||
"description": "JavaScript client for Token Metadata", | ||
@@ -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
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
1543949
455
22685