Skip to content

Commit

Permalink
small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
madergaser committed Feb 8, 2024
1 parent 3bad149 commit 210a9bd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 81 deletions.
20 changes: 6 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@magiceden-oss/open_creator_protocol": "^0.3.2",
"@metaplex-foundation/js": "^0.18.3",
"@metaplex-foundation/mpl-token-auth-rules": "^1.2.0",
"@metaplex-foundation/mpl-token-metadata": "^3.1.2",
"old-mpl-token-metadata": "npm:@metaplex-foundation/[email protected]",
"@project-serum/anchor": "^0.26.0",
"@solana/spl-token": "^0.3.5",
Expand Down
69 changes: 6 additions & 63 deletions tests/utils/mip1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
} from '@metaplex-foundation/umi';
import {
ASSOCIATED_TOKEN_PROGRAM_ID,
getAssociatedTokenAddress,
getAssociatedTokenAddressSync,
} from '@solana/spl-token';
import {
findMasterEditionV2Pda,
Expand All @@ -40,20 +40,15 @@ import {
MintInstructionAccounts,
MintInstructionArgs,
PROGRAM_ID as TOKEN_METADATA_PROGRAM_ID,
TokenRecord,
TokenStandard,
} from 'old-mpl-token-metadata';
import {
TokenDelegateRole,
TokenRecord,
TokenState,
SetTokenStandardInstructionAccounts,
createSetTokenStandardInstruction,
findMetadataPda as findMetadataPda2,
findMasterEditionPda as findMasterEditionV2Pda2,
findTokenRecordPda as getTokenRecordPda2,
createV1,
createNft,
createProgrammableNft,
verifyCreatorV1,
mintV1,
} from '@metaplex-foundation/mpl-token-metadata';
import { getMetaplexInstance, sendAndAssertTx } from '.';
import {
Expand Down Expand Up @@ -178,58 +173,6 @@ export const createDefaultTokenAuthorizationRules = async (
return { ruleSetAddress, txId: sig };
};

// const createNewMip1MintTransactionUmi = (
// umi: Umi,
// payer: UmiSigner,
// mintKeypair: UmiSigner,
// tokenProgramId: PublicKey,
// ruleSet?: PublicKey,
// ) => {
// const metadataPda = findMetadataPda2(umi, {
// mint: mintKeypair.publicKey,
// })[0];
// const masterEditionPDA = findMasterEditionV2Pda2(umi, {
// mint: mintKeypair.publicKey,
// })[0];
// const ata = getAssociatedTokenAddress(
// toWeb3JsPublicKey(mintKeypair.publicKey),
// toWeb3JsPublicKey(payer.publicKey),
// true,
// tokenProgramId,
// );

// const data: AssetData = {
// name: 'ProgrammableNonFungible',
// symbol: 'PNF',
// uri: 'uri',
// sellerFeeBasisPoints: 150,
// creators: [
// {
// address: payer.publicKey,
// share: 100,
// verified: true,
// },
// ],
// primarySaleHappened: false,
// isMutable: true,
// tokenStandard: TokenStandard.ProgrammableNonFungible,
// collection: null,
// uses: null,
// collectionDetails: null,
// ruleSet: ruleSet ?? null,
// };

// const create = createNft(umi, {
// mint: mintKeypair,
// name: 'ProgrammableNonFungible',
// symbol: 'PNF',
// uri: 'uri',
// sellerFeeBasisPoints: percentAmount(5.5),
// token:
// tokenStandard: TokenStandard.ProgrammableNonFungible,
// }).sendAndConfirm(umi);
// };

const createNewMip1MintTransaction = (
payer: Keypair,
mintKeypair: Keypair,
Expand Down Expand Up @@ -303,7 +246,7 @@ export const createProgrammableNftUmi = async (
) => {
const mintKeypair = generateSigner(umi);

const targetTokenAccount = await getAssociatedTokenAddress(
const targetTokenAccount = getAssociatedTokenAddressSync(
toWeb3JsPublicKey(mintKeypair.publicKey),
recipient,
true,
Expand Down Expand Up @@ -347,7 +290,7 @@ export const createProgrammableNftMip1 = async (
) => {
const metaplexInstance = getMetaplexInstance(connection);
const mintKeypair = Keypair.generate();
const targetTokenAccount = await getAssociatedTokenAddress(
const targetTokenAccount = getAssociatedTokenAddressSync(
mintKeypair.publicKey,
recipient,
);
Expand Down
5 changes: 1 addition & 4 deletions tests/utils/nfts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ import {
Metaplex,
PublicKey,
token as getSplTokenAmount,
Amount,
CreateCompressedNftOutput,
} from '@metaplex-foundation/js';
import { Connection, Signer } from '@solana/web3.js';
import { Connection } from '@solana/web3.js';
import { getKeypair } from './generic';
import { umiMintNfts } from './umiNfts';

export const getMetaplexInstance = (conn: Connection) => {
return Metaplex.make(conn).use(keypairIdentity(getKeypair()));
Expand Down

0 comments on commit 210a9bd

Please sign in to comment.