/
setAccountInfo.ts
30 lines (27 loc) · 1.05 KB
/
setAccountInfo.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
* Copyright (c) 2021 Burst Apps Team
* Copyright (c) 2022 Signum Network
*/
import {ChainService} from '../../../service/chainService';
import {UnsignedTransaction} from '../../../typings/unsignedTransaction';
import {DefaultDeadline} from '../../../constants';
import {SetAccountInfoArgs} from '../../../typings/args/setAccountInfoArgs';
import {signIfPrivateKey} from '../../../internal/signIfPrivateKey';
/**
* Use with [[ApiComposer]] and belongs to [[AccountApi]].
*
* See details at [[AccountApi.setAccountInfo]]
* @module core.api.factories
*/
export const setAccountInfo = (service: ChainService) =>
(args: SetAccountInfoArgs) =>
signIfPrivateKey(service, args, async (a: SetAccountInfoArgs) => {
const parameters = {
name: a.name,
description: a.description,
deadline: DefaultDeadline,
feeNQT: a.feePlanck,
publicKey: a.senderPublicKey
};
return service.send<UnsignedTransaction>('setAccountInfo', parameters);
});