File tree Expand file tree Collapse file tree 4 files changed +20
-13
lines changed
apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components
packages/thirdweb/src/extensions/modules Expand file tree Collapse file tree 4 files changed +20
-13
lines changed Original file line number Diff line number Diff line change @@ -99,8 +99,8 @@ function MintableModule(props: ModuleInstanceProps) {
9999 if ( ! hasMinterRole . data ) {
100100 const grantRoleTx = prepareContractCall ( {
101101 contract,
102- method : "function grantRole (address user, uint256 role) public " ,
103- params : [ ownerAccount . address || "" , MINTER_ROLE ] ,
102+ method : "function grantRoles (address user, uint256 roles) " ,
103+ params : [ ownerAccount . address , MINTER_ROLE ] ,
104104 } ) ;
105105
106106 await sendAndConfirmTransaction ( {
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export function ModuleInstance(props: ModuleInstanceProps) {
3131 return < TransferableModule { ...props } /> ;
3232 }
3333
34- if ( props . contractInfo . name . includes ( "Mintable-ignore " ) ) {
34+ if ( props . contractInfo . name . includes ( "Mintable" ) ) {
3535 return < MintableModule { ...props } /> ;
3636 }
3737
Original file line number Diff line number Diff line change @@ -45,13 +45,17 @@ export function mintWithRole(
4545 return generatedMint ( {
4646 contract : options . contract ,
4747 asyncParams : async ( ) => {
48- const batchOfUris = await uploadOrExtractURIs (
49- [ options . nft ] ,
50- options . contract . client ,
51- ) ;
52- const baseURI = getBaseUriFromBatch ( batchOfUris ) ;
48+ let baseURI = "" ;
49+ if ( options . nft ) {
50+ const batchOfUris = await uploadOrExtractURIs (
51+ [ options . nft ] ,
52+ options . contract . client ,
53+ ) ;
54+ baseURI = getBaseUriFromBatch ( batchOfUris ) ;
55+ }
5356
5457 const tokenId = options . tokenId ?? maxUint256 ;
58+ console . log ( "tokenId: " , tokenId ) ;
5559 return {
5660 to : getAddress ( options . to ) ,
5761 tokenId,
Original file line number Diff line number Diff line change @@ -41,11 +41,14 @@ export function mintWithRole(options: BaseTransactionOptions<NFTMintParams>) {
4141 return generatedMint ( {
4242 contract : options . contract ,
4343 asyncParams : async ( ) => {
44- const batchOfUris = await uploadOrExtractURIs (
45- options . nfts ,
46- options . contract . client ,
47- ) ;
48- const baseURI = getBaseUriFromBatch ( batchOfUris ) ;
44+ let baseURI = "" ;
45+ if ( options . nfts ?. [ 0 ] !== "" ) {
46+ const batchOfUris = await uploadOrExtractURIs (
47+ options . nfts ,
48+ options . contract . client ,
49+ ) ;
50+ baseURI = getBaseUriFromBatch ( batchOfUris ) ;
51+ }
4952
5053 return {
5154 to : getAddress ( options . to ) ,
You can’t perform that action at this time.
0 commit comments