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

Mintbase / mintbase-js / 3930349100

pending completion
3930349100

push

github

Ruben Marcus
Merge branch 'alpha' into fix-callback-test

461 of 611 branches covered (75.45%)

Branch coverage included in aggregate %.

676 of 726 relevant lines covered (93.11%)

4.32 hits per line

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

64.29
/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 { NearContractCall } from '../execute';
6
import { MARKET_METHOD_NAMES } from '../types';
1✔
7

8
export type ListArgs = {
9
    contractAddress?: string;
10
    marketAddress?: string;
11
    price: string;
12
    tokenId: string;
13
  }
14

15
/**
16
 * Lists a token on mintbase market contract 
17
 * @param listArguments {@link ListArgs}
18
 * @returns contract call to be passed to @mintbase-js/sdk execute method
19
 */
20
export const list = (args: ListArgs): NearContractCall => {
1✔
21
  const { contractAddress = mbjs.keys.contractAddress, tokenId, marketAddress = mbjs.keys.marketAddress, price } = args;
1!
22
  
23
  if (contractAddress == null) {
1!
24
    throw new Error(ERROR_MESSAGES.CONTRACT_ADDRESS);
×
25
  }
26
  
27
  return {
1✔
28
    contractAddress: contractAddress || mbjs.keys.contractAddress,
1!
29
    args: {
30
      token_id: tokenId,
31
      account_id: marketAddress,
32
      msg: JSON.stringify({
33
        price: price,
34
      }),
35
    },
36
    methodName: MARKET_METHOD_NAMES.LIST,
37
    deposit: LISTING_DEPOSIT,
38
    gas: GAS,
39
  };
40
};
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