File tree Expand file tree Collapse file tree 4 files changed +62
-0
lines changed Expand file tree Collapse file tree 4 files changed +62
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @macalinao/clients-token-metadata " : patch
3+ ---
4+
5+ Add master edition PDA
Original file line number Diff line number Diff line change @@ -24,6 +24,23 @@ const addCustomPDAsVisitor = addPdasVisitor({
2424 ) ,
2525 ] ,
2626 } ,
27+ {
28+ name : "masterEdition" ,
29+ seeds : [
30+ constantPdaSeedNodeFromString ( "utf8" , "metadata" ) ,
31+ variablePdaSeedNode (
32+ "programId" ,
33+ publicKeyTypeNode ( ) ,
34+ "The address of the program" ,
35+ ) ,
36+ variablePdaSeedNode (
37+ "mint" ,
38+ publicKeyTypeNode ( ) ,
39+ "The address of the mint account" ,
40+ ) ,
41+ constantPdaSeedNodeFromString ( "utf8" , "edition" ) ,
42+ ] ,
43+ } ,
2744 ] ,
2845} ) ;
2946
Original file line number Diff line number Diff line change 66 * @see https://github.com/codama-idl/codama
77 */
88
9+ export * from "./masterEdition.js" ;
910export * from "./metadata.js" ;
Original file line number Diff line number Diff line change 1+ /**
2+ * This code was AUTOGENERATED using the codama library.
3+ * Please DO NOT EDIT THIS FILE, instead use visitors
4+ * to add features, then rerun codama to update it.
5+ *
6+ * @see https://github.com/codama-idl/codama
7+ */
8+
9+ import type { Address , ProgramDerivedAddress } from "@solana/kit" ;
10+ import {
11+ getAddressEncoder ,
12+ getProgramDerivedAddress ,
13+ getUtf8Encoder ,
14+ } from "@solana/kit" ;
15+
16+ export interface MasterEditionSeeds {
17+ /** The address of the program */
18+ programId : Address ;
19+ /** The address of the mint account */
20+ mint : Address ;
21+ }
22+
23+ export async function findMasterEditionPda (
24+ seeds : MasterEditionSeeds ,
25+ config : { programAddress ?: Address | undefined } = { } ,
26+ ) : Promise < ProgramDerivedAddress > {
27+ const {
28+ programAddress = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s" as Address < "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s" > ,
29+ } = config ;
30+ return await getProgramDerivedAddress ( {
31+ programAddress,
32+ seeds : [
33+ getUtf8Encoder ( ) . encode ( "metadata" ) ,
34+ getAddressEncoder ( ) . encode ( seeds . programId ) ,
35+ getAddressEncoder ( ) . encode ( seeds . mint ) ,
36+ getUtf8Encoder ( ) . encode ( "edition" ) ,
37+ ] ,
38+ } ) ;
39+ }
You can’t perform that action at this time.
0 commit comments