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

Mintbase / mintbase-js / 3782209270

pending completion
3782209270

push

github

Sérgio
📝Docs fixes and improvements

184 of 258 branches covered (71.32%)

Branch coverage included in aggregate %.

460 of 503 relevant lines covered (91.45%)

3.0 hits per line

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

66.67
/packages/sdk/src/burn/burn.ts
1
import { NearContractCall } from '../execute';
2
import { GAS, ONE_YOCTO, TOKEN_METHOD_NAMES } from '../constants';
1✔
3

4
export type BurnArgs = {
5
  nftContractId?: string;
6
  tokenIds: string[];
7
};
8

9
export const DEPOSIT_FOR_BURN = ONE_YOCTO;
1✔
10
export const GAS_FOR_BURN = GAS;
1✔
11
const DEFAULT_CONTRACT_ADDRESS = process.env.TOKEN_CONTRACT || null;
1✔
12

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

20
  if (nftContractId == null) {
2!
21
    throw new Error('You must provide a nftContractId or define a NFT_CONTRACT_ID enviroment variable to default to');
×
22
  }
23

24
  if (tokenIds.length === 0) {
2!
25
    throw new Error('Burn contract call should not have an empty array of tokens ids');
×
26
  }
27

28
  return {
2✔
29
    contractAddress: nftContractId,
30
    methodName: TOKEN_METHOD_NAMES.BATCH_BURN,
31
    args: {
32
      token_ids: tokenIds,
33
    },
34
    deposit: DEPOSIT_FOR_BURN,
35
    gas: GAS_FOR_BURN,
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