opnet 1.2.1 → 1.2.3
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 +21 -0
- package/browser/abi/shared/interfaces/motoswap/IMotoChefContract.d.ts +121 -0
- package/browser/abi/shared/interfaces/motoswap/INativeSwapContract.d.ts +71 -0
- package/browser/abi/shared/interfaces/motoswap/IOwnableContract.d.ts +12 -0
- package/browser/abi/shared/interfaces/motoswap/IOwnableReentrancyGuardContract.d.ts +13 -0
- package/browser/abi/shared/interfaces/motoswap/IReentrancyGuardContract.d.ts +7 -0
- package/browser/abi/shared/json/motoswap/ADMINISTERD_OP_20_ABI.d.ts +3 -0
- package/browser/abi/shared/json/motoswap/MOTOSWAP_MOTOCHEF_ABI.d.ts +4 -0
- package/browser/abi/shared/json/motoswap/NATIVE_SWAP_ABI.d.ts +3 -0
- package/browser/abi/shared/json/motoswap/OWNABLE_ABI.d.ts +3 -0
- package/browser/abi/shared/json/motoswap/REENTRANCY_GUARD_ABI.d.ts +2 -0
- package/browser/bitcoin/UTXOs.d.ts +1 -1
- package/browser/bitcoin/interfaces/IUTXO.d.ts +1 -1
- package/browser/block/Block.d.ts +2 -1
- package/browser/contracts/CallResult.d.ts +1 -0
- package/browser/index.js +1 -1
- package/browser/opnet.d.ts +7 -2
- package/browser/providers/AbstractRpcProvider.d.ts +1 -1
- package/browser/transactions/Transaction.d.ts +5 -1
- package/browser/transactions/TransactionParser.d.ts +3 -2
- package/browser/transactions/decoders/DeploymentTransaction.d.ts +2 -1
- package/browser/transactions/decoders/GenericTransaction.d.ts +2 -1
- package/browser/transactions/decoders/InteractionTransaction.d.ts +2 -1
- package/browser/transactions/interfaces/ITransaction.d.ts +2 -0
- package/browser/transactions/interfaces/ProofOfWorkChallenge.d.ts +12 -0
- package/browser/transactions/interfaces/transactions/ICommonTransaction.d.ts +2 -0
- package/browser/transactions/metadata/TransactionInput.d.ts +1 -1
- package/browser/transactions/metadata/TransactionOutput.d.ts +1 -1
- package/browser/transactions/metadata/TransactionReceipt.d.ts +2 -1
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/abi/shared/interfaces/motoswap/IAdministeredOP20.d.ts +21 -0
- package/build/abi/shared/interfaces/motoswap/IMotoChefContract.d.ts +121 -0
- package/build/abi/shared/interfaces/motoswap/IMotoChefContract.js +1 -0
- package/build/abi/shared/interfaces/motoswap/INativeSwapContract.d.ts +71 -0
- package/build/abi/shared/interfaces/motoswap/INativeSwapContract.js +1 -0
- package/build/abi/shared/interfaces/motoswap/IOwnableContract.d.ts +12 -0
- package/build/abi/shared/interfaces/motoswap/IOwnableContract.js +1 -0
- package/build/abi/shared/interfaces/motoswap/IOwnableReentrancyGuardContract.d.ts +13 -0
- package/build/abi/shared/interfaces/motoswap/IOwnableReentrancyGuardContract.js +1 -0
- package/build/abi/shared/interfaces/motoswap/IReentrancyGuardContract.d.ts +7 -0
- package/build/abi/shared/interfaces/motoswap/IReentrancyGuardContract.js +1 -0
- package/build/abi/shared/json/motoswap/ADMINISTERD_OP_20_ABI.d.ts +3 -0
- package/build/abi/shared/json/motoswap/ADMINISTERD_OP_20_ABI.js +81 -0
- package/build/abi/shared/json/motoswap/MOTOSWAP_MOTOCHEF_ABI.d.ts +4 -0
- package/build/abi/shared/json/motoswap/MOTOSWAP_MOTOCHEF_ABI.js +443 -0
- package/build/abi/shared/json/motoswap/NATIVE_SWAP_ABI.d.ts +3 -0
- package/build/abi/shared/json/motoswap/{EWMA_ABI.js → NATIVE_SWAP_ABI.js} +208 -37
- package/build/abi/shared/json/motoswap/OWNABLE_ABI.d.ts +3 -0
- package/build/abi/shared/json/motoswap/OWNABLE_ABI.js +35 -0
- package/build/abi/shared/json/motoswap/REENTRANCY_GUARD_ABI.d.ts +2 -0
- package/build/abi/shared/json/motoswap/REENTRANCY_GUARD_ABI.js +15 -0
- package/build/bitcoin/UTXOs.d.ts +1 -1
- package/build/bitcoin/interfaces/IUTXO.d.ts +1 -1
- package/build/block/Block.d.ts +2 -1
- package/build/block/Block.js +2 -2
- package/build/contracts/CallResult.d.ts +1 -0
- package/build/contracts/CallResult.js +7 -3
- package/build/opnet.d.ts +7 -2
- package/build/opnet.js +7 -2
- package/build/providers/AbstractRpcProvider.d.ts +1 -1
- package/build/providers/AbstractRpcProvider.js +4 -4
- package/build/transactions/Transaction.d.ts +5 -1
- package/build/transactions/Transaction.js +14 -2
- package/build/transactions/TransactionParser.d.ts +3 -2
- package/build/transactions/TransactionParser.js +6 -6
- package/build/transactions/decoders/DeploymentTransaction.d.ts +2 -1
- package/build/transactions/decoders/DeploymentTransaction.js +2 -2
- package/build/transactions/decoders/GenericTransaction.d.ts +2 -1
- package/build/transactions/decoders/GenericTransaction.js +2 -2
- package/build/transactions/decoders/InteractionTransaction.d.ts +2 -1
- package/build/transactions/decoders/InteractionTransaction.js +2 -2
- package/build/transactions/interfaces/ITransaction.d.ts +2 -0
- package/build/transactions/interfaces/ProofOfWorkChallenge.d.ts +12 -0
- package/build/transactions/interfaces/ProofOfWorkChallenge.js +1 -0
- package/build/transactions/interfaces/transactions/ICommonTransaction.d.ts +2 -0
- package/build/transactions/metadata/TransactionInput.d.ts +1 -1
- package/build/transactions/metadata/TransactionOutput.d.ts +1 -1
- package/build/transactions/metadata/TransactionReceipt.d.ts +2 -1
- package/build/transactions/metadata/TransactionReceipt.js +12 -8
- package/package.json +14 -14
- package/src/_version.ts +1 -1
- package/src/abi/shared/interfaces/motoswap/IAdministeredOP20.ts +56 -0
- package/src/abi/shared/interfaces/motoswap/IMotoChefContract.ts +348 -0
- package/src/abi/shared/interfaces/motoswap/INativeSwapContract.ts +267 -0
- package/src/abi/shared/interfaces/motoswap/IOwnableContract.ts +32 -0
- package/src/abi/shared/interfaces/motoswap/IOwnableReentrancyGuardContract.ts +33 -0
- package/src/abi/shared/interfaces/motoswap/IReentrancyGuardContract.ts +18 -0
- package/src/abi/shared/json/motoswap/ADMINISTERD_OP_20_ABI.ts +85 -0
- package/src/abi/shared/json/motoswap/MOTOSWAP_MOTOCHEF_ABI.ts +455 -0
- package/src/abi/shared/json/motoswap/{EWMA_ABI.ts → NATIVE_SWAP_ABI.ts} +252 -37
- package/src/abi/shared/json/motoswap/OWNABLE_ABI.ts +38 -0
- package/src/abi/shared/json/motoswap/REENTRANCY_GUARD_ABI.ts +20 -0
- package/src/bitcoin/UTXOs.ts +2 -2
- package/src/bitcoin/interfaces/IUTXO.ts +1 -1
- package/src/block/Block.ts +3 -1
- package/src/contracts/CallResult.ts +9 -6
- package/src/opnet.ts +7 -2
- package/src/providers/AbstractRpcProvider.ts +5 -5
- package/src/providers/JSONRpcProvider.ts +1 -1
- package/src/transactions/Transaction.ts +30 -8
- package/src/transactions/TransactionParser.ts +7 -8
- package/src/transactions/decoders/DeploymentTransaction.ts +3 -2
- package/src/transactions/decoders/GenericTransaction.ts +3 -2
- package/src/transactions/decoders/InteractionTransaction.ts +3 -2
- package/src/transactions/interfaces/ITransaction.ts +6 -0
- package/src/transactions/interfaces/ProofOfWorkChallenge.ts +13 -0
- package/src/transactions/interfaces/transactions/ICommonTransaction.ts +6 -0
- package/src/transactions/metadata/TransactionInput.ts +1 -1
- package/src/transactions/metadata/TransactionOutput.ts +1 -1
- package/src/transactions/metadata/TransactionReceipt.ts +23 -11
- package/browser/abi/shared/interfaces/motoswap/IEwmaContract.d.ts +0 -46
- package/browser/abi/shared/json/motoswap/EWMA_ABI.d.ts +0 -3
- package/build/abi/shared/interfaces/motoswap/IEwmaContract.d.ts +0 -46
- package/build/abi/shared/json/motoswap/EWMA_ABI.d.ts +0 -3
- package/src/abi/shared/interfaces/motoswap/IEwmaContract.ts +0 -188
- /package/build/abi/shared/interfaces/motoswap/{IEwmaContract.js → IAdministeredOP20.js} +0 -0
package/browser/opnet.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './transactions/Transaction.js';
|
|
|
9
9
|
export * from './transactions/interfaces/transactions/ICommonTransaction.js';
|
|
10
10
|
export * from './transactions/interfaces/transactions/IDeploymentTransaction.js';
|
|
11
11
|
export * from './transactions/interfaces/transactions/IInteractionTransaction.js';
|
|
12
|
+
export * from './transactions/interfaces/ProofOfWorkChallenge.js';
|
|
12
13
|
export * from './providers/AbstractRpcProvider.js';
|
|
13
14
|
export * from './providers/JSONRpcProvider.js';
|
|
14
15
|
export * from './providers/WebsocketRpcProvider.js';
|
|
@@ -52,16 +53,20 @@ export { ABIDataTypes } from '@btc-vision/transaction';
|
|
|
52
53
|
export * from './abi/shared/json/motoswap/MOTOSWAP_FACTORY_ABI.js';
|
|
53
54
|
export * from './abi/shared/json/motoswap/MOTOSWAP_POOL_ABI.js';
|
|
54
55
|
export * from './abi/shared/json/motoswap/MOTOSWAP_ROUTER_ABI.js';
|
|
56
|
+
export * from './abi/shared/json/motoswap/MOTOSWAP_MOTOCHEF_ABI.js';
|
|
57
|
+
export * from './abi/shared/json/motoswap/ADMINISTERD_OP_20_ABI.js';
|
|
55
58
|
export * from './abi/shared/json/opnet/OP_20_ABI.js';
|
|
56
59
|
export * from './abi/shared/json/opnet/OP_NET_ABI.js';
|
|
57
60
|
export * from './abi/shared/json/generic/STAKING_ABI.js';
|
|
58
61
|
export * from './abi/shared/json/tests/WBTC_ABI.js';
|
|
59
|
-
export * from './abi/shared/json/motoswap/
|
|
62
|
+
export * from './abi/shared/json/motoswap/NATIVE_SWAP_ABI.js';
|
|
60
63
|
export * from './abi/shared/interfaces/motoswap/IMotoswapFactoryContract.js';
|
|
61
64
|
export * from './abi/shared/interfaces/motoswap/IMotoswapPoolContract.js';
|
|
62
65
|
export * from './abi/shared/interfaces/motoswap/IMotoswapRouterContract.js';
|
|
66
|
+
export * from './abi/shared/interfaces/motoswap/IMotoChefContract.js';
|
|
67
|
+
export * from './abi/shared/interfaces/motoswap/IAdministeredOP20.js';
|
|
63
68
|
export * from './abi/shared/interfaces/opnet/IOP_20Contract.js';
|
|
64
69
|
export * from './abi/shared/interfaces/opnet/IOP_NETContract.js';
|
|
65
70
|
export * from './abi/shared/interfaces/generic/IStackingContract.js';
|
|
66
71
|
export * from './abi/shared/interfaces/tests/IWBTCContract.js';
|
|
67
|
-
export * from './abi/shared/interfaces/motoswap/
|
|
72
|
+
export * from './abi/shared/interfaces/motoswap/INativeSwapContract.js';
|
|
@@ -21,7 +21,7 @@ import { JsonRpcCallResult, JsonRpcResult } from './interfaces/JSONRpcResult.js'
|
|
|
21
21
|
import { AddressesInfo } from './interfaces/PublicKeyInfo.js';
|
|
22
22
|
import { ReorgInformation } from './interfaces/ReorgInformation.js';
|
|
23
23
|
export declare abstract class AbstractRpcProvider {
|
|
24
|
-
|
|
24
|
+
readonly network: Network;
|
|
25
25
|
private nextId;
|
|
26
26
|
private chainId;
|
|
27
27
|
protected constructor(network: Network);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { Network } from '@btc-vision/bitcoin';
|
|
1
2
|
import { BigNumberish } from '../common/CommonTypes.js';
|
|
2
3
|
import { OPNetTransactionTypes } from '../interfaces/opnet/OPNetTransactionTypes.js';
|
|
3
4
|
import { ITransactionBase } from './interfaces/ITransaction.js';
|
|
5
|
+
import { ProofOfWorkChallenge } from './interfaces/ProofOfWorkChallenge.js';
|
|
4
6
|
import { TransactionInput } from './metadata/TransactionInput.js';
|
|
5
7
|
import { TransactionOutput } from './metadata/TransactionOutput.js';
|
|
6
8
|
import { TransactionReceipt } from './metadata/TransactionReceipt.js';
|
|
@@ -13,5 +15,7 @@ export declare abstract class TransactionBase<T extends OPNetTransactionTypes> e
|
|
|
13
15
|
readonly outputs: TransactionOutput[];
|
|
14
16
|
readonly OPNetType: T;
|
|
15
17
|
readonly gasUsed: bigint;
|
|
16
|
-
|
|
18
|
+
readonly pow?: ProofOfWorkChallenge;
|
|
19
|
+
protected constructor(transaction: ITransactionBase<T>, network: Network);
|
|
20
|
+
private decodeProofOfWorkChallenge;
|
|
17
21
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { Network } from '@btc-vision/bitcoin';
|
|
1
2
|
import { OPNetTransactionTypes } from '../interfaces/opnet/OPNetTransactionTypes.js';
|
|
2
3
|
import { ITransaction } from './interfaces/ITransaction.js';
|
|
3
4
|
import { TransactionBase } from './Transaction.js';
|
|
4
5
|
export declare class TransactionParser {
|
|
5
|
-
static parseTransactions(transactions: ITransaction[]): TransactionBase<OPNetTransactionTypes>[];
|
|
6
|
-
static parseTransaction(transaction: ITransaction): TransactionBase<OPNetTransactionTypes>;
|
|
6
|
+
static parseTransactions(transactions: ITransaction[], network: Network): TransactionBase<OPNetTransactionTypes>[];
|
|
7
|
+
static parseTransaction(transaction: ITransaction, network: Network): TransactionBase<OPNetTransactionTypes>;
|
|
7
8
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Network } from '@btc-vision/bitcoin';
|
|
1
2
|
import { Address } from '@btc-vision/transaction';
|
|
2
3
|
import { OPNetTransactionTypes } from '../../interfaces/opnet/OPNetTransactionTypes.js';
|
|
3
4
|
import { IDeploymentTransaction } from '../interfaces/transactions/IDeploymentTransaction.js';
|
|
@@ -12,5 +13,5 @@ export declare class DeploymentTransaction extends TransactionBase<OPNetTransact
|
|
|
12
13
|
readonly contractSeed?: Buffer;
|
|
13
14
|
readonly contractSaltHash?: Buffer;
|
|
14
15
|
readonly from?: Address;
|
|
15
|
-
constructor(transaction: IDeploymentTransaction);
|
|
16
|
+
constructor(transaction: IDeploymentTransaction, network: Network);
|
|
16
17
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { Network } from '@btc-vision/bitcoin';
|
|
1
2
|
import { OPNetTransactionTypes } from '../../interfaces/opnet/OPNetTransactionTypes.js';
|
|
2
3
|
import { IGenericTransaction } from '../interfaces/ITransaction.js';
|
|
3
4
|
import { TransactionBase } from '../Transaction.js';
|
|
4
5
|
export declare class GenericTransaction extends TransactionBase<OPNetTransactionTypes.Generic> implements IGenericTransaction {
|
|
5
|
-
constructor(transaction: IGenericTransaction);
|
|
6
|
+
constructor(transaction: IGenericTransaction, network: Network);
|
|
6
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Network } from '@btc-vision/bitcoin';
|
|
1
2
|
import { Address } from '@btc-vision/transaction';
|
|
2
3
|
import { Buffer } from 'buffer';
|
|
3
4
|
import { InteractionType } from '../../interfaces/opnet/OPNetTransactionTypes.js';
|
|
@@ -12,5 +13,5 @@ export declare class InteractionTransaction extends TransactionBase<InteractionT
|
|
|
12
13
|
readonly from?: Address;
|
|
13
14
|
readonly contractAddress?: string;
|
|
14
15
|
readonly contractTweakedPublicKey: Address;
|
|
15
|
-
constructor(transaction: IInteractionTransaction);
|
|
16
|
+
constructor(transaction: IInteractionTransaction, network: Network);
|
|
16
17
|
}
|
|
@@ -3,6 +3,7 @@ import { OPNetTransactionTypes } from '../../interfaces/opnet/OPNetTransactionTy
|
|
|
3
3
|
import { ITransactionInput, TransactionInput } from '../metadata/TransactionInput.js';
|
|
4
4
|
import { ITransactionOutput, TransactionOutput } from '../metadata/TransactionOutput.js';
|
|
5
5
|
import { ITransactionReceipt } from './ITransactionReceipt.js';
|
|
6
|
+
import { ProofOfWorkChallenge, RawProofOfWorkChallenge } from './ProofOfWorkChallenge.js';
|
|
6
7
|
import { IDeploymentTransaction } from './transactions/IDeploymentTransaction.js';
|
|
7
8
|
import { IInteractionTransaction } from './transactions/IInteractionTransaction.js';
|
|
8
9
|
export interface ITransactionBase<T extends OPNetTransactionTypes> extends ITransactionReceipt {
|
|
@@ -15,6 +16,7 @@ export interface ITransactionBase<T extends OPNetTransactionTypes> extends ITran
|
|
|
15
16
|
readonly outputs: ITransactionOutput[] | TransactionOutput[];
|
|
16
17
|
readonly OPNetType: T;
|
|
17
18
|
readonly gasUsed: string | bigint;
|
|
19
|
+
readonly pow?: RawProofOfWorkChallenge | ProofOfWorkChallenge;
|
|
18
20
|
}
|
|
19
21
|
export interface IGenericTransaction extends ITransactionBase<OPNetTransactionTypes.Generic> {
|
|
20
22
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ProofOfWorkChallenge {
|
|
2
|
+
readonly preimage: Buffer;
|
|
3
|
+
readonly reward: bigint;
|
|
4
|
+
readonly difficulty?: bigint;
|
|
5
|
+
readonly version?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface RawProofOfWorkChallenge {
|
|
8
|
+
readonly preimage: string;
|
|
9
|
+
readonly reward: string;
|
|
10
|
+
readonly difficulty?: string;
|
|
11
|
+
readonly version?: number;
|
|
12
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Address } from '@btc-vision/transaction';
|
|
2
2
|
import { OPNetTransactionTypes } from '../../../interfaces/opnet/OPNetTransactionTypes.js';
|
|
3
3
|
import { ITransactionBase } from '../ITransaction.js';
|
|
4
|
+
import { ProofOfWorkChallenge } from '../ProofOfWorkChallenge.js';
|
|
4
5
|
export interface ICommonTransaction<T extends OPNetTransactionTypes> extends ITransactionBase<T> {
|
|
5
6
|
readonly contractAddress?: string;
|
|
6
7
|
readonly contractTweakedPublicKey?: Address | string;
|
|
7
8
|
readonly from?: Address | string;
|
|
8
9
|
readonly wasCompressed?: boolean;
|
|
10
|
+
readonly pow?: ProofOfWorkChallenge;
|
|
9
11
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { Network } from '@btc-vision/bitcoin';
|
|
1
2
|
import { ContractEvents, ITransactionReceipt } from '../interfaces/ITransactionReceipt.js';
|
|
2
3
|
export declare class TransactionReceipt implements ITransactionReceipt {
|
|
3
4
|
readonly receipt?: Buffer;
|
|
4
5
|
readonly receiptProofs: string[];
|
|
5
6
|
readonly events: ContractEvents;
|
|
6
7
|
readonly revert?: Buffer;
|
|
7
|
-
constructor(receipt: ITransactionReceipt);
|
|
8
|
+
constructor(receipt: ITransactionReceipt, network: Network);
|
|
8
9
|
private parseEvents;
|
|
9
10
|
private decodeEvent;
|
|
10
11
|
}
|
package/build/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.2.
|
|
1
|
+
export declare const version = "1.2.3";
|
package/build/_version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.2.
|
|
1
|
+
export const version = '1.2.3';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Address } from '@btc-vision/transaction';
|
|
2
|
+
import { IOP_20Contract } from '../opnet/IOP_20Contract';
|
|
3
|
+
import { CallResult } from '../../../../opnet';
|
|
4
|
+
export type Admin = CallResult<{
|
|
5
|
+
ADDRESS: Address;
|
|
6
|
+
}>;
|
|
7
|
+
export type ChangeAdmin = CallResult<{
|
|
8
|
+
success: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
export type AdminMint = CallResult<{
|
|
11
|
+
success: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
export type AdminBurn = CallResult<{
|
|
14
|
+
success: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
export interface IAdministeredOP20Contract extends IOP_20Contract {
|
|
17
|
+
admin(): Promise<Admin>;
|
|
18
|
+
changeAdmin(newAdmin: Address): Promise<ChangeAdmin>;
|
|
19
|
+
adminMint(to: Address, amount: bigint): Promise<AdminMint>;
|
|
20
|
+
adminBurn(from: Address, amount: bigint): Promise<AdminBurn>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { Address } from '@btc-vision/transaction';
|
|
2
|
+
import { IOwnableReentrancyGuardContract } from './IOwnableReentrancyGuardContract';
|
|
3
|
+
import { CallResult } from '../../../../opnet';
|
|
4
|
+
export type PoolInfo = {
|
|
5
|
+
allocPoint: number;
|
|
6
|
+
lastRewardBlock: number;
|
|
7
|
+
accMotoPerShare: bigint;
|
|
8
|
+
};
|
|
9
|
+
export type UserInfo = {
|
|
10
|
+
amount: bigint;
|
|
11
|
+
rewardDebt: bigint;
|
|
12
|
+
};
|
|
13
|
+
export type Initialize = CallResult<{
|
|
14
|
+
success: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
export type GetLpToken = CallResult<{
|
|
17
|
+
lpTokenAddress: Address;
|
|
18
|
+
}>;
|
|
19
|
+
export type GetRewarder = CallResult<{
|
|
20
|
+
rewarderAddress: Address;
|
|
21
|
+
}>;
|
|
22
|
+
export type GetPoolInfo = CallResult<PoolInfo>;
|
|
23
|
+
export type GetUserInfo = CallResult<UserInfo>;
|
|
24
|
+
export type Pools = CallResult<{
|
|
25
|
+
poolLength: number;
|
|
26
|
+
poolsData: Uint8Array;
|
|
27
|
+
}>;
|
|
28
|
+
export type TotalAllocPoint = CallResult<{
|
|
29
|
+
totalAllocPoint: bigint;
|
|
30
|
+
}>;
|
|
31
|
+
export type Devaddr = CallResult<{
|
|
32
|
+
devaddr: Address;
|
|
33
|
+
}>;
|
|
34
|
+
export type MotoPerBlock = CallResult<{
|
|
35
|
+
motoPerBlock: bigint;
|
|
36
|
+
}>;
|
|
37
|
+
export type BonusEndBlock = CallResult<{
|
|
38
|
+
bonusEndBlock: bigint;
|
|
39
|
+
}>;
|
|
40
|
+
export type BonusMultiplier = CallResult<{
|
|
41
|
+
bonusMultiplier: bigint;
|
|
42
|
+
}>;
|
|
43
|
+
export type Add = CallResult<{
|
|
44
|
+
success: boolean;
|
|
45
|
+
}>;
|
|
46
|
+
export type Set = CallResult<{
|
|
47
|
+
success: boolean;
|
|
48
|
+
}>;
|
|
49
|
+
export type SetMigrator = CallResult<{
|
|
50
|
+
success: boolean;
|
|
51
|
+
}>;
|
|
52
|
+
export type Migrate = CallResult<{
|
|
53
|
+
success: boolean;
|
|
54
|
+
}>;
|
|
55
|
+
export type GetMultiplier = CallResult<{
|
|
56
|
+
multiplier: bigint;
|
|
57
|
+
}>;
|
|
58
|
+
export type PendingMoto = CallResult<{
|
|
59
|
+
pendingMoto: number;
|
|
60
|
+
}>;
|
|
61
|
+
export type MassUpdatePools = CallResult<{
|
|
62
|
+
success: boolean;
|
|
63
|
+
}>;
|
|
64
|
+
export type UpdatePool = CallResult<PoolInfo>;
|
|
65
|
+
export type Deposit = CallResult<{
|
|
66
|
+
success: boolean;
|
|
67
|
+
}>;
|
|
68
|
+
export type Withdraw = CallResult<{
|
|
69
|
+
success: boolean;
|
|
70
|
+
}>;
|
|
71
|
+
export type Harvest = CallResult<{
|
|
72
|
+
success: boolean;
|
|
73
|
+
}>;
|
|
74
|
+
export type WithdrawAndHarvest = CallResult<{
|
|
75
|
+
success: boolean;
|
|
76
|
+
}>;
|
|
77
|
+
export type SetDev = CallResult<{
|
|
78
|
+
success: boolean;
|
|
79
|
+
}>;
|
|
80
|
+
export type SetMotoPerBlock = CallResult<{
|
|
81
|
+
success: boolean;
|
|
82
|
+
}>;
|
|
83
|
+
export type SetBonusEndBlock = CallResult<{
|
|
84
|
+
success: boolean;
|
|
85
|
+
}>;
|
|
86
|
+
export type SetBonusMultiplier = CallResult<{
|
|
87
|
+
success: boolean;
|
|
88
|
+
}>;
|
|
89
|
+
export type EmergencyWithdraw = CallResult<{
|
|
90
|
+
success: boolean;
|
|
91
|
+
}>;
|
|
92
|
+
export interface IMotoChefContract extends IOwnableReentrancyGuardContract {
|
|
93
|
+
initialize(MOTO: Address, premineAmount: bigint, devaddr: Address, motoPerBlock: bigint, bonusEndBlock: bigint, bonusMultiplier: bigint): Promise<Initialize>;
|
|
94
|
+
getLpToken(pid: number): Promise<GetLpToken>;
|
|
95
|
+
getRewarder(pid: number): Promise<GetRewarder>;
|
|
96
|
+
getPoolInfo(pid: number): Promise<GetPoolInfo>;
|
|
97
|
+
getUserInfo(pid: number, user: Address): Promise<GetUserInfo>;
|
|
98
|
+
pools(): Promise<Pools>;
|
|
99
|
+
totalAllocPoint(): Promise<TotalAllocPoint>;
|
|
100
|
+
devaddr(): Promise<Devaddr>;
|
|
101
|
+
getMotoPerBlock(): Promise<MotoPerBlock>;
|
|
102
|
+
getBonusEndBlock(): Promise<BonusEndBlock>;
|
|
103
|
+
getBonusMultiplier(): Promise<BonusMultiplier>;
|
|
104
|
+
setMotoPerBlock(motoPerBlock: bigint): Promise<SetMotoPerBlock>;
|
|
105
|
+
setBonusEndBlock(bonusEndBlock: bigint): Promise<SetBonusEndBlock>;
|
|
106
|
+
setBonusMultiplier(bonusMultiplier: bigint): Promise<SetBonusMultiplier>;
|
|
107
|
+
add(allocPoint: bigint, lpToken: Address, rewarder: Address): Promise<Add>;
|
|
108
|
+
set(pid: number, allocPoint: bigint, rewarder: Address, overwrite: boolean): Promise<Set>;
|
|
109
|
+
setMigrator(migrator: Address): Promise<SetMigrator>;
|
|
110
|
+
migrate(pid: number): Promise<Migrate>;
|
|
111
|
+
getMultiplier(from: bigint, to: bigint): Promise<GetMultiplier>;
|
|
112
|
+
pendingMoto(pid: number, user: Address): Promise<PendingMoto>;
|
|
113
|
+
massUpdatePools(length: number, pids: number[]): Promise<MassUpdatePools>;
|
|
114
|
+
updatePool(pid: number): Promise<UpdatePool>;
|
|
115
|
+
deposit(pid: number, amount: bigint, to: Address): Promise<Deposit>;
|
|
116
|
+
withdraw(pid: number, amount: bigint, to: Address): Promise<Withdraw>;
|
|
117
|
+
harvest(pid: number, to: Address): Promise<Harvest>;
|
|
118
|
+
withdrawAndHarvest(pid: number, amount: bigint, to: Address): Promise<WithdrawAndHarvest>;
|
|
119
|
+
emergencyWithdraw(pid: number, to: Address): Promise<EmergencyWithdraw>;
|
|
120
|
+
setDev(devaddr: Address): Promise<SetDev>;
|
|
121
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Address } from '@btc-vision/transaction';
|
|
2
|
+
import { CallResult } from '../../../../contracts/CallResult.js';
|
|
3
|
+
import { IOP_NETContract } from '../opnet/IOP_NETContract.js';
|
|
4
|
+
export type ReserveEWMA = CallResult<{
|
|
5
|
+
reserved: bigint;
|
|
6
|
+
}>;
|
|
7
|
+
export type AddLiquidity = CallResult<{
|
|
8
|
+
ok: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
export type RemoveLiquidity = CallResult<{
|
|
11
|
+
ok: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
export type ListLiquidity = CallResult<{
|
|
14
|
+
ok: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
export type CancelListing = CallResult<{
|
|
17
|
+
totalTokensReturned: bigint;
|
|
18
|
+
}>;
|
|
19
|
+
export type CreatePool = CallResult<{
|
|
20
|
+
ok: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
export type SetFees = CallResult<{
|
|
23
|
+
ok: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
export type GetFees = CallResult<{
|
|
26
|
+
reservationBaseFee: bigint;
|
|
27
|
+
priorityQueueBaseFee: bigint;
|
|
28
|
+
pricePerUserInPriorityQueueBTC: bigint;
|
|
29
|
+
}>;
|
|
30
|
+
export type Swap = CallResult<{
|
|
31
|
+
ok: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
export type GetReserve = CallResult<{
|
|
34
|
+
liquidity: bigint;
|
|
35
|
+
reservedLiquidity: bigint;
|
|
36
|
+
virtualBTCReserve: bigint;
|
|
37
|
+
virtualTokenReserve: bigint;
|
|
38
|
+
}>;
|
|
39
|
+
export type GetQuote = CallResult<{
|
|
40
|
+
tokensOut: bigint;
|
|
41
|
+
requiredSatoshis: bigint;
|
|
42
|
+
price: bigint;
|
|
43
|
+
}>;
|
|
44
|
+
export type GetProviderDetails = CallResult<{
|
|
45
|
+
liquidity: bigint;
|
|
46
|
+
reserved: bigint;
|
|
47
|
+
btcReceiver: string;
|
|
48
|
+
}>;
|
|
49
|
+
export type GetPriorityQueueCost = CallResult<{
|
|
50
|
+
cost: bigint;
|
|
51
|
+
}>;
|
|
52
|
+
export type VirtualReserves = CallResult<{
|
|
53
|
+
virtualBTCReserve: bigint;
|
|
54
|
+
virtualTokenReserve: bigint;
|
|
55
|
+
}>;
|
|
56
|
+
export interface INativeSwapContract extends IOP_NETContract {
|
|
57
|
+
reserve(token: Address, maximumAmountIn: bigint, minimumAmountOut: bigint, forLP: boolean): Promise<ReserveEWMA>;
|
|
58
|
+
listLiquidity(token: Address, receiver: string, amountIn: bigint, priority: boolean): Promise<ListLiquidity>;
|
|
59
|
+
cancelListing(token: Address): Promise<CancelListing>;
|
|
60
|
+
createPool(token: Address, floorPrice: bigint, initialLiquidity: bigint, receiver: string, antiBotEnabledFor: number, antiBotMaximumTokensPerReservation: bigint, maxReservesIn5BlocksPercent: number): Promise<CreatePool>;
|
|
61
|
+
setFees(reservationBaseFee: bigint, priorityQueueBaseFee: bigint, pricePerUserInPriorityQueueBTC: bigint): Promise<SetFees>;
|
|
62
|
+
getFees(): Promise<GetFees>;
|
|
63
|
+
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>;
|
|
66
|
+
getReserve(token: Address): Promise<GetReserve>;
|
|
67
|
+
getQuote(token: Address, satoshisIn: bigint): Promise<GetQuote>;
|
|
68
|
+
getProviderDetails(token: Address): Promise<GetProviderDetails>;
|
|
69
|
+
getVirtualReserves(token: Address): Promise<VirtualReserves>;
|
|
70
|
+
getPriorityQueueCost(token: Address): Promise<GetPriorityQueueCost>;
|
|
71
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Address } from '@btc-vision/transaction';
|
|
2
|
+
import { CallResult, IOP_NETContract } from '../../../../opnet';
|
|
3
|
+
export type Admin = CallResult<{
|
|
4
|
+
adminAddress: Address;
|
|
5
|
+
}>;
|
|
6
|
+
export type ChangeAdmin = CallResult<{
|
|
7
|
+
success: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
export interface IOwnableContract extends IOP_NETContract {
|
|
10
|
+
admin(): Promise<Admin>;
|
|
11
|
+
changeAdmin(newAdmin: Address): Promise<ChangeAdmin>;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Address } from '@btc-vision/transaction';
|
|
2
|
+
import { CallResult } from '../../../../opnet';
|
|
3
|
+
import { IReentrancyGuard } from './IReentrancyGuardContract';
|
|
4
|
+
export type Admin = CallResult<{
|
|
5
|
+
adminAddress: Address;
|
|
6
|
+
}>;
|
|
7
|
+
export type ChangeAdmin = CallResult<{
|
|
8
|
+
success: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
export interface IOwnableReentrancyGuardContract extends IReentrancyGuard {
|
|
11
|
+
admin(): Promise<Admin>;
|
|
12
|
+
changeAdmin(newAdmin: Address): Promise<ChangeAdmin>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { ABIDataTypes } from '@btc-vision/transaction';
|
|
2
|
+
import { BitcoinAbiTypes } from '../../../BitcoinAbiTypes';
|
|
3
|
+
import { OP_20_ABI } from '../opnet/OP_20_ABI';
|
|
4
|
+
const ADMINISTERED_OP_20_ABI = [
|
|
5
|
+
{
|
|
6
|
+
name: 'admin',
|
|
7
|
+
type: BitcoinAbiTypes.Function,
|
|
8
|
+
constant: true,
|
|
9
|
+
inputs: [],
|
|
10
|
+
outputs: [
|
|
11
|
+
{
|
|
12
|
+
name: 'ADDRESS',
|
|
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: 'adminMint',
|
|
37
|
+
type: BitcoinAbiTypes.Function,
|
|
38
|
+
constant: false,
|
|
39
|
+
payable: false,
|
|
40
|
+
inputs: [
|
|
41
|
+
{
|
|
42
|
+
name: 'to',
|
|
43
|
+
type: ABIDataTypes.ADDRESS,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'amount',
|
|
47
|
+
type: ABIDataTypes.UINT256,
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
outputs: [
|
|
51
|
+
{
|
|
52
|
+
name: 'success',
|
|
53
|
+
type: ABIDataTypes.BOOL,
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'adminBurn',
|
|
59
|
+
type: BitcoinAbiTypes.Function,
|
|
60
|
+
constant: false,
|
|
61
|
+
payable: false,
|
|
62
|
+
inputs: [
|
|
63
|
+
{
|
|
64
|
+
name: 'from',
|
|
65
|
+
type: ABIDataTypes.ADDRESS,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'amount',
|
|
69
|
+
type: ABIDataTypes.UINT256,
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
outputs: [
|
|
73
|
+
{
|
|
74
|
+
name: 'success',
|
|
75
|
+
type: ABIDataTypes.BOOL,
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
...OP_20_ABI,
|
|
80
|
+
];
|
|
81
|
+
export default ADMINISTERED_OP_20_ABI;
|