Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/crazy-melons-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@macalinao/clients-token-metadata": patch
---

Add master edition PDA
17 changes: 17 additions & 0 deletions clients/token-metadata/coda.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@ const addCustomPDAsVisitor = addPdasVisitor({
),
],
},
{
name: "masterEdition",
seeds: [
constantPdaSeedNodeFromString("utf8", "metadata"),
variablePdaSeedNode(
"programId",
publicKeyTypeNode(),
"The address of the program",
),
variablePdaSeedNode(
"mint",
publicKeyTypeNode(),
"The address of the mint account",
),
constantPdaSeedNodeFromString("utf8", "edition"),
],
},
],
});

Expand Down
1 change: 1 addition & 0 deletions clients/token-metadata/src/generated/pdas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
* @see https://github.com/codama-idl/codama
*/

export * from "./masterEdition.js";
export * from "./metadata.js";
39 changes: 39 additions & 0 deletions clients/token-metadata/src/generated/pdas/masterEdition.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* This code was AUTOGENERATED using the codama library.
* Please DO NOT EDIT THIS FILE, instead use visitors
* to add features, then rerun codama to update it.
*
* @see https://github.com/codama-idl/codama
*/

import type { Address, ProgramDerivedAddress } from "@solana/kit";
import {
getAddressEncoder,
getProgramDerivedAddress,
getUtf8Encoder,
} from "@solana/kit";

export interface MasterEditionSeeds {
/** The address of the program */
programId: Address;
/** The address of the mint account */
mint: Address;
}

export async function findMasterEditionPda(
seeds: MasterEditionSeeds,
config: { programAddress?: Address | undefined } = {},
): Promise<ProgramDerivedAddress> {
const {
programAddress = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s" as Address<"metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s">,
} = config;
return await getProgramDerivedAddress({
programAddress,
seeds: [
getUtf8Encoder().encode("metadata"),
getAddressEncoder().encode(seeds.programId),
getAddressEncoder().encode(seeds.mint),
getUtf8Encoder().encode("edition"),
],
});
}