@dripfi/drip-sdk 1.4.28-slot-machine-1 → 1.4.28
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/dist/PerqApi.d.ts +0 -1
- package/dist/PerqApi.js +0 -27
- package/dist/PerqSdk.d.ts +1 -2
- package/dist/PerqSdk.js +0 -3
- package/dist/abi/index.d.ts +0 -57
- package/dist/abi/index.js +0 -2
- package/dist/contracts/index.d.ts +1 -2
- package/dist/contracts/index.js +1 -3
- package/dist/subpackages/LoyaltyCardsPackage.d.ts +0 -4
- package/dist/subpackages/LoyaltyCardsPackage.js +0 -49
- package/dist/types/LoyaltyCard.d.ts +0 -2
- package/dist/types/PerqConfig.d.ts +0 -1
- package/dist/types/PerqConfig.js +0 -2
- package/package.json +1 -1
- package/dist/abi/SlotBurnTokenAbi.json +0 -86
- package/dist/contracts/SlotBurnTokenContract.d.ts +0 -8
- package/dist/contracts/SlotBurnTokenContract.js +0 -26
package/dist/PerqApi.d.ts
CHANGED
@@ -27,7 +27,6 @@ export default class PerqApi {
|
|
27
27
|
fetchAllLoyaltyCards(): Promise<LoyaltyCard[]>;
|
28
28
|
fetchAllSpecialEditionLoyaltyCards(): Promise<SpecialEditionLoyaltyCard[]>;
|
29
29
|
fetchOwnedLoyaltyCard(walletAddress: string): Promise<LoyaltyCard>;
|
30
|
-
fetchNextLoyaltyCard(walletAddress: string): Promise<LoyaltyCard>;
|
31
30
|
fetchOwnedSpecialEditionLoyaltyCards(walletAddress: string): Promise<SpecialEditionLoyaltyCard[]>;
|
32
31
|
fetchBeansBalance(walletAddress: string): Promise<BeansBalance>;
|
33
32
|
upgradeLoyaltyCard(signedPayload: NonceEnrichedSignedPayload<UpgradeLoyaltyCardPayload>): Promise<LoyaltyCard>;
|
package/dist/PerqApi.js
CHANGED
@@ -185,8 +185,6 @@ class PerqApi {
|
|
185
185
|
level: card.level,
|
186
186
|
cost: parseFloat(ethers_1.ethers.utils.formatUnits(card.cost.toString(), PERQ_TOKEN_DECIMALS)),
|
187
187
|
boost: card.boost,
|
188
|
-
chanceToUpgrade: card.chanceToUpgrade,
|
189
|
-
minBurnPerSpin: card.minBurnPerSpin,
|
190
188
|
}));
|
191
189
|
}
|
192
190
|
else {
|
@@ -216,29 +214,6 @@ class PerqApi {
|
|
216
214
|
level: data.level,
|
217
215
|
cost: parseFloat(ethers_1.ethers.utils.formatUnits(data.cost.toString(), PERQ_TOKEN_DECIMALS)),
|
218
216
|
boost: data.boost,
|
219
|
-
chanceToUpgrade: data.chanceToUpgrade,
|
220
|
-
minBurnPerSpin: data.minBurnPerSpin,
|
221
|
-
};
|
222
|
-
}
|
223
|
-
else {
|
224
|
-
throw Error(`${await res.text()}`);
|
225
|
-
}
|
226
|
-
}
|
227
|
-
async fetchNextLoyaltyCard(walletAddress) {
|
228
|
-
const res = await fetch(`${this.perqSdk.perqConfig.route}/api-be/api/user/${walletAddress}/loyaltyCards/next`);
|
229
|
-
if (res.status === 204) {
|
230
|
-
return {};
|
231
|
-
}
|
232
|
-
if (res.ok) {
|
233
|
-
const data = await res.json();
|
234
|
-
return {
|
235
|
-
id: data.id,
|
236
|
-
tier: data.tier,
|
237
|
-
level: data.level,
|
238
|
-
cost: parseFloat(ethers_1.ethers.utils.formatUnits(data.cost.toString(), PERQ_TOKEN_DECIMALS)),
|
239
|
-
boost: data.boost,
|
240
|
-
chanceToUpgrade: data.chanceToUpgrade,
|
241
|
-
minBurnPerSpin: data.minBurnPerSpin,
|
242
217
|
};
|
243
218
|
}
|
244
219
|
else {
|
@@ -286,8 +261,6 @@ class PerqApi {
|
|
286
261
|
level: data.level,
|
287
262
|
cost: parseFloat(ethers_1.ethers.utils.formatUnits(data.cost.toString(), PERQ_TOKEN_DECIMALS)),
|
288
263
|
boost: data.boost,
|
289
|
-
chanceToUpgrade: data.chanceToUpgrade,
|
290
|
-
minBurnPerSpin: data.minBurnPerSpin,
|
291
264
|
};
|
292
265
|
}
|
293
266
|
else {
|
package/dist/PerqSdk.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Signer, ethers } from 'ethers';
|
2
2
|
import { PerqConfig } from './types';
|
3
3
|
import PerqApi from './PerqApi';
|
4
|
-
import { PerqSwapAndRecyclerContract, PerqTokenRecyclerContract, PerqVestingContract
|
4
|
+
import { PerqSwapAndRecyclerContract, PerqTokenRecyclerContract, PerqVestingContract } from './contracts';
|
5
5
|
import VestingPackage from './subpackages/VestingPackage';
|
6
6
|
import LitePackage from './subpackages/LitePackage';
|
7
7
|
import RecyclerPackage from './subpackages/RecyclerPackage';
|
@@ -28,7 +28,6 @@ export default class PerqSdk {
|
|
28
28
|
perqVestingContract: PerqVestingContract;
|
29
29
|
perqTokenRecyclerContract: PerqTokenRecyclerContract;
|
30
30
|
perqSwapAndRecyclerContract: PerqSwapAndRecyclerContract;
|
31
|
-
slotBurnTokenContract: SlotBurnTokenContract;
|
32
31
|
constructor(perqConfig: PerqConfig, chainId: PerqSupportedChainId, provider?: ethers.providers.JsonRpcProvider);
|
33
32
|
updateSigner(newSigner: Signer, chainId: PerqSupportedChainId): Promise<void>;
|
34
33
|
}
|
package/dist/PerqSdk.js
CHANGED
@@ -30,7 +30,6 @@ class PerqSdk {
|
|
30
30
|
perqVestingContract;
|
31
31
|
perqTokenRecyclerContract;
|
32
32
|
perqSwapAndRecyclerContract;
|
33
|
-
slotBurnTokenContract;
|
34
33
|
constructor(perqConfig, chainId, provider) {
|
35
34
|
this.perqConfig = perqConfig;
|
36
35
|
const newSigner = provider?.getSigner();
|
@@ -50,7 +49,6 @@ class PerqSdk {
|
|
50
49
|
this.perqVestingContract = new contracts_1.PerqVestingContract(this);
|
51
50
|
this.perqTokenRecyclerContract = new contracts_1.PerqTokenRecyclerContract(this);
|
52
51
|
this.perqSwapAndRecyclerContract = new contracts_1.PerqSwapAndRecyclerContract(this);
|
53
|
-
this.slotBurnTokenContract = new contracts_1.SlotBurnTokenContract(this);
|
54
52
|
}
|
55
53
|
async updateSigner(newSigner, chainId) {
|
56
54
|
this.signer = newSigner;
|
@@ -58,7 +56,6 @@ class PerqSdk {
|
|
58
56
|
this.perqVestingContract = new contracts_1.PerqVestingContract(this);
|
59
57
|
this.perqTokenRecyclerContract = new contracts_1.PerqTokenRecyclerContract(this);
|
60
58
|
this.perqSwapAndRecyclerContract = new contracts_1.PerqSwapAndRecyclerContract(this);
|
61
|
-
this.slotBurnTokenContract = new contracts_1.SlotBurnTokenContract(this);
|
62
59
|
}
|
63
60
|
}
|
64
61
|
exports.default = PerqSdk;
|
package/dist/abi/index.d.ts
CHANGED
@@ -71,62 +71,5 @@ declare const _default: {
|
|
71
71
|
stateMutability: string;
|
72
72
|
type: string;
|
73
73
|
}[];
|
74
|
-
readonly SLOT_BURN_TOKEN_ABI: ({
|
75
|
-
inputs: {
|
76
|
-
internalType: string;
|
77
|
-
name: string;
|
78
|
-
type: string;
|
79
|
-
}[];
|
80
|
-
stateMutability: string;
|
81
|
-
type: string;
|
82
|
-
name?: undefined;
|
83
|
-
anonymous?: undefined;
|
84
|
-
outputs?: undefined;
|
85
|
-
} | {
|
86
|
-
inputs: {
|
87
|
-
internalType: string;
|
88
|
-
name: string;
|
89
|
-
type: string;
|
90
|
-
}[];
|
91
|
-
name: string;
|
92
|
-
type: string;
|
93
|
-
stateMutability?: undefined;
|
94
|
-
anonymous?: undefined;
|
95
|
-
outputs?: undefined;
|
96
|
-
} | {
|
97
|
-
anonymous: boolean;
|
98
|
-
inputs: {
|
99
|
-
indexed: boolean;
|
100
|
-
internalType: string;
|
101
|
-
name: string;
|
102
|
-
type: string;
|
103
|
-
}[];
|
104
|
-
name: string;
|
105
|
-
type: string;
|
106
|
-
stateMutability?: undefined;
|
107
|
-
outputs?: undefined;
|
108
|
-
} | {
|
109
|
-
inputs: never[];
|
110
|
-
name: string;
|
111
|
-
outputs: {
|
112
|
-
internalType: string;
|
113
|
-
name: string;
|
114
|
-
type: string;
|
115
|
-
}[];
|
116
|
-
stateMutability: string;
|
117
|
-
type: string;
|
118
|
-
anonymous?: undefined;
|
119
|
-
} | {
|
120
|
-
inputs: {
|
121
|
-
internalType: string;
|
122
|
-
name: string;
|
123
|
-
type: string;
|
124
|
-
}[];
|
125
|
-
name: string;
|
126
|
-
outputs: never[];
|
127
|
-
stateMutability: string;
|
128
|
-
type: string;
|
129
|
-
anonymous?: undefined;
|
130
|
-
})[];
|
131
74
|
};
|
132
75
|
export default _default;
|
package/dist/abi/index.js
CHANGED
@@ -8,12 +8,10 @@ const WethTokenAbi_json_1 = __importDefault(require("./WethTokenAbi.json"));
|
|
8
8
|
const PerqTokenAbi_json_1 = __importDefault(require("./PerqTokenAbi.json"));
|
9
9
|
const TokenRecyclerAbi_json_1 = __importDefault(require("./TokenRecyclerAbi.json"));
|
10
10
|
const PerqVestingAbi_json_1 = __importDefault(require("./PerqVestingAbi.json"));
|
11
|
-
const SlotBurnTokenAbi_json_1 = __importDefault(require("./SlotBurnTokenAbi.json"));
|
12
11
|
exports.default = {
|
13
12
|
PERQ_SWAP_AND_RECYCLER_ABI: PerqSwapAndRecyclerAbi_json_1.default,
|
14
13
|
WETH_TOKEN_ABI: WethTokenAbi_json_1.default,
|
15
14
|
PERQ_TOKEN_ABI: PerqTokenAbi_json_1.default,
|
16
15
|
TOKEN_RECYCLER_ABI: TokenRecyclerAbi_json_1.default,
|
17
16
|
PERQ_VESTING_ABI: PerqVestingAbi_json_1.default,
|
18
|
-
SLOT_BURN_TOKEN_ABI: SlotBurnTokenAbi_json_1.default,
|
19
17
|
};
|
@@ -3,5 +3,4 @@ import PerqSwapAndRecyclerContract from './PerqSwapAndRecyclerContract';
|
|
3
3
|
import PerqTokenRecyclerContract from './PerqTokenRecyclerContract';
|
4
4
|
import PerqTokenContract from './PerqTokenContract';
|
5
5
|
import PerqVestingContract from './PerqVestingContract';
|
6
|
-
|
7
|
-
export { BasePerqContract, PerqSwapAndRecyclerContract, PerqTokenRecyclerContract, PerqTokenContract, PerqVestingContract, SlotBurnTokenContract, };
|
6
|
+
export { BasePerqContract, PerqSwapAndRecyclerContract, PerqTokenRecyclerContract, PerqTokenContract, PerqVestingContract, };
|
package/dist/contracts/index.js
CHANGED
@@ -3,7 +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
|
-
exports.
|
6
|
+
exports.PerqVestingContract = exports.PerqTokenContract = exports.PerqTokenRecyclerContract = exports.PerqSwapAndRecyclerContract = exports.BasePerqContract = void 0;
|
7
7
|
const BasePerqContract_1 = __importDefault(require("./BasePerqContract"));
|
8
8
|
exports.BasePerqContract = BasePerqContract_1.default;
|
9
9
|
const PerqSwapAndRecyclerContract_1 = __importDefault(require("./PerqSwapAndRecyclerContract"));
|
@@ -14,5 +14,3 @@ const PerqTokenContract_1 = __importDefault(require("./PerqTokenContract"));
|
|
14
14
|
exports.PerqTokenContract = PerqTokenContract_1.default;
|
15
15
|
const PerqVestingContract_1 = __importDefault(require("./PerqVestingContract"));
|
16
16
|
exports.PerqVestingContract = PerqVestingContract_1.default;
|
17
|
-
const SlotBurnTokenContract_1 = __importDefault(require("./SlotBurnTokenContract"));
|
18
|
-
exports.SlotBurnTokenContract = SlotBurnTokenContract_1.default;
|
@@ -8,12 +8,8 @@ export default class LoyaltyPackage {
|
|
8
8
|
getSwapPerqForBeansInfo(): Promise<PerqToBeansSwapInfo>;
|
9
9
|
upgradeLoyaltyCard(index: number): Promise<LoyaltyCard>;
|
10
10
|
getOwnedLoyaltyCard(): Promise<LoyaltyCard>;
|
11
|
-
getNextLoyaltyCard(): Promise<LoyaltyCard>;
|
12
11
|
getAllLoyaltyCards(): Promise<LoyaltyCard[]>;
|
13
12
|
claimSpecialEditionCard(cardId: string): Promise<SpecialEditionLoyaltyCard>;
|
14
13
|
getOwnedSpecialEditionCards(): Promise<SpecialEditionLoyaltyCard[]>;
|
15
14
|
getAllSpecialEditionCards(): Promise<SpecialEditionLoyaltyCard[]>;
|
16
|
-
approveForSlotSpin(tokenAddress: string, amount: string): Promise<string>;
|
17
|
-
runSlotSpin(isDepositNative: boolean): Promise<LoyaltyCard | null>;
|
18
|
-
private seededRandom;
|
19
15
|
}
|
@@ -1,11 +1,5 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const types_1 = require("../types");
|
7
|
-
const ethers_1 = require("ethers");
|
8
|
-
const ERC20TokenContract_1 = __importDefault(require("../contracts/ERC20TokenContract"));
|
9
3
|
class LoyaltyPackage {
|
10
4
|
perqSdk;
|
11
5
|
constructor(perqSdk) {
|
@@ -33,10 +27,6 @@ class LoyaltyPackage {
|
|
33
27
|
const signerAddress = await this.perqSdk.signer.getAddress();
|
34
28
|
return this.perqSdk.perqApi.fetchOwnedLoyaltyCard(signerAddress);
|
35
29
|
}
|
36
|
-
async getNextLoyaltyCard() {
|
37
|
-
const signerAddress = await this.perqSdk.signer.getAddress();
|
38
|
-
return this.perqSdk.perqApi.fetchNextLoyaltyCard(signerAddress);
|
39
|
-
}
|
40
30
|
async getAllLoyaltyCards() {
|
41
31
|
return this.perqSdk.perqApi.fetchAllLoyaltyCards();
|
42
32
|
}
|
@@ -54,44 +44,5 @@ class LoyaltyPackage {
|
|
54
44
|
async getAllSpecialEditionCards() {
|
55
45
|
return this.perqSdk.perqApi.fetchAllSpecialEditionLoyaltyCards();
|
56
46
|
}
|
57
|
-
async approveForSlotSpin(tokenAddress, amount) {
|
58
|
-
if (!this.perqSdk.signer) {
|
59
|
-
throw Error('No signer provided');
|
60
|
-
}
|
61
|
-
const tokenContract = new ERC20TokenContract_1.default(tokenAddress, this.perqSdk.signer);
|
62
|
-
const decimals = await tokenContract.getPrecission();
|
63
|
-
const parsedAmountToApprove = ethers_1.ethers.utils.parseUnits(amount, decimals);
|
64
|
-
const slotBurnTokenContractAddress = this.perqSdk.slotBurnTokenContract.getContractAddress();
|
65
|
-
return await tokenContract.approveToken(slotBurnTokenContractAddress, parsedAmountToApprove.toBigInt());
|
66
|
-
}
|
67
|
-
async runSlotSpin(isDepositNative) {
|
68
|
-
const signerAddress = await this.perqSdk.signer.getAddress();
|
69
|
-
const nextLoyaltyCard = await this.perqSdk.perqApi.fetchNextLoyaltyCard(signerAddress);
|
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;
|
73
|
-
const loyaltyCardOwnedChancesToWin = nextLoyaltyCard.chanceToUpgrade;
|
74
|
-
const formattedAmountForSpin = ethers_1.ethers.utils.parseUnits(amountForSpin.toString(), 18);
|
75
|
-
const depositResult = isDepositNative
|
76
|
-
? await this.perqSdk.slotBurnTokenContract.depositNative(formattedAmountForSpin.toString())
|
77
|
-
: await this.perqSdk.slotBurnTokenContract.deposit(formattedAmountForSpin.toString());
|
78
|
-
const txHash = depositResult.hash;
|
79
|
-
const randomValue = this.seededRandom(txHash);
|
80
|
-
const upgradeWon = randomValue * 100 <= loyaltyCardOwnedChancesToWin && loyaltyCardOwnedChancesToWin !== 0;
|
81
|
-
return upgradeWon ? nextLoyaltyCard : null;
|
82
|
-
}
|
83
|
-
seededRandom(input) {
|
84
|
-
// Convert input string to bytes
|
85
|
-
const inputBytes = ethers_1.ethers.utils.toUtf8Bytes(input);
|
86
|
-
// Hash using keccak256
|
87
|
-
const hash = ethers_1.ethers.utils.keccak256(inputBytes);
|
88
|
-
// Convert to a Buffer from hex string (strip 0x)
|
89
|
-
const hashBuffer = new Uint8Array(ethers_1.ethers.utils.arrayify(hash));
|
90
|
-
const dataView = new DataView(hashBuffer.buffer);
|
91
|
-
// Read first 8 bytes as BigUInt64
|
92
|
-
const num = dataView.getBigUint64(0);
|
93
|
-
// Normalize to [0, 1)
|
94
|
-
return Number(num % BigInt(1e12)) / 1e12;
|
95
|
-
}
|
96
47
|
}
|
97
48
|
exports.default = LoyaltyPackage;
|
package/dist/types/PerqConfig.js
CHANGED
@@ -12,7 +12,6 @@ exports.PRODUCTION = {
|
|
12
12
|
swapAndDepositContractAddress: '0xd8534197bd587f8226d12e0c864ef2cae6f82f5c',
|
13
13
|
ethereumSwapperAddress: '0x33e52c206d584550193e642c8982f2fff6339994',
|
14
14
|
smartVaultManagerContractAddress: '0x23daf34e2b9af02a74dc19cb52af727b19403874',
|
15
|
-
slotBurnTokenAddress: '0xf9baae6b27093099f9821bdc7f4e29c770e8abe7',
|
16
15
|
};
|
17
16
|
exports.DEVELOPMENT = {
|
18
17
|
route: 'https://dev.perq.finance',
|
@@ -23,5 +22,4 @@ exports.DEVELOPMENT = {
|
|
23
22
|
swapAndDepositContractAddress: '0x5fb08e00de169f041711206a0995410884080177',
|
24
23
|
ethereumSwapperAddress: '0xe411921ee9eedfefd7b9ae15bf232bd36949fcbbc',
|
25
24
|
smartVaultManagerContractAddress: '0x2638d6c0b4ef6dee04050fa0b07ca62500435747',
|
26
|
-
slotBurnTokenAddress: '0xf9baae6b27093099f9821bdc7f4e29c770e8abe7',
|
27
25
|
};
|
package/package.json
CHANGED
@@ -1,86 +0,0 @@
|
|
1
|
-
[
|
2
|
-
{
|
3
|
-
"inputs": [{ "internalType": "address", "name": "admin", "type": "address" }],
|
4
|
-
"stateMutability": "nonpayable",
|
5
|
-
"type": "constructor"
|
6
|
-
},
|
7
|
-
{
|
8
|
-
"inputs": [{ "internalType": "address", "name": "owner", "type": "address" }],
|
9
|
-
"name": "OwnableInvalidOwner",
|
10
|
-
"type": "error"
|
11
|
-
},
|
12
|
-
{
|
13
|
-
"inputs": [{ "internalType": "address", "name": "account", "type": "address" }],
|
14
|
-
"name": "OwnableUnauthorizedAccount",
|
15
|
-
"type": "error"
|
16
|
-
},
|
17
|
-
{
|
18
|
-
"inputs": [{ "internalType": "address", "name": "token", "type": "address" }],
|
19
|
-
"name": "SafeERC20FailedOperation",
|
20
|
-
"type": "error"
|
21
|
-
},
|
22
|
-
{
|
23
|
-
"anonymous": false,
|
24
|
-
"inputs": [
|
25
|
-
{ "indexed": true, "internalType": "address", "name": "depositor", "type": "address" },
|
26
|
-
{ "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }
|
27
|
-
],
|
28
|
-
"name": "Deposit",
|
29
|
-
"type": "event"
|
30
|
-
},
|
31
|
-
{
|
32
|
-
"anonymous": false,
|
33
|
-
"inputs": [
|
34
|
-
{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" },
|
35
|
-
{ "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }
|
36
|
-
],
|
37
|
-
"name": "OwnershipTransferred",
|
38
|
-
"type": "event"
|
39
|
-
},
|
40
|
-
{
|
41
|
-
"anonymous": false,
|
42
|
-
"inputs": [
|
43
|
-
{ "indexed": true, "internalType": "address", "name": "to", "type": "address" },
|
44
|
-
{ "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }
|
45
|
-
],
|
46
|
-
"name": "Withdraw",
|
47
|
-
"type": "event"
|
48
|
-
},
|
49
|
-
{
|
50
|
-
"inputs": [],
|
51
|
-
"name": "WRAPPED_SONIC",
|
52
|
-
"outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }],
|
53
|
-
"stateMutability": "view",
|
54
|
-
"type": "function"
|
55
|
-
},
|
56
|
-
{
|
57
|
-
"inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }],
|
58
|
-
"name": "deposit",
|
59
|
-
"outputs": [],
|
60
|
-
"stateMutability": "nonpayable",
|
61
|
-
"type": "function"
|
62
|
-
},
|
63
|
-
{ "inputs": [], "name": "depositNative", "outputs": [], "stateMutability": "payable", "type": "function" },
|
64
|
-
{
|
65
|
-
"inputs": [],
|
66
|
-
"name": "owner",
|
67
|
-
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
68
|
-
"stateMutability": "view",
|
69
|
-
"type": "function"
|
70
|
-
},
|
71
|
-
{ "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" },
|
72
|
-
{
|
73
|
-
"inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }],
|
74
|
-
"name": "transferOwnership",
|
75
|
-
"outputs": [],
|
76
|
-
"stateMutability": "nonpayable",
|
77
|
-
"type": "function"
|
78
|
-
},
|
79
|
-
{
|
80
|
-
"inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }],
|
81
|
-
"name": "withdraw",
|
82
|
-
"outputs": [],
|
83
|
-
"stateMutability": "nonpayable",
|
84
|
-
"type": "function"
|
85
|
-
}
|
86
|
-
]
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { ContractTransaction } from 'ethers';
|
2
|
-
import BasePerqContract from './BasePerqContract';
|
3
|
-
import PerqSdk from '../PerqSdk';
|
4
|
-
export default class SlotBurnTokenContract extends BasePerqContract {
|
5
|
-
constructor(perqSdk: PerqSdk);
|
6
|
-
deposit(amount: string): Promise<ContractTransaction>;
|
7
|
-
depositNative(amount: string): Promise<ContractTransaction>;
|
8
|
-
}
|
@@ -1,26 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const ethers_1 = require("ethers");
|
7
|
-
const SlotBurnTokenAbi_json_1 = __importDefault(require("../abi/SlotBurnTokenAbi.json"));
|
8
|
-
const BasePerqContract_1 = __importDefault(require("./BasePerqContract"));
|
9
|
-
class SlotBurnTokenContract extends BasePerqContract_1.default {
|
10
|
-
constructor(perqSdk) {
|
11
|
-
super(perqSdk.perqConfig.slotBurnTokenAddress, new ethers_1.ethers.utils.Interface(SlotBurnTokenAbi_json_1.default), perqSdk.signer);
|
12
|
-
}
|
13
|
-
async deposit(amount) {
|
14
|
-
if (!this.contract.signer) {
|
15
|
-
throw Error('No signer provided');
|
16
|
-
}
|
17
|
-
return await this.contract.deposit(amount.toString());
|
18
|
-
}
|
19
|
-
async depositNative(amount) {
|
20
|
-
if (!this.contract.signer) {
|
21
|
-
throw Error('No signer provided');
|
22
|
-
}
|
23
|
-
return await this.contract.depositNative({ value: amount.toString() });
|
24
|
-
}
|
25
|
-
}
|
26
|
-
exports.default = SlotBurnTokenContract;
|