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 19, 2021
1 parent b18efa5 commit 3802c4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
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 3802c4e

Please sign in to comment.