/
TransferFlowCustomTx.ts
63 lines (55 loc) Β· 1.14 KB
/
TransferFlowCustomTx.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
import {Type} from 'class-transformer';
import {IsIn, IsNotEmpty, IsOptional, Length, ValidateNested} from 'class-validator';
import {FlowMnemonicOrPrivateKeyOrSignatureId} from './FlowMnemonicOrPrivateKeyOrSignatureId';
const types = ['Identity',
'UInt',
'Int',
'UInt8',
'Int8',
'UInt16',
'Int16',
'UInt32',
'Int32',
'UInt64',
'Int64',
'UInt128',
'Int128',
'UInt256',
'Int256',
'Word8',
'Word16',
'Word32',
'Word64',
'UFix64',
'Fix64',
'String',
'Character',
'Bool',
'Address',
'Void',
'Optional',
'Reference',
'Array',
'Dictionary',
'Event',
'Resource',
'Struct'];
export class FlowArgs {
@IsNotEmpty()
public value: string | string[];
@IsNotEmpty()
@IsIn(types)
public type: string;
@IsOptional()
@IsIn(types)
public subType?: string;
}
export class TransferFlowCustomTx extends FlowMnemonicOrPrivateKeyOrSignatureId {
@IsNotEmpty()
@Length(1, 500000)
public transaction: string;
@IsOptional()
@ValidateNested({each: true})
@Type(() => FlowArgs)
public args: FlowArgs[];
}