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

Mintbase / mintbase-js / 6533234361

16 Oct 2023 12:00PM UTC coverage: 84.047%. First build
6533234361

Pull #411

github

tifrel
Make test more concise
Pull Request #411: Add key activity query

625 of 850 branches covered (0.0%)

Branch coverage included in aggregate %.

20 of 20 new or added lines in 4 files covered. (100.0%)

945 of 1018 relevant lines covered (92.83%)

4.77 hits per line

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

78.26
/packages/rpc/src/methods/keys.ts
1
import { requestFromNearRpc } from '../util';
1✔
2

3
export type AccessKey = {
4
  public_key: string;
5
  permission: AccessKeyPermissions;
6
};
7

8
export type AccessKeyPermissions = 'FullAccess' | {
9
  'FunctionCall': {
10
    allowance: string;
11
    receiver_id: string;
12
    method_names: string[];
13
  };
14
}
15

16
export const getAccessKeys = async (accountId: string): Promise<AccessKey[]> => {
3✔
17
  const res = await requestFromNearRpc({
3✔
18
    jsonrpc: '2.0',
19
    id: 'dontcare',
20
    method: 'query',
21
    params: {
22
      request_type: 'view_access_key_list',
23
      finality: 'final',
24
      account_id: accountId,
25
    },
26
  });
27

28
  const accessKeys = res?.result?.keys;
3!
29
  if (res?.error) {
3!
30
    throw res.error;
×
31
  }
32
  if (!accessKeys) {
3✔
33
    throw new Error(`Malformed response: ${JSON.stringify(res)}`);
2✔
34
  }
35
  return accessKeys;
1✔
36
};
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