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

Mintbase / mintbase-js / 8358198021

20 Mar 2024 11:32AM CUT coverage: 77.205%. First build
8358198021

Pull #494

github

rubenmarcus
update @mintbase-js/react with lak keys support
Pull Request #494: update @mintbase-js/react with lak keys support

884 of 1336 branches covered (66.17%)

Branch coverage included in aggregate %.

1199 of 1362 relevant lines covered (88.03%)

13.67 hits per line

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

60.0
/packages/sdk/src/lockMetadata/lockMetadata.ts
1
import BN from 'bn.js';
2
import { mbjs } from '../config/config';
3✔
3
import { GAS, STORAGE_BYTES, STORAGE_PRICE_PER_BYTE_EXPONENT } from '../constants';
3✔
4
import { ERROR_MESSAGES } from '../errorMessages';
3✔
5
import { LockMetadataArgs, LockMetadataArgsResponse, NearContractCall, TOKEN_METHOD_NAMES } from '../types';
3✔
6
import { isIntString, isStoreV2 } from '../utils';
3✔
7

8
/**
9
 * Mint a token given via reference json on a given contract with a specified owner, amount of copies as well and royalties can be specified via options
10
 * @param mintArguments {@link MintArgs}
11
 * @returns contract call to be passed to @mintbase-js/sdk execute method
12
 */
13
export const lockMetadata = (
3✔
14
  args: LockMetadataArgs,
15
): NearContractCall<LockMetadataArgsResponse> => {
16
  const {
17
    contractAddress = mbjs.keys.contractAddress,
×
18
    metadataId,
19
  } = args;
3✔
20

21
  if (!contractAddress) {
3!
22
    throw new Error(ERROR_MESSAGES.CONTRACT_ADDRESS);
×
23
  }
24

25
  if (!isStoreV2(contractAddress)) {
3!
26
    throw new Error(ERROR_MESSAGES.ONLY_V2);
×
27
  }
28

29
  if (!isIntString(metadataId)) {
3!
30
    throw new Error(ERROR_MESSAGES.METADATA_ID_NOT_INT);
×
31
  }
32

33
  return {
3✔
34
    contractAddress: contractAddress || mbjs.keys.contractAddress,
2!
35
    args: {
36
      metadata_id: metadataId,
37
    },
38
    methodName: TOKEN_METHOD_NAMES.LOCK_METADATA,
39
    gas: GAS,
40
    deposit: '1',
41
  };
42
};
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