@dripfi/drip-sdk 1.4.28-bridge-perq-1 → 1.4.28-silo-sdk
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/README.md +45 -48
- package/dist/PerqSdk.d.ts +5 -3
- package/dist/PerqSdk.js +8 -5
- package/dist/abi/index.d.ts +0 -286
- package/dist/abi/index.js +4 -8
- package/dist/contracts/{BasePerqContract.d.ts → BaseContract.d.ts} +1 -1
- package/dist/contracts/{BasePerqContract.js → BaseContract.js} +2 -2
- package/dist/contracts/index.d.ts +6 -8
- package/dist/contracts/index.js +7 -11
- package/dist/contracts/{PerqSwapAndRecyclerContract.d.ts → perq/PerqSwapAndRecyclerContract.d.ts} +3 -3
- package/dist/contracts/{PerqSwapAndRecyclerContract.js → perq/PerqSwapAndRecyclerContract.js} +3 -3
- package/dist/contracts/{PerqTokenContract.d.ts → perq/PerqTokenContract.d.ts} +2 -2
- package/dist/contracts/{PerqTokenContract.js → perq/PerqTokenContract.js} +3 -3
- package/dist/contracts/{PerqTokenRecyclerContract.d.ts → perq/PerqTokenRecyclerContract.d.ts} +3 -3
- package/dist/contracts/{PerqTokenRecyclerContract.js → perq/PerqTokenRecyclerContract.js} +3 -3
- package/dist/contracts/{PerqVestingContract.d.ts → perq/PerqVestingContract.d.ts} +3 -3
- package/dist/contracts/{PerqVestingContract.js → perq/PerqVestingContract.js} +3 -3
- package/dist/subpackages/SiloPackage.d.ts +18 -0
- package/dist/subpackages/SiloPackage.js +115 -0
- package/dist/subpackages/VaultHandlerPackage.d.ts +37 -0
- package/dist/subpackages/VaultHandlerPackage.js +154 -0
- package/dist/types/DeployedProject.d.ts +1 -0
- package/dist/types/PerqConfig.d.ts +0 -2
- package/dist/types/PerqConfig.js +0 -4
- package/dist/types/SdkType.d.ts +2 -0
- package/dist/types/VaultData.d.ts +2 -0
- package/package.json +2 -1
- package/dist/abi/BridgeMainnetPerqToSonicAbi.json +0 -598
- package/dist/abi/BridgeSonicPerqToMainnetAbi.json +0 -733
- package/dist/contracts/BridgeMainnetPerqToSonicContract.d.ts +0 -9
- package/dist/contracts/BridgeMainnetPerqToSonicContract.js +0 -48
- package/dist/contracts/BridgeSonicPerqToMainnetContract.d.ts +0 -9
- package/dist/contracts/BridgeSonicPerqToMainnetContract.js +0 -47
- package/dist/subpackages/BridgePerqPackage.d.ts +0 -36
- package/dist/subpackages/BridgePerqPackage.js +0 -207
- package/dist/types/BridgePerq.d.ts +0 -14
- /package/dist/abi/{PerqSwapAndRecyclerAbi.json → perq/PerqSwapAndRecyclerAbi.json} +0 -0
- /package/dist/abi/{PerqTokenAbi.json → perq/PerqTokenAbi.json} +0 -0
- /package/dist/abi/{PerqVestingAbi.json → perq/PerqVestingAbi.json} +0 -0
- /package/dist/abi/{TokenRecyclerAbi.json → perq/TokenRecyclerAbi.json} +0 -0
- /package/dist/types/{BridgePerq.js → SdkType.js} +0 -0
package/README.md
CHANGED
@@ -15,6 +15,8 @@ The Drip SDK is a TypeScript library designed to interact with the Perq protocol
|
|
15
15
|
- [Vesting](#vesting)
|
16
16
|
- [Recycler](#recycler)
|
17
17
|
- [Sign Handler](#sign-handler)
|
18
|
+
- [Silo](#silo)
|
19
|
+
- [Vault Handler](#vault-handler)
|
18
20
|
- [Examples](#examples)
|
19
21
|
- [Types](#types)
|
20
22
|
- [Abis](#abis)
|
@@ -154,16 +156,15 @@ Access recycler methods through `sdk.recycler`:
|
|
154
156
|
|
155
157
|
Access token utils methods through `sdk.tokenUtils`:
|
156
158
|
|
157
|
-
| Method
|
158
|
-
|
159
|
-
|
|
160
|
-
| `
|
161
|
-
| `
|
162
|
-
| `
|
163
|
-
| `
|
164
|
-
| `
|
165
|
-
| `
|
166
|
-
| `getPerqTokenContractAddress(): string` | Returns the contract address of the Perq token. |
|
159
|
+
| Method | Description |
|
160
|
+
| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
|
161
|
+
| `getTokenPrice(tokenName: string): Promise<number>` | Fetches the current price of a given token. "perq", "weth", "eth" and "wbtc" are supported |
|
162
|
+
| `getAllowance(tokenAddress: string, spender: string): Promise<string>` | Retrieves the current allowance for a token. |
|
163
|
+
| `approveAllowance(tokenAddress: string, amount: string, spenderAddress: string): Promise<string>` | Approves a specific amount of tokens for use by a spender. |
|
164
|
+
| `transferErc20Token(tokenAddress: string, amount: string, receiver: string): Promise<string>` | Transfers a specified amount of ERC20 tokens to a receiver. |
|
165
|
+
| `wrapEther(amount: string, tokenAddress: string): Promise<string>` | Wraps a specified amount of Ether into a WETH token. |
|
166
|
+
| `getERC20TokenAllowance(spender: string, tokenAddress: string): Promise<BigNumber>` | Retrieves the allowance for a specific ERC20 token. |
|
167
|
+
| `getPerqTokenContractAddress(): string` | Returns the contract address of the Perq token. |
|
167
168
|
|
168
169
|
### Sign Handler
|
169
170
|
|
@@ -173,6 +174,29 @@ Access signing methods through `sdk.signHandler`:
|
|
173
174
|
| -------------------------------------------------------------------- | -------------------------------------- |
|
174
175
|
| `signPayload<T>(payload: T): Promise<NonceEnrichedSignedPayload<T>>` | Signs a payload with nonce enrichment. |
|
175
176
|
|
177
|
+
### Silo
|
178
|
+
|
179
|
+
Access silo methods through `sdk.silo`:
|
180
|
+
|
181
|
+
| Method | Description |
|
182
|
+
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
|
183
|
+
| `deposit(assetAmount: string, vaultAddress: string): Promise<string \| undefined>` | Deposits into a Silo Vault. |
|
184
|
+
| `withdraw(assetAmount: string, vaultAddress: string): Promise<string \| undefined>` | Withdraws from a Silo Vault. Recommended for partial withdrawals. |
|
185
|
+
| `redeem(sharesAmount: string, vaultAddress: string): Promise<string \| undefined>` | Withdraws from a Silo Vault. Recommended for full withdraws. |
|
186
|
+
| `getBalanceInShares(vaultAddress: string): Promise<BigNumber>` | Get the users balance in Shares. |
|
187
|
+
| `getBalanceInAssets(vaultAddress: string): Promise<BigNumber>` | Get the users balance in the vaults currency/asset. |
|
188
|
+
| `getTotalSupply(vaultAddress: string): Promise<BigNumber>` | Retrieves the total amounts of shares in the Vault. |
|
189
|
+
| `getTotalAssets(vaultAddress: string): string` | Returns the total balance in the vaults currency/asset. |
|
190
|
+
|
191
|
+
### Vault Handler
|
192
|
+
|
193
|
+
Access vault methods through `sdk.vault`:
|
194
|
+
|
195
|
+
| Method | Description |
|
196
|
+
| ------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------- |
|
197
|
+
| `deposit(tokenAddress: string, vaultAddress: string, amount: string, sdkType: SdkType, onChainProjectId?: number): Promise<string>` | Handles deposit into any Vault by determining which sdk to use. |
|
198
|
+
| `withdraw(tokenAddress: string, vaultAddress: string, amount: string, sdkType: SdkType, onChainProjectId?: number): Promise<string>` | Withdraws from any Vault. |
|
199
|
+
|
176
200
|
## Examples
|
177
201
|
|
178
202
|
### `deposit(tokenAddress: string, vaultAddress: string, amount: string): Promise<string>`
|
@@ -277,43 +301,11 @@ const vaultToWithdrawFrom = vaults[0];
|
|
277
301
|
const txHash = await lite.withdraw(
|
278
302
|
vaultToWithdrawFrom.depositToken.tokenAddress,
|
279
303
|
vaultToWithdrawFrom.vaultAddress,
|
280
|
-
vaultToWithdrawFrom
|
304
|
+
**vaultToWithdrawFrom**.onChainProjectId,
|
281
305
|
'3.55',
|
282
306
|
);
|
283
307
|
```
|
284
308
|
|
285
|
-
### `checkMainnetToSonicBridgeApproval(amount: string): Promise<boolean>`
|
286
|
-
|
287
|
-
I want to check if the User approved the bridge contract to bridge 10 PERQ from MAINNET to SONIC
|
288
|
-
|
289
|
-
```typescript
|
290
|
-
const hasApprovedAmount = await dripSdk.bridge.checkMainnetToSonicBridgeApproval('10');
|
291
|
-
```
|
292
|
-
|
293
|
-
### `approveMainnetToSonicBridge(amount: string): Promise<string>`
|
294
|
-
|
295
|
-
I want to approve to bridge 10 PERQ from MAINNET to SONIC
|
296
|
-
|
297
|
-
```typescript
|
298
|
-
const txHash = await dripSdk.bridge.approveMainnetToSonicBridge('10');
|
299
|
-
```
|
300
|
-
|
301
|
-
### `bridgeMainnetToSonic(amount: string): Promise<string>`
|
302
|
-
|
303
|
-
I want to bridge 10 PERQ from MAINNET to SONIC
|
304
|
-
|
305
|
-
```typescript
|
306
|
-
const txHash = await dripSdk.bridge.bridgeMainnetToSonic('10');
|
307
|
-
```
|
308
|
-
|
309
|
-
### `bridgeSonicToMainnet(amount: string): Promise<string>`
|
310
|
-
|
311
|
-
I want to bridge 10 PERQ from SONIC to MAINNET
|
312
|
-
|
313
|
-
```typescript
|
314
|
-
const txHash = await dripSdk.bridge.bridgeSonicToMainnet('10');
|
315
|
-
```
|
316
|
-
|
317
309
|
## Types
|
318
310
|
|
319
311
|
```typescript
|
@@ -466,15 +458,15 @@ type NonceEnrichedSignedPayload<T> = {
|
|
466
458
|
|
467
459
|
type PerqConfig = {
|
468
460
|
route: string;
|
461
|
+
yelayLiteSdkConfig: sdkConfig;
|
469
462
|
perqTokenAddress: string;
|
470
463
|
perqTokenRecyclerAddress: string;
|
471
464
|
perqSwapAndRecyclerAddress: string;
|
472
465
|
perqVestingAddress: string;
|
473
466
|
swapAndDepositContractAddress: string;
|
467
|
+
smartVaultManagerContractAddress: string;
|
474
468
|
ethereumSwapperAddress: string;
|
475
|
-
|
476
|
-
bridgeMainnetPerqToSonicAddress: string;
|
477
|
-
bridgeSonicPerqToMainnetAddress: string;
|
469
|
+
baseSwapperAddress: string;
|
478
470
|
};
|
479
471
|
|
480
472
|
type PerqToBeansSwapInfo = {
|
@@ -507,6 +499,8 @@ type QLFastRedeem = {
|
|
507
499
|
svtWithdrawn: string;
|
508
500
|
};
|
509
501
|
|
502
|
+
type SdkType = 'lite' | 'silo';
|
503
|
+
|
510
504
|
type SpecialEditionLoyaltyCard = {
|
511
505
|
id: string;
|
512
506
|
name: string;
|
@@ -600,6 +594,7 @@ type VaultData = {
|
|
600
594
|
stretchGoals: StretchGoal[];
|
601
595
|
rewards: VaultReward[];
|
602
596
|
rewardTooltipName: string;
|
597
|
+
sdkType: SdkType;
|
603
598
|
};
|
604
599
|
|
605
600
|
type VaultReward = {
|
@@ -729,9 +724,11 @@ type OverallStats = {
|
|
729
724
|
## Abis
|
730
725
|
|
731
726
|
- PERQ_SWAP_AND_RECYCLER_ABI
|
727
|
+
|
732
728
|
- WETH_TOKEN_ABI
|
729
|
+
|
733
730
|
- PERQ_TOKEN_ABI
|
731
|
+
|
734
732
|
- TOKEN_RECYCLER_ABI
|
733
|
+
|
735
734
|
- PERQ_VESTING_ABI
|
736
|
-
- BRIDGE_SONIC_PERQ_TO_MAINNET_ABI
|
737
|
-
- BRIDGE_MAINNET_PERQ_TO_SONIC_ABI
|
package/dist/PerqSdk.d.ts
CHANGED
@@ -3,7 +3,6 @@ import { PerqConfig } from './types';
|
|
3
3
|
import PerqApi from './PerqApi';
|
4
4
|
import { PerqSwapAndRecyclerContract, PerqTokenRecyclerContract, PerqVestingContract } from './contracts';
|
5
5
|
import VestingPackage from './subpackages/VestingPackage';
|
6
|
-
import BridgePerqPackage from './subpackages/BridgePerqPackage';
|
7
6
|
import LitePackage from './subpackages/LitePackage';
|
8
7
|
import RecyclerPackage from './subpackages/RecyclerPackage';
|
9
8
|
import LoyaltyCardsPackage from './subpackages/LoyaltyCardsPackage';
|
@@ -13,23 +12,26 @@ import UserPackage from './subpackages/UserPackage';
|
|
13
12
|
import SignHandlerPackage from './subpackages/SignHandlerPackage';
|
14
13
|
import PoolsPackage from './subpackages/PoolsPackage';
|
15
14
|
import { PerqSupportedChainId } from './types/PerqConfig';
|
15
|
+
import SiloPackage from './subpackages/SiloPackage';
|
16
|
+
import VaultHandler from './subpackages/VaultHandlerPackage';
|
16
17
|
export default class PerqSdk {
|
17
18
|
perqApi: PerqApi;
|
18
19
|
signer?: Signer;
|
19
20
|
lite: LitePackage;
|
20
21
|
vesting: VestingPackage;
|
21
|
-
bridge: BridgePerqPackage;
|
22
22
|
recycler: RecyclerPackage;
|
23
23
|
loyaltyCards: LoyaltyCardsPackage;
|
24
24
|
tokenUtils: TokenUtilsPackage;
|
25
25
|
user: UserPackage;
|
26
26
|
signHandler: SignHandlerPackage;
|
27
27
|
pools: PoolsPackage;
|
28
|
+
vault: VaultHandler;
|
28
29
|
perqConfig: PerqConfig;
|
29
|
-
yelayLiteSdk?: YelayLiteSdk;
|
30
30
|
perqVestingContract: PerqVestingContract;
|
31
31
|
perqTokenRecyclerContract: PerqTokenRecyclerContract;
|
32
32
|
perqSwapAndRecyclerContract: PerqSwapAndRecyclerContract;
|
33
|
+
yelayLiteSdk?: YelayLiteSdk;
|
34
|
+
siloPackage?: SiloPackage;
|
33
35
|
constructor(perqConfig: PerqConfig, chainId: PerqSupportedChainId, provider?: ethers.providers.JsonRpcProvider);
|
34
36
|
updateSigner(newSigner: Signer, chainId: PerqSupportedChainId): Promise<void>;
|
35
37
|
}
|
package/dist/PerqSdk.js
CHANGED
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const PerqApi_1 = __importDefault(require("./PerqApi"));
|
7
7
|
const contracts_1 = require("./contracts");
|
8
8
|
const VestingPackage_1 = __importDefault(require("./subpackages/VestingPackage"));
|
9
|
-
const BridgePerqPackage_1 = __importDefault(require("./subpackages/BridgePerqPackage"));
|
10
9
|
const LitePackage_1 = __importDefault(require("./subpackages/LitePackage"));
|
11
10
|
const RecyclerPackage_1 = __importDefault(require("./subpackages/RecyclerPackage"));
|
12
11
|
const LoyaltyCardsPackage_1 = __importDefault(require("./subpackages/LoyaltyCardsPackage"));
|
@@ -15,32 +14,35 @@ const TokenUtilsPackage_1 = __importDefault(require("./subpackages/TokenUtilsPac
|
|
15
14
|
const UserPackage_1 = __importDefault(require("./subpackages/UserPackage"));
|
16
15
|
const SignHandlerPackage_1 = __importDefault(require("./subpackages/SignHandlerPackage"));
|
17
16
|
const PoolsPackage_1 = __importDefault(require("./subpackages/PoolsPackage"));
|
17
|
+
const SiloPackage_1 = __importDefault(require("./subpackages/SiloPackage"));
|
18
|
+
const VaultHandlerPackage_1 = __importDefault(require("./subpackages/VaultHandlerPackage"));
|
18
19
|
class PerqSdk {
|
19
20
|
perqApi;
|
20
21
|
signer;
|
21
22
|
lite;
|
22
23
|
vesting;
|
23
|
-
bridge;
|
24
24
|
recycler;
|
25
25
|
loyaltyCards;
|
26
26
|
tokenUtils;
|
27
27
|
user;
|
28
28
|
signHandler;
|
29
29
|
pools;
|
30
|
+
vault;
|
30
31
|
perqConfig;
|
31
|
-
yelayLiteSdk;
|
32
32
|
perqVestingContract;
|
33
33
|
perqTokenRecyclerContract;
|
34
34
|
perqSwapAndRecyclerContract;
|
35
|
+
yelayLiteSdk;
|
36
|
+
siloPackage;
|
35
37
|
constructor(perqConfig, chainId, provider) {
|
36
38
|
this.perqConfig = perqConfig;
|
37
39
|
const newSigner = provider?.getSigner();
|
38
40
|
if (newSigner) {
|
39
41
|
this.signer = newSigner;
|
40
42
|
this.yelayLiteSdk = new sdk_1.YelayLiteSdk(this.signer, chainId, false);
|
43
|
+
this.siloPackage = new SiloPackage_1.default(newSigner);
|
41
44
|
}
|
42
45
|
this.vesting = new VestingPackage_1.default(this);
|
43
|
-
this.bridge = new BridgePerqPackage_1.default(this);
|
44
46
|
this.lite = new LitePackage_1.default(this);
|
45
47
|
this.recycler = new RecyclerPackage_1.default(this);
|
46
48
|
this.loyaltyCards = new LoyaltyCardsPackage_1.default(this);
|
@@ -48,6 +50,7 @@ class PerqSdk {
|
|
48
50
|
this.user = new UserPackage_1.default(this);
|
49
51
|
this.signHandler = new SignHandlerPackage_1.default(this);
|
50
52
|
this.pools = new PoolsPackage_1.default(this);
|
53
|
+
this.vault = new VaultHandlerPackage_1.default(this);
|
51
54
|
this.perqApi = new PerqApi_1.default(this);
|
52
55
|
this.perqVestingContract = new contracts_1.PerqVestingContract(this);
|
53
56
|
this.perqTokenRecyclerContract = new contracts_1.PerqTokenRecyclerContract(this);
|
@@ -59,7 +62,7 @@ class PerqSdk {
|
|
59
62
|
this.perqVestingContract = new contracts_1.PerqVestingContract(this);
|
60
63
|
this.perqTokenRecyclerContract = new contracts_1.PerqTokenRecyclerContract(this);
|
61
64
|
this.perqSwapAndRecyclerContract = new contracts_1.PerqSwapAndRecyclerContract(this);
|
62
|
-
this.
|
65
|
+
this.siloPackage = new SiloPackage_1.default(newSigner);
|
63
66
|
}
|
64
67
|
}
|
65
68
|
exports.default = PerqSdk;
|
package/dist/abi/index.d.ts
CHANGED
@@ -71,291 +71,5 @@ declare const _default: {
|
|
71
71
|
stateMutability: string;
|
72
72
|
type: string;
|
73
73
|
}[];
|
74
|
-
readonly BRIDGE_SONIC_PERQ_TO_MAINNET_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
|
-
anonymous: boolean;
|
110
|
-
inputs: {
|
111
|
-
components: {
|
112
|
-
internalType: string;
|
113
|
-
name: string;
|
114
|
-
type: string;
|
115
|
-
}[];
|
116
|
-
indexed: boolean;
|
117
|
-
internalType: string;
|
118
|
-
name: string;
|
119
|
-
type: string;
|
120
|
-
}[];
|
121
|
-
name: string;
|
122
|
-
type: string;
|
123
|
-
stateMutability?: undefined;
|
124
|
-
outputs?: undefined;
|
125
|
-
} | {
|
126
|
-
inputs: ({
|
127
|
-
components: {
|
128
|
-
internalType: string;
|
129
|
-
name: string;
|
130
|
-
type: string;
|
131
|
-
}[];
|
132
|
-
internalType: string;
|
133
|
-
name: string;
|
134
|
-
type: string;
|
135
|
-
} | {
|
136
|
-
internalType: string;
|
137
|
-
name: string;
|
138
|
-
type: string;
|
139
|
-
components?: undefined;
|
140
|
-
})[];
|
141
|
-
name: string;
|
142
|
-
outputs: {
|
143
|
-
internalType: string;
|
144
|
-
name: string;
|
145
|
-
type: string;
|
146
|
-
}[];
|
147
|
-
stateMutability: string;
|
148
|
-
type: string;
|
149
|
-
anonymous?: undefined;
|
150
|
-
} | {
|
151
|
-
inputs: {
|
152
|
-
components: ({
|
153
|
-
components: {
|
154
|
-
internalType: string;
|
155
|
-
name: string;
|
156
|
-
type: string;
|
157
|
-
}[];
|
158
|
-
internalType: string;
|
159
|
-
name: string;
|
160
|
-
type: string;
|
161
|
-
} | {
|
162
|
-
internalType: string;
|
163
|
-
name: string;
|
164
|
-
type: string;
|
165
|
-
components?: undefined;
|
166
|
-
})[];
|
167
|
-
internalType: string;
|
168
|
-
name: string;
|
169
|
-
type: string;
|
170
|
-
}[];
|
171
|
-
name: string;
|
172
|
-
outputs: never[];
|
173
|
-
stateMutability: string;
|
174
|
-
type: string;
|
175
|
-
anonymous?: undefined;
|
176
|
-
} | {
|
177
|
-
inputs: ({
|
178
|
-
components: {
|
179
|
-
internalType: string;
|
180
|
-
name: string;
|
181
|
-
type: string;
|
182
|
-
}[];
|
183
|
-
internalType: string;
|
184
|
-
name: string;
|
185
|
-
type: string;
|
186
|
-
} | {
|
187
|
-
internalType: string;
|
188
|
-
name: string;
|
189
|
-
type: string;
|
190
|
-
components?: undefined;
|
191
|
-
})[];
|
192
|
-
name: string;
|
193
|
-
outputs: {
|
194
|
-
components: ({
|
195
|
-
internalType: string;
|
196
|
-
name: string;
|
197
|
-
type: string;
|
198
|
-
components?: undefined;
|
199
|
-
} | {
|
200
|
-
components: {
|
201
|
-
internalType: string;
|
202
|
-
name: string;
|
203
|
-
type: string;
|
204
|
-
}[];
|
205
|
-
internalType: string;
|
206
|
-
name: string;
|
207
|
-
type: string;
|
208
|
-
})[];
|
209
|
-
internalType: string;
|
210
|
-
name: string;
|
211
|
-
type: string;
|
212
|
-
}[];
|
213
|
-
stateMutability: string;
|
214
|
-
type: string;
|
215
|
-
anonymous?: undefined;
|
216
|
-
})[];
|
217
|
-
readonly BRIDGE_MAINNET_PERQ_TO_SONIC_ABI: ({
|
218
|
-
inputs: {
|
219
|
-
internalType: string;
|
220
|
-
name: string;
|
221
|
-
type: string;
|
222
|
-
}[];
|
223
|
-
stateMutability: string;
|
224
|
-
type: string;
|
225
|
-
name?: undefined;
|
226
|
-
anonymous?: undefined;
|
227
|
-
outputs?: undefined;
|
228
|
-
} | {
|
229
|
-
inputs: {
|
230
|
-
internalType: string;
|
231
|
-
name: string;
|
232
|
-
type: string;
|
233
|
-
}[];
|
234
|
-
name: string;
|
235
|
-
type: string;
|
236
|
-
stateMutability?: undefined;
|
237
|
-
anonymous?: undefined;
|
238
|
-
outputs?: undefined;
|
239
|
-
} | {
|
240
|
-
anonymous: boolean;
|
241
|
-
inputs: {
|
242
|
-
components: {
|
243
|
-
internalType: string;
|
244
|
-
name: string;
|
245
|
-
type: string;
|
246
|
-
}[];
|
247
|
-
indexed: boolean;
|
248
|
-
internalType: string;
|
249
|
-
name: string;
|
250
|
-
type: string;
|
251
|
-
}[];
|
252
|
-
name: string;
|
253
|
-
type: string;
|
254
|
-
stateMutability?: undefined;
|
255
|
-
outputs?: undefined;
|
256
|
-
} | {
|
257
|
-
anonymous: boolean;
|
258
|
-
inputs: {
|
259
|
-
indexed: boolean;
|
260
|
-
internalType: string;
|
261
|
-
name: string;
|
262
|
-
type: string;
|
263
|
-
}[];
|
264
|
-
name: string;
|
265
|
-
type: string;
|
266
|
-
stateMutability?: undefined;
|
267
|
-
outputs?: undefined;
|
268
|
-
} | {
|
269
|
-
inputs: ({
|
270
|
-
components: {
|
271
|
-
internalType: string;
|
272
|
-
name: string;
|
273
|
-
type: string;
|
274
|
-
}[];
|
275
|
-
internalType: string;
|
276
|
-
name: string;
|
277
|
-
type: string;
|
278
|
-
} | {
|
279
|
-
internalType: string;
|
280
|
-
name: string;
|
281
|
-
type: string;
|
282
|
-
components?: undefined;
|
283
|
-
})[];
|
284
|
-
name: string;
|
285
|
-
outputs: {
|
286
|
-
internalType: string;
|
287
|
-
name: string;
|
288
|
-
type: string;
|
289
|
-
}[];
|
290
|
-
stateMutability: string;
|
291
|
-
type: string;
|
292
|
-
anonymous?: undefined;
|
293
|
-
} | {
|
294
|
-
inputs: {
|
295
|
-
components: ({
|
296
|
-
components: {
|
297
|
-
internalType: string;
|
298
|
-
name: string;
|
299
|
-
type: string;
|
300
|
-
}[];
|
301
|
-
internalType: string;
|
302
|
-
name: string;
|
303
|
-
type: string;
|
304
|
-
} | {
|
305
|
-
internalType: string;
|
306
|
-
name: string;
|
307
|
-
type: string;
|
308
|
-
components?: undefined;
|
309
|
-
})[];
|
310
|
-
internalType: string;
|
311
|
-
name: string;
|
312
|
-
type: string;
|
313
|
-
}[];
|
314
|
-
name: string;
|
315
|
-
outputs: never[];
|
316
|
-
stateMutability: string;
|
317
|
-
type: string;
|
318
|
-
anonymous?: undefined;
|
319
|
-
} | {
|
320
|
-
inputs: ({
|
321
|
-
components: {
|
322
|
-
internalType: string;
|
323
|
-
name: string;
|
324
|
-
type: string;
|
325
|
-
}[];
|
326
|
-
internalType: string;
|
327
|
-
name: string;
|
328
|
-
type: string;
|
329
|
-
} | {
|
330
|
-
internalType: string;
|
331
|
-
name: string;
|
332
|
-
type: string;
|
333
|
-
components?: undefined;
|
334
|
-
})[];
|
335
|
-
name: string;
|
336
|
-
outputs: {
|
337
|
-
components: ({
|
338
|
-
internalType: string;
|
339
|
-
name: string;
|
340
|
-
type: string;
|
341
|
-
components?: undefined;
|
342
|
-
} | {
|
343
|
-
components: {
|
344
|
-
internalType: string;
|
345
|
-
name: string;
|
346
|
-
type: string;
|
347
|
-
}[];
|
348
|
-
internalType: string;
|
349
|
-
name: string;
|
350
|
-
type: string;
|
351
|
-
})[];
|
352
|
-
internalType: string;
|
353
|
-
name: string;
|
354
|
-
type: string;
|
355
|
-
}[];
|
356
|
-
stateMutability: string;
|
357
|
-
type: string;
|
358
|
-
anonymous?: undefined;
|
359
|
-
})[];
|
360
74
|
};
|
361
75
|
export default _default;
|
package/dist/abi/index.js
CHANGED
@@ -3,19 +3,15 @@ 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 PerqSwapAndRecyclerAbi_json_1 = __importDefault(require("
|
6
|
+
const PerqSwapAndRecyclerAbi_json_1 = __importDefault(require("../abi/perq/PerqSwapAndRecyclerAbi.json"));
|
7
7
|
const WethTokenAbi_json_1 = __importDefault(require("./WethTokenAbi.json"));
|
8
|
-
const PerqTokenAbi_json_1 = __importDefault(require("
|
9
|
-
const TokenRecyclerAbi_json_1 = __importDefault(require("
|
10
|
-
const PerqVestingAbi_json_1 = __importDefault(require("
|
11
|
-
const BridgeSonicPerqToMainnetAbi_json_1 = __importDefault(require("./BridgeSonicPerqToMainnetAbi.json"));
|
12
|
-
const BridgeMainnetPerqToSonicAbi_json_1 = __importDefault(require("./BridgeMainnetPerqToSonicAbi.json"));
|
8
|
+
const PerqTokenAbi_json_1 = __importDefault(require("../abi/perq/PerqTokenAbi.json"));
|
9
|
+
const TokenRecyclerAbi_json_1 = __importDefault(require("../abi/perq/TokenRecyclerAbi.json"));
|
10
|
+
const PerqVestingAbi_json_1 = __importDefault(require("../abi/perq/PerqVestingAbi.json"));
|
13
11
|
exports.default = {
|
14
12
|
PERQ_SWAP_AND_RECYCLER_ABI: PerqSwapAndRecyclerAbi_json_1.default,
|
15
13
|
WETH_TOKEN_ABI: WethTokenAbi_json_1.default,
|
16
14
|
PERQ_TOKEN_ABI: PerqTokenAbi_json_1.default,
|
17
15
|
TOKEN_RECYCLER_ABI: TokenRecyclerAbi_json_1.default,
|
18
16
|
PERQ_VESTING_ABI: PerqVestingAbi_json_1.default,
|
19
|
-
BRIDGE_SONIC_PERQ_TO_MAINNET_ABI: BridgeSonicPerqToMainnetAbi_json_1.default,
|
20
|
-
BRIDGE_MAINNET_PERQ_TO_SONIC_ABI: BridgeMainnetPerqToSonicAbi_json_1.default,
|
21
17
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ethers } from 'ethers';
|
2
|
-
export default abstract class
|
2
|
+
export default abstract class BaseContract {
|
3
3
|
protected contract: ethers.Contract;
|
4
4
|
constructor(address: string, abi: ethers.ContractInterface, signer?: ethers.Signer);
|
5
5
|
updateSigner(newSigner: ethers.Signer): void;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const ethers_1 = require("ethers");
|
4
|
-
class
|
4
|
+
class BaseContract {
|
5
5
|
contract;
|
6
6
|
constructor(address, abi, signer) {
|
7
7
|
this.contract = new ethers_1.ethers.Contract(address, abi, signer);
|
@@ -13,4 +13,4 @@ class BasePerqContract {
|
|
13
13
|
return this.contract.address;
|
14
14
|
}
|
15
15
|
}
|
16
|
-
exports.default =
|
16
|
+
exports.default = BaseContract;
|
@@ -1,8 +1,6 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
|
7
|
-
import PerqVestingContract from './PerqVestingContract';
|
8
|
-
export { BasePerqContract, BridgeMainnetPerqToSonicContract, BridgeSonicPerqToMainnetContract, PerqSwapAndRecyclerContract, PerqTokenRecyclerContract, PerqTokenContract, PerqVestingContract, };
|
1
|
+
import BaseContract from './BaseContract';
|
2
|
+
import PerqSwapAndRecyclerContract from '../contracts/perq/PerqSwapAndRecyclerContract';
|
3
|
+
import PerqTokenRecyclerContract from '../contracts/perq/PerqTokenRecyclerContract';
|
4
|
+
import PerqTokenContract from '../contracts/perq//PerqTokenContract';
|
5
|
+
import PerqVestingContract from '../contracts/perq/PerqVestingContract';
|
6
|
+
export { BaseContract, PerqSwapAndRecyclerContract, PerqTokenRecyclerContract, PerqTokenContract, PerqVestingContract };
|
package/dist/contracts/index.js
CHANGED
@@ -3,18 +3,14 @@ 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.PerqVestingContract = exports.PerqTokenContract = exports.PerqTokenRecyclerContract = exports.PerqSwapAndRecyclerContract = exports.
|
7
|
-
const
|
8
|
-
exports.
|
9
|
-
const
|
10
|
-
exports.BridgeMainnetPerqToSonicContract = BridgeMainnetPerqToSonicContract_1.default;
|
11
|
-
const BridgeSonicPerqToMainnetContract_1 = __importDefault(require("./BridgeSonicPerqToMainnetContract"));
|
12
|
-
exports.BridgeSonicPerqToMainnetContract = BridgeSonicPerqToMainnetContract_1.default;
|
13
|
-
const PerqSwapAndRecyclerContract_1 = __importDefault(require("./PerqSwapAndRecyclerContract"));
|
6
|
+
exports.PerqVestingContract = exports.PerqTokenContract = exports.PerqTokenRecyclerContract = exports.PerqSwapAndRecyclerContract = exports.BaseContract = void 0;
|
7
|
+
const BaseContract_1 = __importDefault(require("./BaseContract"));
|
8
|
+
exports.BaseContract = BaseContract_1.default;
|
9
|
+
const PerqSwapAndRecyclerContract_1 = __importDefault(require("../contracts/perq/PerqSwapAndRecyclerContract"));
|
14
10
|
exports.PerqSwapAndRecyclerContract = PerqSwapAndRecyclerContract_1.default;
|
15
|
-
const PerqTokenRecyclerContract_1 = __importDefault(require("
|
11
|
+
const PerqTokenRecyclerContract_1 = __importDefault(require("../contracts/perq/PerqTokenRecyclerContract"));
|
16
12
|
exports.PerqTokenRecyclerContract = PerqTokenRecyclerContract_1.default;
|
17
|
-
const PerqTokenContract_1 = __importDefault(require("
|
13
|
+
const PerqTokenContract_1 = __importDefault(require("../contracts/perq//PerqTokenContract"));
|
18
14
|
exports.PerqTokenContract = PerqTokenContract_1.default;
|
19
|
-
const PerqVestingContract_1 = __importDefault(require("
|
15
|
+
const PerqVestingContract_1 = __importDefault(require("../contracts/perq/PerqVestingContract"));
|
20
16
|
exports.PerqVestingContract = PerqVestingContract_1.default;
|
package/dist/contracts/{PerqSwapAndRecyclerContract.d.ts → perq/PerqSwapAndRecyclerContract.d.ts}
RENAMED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ContractTransaction } from 'ethers';
|
2
|
-
import
|
3
|
-
import PerqSdk from '
|
4
|
-
export default class PerqSwapAndRecyclerContract extends
|
2
|
+
import BaseContract from '../BaseContract';
|
3
|
+
import PerqSdk from '../../PerqSdk';
|
4
|
+
export default class PerqSwapAndRecyclerContract extends BaseContract {
|
5
5
|
constructor(perqSdk: PerqSdk);
|
6
6
|
swapAndRecycle(beneficiary: string | undefined, path: string[], amountInWithDecimals: string, minAmountOutWithDecimals: string, price: string, deadline: string, signature: string): Promise<ContractTransaction>;
|
7
7
|
swapETHAndRecycle(beneficiary: string | undefined, path: string[], minAmountOutWithDecimals: string, amountInEth: string, price: string, deadline: string, signature: string): Promise<ContractTransaction>;
|
package/dist/contracts/{PerqSwapAndRecyclerContract.js → perq/PerqSwapAndRecyclerContract.js}
RENAMED
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const ethers_1 = require("ethers");
|
7
|
-
const PerqSwapAndRecyclerAbi_json_1 = __importDefault(require("
|
8
|
-
const
|
9
|
-
class PerqSwapAndRecyclerContract extends
|
7
|
+
const PerqSwapAndRecyclerAbi_json_1 = __importDefault(require("../../abi/perq/PerqSwapAndRecyclerAbi.json"));
|
8
|
+
const BaseContract_1 = __importDefault(require("../BaseContract"));
|
9
|
+
class PerqSwapAndRecyclerContract extends BaseContract_1.default {
|
10
10
|
constructor(perqSdk) {
|
11
11
|
super(perqSdk.perqConfig.perqSwapAndRecyclerAddress, new ethers_1.ethers.utils.Interface(PerqSwapAndRecyclerAbi_json_1.default), perqSdk.signer);
|
12
12
|
}
|