Merge pull request #15 from metaplex-foundation/various-patches
Allow for new safety deposit validation
This commit is contained in:
commit
385389fa80
|
@ -700,6 +700,24 @@ export async function getWhitelistedCreator(creator: PublicKey) {
|
||||||
)[0];
|
)[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getSafetyDepositBoxValidationTicket(
|
||||||
|
auctionManager: PublicKey,
|
||||||
|
safetyDepositBox: PublicKey,
|
||||||
|
) {
|
||||||
|
const PROGRAM_IDS = programIds();
|
||||||
|
return (
|
||||||
|
await PublicKey.findProgramAddress(
|
||||||
|
[
|
||||||
|
Buffer.from(METAPLEX_PREFIX),
|
||||||
|
PROGRAM_IDS.metaplex.toBuffer(),
|
||||||
|
auctionManager.toBuffer(),
|
||||||
|
safetyDepositBox.toBuffer(),
|
||||||
|
],
|
||||||
|
PROGRAM_IDS.metaplex,
|
||||||
|
)
|
||||||
|
)[0];
|
||||||
|
}
|
||||||
|
|
||||||
export async function getPayoutTicket(
|
export async function getPayoutTicket(
|
||||||
auctionManager: PublicKey,
|
auctionManager: PublicKey,
|
||||||
winnerConfigIndex: number | null | undefined,
|
winnerConfigIndex: number | null | undefined,
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { serialize } from 'borsh';
|
||||||
import {
|
import {
|
||||||
getAuctionKeys,
|
getAuctionKeys,
|
||||||
getOriginalAuthority,
|
getOriginalAuthority,
|
||||||
|
getSafetyDepositBoxValidationTicket,
|
||||||
SCHEMA,
|
SCHEMA,
|
||||||
ValidateSafetyDepositBoxArgs,
|
ValidateSafetyDepositBoxArgs,
|
||||||
} from '.';
|
} from '.';
|
||||||
|
@ -43,6 +44,14 @@ export async function validateSafetyDepositBox(
|
||||||
|
|
||||||
const data = Buffer.from(serialize(SCHEMA, value));
|
const data = Buffer.from(serialize(SCHEMA, value));
|
||||||
const keys = [
|
const keys = [
|
||||||
|
{
|
||||||
|
pubkey: await getSafetyDepositBoxValidationTicket(
|
||||||
|
auctionManagerKey,
|
||||||
|
safetyDepositBox,
|
||||||
|
),
|
||||||
|
isSigner: false,
|
||||||
|
isWritable: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
pubkey: auctionManagerKey,
|
pubkey: auctionManagerKey,
|
||||||
isSigner: false,
|
isSigner: false,
|
||||||
|
|
Loading…
Reference in New Issue