Marketplace 2.0

Mintbase is introducing a new marketplace contract that enables arbitrary accounts to collect the market fee when a token is sold with a registered referral id.

Affiliate Program

No need to build an indexer or deploy market contracts, just focus on your market ui.

List a token

Listing a token to the marketplace requires two function calls. The first to reserve storage in the contract for the listing and other to authorize the marketplace to transfer the token once sold.

Storage deposit

The new market requires a 0.01N storage deposit per listing. This amount is transferred back when the token is sold or it's unlisted from the marketplace.

  • Method: deposit_storage

  • Receiver Id: the market contract address

  • Arguments: none

  • Deposit: 0.01N

  • Gas: 200 TGas

near call <market-contract> deposit_storage '{}' --deposit 0.01 --accountId <your-account>h

Authorize the market

  • Method: nft_approve

  • Receiver Id: the token contract address

  • Arguments:

    • account_id: the market contract address

    • token_id: the token id

    • msg: a stringified object that contains price expressed in yoctoNEAR

      • e.g "{"price":"500000000000000000000000"}"

  • Deposit: 0.0008 NEAR

  • Gas: 200 TGas

near call <nft-contract> nft_approve '{"account_id": <market-contract>, "token_id": <token-id>, "msg": "{\"price\":\"<amount-yocto>\"}"}' --depositYocto 1 --accountId <your-account>

Buy a token

Once an account is registered for collecting fees (see above) it can start collecting market fees for being a referral.

Buy

  • Method: buy

  • Receiver Id: the market address

  • Arguments:

    • nft_contract_id: the token contract address

    • token_id: the token id

    • referrer_id (optional): the account address that will collect the market fee

      • ⚠️ Note that the referrer_id has to be registered first by Mintbase (see above)

  • Deposit: the token listing price

  • Gas: 200 TGas

near call <market-contract> buy '{"nft_contract_id": <nft-contract>, "token_id": <token-id>, "referrer_id": <referrer-id>}' --depositYocto <price-yocto> --accountId <your-account>

Last updated