opnet 1.3.2 → 1.3.4
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/{IAdministeredOP20.d.ts → IMoto.d.ts} +2 -2
- package/browser/abi/shared/interfaces/motoswap/IMotoChef.d.ts +208 -0
- package/browser/abi/shared/interfaces/motoswap/IMotoswapPoolContract.d.ts +0 -4
- package/browser/abi/shared/interfaces/motoswap/IMotoswapStakingContract.d.ts +19 -3
- package/browser/abi/shared/interfaces/motoswap/INativeSwapContract.d.ts +13 -5
- package/browser/abi/shared/json/generic/STAKING_ABI.d.ts +0 -1
- package/{build/abi/shared/json/motoswap/REENTRANCY_GUARD_ABI.d.ts → browser/abi/shared/json/motoswap/MOTOCHEF_ABI.d.ts} +1 -1
- package/browser/abi/shared/json/motoswap/MOTOSWAP_STAKING_ABI.d.ts +0 -1
- package/browser/abi/shared/json/motoswap/MOTO_ABI.d.ts +2 -0
- package/browser/abi/shared/json/motoswap/NATIVE_SWAP_ABI.d.ts +0 -1
- package/browser/fetch/fetch-browser.d.ts +4 -0
- package/browser/fetch/fetch.d.ts +2 -0
- package/browser/index.js +1 -1
- package/browser/opnet.d.ts +10 -12
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/abi/shared/interfaces/motoswap/{IAdministeredOP20.d.ts → IMoto.d.ts} +2 -2
- package/build/abi/shared/interfaces/motoswap/IMotoChef.d.ts +208 -0
- package/build/abi/shared/interfaces/motoswap/IMotoswapPoolContract.d.ts +0 -4
- package/build/abi/shared/interfaces/motoswap/IMotoswapStakingContract.d.ts +19 -3
- package/build/abi/shared/interfaces/motoswap/INativeSwapContract.d.ts +13 -5
- package/build/abi/shared/json/generic/STAKING_ABI.d.ts +0 -1
- package/build/abi/shared/json/generic/STAKING_ABI.js +1 -1
- package/{browser/abi/shared/json/motoswap/REENTRANCY_GUARD_ABI.d.ts → build/abi/shared/json/motoswap/MOTOCHEF_ABI.d.ts} +1 -1
- package/build/abi/shared/json/motoswap/MOTOCHEF_ABI.js +820 -0
- package/build/abi/shared/json/motoswap/MOTOSWAP_STAKING_ABI.d.ts +0 -1
- package/build/abi/shared/json/motoswap/MOTOSWAP_STAKING_ABI.js +45 -5
- package/build/abi/shared/json/motoswap/MOTO_ABI.d.ts +2 -0
- package/build/abi/shared/json/motoswap/{ADMINISTERD_OP_20_ABI.js → MOTO_ABI.js} +5 -13
- package/build/abi/shared/json/motoswap/NATIVE_SWAP_ABI.d.ts +0 -1
- package/build/abi/shared/json/motoswap/NATIVE_SWAP_ABI.js +15 -1
- package/build/abi/shared/json/opnet/OP_NET_ABI.js +7 -18
- package/build/contracts/Contract.js +2 -2
- package/build/fetch/fetch.d.ts +2 -0
- package/build/fetch/fetch.js +2 -0
- package/build/opnet.d.ts +10 -12
- package/build/opnet.js +10 -12
- package/build/providers/JSONRpcProvider.js +7 -1
- package/package.json +6 -4
- package/src/_version.ts +1 -1
- package/src/abi/shared/interfaces/motoswap/{IAdministeredOP20.ts → IMoto.ts} +4 -4
- package/src/abi/shared/interfaces/motoswap/IMotoChef.ts +485 -0
- package/src/abi/shared/interfaces/motoswap/IMotoswapPoolContract.ts +0 -5
- package/src/abi/shared/interfaces/motoswap/IMotoswapStakingContract.ts +50 -4
- package/src/abi/shared/interfaces/motoswap/INativeSwapContract.ts +19 -5
- package/src/abi/shared/json/generic/STAKING_ABI.ts +1 -7
- package/src/abi/shared/json/motoswap/MOTOCHEF_ABI.ts +831 -0
- package/src/abi/shared/json/motoswap/MOTOSWAP_FACTORY_ABI.ts +0 -6
- package/src/abi/shared/json/motoswap/MOTOSWAP_POOL_ABI.ts +0 -6
- package/src/abi/shared/json/motoswap/MOTOSWAP_ROUTER_ABI.ts +0 -3
- package/src/abi/shared/json/motoswap/MOTOSWAP_STAKING_ABI.ts +51 -9
- package/src/abi/shared/json/motoswap/{ADMINISTERD_OP_20_ABI.ts → MOTO_ABI.ts} +7 -15
- package/src/abi/shared/json/motoswap/NATIVE_SWAP_ABI.ts +15 -7
- package/src/abi/shared/json/opnet/OP_NET_ABI.ts +7 -24
- package/src/contracts/CallResult.ts +1 -0
- package/src/contracts/Contract.ts +3 -3
- package/src/fetch/fetch-browser.js +5 -0
- package/src/fetch/fetch.ts +3 -0
- package/src/opnet.ts +10 -12
- package/src/providers/JSONRpcProvider.ts +9 -4
- package/webpack.config.js +1 -0
- package/browser/abi/shared/interfaces/motoswap/IMotoChefContract.d.ts +0 -229
- package/browser/abi/shared/interfaces/motoswap/IOwnableContract.d.ts +0 -12
- package/browser/abi/shared/interfaces/motoswap/IOwnableReentrancyGuardContract.d.ts +0 -13
- package/browser/abi/shared/interfaces/motoswap/IReentrancyGuardContract.d.ts +0 -7
- package/browser/abi/shared/interfaces/tests/IWBTCContract.d.ts +0 -13
- package/browser/abi/shared/json/motoswap/ADMINISTERD_OP_20_ABI.d.ts +0 -3
- package/browser/abi/shared/json/motoswap/MOTOSWAP_MOTOCHEF_ABI.d.ts +0 -4
- package/browser/abi/shared/json/motoswap/OWNABLE_ABI.d.ts +0 -3
- package/browser/abi/shared/json/tests/WBTC_ABI.d.ts +0 -3
- package/build/abi/shared/interfaces/motoswap/IMotoChefContract.d.ts +0 -229
- package/build/abi/shared/interfaces/motoswap/IOwnableContract.d.ts +0 -12
- package/build/abi/shared/interfaces/motoswap/IOwnableContract.js +0 -1
- package/build/abi/shared/interfaces/motoswap/IOwnableReentrancyGuardContract.d.ts +0 -13
- package/build/abi/shared/interfaces/motoswap/IOwnableReentrancyGuardContract.js +0 -1
- package/build/abi/shared/interfaces/motoswap/IReentrancyGuardContract.d.ts +0 -7
- package/build/abi/shared/interfaces/motoswap/IReentrancyGuardContract.js +0 -1
- package/build/abi/shared/interfaces/tests/IWBTCContract.d.ts +0 -13
- package/build/abi/shared/interfaces/tests/IWBTCContract.js +0 -1
- package/build/abi/shared/json/motoswap/ADMINISTERD_OP_20_ABI.d.ts +0 -3
- package/build/abi/shared/json/motoswap/MOTOSWAP_MOTOCHEF_ABI.d.ts +0 -4
- package/build/abi/shared/json/motoswap/MOTOSWAP_MOTOCHEF_ABI.js +0 -508
- package/build/abi/shared/json/motoswap/OWNABLE_ABI.d.ts +0 -3
- package/build/abi/shared/json/motoswap/OWNABLE_ABI.js +0 -35
- package/build/abi/shared/json/motoswap/REENTRANCY_GUARD_ABI.js +0 -15
- package/build/abi/shared/json/tests/WBTC_ABI.d.ts +0 -3
- package/build/abi/shared/json/tests/WBTC_ABI.js +0 -57
- package/src/abi/shared/interfaces/motoswap/IMotoChefContract.ts +0 -484
- package/src/abi/shared/interfaces/motoswap/IOwnableContract.ts +0 -32
- package/src/abi/shared/interfaces/motoswap/IOwnableReentrancyGuardContract.ts +0 -33
- package/src/abi/shared/interfaces/motoswap/IReentrancyGuardContract.ts +0 -18
- package/src/abi/shared/interfaces/tests/IWBTCContract.ts +0 -35
- package/src/abi/shared/json/motoswap/MOTOSWAP_MOTOCHEF_ABI.ts +0 -520
- package/src/abi/shared/json/motoswap/OWNABLE_ABI.ts +0 -38
- package/src/abi/shared/json/motoswap/REENTRANCY_GUARD_ABI.ts +0 -20
- package/src/abi/shared/json/tests/WBTC_ABI.ts +0 -73
- /package/build/abi/shared/interfaces/motoswap/{IAdministeredOP20.js → IMoto.js} +0 -0
- /package/build/abi/shared/interfaces/motoswap/{IMotoChefContract.js → IMotoChef.js} +0 -0
|
@@ -1,9 +1,50 @@
|
|
|
1
1
|
import { ABIDataTypes } from '@btc-vision/transaction';
|
|
2
2
|
import { BitcoinAbiTypes } from '../../../BitcoinAbiTypes.js';
|
|
3
3
|
import { OP_NET_ABI } from '../opnet/OP_NET_ABI.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const MOTOSWAP_OWNABLE_REENTRANCY_GUARD_ABI = [
|
|
5
|
+
{
|
|
6
|
+
name: 'admin',
|
|
7
|
+
type: BitcoinAbiTypes.Function,
|
|
8
|
+
constant: true,
|
|
9
|
+
inputs: [],
|
|
10
|
+
outputs: [
|
|
11
|
+
{
|
|
12
|
+
name: 'adminAddress',
|
|
13
|
+
type: ABIDataTypes.ADDRESS,
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'changeAdmin',
|
|
19
|
+
type: BitcoinAbiTypes.Function,
|
|
20
|
+
constant: false,
|
|
21
|
+
payable: false,
|
|
22
|
+
inputs: [
|
|
23
|
+
{
|
|
24
|
+
name: 'newAdmin',
|
|
25
|
+
type: ABIDataTypes.ADDRESS,
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
outputs: [
|
|
29
|
+
{
|
|
30
|
+
name: 'success',
|
|
31
|
+
type: ABIDataTypes.BOOL,
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'status',
|
|
37
|
+
inputs: [],
|
|
38
|
+
outputs: [
|
|
39
|
+
{
|
|
40
|
+
name: 'status',
|
|
41
|
+
type: ABIDataTypes.UINT256,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
type: BitcoinAbiTypes.Function,
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
const MotoswapStakingEvents = [
|
|
7
48
|
{
|
|
8
49
|
name: 'RewardTokenAdded',
|
|
9
50
|
type: BitcoinAbiTypes.Event,
|
|
@@ -159,8 +200,7 @@ export const MOTOSWAP_STAKING_ABI = [
|
|
|
159
200
|
inputs: [],
|
|
160
201
|
outputs: [{ name: 'success', type: ABIDataTypes.BOOL }],
|
|
161
202
|
},
|
|
203
|
+
...MOTOSWAP_OWNABLE_REENTRANCY_GUARD_ABI,
|
|
162
204
|
...MotoswapStakingEvents,
|
|
163
205
|
...OP_NET_ABI,
|
|
164
|
-
...REENTRANCY_GUARD_ABI,
|
|
165
|
-
...OWNABLE_ABI,
|
|
166
206
|
];
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { ABIDataTypes } from '@btc-vision/transaction';
|
|
2
|
-
import { BitcoinAbiTypes } from '../../../BitcoinAbiTypes
|
|
3
|
-
import { OP_20_ABI } from '../opnet/OP_20_ABI
|
|
4
|
-
const
|
|
2
|
+
import { BitcoinAbiTypes } from '../../../BitcoinAbiTypes';
|
|
3
|
+
import { OP_20_ABI } from '../opnet/OP_20_ABI';
|
|
4
|
+
export const MOTO_ABI = [
|
|
5
5
|
{
|
|
6
6
|
name: 'admin',
|
|
7
7
|
type: BitcoinAbiTypes.Function,
|
|
8
|
-
constant: true,
|
|
9
8
|
inputs: [],
|
|
10
9
|
outputs: [
|
|
11
10
|
{
|
|
12
|
-
name: '
|
|
11
|
+
name: 'adminAddress',
|
|
13
12
|
type: ABIDataTypes.ADDRESS,
|
|
14
13
|
},
|
|
15
14
|
],
|
|
@@ -17,11 +16,9 @@ const ADMINISTERED_OP_20_ABI = [
|
|
|
17
16
|
{
|
|
18
17
|
name: 'changeAdmin',
|
|
19
18
|
type: BitcoinAbiTypes.Function,
|
|
20
|
-
constant: false,
|
|
21
|
-
payable: false,
|
|
22
19
|
inputs: [
|
|
23
20
|
{
|
|
24
|
-
name: '
|
|
21
|
+
name: 'to',
|
|
25
22
|
type: ABIDataTypes.ADDRESS,
|
|
26
23
|
},
|
|
27
24
|
],
|
|
@@ -35,8 +32,6 @@ const ADMINISTERED_OP_20_ABI = [
|
|
|
35
32
|
{
|
|
36
33
|
name: 'adminMint',
|
|
37
34
|
type: BitcoinAbiTypes.Function,
|
|
38
|
-
constant: false,
|
|
39
|
-
payable: false,
|
|
40
35
|
inputs: [
|
|
41
36
|
{
|
|
42
37
|
name: 'to',
|
|
@@ -57,8 +52,6 @@ const ADMINISTERED_OP_20_ABI = [
|
|
|
57
52
|
{
|
|
58
53
|
name: 'adminBurn',
|
|
59
54
|
type: BitcoinAbiTypes.Function,
|
|
60
|
-
constant: false,
|
|
61
|
-
payable: false,
|
|
62
55
|
inputs: [
|
|
63
56
|
{
|
|
64
57
|
name: 'from',
|
|
@@ -78,4 +71,3 @@ const ADMINISTERED_OP_20_ABI = [
|
|
|
78
71
|
},
|
|
79
72
|
...OP_20_ABI,
|
|
80
73
|
];
|
|
81
|
-
export default ADMINISTERED_OP_20_ABI;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ABIDataTypes } from '@btc-vision/transaction';
|
|
2
2
|
import { BitcoinAbiTypes } from '../../../BitcoinAbiTypes.js';
|
|
3
3
|
import { OP_NET_ABI } from '../opnet/OP_NET_ABI.js';
|
|
4
|
-
|
|
4
|
+
const NativeSwapEvents = [
|
|
5
5
|
{
|
|
6
6
|
name: 'LiquidityAdded',
|
|
7
7
|
values: [
|
|
@@ -59,9 +59,23 @@ export const NativeSwapEvents = [
|
|
|
59
59
|
values: [
|
|
60
60
|
{ name: 'depositAddress', type: ABIDataTypes.STRING },
|
|
61
61
|
{ name: 'amount', type: ABIDataTypes.UINT128 },
|
|
62
|
+
{ name: 'providerId', type: ABIDataTypes.UINT256 },
|
|
63
|
+
],
|
|
64
|
+
type: BitcoinAbiTypes.Event,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'ActivateProvider',
|
|
68
|
+
values: [
|
|
69
|
+
{ name: 'providerId', type: ABIDataTypes.UINT256 },
|
|
70
|
+
{ name: 'listingAmount', type: ABIDataTypes.UINT128 },
|
|
62
71
|
],
|
|
63
72
|
type: BitcoinAbiTypes.Event,
|
|
64
73
|
},
|
|
74
|
+
{
|
|
75
|
+
name: 'FulfilledProvider',
|
|
76
|
+
values: [{ name: 'providerId', type: ABIDataTypes.UINT256 }],
|
|
77
|
+
type: BitcoinAbiTypes.Event,
|
|
78
|
+
},
|
|
65
79
|
];
|
|
66
80
|
export const NativeSwapAbi = [
|
|
67
81
|
{
|
|
@@ -2,36 +2,25 @@ import { ABIDataTypes } from '@btc-vision/transaction';
|
|
|
2
2
|
import { BitcoinAbiTypes } from '../../../BitcoinAbiTypes.js';
|
|
3
3
|
export const OP_NET_ABI = [
|
|
4
4
|
{
|
|
5
|
-
name: '
|
|
6
|
-
constant: true,
|
|
7
|
-
outputs: [
|
|
8
|
-
{
|
|
9
|
-
name: 'owner',
|
|
10
|
-
type: ABIDataTypes.ADDRESS,
|
|
11
|
-
},
|
|
12
|
-
],
|
|
5
|
+
name: 'address',
|
|
13
6
|
type: BitcoinAbiTypes.Function,
|
|
14
|
-
|
|
15
|
-
{
|
|
16
|
-
name: 'deployer',
|
|
17
|
-
constant: true,
|
|
7
|
+
inputs: [],
|
|
18
8
|
outputs: [
|
|
19
9
|
{
|
|
20
|
-
name: '
|
|
10
|
+
name: 'address',
|
|
21
11
|
type: ABIDataTypes.ADDRESS,
|
|
22
12
|
},
|
|
23
13
|
],
|
|
24
|
-
type: BitcoinAbiTypes.Function,
|
|
25
14
|
},
|
|
26
15
|
{
|
|
27
|
-
name: '
|
|
28
|
-
|
|
16
|
+
name: 'contractDeployer',
|
|
17
|
+
type: BitcoinAbiTypes.Function,
|
|
18
|
+
inputs: [],
|
|
29
19
|
outputs: [
|
|
30
20
|
{
|
|
31
|
-
name: '
|
|
21
|
+
name: 'contractDeployer',
|
|
32
22
|
type: ABIDataTypes.ADDRESS,
|
|
33
23
|
},
|
|
34
24
|
],
|
|
35
|
-
type: BitcoinAbiTypes.Function,
|
|
36
25
|
},
|
|
37
26
|
];
|
|
@@ -421,8 +421,8 @@ export class IBaseContract {
|
|
|
421
421
|
const gasParameters = await this.currentGasParameters();
|
|
422
422
|
const gasPerSat = gasParameters.gasPerSat;
|
|
423
423
|
const exactGas = ((gas / 1000000n) * gasPerSat) / 1000000n;
|
|
424
|
-
const extraGas = (exactGas *
|
|
425
|
-
return this.max(exactGas + extraGas, 330n);
|
|
424
|
+
const extraGas = (exactGas * 25n) / 100n;
|
|
425
|
+
return this.max(exactGas + extraGas, 330n) + 1n;
|
|
426
426
|
}
|
|
427
427
|
max(a, b) {
|
|
428
428
|
return a > b ? a : b;
|
package/build/opnet.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ export * from './transactions/decoders/InteractionTransaction.js';
|
|
|
6
6
|
export * from './transactions/metadata/TransactionInput.js';
|
|
7
7
|
export * from './transactions/metadata/TransactionOutput.js';
|
|
8
8
|
export * from './transactions/Transaction.js';
|
|
9
|
+
export * from './transactions/interfaces/ProofOfWorkChallenge.js';
|
|
9
10
|
export * from './transactions/interfaces/transactions/ICommonTransaction.js';
|
|
10
11
|
export * from './transactions/interfaces/transactions/IDeploymentTransaction.js';
|
|
11
12
|
export * from './transactions/interfaces/transactions/IInteractionTransaction.js';
|
|
12
|
-
export * from './transactions/interfaces/ProofOfWorkChallenge.js';
|
|
13
13
|
export * from './providers/AbstractRpcProvider.js';
|
|
14
14
|
export * from './providers/JSONRpcProvider.js';
|
|
15
15
|
export * from './providers/WebsocketRpcProvider.js';
|
|
@@ -27,8 +27,8 @@ export * from './contracts/ContractData.js';
|
|
|
27
27
|
export * from './contracts/interfaces/IAccessList.js';
|
|
28
28
|
export * from './contracts/interfaces/ICallResult.js';
|
|
29
29
|
export * from './contracts/interfaces/IContract.js';
|
|
30
|
-
export * from './contracts/OPNetEvent.js';
|
|
31
30
|
export * from './contracts/interfaces/SimulatedTransaction.js';
|
|
31
|
+
export * from './contracts/OPNetEvent.js';
|
|
32
32
|
export * from './contracts/TypeToStr.js';
|
|
33
33
|
export * from './abi/BitcoinAbiTypes.js';
|
|
34
34
|
export * from './abi/BitcoinInterface.js';
|
|
@@ -51,23 +51,21 @@ export * from './common/CommonTypes.js';
|
|
|
51
51
|
export * from './bitcoin/interfaces/IUTXO.js';
|
|
52
52
|
export * from './bitcoin/UTXOs.js';
|
|
53
53
|
export { ABIDataTypes } from '@btc-vision/transaction';
|
|
54
|
+
export * from './abi/shared/json/generic/STAKING_ABI.js';
|
|
55
|
+
export * from './abi/shared/json/motoswap/MOTO_ABI.js';
|
|
56
|
+
export * from './abi/shared/json/motoswap/MOTOCHEF_ABI.js';
|
|
54
57
|
export * from './abi/shared/json/motoswap/MOTOSWAP_FACTORY_ABI.js';
|
|
55
58
|
export * from './abi/shared/json/motoswap/MOTOSWAP_POOL_ABI.js';
|
|
56
59
|
export * from './abi/shared/json/motoswap/MOTOSWAP_ROUTER_ABI.js';
|
|
57
|
-
export * from './abi/shared/json/motoswap/
|
|
58
|
-
export * from './abi/shared/json/motoswap/ADMINISTERD_OP_20_ABI.js';
|
|
60
|
+
export * from './abi/shared/json/motoswap/NATIVE_SWAP_ABI.js';
|
|
59
61
|
export * from './abi/shared/json/opnet/OP_20_ABI.js';
|
|
60
62
|
export * from './abi/shared/json/opnet/OP_NET_ABI.js';
|
|
61
|
-
export * from './abi/shared/
|
|
62
|
-
export * from './abi/shared/
|
|
63
|
-
export * from './abi/shared/
|
|
63
|
+
export * from './abi/shared/interfaces/generic/IStackingContract.js';
|
|
64
|
+
export * from './abi/shared/interfaces/motoswap/IMoto.js';
|
|
65
|
+
export * from './abi/shared/interfaces/motoswap/IMotoChef.js';
|
|
64
66
|
export * from './abi/shared/interfaces/motoswap/IMotoswapFactoryContract.js';
|
|
65
67
|
export * from './abi/shared/interfaces/motoswap/IMotoswapPoolContract.js';
|
|
66
68
|
export * from './abi/shared/interfaces/motoswap/IMotoswapRouterContract.js';
|
|
67
|
-
export * from './abi/shared/interfaces/motoswap/
|
|
68
|
-
export * from './abi/shared/interfaces/motoswap/IAdministeredOP20.js';
|
|
69
|
+
export * from './abi/shared/interfaces/motoswap/INativeSwapContract.js';
|
|
69
70
|
export * from './abi/shared/interfaces/opnet/IOP_20Contract.js';
|
|
70
71
|
export * from './abi/shared/interfaces/opnet/IOP_NETContract.js';
|
|
71
|
-
export * from './abi/shared/interfaces/generic/IStackingContract.js';
|
|
72
|
-
export * from './abi/shared/interfaces/tests/IWBTCContract.js';
|
|
73
|
-
export * from './abi/shared/interfaces/motoswap/INativeSwapContract.js';
|
package/build/opnet.js
CHANGED
|
@@ -6,10 +6,10 @@ export * from './transactions/decoders/InteractionTransaction.js';
|
|
|
6
6
|
export * from './transactions/metadata/TransactionInput.js';
|
|
7
7
|
export * from './transactions/metadata/TransactionOutput.js';
|
|
8
8
|
export * from './transactions/Transaction.js';
|
|
9
|
+
export * from './transactions/interfaces/ProofOfWorkChallenge.js';
|
|
9
10
|
export * from './transactions/interfaces/transactions/ICommonTransaction.js';
|
|
10
11
|
export * from './transactions/interfaces/transactions/IDeploymentTransaction.js';
|
|
11
12
|
export * from './transactions/interfaces/transactions/IInteractionTransaction.js';
|
|
12
|
-
export * from './transactions/interfaces/ProofOfWorkChallenge.js';
|
|
13
13
|
export * from './providers/AbstractRpcProvider.js';
|
|
14
14
|
export * from './providers/JSONRpcProvider.js';
|
|
15
15
|
export * from './providers/WebsocketRpcProvider.js';
|
|
@@ -27,8 +27,8 @@ export * from './contracts/ContractData.js';
|
|
|
27
27
|
export * from './contracts/interfaces/IAccessList.js';
|
|
28
28
|
export * from './contracts/interfaces/ICallResult.js';
|
|
29
29
|
export * from './contracts/interfaces/IContract.js';
|
|
30
|
-
export * from './contracts/OPNetEvent.js';
|
|
31
30
|
export * from './contracts/interfaces/SimulatedTransaction.js';
|
|
31
|
+
export * from './contracts/OPNetEvent.js';
|
|
32
32
|
export * from './contracts/TypeToStr.js';
|
|
33
33
|
export * from './abi/BitcoinAbiTypes.js';
|
|
34
34
|
export * from './abi/BitcoinInterface.js';
|
|
@@ -51,23 +51,21 @@ export * from './common/CommonTypes.js';
|
|
|
51
51
|
export * from './bitcoin/interfaces/IUTXO.js';
|
|
52
52
|
export * from './bitcoin/UTXOs.js';
|
|
53
53
|
export { ABIDataTypes } from '@btc-vision/transaction';
|
|
54
|
+
export * from './abi/shared/json/generic/STAKING_ABI.js';
|
|
55
|
+
export * from './abi/shared/json/motoswap/MOTO_ABI.js';
|
|
56
|
+
export * from './abi/shared/json/motoswap/MOTOCHEF_ABI.js';
|
|
54
57
|
export * from './abi/shared/json/motoswap/MOTOSWAP_FACTORY_ABI.js';
|
|
55
58
|
export * from './abi/shared/json/motoswap/MOTOSWAP_POOL_ABI.js';
|
|
56
59
|
export * from './abi/shared/json/motoswap/MOTOSWAP_ROUTER_ABI.js';
|
|
57
|
-
export * from './abi/shared/json/motoswap/
|
|
58
|
-
export * from './abi/shared/json/motoswap/ADMINISTERD_OP_20_ABI.js';
|
|
60
|
+
export * from './abi/shared/json/motoswap/NATIVE_SWAP_ABI.js';
|
|
59
61
|
export * from './abi/shared/json/opnet/OP_20_ABI.js';
|
|
60
62
|
export * from './abi/shared/json/opnet/OP_NET_ABI.js';
|
|
61
|
-
export * from './abi/shared/
|
|
62
|
-
export * from './abi/shared/
|
|
63
|
-
export * from './abi/shared/
|
|
63
|
+
export * from './abi/shared/interfaces/generic/IStackingContract.js';
|
|
64
|
+
export * from './abi/shared/interfaces/motoswap/IMoto.js';
|
|
65
|
+
export * from './abi/shared/interfaces/motoswap/IMotoChef.js';
|
|
64
66
|
export * from './abi/shared/interfaces/motoswap/IMotoswapFactoryContract.js';
|
|
65
67
|
export * from './abi/shared/interfaces/motoswap/IMotoswapPoolContract.js';
|
|
66
68
|
export * from './abi/shared/interfaces/motoswap/IMotoswapRouterContract.js';
|
|
67
|
-
export * from './abi/shared/interfaces/motoswap/
|
|
68
|
-
export * from './abi/shared/interfaces/motoswap/IAdministeredOP20.js';
|
|
69
|
+
export * from './abi/shared/interfaces/motoswap/INativeSwapContract.js';
|
|
69
70
|
export * from './abi/shared/interfaces/opnet/IOP_20Contract.js';
|
|
70
71
|
export * from './abi/shared/interfaces/opnet/IOP_NETContract.js';
|
|
71
|
-
export * from './abi/shared/interfaces/generic/IStackingContract.js';
|
|
72
|
-
export * from './abi/shared/interfaces/tests/IWBTCContract.js';
|
|
73
|
-
export * from './abi/shared/interfaces/motoswap/INativeSwapContract.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AbstractRpcProvider } from './AbstractRpcProvider.js';
|
|
2
|
+
import fetch from '../fetch/fetch.js';
|
|
2
3
|
export class JSONRpcProvider extends AbstractRpcProvider {
|
|
3
4
|
timeout;
|
|
4
5
|
url;
|
|
@@ -15,8 +16,12 @@ export class JSONRpcProvider extends AbstractRpcProvider {
|
|
|
15
16
|
method: 'POST',
|
|
16
17
|
headers: {
|
|
17
18
|
'Content-Type': 'application/json',
|
|
18
|
-
Connection: 'close',
|
|
19
19
|
'User-Agent': 'OPNET/1.0',
|
|
20
|
+
'Accept-Encoding': 'gzip, deflate, br',
|
|
21
|
+
Accept: 'application/json',
|
|
22
|
+
'Accept-Charset': 'utf-8',
|
|
23
|
+
'Accept-Language': 'en-US',
|
|
24
|
+
Connection: 'Keep-Alive',
|
|
20
25
|
},
|
|
21
26
|
body: JSON.stringify(payload),
|
|
22
27
|
timeout: this.timeout,
|
|
@@ -35,6 +40,7 @@ export class JSONRpcProvider extends AbstractRpcProvider {
|
|
|
35
40
|
return [fetchedData];
|
|
36
41
|
}
|
|
37
42
|
catch (e) {
|
|
43
|
+
console.log(e);
|
|
38
44
|
const error = e;
|
|
39
45
|
if (error.name === 'AbortError') {
|
|
40
46
|
throw new Error(`Request timed out after ${this.timeout}ms`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opnet",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.4",
|
|
5
5
|
"author": "OP_NET",
|
|
6
6
|
"description": "The perfect library for building Bitcoin-based applications.",
|
|
7
7
|
"engines": {
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"./build/index.js": "./browser/index.js",
|
|
26
26
|
"Buffer": "buffer",
|
|
27
27
|
"crypto": "./src/crypto/crypto-browser.js",
|
|
28
|
-
"stream": "stream-browserify"
|
|
28
|
+
"stream": "stream-browserify",
|
|
29
|
+
"undici": "./src/fetch/fetch-browser.js"
|
|
29
30
|
},
|
|
30
31
|
"homepage": "https://opnet.org",
|
|
31
32
|
"keywords": [
|
|
@@ -102,11 +103,12 @@
|
|
|
102
103
|
"@bitcoinerlab/secp256k1": "^1.2.0",
|
|
103
104
|
"@btc-vision/bitcoin": "^6.3.6",
|
|
104
105
|
"@btc-vision/bitcoin-rpc": "^1.0.1",
|
|
105
|
-
"@btc-vision/transaction": "^1.3.
|
|
106
|
+
"@btc-vision/transaction": "^1.3.2",
|
|
106
107
|
"@noble/hashes": "^1.7.1",
|
|
107
108
|
"bignumber.js": "^9.1.2",
|
|
108
109
|
"buffer": "^6.0.3",
|
|
109
110
|
"ecpair": "^2.1.0",
|
|
110
|
-
"tiny-secp256k1": "^2.2.3"
|
|
111
|
+
"tiny-secp256k1": "^2.2.3",
|
|
112
|
+
"undici": "^7.5.0"
|
|
111
113
|
}
|
|
112
114
|
}
|
package/src/_version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.3.
|
|
1
|
+
export const version = '1.3.4';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Address } from '@btc-vision/transaction';
|
|
2
|
-
import { IOP_20Contract } from '../opnet/IOP_20Contract';
|
|
3
2
|
import { CallResult } from '../../../../opnet';
|
|
3
|
+
import { IOP_20Contract } from '../opnet/IOP_20Contract';
|
|
4
4
|
|
|
5
5
|
export type Admin = CallResult<{
|
|
6
6
|
ADDRESS: Address;
|
|
@@ -19,12 +19,12 @@ export type AdminBurn = CallResult<{
|
|
|
19
19
|
}>;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* @description This interface represents the
|
|
23
|
-
* @interface
|
|
22
|
+
* @description This interface represents the IMoto contract. It extends the IOP_20Contract and adds the ability to have an admin address that can mint and burn tokens.
|
|
23
|
+
* @interface IMoto
|
|
24
24
|
* @extends {IOwnableReentrancyGuardContract}
|
|
25
25
|
* @cathegory Contracts
|
|
26
26
|
*/
|
|
27
|
-
export interface
|
|
27
|
+
export interface IMoto extends IOP_20Contract {
|
|
28
28
|
/**
|
|
29
29
|
* @description Gets the current admin address.
|
|
30
30
|
* @returns {Admin}
|