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

Mintbase / mintbase-js / 6737174789

02 Nov 2023 07:09PM UTC coverage: 80.789%. First build
6737174789

Pull #424

github

rubenmarcus
new beta
Pull Request #424: new beta

634 of 929 branches covered (0.0%)

Branch coverage included in aggregate %.

964 of 1049 relevant lines covered (91.9%)

4.7 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