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

Mintbase / mintbase-js / 3932668827

pending completion
3932668827

push

github

Ruben Marcus
replace the package name

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.71
/packages/sdk/src/burn/burn.ts
1
import { NearContractCall } from '../execute';
2
import { GAS, ONE_YOCTO } from '../constants';
1✔
3
import { mbjs } from '../config/config';
1✔
4
import { TOKEN_METHOD_NAMES } from '../types';
1✔
5
import { ERROR_MESSAGES } from '../errorMessages';
1✔
6

7
export type BurnArgs = {
8
  contractAddress?: string;
9
  tokenIds: string[];
10
};
11

12
export const DEPOSIT_FOR_BURN = ONE_YOCTO;
1✔
13
export const GAS_FOR_BURN = GAS;
1✔
14

15
/**
16
 * Burns one or more tokens from a given contract.
17
 * @param burnArguments {@link BurnArgs}
18
 * @returns contract call to be passed to @mintbase-js/sdk execute method
19
 */
20
export const burn = ({ tokenIds, contractAddress = mbjs.keys.contractAddress }: BurnArgs): NearContractCall => {
1!
21

22
  if (contractAddress == null) {
2!
23
    throw new Error(ERROR_MESSAGES.CONTRACT_ADDRESS);
×
24
  }
25

26
  if (tokenIds.length === 0) {
2!
27
    throw new Error(ERROR_MESSAGES.BURN_TOKEN_IDS);
×
28
  }
29

30
  return {
2✔
31
    contractAddress: contractAddress || mbjs.keys.contractAddress,
2!
32
    methodName: TOKEN_METHOD_NAMES.BATCH_BURN,
33
    args: {
34
      token_ids: tokenIds,
35
    },
36
    deposit: DEPOSIT_FOR_BURN,
37
    gas: GAS_FOR_BURN,
38
  };
39
};
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