/
MintMultipleErc721.ts
83 lines (67 loc) Β· 1.63 KB
/
MintMultipleErc721.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import {
IsArray,
IsBoolean,
IsIn,
IsNotEmpty,
IsOptional,
IsUUID,
Length,
Min,
Validate,
ValidateIf,
} from 'class-validator'
import { Currency } from './Currency'
import { Mint721BatchBuiltInPrivateKeyValidator } from '../validation/Mint721BatchBuiltInPrivateKeyValidator'
export class MintMultipleErc721 {
@IsNotEmpty()
@IsArray()
public to: string[];
@IsNotEmpty()
@IsArray()
public tokenId: string[];
@Validate(Mint721BatchBuiltInPrivateKeyValidator)
@IsNotEmpty()
@IsArray()
public url: string[];
@IsOptional()
@Length(42, 43)
public minter?: string;
@IsNotEmpty()
@IsIn([Currency.BSC, Currency.ETH, Currency.CELO, Currency.KLAY, Currency.ONE, Currency.MATIC])
public chain: Currency;
@IsNotEmpty()
@Length(42, 43)
public contractAddress: string;
@Min(0)
@IsOptional()
public nonce?: number;
@IsBoolean()
@IsOptional()
@ValidateIf(o => o.provenance && o.fixedValues)
public provenance?: boolean;
@IsArray()
@IsOptional()
@ValidateIf(o => o.authorAddresses && o.cashbackValues)
public authorAddresses?: string[][];
@IsArray()
@IsOptional()
@ValidateIf(o => o.authorAddresses && o.cashbackValues)
public cashbackValues?: string[][];
@IsOptional()
@IsArray()
@ValidateIf(o => o.provenance && o.fixedValues)
public fixedValues?: string[][];
@IsOptional()
@ValidateIf(o => o.authorAddresses && o.cashbackValues)
public erc20?: string;
@IsOptional()
@Length(64, 66)
public fromPrivateKey?: string;
@IsOptional()
@IsUUID('4')
public signatureId?: string;
@ValidateIf(o => o.signatureId)
@IsOptional()
@Min(0)
public index?: number;
}