Ask or search…
K
Links

removeMinter

Remove minter from a smart contract you own
As with all new SDK api methods, this call should be wrapped in execute and passed a signing method

removeMinter(args: removeMinterArgs): NearContractCall

removeMinter takes a single argument of type AddMinterArgs
type AddMinterArgs = {
//the contract you own for which you wish to grant minting access
//as an argument or through CONTRACT_ADDRESS env
nftContractId?: string;
//the id of the account that will be allowed to mint on the corresponding nftContractId
minterId: string;
};

React example

Example usage of removeMinter method in a hypothetical React component:
RemoveMinterComponent.ts
1
import { useState } from 'react';
2
import { useWallet } from '@mintbase-js/react';
3
import { execute, removeMinter, RemoveMinterArgs } from '@mintbase-js/sdk';
4
5
6
export const RemoveMinterComponent = ({ contractAddress, minterId }: RemoveMinterArgs) : JSX.Element => {
7
8
const { selector } = useWallet();
9
10
const handleRemoveMinter = async (): Promise<void> => {
11
const wallet = await selector.wallet();
12
await execute(
13
removeMinter({ contractAddress: contractAddress, minterId: minterId })
14
);
15
}
16
17
return (
18
<div>
19
<button onClick={handleRemoveMinter}>
20
removeMinter from contract you own
21
</button>
22
</div>
23
);
24
};