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

Mintbase / mintbase-js / 6638614503

25 Oct 2023 09:45AM UTC coverage: 84.019%. First build
6638614503

Pull #419

github

sainthiago
add extra fields
Pull Request #419: upload reference test

629 of 857 branches covered (0.0%)

Branch coverage included in aggregate %.

10 of 10 new or added lines in 1 file covered. (100.0%)

964 of 1039 relevant lines covered (92.78%)

4.8 hits per line

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

73.68
/packages/sdk/src/list/list.ts
1
/* eslint-disable @typescript-eslint/camelcase */
2
import { mbjs } from '../config/config';
1✔
3
import { GAS, LISTING_DEPOSIT } from '../constants';
1✔
4
import { ERROR_MESSAGES } from '../errorMessages';
1✔
5
import { ListArgs, ListArgsResponse, MARKET_METHOD_NAMES, NearContractCall } from '../types';
1✔
6

7

8
/**
9
 * Lists a token on mintbase market contract
10
 * @param listArguments {@link ListArgs}
11
 * @returns contract call to be passed to @mintbase-js/sdk execute method
12
 */
13
export const list = (args: ListArgs): NearContractCall<ListArgsResponse> => {
1✔
14
  const { contractAddress = mbjs.keys.contractAddress, tokenId, marketAddress = mbjs.keys.marketAddress, price } = args;
3!
15

16
  if (contractAddress == null) {
3!
17
    throw new Error(ERROR_MESSAGES.CONTRACT_ADDRESS);
×
18
  }
19

20
  const msg: { price: string; ft_contract?: string } = { price: price };
3✔
21
  if (args.ft) {
3✔
22
    const ftContractId = mbjs.keys.ftAddresses[args.ft];
2✔
23
    msg.ft_contract = ftContractId;
2✔
24
  }
25

26
  return {
3✔
27
    contractAddress: contractAddress || mbjs.keys.contractAddress,
3!
28
    args: {
29
      token_id: tokenId,
30
      account_id: marketAddress,
31
      msg: JSON.stringify(msg),
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