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

Mintbase / mintbase-js / 9679496034

26 Jun 2024 12:19PM CUT coverage: 75.281%. First build
9679496034

Pull #517

github

sainthiago
v
Pull Request #517: [feature]: add bitte-wallet in wallet package

909 of 1395 branches covered (65.16%)

Branch coverage included in aggregate %.

12 of 62 new or added lines in 2 files covered. (19.35%)

1235 of 1453 relevant lines covered (85.0%)

13.45 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