opnet 1.2.4 → 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.
- package/browser/_version.d.ts +1 -1
- package/browser/abi/shared/interfaces/motoswap/INativeSwapContract.d.ts +2 -7
- package/browser/abi/shared/interfaces/opnet/IOP_NETContract.d.ts +3 -0
- package/browser/index.js +1 -1
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/abi/shared/interfaces/motoswap/INativeSwapContract.d.ts +2 -7
- package/build/abi/shared/interfaces/opnet/IOP_NETContract.d.ts +3 -0
- package/build/abi/shared/json/motoswap/NATIVE_SWAP_ABI.js +4 -20
- package/build/abi/shared/json/opnet/OP_NET_ABI.js +11 -0
- package/package.json +1 -1
- package/src/_version.ts +1 -1
- package/src/abi/shared/interfaces/motoswap/INativeSwapContract.ts +3 -18
- package/src/abi/shared/interfaces/opnet/IOP_NETContract.ts +2 -0
- package/src/abi/shared/json/motoswap/NATIVE_SWAP_ABI.ts +4 -21
- package/src/abi/shared/json/opnet/OP_NET_ABI.ts +12 -0
package/build/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.2.
|
|
1
|
+
export declare const version = "1.2.5";
|
package/build/_version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.2.
|
|
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
|
|
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
|
}
|
|
@@ -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
package/src/_version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.2.
|
|
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
|
|
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,
|