opnet 1.3.2 → 1.3.3

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 (102) hide show
  1. package/browser/_version.d.ts +1 -1
  2. package/browser/abi/shared/interfaces/motoswap/{IAdministeredOP20.d.ts → IMoto.d.ts} +2 -2
  3. package/browser/abi/shared/interfaces/motoswap/IMotoChef.d.ts +208 -0
  4. package/browser/abi/shared/interfaces/motoswap/IMotoswapPoolContract.d.ts +0 -4
  5. package/browser/abi/shared/interfaces/motoswap/IMotoswapStakingContract.d.ts +19 -3
  6. package/browser/abi/shared/interfaces/motoswap/INativeSwapContract.d.ts +13 -5
  7. package/browser/abi/shared/interfaces/opnet/IOP_NETContract.d.ts +2 -2
  8. package/browser/abi/shared/json/generic/STAKING_ABI.d.ts +0 -1
  9. package/{build/abi/shared/json/motoswap/REENTRANCY_GUARD_ABI.d.ts → browser/abi/shared/json/motoswap/MOTOCHEF_ABI.d.ts} +1 -1
  10. package/browser/abi/shared/json/motoswap/MOTOSWAP_STAKING_ABI.d.ts +0 -1
  11. package/browser/abi/shared/json/motoswap/MOTO_ABI.d.ts +2 -0
  12. package/browser/abi/shared/json/motoswap/NATIVE_SWAP_ABI.d.ts +0 -1
  13. package/browser/fetch/fetch-browser.d.ts +4 -0
  14. package/browser/fetch/fetch.d.ts +2 -0
  15. package/browser/index.js +1 -1
  16. package/browser/opnet.d.ts +10 -12
  17. package/build/_version.d.ts +1 -1
  18. package/build/_version.js +1 -1
  19. package/build/abi/shared/interfaces/motoswap/{IAdministeredOP20.d.ts → IMoto.d.ts} +2 -2
  20. package/build/abi/shared/interfaces/motoswap/IMotoChef.d.ts +208 -0
  21. package/build/abi/shared/interfaces/motoswap/IMotoswapPoolContract.d.ts +0 -4
  22. package/build/abi/shared/interfaces/motoswap/IMotoswapStakingContract.d.ts +19 -3
  23. package/build/abi/shared/interfaces/motoswap/INativeSwapContract.d.ts +13 -5
  24. package/build/abi/shared/interfaces/opnet/IOP_NETContract.d.ts +2 -2
  25. package/build/abi/shared/json/generic/STAKING_ABI.d.ts +0 -1
  26. package/build/abi/shared/json/generic/STAKING_ABI.js +1 -1
  27. package/{browser/abi/shared/json/motoswap/REENTRANCY_GUARD_ABI.d.ts → build/abi/shared/json/motoswap/MOTOCHEF_ABI.d.ts} +1 -1
  28. package/build/abi/shared/json/motoswap/MOTOCHEF_ABI.js +820 -0
  29. package/build/abi/shared/json/motoswap/MOTOSWAP_STAKING_ABI.d.ts +0 -1
  30. package/build/abi/shared/json/motoswap/MOTOSWAP_STAKING_ABI.js +45 -5
  31. package/build/abi/shared/json/motoswap/MOTO_ABI.d.ts +2 -0
  32. package/build/abi/shared/json/motoswap/{ADMINISTERD_OP_20_ABI.js → MOTO_ABI.js} +5 -13
  33. package/build/abi/shared/json/motoswap/NATIVE_SWAP_ABI.d.ts +0 -1
  34. package/build/abi/shared/json/motoswap/NATIVE_SWAP_ABI.js +15 -1
  35. package/build/abi/shared/json/opnet/OP_NET_ABI.js +7 -18
  36. package/build/contracts/Contract.js +2 -2
  37. package/build/fetch/fetch.d.ts +2 -0
  38. package/build/fetch/fetch.js +2 -0
  39. package/build/opnet.d.ts +10 -12
  40. package/build/opnet.js +10 -12
  41. package/build/providers/JSONRpcProvider.js +7 -1
  42. package/package.json +6 -4
  43. package/src/_version.ts +1 -1
  44. package/src/abi/shared/interfaces/motoswap/{IAdministeredOP20.ts → IMoto.ts} +4 -4
  45. package/src/abi/shared/interfaces/motoswap/IMotoChef.ts +485 -0
  46. package/src/abi/shared/interfaces/motoswap/IMotoswapPoolContract.ts +0 -5
  47. package/src/abi/shared/interfaces/motoswap/IMotoswapStakingContract.ts +50 -4
  48. package/src/abi/shared/interfaces/motoswap/INativeSwapContract.ts +19 -5
  49. package/src/abi/shared/interfaces/opnet/IOP_NETContract.ts +1 -1
  50. package/src/abi/shared/json/generic/STAKING_ABI.ts +1 -7
  51. package/src/abi/shared/json/motoswap/MOTOCHEF_ABI.ts +831 -0
  52. package/src/abi/shared/json/motoswap/MOTOSWAP_FACTORY_ABI.ts +0 -6
  53. package/src/abi/shared/json/motoswap/MOTOSWAP_POOL_ABI.ts +0 -6
  54. package/src/abi/shared/json/motoswap/MOTOSWAP_ROUTER_ABI.ts +0 -3
  55. package/src/abi/shared/json/motoswap/MOTOSWAP_STAKING_ABI.ts +51 -9
  56. package/src/abi/shared/json/motoswap/{ADMINISTERD_OP_20_ABI.ts → MOTO_ABI.ts} +7 -15
  57. package/src/abi/shared/json/motoswap/NATIVE_SWAP_ABI.ts +15 -7
  58. package/src/abi/shared/json/opnet/OP_NET_ABI.ts +7 -24
  59. package/src/contracts/CallResult.ts +1 -0
  60. package/src/contracts/Contract.ts +3 -3
  61. package/src/fetch/fetch-browser.js +5 -0
  62. package/src/fetch/fetch.ts +3 -0
  63. package/src/opnet.ts +10 -12
  64. package/src/providers/JSONRpcProvider.ts +9 -4
  65. package/webpack.config.js +1 -0
  66. package/browser/abi/shared/interfaces/motoswap/IMotoChefContract.d.ts +0 -229
  67. package/browser/abi/shared/interfaces/motoswap/IOwnableContract.d.ts +0 -12
  68. package/browser/abi/shared/interfaces/motoswap/IOwnableReentrancyGuardContract.d.ts +0 -13
  69. package/browser/abi/shared/interfaces/motoswap/IReentrancyGuardContract.d.ts +0 -7
  70. package/browser/abi/shared/interfaces/tests/IWBTCContract.d.ts +0 -13
  71. package/browser/abi/shared/json/motoswap/ADMINISTERD_OP_20_ABI.d.ts +0 -3
  72. package/browser/abi/shared/json/motoswap/MOTOSWAP_MOTOCHEF_ABI.d.ts +0 -4
  73. package/browser/abi/shared/json/motoswap/OWNABLE_ABI.d.ts +0 -3
  74. package/browser/abi/shared/json/tests/WBTC_ABI.d.ts +0 -3
  75. package/build/abi/shared/interfaces/motoswap/IMotoChefContract.d.ts +0 -229
  76. package/build/abi/shared/interfaces/motoswap/IOwnableContract.d.ts +0 -12
  77. package/build/abi/shared/interfaces/motoswap/IOwnableContract.js +0 -1
  78. package/build/abi/shared/interfaces/motoswap/IOwnableReentrancyGuardContract.d.ts +0 -13
  79. package/build/abi/shared/interfaces/motoswap/IOwnableReentrancyGuardContract.js +0 -1
  80. package/build/abi/shared/interfaces/motoswap/IReentrancyGuardContract.d.ts +0 -7
  81. package/build/abi/shared/interfaces/motoswap/IReentrancyGuardContract.js +0 -1
  82. package/build/abi/shared/interfaces/tests/IWBTCContract.d.ts +0 -13
  83. package/build/abi/shared/interfaces/tests/IWBTCContract.js +0 -1
  84. package/build/abi/shared/json/motoswap/ADMINISTERD_OP_20_ABI.d.ts +0 -3
  85. package/build/abi/shared/json/motoswap/MOTOSWAP_MOTOCHEF_ABI.d.ts +0 -4
  86. package/build/abi/shared/json/motoswap/MOTOSWAP_MOTOCHEF_ABI.js +0 -508
  87. package/build/abi/shared/json/motoswap/OWNABLE_ABI.d.ts +0 -3
  88. package/build/abi/shared/json/motoswap/OWNABLE_ABI.js +0 -35
  89. package/build/abi/shared/json/motoswap/REENTRANCY_GUARD_ABI.js +0 -15
  90. package/build/abi/shared/json/tests/WBTC_ABI.d.ts +0 -3
  91. package/build/abi/shared/json/tests/WBTC_ABI.js +0 -57
  92. package/src/abi/shared/interfaces/motoswap/IMotoChefContract.ts +0 -484
  93. package/src/abi/shared/interfaces/motoswap/IOwnableContract.ts +0 -32
  94. package/src/abi/shared/interfaces/motoswap/IOwnableReentrancyGuardContract.ts +0 -33
  95. package/src/abi/shared/interfaces/motoswap/IReentrancyGuardContract.ts +0 -18
  96. package/src/abi/shared/interfaces/tests/IWBTCContract.ts +0 -35
  97. package/src/abi/shared/json/motoswap/MOTOSWAP_MOTOCHEF_ABI.ts +0 -520
  98. package/src/abi/shared/json/motoswap/OWNABLE_ABI.ts +0 -38
  99. package/src/abi/shared/json/motoswap/REENTRANCY_GUARD_ABI.ts +0 -20
  100. package/src/abi/shared/json/tests/WBTC_ABI.ts +0 -73
  101. /package/build/abi/shared/interfaces/motoswap/{IAdministeredOP20.js → IMoto.js} +0 -0
  102. /package/build/abi/shared/interfaces/motoswap/{IMotoChefContract.js → IMotoChef.js} +0 -0
@@ -1,484 +0,0 @@
1
- import { Address } from '@btc-vision/transaction';
2
- import { CallResult, OPNetEvent } from '../../../../opnet.js';
3
- import { IOwnableReentrancyGuardContract } from './IOwnableReentrancyGuardContract.js';
4
-
5
- export type PoolInfo = {
6
- allocPoint: number;
7
- lastRewardBlock: number;
8
- accMotoPerShare: bigint;
9
- };
10
-
11
- export type UserInfo = {
12
- amount: bigint;
13
- rewardDebt: bigint;
14
- };
15
-
16
- export type Initialize = CallResult<
17
- {
18
- success: boolean;
19
- },
20
- [OPNetEvent<LogPoolAdditionEvent>, OPNetEvent<LogInitEvent>]
21
- >;
22
-
23
- export type GetLpToken = CallResult<{
24
- lpTokenAddress: Address;
25
- }>;
26
-
27
- export type GetLpTokens = CallResult<{
28
- lpTokens: Address[];
29
- }>;
30
-
31
- export type GetRewarder = CallResult<{
32
- rewarderAddress: Address;
33
- }>;
34
-
35
- export type GetPoolInfo = CallResult<PoolInfo>;
36
-
37
- export type GetPoolsLength = CallResult<{
38
- poolLength: bigint;
39
- }>;
40
-
41
- export type GetUserInfo = CallResult<UserInfo>;
42
-
43
- export type Pools = CallResult<{
44
- poolLength: number;
45
- poolsData: Uint8Array;
46
- }>;
47
-
48
- export type TotalAllocPoint = CallResult<{
49
- totalAllocPoint: bigint;
50
- }>;
51
-
52
- export type Devaddr = CallResult<{
53
- devaddr: Address;
54
- }>;
55
-
56
- export type MotoPerBlock = CallResult<{
57
- motoPerBlock: bigint;
58
- }>;
59
-
60
- export type BonusEndBlock = CallResult<{
61
- bonusEndBlock: bigint;
62
- }>;
63
-
64
- export type BonusMultiplier = CallResult<{
65
- bonusMultiplier: bigint;
66
- }>;
67
-
68
- export type TotalBtcStaked = CallResult<{
69
- totalBtcStaked: bigint;
70
- }>;
71
-
72
- export type TreasuryAddress = CallResult<{
73
- TreasuryAddress: string;
74
- }>;
75
-
76
- export type GetStakingTxId = CallResult<{
77
- stakingTxId: bigint;
78
- }>;
79
-
80
- export type GetStakingIndex = CallResult<{
81
- stakingIndex: bigint;
82
- }>;
83
-
84
- export type Add = CallResult<
85
- {
86
- success: boolean;
87
- },
88
- [OPNetEvent<LogPoolAdditionEvent>]
89
- >;
90
-
91
- export type Set = CallResult<
92
- {
93
- success: boolean;
94
- },
95
- [OPNetEvent<LogSetPoolEvent>]
96
- >;
97
-
98
- export type SetMigrator = CallResult<{
99
- success: boolean;
100
- }>;
101
-
102
- export type Migrate = CallResult<{
103
- success: boolean;
104
- }>;
105
-
106
- export type GetMultiplier = CallResult<{
107
- multiplier: bigint;
108
- }>;
109
-
110
- export type PendingMoto = CallResult<{
111
- pendingMoto: number;
112
- }>;
113
-
114
- export type MassUpdatePools = CallResult<{
115
- success: boolean;
116
- }>;
117
-
118
- export type UpdatePool = CallResult<PoolInfo, [OPNetEvent<LogUpdatePoolEvent>]>;
119
-
120
- export type Deposit = CallResult<
121
- {
122
- success: boolean;
123
- },
124
- [OPNetEvent<DepositEvent>]
125
- >;
126
-
127
- export type Withdraw = CallResult<
128
- {
129
- success: boolean;
130
- },
131
- [OPNetEvent<WithdrawEvent>]
132
- >;
133
-
134
- export type Harvest = CallResult<
135
- {
136
- success: boolean;
137
- },
138
- [OPNetEvent<HarvestEvent>]
139
- >;
140
-
141
- export type WithdrawAndHarvest = CallResult<
142
- {
143
- success: boolean;
144
- },
145
- [OPNetEvent<WithdrawEvent>, OPNetEvent<HarvestEvent>]
146
- >;
147
-
148
- export type SetDev = CallResult<{
149
- success: boolean;
150
- }>;
151
-
152
- export type SetMotoPerBlock = CallResult<{
153
- success: boolean;
154
- }>;
155
-
156
- export type SetBonusEndBlock = CallResult<{
157
- success: boolean;
158
- }>;
159
-
160
- export type SetBonusMultiplier = CallResult<{
161
- success: boolean;
162
- }>;
163
-
164
- export type EmergencyWithdraw = CallResult<
165
- {
166
- success: boolean;
167
- },
168
- [OPNetEvent<EmergencyWithdrawEvent>]
169
- >;
170
-
171
- export type StakeBtc = CallResult<
172
- {
173
- success: boolean;
174
- },
175
- [OPNetEvent<StakeBTCEvent>]
176
- >;
177
-
178
- export type UnstakeBtc = CallResult<
179
- {
180
- success: boolean;
181
- },
182
- [OPNetEvent<UnstakeBTCEvent>]
183
- >;
184
-
185
- // EVENTS
186
- export type LogInitEvent = {
187
- success: boolean;
188
- };
189
-
190
- export type LogPoolAdditionEvent = {
191
- readonly pid: bigint; // uint256
192
- readonly allocPoint: bigint; // uint256
193
- readonly lpToken: Address;
194
- readonly rewarder: Address;
195
- };
196
-
197
- export type LogSetPoolEvent = {
198
- readonly pid: bigint; // uint256
199
- readonly allocPoint: bigint; // uint256
200
- readonly rewarder: Address;
201
- readonly overwrite: boolean; // bool
202
- };
203
-
204
- export type LogUpdatePoolEvent = {
205
- readonly pid: bigint; // uint256
206
- readonly lastRewardBlock: bigint; // uint64
207
- readonly lpSupply: bigint; // uint256
208
- readonly accMotoPerShare: bigint; // uint256
209
- };
210
-
211
- export type DepositEvent = {
212
- readonly user: Address;
213
- readonly pid: bigint; // uint32
214
- readonly amount: bigint; // uint256
215
- readonly to: Address;
216
- };
217
-
218
- export type WithdrawEvent = {
219
- readonly user: Address;
220
- readonly pid: bigint; // uint256
221
- readonly amount: bigint; // uint256
222
- readonly to: Address;
223
- };
224
-
225
- export type HarvestEvent = {
226
- readonly user: Address;
227
- readonly pid: bigint; // uint256
228
- readonly amount: bigint; // uint256
229
- };
230
-
231
- export type EmergencyWithdrawEvent = {
232
- readonly user: Address;
233
- readonly pid: bigint; // uint256
234
- readonly amount: bigint; // uint256
235
- readonly to: Address;
236
- };
237
-
238
- export type StakeBTCEvent = {
239
- readonly user: Address;
240
- readonly amount: bigint;
241
- readonly stakingTxId: bigint;
242
- readonly stakingIndex: bigint;
243
- };
244
-
245
- export type UnstakeBTCEvent = {
246
- readonly user: Address;
247
- readonly amount: bigint;
248
- readonly stakingTxId: bigint;
249
- readonly stakingIndex: bigint;
250
- };
251
-
252
- /**
253
- * @description This interface represents the MotoChef contract.
254
- * @interface IMotoChefContract
255
- * @extends {IOwnableReentrancyGuardContract}
256
- * @cathegory Contracts
257
- */
258
- export interface IMotoChefContract extends IOwnableReentrancyGuardContract {
259
- /**
260
- * @description Initialize the MotoChef contract. Can only be called by an admin.
261
- * @param {Address} MOTO The address of the MOTO token. MotoChef needs to be the owner/admin of the MOTO token.
262
- * @param {bigint} premineAmount The amount of MOTO to mint on deploy.
263
- * @param {Address} devaddr The address of the dev.
264
- * @param {bigint} motoPerBlock The amount of MOTOs created per block.
265
- * @param {bigint} bonusEndBlock The block number when the bonus MOTO period ends.
266
- * @param {bigint} bonusMultiplier The bonus muliplier for early moto makers.
267
- * @param treasuryAddress The treasury address for btc
268
- * @param btcAllocPoint The alloc point for the BTC pool
269
- * @returns {Initialize}
270
- */
271
- initialize(
272
- MOTO: Address,
273
- premineAmount: bigint,
274
- devaddr: Address,
275
- motoPerBlock: bigint,
276
- bonusEndBlock: bigint,
277
- bonusMultiplier: bigint,
278
- treasuryAddress: string,
279
- btcAllocPoint: bigint,
280
- ): Promise<Initialize>;
281
-
282
- /**
283
- * @description Gets the LP token address of a pool
284
- * @param {number} pid The index of the pool
285
- * @returns {GetLpToken}
286
- */
287
- getLpToken(pid: bigint): Promise<GetLpToken>;
288
-
289
- getLpTokens(): Promise<GetLpTokens>;
290
-
291
- /**
292
- * @description Gets the pool info of a pool
293
- * @param {number} pid The index of the pool
294
- * @returns {GetPoolInfo}
295
- */
296
- getPoolInfo(pid: bigint): Promise<GetPoolInfo>;
297
-
298
- getPoolsLength(): Promise<GetPoolsLength>;
299
-
300
- /**
301
- * @description Gets the user info of a pool
302
- * @param {number} pid The index of the pool
303
- * @param {Address} user The address of the user
304
- * @returns {GetUserInfo}
305
- */
306
- getUserInfo(pid: bigint, user: Address): Promise<GetUserInfo>;
307
-
308
- /**
309
- * @description Gets the total alloc point
310
- * @returns {TotalAllocPoint}
311
- */
312
- totalAllocPoint(): Promise<TotalAllocPoint>;
313
-
314
- /**
315
- * @description Gets the dev address
316
- * @returns {Devaddr}
317
- */
318
- devaddr(): Promise<Devaddr>;
319
-
320
- /**
321
- * @description Gets the moto per block
322
- * @returns {MotoPerBlock}
323
- */
324
- getMotoPerBlock(): Promise<MotoPerBlock>;
325
-
326
- /**
327
- * @description Gets the bonus end block
328
- * @returns {BonusEndBlock}
329
- */
330
- getBonusEndBlock(): Promise<BonusEndBlock>;
331
-
332
- /**
333
- * @description Gets the bonus multiplier
334
- * @returns {BonusMultiplier}
335
- */
336
- getBonusMultiplier(): Promise<BonusMultiplier>;
337
-
338
- totalBtcStaked(): Promise<TotalBtcStaked>;
339
-
340
- treasuryAddress(): Promise<TreasuryAddress>;
341
-
342
- getStakingTxId(): Promise<GetStakingTxId>;
343
-
344
- getStakingIndex(): Promise<GetStakingIndex>;
345
-
346
- /**
347
- * @description Set the moto per block. Can only be called by an admin.
348
- * @param {bigint} motoPerBlock The amount of MOTO per block.
349
- * @returns {SetMotoPerBlock}
350
- */
351
- setMotoPerBlock(motoPerBlock: bigint): Promise<SetMotoPerBlock>;
352
-
353
- /**
354
- * @description Set the bonus end block. Can only be called by an admin.
355
- * @param {bigint} bonusEndBlock The block number when the bonus period ends.
356
- * @returns {SetBonusEndBlock}
357
- */
358
- setBonusEndBlock(bonusEndBlock: bigint): Promise<SetBonusEndBlock>;
359
-
360
- /**
361
- * @description Set the bonus multiplier. Can only be called by an admin.
362
- * @param {bigint} bonusMultiplier The bonus multiplier.
363
- * @returns {SetBonusMultiplier}
364
- */
365
- setBonusMultiplier(bonusMultiplier: bigint): Promise<SetBonusMultiplier>;
366
-
367
- /**
368
- * @description Add a new lp to the pool. Can only be called by an admin.
369
- * @param {bigint} allocPoint allocPoint AP of the new pool.
370
- * @param {Address} lpToken Address of the LP OP-20 token.
371
- * @param {Address} rewarder Address of the rewarder delegate.
372
- * @returns {Add}
373
- */
374
- add(allocPoint: bigint, lpToken: Address): Promise<Add>;
375
-
376
- /**
377
- * @description Update the given pool's MOTO allocation point and `IRewarder` contract. Can only be called by an admin.
378
- * @param {number} pid the index of the pool
379
- * @param {bigint} allocPoint New AP of the pool.
380
- * @param {Address} rewarder Address of the rewarder delegate.
381
- * @param {boolean} overwrite True if _rewarder should be `set`. Otherwise `_rewarder` is ignored.
382
- * @returns {Set}
383
- */
384
- set(pid: bigint, allocPoint: bigint): Promise<Set>;
385
-
386
- /**
387
- * @description Set the `migrator` contract. Can only be called by an admin.
388
- * @param {Address} migrator The contract address to set.
389
- * @returns {SetMigrator}
390
- */
391
- setMigrator(migrator: Address): Promise<SetMigrator>;
392
-
393
- /**
394
- * @description Migrate LP token to another LP contract through the `migrator` contract.
395
- * @param {number} pid The index of the pool.
396
- * @returns {Migrate}
397
- */
398
- migrate(pid: bigint): Promise<Migrate>;
399
-
400
- /**
401
- * @description Get the multiplier over the given _from to _to block.
402
- * @param {bigint} from the from block
403
- * @param {bigint} to the to block
404
- * @returns {GetMultiplier}
405
- */
406
- getMultiplier(from: bigint, to: bigint): Promise<GetMultiplier>;
407
-
408
- /**
409
- * @description View function to see pending MOTO on frontend.
410
- * @param {number} pid The index of the pool
411
- * @param {Address} user Address of user.
412
- * @returns {PendingMoto}
413
- */
414
- pendingMoto(pid: bigint, user: Address): Promise<PendingMoto>;
415
-
416
- /**
417
- * @description Update reward variables for all pools. Be careful of gas spending!
418
- * @param {number} length The length of the pids array.
419
- * @param {number[]} pids Pool IDs of all to be updated. Make sure to update all active pools.
420
- * @returns {MassUpdatePools}
421
- */
422
- massUpdatePools(length: number, pids: bigint[]): Promise<MassUpdatePools>;
423
-
424
- /**
425
- * @description Update reward variables of the given pool.
426
- * @param {number} pid The index of the pool
427
- * @returns {UpdatePool}
428
- */
429
- updatePool(pid: bigint): Promise<UpdatePool>;
430
-
431
- /**
432
- * @description Deposit LP tokens to MotoChef for MOTO allocation.
433
- * @param {number} pid The index of the pool.
434
- * @param {bigint} amount LP token amount to deposit.
435
- * @param {Address} to The receiver of `amount` deposit benefit.
436
- * @returns {Deposit}
437
- */
438
- deposit(pid: bigint, amount: bigint, to: Address): Promise<Deposit>;
439
-
440
- /**
441
- * @description Withdraw LP tokens from MotoChef.
442
- * @param {number} pid The index of the pool.
443
- * @param {bigint} amount LP token amount to deposit.
444
- * @param {Address} to The receiver of `amount` deposit benefit.
445
- * @returns {Withdraw}
446
- */
447
- withdraw(pid: bigint, amount: bigint, to: Address): Promise<Withdraw>;
448
-
449
- /**
450
- * @description Harvest proceeds for transaction sender to `to`.
451
- * @param {number} pid The index of the pool.
452
- * @param {Address} to Receiver of MOTO rewards.
453
- * @returns {Harvest}
454
- */
455
- harvest(pid: bigint, to: Address): Promise<Harvest>;
456
-
457
- /**
458
- * @description Withdraw LP tokens from MotoChef and harvest proceeds for transaction sender to `to`.
459
- * @param {number} pid The index of the pool.
460
- * @param {bigint} amount LP token amount to withdraw.
461
- * @param {Address} to Receiver of the LP tokens and MOTO rewards.
462
- * @returns {WithdrawAndHarvest}
463
- */
464
- withdrawAndHarvest(pid: bigint, amount: bigint, to: Address): Promise<WithdrawAndHarvest>;
465
-
466
- /**
467
- * @description Withdraw without caring about rewards. EMERGENCY ONLY.
468
- * @param {number} pid The index of the pool.
469
- * @param {Address} to Receiver of the LP tokens.
470
- * @returns {EmergencyWithdraw}
471
- */
472
- emergencyWithdraw(pid: bigint, to: Address): Promise<EmergencyWithdraw>;
473
-
474
- /**
475
- * @description Update dev address by the previous dev.
476
- * @param {Address} devaddr The new dev address.s
477
- * @returns {SetDev}
478
- */
479
- setDev(devaddr: Address): Promise<SetDev>;
480
-
481
- stakeBtc(stakeAmount: bigint): Promise<StakeBtc>;
482
-
483
- unstakeBtc(): Promise<UnstakeBtc>;
484
- }
@@ -1,32 +0,0 @@
1
- import { Address } from '@btc-vision/transaction';
2
- import { CallResult, IOP_NETContract } from '../../../../opnet';
3
-
4
- export type Admin = CallResult<{
5
- adminAddress: Address;
6
- }>;
7
-
8
- export type ChangeAdmin = CallResult<{
9
- success: boolean;
10
- }>;
11
-
12
- /**
13
- * @description This interface represents the Ownable contract. It adds the ability to have an admin address that can access certain methods.
14
- * @interface IOwnableContract
15
- * @extends {IOP_NETContract}
16
- * @category Contracts
17
- *
18
- */
19
- export interface IOwnableContract extends IOP_NETContract {
20
- /**
21
- * @description Gets the current admin address.
22
- * @returns {Admin}
23
- */
24
- admin(): Promise<Admin>;
25
-
26
- /**
27
- * @description Changes the contract admin. Only callable by the current admin.
28
- * @param {Address} newAdmin The new admin address.
29
- * @returns {ChangeAdmin}
30
- */
31
- changeAdmin(newAdmin: Address): Promise<ChangeAdmin>;
32
- }
@@ -1,33 +0,0 @@
1
- import { Address } from '@btc-vision/transaction';
2
- import { CallResult } from '../../../../opnet.js';
3
- import { IReentrancyGuard } from './IReentrancyGuardContract.js';
4
-
5
- export type Admin = CallResult<{
6
- adminAddress: Address;
7
- }>;
8
-
9
- export type ChangeAdmin = CallResult<{
10
- success: boolean;
11
- }>;
12
-
13
- /**
14
- * @description This interface represents the OwnableReentrancyGuard contract.
15
- * @interface IOwnableContract
16
- * @extends {IOP_NETContract}
17
- * @category Contracts
18
- *
19
- */
20
- export interface IOwnableReentrancyGuardContract extends IReentrancyGuard {
21
- /**
22
- * @description Gets the current admin address.
23
- * @returns {Admin}
24
- */
25
- admin(): Promise<Admin>;
26
-
27
- /**
28
- * @description Changes the contract admin. Only callable by the current admin.
29
- * @param {Address} newAdmin The new admin address.
30
- * @returns {ChangeAdmin}
31
- */
32
- changeAdmin(newAdmin: Address): Promise<ChangeAdmin>;
33
- }
@@ -1,18 +0,0 @@
1
- import { CallResult, IOP_NETContract } from '../../../../opnet';
2
-
3
- export type Status = CallResult<{ status: bigint }>;
4
-
5
- /**
6
- * @description This interface represents the ReentrancyGuard contract.
7
- * @interface IReentrancyGuardContract
8
- * @extends {IOP_NETContract}
9
- * @category Contracts
10
- *
11
- */
12
- export interface IReentrancyGuard extends IOP_NETContract {
13
- /**
14
- * @description Gets the current admin address.
15
- * @returns {Status}
16
- */
17
- status(): Promise<Status>;
18
- }
@@ -1,35 +0,0 @@
1
- import { Address } from '@btc-vision/transaction';
2
- import { CallResult } from '../../../../contracts/CallResult.js';
3
- import { IOP_20Contract } from '../opnet/IOP_20Contract.js';
4
- import { IStackingContract } from '../generic/IStackingContract.js';
5
-
6
- /**
7
- * @description This interface represents the contract OP_20 and Stacking contract merged.
8
- * @interface MergedOP_20AndStackingContract
9
- * @extends {IOP_20Contract}
10
- * @extends {IStackingContract}
11
- * @cathegory Contracts
12
- */
13
- export type MergedOP_20AndStackingContract = IOP_20Contract & IStackingContract;
14
-
15
- /**
16
- * @description This interface represents the WBTC contract.
17
- * @interface IWBTCContract
18
- * @extends {MergedOP_20AndStackingContract}
19
- * @cathegory Contracts
20
- */
21
- export interface IWBTCContract extends MergedOP_20AndStackingContract {
22
- /**
23
- * @description Request a withdrawal of the specified amount.
24
- * @param {bigint} amount The amount to withdraw.
25
- * @returns {Promise<CallResult>} A promise that resolves to a boolean indicating if the withdrawal was successful.
26
- */
27
- requestWithdrawal(amount: bigint): Promise<CallResult<{ success: boolean }>>;
28
-
29
- /**
30
- * @description Get the withdrawable balance of the specified address.
31
- * @param {string} address The address to check.
32
- * @returns {Promise<CallResult>} A promise that resolves to the balance.
33
- */
34
- withdrawableBalanceOf(address: Address): Promise<CallResult<{ balance: bigint }>>;
35
- }