Skip to content

Commit

Permalink
mint args explanation (#473)
Browse files Browse the repository at this point in the history
Co-authored-by: Till <[email protected]>
  • Loading branch information
rubenmarcus and tifrel authored Feb 13, 2024
1 parent 0489408 commit 0ad4081
Showing 1 changed file with 24 additions and 27 deletions.
51 changes: 24 additions & 27 deletions packages/sdk/src/mint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,39 @@ If you want to mint on a v2 smart contract, please [create metadata](../createMe

**As with all new SDK api methods, this call should be wrapped in [execute](../#execute) and passed a signing method. For a guide showing how to make a contract call with mintbase-js click [here](https://docs.mintbase.xyz/dev/getting-started/make-your-first-contract-call-deploycontract)**

## mint(args: MintArgs): NearContractCall
## mint(args: MintArgsV1): NearContractCall

`mint` takes a single argument of type `MintArgs`

```typescript
export type MintArgs = {
//the contractId from which you want to mint
//can be specified through CONTRACT_ADDRESS configuration / environment variables
contractAddress?: string;
//the intended owner of the token being minted
ownerId: string;
// metadata including title, description and reference materials
metadata: TokenMetadata;
options?: MintOptions;
noMedia?: boolean; // explicit opt-in to NFT without media, breaks wallets
noReference?: boolean; // explicit opt-in to NFT without reference
};
## MintArgsV1

- `contractAddress` (optional): The address of the contract where the token will be minted. If not provided, the TOKEN_CONTRACT environment variable will be used.

- `ownerId`: The NEAR account ID of the owner of the token that will be minted.

- `metadata`: An object containing the metadata of the token. It includes properties like title, description, media, etc.

export type MintArgs = {
//the contractId from which you want to mint, this can be statically defined via the mbjs config file
- `royalties` (optional): An object that specifies how the funds from the sale of the token will be split among different parties.

- `amount` (optional): The number of copies of the token that you want to mint. If not provided, only one copy will be minted.

- `noMedia` (optional): If you mint a token with `metadata.media = null`, this method will throw an error. While the Mintbase Market can generally deal with media in the reference material, many third parties, most notably wallets, cannot. To disable this check and explicitly mint with the risk of breaking third-party compatibility, use `noMedia: true`

- `noReference` (optional): Similar to `noMedia`, but with respect to the `metadata.reference` field. This is less crucial for NFT display, but Mintbase NFTs usually come with rich data that does not fit into the NEAR metadata standards, and are thus stored using the `reference` URI.


## Types


```typescript
export type MintArgsV1 = {
contractAddress?: string;
//the intended owner of the token being minted
ownerId: string;
//on chain metadata, currently reference and media must be provided unless clearly opted out using the noMedia or noReference args
//the storage module returns the media hash to be provided to the media key in the metadata object when uploading as well as the referenceId which should be supplied to the reference key.
metadata: TokenMetadata;
//permanent royalties to be paid on every token sale provided in a Record of keys (accountIds) and values (amount)
//the royalty total is capped at 0.5 eg: {"test1.near" : 0.2, "test2.near": 0.3}
royalties?: Splits;
//amount of tokens with the same metadata you would like to mint
amount?: number;
// explicit opt-in to NFT without media, breaks wallets
noMedia?: boolean;
// explicit opt-in to NFT without reference
noReference?: boolean;
tokenIdsToMint?: number[];
noMedia?: boolean; // explicit opt-in to NFT without media, breaks wallets
noReference?: boolean; // explicit opt-in to NFT without reference
};

export type TokenMetadata = {
Expand Down

0 comments on commit 0ad4081

Please sign in to comment.