@dripfi/drip-sdk 1.4.26 → 1.4.28-bridge-perq
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 +14 -7
- package/dist/PerqApi.d.ts +2 -0
- package/dist/PerqApi.js +10 -0
- package/dist/PerqSdk.d.ts +6 -1
- package/dist/PerqSdk.js +12 -0
- package/dist/abi/BridgeMainnetPerqToSonicAbi.json +598 -0
- package/dist/abi/BridgeSonicPerqToMainnetAbi.json +733 -0
- package/dist/abi/index.d.ts +286 -0
- package/dist/abi/index.js +4 -0
- package/dist/contracts/BridgeMainnetPerqToSonicContract.d.ts +26 -0
- package/dist/contracts/BridgeMainnetPerqToSonicContract.js +48 -0
- package/dist/contracts/BridgeSonicPerqToMainnetContract.d.ts +26 -0
- package/dist/contracts/BridgeSonicPerqToMainnetContract.js +48 -0
- package/dist/contracts/index.d.ts +3 -1
- package/dist/contracts/index.js +5 -1
- package/dist/subpackages/BridgePerqPackage.d.ts +33 -0
- package/dist/subpackages/BridgePerqPackage.js +201 -0
- package/dist/subpackages/PoolsPackage.d.ts +5 -0
- package/dist/subpackages/PoolsPackage.js +6 -0
- package/dist/types/MyPerqData.d.ts +2 -0
- package/dist/types/OverallStats.d.ts +7 -0
- package/dist/types/OverallStats.js +2 -0
- package/dist/types/PerqConfig.d.ts +2 -0
- package/dist/types/PerqConfig.js +4 -0
- package/package.json +1 -1
package/dist/abi/index.d.ts
CHANGED
@@ -71,5 +71,291 @@ 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
|
+
})[];
|
74
360
|
};
|
75
361
|
export default _default;
|
package/dist/abi/index.js
CHANGED
@@ -8,10 +8,14 @@ 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 BridgeSonicPerqToMainnetAbi_json_1 = __importDefault(require("./BridgeSonicPerqToMainnetAbi.json"));
|
12
|
+
const BridgeMainnetPerqToSonicAbi_json_1 = __importDefault(require("./BridgeMainnetPerqToSonicAbi.json"));
|
11
13
|
exports.default = {
|
12
14
|
PERQ_SWAP_AND_RECYCLER_ABI: PerqSwapAndRecyclerAbi_json_1.default,
|
13
15
|
WETH_TOKEN_ABI: WethTokenAbi_json_1.default,
|
14
16
|
PERQ_TOKEN_ABI: PerqTokenAbi_json_1.default,
|
15
17
|
TOKEN_RECYCLER_ABI: TokenRecyclerAbi_json_1.default,
|
16
18
|
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,
|
17
21
|
};
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { ContractTransaction, ethers } from 'ethers';
|
2
|
+
import BasePerqContract from './BasePerqContract';
|
3
|
+
export interface SendParam {
|
4
|
+
dstEid: number;
|
5
|
+
to: string;
|
6
|
+
amountLD: ethers.BigNumber;
|
7
|
+
minAmountLD: ethers.BigNumber;
|
8
|
+
extraOptions: string;
|
9
|
+
composeMsg: string;
|
10
|
+
oftCmd: string;
|
11
|
+
}
|
12
|
+
export interface MessagingFee {
|
13
|
+
nativeFee: ethers.BigNumber;
|
14
|
+
lzTokenFee: ethers.BigNumber;
|
15
|
+
}
|
16
|
+
export interface MessagingReceipt {
|
17
|
+
guid: string;
|
18
|
+
nonce: number;
|
19
|
+
fee: MessagingFee;
|
20
|
+
}
|
21
|
+
import PerqSdk from '../PerqSdk';
|
22
|
+
export default class BridgeMainnetPerqToSonicContract extends BasePerqContract {
|
23
|
+
constructor(perqSdk: PerqSdk);
|
24
|
+
send(sendParam: SendParam, fee: MessagingFee, refundAddress: string, overrides?: ethers.PayableOverrides): Promise<ContractTransaction>;
|
25
|
+
quoteSend(sendParam: SendParam, payInLzToken: boolean): Promise<MessagingFee>;
|
26
|
+
}
|
@@ -0,0 +1,48 @@
|
|
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 BridgeMainnetPerqToSonicAbi_json_1 = __importDefault(require("../abi/BridgeMainnetPerqToSonicAbi.json"));
|
8
|
+
const BasePerqContract_1 = __importDefault(require("./BasePerqContract"));
|
9
|
+
class BridgeMainnetPerqToSonicContract extends BasePerqContract_1.default {
|
10
|
+
constructor(perqSdk) {
|
11
|
+
super(perqSdk.perqConfig.bridgeMainnetPerqToSonicAddress, new ethers_1.ethers.utils.Interface(BridgeMainnetPerqToSonicAbi_json_1.default), perqSdk.signer);
|
12
|
+
}
|
13
|
+
async send(sendParam, fee, refundAddress, overrides) {
|
14
|
+
if (!this.contract.signer) {
|
15
|
+
throw Error('No signer provided');
|
16
|
+
}
|
17
|
+
// Convert the parameters to the format expected by the contract
|
18
|
+
const sendParamTuple = [
|
19
|
+
sendParam.dstEid,
|
20
|
+
sendParam.to,
|
21
|
+
sendParam.amountLD,
|
22
|
+
sendParam.minAmountLD,
|
23
|
+
sendParam.extraOptions,
|
24
|
+
sendParam.composeMsg,
|
25
|
+
sendParam.oftCmd,
|
26
|
+
];
|
27
|
+
const feeTuple = [fee.nativeFee, fee.lzTokenFee];
|
28
|
+
return await this.contract.send(sendParamTuple, feeTuple, refundAddress, overrides);
|
29
|
+
}
|
30
|
+
// Helper method to quote the send operation (useful for getting fee estimates)
|
31
|
+
async quoteSend(sendParam, payInLzToken) {
|
32
|
+
const sendParamTuple = [
|
33
|
+
sendParam.dstEid,
|
34
|
+
sendParam.to,
|
35
|
+
sendParam.amountLD,
|
36
|
+
sendParam.minAmountLD,
|
37
|
+
sendParam.extraOptions,
|
38
|
+
sendParam.composeMsg,
|
39
|
+
sendParam.oftCmd,
|
40
|
+
];
|
41
|
+
const result = await this.contract.quoteSend(sendParamTuple, payInLzToken);
|
42
|
+
return {
|
43
|
+
nativeFee: result.nativeFee,
|
44
|
+
lzTokenFee: result.lzTokenFee,
|
45
|
+
};
|
46
|
+
}
|
47
|
+
}
|
48
|
+
exports.default = BridgeMainnetPerqToSonicContract;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { ContractTransaction, ethers } from 'ethers';
|
2
|
+
import BasePerqContract from './BasePerqContract';
|
3
|
+
export interface SendParam {
|
4
|
+
dstEid: number;
|
5
|
+
to: string;
|
6
|
+
amountLD: ethers.BigNumber;
|
7
|
+
minAmountLD: ethers.BigNumber;
|
8
|
+
extraOptions: string;
|
9
|
+
composeMsg: string;
|
10
|
+
oftCmd: string;
|
11
|
+
}
|
12
|
+
export interface MessagingFee {
|
13
|
+
nativeFee: ethers.BigNumber;
|
14
|
+
lzTokenFee: ethers.BigNumber;
|
15
|
+
}
|
16
|
+
export interface MessagingReceipt {
|
17
|
+
guid: string;
|
18
|
+
nonce: number;
|
19
|
+
fee: MessagingFee;
|
20
|
+
}
|
21
|
+
import PerqSdk from '../PerqSdk';
|
22
|
+
export default class BridgeSonicPerqToMainnetContract extends BasePerqContract {
|
23
|
+
constructor(perqSdk: PerqSdk);
|
24
|
+
send(sendParam: SendParam, fee: MessagingFee, refundAddress: string, overrides?: ethers.PayableOverrides): Promise<ContractTransaction>;
|
25
|
+
quoteSend(sendParam: SendParam, payInLzToken: boolean): Promise<MessagingFee>;
|
26
|
+
}
|
@@ -0,0 +1,48 @@
|
|
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 BridgeSonicPerqToMainnetAbi_json_1 = __importDefault(require("../abi/BridgeSonicPerqToMainnetAbi.json"));
|
8
|
+
const BasePerqContract_1 = __importDefault(require("./BasePerqContract"));
|
9
|
+
class BridgeSonicPerqToMainnetContract extends BasePerqContract_1.default {
|
10
|
+
constructor(perqSdk) {
|
11
|
+
super(perqSdk.perqConfig.bridgeSonicPerqToMainnetAddress, new ethers_1.ethers.utils.Interface(BridgeSonicPerqToMainnetAbi_json_1.default), perqSdk.signer);
|
12
|
+
}
|
13
|
+
async send(sendParam, fee, refundAddress, overrides) {
|
14
|
+
if (!this.contract.signer) {
|
15
|
+
throw Error('No signer provided');
|
16
|
+
}
|
17
|
+
// Convert the parameters to the format expected by the contract
|
18
|
+
const sendParamTuple = [
|
19
|
+
sendParam.dstEid,
|
20
|
+
sendParam.to,
|
21
|
+
sendParam.amountLD,
|
22
|
+
sendParam.minAmountLD,
|
23
|
+
sendParam.extraOptions,
|
24
|
+
sendParam.composeMsg,
|
25
|
+
sendParam.oftCmd,
|
26
|
+
];
|
27
|
+
const feeTuple = [fee.nativeFee, fee.lzTokenFee];
|
28
|
+
return await this.contract.send(sendParamTuple, feeTuple, refundAddress, overrides);
|
29
|
+
}
|
30
|
+
// Helper method to quote the send operation (useful for getting fee estimates)
|
31
|
+
async quoteSend(sendParam, payInLzToken) {
|
32
|
+
const sendParamTuple = [
|
33
|
+
sendParam.dstEid,
|
34
|
+
sendParam.to,
|
35
|
+
sendParam.amountLD,
|
36
|
+
sendParam.minAmountLD,
|
37
|
+
sendParam.extraOptions,
|
38
|
+
sendParam.composeMsg,
|
39
|
+
sendParam.oftCmd,
|
40
|
+
];
|
41
|
+
const result = await this.contract.quoteSend(sendParamTuple, payInLzToken);
|
42
|
+
return {
|
43
|
+
nativeFee: result.nativeFee,
|
44
|
+
lzTokenFee: result.lzTokenFee,
|
45
|
+
};
|
46
|
+
}
|
47
|
+
}
|
48
|
+
exports.default = BridgeSonicPerqToMainnetContract;
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import BasePerqContract from './BasePerqContract';
|
2
|
+
import BridgeMainnetPerqToSonicContract from './BridgeMainnetPerqToSonicContract';
|
3
|
+
import BridgeSonicPerqToMainnetContract from './BridgeSonicPerqToMainnetContract';
|
2
4
|
import PerqSwapAndRecyclerContract from './PerqSwapAndRecyclerContract';
|
3
5
|
import PerqTokenRecyclerContract from './PerqTokenRecyclerContract';
|
4
6
|
import PerqTokenContract from './PerqTokenContract';
|
5
7
|
import PerqVestingContract from './PerqVestingContract';
|
6
|
-
export { BasePerqContract, PerqSwapAndRecyclerContract, PerqTokenRecyclerContract, PerqTokenContract, PerqVestingContract, };
|
8
|
+
export { BasePerqContract, BridgeMainnetPerqToSonicContract, BridgeSonicPerqToMainnetContract, PerqSwapAndRecyclerContract, PerqTokenRecyclerContract, PerqTokenContract, PerqVestingContract, };
|
package/dist/contracts/index.js
CHANGED
@@ -3,9 +3,13 @@ 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.BasePerqContract = void 0;
|
6
|
+
exports.PerqVestingContract = exports.PerqTokenContract = exports.PerqTokenRecyclerContract = exports.PerqSwapAndRecyclerContract = exports.BridgeSonicPerqToMainnetContract = exports.BridgeMainnetPerqToSonicContract = exports.BasePerqContract = void 0;
|
7
7
|
const BasePerqContract_1 = __importDefault(require("./BasePerqContract"));
|
8
8
|
exports.BasePerqContract = BasePerqContract_1.default;
|
9
|
+
const BridgeMainnetPerqToSonicContract_1 = __importDefault(require("./BridgeMainnetPerqToSonicContract"));
|
10
|
+
exports.BridgeMainnetPerqToSonicContract = BridgeMainnetPerqToSonicContract_1.default;
|
11
|
+
const BridgeSonicPerqToMainnetContract_1 = __importDefault(require("./BridgeSonicPerqToMainnetContract"));
|
12
|
+
exports.BridgeSonicPerqToMainnetContract = BridgeSonicPerqToMainnetContract_1.default;
|
9
13
|
const PerqSwapAndRecyclerContract_1 = __importDefault(require("./PerqSwapAndRecyclerContract"));
|
10
14
|
exports.PerqSwapAndRecyclerContract = PerqSwapAndRecyclerContract_1.default;
|
11
15
|
const PerqTokenRecyclerContract_1 = __importDefault(require("./PerqTokenRecyclerContract"));
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import PerqSdk from '../PerqSdk';
|
2
|
+
export interface BridgeQuote {
|
3
|
+
nativeFee: string;
|
4
|
+
lzTokenFee: string;
|
5
|
+
}
|
6
|
+
export default class BridgePerqPackage {
|
7
|
+
perqSdk: PerqSdk;
|
8
|
+
constructor(perqSdk: PerqSdk);
|
9
|
+
/**
|
10
|
+
* Bridge PERQ tokens from Mainnet to Sonic
|
11
|
+
*/
|
12
|
+
bridgeMainnetToSonic(amount: string): Promise<string>;
|
13
|
+
/**
|
14
|
+
* Bridge PERQ tokens from Sonic to Mainnet
|
15
|
+
*/
|
16
|
+
bridgeSonicToMainnet(amount: string): Promise<string>;
|
17
|
+
/**
|
18
|
+
* Check if the Mainnet to Sonic bridge contract has approval to spend PERQ tokens
|
19
|
+
*/
|
20
|
+
checkMainnetToSonicBridgeApproval(amount: string): Promise<boolean>;
|
21
|
+
/**
|
22
|
+
* Approve the Mainnet to Sonic bridge contract to spend PERQ tokens
|
23
|
+
*/
|
24
|
+
approveMainnetToSonicBridge(amount: string): Promise<string>;
|
25
|
+
/**
|
26
|
+
* Quote the fees for bridging PERQ from Mainnet to Sonic
|
27
|
+
*/
|
28
|
+
private quoteMainnetToSonic;
|
29
|
+
/**
|
30
|
+
* Quote the fees for bridging PERQ from Sonic to Mainnet
|
31
|
+
*/
|
32
|
+
private quoteSonicToMainnet;
|
33
|
+
}
|