opnet 1.2.3 → 1.2.5

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.
@@ -1 +1 @@
1
- export declare const version = "1.2.3";
1
+ export declare const version = "1.2.5";
package/build/_version.js CHANGED
@@ -1 +1 @@
1
- export const version = '1.2.3';
1
+ export const version = '1.2.5';
@@ -49,10 +49,6 @@ export type GetProviderDetails = CallResult<{
49
49
  export type GetPriorityQueueCost = CallResult<{
50
50
  cost: bigint;
51
51
  }>;
52
- export type VirtualReserves = CallResult<{
53
- virtualBTCReserve: bigint;
54
- virtualTokenReserve: bigint;
55
- }>;
56
52
  export interface INativeSwapContract extends IOP_NETContract {
57
53
  reserve(token: Address, maximumAmountIn: bigint, minimumAmountOut: bigint, forLP: boolean): Promise<ReserveEWMA>;
58
54
  listLiquidity(token: Address, receiver: string, amountIn: bigint, priority: boolean): Promise<ListLiquidity>;
@@ -61,11 +57,10 @@ export interface INativeSwapContract extends IOP_NETContract {
61
57
  setFees(reservationBaseFee: bigint, priorityQueueBaseFee: bigint, pricePerUserInPriorityQueueBTC: bigint): Promise<SetFees>;
62
58
  getFees(): Promise<GetFees>;
63
59
  addLiquidity(token: Address, receiver: string, amountIn: bigint, priority: boolean): Promise<AddLiquidity>;
64
- removeLiquidity(token: Address): Promise<RemoveLiquidity>;
65
- swap(token: Address, isSimulation: boolean): Promise<Swap>;
60
+ removeLiquidity(token: Address, amount: bigint): Promise<RemoveLiquidity>;
61
+ swap(token: Address): Promise<Swap>;
66
62
  getReserve(token: Address): Promise<GetReserve>;
67
63
  getQuote(token: Address, satoshisIn: bigint): Promise<GetQuote>;
68
64
  getProviderDetails(token: Address): Promise<GetProviderDetails>;
69
- getVirtualReserves(token: Address): Promise<VirtualReserves>;
70
65
  getPriorityQueueCost(token: Address): Promise<GetPriorityQueueCost>;
71
66
  }
@@ -5,4 +5,7 @@ export interface IOP_NETContract extends BaseContractProperties {
5
5
  owner(): Promise<CallResult<{
6
6
  owner: Address;
7
7
  }>>;
8
+ deployer(): Promise<CallResult<{
9
+ deployer: Address;
10
+ }>>;
8
11
  }
@@ -308,6 +308,10 @@ export const NativeSwapAbi = [
308
308
  name: 'token',
309
309
  type: ABIDataTypes.ADDRESS,
310
310
  },
311
+ {
312
+ name: 'amount',
313
+ type: ABIDataTypes.UINT256,
314
+ },
311
315
  ],
312
316
  outputs: [
313
317
  {
@@ -413,26 +417,6 @@ export const NativeSwapAbi = [
413
417
  ],
414
418
  type: BitcoinAbiTypes.Function,
415
419
  },
416
- {
417
- name: 'getVirtualReserves',
418
- inputs: [
419
- {
420
- name: 'token',
421
- type: ABIDataTypes.ADDRESS,
422
- },
423
- ],
424
- outputs: [
425
- {
426
- name: 'virtualBTCReserve',
427
- type: ABIDataTypes.UINT256,
428
- },
429
- {
430
- name: 'virtualTokenReserve',
431
- type: ABIDataTypes.UINT256,
432
- },
433
- ],
434
- type: BitcoinAbiTypes.Function,
435
- },
436
420
  {
437
421
  name: 'getPriorityQueueCost',
438
422
  inputs: [
@@ -12,6 +12,17 @@ export const OP_NET_ABI = [
12
12
  ],
13
13
  type: BitcoinAbiTypes.Function,
14
14
  },
15
+ {
16
+ name: 'deployer',
17
+ constant: true,
18
+ outputs: [
19
+ {
20
+ name: 'deployer',
21
+ type: ABIDataTypes.ADDRESS,
22
+ },
23
+ ],
24
+ type: BitcoinAbiTypes.Function,
25
+ },
15
26
  {
16
27
  name: 'address',
17
28
  constant: true,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opnet",
3
3
  "type": "module",
4
- "version": "1.2.3",
4
+ "version": "1.2.5",
5
5
  "author": "OP_NET",
6
6
  "description": "The perfect library for building Bitcoin-based applications.",
7
7
  "engines": {
@@ -101,7 +101,7 @@
101
101
  "@bitcoinerlab/secp256k1": "^1.2.0",
102
102
  "@btc-vision/bitcoin": "^6.3.3",
103
103
  "@btc-vision/bitcoin-rpc": "^1.0.0",
104
- "@btc-vision/transaction": "^1.2.3",
104
+ "@btc-vision/transaction": "^1.2.4",
105
105
  "@noble/hashes": "^1.7.0",
106
106
  "bignumber.js": "^9.1.2",
107
107
  "buffer": "^6.0.3",
package/src/_version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '1.2.3';
1
+ export const version = '1.2.5';
@@ -104,14 +104,6 @@ export type GetPriorityQueueCost = CallResult<{
104
104
  cost: bigint;
105
105
  }>;
106
106
 
107
- /**
108
- * @description Represents the result of retrieving the virtual reserves
109
- */
110
- export type VirtualReserves = CallResult<{
111
- virtualBTCReserve: bigint;
112
- virtualTokenReserve: bigint;
113
- }>;
114
-
115
107
  /**
116
108
  * @description This interface represents the NativeSwap contract,
117
109
  * including all new/updated methods and type definitions.
@@ -216,17 +208,17 @@ export interface INativeSwapContract extends IOP_NETContract {
216
208
  /**
217
209
  * @description Removes liquidity from the contract.
218
210
  * @param token - The address of the token to remove liquidity for.
211
+ * @param amount
219
212
  * @returns {Promise<RemoveLiquidity>}
220
213
  */
221
- removeLiquidity(token: Address): Promise<RemoveLiquidity>;
214
+ removeLiquidity(token: Address, amount: bigint): Promise<RemoveLiquidity>;
222
215
 
223
216
  /**
224
217
  * @description Executes a swap operation.
225
218
  * @param token - The address of the token to swap.
226
- * @param isSimulation - Whether this is just a simulation.
227
219
  * @returns {Promise<Swap>}
228
220
  */
229
- swap(token: Address, isSimulation: boolean): Promise<Swap>;
221
+ swap(token: Address): Promise<Swap>;
230
222
 
231
223
  /**
232
224
  * @description Retrieves the reserve information for a token.
@@ -251,13 +243,6 @@ export interface INativeSwapContract extends IOP_NETContract {
251
243
  */
252
244
  getProviderDetails(token: Address): Promise<GetProviderDetails>;
253
245
 
254
- /**
255
- * @description Retrieves the virtual reserves (akin to EWMA).
256
- * @param token - The address of the token.
257
- * @returns {Promise<VirtualReserves>}
258
- */
259
- getVirtualReserves(token: Address): Promise<VirtualReserves>;
260
-
261
246
  /**
262
247
  * @description Retrieves the cost for using the priority queue (new).
263
248
  * @param token - The address of the token.
@@ -10,4 +10,6 @@ import { BaseContractProperties } from '../../../interfaces/BaseContractProperti
10
10
  */
11
11
  export interface IOP_NETContract extends BaseContractProperties {
12
12
  owner(): Promise<CallResult<{ owner: Address }>>;
13
+
14
+ deployer(): Promise<CallResult<{ deployer: Address }>>;
13
15
  }
@@ -348,6 +348,10 @@ export const NativeSwapAbi: BitcoinInterfaceAbi = [
348
348
  name: 'token',
349
349
  type: ABIDataTypes.ADDRESS,
350
350
  },
351
+ {
352
+ name: 'amount',
353
+ type: ABIDataTypes.UINT256,
354
+ },
351
355
  ],
352
356
  outputs: [
353
357
  {
@@ -470,27 +474,6 @@ export const NativeSwapAbi: BitcoinInterfaceAbi = [
470
474
  type: BitcoinAbiTypes.Function,
471
475
  },
472
476
 
473
- {
474
- name: 'getVirtualReserves',
475
- inputs: [
476
- {
477
- name: 'token',
478
- type: ABIDataTypes.ADDRESS,
479
- },
480
- ],
481
- outputs: [
482
- {
483
- name: 'virtualBTCReserve',
484
- type: ABIDataTypes.UINT256,
485
- },
486
- {
487
- name: 'virtualTokenReserve',
488
- type: ABIDataTypes.UINT256,
489
- },
490
- ],
491
- type: BitcoinAbiTypes.Function,
492
- },
493
-
494
477
  //=================================================
495
478
  // GET PRIORITY QUEUE COST
496
479
  //=================================================
@@ -19,6 +19,18 @@ export const OP_NET_ABI: BitcoinInterfaceAbi = [
19
19
  type: BitcoinAbiTypes.Function,
20
20
  },
21
21
 
22
+ {
23
+ name: 'deployer',
24
+ constant: true,
25
+ outputs: [
26
+ {
27
+ name: 'deployer',
28
+ type: ABIDataTypes.ADDRESS,
29
+ },
30
+ ],
31
+ type: BitcoinAbiTypes.Function,
32
+ },
33
+
22
34
  {
23
35
  name: 'address',
24
36
  constant: true,