opnet 1.0.33 → 1.0.34

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.
Files changed (215) hide show
  1. package/browser/_version.d.ts +1 -1
  2. package/browser/abi/shared/interfaces/IMotoContract.d.ts +6 -0
  3. package/browser/abi/shared/interfaces/IMotoswapFactoryContract.d.ts +7 -0
  4. package/browser/abi/shared/interfaces/IMotoswapPoolContract.d.ts +12 -0
  5. package/browser/abi/shared/interfaces/IOP_20Contract.d.ts +16 -0
  6. package/browser/abi/shared/interfaces/IOP_NETContract.d.ts +7 -0
  7. package/browser/abi/shared/interfaces/IStackingContract.d.ts +11 -0
  8. package/browser/abi/shared/interfaces/IWBTCContract.d.ts +8 -0
  9. package/browser/abi/shared/json/MOTOSWAP_FACTORY_ABI.d.ts +2 -0
  10. package/browser/abi/shared/json/MOTOSWAP_POOL_ABI.d.ts +2 -0
  11. package/browser/abi/shared/json/MOTO_TOKEN_ABI.d.ts +2 -0
  12. package/browser/abi/shared/json/OP_20_ABI.d.ts +2 -0
  13. package/browser/abi/shared/json/OP_NET_ABI.d.ts +2 -0
  14. package/browser/abi/shared/json/STAKING_ABI.d.ts +2 -0
  15. package/browser/abi/shared/json/WBTC_ABI.d.ts +2 -0
  16. package/browser/common/CommonTypes.d.ts +2 -1
  17. package/browser/index.js +1 -1
  18. package/browser/opnet.d.ts +16 -0
  19. package/browser/scripts/ITestContract.d.ts +2 -0
  20. package/browser/scripts/testWBTCContract.d.ts +1 -0
  21. package/build/_version.d.ts +1 -1
  22. package/build/_version.js +1 -1
  23. package/build/abi/shared/MOTOSWAP_FACTORY_ABI.d.ts +2 -0
  24. package/build/abi/shared/MOTOSWAP_FACTORY_ABI.js +68 -0
  25. package/build/abi/shared/OP_20_ABI.d.ts +2 -0
  26. package/build/abi/shared/OP_20_ABI.js +235 -0
  27. package/build/abi/shared/OP_NET_ABI.d.ts +2 -0
  28. package/build/abi/shared/OP_NET_ABI.js +31 -0
  29. package/build/abi/shared/STAKING_ABI.d.ts +2 -0
  30. package/build/abi/shared/STAKING_ABI.js +96 -0
  31. package/build/abi/shared/WBTC_ABI.d.ts +2 -0
  32. package/build/abi/shared/WBTC_ABI.js +40 -0
  33. package/build/abi/shared/interfaces/IMotoContract.d.ts +6 -0
  34. package/build/abi/shared/interfaces/IMotoContract.js +1 -0
  35. package/build/abi/shared/interfaces/IMotoswapFactoryContract.d.ts +7 -0
  36. package/build/abi/shared/interfaces/IMotoswapFactoryContract.js +1 -0
  37. package/build/abi/shared/interfaces/IMotoswapPoolContract.d.ts +12 -0
  38. package/build/abi/shared/interfaces/IMotoswapPoolContract.js +1 -0
  39. package/build/abi/shared/interfaces/IOP_20Contract.d.ts +16 -0
  40. package/build/abi/shared/interfaces/IOP_20Contract.js +1 -0
  41. package/build/abi/shared/interfaces/IOP_NETContract.d.ts +7 -0
  42. package/build/abi/shared/interfaces/IOP_NETContract.js +1 -0
  43. package/build/abi/shared/interfaces/IStackingContract.d.ts +11 -0
  44. package/build/abi/shared/interfaces/IStackingContract.js +1 -0
  45. package/build/abi/shared/interfaces/IWBTCContract.d.ts +8 -0
  46. package/build/abi/shared/interfaces/IWBTCContract.js +1 -0
  47. package/build/abi/shared/json/MOTOSWAP_FACTORY_ABI.d.ts +2 -0
  48. package/build/abi/shared/json/MOTOSWAP_FACTORY_ABI.js +68 -0
  49. package/build/abi/shared/json/MOTOSWAP_POOL_ABI.d.ts +2 -0
  50. package/build/abi/shared/json/MOTOSWAP_POOL_ABI.js +272 -0
  51. package/build/abi/shared/json/MOTO_TOKEN_ABI.d.ts +2 -0
  52. package/build/abi/shared/json/MOTO_TOKEN_ABI.js +22 -0
  53. package/build/abi/shared/json/OP_20_ABI.d.ts +2 -0
  54. package/build/abi/shared/json/OP_20_ABI.js +253 -0
  55. package/build/abi/shared/json/OP_NET_ABI.d.ts +2 -0
  56. package/build/abi/shared/json/OP_NET_ABI.js +31 -0
  57. package/build/abi/shared/json/STAKING_ABI.d.ts +2 -0
  58. package/build/abi/shared/json/STAKING_ABI.js +126 -0
  59. package/build/abi/shared/json/WBTC_ABI.d.ts +2 -0
  60. package/build/abi/shared/json/WBTC_ABI.js +54 -0
  61. package/build/common/CommonTypes.d.ts +2 -1
  62. package/build/contracts/Contract.js +52 -10
  63. package/build/opnet.d.ts +16 -0
  64. package/build/opnet.js +16 -0
  65. package/build/scripts/ITestContract.d.ts +0 -2
  66. package/build/scripts/ITestContract.js +1 -260
  67. package/build/scripts/testMethods.js +2 -2
  68. package/build/scripts/testMethodsReg.js +2 -2
  69. package/build/scripts/testWBTCContract.d.ts +1 -0
  70. package/build/scripts/testWBTCContract.js +11 -0
  71. package/docs/assets/highlight.css +14 -0
  72. package/docs/assets/navigation.js +1 -1
  73. package/docs/assets/search.js +1 -1
  74. package/docs/classes/AbstractRpcProvider.html +22 -22
  75. package/docs/classes/BaseContract.html +7 -7
  76. package/docs/classes/BitcoinAddress.html +2 -2
  77. package/docs/classes/BitcoinInterface.html +2 -2
  78. package/docs/classes/BitcoinUtils.html +2 -2
  79. package/docs/classes/Block.html +3 -3
  80. package/docs/classes/CallResult.html +2 -2
  81. package/docs/classes/ContractData.html +2 -2
  82. package/docs/classes/DeploymentTransaction.html +24 -24
  83. package/docs/classes/GenericTransaction.html +14 -14
  84. package/docs/classes/IBaseContract.html +7 -7
  85. package/docs/classes/InteractionTransaction.html +21 -21
  86. package/docs/classes/JSONRpcProvider.html +22 -22
  87. package/docs/classes/OPNetEvent.html +2 -2
  88. package/docs/classes/StoredValue.html +2 -2
  89. package/docs/classes/TransactionBase.html +14 -14
  90. package/docs/classes/TransactionInput.html +2 -2
  91. package/docs/classes/TransactionOutput.html +2 -2
  92. package/docs/classes/TransactionParser.html +2 -2
  93. package/docs/classes/TransactionReceipt.html +7 -7
  94. package/docs/classes/UTXO.html +2 -2
  95. package/docs/classes/UnwrapTransaction.html +225 -0
  96. package/docs/classes/WebSocketRpcProvider.html +22 -22
  97. package/docs/classes/WrapTransaction.html +28 -28
  98. package/docs/enums/ABIDataTypes.html +4 -1
  99. package/docs/enums/BitcoinAbiTypes.html +2 -2
  100. package/docs/enums/GenerateTarget.html +2 -2
  101. package/docs/enums/JSONRPCErrorCode.html +2 -2
  102. package/docs/enums/JSONRPCErrorHttpCodes.html +2 -2
  103. package/docs/enums/JSONRpcMethods.html +9 -9
  104. package/docs/enums/OPNetTransactionTypes.html +2 -2
  105. package/docs/functions/getContract.html +3 -1
  106. package/docs/hierarchy.html +1 -1
  107. package/docs/interfaces/BaseContractProperties.html +2 -2
  108. package/docs/interfaces/BitcoinAbiValue.html +3 -3
  109. package/docs/interfaces/BitcoinInterfaceAbiBase.html +2 -2
  110. package/docs/interfaces/BroadcastedTransaction.html +6 -6
  111. package/docs/interfaces/ContractEvents.html +1 -1
  112. package/docs/interfaces/EventBaseData.html +2 -2
  113. package/docs/interfaces/FunctionBaseData.html +2 -2
  114. package/docs/interfaces/IAccessList.html +1 -1
  115. package/docs/interfaces/IAccessListItem.html +1 -1
  116. package/docs/interfaces/IBlock.html +3 -3
  117. package/docs/interfaces/IBlockCommon.html +3 -3
  118. package/docs/interfaces/IBlockWitness.html +2 -2
  119. package/docs/interfaces/IBlockWitnessAPI.html +2 -2
  120. package/docs/interfaces/ICallRequestError.html +2 -2
  121. package/docs/interfaces/ICallResultData.html +2 -2
  122. package/docs/interfaces/ICommonTransaction.html +16 -16
  123. package/docs/interfaces/IContract.html +2 -2
  124. package/docs/interfaces/IDecodedEvent.html +2 -2
  125. package/docs/interfaces/IDeploymentTransaction.html +23 -23
  126. package/docs/interfaces/IGenericTransaction.html +13 -13
  127. package/docs/interfaces/IInteractionTransaction.html +20 -20
  128. package/docs/interfaces/IMotoContract.html +194 -0
  129. package/docs/interfaces/IMotoswapFactoryContract.html +191 -0
  130. package/docs/interfaces/IMotoswapPoolContract.html +206 -0
  131. package/docs/interfaces/IOP_20Contract.html +194 -0
  132. package/docs/interfaces/IOP_NETContract.html +181 -0
  133. package/docs/interfaces/IRawContract.html +2 -2
  134. package/docs/interfaces/IRawContractEvents.html +1 -1
  135. package/docs/interfaces/IStackingContract.html +183 -0
  136. package/docs/interfaces/IStorageValue.html +2 -2
  137. package/docs/interfaces/ITransactionBase.html +13 -13
  138. package/docs/interfaces/ITransactionInput.html +2 -2
  139. package/docs/interfaces/ITransactionOutput.html +2 -2
  140. package/docs/interfaces/ITransactionReceipt.html +5 -5
  141. package/docs/interfaces/IUTXO.html +2 -2
  142. package/docs/interfaces/IUnwrapTransaction.html +224 -0
  143. package/docs/interfaces/IWBTCContract.html +207 -0
  144. package/docs/interfaces/IWrapTransaction.html +27 -27
  145. package/docs/interfaces/JSONRpc2Request.html +2 -2
  146. package/docs/interfaces/JSONRpc2ResponseError.html +2 -2
  147. package/docs/interfaces/JSONRpc2ResponseResult.html +2 -2
  148. package/docs/interfaces/JSONRpc2ResultData.html +1 -1
  149. package/docs/interfaces/JSONRpcErrorData.html +1 -1
  150. package/docs/interfaces/JSONRpcParams.html +1 -1
  151. package/docs/interfaces/JSONRpcResultError.html +2 -2
  152. package/docs/interfaces/MergedOP_20AndStackingContract.html +199 -0
  153. package/docs/interfaces/NetEventDocument.html +5 -5
  154. package/docs/interfaces/ParsedPartialWBTCUTXODocument.html +179 -0
  155. package/docs/interfaces/PartialWBTCUTXODocument.html +179 -0
  156. package/docs/interfaces/ReorgInformation.html +2 -2
  157. package/docs/interfaces/UsedUTXO.html +176 -0
  158. package/docs/modules.html +20 -0
  159. package/docs/types/BaseContractProperty.html +1 -1
  160. package/docs/types/BigNumberish.html +1 -1
  161. package/docs/types/BitcoinAddressLike.html +1 -1
  162. package/docs/types/BitcoinInterfaceAbi.html +1 -1
  163. package/docs/types/BlockHeaderChecksumProof.html +1 -1
  164. package/docs/types/BlockTag.html +1 -1
  165. package/docs/types/BlockWitnesses.html +1 -1
  166. package/docs/types/ContractDecodedObjectResult.html +1 -1
  167. package/docs/types/DecodedCallResult.html +1 -1
  168. package/docs/types/DecodedOutput.html +1 -1
  169. package/docs/types/GenerationParameters.html +1 -1
  170. package/docs/types/ICallResult.html +1 -1
  171. package/docs/types/ITransaction.html +1 -1
  172. package/docs/types/InteractionType.html +1 -1
  173. package/docs/types/JSONRpc2RequestParams.html +1 -1
  174. package/docs/types/JSONRpc2Result.html +1 -1
  175. package/docs/types/JSONRpcId.html +1 -1
  176. package/docs/types/JsonRpcCallResult.html +1 -1
  177. package/docs/types/JsonRpcError.html +1 -1
  178. package/docs/types/JsonRpcPayload.html +1 -1
  179. package/docs/types/JsonRpcResult.html +1 -1
  180. package/docs/types/Numeric.html +1 -1
  181. package/docs/types/PointerLike.html +1 -1
  182. package/docs/types/RawContractEvents.html +1 -1
  183. package/docs/types/UTXOs.html +1 -1
  184. package/docs/variables/MOTO_TOKEN_ABI.html +174 -0
  185. package/docs/variables/MotoSwapFactoryAbi.html +174 -0
  186. package/docs/variables/MotoswapPoolAbi.html +174 -0
  187. package/docs/variables/OP_20_ABI.html +174 -0
  188. package/docs/variables/OP_NET_ABI.html +174 -0
  189. package/docs/variables/STAKING_ABI.html +174 -0
  190. package/docs/variables/WBTC_ABI.html +174 -0
  191. package/docs/variables/version.html +1 -1
  192. package/package.json +3 -3
  193. package/src/_version.ts +1 -1
  194. package/src/abi/shared/interfaces/IMotoContract.ts +16 -0
  195. package/src/abi/shared/interfaces/IMotoswapFactoryContract.ts +26 -0
  196. package/src/abi/shared/interfaces/IMotoswapPoolContract.ts +70 -0
  197. package/src/abi/shared/interfaces/IOP_20Contract.ts +59 -0
  198. package/src/abi/shared/interfaces/IOP_NETContract.ts +14 -0
  199. package/src/abi/shared/interfaces/IStackingContract.ts +23 -0
  200. package/src/abi/shared/interfaces/IWBTCContract.ts +32 -0
  201. package/src/abi/shared/json/MOTOSWAP_FACTORY_ABI.ts +72 -0
  202. package/src/abi/shared/json/MOTOSWAP_POOL_ABI.ts +289 -0
  203. package/src/abi/shared/json/MOTO_TOKEN_ABI.ts +26 -0
  204. package/src/{scripts/ITestContract.ts → abi/shared/json/OP_20_ABI.ts} +13 -58
  205. package/src/abi/shared/json/OP_NET_ABI.ts +34 -0
  206. package/src/abi/shared/json/STAKING_ABI.ts +130 -0
  207. package/src/abi/shared/json/WBTC_ABI.ts +63 -0
  208. package/src/common/CommonTypes.ts +3 -1
  209. package/src/contracts/Contract.ts +71 -10
  210. package/src/opnet.ts +21 -0
  211. package/src/scripts/testMethods.ts +5 -83
  212. package/src/scripts/testMethodsReg.ts +5 -23
  213. package/src/scripts/testWBTCContract.ts +22 -0
  214. package/src/scripts/testContract.ts +0 -23
  215. package/src/scripts/test_abi.json +0 -31
@@ -1 +1 @@
1
- export declare const version = "1.0.33";
1
+ export declare const version = "1.0.34";
@@ -0,0 +1,6 @@
1
+ import { Address } from '@btc-vision/bsi-binary';
2
+ import { BaseContractProperty } from '../../BaseContractProperty.js';
3
+ import { IOP_20Contract } from './IOP_20Contract.js';
4
+ export interface IMotoContract extends IOP_20Contract {
5
+ airdrop(list: Map<Address, bigint>): Promise<BaseContractProperty>;
6
+ }
@@ -0,0 +1,7 @@
1
+ import { Address } from '@btc-vision/bsi-binary';
2
+ import { BaseContractProperty } from '../../BaseContractProperty.js';
3
+ import { IOP_NETContract } from './IOP_NETContract.js';
4
+ export interface IMotoswapFactoryContract extends IOP_NETContract {
5
+ getPool(token0: Address, token1: Address): Promise<BaseContractProperty>;
6
+ createPool(token0: Address, token1: Address): Promise<BaseContractProperty>;
7
+ }
@@ -0,0 +1,12 @@
1
+ import { BaseContractProperty } from '../../BaseContractProperty.js';
2
+ import { IOP_20Contract } from './IOP_20Contract.js';
3
+ export interface IMotoswapPoolContract extends Omit<IOP_20Contract, 'burn' | 'mint'> {
4
+ token0(): Promise<BaseContractProperty>;
5
+ token1(): Promise<BaseContractProperty>;
6
+ getReserves(): Promise<BaseContractProperty>;
7
+ swap(amount0Out: bigint, amount1Out: bigint, to: string, data: Uint8Array): Promise<BaseContractProperty>;
8
+ burn(amount0: bigint, amount1: bigint): Promise<BaseContractProperty>;
9
+ sync(): Promise<BaseContractProperty>;
10
+ price0CumulativeLast(): Promise<BaseContractProperty>;
11
+ price1CumulativeLast(): Promise<BaseContractProperty>;
12
+ }
@@ -0,0 +1,16 @@
1
+ import { BitcoinAddressLike } from '../../../common/CommonTypes.js';
2
+ import { BaseContractProperty } from '../../BaseContractProperty.js';
3
+ import { IOP_NETContract } from './IOP_NETContract.js';
4
+ export interface IOP_20Contract extends IOP_NETContract {
5
+ balanceOf(address: BitcoinAddressLike): Promise<BaseContractProperty>;
6
+ name(): Promise<BaseContractProperty>;
7
+ symbol(): Promise<BaseContractProperty>;
8
+ totalSupply(): Promise<BaseContractProperty>;
9
+ decimals(): Promise<BaseContractProperty>;
10
+ transfer(to: BitcoinAddressLike, value: bigint): Promise<BaseContractProperty>;
11
+ transferFrom(from: BitcoinAddressLike, to: BitcoinAddressLike, value: bigint): Promise<BaseContractProperty>;
12
+ approve(spender: BitcoinAddressLike, value: bigint): Promise<BaseContractProperty>;
13
+ allowance(owner: BitcoinAddressLike, spender: BitcoinAddressLike): Promise<BaseContractProperty>;
14
+ mint(to: BitcoinAddressLike, value: bigint): Promise<BaseContractProperty>;
15
+ burn(to: BitcoinAddressLike, value: bigint): Promise<BaseContractProperty>;
16
+ }
@@ -0,0 +1,7 @@
1
+ import { BitcoinAddressLike } from '../../../common/CommonTypes.js';
2
+ import { BaseContractProperty } from '../../BaseContractProperty.js';
3
+ import { BaseContractProperties } from '../../interfaces/BaseContractProperties.js';
4
+ export interface IOP_NETContract extends BaseContractProperties {
5
+ owner(): Promise<BaseContractProperty>;
6
+ isAddressOwner(address: BitcoinAddressLike): Promise<BaseContractProperty>;
7
+ }
@@ -0,0 +1,11 @@
1
+ import { Address } from '@btc-vision/bsi-binary';
2
+ import { BaseContractProperties } from '../../interfaces/BaseContractProperties.js';
3
+ export interface IStackingContract {
4
+ stake(amount: bigint): Promise<BaseContractProperties>;
5
+ unstake(): Promise<BaseContractProperties>;
6
+ stakedAmount(address: Address): Promise<BaseContractProperties>;
7
+ stakedReward(address: Address): Promise<BaseContractProperties>;
8
+ claim(): Promise<BaseContractProperties>;
9
+ rewardPool(): Promise<BaseContractProperties>;
10
+ totalStaked(): Promise<BaseContractProperties>;
11
+ }
@@ -0,0 +1,8 @@
1
+ import { BaseContractProperty } from '../../BaseContractProperty.js';
2
+ import { IOP_20Contract } from './IOP_20Contract.js';
3
+ import { IStackingContract } from './IStackingContract.js';
4
+ export type MergedOP_20AndStackingContract = IOP_20Contract & IStackingContract;
5
+ export interface IWBTCContract extends MergedOP_20AndStackingContract {
6
+ requestWithdrawal(amount: bigint): Promise<BaseContractProperty>;
7
+ withdrawableBalanceOf(address: string): Promise<BaseContractProperty>;
8
+ }
@@ -0,0 +1,2 @@
1
+ import { BitcoinInterfaceAbi } from '../../interfaces/BitcoinInterfaceAbi.js';
2
+ export declare const MotoSwapFactoryAbi: BitcoinInterfaceAbi;
@@ -0,0 +1,2 @@
1
+ import { BitcoinInterfaceAbi } from '../../interfaces/BitcoinInterfaceAbi.js';
2
+ export declare const MotoswapPoolAbi: BitcoinInterfaceAbi;
@@ -0,0 +1,2 @@
1
+ import { BitcoinInterfaceAbi } from '../../interfaces/BitcoinInterfaceAbi.js';
2
+ export declare const MOTO_TOKEN_ABI: BitcoinInterfaceAbi;
@@ -0,0 +1,2 @@
1
+ import { BitcoinInterfaceAbi } from '../../interfaces/BitcoinInterfaceAbi.js';
2
+ export declare const OP_20_ABI: BitcoinInterfaceAbi;
@@ -0,0 +1,2 @@
1
+ import { BitcoinInterfaceAbi } from '../../interfaces/BitcoinInterfaceAbi.js';
2
+ export declare const OP_NET_ABI: BitcoinInterfaceAbi;
@@ -0,0 +1,2 @@
1
+ import { BitcoinInterfaceAbi } from '../../interfaces/BitcoinInterfaceAbi.js';
2
+ export declare const STAKING_ABI: BitcoinInterfaceAbi;
@@ -0,0 +1,2 @@
1
+ import { BitcoinInterfaceAbi } from '../../interfaces/BitcoinInterfaceAbi.js';
2
+ export declare const WBTC_ABI: BitcoinInterfaceAbi;
@@ -1,7 +1,8 @@
1
+ import { Address } from '@btc-vision/bsi-binary';
1
2
  import { BitcoinAddress } from '../bitcoin/BitcoinAddress.js';
2
3
  export type BitcoinAddressLike = string | BitcoinAddress;
3
4
  export type PointerLike = bigint | string;
4
- export type DecodedCallResult = bigint | string | boolean | number | Uint8Array | Array<bigint> | Array<string> | Array<boolean> | Array<number> | Array<Uint8Array>;
5
+ export type DecodedCallResult = bigint | string | boolean | number | Uint8Array | Array<bigint> | Array<string> | Array<boolean> | Array<number> | Array<Uint8Array> | Map<Address, bigint>;
5
6
  export type Numeric = number | bigint;
6
7
  export type BigNumberish = Numeric | string;
7
8
  export type BlockTag = BigNumberish | 'latest' | 'pending' | 'earliest';