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

Mintbase / mintbase-js / 8845566891

26 Apr 2024 08:42AM CUT coverage: 77.325%. First build
8845566891

Pull #504

github

tifrel
Lint & test
Pull Request #504: Fix v2 contract deployment

893 of 1346 branches covered (66.34%)

Branch coverage included in aggregate %.

6 of 7 new or added lines in 1 file covered. (85.71%)

1211 of 1375 relevant lines covered (88.07%)

13.74 hits per line

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

50.0
/packages/sdk/src/burn/burn.ts
1
import { DEPOSIT_FOR_BURN, GAS_FOR_BURN } from '../constants';
3✔
2
import { mbjs } from '../config/config';
3✔
3
import { TOKEN_METHOD_NAMES, NearContractCall, BurnArgs, BurnArgsResponse } from '../types';
3✔
4
import { ERROR_MESSAGES } from '../errorMessages';
3✔
5

6

7
/**
8
 * Burns one or more tokens from a given contract.
9
 * @param burnArguments {@link BurnArgs}
10
 * @returns contract call to be passed to @mintbase-js/sdk execute method
11
 */
12
export const burn = ({ tokenIds, contractAddress = mbjs.keys.contractAddress }: BurnArgs): NearContractCall<BurnArgsResponse> => {
3!
13

14
  if (!contractAddress) {
6!
15
    throw new Error(ERROR_MESSAGES.CONTRACT_ADDRESS);
×
16
  }
17

18
  if (tokenIds.length === 0) {
6!
19
    throw new Error(ERROR_MESSAGES.BURN_TOKEN_IDS);
×
20
  }
21

22
  return {
6✔
23
    contractAddress: contractAddress || mbjs.keys.contractAddress,
4!
24
    methodName: TOKEN_METHOD_NAMES.BATCH_BURN,
25
    args: {
26
      token_ids: tokenIds,
27
    },
28
    deposit: DEPOSIT_FOR_BURN,
29
    gas: GAS_FOR_BURN,
30
  };
31
};
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