• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Mintbase / mintbase-js / 3802521708

pending completion
3802521708

push

github

Ruben Marcus
fix method imports

182 of 258 branches covered (70.54%)

Branch coverage included in aggregate %.

456 of 501 relevant lines covered (91.02%)

3.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

55.56
/packages/sdk/src/list/list.ts
1
/* eslint-disable @typescript-eslint/camelcase */
2
import { DEFAULT_CONTRACT_ADDRESS, GAS, LISTING_DEPOSIT, MARKET_METHOD_NAMES, MB_MARKET_ADDRESS } from '../constants';
1✔
3
import { NearContractCall } from '../execute';
4

5
export type ListArgs = {
6
    nftContractId?: string;
7
    marketId?: string;
8
    price: string;
9
    tokenId: string;
10
  }
11

12
/**
13
 * Lists a token on mintbase market contract 
14
 * @param listArguments {@link ListArgs}
15
 * @returns contract call to be passed to @mintbase-js/sdk execute method
16
 */
17
export const list = (args: ListArgs): NearContractCall => {
1✔
18
  const { nftContractId = DEFAULT_CONTRACT_ADDRESS, tokenId, marketId = MB_MARKET_ADDRESS, price } = args;
1!
19
  
20
  if (nftContractId == null) {
1!
21
    throw new Error('You must provide a nftContractId or define a NFT_CONTRACT_ID enviroment variable to default to');
×
22
  }
23
  
24
  return {
1✔
25
    contractAddress: nftContractId,
26
    args: {
27
      token_id: tokenId,
28
      account_id: marketId,
29
      msg: JSON.stringify({
30
        price: price,
31
      }),
32
    },
33
    methodName: MARKET_METHOD_NAMES.LIST,
34
    deposit: LISTING_DEPOSIT,
35
    gas: GAS,
36
  };
37
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc