opnet 1.6.9 → 1.6.11
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 +83 -43
- 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 +83 -43
- package/build/abi/shared/json/motoswap/NATIVE_SWAP_ABI.js +127 -56
- package/package.json +1 -1
- package/src/_version.ts +1 -1
- package/src/abi/shared/interfaces/motoswap/INativeSwapContract.ts +168 -115
- package/src/abi/shared/json/motoswap/NATIVE_SWAP_ABI.ts +181 -91
package/browser/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.6.
|
|
1
|
+
export declare const version = "1.6.11";
|
|
@@ -3,20 +3,39 @@ import { CallResult } from '../../../../contracts/CallResult.js';
|
|
|
3
3
|
import { OPNetEvent } from '../../../../contracts/OPNetEvent.js';
|
|
4
4
|
import { TransferredEvent } from '../opnet/IOP20Contract.js';
|
|
5
5
|
import { IOP_NETContract } from '../opnet/IOP_NETContract.js';
|
|
6
|
-
export type LiquidityAddedNativeEvent = {
|
|
7
|
-
readonly totalTokensContributed: bigint;
|
|
8
|
-
readonly virtualTokenExchanged: bigint;
|
|
9
|
-
readonly totalSatoshisSpent: bigint;
|
|
10
|
-
};
|
|
11
6
|
export type LiquidityListedEvent = {
|
|
12
7
|
readonly totalLiquidity: bigint;
|
|
13
8
|
readonly provider: string;
|
|
14
9
|
};
|
|
15
|
-
export type
|
|
10
|
+
export type LiquidityReservedEvent = {
|
|
11
|
+
readonly depositAddress: string;
|
|
12
|
+
readonly satoshisAmount: bigint;
|
|
16
13
|
readonly providerId: bigint;
|
|
17
|
-
readonly btcOwed: bigint;
|
|
18
14
|
readonly tokenAmount: bigint;
|
|
19
15
|
};
|
|
16
|
+
export type ListingCanceledEvent = {
|
|
17
|
+
readonly amount: bigint;
|
|
18
|
+
readonly penalty: bigint;
|
|
19
|
+
};
|
|
20
|
+
export type ProviderActivatedEvent = {
|
|
21
|
+
readonly providerId: bigint;
|
|
22
|
+
readonly listingAmount: bigint;
|
|
23
|
+
readonly btcToRemove: bigint;
|
|
24
|
+
};
|
|
25
|
+
export type ProviderConsumedEvent = {
|
|
26
|
+
readonly providerId: bigint;
|
|
27
|
+
readonly amountUsed: bigint;
|
|
28
|
+
};
|
|
29
|
+
export type ProviderFulfilledEvent = {
|
|
30
|
+
readonly providerId: bigint;
|
|
31
|
+
readonly canceled: boolean;
|
|
32
|
+
readonly removalCompleted: boolean;
|
|
33
|
+
readonly stakedAmount: bigint;
|
|
34
|
+
};
|
|
35
|
+
export type ReservationFallbackEvent = {
|
|
36
|
+
readonly reservationId: bigint;
|
|
37
|
+
readonly expirationBlock: bigint;
|
|
38
|
+
};
|
|
20
39
|
export type ReservationCreatedEvent = {
|
|
21
40
|
readonly expectedAmountOut: bigint;
|
|
22
41
|
readonly totalSatoshis: bigint;
|
|
@@ -27,48 +46,42 @@ export type ReservationPurgedEvent = {
|
|
|
27
46
|
readonly purgingBlock: bigint;
|
|
28
47
|
readonly purgeIndex: number;
|
|
29
48
|
readonly providerCount: number;
|
|
30
|
-
|
|
31
|
-
export type ReservationPurgingEvent = {
|
|
32
|
-
readonly reservationId: bigint;
|
|
33
|
-
readonly purgeIndex: number;
|
|
34
|
-
readonly purgeQueueLength: number;
|
|
49
|
+
readonly purgedAmount: bigint;
|
|
35
50
|
};
|
|
36
51
|
export type SwapExecutedEvent = {
|
|
37
52
|
readonly buyer: Address;
|
|
38
53
|
readonly amountIn: bigint;
|
|
39
54
|
readonly amountOut: bigint;
|
|
55
|
+
readonly totalFees: bigint;
|
|
40
56
|
};
|
|
41
|
-
export type
|
|
42
|
-
readonly depositAddress: string;
|
|
43
|
-
readonly amount: bigint;
|
|
44
|
-
readonly providerId: bigint;
|
|
45
|
-
};
|
|
46
|
-
export type ListingCanceledEvent = {
|
|
57
|
+
export type WithdrawListingEvent = {
|
|
47
58
|
readonly amount: bigint;
|
|
48
|
-
readonly
|
|
49
|
-
};
|
|
50
|
-
export type ActivateProviderEvent = {
|
|
59
|
+
readonly tokenAddress: Address;
|
|
51
60
|
readonly providerId: bigint;
|
|
52
|
-
readonly
|
|
53
|
-
readonly btcToRemove: bigint;
|
|
61
|
+
readonly sender: Address;
|
|
54
62
|
};
|
|
55
|
-
export type
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
export type ReserveNativeSwap = CallResult<{}, OPNetEvent<LiquidityReservedEvent | ReservationCreatedEvent | TransferredEvent | FulfilledProviderEvent>[]>;
|
|
61
|
-
export type AddLiquidity = CallResult<{}, OPNetEvent<LiquidityAddedNativeEvent | TransferredEvent | ActivateProviderEvent | FulfilledProviderEvent>[]>;
|
|
62
|
-
export type RemoveLiquidity = CallResult<{}, OPNetEvent<LiquidityRemovedNativeEvent | TransferredEvent | FulfilledProviderEvent>[]>;
|
|
63
|
-
export type ListLiquidity = CallResult<{}, OPNetEvent<LiquidityListedEvent>[]>;
|
|
64
|
-
export type CancelListing = CallResult<{}, OPNetEvent<ListingCanceledEvent | TransferredEvent | FulfilledProviderEvent>[]>;
|
|
65
|
-
export type CreatePool = CallResult<{}, OPNetEvent<TransferredEvent | LiquidityAddedNativeEvent>[]>;
|
|
63
|
+
export type ReserveNativeSwap = CallResult<{}, OPNetEvent<LiquidityReservedEvent | ReservationCreatedEvent | TransferredEvent | ProviderFulfilledEvent | ReservationPurgedEvent>[]>;
|
|
64
|
+
export type ListLiquidity = CallResult<{}, OPNetEvent<LiquidityListedEvent | TransferredEvent>[]>;
|
|
65
|
+
export type CancelListing = CallResult<{}, OPNetEvent<ListingCanceledEvent | TransferredEvent | ReservationPurgedEvent>[]>;
|
|
66
|
+
export type WithdrawListing = CallResult<{}, OPNetEvent<WithdrawListingEvent | TransferredEvent>[]>;
|
|
67
|
+
export type CreatePool = CallResult<{}, OPNetEvent<TransferredEvent | ReservationPurgedEvent>[]>;
|
|
66
68
|
export type SetFees = CallResult;
|
|
69
|
+
export type SetStakingContractAddress = CallResult;
|
|
70
|
+
export type SetFeesAddress = CallResult;
|
|
71
|
+
export type Pause = CallResult;
|
|
72
|
+
export type Unpause = CallResult;
|
|
73
|
+
export type ActivateWithdrawMode = CallResult;
|
|
74
|
+
export type IsPaused = CallResult<{
|
|
75
|
+
paused: boolean;
|
|
76
|
+
}, []>;
|
|
77
|
+
export type IsWithdrawModeActive = CallResult<{
|
|
78
|
+
active: boolean;
|
|
79
|
+
}, []>;
|
|
67
80
|
export type GetFees = CallResult<{
|
|
68
81
|
reservationBaseFee: bigint;
|
|
69
82
|
priorityQueueBaseFee: bigint;
|
|
70
83
|
}, []>;
|
|
71
|
-
export type Swap = CallResult<{}, OPNetEvent<SwapExecutedEvent | TransferredEvent |
|
|
84
|
+
export type Swap = CallResult<{}, OPNetEvent<SwapExecutedEvent | TransferredEvent | ProviderActivatedEvent | ProviderFulfilledEvent | ProviderConsumedEvent | ReservationFallbackEvent>[]>;
|
|
72
85
|
export type GetReserve = CallResult<{
|
|
73
86
|
liquidity: bigint;
|
|
74
87
|
reservedLiquidity: bigint;
|
|
@@ -87,7 +100,6 @@ export type GetProviderDetails = CallResult<{
|
|
|
87
100
|
id: bigint;
|
|
88
101
|
liquidity: bigint;
|
|
89
102
|
reserved: bigint;
|
|
90
|
-
lpShares: bigint;
|
|
91
103
|
btcReceiver: string;
|
|
92
104
|
indexedAt: number;
|
|
93
105
|
isPriority: boolean;
|
|
@@ -95,6 +107,21 @@ export type GetProviderDetails = CallResult<{
|
|
|
95
107
|
isActive: boolean;
|
|
96
108
|
lastListedTokensAtBlock: bigint;
|
|
97
109
|
isPurged: boolean;
|
|
110
|
+
isLiquidityProvisionAllowed: boolean;
|
|
111
|
+
}, [
|
|
112
|
+
]>;
|
|
113
|
+
export type GetProviderDetailsById = CallResult<{
|
|
114
|
+
id: bigint;
|
|
115
|
+
liquidity: bigint;
|
|
116
|
+
reserved: bigint;
|
|
117
|
+
btcReceiver: string;
|
|
118
|
+
indexedAt: number;
|
|
119
|
+
isPriority: boolean;
|
|
120
|
+
purgeIndex: number;
|
|
121
|
+
isActive: boolean;
|
|
122
|
+
lastListedTokensAtBlock: bigint;
|
|
123
|
+
isPurged: boolean;
|
|
124
|
+
isLiquidityProvisionAllowed: boolean;
|
|
98
125
|
}, [
|
|
99
126
|
]>;
|
|
100
127
|
export type GetPriorityQueueCost = CallResult<{
|
|
@@ -108,8 +135,11 @@ export type AntiBotSettings = CallResult<{
|
|
|
108
135
|
export type StakingAddressResult = CallResult<{
|
|
109
136
|
stakingAddress: Address;
|
|
110
137
|
}, []>;
|
|
138
|
+
export type FeesAddressResult = CallResult<{
|
|
139
|
+
feesAddress: string;
|
|
140
|
+
}, []>;
|
|
111
141
|
export type QueueDetails = CallResult<{
|
|
112
|
-
lastPurgedBlock:
|
|
142
|
+
lastPurgedBlock: bigint;
|
|
113
143
|
blockWithReservationsLength: number;
|
|
114
144
|
removalQueueLength: number;
|
|
115
145
|
removalQueueStartingIndex: number;
|
|
@@ -122,22 +152,32 @@ export type QueueDetails = CallResult<{
|
|
|
122
152
|
removePurgeQueueLength: number;
|
|
123
153
|
}, [
|
|
124
154
|
]>;
|
|
155
|
+
export type OnOP20ReceivedResult = CallResult<{
|
|
156
|
+
selector: Buffer;
|
|
157
|
+
}, []>;
|
|
125
158
|
export interface INativeSwapContract extends IOP_NETContract {
|
|
126
159
|
reserve(token: Address, maximumAmountIn: bigint, minimumAmountOut: bigint, forLP: boolean, activationDelay: number): Promise<ReserveNativeSwap>;
|
|
127
|
-
listLiquidity(token: Address, receiver: string, amountIn: bigint, priority: boolean): Promise<ListLiquidity>;
|
|
160
|
+
listLiquidity(token: Address, receiver: Buffer, receiverStr: string, amountIn: bigint, priority: boolean): Promise<ListLiquidity>;
|
|
128
161
|
cancelListing(token: Address): Promise<CancelListing>;
|
|
129
|
-
|
|
162
|
+
withdrawListing(token: Address): Promise<WithdrawListing>;
|
|
163
|
+
createPool(token: Address, floorPrice: bigint, initialLiquidity: bigint, receiver: Buffer, receiverStr: string, antiBotEnabledFor: number, antiBotMaximumTokensPerReservation: bigint, maxReservesIn5BlocksPercent: number): Promise<CreatePool>;
|
|
130
164
|
setFees(reservationBaseFee: bigint, priorityQueueBaseFee: bigint): Promise<SetFees>;
|
|
165
|
+
setStakingContractAddress(stakingContractAddress: Address): Promise<SetStakingContractAddress>;
|
|
166
|
+
setFeesAddress(feesAddress: string): Promise<SetFeesAddress>;
|
|
167
|
+
pause(): Promise<Pause>;
|
|
168
|
+
unpause(): Promise<Unpause>;
|
|
169
|
+
activateWithdrawMode(): Promise<ActivateWithdrawMode>;
|
|
170
|
+
isPaused(): Promise<IsPaused>;
|
|
171
|
+
isWithdrawModeActive(): Promise<IsWithdrawModeActive>;
|
|
131
172
|
getFees(): Promise<GetFees>;
|
|
132
|
-
addLiquidity(token: Address, receiver: string): Promise<AddLiquidity>;
|
|
133
|
-
removeLiquidity(token: Address): Promise<RemoveLiquidity>;
|
|
134
173
|
swap(token: Address): Promise<Swap>;
|
|
135
174
|
getReserve(token: Address): Promise<GetReserve>;
|
|
136
175
|
getQuote(token: Address, satoshisIn: bigint): Promise<GetQuote>;
|
|
137
176
|
getProviderDetails(token: Address): Promise<GetProviderDetails>;
|
|
177
|
+
getProviderDetailsById(providerId: bigint): Promise<GetProviderDetailsById>;
|
|
138
178
|
getQueueDetails(token: Address): Promise<QueueDetails>;
|
|
139
|
-
getPriorityQueueCost(
|
|
179
|
+
getPriorityQueueCost(): Promise<GetPriorityQueueCost>;
|
|
140
180
|
getAntibotSettings(token: Address): Promise<AntiBotSettings>;
|
|
141
|
-
setStakingContractAddress(stakingContractAddress: Address): Promise<CallResult>;
|
|
142
181
|
getStakingContractAddress(): Promise<StakingAddressResult>;
|
|
182
|
+
getFeesAddress(): Promise<FeesAddressResult>;
|
|
143
183
|
}
|