@dripfi/drip-sdk 1.4.28-slot-machine → 1.4.28-slot-machine-1
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.
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const types_1 = require("../types");
|
6
7
|
const ethers_1 = require("ethers");
|
7
8
|
const ERC20TokenContract_1 = __importDefault(require("../contracts/ERC20TokenContract"));
|
8
9
|
class LoyaltyPackage {
|
@@ -66,7 +67,9 @@ class LoyaltyPackage {
|
|
66
67
|
async runSlotSpin(isDepositNative) {
|
67
68
|
const signerAddress = await this.perqSdk.signer.getAddress();
|
68
69
|
const nextLoyaltyCard = await this.perqSdk.perqApi.fetchNextLoyaltyCard(signerAddress);
|
69
|
-
const
|
70
|
+
const isFirstLoyaltyCard = nextLoyaltyCard.level === 1 && nextLoyaltyCard.tier === types_1.ELoyaltyCardTier.White;
|
71
|
+
// hardcode to 0.1 for the first loyalty card
|
72
|
+
const amountForSpin = isFirstLoyaltyCard ? 0.1 : nextLoyaltyCard.minBurnPerSpin;
|
70
73
|
const loyaltyCardOwnedChancesToWin = nextLoyaltyCard.chanceToUpgrade;
|
71
74
|
const formattedAmountForSpin = ethers_1.ethers.utils.parseUnits(amountForSpin.toString(), 18);
|
72
75
|
const depositResult = isDepositNative
|