@gala-chain/launchpad 1.0.7 → 1.0.8

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.
Files changed (27) hide show
  1. package/lib/package.json +1 -1
  2. package/lib/src/api/types/LaunchpadDtos.d.ts +2 -1
  3. package/lib/src/api/types/LaunchpadDtos.d.ts.map +1 -1
  4. package/lib/src/api/types/LaunchpadDtos.js +5 -1
  5. package/lib/src/api/types/LaunchpadDtos.js.map +1 -1
  6. package/lib/src/chaincode/launchpad/buyExactToken.d.ts.map +1 -1
  7. package/lib/src/chaincode/launchpad/buyExactToken.js +2 -1
  8. package/lib/src/chaincode/launchpad/buyExactToken.js.map +1 -1
  9. package/lib/src/chaincode/launchpad/buyWithNative.d.ts.map +1 -1
  10. package/lib/src/chaincode/launchpad/buyWithNative.js +2 -1
  11. package/lib/src/chaincode/launchpad/buyWithNative.js.map +1 -1
  12. package/lib/src/chaincode/launchpad/finaliseSale.js +3 -3
  13. package/lib/src/chaincode/launchpad/finaliseSale.js.map +1 -1
  14. package/lib/src/chaincode/launchpad/sellExactToken.d.ts.map +1 -1
  15. package/lib/src/chaincode/launchpad/sellExactToken.js +2 -1
  16. package/lib/src/chaincode/launchpad/sellExactToken.js.map +1 -1
  17. package/lib/src/chaincode/launchpad/sellWithNative.d.ts.map +1 -1
  18. package/lib/src/chaincode/launchpad/sellWithNative.js +2 -1
  19. package/lib/src/chaincode/launchpad/sellWithNative.js.map +1 -1
  20. package/lib/tsconfig.tsbuildinfo +1 -1
  21. package/package.json +1 -1
  22. package/src/api/types/LaunchpadDtos.ts +4 -1
  23. package/src/chaincode/launchpad/buyExactToken.ts +2 -1
  24. package/src/chaincode/launchpad/buyWithNative.ts +2 -1
  25. package/src/chaincode/launchpad/finaliseSale.ts +3 -3
  26. package/src/chaincode/launchpad/sellExactToken.ts +2 -1
  27. package/src/chaincode/launchpad/sellWithNative.ts +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gala-chain/launchpad",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "GalaChain Launchpad Chaincode",
5
5
  "main": "lib/src/index.js",
6
6
  "types": "lib/src/index.d.ts",
@@ -309,6 +309,9 @@ export class TradeResDto {
309
309
 
310
310
  @IsString()
311
311
  public uniqueKey: string;
312
+
313
+ @IsString()
314
+ public totalTokenSold: string;
312
315
  }
313
316
 
314
317
  export class FetchSaleDto extends ChainCallDTO {
@@ -400,5 +403,5 @@ export class BatchSubmitAuthoritiesResDto extends ChainCallDTO {
400
403
 
401
404
  export class TransactionFeeResDto {
402
405
  @IsNumber()
403
- feeAmount;
406
+ feeAmount: number;
404
407
  }
@@ -151,6 +151,7 @@ export async function buyExactToken(
151
151
  userAddress: ctx.callingUser,
152
152
  isFinalized: isSaleFinalized,
153
153
  functionName: "BuyExactToken",
154
- uniqueKey: buyTokenDTO.uniqueKey
154
+ uniqueKey: buyTokenDTO.uniqueKey,
155
+ totalTokenSold: sale.fetchTokensSold()
155
156
  };
156
157
  }
@@ -155,6 +155,7 @@ export async function buyWithNative(
155
155
  userAddress: ctx.callingUser,
156
156
  isFinalized: isSaleFinalized,
157
157
  functionName: "BuyWithNative",
158
- uniqueKey: buyTokenDTO.uniqueKey
158
+ uniqueKey: buyTokenDTO.uniqueKey,
159
+ totalTokenSold: sale.fetchTokensSold()
159
160
  };
160
161
  }
@@ -51,9 +51,9 @@ export async function finalizeSale(ctx: GalaChainContext, sale: LaunchpadSale):
51
51
  throw new PreConditionFailedError("Platform fee configuration is yet to be defined.");
52
52
  }
53
53
 
54
- const platformFeePercentage = feeAllocation ? feeAllocation.platformFeePercentage : 0.1;
55
- const ownerAllocationPercentage = feeAllocation ? feeAllocation.ownerAllocationPercentage : 0.6;
56
- const liquidityAllocationPercentage = feeAllocation ? feeAllocation.liquidityAllocationPercentage : 0.3;
54
+ const platformFeePercentage = feeAllocation ? feeAllocation.platformFeePercentage : 0.01;
55
+ const ownerAllocationPercentage = feeAllocation ? feeAllocation.ownerAllocationPercentage : 0.5;
56
+ const liquidityAllocationPercentage = feeAllocation ? feeAllocation.liquidityAllocationPercentage : 0.94;
57
57
 
58
58
  const nativeToken = sale.fetchNativeTokenInstanceKey();
59
59
  const memeToken = sale.fetchSellingTokenInstanceKey();
@@ -133,6 +133,7 @@ export async function sellExactToken(
133
133
  userAddress: ctx.callingUser,
134
134
  isFinalized: false,
135
135
  functionName: "SellExactToken",
136
- uniqueKey: sellTokenDTO.uniqueKey
136
+ uniqueKey: sellTokenDTO.uniqueKey,
137
+ totalTokenSold: sale.fetchTokensSold()
137
138
  };
138
139
  }
@@ -132,6 +132,7 @@ export async function sellWithNative(
132
132
  userAddress: ctx.callingUser,
133
133
  isFinalized: false,
134
134
  functionName: "SellWithNative",
135
- uniqueKey: sellTokenDTO.uniqueKey
135
+ uniqueKey: sellTokenDTO.uniqueKey,
136
+ totalTokenSold: sale.fetchTokensSold()
136
137
  };
137
138
  }