opnet 1.1.21 → 1.1.22
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/.github/workflows/ci.yml +43 -43
- package/browser/_version.d.ts +1 -1
- package/browser/abi/shared/interfaces/{IStackingContract.d.ts → generic/IStackingContract.d.ts} +1 -1
- package/browser/abi/shared/interfaces/motoswap/IEwmaContract.d.ts +36 -0
- package/browser/abi/shared/interfaces/{IMotoswapFactoryContract.d.ts → motoswap/IMotoswapFactoryContract.d.ts} +2 -2
- package/browser/abi/shared/interfaces/{IMotoswapPoolContract.d.ts → motoswap/IMotoswapPoolContract.d.ts} +2 -2
- package/browser/abi/shared/interfaces/{IMotoswapRouterContract.d.ts → motoswap/IMotoswapRouterContract.d.ts} +2 -2
- package/{build/abi/shared/interfaces → browser/abi/shared/interfaces/opnet}/IOP_20Contract.d.ts +1 -1
- package/browser/abi/shared/interfaces/{IOP_NETContract.d.ts → opnet/IOP_NETContract.d.ts} +2 -2
- package/{build/abi/shared/interfaces → browser/abi/shared/interfaces/tests}/IWBTCContract.d.ts +3 -3
- package/browser/abi/shared/json/{STAKING_ABI.d.ts → generic/STAKING_ABI.d.ts} +1 -1
- package/browser/abi/shared/json/motoswap/EWMA_ABI.d.ts +3 -0
- package/browser/abi/shared/json/{MOTOSWAP_FACTORY_ABI.d.ts → motoswap/MOTOSWAP_FACTORY_ABI.d.ts} +1 -1
- package/browser/abi/shared/json/{MOTOSWAP_POOL_ABI.d.ts → motoswap/MOTOSWAP_POOL_ABI.d.ts} +1 -1
- package/browser/abi/shared/json/motoswap/MOTOSWAP_ROUTER_ABI.d.ts +2 -0
- package/browser/abi/shared/json/{OP_20_ABI.d.ts → opnet/OP_20_ABI.d.ts} +1 -1
- package/browser/abi/shared/json/opnet/OP_NET_ABI.d.ts +2 -0
- package/browser/abi/shared/json/{WBTC_ABI.d.ts → tests/WBTC_ABI.d.ts} +1 -1
- package/browser/index.js +1 -1
- package/browser/opnet.d.ts +16 -14
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/abi/shared/interfaces/{IStackingContract.d.ts → generic/IStackingContract.d.ts} +1 -1
- package/build/abi/shared/interfaces/motoswap/IEwmaContract.d.ts +36 -0
- package/build/abi/shared/interfaces/{IMotoswapFactoryContract.d.ts → motoswap/IMotoswapFactoryContract.d.ts} +2 -2
- package/build/abi/shared/interfaces/{IMotoswapPoolContract.d.ts → motoswap/IMotoswapPoolContract.d.ts} +2 -2
- package/build/abi/shared/interfaces/{IMotoswapRouterContract.d.ts → motoswap/IMotoswapRouterContract.d.ts} +2 -2
- package/{browser/abi/shared/interfaces → build/abi/shared/interfaces/opnet}/IOP_20Contract.d.ts +1 -1
- package/build/abi/shared/interfaces/{IOP_NETContract.d.ts → opnet/IOP_NETContract.d.ts} +2 -2
- package/{browser/abi/shared/interfaces → build/abi/shared/interfaces/tests}/IWBTCContract.d.ts +3 -3
- package/build/abi/shared/interfaces/tests/IWBTCContract.js +1 -0
- package/build/abi/shared/json/{STAKING_ABI.d.ts → generic/STAKING_ABI.d.ts} +1 -1
- package/build/abi/shared/json/{STAKING_ABI.js → generic/STAKING_ABI.js} +1 -1
- package/build/abi/shared/json/motoswap/EWMA_ABI.d.ts +3 -0
- package/build/abi/shared/json/motoswap/EWMA_ABI.js +271 -0
- package/build/abi/shared/json/{MOTOSWAP_FACTORY_ABI.d.ts → motoswap/MOTOSWAP_FACTORY_ABI.d.ts} +1 -1
- package/build/abi/shared/json/{MOTOSWAP_FACTORY_ABI.js → motoswap/MOTOSWAP_FACTORY_ABI.js} +2 -2
- package/build/abi/shared/json/{MOTOSWAP_POOL_ABI.d.ts → motoswap/MOTOSWAP_POOL_ABI.d.ts} +1 -1
- package/build/abi/shared/json/{MOTOSWAP_POOL_ABI.js → motoswap/MOTOSWAP_POOL_ABI.js} +2 -2
- package/build/abi/shared/json/motoswap/MOTOSWAP_ROUTER_ABI.d.ts +2 -0
- package/build/abi/shared/json/{MOTOSWAP_ROUTER_ABI.js → motoswap/MOTOSWAP_ROUTER_ABI.js} +3 -3
- package/build/abi/shared/json/{OP_20_ABI.d.ts → opnet/OP_20_ABI.d.ts} +1 -1
- package/build/abi/shared/json/{OP_20_ABI.js → opnet/OP_20_ABI.js} +1 -1
- package/build/abi/shared/json/opnet/OP_NET_ABI.d.ts +2 -0
- package/build/abi/shared/json/{OP_NET_ABI.js → opnet/OP_NET_ABI.js} +1 -1
- package/build/abi/shared/json/{WBTC_ABI.d.ts → tests/WBTC_ABI.d.ts} +1 -1
- package/build/abi/shared/json/{WBTC_ABI.js → tests/WBTC_ABI.js} +3 -3
- package/build/opnet.d.ts +16 -14
- package/build/opnet.js +16 -14
- package/package.json +2 -2
- package/src/_version.ts +1 -1
- package/src/abi/shared/interfaces/{IStackingContract.ts → generic/IStackingContract.ts} +1 -1
- package/src/abi/shared/interfaces/motoswap/IEwmaContract.ts +153 -0
- package/src/abi/shared/interfaces/{IMotoswapFactoryContract.ts → motoswap/IMotoswapFactoryContract.ts} +2 -2
- package/src/abi/shared/interfaces/{IMotoswapPoolContract.ts → motoswap/IMotoswapPoolContract.ts} +2 -2
- package/src/abi/shared/interfaces/{IMotoswapRouterContract.ts → motoswap/IMotoswapRouterContract.ts} +2 -2
- package/src/abi/shared/interfaces/{IOP_20Contract.ts → opnet/IOP_20Contract.ts} +2 -3
- package/src/abi/shared/interfaces/{IOP_NETContract.ts → opnet/IOP_NETContract.ts} +2 -2
- package/src/abi/shared/interfaces/{IWBTCContract.ts → tests/IWBTCContract.ts} +3 -3
- package/src/abi/shared/json/{STAKING_ABI.ts → generic/STAKING_ABI.ts} +2 -2
- package/src/abi/shared/json/motoswap/EWMA_ABI.ts +289 -0
- package/src/abi/shared/json/{MOTOSWAP_FACTORY_ABI.ts → motoswap/MOTOSWAP_FACTORY_ABI.ts} +3 -3
- package/src/abi/shared/json/{MOTOSWAP_POOL_ABI.ts → motoswap/MOTOSWAP_POOL_ABI.ts} +3 -3
- package/src/abi/shared/json/{MOTOSWAP_ROUTER_ABI.ts → motoswap/MOTOSWAP_ROUTER_ABI.ts} +4 -4
- package/src/abi/shared/json/{OP_20_ABI.ts → opnet/OP_20_ABI.ts} +2 -2
- package/src/abi/shared/json/{OP_NET_ABI.ts → opnet/OP_NET_ABI.ts} +2 -2
- package/src/abi/shared/json/{WBTC_ABI.ts → tests/WBTC_ABI.ts} +4 -4
- package/src/opnet.ts +16 -20
- package/browser/abi/shared/json/MOTOSWAP_ROUTER_ABI.d.ts +0 -2
- package/browser/abi/shared/json/OP_NET_ABI.d.ts +0 -2
- package/build/abi/shared/json/MOTOSWAP_ROUTER_ABI.d.ts +0 -2
- package/build/abi/shared/json/OP_NET_ABI.d.ts +0 -2
- package/src/providers/interfaces/Generate.ts.disabled +0 -7
- package/src/transactions/decoders/UnwrapTransaction.ts.disabled +0 -67
- package/src/transactions/decoders/WrapTransaction.ts.disabled +0 -69
- package/src/transactions/interfaces/transactions/IUnwrapTransaction.ts.disabled +0 -59
- package/src/transactions/interfaces/transactions/IWrapTransaction.ts.disabled +0 -43
- /package/build/abi/shared/interfaces/{IStackingContract.js → generic/IStackingContract.js} +0 -0
- /package/build/abi/shared/interfaces/{IMotoswapFactoryContract.js → motoswap/IEwmaContract.js} +0 -0
- /package/build/abi/shared/interfaces/{IMotoswapPoolContract.js → motoswap/IMotoswapFactoryContract.js} +0 -0
- /package/build/abi/shared/interfaces/{IMotoswapRouterContract.js → motoswap/IMotoswapPoolContract.js} +0 -0
- /package/build/abi/shared/interfaces/{IOP_20Contract.js → motoswap/IMotoswapRouterContract.js} +0 -0
- /package/build/abi/shared/interfaces/{IOP_NETContract.js → opnet/IOP_20Contract.js} +0 -0
- /package/build/abi/shared/interfaces/{IWBTCContract.js → opnet/IOP_NETContract.js} +0 -0
package/.github/workflows/ci.yml
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
name: CI for OP_NET
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- '*'
|
|
7
7
|
|
|
8
8
|
jobs:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
9
|
+
build_and_publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: write
|
|
14
|
+
id-token: write
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout code
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Setup Node.js
|
|
21
|
+
uses: actions/setup-node@v4
|
|
22
|
+
with:
|
|
23
|
+
node-version: '22.x'
|
|
24
|
+
registry-url: 'https://registry.npmjs.org'
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: npm install
|
|
28
|
+
|
|
29
|
+
- name: Build the project
|
|
30
|
+
run: npm run build
|
|
31
|
+
|
|
32
|
+
- name: Build browser assets
|
|
33
|
+
run: npm run browserBuild
|
|
34
|
+
|
|
35
|
+
- name: Publish to npm
|
|
36
|
+
run: npm publish --provenance --access public
|
|
37
|
+
env:
|
|
38
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
39
|
+
|
|
40
|
+
- name: Create GitHub Release
|
|
41
|
+
uses: actions/create-release@v1
|
|
42
|
+
with:
|
|
43
|
+
tag_name: ${{ github.ref_name }}
|
|
44
|
+
release_name: Release ${{ github.ref_name }}
|
|
45
|
+
body: |
|
|
46
|
+
Automated release for OP_NET.
|
|
47
|
+
env:
|
|
48
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
package/browser/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.1.
|
|
1
|
+
export declare const version = "1.1.22";
|
package/browser/abi/shared/interfaces/{IStackingContract.d.ts → generic/IStackingContract.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Address } from '@btc-vision/transaction';
|
|
2
|
-
import { CallResult } from '
|
|
2
|
+
import { CallResult } from '../../../../contracts/CallResult.js';
|
|
3
3
|
export interface IStackingContract {
|
|
4
4
|
stake(amount: bigint): Promise<CallResult<{
|
|
5
5
|
success: boolean;
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
totalTokensReturned: bigint;
|
|
12
|
+
}>;
|
|
13
|
+
export type Swap = CallResult<{
|
|
14
|
+
ok: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
export type GetReserve = CallResult<{
|
|
17
|
+
liquidity: bigint;
|
|
18
|
+
reservedLiquidity: bigint;
|
|
19
|
+
}>;
|
|
20
|
+
export type GetQuote = CallResult<{
|
|
21
|
+
tokensOut: bigint;
|
|
22
|
+
requiredSatoshis: bigint;
|
|
23
|
+
currentPrice: bigint;
|
|
24
|
+
}>;
|
|
25
|
+
export type SetQuote = CallResult<{
|
|
26
|
+
ok: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
export interface IEwmaContract extends IOP_NETContract {
|
|
29
|
+
reserve(token: Address, maximumAmountIn: bigint, minimumAmountOut: bigint): Promise<ReserveEWMA>;
|
|
30
|
+
addLiquidity(token: Address, receiver: string, amountIn: bigint): Promise<AddLiquidity>;
|
|
31
|
+
removeLiquidity(token: Address): Promise<RemoveLiquidity>;
|
|
32
|
+
swap(token: Address, reservationId: bigint, isSimulation: boolean): Promise<Swap>;
|
|
33
|
+
getReserve(token: Address): Promise<GetReserve>;
|
|
34
|
+
getQuote(token: Address, satoshisIn: bigint): Promise<GetQuote>;
|
|
35
|
+
setQuote(token: Address, p0: bigint): Promise<SetQuote>;
|
|
36
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Address } from '@btc-vision/transaction';
|
|
2
|
-
import { CallResult } from '
|
|
3
|
-
import { IOP_NETContract } from '
|
|
2
|
+
import { CallResult } from '../../../../contracts/CallResult.js';
|
|
3
|
+
import { IOP_NETContract } from '../opnet/IOP_NETContract.js';
|
|
4
4
|
export interface IMotoswapFactoryContract extends IOP_NETContract {
|
|
5
5
|
getPool(token0: Address, token1: Address): Promise<CallResult<{
|
|
6
6
|
pool: bigint;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Address } from '@btc-vision/transaction';
|
|
2
|
-
import { CallResult } from '
|
|
3
|
-
import { IOP_20Contract } from '
|
|
2
|
+
import { CallResult } from '../../../../contracts/CallResult.js';
|
|
3
|
+
import { IOP_20Contract } from '../opnet/IOP_20Contract.js';
|
|
4
4
|
export type Reserves = {
|
|
5
5
|
readonly reserve0: bigint;
|
|
6
6
|
readonly reserve1: bigint;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Address } from '@btc-vision/transaction';
|
|
2
|
-
import { CallResult } from '
|
|
3
|
-
import { IOP_NETContract } from '
|
|
2
|
+
import { CallResult } from '../../../../contracts/CallResult.js';
|
|
3
|
+
import { IOP_NETContract } from '../opnet/IOP_NETContract.js';
|
|
4
4
|
export interface IMotoswapRouterContract extends IOP_NETContract {
|
|
5
5
|
addLiquidity(tokenA: Address, tokenB: Address, amountADesired: bigint, amountBDesired: bigint, amountAMin: bigint, amountBMin: bigint, to: Address, deadline: bigint): Promise<CallResult<{
|
|
6
6
|
amountA: bigint;
|
package/{build/abi/shared/interfaces → browser/abi/shared/interfaces/opnet}/IOP_20Contract.d.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Address, AddressMap } from '@btc-vision/transaction';
|
|
2
|
-
import { CallResult } from '
|
|
2
|
+
import { CallResult } from '../../../../contracts/CallResult.js';
|
|
3
3
|
import { IOP_NETContract } from './IOP_NETContract.js';
|
|
4
4
|
export type Name = CallResult<{
|
|
5
5
|
name: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Address } from '@btc-vision/transaction';
|
|
2
|
-
import { CallResult } from '
|
|
3
|
-
import { BaseContractProperties } from '
|
|
2
|
+
import { CallResult } from '../../../../contracts/CallResult.js';
|
|
3
|
+
import { BaseContractProperties } from '../../../interfaces/BaseContractProperties.js';
|
|
4
4
|
export interface IOP_NETContract extends BaseContractProperties {
|
|
5
5
|
owner(): Promise<CallResult<{
|
|
6
6
|
owner: Address;
|
package/{build/abi/shared/interfaces → browser/abi/shared/interfaces/tests}/IWBTCContract.d.ts
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Address } from '@btc-vision/transaction';
|
|
2
|
-
import { CallResult } from '
|
|
3
|
-
import { IOP_20Contract } from '
|
|
4
|
-
import { IStackingContract } from '
|
|
2
|
+
import { CallResult } from '../../../../contracts/CallResult.js';
|
|
3
|
+
import { IOP_20Contract } from '../opnet/IOP_20Contract.js';
|
|
4
|
+
import { IStackingContract } from '../generic/IStackingContract.js';
|
|
5
5
|
export type MergedOP_20AndStackingContract = IOP_20Contract & IStackingContract;
|
|
6
6
|
export interface IWBTCContract extends MergedOP_20AndStackingContract {
|
|
7
7
|
requestWithdrawal(amount: bigint): Promise<CallResult<{
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { BitcoinInterfaceAbi } from '
|
|
1
|
+
import { BitcoinInterfaceAbi } from '../../../interfaces/BitcoinInterfaceAbi.js';
|
|
2
2
|
export declare const StackingEvents: BitcoinInterfaceAbi;
|
|
3
3
|
export declare const STAKING_ABI: BitcoinInterfaceAbi;
|
package/browser/abi/shared/json/{MOTOSWAP_FACTORY_ABI.d.ts → motoswap/MOTOSWAP_FACTORY_ABI.d.ts}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { BitcoinInterfaceAbi } from '
|
|
1
|
+
import { BitcoinInterfaceAbi } from '../../../interfaces/BitcoinInterfaceAbi.js';
|
|
2
2
|
export declare const MotoSwapFactoryEvents: BitcoinInterfaceAbi;
|
|
3
3
|
export declare const MotoSwapFactoryAbi: BitcoinInterfaceAbi;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { BitcoinInterfaceAbi } from '
|
|
1
|
+
import { BitcoinInterfaceAbi } from '../../../interfaces/BitcoinInterfaceAbi.js';
|
|
2
2
|
export declare const MotoSwapPoolEvents: BitcoinInterfaceAbi;
|
|
3
3
|
export declare const MotoswapPoolAbi: BitcoinInterfaceAbi;
|