opnet 1.6.5 → 1.6.7
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 +2 -2
- package/browser/_version.d.ts +1 -1
- package/browser/abi/shared/interfaces/generic/IStackingContract.d.ts +3 -9
- package/browser/abi/shared/interfaces/motoswap/IMoto.d.ts +4 -8
- package/browser/abi/shared/interfaces/motoswap/IMotoChef.d.ts +30 -71
- package/browser/abi/shared/interfaces/motoswap/IMotoswapFactoryContract.d.ts +1 -3
- package/browser/abi/shared/interfaces/motoswap/IMotoswapPoolContract.d.ts +12 -21
- package/browser/abi/shared/interfaces/motoswap/IMotoswapRouterContract.d.ts +1 -3
- package/browser/abi/shared/interfaces/motoswap/IMotoswapStakingContract.d.ts +10 -28
- package/browser/abi/shared/interfaces/motoswap/INativeSwapContract.d.ts +12 -30
- package/browser/abi/shared/interfaces/opnet/IOP20Contract.d.ts +95 -0
- package/browser/index.js +1 -1
- package/browser/opnet.d.ts +1 -1
- package/browser/providers/AbstractRpcProvider.d.ts +2 -2
- package/browser/utxos/UTXOsManager.d.ts +1 -1
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/abi/shared/interfaces/generic/IStackingContract.d.ts +3 -9
- package/build/abi/shared/interfaces/motoswap/IMoto.d.ts +4 -8
- package/build/abi/shared/interfaces/motoswap/IMotoChef.d.ts +30 -71
- package/build/abi/shared/interfaces/motoswap/IMotoswapFactoryContract.d.ts +1 -3
- package/build/abi/shared/interfaces/motoswap/IMotoswapPoolContract.d.ts +12 -21
- package/build/abi/shared/interfaces/motoswap/IMotoswapRouterContract.d.ts +1 -3
- package/build/abi/shared/interfaces/motoswap/IMotoswapStakingContract.d.ts +10 -28
- package/build/abi/shared/interfaces/motoswap/INativeSwapContract.d.ts +12 -30
- package/build/abi/shared/interfaces/opnet/IOP20Contract.d.ts +95 -0
- package/build/abi/shared/json/generic/STAKING_ABI.js +3 -18
- package/build/abi/shared/json/motoswap/MOTOCHEF_ABI.js +30 -138
- package/build/abi/shared/json/motoswap/MOTOSWAP_FACTORY_ABI.js +1 -6
- package/build/abi/shared/json/motoswap/MOTOSWAP_POOL_ABI.js +9 -28
- package/build/abi/shared/json/motoswap/MOTOSWAP_ROUTER_ABI.js +1 -6
- package/build/abi/shared/json/motoswap/MOTOSWAP_STAKING_ABI.js +9 -14
- package/build/abi/shared/json/motoswap/MOTO_ABI.js +8 -40
- package/build/abi/shared/json/motoswap/NATIVE_SWAP_ABI.js +9 -9
- package/build/abi/shared/json/opnet/OP_20_ABI.js +125 -125
- package/build/contracts/CallResult.js +2 -5
- package/build/opnet.d.ts +1 -1
- package/build/opnet.js +1 -1
- package/build/providers/AbstractRpcProvider.d.ts +2 -2
- package/build/providers/AbstractRpcProvider.js +3 -3
- package/build/utxos/UTXOsManager.d.ts +1 -1
- package/build/utxos/UTXOsManager.js +2 -1
- package/package.json +16 -14
- package/src/_version.ts +1 -1
- package/src/abi/shared/interfaces/generic/IStackingContract.ts +3 -3
- package/src/abi/shared/interfaces/motoswap/IMoto.ts +6 -10
- package/src/abi/shared/interfaces/motoswap/IMotoChef.ts +66 -121
- package/src/abi/shared/interfaces/motoswap/IMotoswapFactoryContract.ts +1 -3
- package/src/abi/shared/interfaces/motoswap/IMotoswapPoolContract.ts +17 -19
- package/src/abi/shared/interfaces/motoswap/IMotoswapRouterContract.ts +1 -1
- package/src/abi/shared/interfaces/motoswap/IMotoswapStakingContract.ts +10 -28
- package/src/abi/shared/interfaces/motoswap/INativeSwapContract.ts +22 -22
- package/src/abi/shared/interfaces/opnet/IOP20Contract.ts +154 -0
- package/src/abi/shared/json/generic/STAKING_ABI.ts +3 -18
- package/src/abi/shared/json/motoswap/MOTOCHEF_ABI.ts +30 -138
- package/src/abi/shared/json/motoswap/MOTOSWAP_FACTORY_ABI.ts +1 -6
- package/src/abi/shared/json/motoswap/MOTOSWAP_POOL_ABI.ts +9 -28
- package/src/abi/shared/json/motoswap/MOTOSWAP_ROUTER_ABI.ts +1 -6
- package/src/abi/shared/json/motoswap/MOTOSWAP_STAKING_ABI.ts +9 -14
- package/src/abi/shared/json/motoswap/MOTO_ABI.ts +8 -40
- package/src/abi/shared/json/motoswap/NATIVE_SWAP_ABI.ts +10 -10
- package/src/abi/shared/json/opnet/OP_20_ABI.ts +126 -126
- package/src/contracts/CallResult.ts +2 -6
- package/src/contracts/Contract.ts +1 -1
- package/src/opnet.ts +1 -1
- package/src/providers/AbstractRpcProvider.ts +9 -5
- package/src/transactions/Transaction.ts +1 -1
- package/src/utxos/UTXOsManager.ts +4 -0
- package/browser/abi/shared/interfaces/opnet/IOP_20Contract.d.ts +0 -82
- package/build/abi/shared/interfaces/opnet/IOP_20Contract.d.ts +0 -82
- package/src/abi/shared/interfaces/opnet/IOP_20Contract.ts +0 -112
- /package/build/abi/shared/interfaces/opnet/{IOP_20Contract.js → IOP20Contract.js} +0 -0
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ lines of code:
|
|
|
59
59
|
```typescript
|
|
60
60
|
import {
|
|
61
61
|
getContract,
|
|
62
|
-
|
|
62
|
+
IOP20Contract,
|
|
63
63
|
JSONRpcProvider,
|
|
64
64
|
OP_20_ABI,
|
|
65
65
|
TransactionParameters,
|
|
@@ -73,7 +73,7 @@ const provider: JSONRpcProvider = new JSONRpcProvider('https://regtest.opnet.org
|
|
|
73
73
|
const wallet: Wallet = Configs.WALLET;
|
|
74
74
|
const yourAddress: Address = new Address(wallet.keypair.publicKey);
|
|
75
75
|
|
|
76
|
-
const example:
|
|
76
|
+
const example: IOP20Contract = getContract<IOP20Contract>(
|
|
77
77
|
'bcrt1plz0svv3wl05qrrv0dx8hvh5mgqc7jf3mhqgtw8jnj3l3d3cs6lzsfc3mxh',
|
|
78
78
|
OP_20_ABI,
|
|
79
79
|
provider,
|
package/browser/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.6.
|
|
1
|
+
export declare const version = "1.6.7";
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import { Address } from '@btc-vision/transaction';
|
|
2
2
|
import { CallResult } from '../../../../contracts/CallResult.js';
|
|
3
3
|
export interface IStackingContract {
|
|
4
|
-
stake(amount: bigint): Promise<CallResult
|
|
5
|
-
|
|
6
|
-
}>>;
|
|
7
|
-
unstake(): Promise<CallResult<{
|
|
8
|
-
success: boolean;
|
|
9
|
-
}>>;
|
|
4
|
+
stake(amount: bigint): Promise<CallResult>;
|
|
5
|
+
unstake(): Promise<CallResult>;
|
|
10
6
|
stakedAmount(address: Address): Promise<CallResult<{
|
|
11
7
|
amount: bigint;
|
|
12
8
|
}>>;
|
|
13
9
|
stakedReward(address: Address): Promise<CallResult<{
|
|
14
10
|
amount: bigint;
|
|
15
11
|
}>>;
|
|
16
|
-
claim(): Promise<CallResult
|
|
17
|
-
success: boolean;
|
|
18
|
-
}>>;
|
|
12
|
+
claim(): Promise<CallResult>;
|
|
19
13
|
rewardPool(): Promise<CallResult<{
|
|
20
14
|
reward: bigint;
|
|
21
15
|
}>>;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { Address } from '@btc-vision/transaction';
|
|
2
2
|
import { Admin, CallResult, ChangeAdmin } from '../../../../opnet.js';
|
|
3
|
-
import {
|
|
4
|
-
export type AdminMint = CallResult
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export type AdminBurn = CallResult<{
|
|
8
|
-
success: boolean;
|
|
9
|
-
}>;
|
|
10
|
-
export interface IMoto extends IOP_20Contract {
|
|
3
|
+
import { IOP20Contract } from '../opnet/IOP20Contract.js';
|
|
4
|
+
export type AdminMint = CallResult;
|
|
5
|
+
export type AdminBurn = CallResult;
|
|
6
|
+
export interface IMoto extends IOP20Contract {
|
|
11
7
|
admin(): Promise<Admin>;
|
|
12
8
|
changeAdmin(newAdmin: Address): Promise<ChangeAdmin>;
|
|
13
9
|
adminMint(to: Address, amount: bigint): Promise<AdminMint>;
|
|
@@ -8,81 +8,70 @@ export type OwnershipTransferredEvent = {
|
|
|
8
8
|
export type Owner = CallResult<{
|
|
9
9
|
owner: Address;
|
|
10
10
|
}, OPNetEvent<never>[]>;
|
|
11
|
-
export type RenounceOwnership = CallResult<{
|
|
12
|
-
|
|
13
|
-
}, OPNetEvent<OwnershipTransferredEvent>[]>;
|
|
14
|
-
export type TransferOwnership = CallResult<{
|
|
15
|
-
success: boolean;
|
|
16
|
-
}, OPNetEvent<OwnershipTransferredEvent>[]>;
|
|
11
|
+
export type RenounceOwnership = CallResult<{}, OPNetEvent<OwnershipTransferredEvent>[]>;
|
|
12
|
+
export type TransferOwnership = CallResult<{}, OPNetEvent<OwnershipTransferredEvent>[]>;
|
|
17
13
|
interface IOwnable extends IOP_NETContract {
|
|
18
14
|
owner(): Promise<Owner>;
|
|
19
15
|
renounceOwnership(): Promise<RenounceOwnership>;
|
|
20
16
|
transferOwnership(newOwner: Address): Promise<TransferOwnership>;
|
|
21
17
|
}
|
|
22
|
-
export type
|
|
18
|
+
export type PoolAddedEvent = {
|
|
23
19
|
readonly poolId: number;
|
|
24
20
|
readonly allocPoint: bigint;
|
|
25
21
|
readonly lpToken: Address;
|
|
26
22
|
};
|
|
27
|
-
export type
|
|
28
|
-
export type
|
|
23
|
+
export type InitializedEvent = {};
|
|
24
|
+
export type PoolUpdatedEvent = {
|
|
29
25
|
readonly poolId: number;
|
|
30
26
|
readonly lastRewardBlock: bigint;
|
|
31
27
|
readonly lpSupply: bigint;
|
|
32
28
|
readonly accMotoPerShare: bigint;
|
|
33
29
|
};
|
|
34
|
-
export type
|
|
30
|
+
export type BTCStakedEvent = {
|
|
35
31
|
readonly user: Address;
|
|
36
32
|
readonly netAmount: bigint;
|
|
37
33
|
readonly stakeTxId: bigint;
|
|
38
34
|
readonly stakeIndex: bigint;
|
|
39
35
|
};
|
|
40
|
-
export type
|
|
41
|
-
readonly user: Address;
|
|
42
|
-
readonly storedTxId: bigint;
|
|
43
|
-
readonly storedIndex: bigint;
|
|
44
|
-
};
|
|
45
|
-
export type UnstakedBTCEvent = {
|
|
36
|
+
export type BTCUnstakedEvent = {
|
|
46
37
|
readonly user: Address;
|
|
47
38
|
readonly pendingMoto: bigint;
|
|
48
39
|
readonly storedTxId: bigint;
|
|
49
40
|
readonly storedIndex: bigint;
|
|
50
41
|
};
|
|
51
|
-
export type
|
|
42
|
+
export type BTCStakeRemovedEvent = {
|
|
52
43
|
readonly user: Address;
|
|
53
44
|
readonly storedTxId: bigint;
|
|
54
45
|
readonly storedIndex: bigint;
|
|
55
46
|
};
|
|
56
|
-
export type
|
|
47
|
+
export type PoolSetEvent = {
|
|
57
48
|
readonly poolId: number;
|
|
58
49
|
readonly allocPoint: bigint;
|
|
59
50
|
};
|
|
60
|
-
export type
|
|
51
|
+
export type DepositedEvent = {
|
|
61
52
|
readonly user: Address;
|
|
62
53
|
readonly poolId: number;
|
|
63
54
|
readonly amount: bigint;
|
|
64
55
|
readonly to: Address;
|
|
65
56
|
};
|
|
66
|
-
export type
|
|
57
|
+
export type WithdrawnEvent = {
|
|
67
58
|
readonly user: Address;
|
|
68
59
|
readonly poolId: number;
|
|
69
60
|
readonly amount: bigint;
|
|
70
61
|
readonly to: Address;
|
|
71
62
|
};
|
|
72
|
-
export type
|
|
63
|
+
export type HarvestedEvent = {
|
|
73
64
|
readonly user: Address;
|
|
74
65
|
readonly poolId: number;
|
|
75
66
|
readonly amount: bigint;
|
|
76
67
|
};
|
|
77
|
-
export type
|
|
68
|
+
export type EmergencyWithdrawnEvent = {
|
|
78
69
|
readonly user: Address;
|
|
79
70
|
readonly poolId: number;
|
|
80
71
|
readonly amount: bigint;
|
|
81
72
|
readonly to: Address;
|
|
82
73
|
};
|
|
83
|
-
export type Initialize = CallResult<{
|
|
84
|
-
success: boolean;
|
|
85
|
-
}, OPNetEvent<LogPoolAdditionEvent | LogInitEvent>[]>;
|
|
74
|
+
export type Initialize = CallResult<{}, OPNetEvent<PoolAddedEvent | InitializedEvent>[]>;
|
|
86
75
|
export type TotalAllocPoint = CallResult<{
|
|
87
76
|
totalAllocPoint: bigint;
|
|
88
77
|
}, OPNetEvent<never>[]>;
|
|
@@ -134,56 +123,26 @@ export type GetStakingIndex = CallResult<{
|
|
|
134
123
|
export type TotalBTCStaked = CallResult<{
|
|
135
124
|
totalBTCStaked: bigint;
|
|
136
125
|
}, OPNetEvent<never>[]>;
|
|
137
|
-
export type StakeBTC = CallResult<{
|
|
138
|
-
|
|
139
|
-
}, OPNetEvent<
|
|
140
|
-
export type
|
|
141
|
-
|
|
142
|
-
}, OPNetEvent<LogUpdatePoolEvent | UnstakedBTCEvent>[]>;
|
|
143
|
-
export type RemoveBTCStake = CallResult<{
|
|
144
|
-
success: boolean;
|
|
145
|
-
}, OPNetEvent<LogUpdatePoolEvent | RemovedBTCStakeEvent>[]>;
|
|
146
|
-
export type Add = CallResult<{
|
|
147
|
-
success: boolean;
|
|
148
|
-
}, OPNetEvent<LogPoolAdditionEvent>[]>;
|
|
149
|
-
export type Set = CallResult<{
|
|
150
|
-
success: boolean;
|
|
151
|
-
}, OPNetEvent<LogSetPoolEvent>[]>;
|
|
126
|
+
export type StakeBTC = CallResult<{}, OPNetEvent<PoolUpdatedEvent | BTCStakedEvent | BTCStakeRemovedEvent>[]>;
|
|
127
|
+
export type UnstakeBTC = CallResult<{}, OPNetEvent<PoolUpdatedEvent | BTCUnstakedEvent>[]>;
|
|
128
|
+
export type RemoveBTCStake = CallResult<{}, OPNetEvent<PoolUpdatedEvent | BTCStakeRemovedEvent>[]>;
|
|
129
|
+
export type Add = CallResult<{}, OPNetEvent<PoolAddedEvent>[]>;
|
|
130
|
+
export type Set = CallResult<{}, OPNetEvent<PoolSetEvent>[]>;
|
|
152
131
|
export type UpdatePool = CallResult<{
|
|
153
132
|
accMotoPerShare: bigint;
|
|
154
133
|
lastRewardBlock: bigint;
|
|
155
134
|
allocPoint: bigint;
|
|
156
|
-
}, OPNetEvent<
|
|
157
|
-
export type MassUpdatePools = CallResult<{
|
|
158
|
-
|
|
159
|
-
}, OPNetEvent<
|
|
160
|
-
export type
|
|
161
|
-
|
|
162
|
-
}, OPNetEvent<
|
|
163
|
-
export type
|
|
164
|
-
|
|
165
|
-
}, OPNetEvent<
|
|
166
|
-
export type
|
|
167
|
-
success: boolean;
|
|
168
|
-
}, OPNetEvent<LogUpdatePoolEvent | HarvestEvent>[]>;
|
|
169
|
-
export type WithdrawAndHarvest = CallResult<{
|
|
170
|
-
success: boolean;
|
|
171
|
-
}, OPNetEvent<LogUpdatePoolEvent | WithdrawEvent | HarvestEvent>[]>;
|
|
172
|
-
export type EmergencyWithdraw = CallResult<{
|
|
173
|
-
success: boolean;
|
|
174
|
-
}, OPNetEvent<EmergencyWithdrawEvent>[]>;
|
|
175
|
-
export type SetMotoPerBlock = CallResult<{
|
|
176
|
-
success: boolean;
|
|
177
|
-
}, OPNetEvent<never>[]>;
|
|
178
|
-
export type SetBonusEndBlock = CallResult<{
|
|
179
|
-
success: boolean;
|
|
180
|
-
}, OPNetEvent<never>[]>;
|
|
181
|
-
export type SetBonusMultiplier = CallResult<{
|
|
182
|
-
success: boolean;
|
|
183
|
-
}, OPNetEvent<never>[]>;
|
|
184
|
-
export type SetDev = CallResult<{
|
|
185
|
-
success: boolean;
|
|
186
|
-
}, OPNetEvent<never>[]>;
|
|
135
|
+
}, OPNetEvent<PoolUpdatedEvent>[]>;
|
|
136
|
+
export type MassUpdatePools = CallResult<{}, OPNetEvent<PoolUpdatedEvent>[]>;
|
|
137
|
+
export type Deposit = CallResult<{}, OPNetEvent<PoolUpdatedEvent | DepositedEvent>[]>;
|
|
138
|
+
export type Withdraw = CallResult<{}, OPNetEvent<PoolUpdatedEvent | WithdrawnEvent>[]>;
|
|
139
|
+
export type Harvest = CallResult<{}, OPNetEvent<PoolUpdatedEvent | HarvestedEvent>[]>;
|
|
140
|
+
export type WithdrawAndHarvest = CallResult<{}, OPNetEvent<PoolUpdatedEvent | WithdrawnEvent | HarvestedEvent>[]>;
|
|
141
|
+
export type EmergencyWithdraw = CallResult<{}, OPNetEvent<EmergencyWithdrawnEvent>[]>;
|
|
142
|
+
export type SetMotoPerBlock = CallResult<{}, OPNetEvent<never>[]>;
|
|
143
|
+
export type SetBonusEndBlock = CallResult<{}, OPNetEvent<never>[]>;
|
|
144
|
+
export type SetBonusMultiplier = CallResult<{}, OPNetEvent<never>[]>;
|
|
145
|
+
export type SetDev = CallResult<{}, OPNetEvent<never>[]>;
|
|
187
146
|
export interface IMotoChef extends IOwnable {
|
|
188
147
|
initialize(motoAddress: Address, premineAmount: bigint, devAddress: Address, motoPerBlock: bigint, bonusEndBlock: bigint, bonusMultiplier: bigint, treasuryAddress: string, BTCAllocPoint: bigint, MOTOAllocPoint: bigint): Promise<Initialize>;
|
|
189
148
|
totalAllocPoint(): Promise<TotalAllocPoint>;
|
|
@@ -14,9 +14,7 @@ export interface IMotoswapFactoryContract extends IOP_NETContract {
|
|
|
14
14
|
createPool(token0: Address, token1: Address): Promise<CallResult<{
|
|
15
15
|
address: Address;
|
|
16
16
|
}, [OPNetEvent<PoolCreatedEvent>]>>;
|
|
17
|
-
setStakingContractAddress(stakingContractAddress: Address): Promise<CallResult
|
|
18
|
-
success: boolean;
|
|
19
|
-
}>>;
|
|
17
|
+
setStakingContractAddress(stakingContractAddress: Address): Promise<CallResult>;
|
|
20
18
|
getStakingContractAddress(): Promise<CallResult<{
|
|
21
19
|
stakingContractAddress: Address;
|
|
22
20
|
}>>;
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { Address } from '@btc-vision/transaction';
|
|
2
2
|
import { CallResult } from '../../../../contracts/CallResult.js';
|
|
3
3
|
import { OPNetEvent } from '../../../../contracts/OPNetEvent.js';
|
|
4
|
-
import {
|
|
4
|
+
import { IOP20Contract } from '../opnet/IOP20Contract.js';
|
|
5
5
|
export type Reserves = {
|
|
6
6
|
readonly reserve0: bigint;
|
|
7
7
|
readonly reserve1: bigint;
|
|
8
8
|
readonly blockTimestampLast: bigint;
|
|
9
9
|
};
|
|
10
|
-
export type
|
|
10
|
+
export type LiquidityRemovedEvent = {
|
|
11
11
|
readonly sender: Address;
|
|
12
12
|
readonly amount0: bigint;
|
|
13
13
|
readonly amount1: bigint;
|
|
14
|
+
readonly to: Address;
|
|
14
15
|
};
|
|
15
|
-
export type
|
|
16
|
+
export type LiquidityAddedEvent = {
|
|
16
17
|
readonly sender: Address;
|
|
17
18
|
readonly amount0: bigint;
|
|
18
19
|
readonly amount1: bigint;
|
|
19
20
|
};
|
|
20
|
-
export type
|
|
21
|
+
export type SwappedEvent = {
|
|
21
22
|
readonly sender: Address;
|
|
22
23
|
readonly amount0In: bigint;
|
|
23
24
|
readonly amount1In: bigint;
|
|
@@ -25,7 +26,7 @@ export type SwapEvent = {
|
|
|
25
26
|
readonly amount1Out: bigint;
|
|
26
27
|
readonly to: Address;
|
|
27
28
|
};
|
|
28
|
-
export interface IMotoswapPoolContract extends Omit<
|
|
29
|
+
export interface IMotoswapPoolContract extends Omit<IOP20Contract, 'burn' | 'mint'> {
|
|
29
30
|
token0(): Promise<CallResult<{
|
|
30
31
|
token0: Address;
|
|
31
32
|
}>>;
|
|
@@ -33,27 +34,19 @@ export interface IMotoswapPoolContract extends Omit<IOP_20Contract, 'burn' | 'mi
|
|
|
33
34
|
token1: Address;
|
|
34
35
|
}>>;
|
|
35
36
|
getReserves(): Promise<CallResult<Reserves>>;
|
|
36
|
-
swap(amount0Out: bigint, amount1Out: bigint, to: string, data: Uint8Array): Promise<CallResult<{
|
|
37
|
-
|
|
38
|
-
}, [
|
|
39
|
-
OPNetEvent<SwapEvent>
|
|
40
|
-
]>>;
|
|
41
|
-
skim(): Promise<CallResult<{
|
|
42
|
-
success: boolean;
|
|
43
|
-
}>>;
|
|
37
|
+
swap(amount0Out: bigint, amount1Out: bigint, to: string, data: Uint8Array): Promise<CallResult<{}, [OPNetEvent<SwappedEvent>]>>;
|
|
38
|
+
skim(): Promise<CallResult>;
|
|
44
39
|
kLast(): Promise<CallResult<{
|
|
45
40
|
kLast: bigint;
|
|
46
41
|
}>>;
|
|
47
42
|
burn(to: Address): Promise<CallResult<{
|
|
48
43
|
amount0: bigint;
|
|
49
44
|
amount1: bigint;
|
|
50
|
-
}, [OPNetEvent<
|
|
45
|
+
}, [OPNetEvent<LiquidityRemovedEvent>]>>;
|
|
51
46
|
blockTimestampLast(): Promise<CallResult<{
|
|
52
47
|
blockTimestampLast: bigint;
|
|
53
48
|
}>>;
|
|
54
|
-
sync(): Promise<CallResult
|
|
55
|
-
success: boolean;
|
|
56
|
-
}>>;
|
|
49
|
+
sync(): Promise<CallResult>;
|
|
57
50
|
price0CumulativeLast(): Promise<CallResult<{
|
|
58
51
|
price0CumulativeLast: bigint;
|
|
59
52
|
}>>;
|
|
@@ -65,8 +58,6 @@ export interface IMotoswapPoolContract extends Omit<IOP_20Contract, 'burn' | 'mi
|
|
|
65
58
|
}>>;
|
|
66
59
|
mint(to: Address): Promise<CallResult<{
|
|
67
60
|
liquidity: bigint;
|
|
68
|
-
}, [OPNetEvent<
|
|
69
|
-
initialize(token0: Address, token1: Address): Promise<CallResult
|
|
70
|
-
success: boolean;
|
|
71
|
-
}>>;
|
|
61
|
+
}, [OPNetEvent<LiquidityAddedEvent>]>>;
|
|
62
|
+
initialize(token0: Address, token1: Address): Promise<CallResult>;
|
|
72
63
|
}
|
|
@@ -26,9 +26,7 @@ export interface IMotoswapRouterContract extends IOP_NETContract {
|
|
|
26
26
|
getAmountsIn(amountOut: bigint, path: Address[]): Promise<CallResult<{
|
|
27
27
|
amountsIn: bigint[];
|
|
28
28
|
}>>;
|
|
29
|
-
swapExactTokensForTokensSupportingFeeOnTransferTokens(amountIn: bigint, amountOutMin: bigint, path: Address[], to: Address, deadline: bigint): Promise<CallResult
|
|
30
|
-
success: boolean;
|
|
31
|
-
}>>;
|
|
29
|
+
swapExactTokensForTokensSupportingFeeOnTransferTokens(amountIn: bigint, amountOutMin: bigint, path: Address[], to: Address, deadline: bigint): Promise<CallResult>;
|
|
32
30
|
factory(): Promise<CallResult<{
|
|
33
31
|
factory: Address;
|
|
34
32
|
}>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Address } from '@btc-vision/transaction';
|
|
2
2
|
import { CallResult } from '../../../../contracts/CallResult.js';
|
|
3
|
-
import { BalanceOf, TotalSupply } from '../opnet/
|
|
3
|
+
import { BalanceOf, TotalSupply } from '../opnet/IOP20Contract.js';
|
|
4
4
|
import { IOP_NETContract } from '../opnet/IOP_NETContract.js';
|
|
5
5
|
export type Status = CallResult<{
|
|
6
6
|
status: bigint;
|
|
@@ -11,9 +11,7 @@ interface IMotoswapReentrancyGuard extends IOP_NETContract {
|
|
|
11
11
|
export type Admin = CallResult<{
|
|
12
12
|
adminAddress: Address;
|
|
13
13
|
}>;
|
|
14
|
-
export type ChangeAdmin = CallResult
|
|
15
|
-
success: boolean;
|
|
16
|
-
}>;
|
|
14
|
+
export type ChangeAdmin = CallResult;
|
|
17
15
|
interface IMotoswapOwnableReentrancyGuard extends IMotoswapReentrancyGuard {
|
|
18
16
|
admin(): Promise<Admin>;
|
|
19
17
|
changeAdmin(newAdmin: Address): Promise<ChangeAdmin>;
|
|
@@ -42,30 +40,14 @@ export type CalculateSlashingFee = CallResult<{
|
|
|
42
40
|
export type EnabledRewardTokens = CallResult<{
|
|
43
41
|
enabledRewardTokens: Address[];
|
|
44
42
|
}>;
|
|
45
|
-
export type Stake = CallResult
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
export type
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
export type
|
|
52
|
-
|
|
53
|
-
}>;
|
|
54
|
-
export type AdminAddRewardToken = CallResult<{
|
|
55
|
-
success: boolean;
|
|
56
|
-
}>;
|
|
57
|
-
export type AdminRemoveRewardToken = CallResult<{
|
|
58
|
-
success: boolean;
|
|
59
|
-
}>;
|
|
60
|
-
export type AdminChangeMotoAddress = CallResult<{
|
|
61
|
-
success: boolean;
|
|
62
|
-
}>;
|
|
63
|
-
export type AdminChangeLockupParameters = CallResult<{
|
|
64
|
-
success: boolean;
|
|
65
|
-
}>;
|
|
66
|
-
export type AdminEnableEmergencyWithdrawals = CallResult<{
|
|
67
|
-
success: boolean;
|
|
68
|
-
}>;
|
|
43
|
+
export type Stake = CallResult;
|
|
44
|
+
export type Unstake = CallResult;
|
|
45
|
+
export type ClaimRewards = CallResult;
|
|
46
|
+
export type AdminAddRewardToken = CallResult;
|
|
47
|
+
export type AdminRemoveRewardToken = CallResult;
|
|
48
|
+
export type AdminChangeMotoAddress = CallResult;
|
|
49
|
+
export type AdminChangeLockupParameters = CallResult;
|
|
50
|
+
export type AdminEnableEmergencyWithdrawals = CallResult;
|
|
69
51
|
export type RewardTokenAddedEvent = {
|
|
70
52
|
readonly token: Address;
|
|
71
53
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Address } from '@btc-vision/transaction';
|
|
2
2
|
import { CallResult } from '../../../../contracts/CallResult.js';
|
|
3
3
|
import { OPNetEvent } from '../../../../contracts/OPNetEvent.js';
|
|
4
|
-
import {
|
|
4
|
+
import { TransferredEvent } from '../opnet/IOP20Contract.js';
|
|
5
5
|
import { IOP_NETContract } from '../opnet/IOP_NETContract.js';
|
|
6
|
-
export type
|
|
6
|
+
export type LiquidityAddedNativeEvent = {
|
|
7
7
|
readonly totalTokensContributed: bigint;
|
|
8
8
|
readonly virtualTokenExchanged: bigint;
|
|
9
9
|
readonly totalSatoshisSpent: bigint;
|
|
@@ -12,7 +12,7 @@ export type LiquidityListedEvent = {
|
|
|
12
12
|
readonly totalLiquidity: bigint;
|
|
13
13
|
readonly provider: string;
|
|
14
14
|
};
|
|
15
|
-
export type
|
|
15
|
+
export type LiquidityRemovedNativeEvent = {
|
|
16
16
|
readonly providerId: bigint;
|
|
17
17
|
readonly btcOwed: bigint;
|
|
18
18
|
readonly tokenAmount: bigint;
|
|
@@ -57,34 +57,18 @@ export type FulfilledProviderEvent = {
|
|
|
57
57
|
readonly canceled: boolean;
|
|
58
58
|
readonly removalCompleted: boolean;
|
|
59
59
|
};
|
|
60
|
-
export type ReserveNativeSwap = CallResult<{
|
|
61
|
-
|
|
62
|
-
}, OPNetEvent<
|
|
63
|
-
export type
|
|
64
|
-
|
|
65
|
-
}, OPNetEvent<
|
|
66
|
-
export type
|
|
67
|
-
ok: boolean;
|
|
68
|
-
}, OPNetEvent<LiquidityRemovedEvent | TransferEvent | FulfilledProviderEvent>[]>;
|
|
69
|
-
export type ListLiquidity = CallResult<{
|
|
70
|
-
ok: boolean;
|
|
71
|
-
}, OPNetEvent<LiquidityListedEvent>[]>;
|
|
72
|
-
export type CancelListing = CallResult<{
|
|
73
|
-
ok: boolean;
|
|
74
|
-
}, OPNetEvent<ListingCanceledEvent | TransferEvent | FulfilledProviderEvent>[]>;
|
|
75
|
-
export type CreatePool = CallResult<{
|
|
76
|
-
ok: boolean;
|
|
77
|
-
}, OPNetEvent<TransferEvent | LiquidityAddedEvent>[]>;
|
|
78
|
-
export type SetFees = CallResult<{
|
|
79
|
-
ok: boolean;
|
|
80
|
-
}, []>;
|
|
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>[]>;
|
|
66
|
+
export type SetFees = CallResult;
|
|
81
67
|
export type GetFees = CallResult<{
|
|
82
68
|
reservationBaseFee: bigint;
|
|
83
69
|
priorityQueueBaseFee: bigint;
|
|
84
70
|
}, []>;
|
|
85
|
-
export type Swap = CallResult<{
|
|
86
|
-
ok: boolean;
|
|
87
|
-
}, OPNetEvent<SwapExecutedEvent | TransferEvent | ActivateProviderEvent | FulfilledProviderEvent>[]>;
|
|
71
|
+
export type Swap = CallResult<{}, OPNetEvent<SwapExecutedEvent | TransferredEvent | ActivateProviderEvent | FulfilledProviderEvent>[]>;
|
|
88
72
|
export type GetReserve = CallResult<{
|
|
89
73
|
liquidity: bigint;
|
|
90
74
|
reservedLiquidity: bigint;
|
|
@@ -154,8 +138,6 @@ export interface INativeSwapContract extends IOP_NETContract {
|
|
|
154
138
|
getQueueDetails(token: Address): Promise<QueueDetails>;
|
|
155
139
|
getPriorityQueueCost(token: Address): Promise<GetPriorityQueueCost>;
|
|
156
140
|
getAntibotSettings(token: Address): Promise<AntiBotSettings>;
|
|
157
|
-
setStakingContractAddress(stakingContractAddress: Address): Promise<CallResult
|
|
158
|
-
ok: boolean;
|
|
159
|
-
}, []>>;
|
|
141
|
+
setStakingContractAddress(stakingContractAddress: Address): Promise<CallResult>;
|
|
160
142
|
getStakingContractAddress(): Promise<StakingAddressResult>;
|
|
161
143
|
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { Address, AddressMap } from '@btc-vision/transaction';
|
|
2
|
+
import { CallResult } from '../../../../contracts/CallResult.js';
|
|
3
|
+
import { OPNetEvent } from '../../../../contracts/OPNetEvent.js';
|
|
4
|
+
import { IOP_NETContract } from './IOP_NETContract.js';
|
|
5
|
+
export type MintedEvent = {
|
|
6
|
+
to: Address;
|
|
7
|
+
amount: bigint;
|
|
8
|
+
};
|
|
9
|
+
export type TransferredEvent = {
|
|
10
|
+
from: Address;
|
|
11
|
+
to: Address;
|
|
12
|
+
amount: bigint;
|
|
13
|
+
};
|
|
14
|
+
export type BurnedEvent = {
|
|
15
|
+
from: Address;
|
|
16
|
+
amount: bigint;
|
|
17
|
+
};
|
|
18
|
+
export type ApprovedEvent = {
|
|
19
|
+
owner: Address;
|
|
20
|
+
spender: Address;
|
|
21
|
+
value: bigint;
|
|
22
|
+
};
|
|
23
|
+
export type Name = CallResult<{
|
|
24
|
+
name: string;
|
|
25
|
+
}, []>;
|
|
26
|
+
export type BalanceOf = CallResult<{
|
|
27
|
+
balance: bigint;
|
|
28
|
+
}, []>;
|
|
29
|
+
export type SymbolOf = CallResult<{
|
|
30
|
+
symbol: string;
|
|
31
|
+
}, []>;
|
|
32
|
+
export type TotalSupply = CallResult<{
|
|
33
|
+
totalSupply: bigint;
|
|
34
|
+
}, []>;
|
|
35
|
+
export type MaxSupply = CallResult<{
|
|
36
|
+
maximumSupply: bigint;
|
|
37
|
+
}, []>;
|
|
38
|
+
export type Decimals = CallResult<{
|
|
39
|
+
decimals: number;
|
|
40
|
+
}, []>;
|
|
41
|
+
export type TokenIcon = CallResult<{
|
|
42
|
+
icon: string;
|
|
43
|
+
}, []>;
|
|
44
|
+
export type DomainSeparator = CallResult<{
|
|
45
|
+
domainSeparator: Uint8Array;
|
|
46
|
+
}, []>;
|
|
47
|
+
export type NonceOf = CallResult<{
|
|
48
|
+
nonce: bigint;
|
|
49
|
+
}, []>;
|
|
50
|
+
export type TokenMetadata = CallResult<{
|
|
51
|
+
name: string;
|
|
52
|
+
symbol: string;
|
|
53
|
+
decimals: number;
|
|
54
|
+
totalSupply: bigint;
|
|
55
|
+
maximumSupply: bigint;
|
|
56
|
+
icon: string;
|
|
57
|
+
domainSeparator: Uint8Array;
|
|
58
|
+
}, [
|
|
59
|
+
]>;
|
|
60
|
+
export type SafeTransfer = CallResult<{}, [OPNetEvent<TransferredEvent>]>;
|
|
61
|
+
export type SafeTransferFrom = CallResult<{}, [OPNetEvent<TransferredEvent>]>;
|
|
62
|
+
export type IncreaseAllowance = CallResult<{}, [OPNetEvent<ApprovedEvent>]>;
|
|
63
|
+
export type DecreaseAllowance = CallResult<{}, [OPNetEvent<ApprovedEvent>]>;
|
|
64
|
+
export type IncreaseAllowanceBySignature = CallResult<{}, [OPNetEvent<ApprovedEvent>]>;
|
|
65
|
+
export type DecreaseAllowanceBySignature = CallResult<{}, [OPNetEvent<ApprovedEvent>]>;
|
|
66
|
+
export type Allowance = CallResult<{
|
|
67
|
+
remaining: bigint;
|
|
68
|
+
}, []>;
|
|
69
|
+
export type Burn = CallResult<{}, [OPNetEvent<BurnedEvent>]>;
|
|
70
|
+
export type Mint = CallResult<{}, [OPNetEvent<MintedEvent>]>;
|
|
71
|
+
export type Airdrop = CallResult<{}, OPNetEvent<MintedEvent>[]>;
|
|
72
|
+
export type AirdropWithAmount = CallResult<{}, OPNetEvent<MintedEvent>[]>;
|
|
73
|
+
export interface IOP20Contract extends IOP_NETContract {
|
|
74
|
+
balanceOf(account: Address): Promise<BalanceOf>;
|
|
75
|
+
name(): Promise<Name>;
|
|
76
|
+
symbol(): Promise<SymbolOf>;
|
|
77
|
+
totalSupply(): Promise<TotalSupply>;
|
|
78
|
+
maximumSupply(): Promise<MaxSupply>;
|
|
79
|
+
domainSeparator(): Promise<DomainSeparator>;
|
|
80
|
+
nonceOf(owner: Address): Promise<NonceOf>;
|
|
81
|
+
decimals(): Promise<Decimals>;
|
|
82
|
+
icon(): Promise<TokenIcon>;
|
|
83
|
+
safeTransfer(to: Address, amount: bigint, data: Uint8Array): Promise<SafeTransfer>;
|
|
84
|
+
safeTransferFrom(from: Address, to: Address, amount: bigint, data: Uint8Array): Promise<SafeTransferFrom>;
|
|
85
|
+
increaseAllowance(spender: Address, amount: bigint): Promise<IncreaseAllowance>;
|
|
86
|
+
decreaseAllowance(spender: Address, amount: bigint): Promise<DecreaseAllowance>;
|
|
87
|
+
metadata(): Promise<TokenMetadata>;
|
|
88
|
+
increaseAllowanceBySignature(owner: Address, spender: Address, amount: bigint, deadline: bigint, signature: Uint8Array): Promise<IncreaseAllowanceBySignature>;
|
|
89
|
+
decreaseAllowanceBySignature(owner: Address, spender: Address, amount: bigint, deadline: bigint, signature: Uint8Array): Promise<DecreaseAllowanceBySignature>;
|
|
90
|
+
allowance(owner: Address, spender: Address): Promise<Allowance>;
|
|
91
|
+
burn(value: bigint): Promise<Burn>;
|
|
92
|
+
mint(address: Address, value: bigint): Promise<Mint>;
|
|
93
|
+
airdrop(map: AddressMap<bigint>): Promise<Airdrop>;
|
|
94
|
+
airdropWithAmount(amount: bigint, addresses: Address[]): Promise<AirdropWithAmount>;
|
|
95
|
+
}
|