Skip to content

Commit

Permalink
fix(mint): allow for supply to be set to zero
Browse files Browse the repository at this point in the history
  • Loading branch information
kespinola committed Nov 21, 2021
1 parent b18efa5 commit fb145e9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@holaplex/js",
"name": "@metaplex/js",
"main": "lib/index.cjs.js",
"module": "lib/index.esm.js",
"types": "lib/index.d.ts",
Expand All @@ -20,10 +20,10 @@
"solana",
"blockchain"
],
"author": "Holaplex Maintainers <engineering@holaplex.com>",
"homepage": "https://holaplex.com",
"author": "Metaplex Maintainers <contact@metaplex.com>",
"homepage": "https://metaplex.com",
"repository": {
"url": "https://github.com/holaplex/js.git"
"url": "https://github.com/metaplex/js.git"
},
"scripts": {
"build:docs": "typedoc",
Expand Down
4 changes: 2 additions & 2 deletions src/actions/mintNFT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface MintNFTParams {
connection: Connection;
wallet: Wallet;
uri: string;
maxSupply?: number;
maxSupply: BN | null;
}

interface MintNFTResponse {
Expand Down Expand Up @@ -90,7 +90,7 @@ export const mintNFT = async ({
updateAuthority: wallet.publicKey,
mint: mint.publicKey,
mintAuthority: wallet.publicKey,
maxSupply: maxSupply ? new BN(maxSupply) : null,
maxSupply,
},
);

Expand Down
8 changes: 4 additions & 4 deletions test/actions/mintNFT.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Keypair } from '@solana/web3.js';
import axios from 'axios';
import { Connection, NodeWallet, Wallet } from '../../src';
import BN from 'bn.js';
import { Connection, NodeWallet } from '../../src';
import { mintNFT } from '../../src/actions';
import { FEE_PAYER } from '../utils';
import { MasterEdition, Metadata } from '../../src/programs/metadata';
Expand Down Expand Up @@ -36,7 +36,7 @@ describe('minting an NFT', () => {
connection,
wallet,
uri,
maxSupply: 0,
maxSupply: new BN(0),
});

const metadata = await Metadata.getPDA(mint.publicKey);
Expand All @@ -61,7 +61,7 @@ describe('minting an NFT', () => {
connection,
wallet,
uri,
maxSupply: 0,
maxSupply: new BN(0),
});
} catch (e) {
expect(e).not.toBeNull();
Expand Down

0 comments on commit fb145e9

Please sign in to comment.