generated from PolymeshAssociation/typescript-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 11
/
CorporateAction.ts
64 lines (57 loc) · 1.58 KB
/
CorporateAction.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import BigNumber from 'bignumber.js';
import { Context, CorporateActionBase, modifyCaCheckpoint } from '~/internal';
import {
CorporateActionKind,
CorporateActionTargets,
ModifyCaCheckpointParams,
ProcedureMethod,
TaxWithholding,
} from '~/types';
import { HumanReadableType } from '~/types/utils';
import { createProcedureMethod } from '~/utils/internal';
export interface UniqueIdentifiers {
id: BigNumber;
ticker: string;
}
export interface HumanReadable {
id: string;
ticker: string;
declarationDate: string;
description: string;
targets: HumanReadableType<CorporateActionTargets>;
defaultTaxWithholding: string;
taxWithholdings: HumanReadableType<TaxWithholding[]>;
}
export interface Params {
kind: CorporateActionKind;
declarationDate: Date;
description: string;
targets: CorporateActionTargets;
defaultTaxWithholding: BigNumber;
taxWithholdings: TaxWithholding[];
}
/**
* Represents an action initiated by the issuer of an Asset which may affect the positions of
* the Asset Holders
*/
export class CorporateAction extends CorporateActionBase {
/**
* @hidden
*/
public constructor(args: UniqueIdentifiers & Params, context: Context) {
super(args, context);
this.modifyCheckpoint = createProcedureMethod(
{
getProcedureAndArgs: modifyCaCheckpointArgs => [
modifyCaCheckpoint,
{ corporateAction: this, ...modifyCaCheckpointArgs },
],
},
context
);
}
/**
* Modify the Corporate Action's Checkpoint
*/
public modifyCheckpoint: ProcedureMethod<ModifyCaCheckpointParams, void>;
}