@gala-chain/launchpad 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dev-env +7 -0
- package/.dockerignore +9 -0
- package/.eslintignore +4 -0
- package/.eslintrc.json +37 -0
- package/.github/workflows/publish-on-tag.yml +72 -0
- package/.github/workflows/test-on-push.yml +32 -0
- package/.nvmrc +1 -0
- package/.prettierignore +4 -0
- package/.prettierrc +12 -0
- package/Dockerfile +31 -0
- package/LICENSE +201 -0
- package/README.md +2 -0
- package/api-config.json +16 -0
- package/e2e/__snapshots__/api.spec.ts.snap +2482 -0
- package/e2e/api-config.json +17 -0
- package/e2e/api.spec.ts +48 -0
- package/e2e/jest.config.js +42 -0
- package/e2e/tsconfig.json +10 -0
- package/jest.config.ts +27 -0
- package/lib/jest.config.d.ts +13 -0
- package/lib/jest.config.d.ts.map +1 -0
- package/lib/jest.config.js +28 -0
- package/lib/jest.config.js.map +1 -0
- package/lib/package.json +54 -0
- package/lib/src/api/index.d.ts +4 -0
- package/lib/src/api/index.d.ts.map +1 -0
- package/lib/src/api/index.js +21 -0
- package/lib/src/api/index.js.map +1 -0
- package/lib/src/api/types/LaunchpadDtos.d.ts +102 -0
- package/lib/src/api/types/LaunchpadDtos.d.ts.map +1 -0
- package/lib/src/api/types/LaunchpadDtos.js +410 -0
- package/lib/src/api/types/LaunchpadDtos.js.map +1 -0
- package/lib/src/api/types/LaunchpadFeeConfig.d.ts +9 -0
- package/lib/src/api/types/LaunchpadFeeConfig.d.ts.map +1 -0
- package/lib/src/api/types/LaunchpadFeeConfig.js +56 -0
- package/lib/src/api/types/LaunchpadFeeConfig.js.map +1 -0
- package/lib/src/api/types/LaunchpadFinalizeAllocation.d.ts +10 -0
- package/lib/src/api/types/LaunchpadFinalizeAllocation.d.ts.map +1 -0
- package/lib/src/api/types/LaunchpadFinalizeAllocation.js +70 -0
- package/lib/src/api/types/LaunchpadFinalizeAllocation.js.map +1 -0
- package/lib/src/api/types/LaunchpadSale.d.ts +35 -0
- package/lib/src/api/types/LaunchpadSale.d.ts.map +1 -0
- package/lib/src/api/types/LaunchpadSale.js +195 -0
- package/lib/src/api/types/LaunchpadSale.js.map +1 -0
- package/lib/src/api/types/index.d.ts +5 -0
- package/lib/src/api/types/index.d.ts.map +1 -0
- package/lib/src/api/types/index.js +22 -0
- package/lib/src/api/types/index.js.map +1 -0
- package/lib/src/api/utils/error.d.ts +20 -0
- package/lib/src/api/utils/error.d.ts.map +1 -0
- package/lib/src/api/utils/error.js +35 -0
- package/lib/src/api/utils/error.js.map +1 -0
- package/lib/src/api/utils/index.d.ts +2 -0
- package/lib/src/api/utils/index.d.ts.map +1 -0
- package/lib/src/api/utils/index.js +19 -0
- package/lib/src/api/utils/index.js.map +1 -0
- package/lib/src/api/validators/decorators.d.ts +19 -0
- package/lib/src/api/validators/decorators.d.ts.map +1 -0
- package/lib/src/api/validators/decorators.js +391 -0
- package/lib/src/api/validators/decorators.js.map +1 -0
- package/lib/src/api/validators/index.d.ts +2 -0
- package/lib/src/api/validators/index.d.ts.map +1 -0
- package/lib/src/api/validators/index.js +19 -0
- package/lib/src/api/validators/index.js.map +1 -0
- package/lib/src/chaincode/LaunchpadContract.d.ts +20 -0
- package/lib/src/chaincode/LaunchpadContract.d.ts.map +1 -0
- package/lib/src/chaincode/LaunchpadContract.js +217 -0
- package/lib/src/chaincode/LaunchpadContract.js.map +1 -0
- package/lib/src/chaincode/dexLaunchpadFeeGate.d.ts +14 -0
- package/lib/src/chaincode/dexLaunchpadFeeGate.d.ts.map +1 -0
- package/lib/src/chaincode/dexLaunchpadFeeGate.js +47 -0
- package/lib/src/chaincode/dexLaunchpadFeeGate.js.map +1 -0
- package/lib/src/chaincode/index.d.ts +2 -0
- package/lib/src/chaincode/index.d.ts.map +1 -0
- package/lib/src/chaincode/index.js +19 -0
- package/lib/src/chaincode/index.js.map +1 -0
- package/lib/src/chaincode/launchpad/buyExactToken.d.ts +20 -0
- package/lib/src/chaincode/launchpad/buyExactToken.d.ts.map +1 -0
- package/lib/src/chaincode/launchpad/buyExactToken.js +113 -0
- package/lib/src/chaincode/launchpad/buyExactToken.js.map +1 -0
- package/lib/src/chaincode/launchpad/buyWithNative.d.ts +22 -0
- package/lib/src/chaincode/launchpad/buyWithNative.d.ts.map +1 -0
- package/lib/src/chaincode/launchpad/buyWithNative.js +106 -0
- package/lib/src/chaincode/launchpad/buyWithNative.js.map +1 -0
- package/lib/src/chaincode/launchpad/callMemeTokenIn.d.ts +27 -0
- package/lib/src/chaincode/launchpad/callMemeTokenIn.d.ts.map +1 -0
- package/lib/src/chaincode/launchpad/callMemeTokenIn.js +76 -0
- package/lib/src/chaincode/launchpad/callMemeTokenIn.js.map +1 -0
- package/lib/src/chaincode/launchpad/callMemeTokenOut.d.ts +25 -0
- package/lib/src/chaincode/launchpad/callMemeTokenOut.d.ts.map +1 -0
- package/lib/src/chaincode/launchpad/callMemeTokenOut.js +56 -0
- package/lib/src/chaincode/launchpad/callMemeTokenOut.js.map +1 -0
- package/lib/src/chaincode/launchpad/callNativeTokenIn.d.ts +25 -0
- package/lib/src/chaincode/launchpad/callNativeTokenIn.d.ts.map +1 -0
- package/lib/src/chaincode/launchpad/callNativeTokenIn.js +51 -0
- package/lib/src/chaincode/launchpad/callNativeTokenIn.js.map +1 -0
- package/lib/src/chaincode/launchpad/callNativeTokenOut.d.ts +26 -0
- package/lib/src/chaincode/launchpad/callNativeTokenOut.d.ts.map +1 -0
- package/lib/src/chaincode/launchpad/callNativeTokenOut.js +60 -0
- package/lib/src/chaincode/launchpad/callNativeTokenOut.js.map +1 -0
- package/lib/src/chaincode/launchpad/configureLaunchpadFeeConfig.d.ts +4 -0
- package/lib/src/chaincode/launchpad/configureLaunchpadFeeConfig.d.ts.map +1 -0
- package/lib/src/chaincode/launchpad/configureLaunchpadFeeConfig.js +58 -0
- package/lib/src/chaincode/launchpad/configureLaunchpadFeeConfig.js.map +1 -0
- package/lib/src/chaincode/launchpad/createSale.d.ts +26 -0
- package/lib/src/chaincode/launchpad/createSale.d.ts.map +1 -0
- package/lib/src/chaincode/launchpad/createSale.js +129 -0
- package/lib/src/chaincode/launchpad/createSale.js.map +1 -0
- package/lib/src/chaincode/launchpad/fees.d.ts +6 -0
- package/lib/src/chaincode/launchpad/fees.d.ts.map +1 -0
- package/lib/src/chaincode/launchpad/fees.js +85 -0
- package/lib/src/chaincode/launchpad/fees.js.map +1 -0
- package/lib/src/chaincode/launchpad/fetchLaunchpadAdressConfig.d.ts +4 -0
- package/lib/src/chaincode/launchpad/fetchLaunchpadAdressConfig.d.ts.map +1 -0
- package/lib/src/chaincode/launchpad/fetchLaunchpadAdressConfig.js +36 -0
- package/lib/src/chaincode/launchpad/fetchLaunchpadAdressConfig.js.map +1 -0
- package/lib/src/chaincode/launchpad/fetchSaleDetails.d.ts +19 -0
- package/lib/src/chaincode/launchpad/fetchSaleDetails.d.ts.map +1 -0
- package/lib/src/chaincode/launchpad/fetchSaleDetails.js +49 -0
- package/lib/src/chaincode/launchpad/fetchSaleDetails.js.map +1 -0
- package/lib/src/chaincode/launchpad/finaliseSale.d.ts +4 -0
- package/lib/src/chaincode/launchpad/finaliseSale.d.ts.map +1 -0
- package/lib/src/chaincode/launchpad/finaliseSale.js +144 -0
- package/lib/src/chaincode/launchpad/finaliseSale.js.map +1 -0
- package/lib/src/chaincode/launchpad/finalizeTokenAllocation.d.ts +4 -0
- package/lib/src/chaincode/launchpad/finalizeTokenAllocation.d.ts.map +1 -0
- package/lib/src/chaincode/launchpad/finalizeTokenAllocation.js +43 -0
- package/lib/src/chaincode/launchpad/finalizeTokenAllocation.js.map +1 -0
- package/lib/src/chaincode/launchpad/index.d.ts +15 -0
- package/lib/src/chaincode/launchpad/index.d.ts.map +1 -0
- package/lib/src/chaincode/launchpad/index.js +32 -0
- package/lib/src/chaincode/launchpad/index.js.map +1 -0
- package/lib/src/chaincode/launchpad/preMintCalculation.d.ts +17 -0
- package/lib/src/chaincode/launchpad/preMintCalculation.d.ts.map +1 -0
- package/lib/src/chaincode/launchpad/preMintCalculation.js +56 -0
- package/lib/src/chaincode/launchpad/preMintCalculation.js.map +1 -0
- package/lib/src/chaincode/launchpad/sellExactToken.d.ts +22 -0
- package/lib/src/chaincode/launchpad/sellExactToken.d.ts.map +1 -0
- package/lib/src/chaincode/launchpad/sellExactToken.js +102 -0
- package/lib/src/chaincode/launchpad/sellExactToken.js.map +1 -0
- package/lib/src/chaincode/launchpad/sellWithNative.d.ts +23 -0
- package/lib/src/chaincode/launchpad/sellWithNative.d.ts.map +1 -0
- package/lib/src/chaincode/launchpad/sellWithNative.js +97 -0
- package/lib/src/chaincode/launchpad/sellWithNative.js.map +1 -0
- package/lib/src/chaincode/utils/index.d.ts +2 -0
- package/lib/src/chaincode/utils/index.d.ts.map +1 -0
- package/lib/src/chaincode/utils/index.js +19 -0
- package/lib/src/chaincode/utils/index.js.map +1 -0
- package/lib/src/chaincode/utils/launchpadSaleUtils.d.ts +11 -0
- package/lib/src/chaincode/utils/launchpadSaleUtils.d.ts.map +1 -0
- package/lib/src/chaincode/utils/launchpadSaleUtils.js +65 -0
- package/lib/src/chaincode/utils/launchpadSaleUtils.js.map +1 -0
- package/lib/src/cli.d.ts +3 -0
- package/lib/src/cli.d.ts.map +1 -0
- package/lib/src/cli.js +41 -0
- package/lib/src/cli.js.map +1 -0
- package/lib/src/index.d.ts +14 -0
- package/lib/src/index.d.ts.map +1 -0
- package/lib/src/index.js +32 -0
- package/lib/src/index.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/package.json +54 -0
- package/src/api/index.ts +18 -0
- package/src/api/types/LaunchpadDtos.ts +362 -0
- package/src/api/types/LaunchpadFeeConfig.ts +45 -0
- package/src/api/types/LaunchpadFinalizeAllocation.ts +65 -0
- package/src/api/types/LaunchpadSale.ts +200 -0
- package/src/api/types/index.ts +19 -0
- package/src/api/utils/error.ts +32 -0
- package/src/api/utils/index.ts +16 -0
- package/src/api/validators/decorators.spec.ts +277 -0
- package/src/api/validators/decorators.ts +401 -0
- package/src/api/validators/index.ts +16 -0
- package/src/chaincode/LaunchpadContract.ts +211 -0
- package/src/chaincode/dexLaunchpadFeeGate.ts +43 -0
- package/src/chaincode/index.ts +16 -0
- package/src/chaincode/launchpad/buyExactToken.ts +128 -0
- package/src/chaincode/launchpad/buyWithNative.ts +120 -0
- package/src/chaincode/launchpad/callMemeTokenIn.ts +82 -0
- package/src/chaincode/launchpad/callMemeTokenOut.ts +80 -0
- package/src/chaincode/launchpad/callNativeTokenIn.ts +71 -0
- package/src/chaincode/launchpad/callNativeTokenOut.ts +81 -0
- package/src/chaincode/launchpad/configureLaunchpadFeeConfig.ts +69 -0
- package/src/chaincode/launchpad/createSale.ts +157 -0
- package/src/chaincode/launchpad/fees.ts +105 -0
- package/src/chaincode/launchpad/fetchLaunchpadAdressConfig.ts +38 -0
- package/src/chaincode/launchpad/fetchSaleDetails.ts +53 -0
- package/src/chaincode/launchpad/finaliseSale.ts +217 -0
- package/src/chaincode/launchpad/finalizeTokenAllocation.ts +47 -0
- package/src/chaincode/launchpad/index.ts +28 -0
- package/src/chaincode/launchpad/preMintCalculation.ts +61 -0
- package/src/chaincode/launchpad/sellExactToken.ts +122 -0
- package/src/chaincode/launchpad/sellWithNative.ts +112 -0
- package/src/chaincode/utils/index.ts +15 -0
- package/src/chaincode/utils/launchpadSaleUtils.ts +68 -0
- package/src/cli.ts +63 -0
- package/src/index.ts +32 -0
- package/tsconfig.base.json +29 -0
- package/tsconfig.json +19 -0
- package/tsconfig.spec.json +11 -0
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Gala Games Inc. All rights reserved.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
import {
|
|
16
|
+
BigNumberProperty,
|
|
17
|
+
ChainCallDTO,
|
|
18
|
+
ChainObject,
|
|
19
|
+
IsUserAlias,
|
|
20
|
+
SubmitCallDTO,
|
|
21
|
+
TokenBalance,
|
|
22
|
+
UserAlias
|
|
23
|
+
} from "@gala-chain/api";
|
|
24
|
+
import BigNumber from "bignumber.js";
|
|
25
|
+
import { Type } from "class-transformer";
|
|
26
|
+
import {
|
|
27
|
+
IsBoolean,
|
|
28
|
+
IsNotEmpty,
|
|
29
|
+
IsNumber,
|
|
30
|
+
IsOptional,
|
|
31
|
+
IsString,
|
|
32
|
+
Max,
|
|
33
|
+
Min,
|
|
34
|
+
ValidateNested
|
|
35
|
+
} from "class-validator";
|
|
36
|
+
|
|
37
|
+
// TODO: Move to @gala-chain/api
|
|
38
|
+
import { BigNumberIsNotNegative, BigNumberLessThanOrEqualOther, BigNumberMax } from "../validators";
|
|
39
|
+
import { IsNonZeroBigNumber } from "../validators";
|
|
40
|
+
|
|
41
|
+
export class ReverseBondingCurveConfigurationChainObject extends ChainObject {
|
|
42
|
+
@BigNumberProperty()
|
|
43
|
+
@BigNumberIsNotNegative()
|
|
44
|
+
@BigNumberMax("0.5")
|
|
45
|
+
@BigNumberLessThanOrEqualOther("maxFeePortion")
|
|
46
|
+
minFeePortion: BigNumber;
|
|
47
|
+
|
|
48
|
+
@BigNumberProperty()
|
|
49
|
+
@BigNumberIsNotNegative()
|
|
50
|
+
@BigNumberMax("0.5")
|
|
51
|
+
maxFeePortion: BigNumber;
|
|
52
|
+
|
|
53
|
+
constructor(minFeePortion: BigNumber, maxFeePortion: BigNumber) {
|
|
54
|
+
super();
|
|
55
|
+
this.minFeePortion = minFeePortion;
|
|
56
|
+
this.maxFeePortion = maxFeePortion;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export class ReverseBondingCurveConfigurationDto extends ChainCallDTO {
|
|
61
|
+
@BigNumberProperty()
|
|
62
|
+
@BigNumberIsNotNegative()
|
|
63
|
+
@BigNumberMax("0.5")
|
|
64
|
+
@BigNumberLessThanOrEqualOther("maxFeePortion")
|
|
65
|
+
minFeePortion: BigNumber;
|
|
66
|
+
|
|
67
|
+
@BigNumberProperty()
|
|
68
|
+
@BigNumberIsNotNegative()
|
|
69
|
+
@BigNumberMax("0.5")
|
|
70
|
+
maxFeePortion: BigNumber;
|
|
71
|
+
|
|
72
|
+
toChainObject(): ReverseBondingCurveConfigurationChainObject {
|
|
73
|
+
return new ReverseBondingCurveConfigurationChainObject(this.minFeePortion, this.maxFeePortion);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export class CreateTokenSaleDTO extends SubmitCallDTO {
|
|
78
|
+
@IsString()
|
|
79
|
+
@IsNotEmpty()
|
|
80
|
+
public tokenName: string;
|
|
81
|
+
|
|
82
|
+
@IsString()
|
|
83
|
+
@IsNotEmpty()
|
|
84
|
+
public tokenSymbol: string;
|
|
85
|
+
|
|
86
|
+
@IsString()
|
|
87
|
+
@IsNotEmpty()
|
|
88
|
+
public tokenDescription: string;
|
|
89
|
+
|
|
90
|
+
@IsString()
|
|
91
|
+
@IsNotEmpty()
|
|
92
|
+
public tokenCollection: string;
|
|
93
|
+
|
|
94
|
+
@IsString()
|
|
95
|
+
@IsNotEmpty()
|
|
96
|
+
public tokenCategory: string;
|
|
97
|
+
|
|
98
|
+
@IsString()
|
|
99
|
+
@IsNotEmpty()
|
|
100
|
+
public tokenImage: string;
|
|
101
|
+
|
|
102
|
+
@BigNumberProperty()
|
|
103
|
+
public preBuyQuantity: BigNumber;
|
|
104
|
+
|
|
105
|
+
@IsString()
|
|
106
|
+
@IsOptional()
|
|
107
|
+
public websiteUrl?: string;
|
|
108
|
+
|
|
109
|
+
@IsString()
|
|
110
|
+
@IsOptional()
|
|
111
|
+
public telegramUrl?: string;
|
|
112
|
+
|
|
113
|
+
@IsString()
|
|
114
|
+
@IsOptional()
|
|
115
|
+
public twitterUrl?: string;
|
|
116
|
+
|
|
117
|
+
@IsOptional()
|
|
118
|
+
@ValidateNested()
|
|
119
|
+
@Type(() => ReverseBondingCurveConfigurationDto)
|
|
120
|
+
public reverseBondingCurveConfiguration?: ReverseBondingCurveConfigurationDto;
|
|
121
|
+
|
|
122
|
+
constructor(
|
|
123
|
+
tokenName: string,
|
|
124
|
+
tokenSymbol: string,
|
|
125
|
+
tokenDescription: string,
|
|
126
|
+
tokenImage: string,
|
|
127
|
+
preBuyQuantity: BigNumber,
|
|
128
|
+
tokenCollection: string,
|
|
129
|
+
tokenCategory: string,
|
|
130
|
+
reverseBondingCurveConfiguration?: ReverseBondingCurveConfigurationDto
|
|
131
|
+
) {
|
|
132
|
+
super();
|
|
133
|
+
this.tokenName = tokenName;
|
|
134
|
+
this.tokenSymbol = tokenSymbol;
|
|
135
|
+
this.tokenDescription = tokenDescription;
|
|
136
|
+
this.tokenImage = tokenImage;
|
|
137
|
+
this.preBuyQuantity = preBuyQuantity;
|
|
138
|
+
this.tokenCollection = tokenCollection;
|
|
139
|
+
this.tokenCategory = tokenCategory;
|
|
140
|
+
this.reverseBondingCurveConfiguration = reverseBondingCurveConfiguration;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export class CreateSaleResDto {
|
|
145
|
+
@IsNotEmpty()
|
|
146
|
+
public image: string;
|
|
147
|
+
|
|
148
|
+
@IsNotEmpty()
|
|
149
|
+
public tokenName: string;
|
|
150
|
+
|
|
151
|
+
@IsNotEmpty()
|
|
152
|
+
public symbol: string;
|
|
153
|
+
|
|
154
|
+
@IsNotEmpty()
|
|
155
|
+
public description: string;
|
|
156
|
+
|
|
157
|
+
@IsOptional()
|
|
158
|
+
public websiteUrl?: string;
|
|
159
|
+
|
|
160
|
+
@IsOptional()
|
|
161
|
+
public telegramUrl?: string;
|
|
162
|
+
|
|
163
|
+
@IsOptional()
|
|
164
|
+
public twitterUrl?: string;
|
|
165
|
+
|
|
166
|
+
@IsNotEmpty()
|
|
167
|
+
public initialBuyQuantity: string;
|
|
168
|
+
|
|
169
|
+
@IsUserAlias()
|
|
170
|
+
@IsNotEmpty()
|
|
171
|
+
public vaultAddress: UserAlias;
|
|
172
|
+
|
|
173
|
+
@IsUserAlias()
|
|
174
|
+
@IsNotEmpty()
|
|
175
|
+
public creatorAddress: UserAlias;
|
|
176
|
+
|
|
177
|
+
@IsNotEmpty()
|
|
178
|
+
public collection: string;
|
|
179
|
+
|
|
180
|
+
@IsNotEmpty()
|
|
181
|
+
public category: string;
|
|
182
|
+
|
|
183
|
+
@IsNotEmpty()
|
|
184
|
+
public functionName: string;
|
|
185
|
+
|
|
186
|
+
@IsNotEmpty()
|
|
187
|
+
@IsBoolean()
|
|
188
|
+
public isFinalized: boolean;
|
|
189
|
+
|
|
190
|
+
@IsString()
|
|
191
|
+
@IsNotEmpty()
|
|
192
|
+
public tokenStringKey: string;
|
|
193
|
+
|
|
194
|
+
@IsOptional()
|
|
195
|
+
@ValidateNested()
|
|
196
|
+
@Type(() => ReverseBondingCurveConfigurationDto)
|
|
197
|
+
public reverseBondingCurveConfiguration?: ReverseBondingCurveConfigurationDto;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export class TokenExtraFeesDto {
|
|
201
|
+
@BigNumberProperty()
|
|
202
|
+
@IsOptional()
|
|
203
|
+
public maxAcceptableReverseBondingCurveFee?: BigNumber;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export class ExactTokenQuantityDto extends SubmitCallDTO {
|
|
207
|
+
@IsUserAlias()
|
|
208
|
+
@IsNotEmpty()
|
|
209
|
+
public vaultAddress: UserAlias;
|
|
210
|
+
|
|
211
|
+
@BigNumberProperty()
|
|
212
|
+
@IsNonZeroBigNumber({ message: "tokenQuantity cannot be zero" })
|
|
213
|
+
public tokenQuantity: BigNumber;
|
|
214
|
+
|
|
215
|
+
@BigNumberProperty()
|
|
216
|
+
@IsOptional()
|
|
217
|
+
public expectedNativeToken?: BigNumber;
|
|
218
|
+
|
|
219
|
+
@ValidateNested()
|
|
220
|
+
@Type(() => TokenExtraFeesDto)
|
|
221
|
+
@IsOptional()
|
|
222
|
+
public extraFees?: TokenExtraFeesDto;
|
|
223
|
+
|
|
224
|
+
constructor(vaultAddress: UserAlias, tokenQuantity: BigNumber = new BigNumber(0)) {
|
|
225
|
+
super();
|
|
226
|
+
this.vaultAddress = vaultAddress;
|
|
227
|
+
this.tokenQuantity = tokenQuantity;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export class NativeTokenQuantityDto extends SubmitCallDTO {
|
|
232
|
+
@IsUserAlias()
|
|
233
|
+
@IsNotEmpty()
|
|
234
|
+
public vaultAddress: UserAlias;
|
|
235
|
+
|
|
236
|
+
@BigNumberProperty()
|
|
237
|
+
@IsNonZeroBigNumber({ message: "nativeTokenQuanity cannot be zero" })
|
|
238
|
+
public nativeTokenQuantity: BigNumber;
|
|
239
|
+
|
|
240
|
+
@BigNumberProperty()
|
|
241
|
+
@IsOptional()
|
|
242
|
+
public expectedToken?: BigNumber;
|
|
243
|
+
|
|
244
|
+
@ValidateNested()
|
|
245
|
+
@Type(() => TokenExtraFeesDto)
|
|
246
|
+
@IsOptional()
|
|
247
|
+
public extraFees?: TokenExtraFeesDto;
|
|
248
|
+
|
|
249
|
+
constructor(vaultAddress: UserAlias, nativeTokenQuantity: BigNumber = new BigNumber(0)) {
|
|
250
|
+
super();
|
|
251
|
+
this.vaultAddress = vaultAddress;
|
|
252
|
+
this.nativeTokenQuantity = nativeTokenQuantity;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export class TradeResDto {
|
|
257
|
+
@IsOptional()
|
|
258
|
+
public tokenBalance?: TokenBalance;
|
|
259
|
+
|
|
260
|
+
@IsOptional()
|
|
261
|
+
public nativeTokenBalance?: TokenBalance;
|
|
262
|
+
|
|
263
|
+
@IsOptional()
|
|
264
|
+
public tokenQuantity?: string;
|
|
265
|
+
|
|
266
|
+
@IsOptional()
|
|
267
|
+
public nativeTokenAmount?: string;
|
|
268
|
+
|
|
269
|
+
@IsNotEmpty()
|
|
270
|
+
public inputQuantity: string;
|
|
271
|
+
|
|
272
|
+
@IsNotEmpty()
|
|
273
|
+
public outputQuantity: string;
|
|
274
|
+
|
|
275
|
+
@IsNotEmpty()
|
|
276
|
+
public tokenName: string;
|
|
277
|
+
|
|
278
|
+
@IsNotEmpty()
|
|
279
|
+
public tradeType: string;
|
|
280
|
+
|
|
281
|
+
@IsUserAlias()
|
|
282
|
+
@IsNotEmpty()
|
|
283
|
+
public vaultAddress: UserAlias;
|
|
284
|
+
|
|
285
|
+
@IsNotEmpty()
|
|
286
|
+
@IsUserAlias()
|
|
287
|
+
public userAddress: UserAlias;
|
|
288
|
+
|
|
289
|
+
@IsNotEmpty()
|
|
290
|
+
@IsBoolean()
|
|
291
|
+
public isFinalized: boolean;
|
|
292
|
+
|
|
293
|
+
@IsNotEmpty()
|
|
294
|
+
public functionName: string;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export class FetchSaleDto extends ChainCallDTO {
|
|
298
|
+
// TODO: UserAlias?
|
|
299
|
+
@IsUserAlias()
|
|
300
|
+
@IsNotEmpty()
|
|
301
|
+
public vaultAddress: UserAlias;
|
|
302
|
+
constructor(vaultAddress: UserAlias) {
|
|
303
|
+
super();
|
|
304
|
+
this.vaultAddress = vaultAddress;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export class PreMintCalculationDto extends ChainCallDTO {
|
|
309
|
+
@BigNumberProperty()
|
|
310
|
+
@IsNonZeroBigNumber()
|
|
311
|
+
@IsNotEmpty()
|
|
312
|
+
public nativeTokenQuantity: BigNumber;
|
|
313
|
+
|
|
314
|
+
constructor(nativeTokenQuantity: BigNumber = new BigNumber(0)) {
|
|
315
|
+
super();
|
|
316
|
+
this.nativeTokenQuantity = nativeTokenQuantity;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export class ConfigureLaunchpadFeeAddressDto extends SubmitCallDTO {
|
|
321
|
+
@IsOptional()
|
|
322
|
+
@IsUserAlias()
|
|
323
|
+
public newPlatformFeeAddress?: UserAlias;
|
|
324
|
+
|
|
325
|
+
@IsOptional()
|
|
326
|
+
@IsUserAlias({ each: true })
|
|
327
|
+
public newAuthorities?: UserAlias[];
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export class FinalizeTokenAllocationDto extends SubmitCallDTO {
|
|
331
|
+
@IsNumber()
|
|
332
|
+
@Min(0)
|
|
333
|
+
@Max(1)
|
|
334
|
+
public platformFeePercentage: number;
|
|
335
|
+
|
|
336
|
+
@IsNumber()
|
|
337
|
+
@Min(0)
|
|
338
|
+
@Max(1)
|
|
339
|
+
public ownerFeePercentage: number;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export class CollectFeeAddressDto extends ChainCallDTO {
|
|
343
|
+
@IsNotEmpty()
|
|
344
|
+
@IsUserAlias()
|
|
345
|
+
public platformFeeCollectAddress: UserAlias;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export class TradeCalculationResFeesDto {
|
|
349
|
+
@IsNotEmpty()
|
|
350
|
+
@IsString()
|
|
351
|
+
reverseBondingCurve: string;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export class TradeCalculationResDto {
|
|
355
|
+
@IsNotEmpty()
|
|
356
|
+
@IsString()
|
|
357
|
+
public calculatedQuantity: string;
|
|
358
|
+
|
|
359
|
+
@ValidateNested({ each: true })
|
|
360
|
+
@Type(() => TradeCalculationResFeesDto)
|
|
361
|
+
public extraFees: TradeCalculationResFeesDto;
|
|
362
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Gala Games Inc. All rights reserved.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
import { ChainObject, IsUserAlias, UserAlias } from "@gala-chain/api";
|
|
16
|
+
import { Exclude } from "class-transformer";
|
|
17
|
+
import { ArrayNotEmpty, IsNotEmpty } from "class-validator";
|
|
18
|
+
import { JSONSchema } from "class-validator-jsonschema";
|
|
19
|
+
|
|
20
|
+
@JSONSchema({
|
|
21
|
+
description: "Defines the platform fee address and authorized owners for modification."
|
|
22
|
+
})
|
|
23
|
+
export class LaunchpadFeeConfig extends ChainObject {
|
|
24
|
+
@Exclude()
|
|
25
|
+
public static INDEX_KEY = "GCLFC"; // GalaChain Launchpad Fee Configuration
|
|
26
|
+
|
|
27
|
+
@IsNotEmpty()
|
|
28
|
+
@IsUserAlias()
|
|
29
|
+
feeAddress: UserAlias;
|
|
30
|
+
|
|
31
|
+
@ArrayNotEmpty()
|
|
32
|
+
@IsUserAlias({ each: true })
|
|
33
|
+
authorities: UserAlias[];
|
|
34
|
+
|
|
35
|
+
constructor(feeAddress: UserAlias, authorities: UserAlias[]) {
|
|
36
|
+
super();
|
|
37
|
+
this.feeAddress = feeAddress;
|
|
38
|
+
this.authorities = authorities;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public setNewFeeAddress(newfeeAddress: UserAlias, newAuthorities: UserAlias[]) {
|
|
42
|
+
this.feeAddress = newfeeAddress;
|
|
43
|
+
this.authorities = newAuthorities;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Gala Games Inc. All rights reserved.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
import { ChainObject } from "@gala-chain/api";
|
|
16
|
+
import { Exclude } from "class-transformer";
|
|
17
|
+
import { IsNumber, Max, Min } from "class-validator";
|
|
18
|
+
import { JSONSchema } from "class-validator-jsonschema";
|
|
19
|
+
|
|
20
|
+
@JSONSchema({
|
|
21
|
+
description: "Defines the platform fee and owner allocation percentages."
|
|
22
|
+
})
|
|
23
|
+
export class LaunchpadFinalizeFeeAllocation extends ChainObject {
|
|
24
|
+
@Exclude()
|
|
25
|
+
static INDEX_KEY = "GCLFFA"; //GalaChain Launchpad Final Fee Allocatoin
|
|
26
|
+
|
|
27
|
+
@IsNumber()
|
|
28
|
+
@Min(0)
|
|
29
|
+
@Max(1)
|
|
30
|
+
public platformFeePercentage: number;
|
|
31
|
+
|
|
32
|
+
@IsNumber()
|
|
33
|
+
@Min(0)
|
|
34
|
+
@Max(1)
|
|
35
|
+
public ownerAllocationPercentage: number;
|
|
36
|
+
|
|
37
|
+
public liquidityAllocationPercentage: number;
|
|
38
|
+
|
|
39
|
+
constructor(platformFeePercentage: number, ownerAllocationPercentage: number) {
|
|
40
|
+
super();
|
|
41
|
+
const total = platformFeePercentage + ownerAllocationPercentage;
|
|
42
|
+
if (total > 1) {
|
|
43
|
+
throw new Error("Total allocation (Platform Fee + Owner Allocation) cannot exceed 1.");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
this.platformFeePercentage = platformFeePercentage;
|
|
47
|
+
this.ownerAllocationPercentage = ownerAllocationPercentage;
|
|
48
|
+
|
|
49
|
+
const liquidity = 1 - total;
|
|
50
|
+
this.liquidityAllocationPercentage = Number(Math.max(liquidity, 0).toFixed(5));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public setAllocation(platformFee: number, ownerAllocation: number) {
|
|
54
|
+
const total = platformFee + ownerAllocation;
|
|
55
|
+
if (total > 1) {
|
|
56
|
+
throw new Error("Total allocation (Platform Fee + Owner Allocation) cannot exceed 1.");
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
this.platformFeePercentage = platformFee;
|
|
60
|
+
this.ownerAllocationPercentage = ownerAllocation;
|
|
61
|
+
|
|
62
|
+
const liquidity = 1 - total;
|
|
63
|
+
this.liquidityAllocationPercentage = Number(Math.max(liquidity, 0).toFixed(5)); // Ensure it doesn't go negative
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Gala Games Inc. All rights reserved.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
import {
|
|
16
|
+
BigNumberProperty,
|
|
17
|
+
ChainKey,
|
|
18
|
+
ChainObject,
|
|
19
|
+
IsUserAlias,
|
|
20
|
+
StringEnumProperty,
|
|
21
|
+
TokenInstanceKey,
|
|
22
|
+
UserAlias
|
|
23
|
+
} from "@gala-chain/api";
|
|
24
|
+
import BigNumber from "bignumber.js";
|
|
25
|
+
import { Exclude, Type } from "class-transformer";
|
|
26
|
+
import { IsNotEmpty, IsOptional, IsString, ValidateNested } from "class-validator";
|
|
27
|
+
import { JSONSchema } from "class-validator-jsonschema";
|
|
28
|
+
|
|
29
|
+
import { ReverseBondingCurveConfigurationChainObject } from "./LaunchpadDtos";
|
|
30
|
+
|
|
31
|
+
export enum SaleStatus {
|
|
32
|
+
ONGOING = "Ongoing",
|
|
33
|
+
END = "Finished"
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@JSONSchema({
|
|
37
|
+
description: "Represents a launchpad sale, defining token quantities, pricing, and sale operations."
|
|
38
|
+
})
|
|
39
|
+
export class LaunchpadSale extends ChainObject {
|
|
40
|
+
@Exclude()
|
|
41
|
+
static INDEX_KEY = "GCLPS"; //GalaChain LaunchPad Sale
|
|
42
|
+
|
|
43
|
+
@ChainKey({ position: 0 })
|
|
44
|
+
@IsUserAlias()
|
|
45
|
+
@IsNotEmpty()
|
|
46
|
+
public vaultAddress: UserAlias;
|
|
47
|
+
|
|
48
|
+
@StringEnumProperty(SaleStatus)
|
|
49
|
+
@IsNotEmpty()
|
|
50
|
+
public saleStatus: SaleStatus;
|
|
51
|
+
|
|
52
|
+
@Type(() => TokenInstanceKey)
|
|
53
|
+
@IsNotEmpty()
|
|
54
|
+
public sellingToken: TokenInstanceKey;
|
|
55
|
+
|
|
56
|
+
@Type(() => TokenInstanceKey)
|
|
57
|
+
@IsNotEmpty()
|
|
58
|
+
public nativeToken: TokenInstanceKey;
|
|
59
|
+
|
|
60
|
+
@IsString()
|
|
61
|
+
@IsNotEmpty()
|
|
62
|
+
public sellingTokenQuantity: string;
|
|
63
|
+
|
|
64
|
+
@IsString()
|
|
65
|
+
@IsNotEmpty()
|
|
66
|
+
public nativeTokenQuantity: string;
|
|
67
|
+
|
|
68
|
+
@IsUserAlias()
|
|
69
|
+
@IsNotEmpty()
|
|
70
|
+
public saleOwner: UserAlias;
|
|
71
|
+
|
|
72
|
+
@BigNumberProperty()
|
|
73
|
+
public basePrice: BigNumber;
|
|
74
|
+
|
|
75
|
+
@BigNumberProperty()
|
|
76
|
+
public exponentFactor: BigNumber;
|
|
77
|
+
|
|
78
|
+
@BigNumberProperty()
|
|
79
|
+
public maxSupply: BigNumber;
|
|
80
|
+
|
|
81
|
+
@BigNumberProperty()
|
|
82
|
+
public euler: BigNumber;
|
|
83
|
+
|
|
84
|
+
@IsOptional()
|
|
85
|
+
@ValidateNested()
|
|
86
|
+
@Type(() => ReverseBondingCurveConfigurationChainObject)
|
|
87
|
+
public reverseBondingCurveConfiguration?: ReverseBondingCurveConfigurationChainObject;
|
|
88
|
+
|
|
89
|
+
@JSONSchema({
|
|
90
|
+
description:
|
|
91
|
+
"The market cap has been calculated using the bonding curve equations to approximate a specific final price."
|
|
92
|
+
})
|
|
93
|
+
public static MARKET_CAP = "1640985.8441726";
|
|
94
|
+
|
|
95
|
+
@JSONSchema({
|
|
96
|
+
description:
|
|
97
|
+
"This base price has been calculated using the bonding curve equations to ensure that a MARKET_CAP amount of " +
|
|
98
|
+
"native tokens will correspond to 10 million native tokens."
|
|
99
|
+
})
|
|
100
|
+
public static BASE_PRICE = "16506671506650";
|
|
101
|
+
|
|
102
|
+
constructor(
|
|
103
|
+
vaultAddress: UserAlias,
|
|
104
|
+
sellingToken: TokenInstanceKey,
|
|
105
|
+
reverseBondingCurveConfiguration: ReverseBondingCurveConfigurationChainObject | undefined,
|
|
106
|
+
saleOwner: UserAlias
|
|
107
|
+
) {
|
|
108
|
+
super();
|
|
109
|
+
|
|
110
|
+
this.vaultAddress = vaultAddress;
|
|
111
|
+
this.saleOwner = saleOwner;
|
|
112
|
+
|
|
113
|
+
this.sellingToken = sellingToken;
|
|
114
|
+
this.sellingTokenQuantity = "1e+7";
|
|
115
|
+
|
|
116
|
+
this.basePrice = new BigNumber(LaunchpadSale.BASE_PRICE);
|
|
117
|
+
this.exponentFactor = new BigNumber("1166069000000");
|
|
118
|
+
this.maxSupply = new BigNumber("1e+7");
|
|
119
|
+
this.euler = new BigNumber("2.7182818284590452353602874713527");
|
|
120
|
+
this.saleStatus = SaleStatus.ONGOING;
|
|
121
|
+
|
|
122
|
+
const nativeTokenInstance = new TokenInstanceKey();
|
|
123
|
+
nativeTokenInstance.collection = "GALA";
|
|
124
|
+
nativeTokenInstance.category = "Unit";
|
|
125
|
+
nativeTokenInstance.type = "none";
|
|
126
|
+
nativeTokenInstance.additionalKey = "none";
|
|
127
|
+
nativeTokenInstance.instance = new BigNumber(0);
|
|
128
|
+
|
|
129
|
+
this.nativeToken = nativeTokenInstance;
|
|
130
|
+
this.nativeTokenQuantity = "0";
|
|
131
|
+
this.reverseBondingCurveConfiguration = reverseBondingCurveConfiguration;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
public buyToken(sellingTokenAmount: BigNumber, nativeTokenAmount: BigNumber) {
|
|
135
|
+
const tokenLeftInVault = new BigNumber(this.sellingTokenQuantity);
|
|
136
|
+
const nativeTokensLeftInVault = new BigNumber(this.nativeTokenQuantity);
|
|
137
|
+
this.sellingTokenQuantity = tokenLeftInVault.minus(sellingTokenAmount).toString();
|
|
138
|
+
this.nativeTokenQuantity = nativeTokensLeftInVault.plus(nativeTokenAmount).toString();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
public sellToken(sellingTokenAmount: BigNumber, nativeTokenAmount: BigNumber) {
|
|
142
|
+
const tokenLeftInVault = new BigNumber(this.sellingTokenQuantity);
|
|
143
|
+
const nativeTokensLeftInVault = new BigNumber(this.nativeTokenQuantity);
|
|
144
|
+
this.sellingTokenQuantity = tokenLeftInVault.plus(sellingTokenAmount).toString();
|
|
145
|
+
this.nativeTokenQuantity = nativeTokensLeftInVault.minus(nativeTokenAmount).toString();
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
public fetchTokensSold() {
|
|
149
|
+
const tokenLeftInVault = new BigNumber(this.sellingTokenQuantity);
|
|
150
|
+
const tokensSold = new BigNumber(this.maxSupply).minus(tokenLeftInVault);
|
|
151
|
+
return tokensSold.toString();
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Returns the portion of the max supply that is circulating (that is, not in the vault)
|
|
155
|
+
// This is a value between 0 and 1. If a quarter of the max supply is circulating, this
|
|
156
|
+
// will return 0.25
|
|
157
|
+
public fetchCirculatingSupplyProportional() {
|
|
158
|
+
const tokenLeftInVault = new BigNumber(this.sellingTokenQuantity);
|
|
159
|
+
const graduationProgress = BigNumber(1).minus(tokenLeftInVault.dividedBy(this.maxSupply));
|
|
160
|
+
return graduationProgress;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
public fetchNativeTokensInVault() {
|
|
164
|
+
const nativeTokenInVault = new BigNumber(this.nativeTokenQuantity);
|
|
165
|
+
return nativeTokenInVault.toString();
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
public fetchBasePrice() {
|
|
169
|
+
const basePriceBigNumber = new BigNumber(this.basePrice);
|
|
170
|
+
return basePriceBigNumber.toString();
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
public finalizeSale() {
|
|
174
|
+
this.saleStatus = SaleStatus.END;
|
|
175
|
+
this.nativeTokenQuantity = "0";
|
|
176
|
+
this.sellingTokenQuantity = "0";
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
public fetchSellingTokenInstanceKey() {
|
|
180
|
+
const tokenInstanceKey = new TokenInstanceKey();
|
|
181
|
+
tokenInstanceKey.collection = this.sellingToken.collection;
|
|
182
|
+
tokenInstanceKey.category = this.sellingToken.category;
|
|
183
|
+
tokenInstanceKey.type = this.sellingToken.type;
|
|
184
|
+
tokenInstanceKey.additionalKey = this.sellingToken.additionalKey;
|
|
185
|
+
tokenInstanceKey.instance = this.sellingToken.instance;
|
|
186
|
+
|
|
187
|
+
return tokenInstanceKey;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
public fetchNativeTokenInstanceKey() {
|
|
191
|
+
const tokenInstanceKey = new TokenInstanceKey();
|
|
192
|
+
tokenInstanceKey.collection = this.nativeToken.collection;
|
|
193
|
+
tokenInstanceKey.category = this.nativeToken.category;
|
|
194
|
+
tokenInstanceKey.type = this.nativeToken.type;
|
|
195
|
+
tokenInstanceKey.additionalKey = this.nativeToken.additionalKey;
|
|
196
|
+
tokenInstanceKey.instance = this.nativeToken.instance;
|
|
197
|
+
|
|
198
|
+
return tokenInstanceKey;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Gala Games Inc. All rights reserved.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
* See the License for the specific language governing permissions and
|
|
13
|
+
* limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export * from "./LaunchpadDtos";
|
|
17
|
+
export * from "./LaunchpadFinalizeAllocation";
|
|
18
|
+
export * from "./LaunchpadFeeConfig";
|
|
19
|
+
export * from "./LaunchpadSale";
|