@1inch/swap-vm-sdk 0.1.0
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/LICENSE +103 -0
- package/README.md +584 -0
- package/dist/abi/SwapVM.abi.d.mts +403 -0
- package/dist/abi/SwapVM.abi.d.ts +403 -0
- package/dist/abi/index.d.mts +1 -0
- package/dist/abi/index.d.ts +1 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3842 -0
- package/dist/index.mjs +3777 -0
- package/dist/swap-vm/index.d.mts +6 -0
- package/dist/swap-vm/index.d.ts +6 -0
- package/dist/swap-vm/instructions/balances/balances-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/balances/balances-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/balances/balances-args.d.mts +17 -0
- package/dist/swap-vm/instructions/balances/balances-args.d.ts +17 -0
- package/dist/swap-vm/instructions/balances/index.d.mts +3 -0
- package/dist/swap-vm/instructions/balances/index.d.ts +3 -0
- package/dist/swap-vm/instructions/balances/opcodes.d.mts +12 -0
- package/dist/swap-vm/instructions/balances/opcodes.d.ts +12 -0
- package/dist/swap-vm/instructions/balances/types.d.mts +5 -0
- package/dist/swap-vm/instructions/balances/types.d.ts +5 -0
- package/dist/swap-vm/instructions/base-fee-adjuster/base-fee-adjuster-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/base-fee-adjuster/base-fee-adjuster-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/base-fee-adjuster/base-fee-adjuster-args.d.mts +40 -0
- package/dist/swap-vm/instructions/base-fee-adjuster/base-fee-adjuster-args.d.ts +40 -0
- package/dist/swap-vm/instructions/base-fee-adjuster/index.d.mts +2 -0
- package/dist/swap-vm/instructions/base-fee-adjuster/index.d.ts +2 -0
- package/dist/swap-vm/instructions/base-fee-adjuster/opcodes.d.mts +5 -0
- package/dist/swap-vm/instructions/base-fee-adjuster/opcodes.d.ts +5 -0
- package/dist/swap-vm/instructions/concentrate/concentrate-grow-liquidity-2d-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/concentrate/concentrate-grow-liquidity-2d-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/concentrate/concentrate-grow-liquidity-2d-args.d.mts +21 -0
- package/dist/swap-vm/instructions/concentrate/concentrate-grow-liquidity-2d-args.d.ts +21 -0
- package/dist/swap-vm/instructions/concentrate/concentrate-grow-liquidity-xd-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/concentrate/concentrate-grow-liquidity-xd-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/concentrate/concentrate-grow-liquidity-xd-args.d.mts +17 -0
- package/dist/swap-vm/instructions/concentrate/concentrate-grow-liquidity-xd-args.d.ts +17 -0
- package/dist/swap-vm/instructions/concentrate/index.d.mts +5 -0
- package/dist/swap-vm/instructions/concentrate/index.d.ts +5 -0
- package/dist/swap-vm/instructions/concentrate/opcodes.d.mts +10 -0
- package/dist/swap-vm/instructions/concentrate/opcodes.d.ts +10 -0
- package/dist/swap-vm/instructions/concentrate/types.d.mts +5 -0
- package/dist/swap-vm/instructions/concentrate/types.d.ts +5 -0
- package/dist/swap-vm/instructions/concentrate/utils.d.mts +4 -0
- package/dist/swap-vm/instructions/concentrate/utils.d.ts +4 -0
- package/dist/swap-vm/instructions/controls/deadline-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/controls/deadline-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/controls/deadline-args.d.mts +9 -0
- package/dist/swap-vm/instructions/controls/deadline-args.d.ts +9 -0
- package/dist/swap-vm/instructions/controls/index.d.mts +8 -0
- package/dist/swap-vm/instructions/controls/index.d.ts +8 -0
- package/dist/swap-vm/instructions/controls/jump-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/controls/jump-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/controls/jump-args.d.mts +16 -0
- package/dist/swap-vm/instructions/controls/jump-args.d.ts +16 -0
- package/dist/swap-vm/instructions/controls/jump-if-token-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/controls/jump-if-token-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/controls/jump-if-token-args.d.mts +10 -0
- package/dist/swap-vm/instructions/controls/jump-if-token-args.d.ts +10 -0
- package/dist/swap-vm/instructions/controls/only-taker-token-balance-gte-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/controls/only-taker-token-balance-gte-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/controls/only-taker-token-balance-gte-args.d.mts +17 -0
- package/dist/swap-vm/instructions/controls/only-taker-token-balance-gte-args.d.ts +17 -0
- package/dist/swap-vm/instructions/controls/only-taker-token-balance-non-zero-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/controls/only-taker-token-balance-non-zero-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/controls/only-taker-token-balance-non-zero-args.d.mts +16 -0
- package/dist/swap-vm/instructions/controls/only-taker-token-balance-non-zero-args.d.ts +16 -0
- package/dist/swap-vm/instructions/controls/only-taker-token-supply-share-gte-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/controls/only-taker-token-supply-share-gte-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/controls/only-taker-token-supply-share-gte-args.d.mts +18 -0
- package/dist/swap-vm/instructions/controls/only-taker-token-supply-share-gte-args.d.ts +18 -0
- package/dist/swap-vm/instructions/controls/opcodes.d.mts +36 -0
- package/dist/swap-vm/instructions/controls/opcodes.d.ts +36 -0
- package/dist/swap-vm/instructions/controls/salt-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/controls/salt-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/controls/salt-args.d.mts +16 -0
- package/dist/swap-vm/instructions/controls/salt-args.d.ts +16 -0
- package/dist/swap-vm/instructions/debug/debug-args.d.mts +8 -0
- package/dist/swap-vm/instructions/debug/debug-args.d.ts +8 -0
- package/dist/swap-vm/instructions/debug/debug-empty-args.d.mts +19 -0
- package/dist/swap-vm/instructions/debug/debug-empty-args.d.ts +19 -0
- package/dist/swap-vm/instructions/debug/opcodes.d.mts +18 -0
- package/dist/swap-vm/instructions/debug/opcodes.d.ts +18 -0
- package/dist/swap-vm/instructions/debug/print-amount-for-swap.d.mts +16 -0
- package/dist/swap-vm/instructions/debug/print-amount-for-swap.d.ts +16 -0
- package/dist/swap-vm/instructions/debug/print-context.d.mts +16 -0
- package/dist/swap-vm/instructions/debug/print-context.d.ts +16 -0
- package/dist/swap-vm/instructions/debug/print-free-memory-pointer.d.mts +16 -0
- package/dist/swap-vm/instructions/debug/print-free-memory-pointer.d.ts +16 -0
- package/dist/swap-vm/instructions/debug/print-gas-left.d.mts +16 -0
- package/dist/swap-vm/instructions/debug/print-gas-left.d.ts +16 -0
- package/dist/swap-vm/instructions/debug/print-swap-query.d.mts +16 -0
- package/dist/swap-vm/instructions/debug/print-swap-query.d.ts +16 -0
- package/dist/swap-vm/instructions/debug/print-swap-registers.d.mts +16 -0
- package/dist/swap-vm/instructions/debug/print-swap-registers.d.ts +16 -0
- package/dist/swap-vm/instructions/decay/decay-xd-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/decay/decay-xd-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/decay/decay-xd-args.d.mts +16 -0
- package/dist/swap-vm/instructions/decay/decay-xd-args.d.ts +16 -0
- package/dist/swap-vm/instructions/decay/index.d.mts +2 -0
- package/dist/swap-vm/instructions/decay/index.d.ts +2 -0
- package/dist/swap-vm/instructions/decay/opcodes.d.mts +5 -0
- package/dist/swap-vm/instructions/decay/opcodes.d.ts +5 -0
- package/dist/swap-vm/instructions/dutch-auction/dutch-auction-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/dutch-auction/dutch-auction-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/dutch-auction/dutch-auction-args.d.mts +44 -0
- package/dist/swap-vm/instructions/dutch-auction/dutch-auction-args.d.ts +44 -0
- package/dist/swap-vm/instructions/dutch-auction/index.d.mts +2 -0
- package/dist/swap-vm/instructions/dutch-auction/index.d.ts +2 -0
- package/dist/swap-vm/instructions/dutch-auction/opcodes.d.mts +10 -0
- package/dist/swap-vm/instructions/dutch-auction/opcodes.d.ts +10 -0
- package/dist/swap-vm/instructions/empty.d.mts +13 -0
- package/dist/swap-vm/instructions/empty.d.ts +13 -0
- package/dist/swap-vm/instructions/extruction/extruction-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/extruction/extruction-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/extruction/extruction-args.d.mts +21 -0
- package/dist/swap-vm/instructions/extruction/extruction-args.d.ts +21 -0
- package/dist/swap-vm/instructions/extruction/index.d.mts +2 -0
- package/dist/swap-vm/instructions/extruction/index.d.ts +2 -0
- package/dist/swap-vm/instructions/extruction/opcodes.d.mts +5 -0
- package/dist/swap-vm/instructions/extruction/opcodes.d.ts +5 -0
- package/dist/swap-vm/instructions/fee/flat-fee-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/fee/flat-fee-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/fee/flat-fee-args.d.mts +28 -0
- package/dist/swap-vm/instructions/fee/flat-fee-args.d.ts +28 -0
- package/dist/swap-vm/instructions/fee/index.d.mts +3 -0
- package/dist/swap-vm/instructions/fee/index.d.ts +3 -0
- package/dist/swap-vm/instructions/fee/opcodes.d.mts +30 -0
- package/dist/swap-vm/instructions/fee/opcodes.d.ts +30 -0
- package/dist/swap-vm/instructions/fee/protocol-fee-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/fee/protocol-fee-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/fee/protocol-fee-args.d.mts +35 -0
- package/dist/swap-vm/instructions/fee/protocol-fee-args.d.ts +35 -0
- package/dist/swap-vm/instructions/index.d.mts +29 -0
- package/dist/swap-vm/instructions/index.d.ts +29 -0
- package/dist/swap-vm/instructions/instruction.d.mts +7 -0
- package/dist/swap-vm/instructions/instruction.d.ts +7 -0
- package/dist/swap-vm/instructions/invalidators/index.d.mts +4 -0
- package/dist/swap-vm/instructions/invalidators/index.d.ts +4 -0
- package/dist/swap-vm/instructions/invalidators/invalidate-bit-1d-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/invalidators/invalidate-bit-1d-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/invalidators/invalidate-bit-1d-args.d.mts +16 -0
- package/dist/swap-vm/instructions/invalidators/invalidate-bit-1d-args.d.ts +16 -0
- package/dist/swap-vm/instructions/invalidators/invalidate-token-in-1d-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/invalidators/invalidate-token-in-1d-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/invalidators/invalidate-token-in-1d-args.d.mts +8 -0
- package/dist/swap-vm/instructions/invalidators/invalidate-token-in-1d-args.d.ts +8 -0
- package/dist/swap-vm/instructions/invalidators/invalidate-token-out-1d-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/invalidators/invalidate-token-out-1d-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/invalidators/invalidate-token-out-1d-args.d.mts +8 -0
- package/dist/swap-vm/instructions/invalidators/invalidate-token-out-1d-args.d.ts +8 -0
- package/dist/swap-vm/instructions/invalidators/opcodes.d.mts +15 -0
- package/dist/swap-vm/instructions/invalidators/opcodes.d.ts +15 -0
- package/dist/swap-vm/instructions/limit-swap/index.d.mts +2 -0
- package/dist/swap-vm/instructions/limit-swap/index.d.ts +2 -0
- package/dist/swap-vm/instructions/limit-swap/limit-swap-direction-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/limit-swap/limit-swap-direction-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/limit-swap/limit-swap-direction-args.d.mts +24 -0
- package/dist/swap-vm/instructions/limit-swap/limit-swap-direction-args.d.ts +24 -0
- package/dist/swap-vm/instructions/limit-swap/opcodes.d.mts +10 -0
- package/dist/swap-vm/instructions/limit-swap/opcodes.d.ts +10 -0
- package/dist/swap-vm/instructions/min-rate/index.d.mts +2 -0
- package/dist/swap-vm/instructions/min-rate/index.d.ts +2 -0
- package/dist/swap-vm/instructions/min-rate/min-rate-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/min-rate/min-rate-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/min-rate/min-rate-args.d.mts +22 -0
- package/dist/swap-vm/instructions/min-rate/min-rate-args.d.ts +22 -0
- package/dist/swap-vm/instructions/min-rate/opcodes.d.mts +10 -0
- package/dist/swap-vm/instructions/min-rate/opcodes.d.ts +10 -0
- package/dist/swap-vm/instructions/opcode.d.mts +8 -0
- package/dist/swap-vm/instructions/opcode.d.ts +8 -0
- package/dist/swap-vm/instructions/oracle-price-adjuster/index.d.mts +2 -0
- package/dist/swap-vm/instructions/oracle-price-adjuster/index.d.ts +2 -0
- package/dist/swap-vm/instructions/oracle-price-adjuster/opcodes.d.mts +5 -0
- package/dist/swap-vm/instructions/oracle-price-adjuster/opcodes.d.ts +5 -0
- package/dist/swap-vm/instructions/oracle-price-adjuster/oracle-price-adjuster-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/oracle-price-adjuster/oracle-price-adjuster-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/oracle-price-adjuster/oracle-price-adjuster-args.d.mts +41 -0
- package/dist/swap-vm/instructions/oracle-price-adjuster/oracle-price-adjuster-args.d.ts +41 -0
- package/dist/swap-vm/instructions/stable-swap/index.d.mts +2 -0
- package/dist/swap-vm/instructions/stable-swap/index.d.ts +2 -0
- package/dist/swap-vm/instructions/stable-swap/opcodes.d.mts +4 -0
- package/dist/swap-vm/instructions/stable-swap/opcodes.d.ts +4 -0
- package/dist/swap-vm/instructions/stable-swap/stable-swap-2d-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/stable-swap/stable-swap-2d-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/stable-swap/stable-swap-2d-args.d.mts +25 -0
- package/dist/swap-vm/instructions/stable-swap/stable-swap-2d-args.d.ts +25 -0
- package/dist/swap-vm/instructions/twap-swap/index.d.mts +2 -0
- package/dist/swap-vm/instructions/twap-swap/index.d.ts +2 -0
- package/dist/swap-vm/instructions/twap-swap/opcodes.d.mts +5 -0
- package/dist/swap-vm/instructions/twap-swap/opcodes.d.ts +5 -0
- package/dist/swap-vm/instructions/twap-swap/twap-swap-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/twap-swap/twap-swap-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/twap-swap/twap-swap-args.d.mts +71 -0
- package/dist/swap-vm/instructions/twap-swap/twap-swap-args.d.ts +71 -0
- package/dist/swap-vm/instructions/types.d.mts +18 -0
- package/dist/swap-vm/instructions/types.d.ts +18 -0
- package/dist/swap-vm/instructions/xyc-swap/index.d.mts +2 -0
- package/dist/swap-vm/instructions/xyc-swap/index.d.ts +2 -0
- package/dist/swap-vm/instructions/xyc-swap/opcodes.d.mts +5 -0
- package/dist/swap-vm/instructions/xyc-swap/opcodes.d.ts +5 -0
- package/dist/swap-vm/instructions/xyc-swap/xyc-swap-xd-args-coder.d.mts +7 -0
- package/dist/swap-vm/instructions/xyc-swap/xyc-swap-xd-args-coder.d.ts +7 -0
- package/dist/swap-vm/instructions/xyc-swap/xyc-swap-xd-args.d.mts +15 -0
- package/dist/swap-vm/instructions/xyc-swap/xyc-swap-xd-args.d.ts +15 -0
- package/dist/swap-vm/maker-traits.d.mts +206 -0
- package/dist/swap-vm/maker-traits.d.ts +206 -0
- package/dist/swap-vm/order.d.mts +84 -0
- package/dist/swap-vm/order.d.ts +84 -0
- package/dist/swap-vm/programs/aqua-program-builder.d.mts +118 -0
- package/dist/swap-vm/programs/aqua-program-builder.d.ts +118 -0
- package/dist/swap-vm/programs/index.d.mts +4 -0
- package/dist/swap-vm/programs/index.d.ts +4 -0
- package/dist/swap-vm/programs/program-builder.d.mts +26 -0
- package/dist/swap-vm/programs/program-builder.d.ts +26 -0
- package/dist/swap-vm/programs/regular-program-builder.d.mts +187 -0
- package/dist/swap-vm/programs/regular-program-builder.d.ts +187 -0
- package/dist/swap-vm/programs/swap-vm-program.d.mts +6 -0
- package/dist/swap-vm/programs/swap-vm-program.d.ts +6 -0
- package/dist/swap-vm/strategies/aqua-amm-strategy.d.mts +32 -0
- package/dist/swap-vm/strategies/aqua-amm-strategy.d.ts +32 -0
- package/dist/swap-vm/strategies/index.d.mts +1 -0
- package/dist/swap-vm/strategies/index.d.ts +1 -0
- package/dist/swap-vm/taker-traits.d.mts +214 -0
- package/dist/swap-vm/taker-traits.d.ts +214 -0
- package/dist/swap-vm/types.d.mts +22 -0
- package/dist/swap-vm/types.d.ts +22 -0
- package/dist/swap-vm-contract/constants.d.mts +13 -0
- package/dist/swap-vm-contract/constants.d.ts +13 -0
- package/dist/swap-vm-contract/events/index.d.mts +1 -0
- package/dist/swap-vm-contract/events/index.d.ts +1 -0
- package/dist/swap-vm-contract/events/swapped-event.d.mts +19 -0
- package/dist/swap-vm-contract/events/swapped-event.d.ts +19 -0
- package/dist/swap-vm-contract/index.d.mts +4 -0
- package/dist/swap-vm-contract/index.d.ts +4 -0
- package/dist/swap-vm-contract/swap-vm-contract.d.mts +38 -0
- package/dist/swap-vm-contract/swap-vm-contract.d.ts +38 -0
- package/dist/swap-vm-contract/types.d.mts +22 -0
- package/dist/swap-vm-contract/types.d.ts +22 -0
- package/package.json +72 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HexString } from '@1inch/sdk-core';
|
|
2
|
+
import { DutchAuctionArgs } from './dutch-auction-args';
|
|
3
|
+
import type { IArgsCoder } from '../types';
|
|
4
|
+
export declare class DutchAuctionArgsCoder implements IArgsCoder<DutchAuctionArgs> {
|
|
5
|
+
encode(args: DutchAuctionArgs): HexString;
|
|
6
|
+
decode(data: HexString): DutchAuctionArgs;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HexString } from '@1inch/sdk-core';
|
|
2
|
+
import { DutchAuctionArgs } from './dutch-auction-args';
|
|
3
|
+
import type { IArgsCoder } from '../types';
|
|
4
|
+
export declare class DutchAuctionArgsCoder implements IArgsCoder<DutchAuctionArgs> {
|
|
5
|
+
encode(args: DutchAuctionArgs): HexString;
|
|
6
|
+
decode(data: HexString): DutchAuctionArgs;
|
|
7
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { HexString } from '@1inch/sdk-core';
|
|
2
|
+
import type { IArgsData } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* @notice Dutch Auction instruction for time-based price decay with deadline
|
|
5
|
+
* @dev Implements an exponential decay auction mechanism that works after any swap:
|
|
6
|
+
* - Designed to be used after any swap instruction (LimitSwap, XYCSwap, etc.) which sets amounts
|
|
7
|
+
* - Applies time-based decay to the amounts calculated by the previous swap
|
|
8
|
+
* - Maker sells token0 and receives token1
|
|
9
|
+
* - Price improves for taker over time through exponential decay until deadline
|
|
10
|
+
* - Reverts if current time exceeds deadline
|
|
11
|
+
* - Only works for 1=>0 swaps (token1 to token0)
|
|
12
|
+
*
|
|
13
|
+
* The decay factor determines the price reduction rate:
|
|
14
|
+
* - 1.0e18 = no decay (constant price)
|
|
15
|
+
* - 0.999e18 = 0.1% decay per second
|
|
16
|
+
* - 0.99e18 = 1% decay per second
|
|
17
|
+
* - 0.9e18 = 10% decay per second
|
|
18
|
+
*
|
|
19
|
+
* Example usage:
|
|
20
|
+
* 1. Any swap instruction sets: 100 token1 → 1000 token0
|
|
21
|
+
* 2. DutchAuction with decayFactor = 0.99e18, after 100 seconds:
|
|
22
|
+
* - exactIn: Taker gets ~2.73x more token0 for the same token1
|
|
23
|
+
* - exactOut: Taker needs only ~36.6% of initial token1
|
|
24
|
+
* 3. After deadline, the auction expires and cannot be executed
|
|
25
|
+
*
|
|
26
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/DutchAuction.sol#L66
|
|
27
|
+
*/
|
|
28
|
+
export declare class DutchAuctionArgs implements IArgsData {
|
|
29
|
+
readonly startTime: bigint;
|
|
30
|
+
readonly duration: bigint;
|
|
31
|
+
readonly decayFactor: bigint;
|
|
32
|
+
static readonly CODER: any;
|
|
33
|
+
/**
|
|
34
|
+
* startTime - auction start time (uint40)
|
|
35
|
+
* duration - auction duration in seconds (uint16)
|
|
36
|
+
* decayFactor - price decay per second, 1e18 = no decay (uint32)
|
|
37
|
+
**/
|
|
38
|
+
constructor(startTime: bigint, duration: bigint, decayFactor: bigint);
|
|
39
|
+
/**
|
|
40
|
+
* Decodes hex data into DutchAuctionArgs instance
|
|
41
|
+
**/
|
|
42
|
+
static decode(data: HexString): DutchAuctionArgs;
|
|
43
|
+
toJSON(): Record<string, unknown>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { HexString } from '@1inch/sdk-core';
|
|
2
|
+
import type { IArgsData } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* @notice Dutch Auction instruction for time-based price decay with deadline
|
|
5
|
+
* @dev Implements an exponential decay auction mechanism that works after any swap:
|
|
6
|
+
* - Designed to be used after any swap instruction (LimitSwap, XYCSwap, etc.) which sets amounts
|
|
7
|
+
* - Applies time-based decay to the amounts calculated by the previous swap
|
|
8
|
+
* - Maker sells token0 and receives token1
|
|
9
|
+
* - Price improves for taker over time through exponential decay until deadline
|
|
10
|
+
* - Reverts if current time exceeds deadline
|
|
11
|
+
* - Only works for 1=>0 swaps (token1 to token0)
|
|
12
|
+
*
|
|
13
|
+
* The decay factor determines the price reduction rate:
|
|
14
|
+
* - 1.0e18 = no decay (constant price)
|
|
15
|
+
* - 0.999e18 = 0.1% decay per second
|
|
16
|
+
* - 0.99e18 = 1% decay per second
|
|
17
|
+
* - 0.9e18 = 10% decay per second
|
|
18
|
+
*
|
|
19
|
+
* Example usage:
|
|
20
|
+
* 1. Any swap instruction sets: 100 token1 → 1000 token0
|
|
21
|
+
* 2. DutchAuction with decayFactor = 0.99e18, after 100 seconds:
|
|
22
|
+
* - exactIn: Taker gets ~2.73x more token0 for the same token1
|
|
23
|
+
* - exactOut: Taker needs only ~36.6% of initial token1
|
|
24
|
+
* 3. After deadline, the auction expires and cannot be executed
|
|
25
|
+
*
|
|
26
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/DutchAuction.sol#L66
|
|
27
|
+
*/
|
|
28
|
+
export declare class DutchAuctionArgs implements IArgsData {
|
|
29
|
+
readonly startTime: bigint;
|
|
30
|
+
readonly duration: bigint;
|
|
31
|
+
readonly decayFactor: bigint;
|
|
32
|
+
static readonly CODER: any;
|
|
33
|
+
/**
|
|
34
|
+
* startTime - auction start time (uint40)
|
|
35
|
+
* duration - auction duration in seconds (uint16)
|
|
36
|
+
* decayFactor - price decay per second, 1e18 = no decay (uint32)
|
|
37
|
+
**/
|
|
38
|
+
constructor(startTime: bigint, duration: bigint, decayFactor: bigint);
|
|
39
|
+
/**
|
|
40
|
+
* Decodes hex data into DutchAuctionArgs instance
|
|
41
|
+
**/
|
|
42
|
+
static decode(data: HexString): DutchAuctionArgs;
|
|
43
|
+
toJSON(): Record<string, unknown>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dutch auction with time-based decay on amountIn
|
|
3
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/DutchAuction.sol#L75
|
|
4
|
+
**/
|
|
5
|
+
export declare const dutchAuctionBalanceIn1D: any;
|
|
6
|
+
/**
|
|
7
|
+
* Dutch auction with time-based decay on amountOut
|
|
8
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/DutchAuction.sol#L85
|
|
9
|
+
**/
|
|
10
|
+
export declare const dutchAuctionBalanceOut1D: any;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dutch auction with time-based decay on amountIn
|
|
3
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/DutchAuction.sol#L75
|
|
4
|
+
**/
|
|
5
|
+
export declare const dutchAuctionBalanceIn1D: any;
|
|
6
|
+
/**
|
|
7
|
+
* Dutch auction with time-based decay on amountOut
|
|
8
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/DutchAuction.sol#L85
|
|
9
|
+
**/
|
|
10
|
+
export declare const dutchAuctionBalanceOut1D: any;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HexString } from '@1inch/sdk-core';
|
|
2
|
+
import type { IArgsCoder, IArgsData } from './types';
|
|
3
|
+
import { Opcode } from './opcode';
|
|
4
|
+
declare class EmptyCoder implements IArgsCoder<EmptyArgs> {
|
|
5
|
+
encode(_: EmptyArgs): HexString;
|
|
6
|
+
decode(_: HexString): EmptyArgs;
|
|
7
|
+
}
|
|
8
|
+
declare class EmptyArgs implements IArgsData {
|
|
9
|
+
static readonly CODER: EmptyCoder;
|
|
10
|
+
toJSON(): null;
|
|
11
|
+
}
|
|
12
|
+
export declare const EMPTY_OPCODE: Opcode<EmptyArgs>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HexString } from '@1inch/sdk-core';
|
|
2
|
+
import type { IArgsCoder, IArgsData } from './types';
|
|
3
|
+
import { Opcode } from './opcode';
|
|
4
|
+
declare class EmptyCoder implements IArgsCoder<EmptyArgs> {
|
|
5
|
+
encode(_: EmptyArgs): HexString;
|
|
6
|
+
decode(_: HexString): EmptyArgs;
|
|
7
|
+
}
|
|
8
|
+
declare class EmptyArgs implements IArgsData {
|
|
9
|
+
static readonly CODER: EmptyCoder;
|
|
10
|
+
toJSON(): null;
|
|
11
|
+
}
|
|
12
|
+
export declare const EMPTY_OPCODE: Opcode<EmptyArgs>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HexString } from '@1inch/sdk-core';
|
|
2
|
+
import { ExtructionArgs } from './extruction-args';
|
|
3
|
+
import type { IArgsCoder } from '../types';
|
|
4
|
+
export declare class ExtructionArgsCoder implements IArgsCoder<ExtructionArgs> {
|
|
5
|
+
encode(args: ExtructionArgs): HexString;
|
|
6
|
+
decode(data: HexString): ExtructionArgs;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HexString } from '@1inch/sdk-core';
|
|
2
|
+
import { ExtructionArgs } from './extruction-args';
|
|
3
|
+
import type { IArgsCoder } from '../types';
|
|
4
|
+
export declare class ExtructionArgsCoder implements IArgsCoder<ExtructionArgs> {
|
|
5
|
+
encode(args: ExtructionArgs): HexString;
|
|
6
|
+
decode(data: HexString): ExtructionArgs;
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Address, HexString } from '@1inch/sdk-core';
|
|
2
|
+
import type { IArgsData } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Arguments for extruction instruction to call external contract logic
|
|
5
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/Extruction.sol#L33
|
|
6
|
+
**/
|
|
7
|
+
export declare class ExtructionArgs implements IArgsData {
|
|
8
|
+
readonly target: Address;
|
|
9
|
+
readonly extructionArgs: HexString;
|
|
10
|
+
static readonly CODER: any;
|
|
11
|
+
/**
|
|
12
|
+
* target - External contract address (20 bytes)
|
|
13
|
+
* extructionArgs - Arguments to pass to external contract (variable)
|
|
14
|
+
**/
|
|
15
|
+
constructor(target: Address, extructionArgs: HexString);
|
|
16
|
+
/**
|
|
17
|
+
* Decodes hex data into ExtructionArgs instance
|
|
18
|
+
**/
|
|
19
|
+
static decode(data: HexString): ExtructionArgs;
|
|
20
|
+
toJSON(): Record<string, unknown>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Address, HexString } from '@1inch/sdk-core';
|
|
2
|
+
import type { IArgsData } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Arguments for extruction instruction to call external contract logic
|
|
5
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/Extruction.sol#L33
|
|
6
|
+
**/
|
|
7
|
+
export declare class ExtructionArgs implements IArgsData {
|
|
8
|
+
readonly target: Address;
|
|
9
|
+
readonly extructionArgs: HexString;
|
|
10
|
+
static readonly CODER: any;
|
|
11
|
+
/**
|
|
12
|
+
* target - External contract address (20 bytes)
|
|
13
|
+
* extructionArgs - Arguments to pass to external contract (variable)
|
|
14
|
+
**/
|
|
15
|
+
constructor(target: Address, extructionArgs: HexString);
|
|
16
|
+
/**
|
|
17
|
+
* Decodes hex data into ExtructionArgs instance
|
|
18
|
+
**/
|
|
19
|
+
static decode(data: HexString): ExtructionArgs;
|
|
20
|
+
toJSON(): Record<string, unknown>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HexString } from '@1inch/sdk-core';
|
|
2
|
+
import { FlatFeeArgs } from './flat-fee-args';
|
|
3
|
+
import type { IArgsCoder } from '../types';
|
|
4
|
+
export declare class FlatFeeArgsCoder implements IArgsCoder<FlatFeeArgs> {
|
|
5
|
+
encode(args: FlatFeeArgs): HexString;
|
|
6
|
+
decode(data: HexString): FlatFeeArgs;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HexString } from '@1inch/sdk-core';
|
|
2
|
+
import { FlatFeeArgs } from './flat-fee-args';
|
|
3
|
+
import type { IArgsCoder } from '../types';
|
|
4
|
+
export declare class FlatFeeArgsCoder implements IArgsCoder<FlatFeeArgs> {
|
|
5
|
+
encode(args: FlatFeeArgs): HexString;
|
|
6
|
+
decode(data: HexString): FlatFeeArgs;
|
|
7
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { HexString } from '@1inch/sdk-core';
|
|
2
|
+
import type { IArgsData } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Arguments for flat fee instructions (flatFeeXD, flatFeeAmountInXD, flatFeeAmountOutXD, progressiveFeeXD)
|
|
5
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/Fee.sol#L66
|
|
6
|
+
**/
|
|
7
|
+
export declare class FlatFeeArgs implements IArgsData {
|
|
8
|
+
readonly fee: bigint;
|
|
9
|
+
static readonly CODER: any;
|
|
10
|
+
constructor(fee: bigint);
|
|
11
|
+
/**
|
|
12
|
+
* Decodes hex data into FlatFeeArgs instance
|
|
13
|
+
**/
|
|
14
|
+
static decode(data: HexString): FlatFeeArgs;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a FlatFeeArgs instance from percentage
|
|
17
|
+
* @param percent - Fee as percentage (e.g., 1 for 1%, 0.1 for 0.1%)
|
|
18
|
+
* @returns FlatFeeArgs instance
|
|
19
|
+
*/
|
|
20
|
+
static fromPercent(percent: number): FlatFeeArgs;
|
|
21
|
+
/**
|
|
22
|
+
* Creates a FlatFeeArgs instance from basis points
|
|
23
|
+
* @param bps - Fee in basis points (10000 bps = 100%)
|
|
24
|
+
* @returns FlatFeeArgs instance
|
|
25
|
+
*/
|
|
26
|
+
static fromBps(bps: number): FlatFeeArgs;
|
|
27
|
+
toJSON(): Record<string, unknown>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { HexString } from '@1inch/sdk-core';
|
|
2
|
+
import type { IArgsData } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Arguments for flat fee instructions (flatFeeXD, flatFeeAmountInXD, flatFeeAmountOutXD, progressiveFeeXD)
|
|
5
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/Fee.sol#L66
|
|
6
|
+
**/
|
|
7
|
+
export declare class FlatFeeArgs implements IArgsData {
|
|
8
|
+
readonly fee: bigint;
|
|
9
|
+
static readonly CODER: any;
|
|
10
|
+
constructor(fee: bigint);
|
|
11
|
+
/**
|
|
12
|
+
* Decodes hex data into FlatFeeArgs instance
|
|
13
|
+
**/
|
|
14
|
+
static decode(data: HexString): FlatFeeArgs;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a FlatFeeArgs instance from percentage
|
|
17
|
+
* @param percent - Fee as percentage (e.g., 1 for 1%, 0.1 for 0.1%)
|
|
18
|
+
* @returns FlatFeeArgs instance
|
|
19
|
+
*/
|
|
20
|
+
static fromPercent(percent: number): FlatFeeArgs;
|
|
21
|
+
/**
|
|
22
|
+
* Creates a FlatFeeArgs instance from basis points
|
|
23
|
+
* @param bps - Fee in basis points (10000 bps = 100%)
|
|
24
|
+
* @returns FlatFeeArgs instance
|
|
25
|
+
*/
|
|
26
|
+
static fromBps(bps: number): FlatFeeArgs;
|
|
27
|
+
toJSON(): Record<string, unknown>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Applies fee to amountIn
|
|
3
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/Fee.sol#L66
|
|
4
|
+
**/
|
|
5
|
+
export declare const flatFeeAmountInXD: any;
|
|
6
|
+
/**
|
|
7
|
+
* Applies fee to amountOut
|
|
8
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/Fee.sol#L72
|
|
9
|
+
**/
|
|
10
|
+
export declare const flatFeeAmountOutXD: any;
|
|
11
|
+
/**
|
|
12
|
+
* Applies progressive fee to amountIn
|
|
13
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/Fee.sol#L78
|
|
14
|
+
**/
|
|
15
|
+
export declare const progressiveFeeInXD: any;
|
|
16
|
+
/**
|
|
17
|
+
* Applies progressive fee to amountOut
|
|
18
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/Fee.sol#L106
|
|
19
|
+
**/
|
|
20
|
+
export declare const progressiveFeeOutXD: any;
|
|
21
|
+
/**
|
|
22
|
+
* Applies protocol fee to amountOut with direct transfer
|
|
23
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/Fee.sol#L102
|
|
24
|
+
**/
|
|
25
|
+
export declare const protocolFeeAmountOutXD: any;
|
|
26
|
+
/**
|
|
27
|
+
* Applies protocol fee to amountOut through Aqua protocol
|
|
28
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/Fee.sol#L110
|
|
29
|
+
**/
|
|
30
|
+
export declare const aquaProtocolFeeAmountOutXD: any;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Applies fee to amountIn
|
|
3
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/Fee.sol#L66
|
|
4
|
+
**/
|
|
5
|
+
export declare const flatFeeAmountInXD: any;
|
|
6
|
+
/**
|
|
7
|
+
* Applies fee to amountOut
|
|
8
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/Fee.sol#L72
|
|
9
|
+
**/
|
|
10
|
+
export declare const flatFeeAmountOutXD: any;
|
|
11
|
+
/**
|
|
12
|
+
* Applies progressive fee to amountIn
|
|
13
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/Fee.sol#L78
|
|
14
|
+
**/
|
|
15
|
+
export declare const progressiveFeeInXD: any;
|
|
16
|
+
/**
|
|
17
|
+
* Applies progressive fee to amountOut
|
|
18
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/Fee.sol#L106
|
|
19
|
+
**/
|
|
20
|
+
export declare const progressiveFeeOutXD: any;
|
|
21
|
+
/**
|
|
22
|
+
* Applies protocol fee to amountOut with direct transfer
|
|
23
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/Fee.sol#L102
|
|
24
|
+
**/
|
|
25
|
+
export declare const protocolFeeAmountOutXD: any;
|
|
26
|
+
/**
|
|
27
|
+
* Applies protocol fee to amountOut through Aqua protocol
|
|
28
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/Fee.sol#L110
|
|
29
|
+
**/
|
|
30
|
+
export declare const aquaProtocolFeeAmountOutXD: any;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HexString } from '@1inch/sdk-core';
|
|
2
|
+
import { ProtocolFeeArgs } from './protocol-fee-args';
|
|
3
|
+
import type { IArgsCoder } from '../types';
|
|
4
|
+
export declare class ProtocolFeeArgsCoder implements IArgsCoder<ProtocolFeeArgs> {
|
|
5
|
+
encode(args: ProtocolFeeArgs): HexString;
|
|
6
|
+
decode(data: HexString): ProtocolFeeArgs;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HexString } from '@1inch/sdk-core';
|
|
2
|
+
import { ProtocolFeeArgs } from './protocol-fee-args';
|
|
3
|
+
import type { IArgsCoder } from '../types';
|
|
4
|
+
export declare class ProtocolFeeArgsCoder implements IArgsCoder<ProtocolFeeArgs> {
|
|
5
|
+
encode(args: ProtocolFeeArgs): HexString;
|
|
6
|
+
decode(data: HexString): ProtocolFeeArgs;
|
|
7
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Address, HexString } from '@1inch/sdk-core';
|
|
2
|
+
import type { IArgsData } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Arguments for protocol fee instructions (protocolFeeAmountOutXD, aquaProtocolFeeAmountOutXD)
|
|
5
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/Fee.sol#L102
|
|
6
|
+
**/
|
|
7
|
+
export declare class ProtocolFeeArgs implements IArgsData {
|
|
8
|
+
readonly fee: bigint;
|
|
9
|
+
readonly to: Address;
|
|
10
|
+
static readonly CODER: any;
|
|
11
|
+
/**
|
|
12
|
+
* fee - 1e9 = 100% (uint32)
|
|
13
|
+
* to - address to send pulled tokens to (20 bytes)
|
|
14
|
+
**/
|
|
15
|
+
constructor(fee: bigint, to: Address);
|
|
16
|
+
/**
|
|
17
|
+
* Decodes hex data into ProtocolFeeArgs instance
|
|
18
|
+
**/
|
|
19
|
+
static decode(data: HexString): ProtocolFeeArgs;
|
|
20
|
+
/**
|
|
21
|
+
* Creates a ProtocolFeeArgs instance from percentage
|
|
22
|
+
* @param percent - Fee as percentage (e.g., 1 for 1%, 0.1 for 0.1%)
|
|
23
|
+
* @param to - Address to receive the protocol fee
|
|
24
|
+
* @returns ProtocolFeeArgs instance
|
|
25
|
+
*/
|
|
26
|
+
static fromPercent(percent: number, to: Address): ProtocolFeeArgs;
|
|
27
|
+
/**
|
|
28
|
+
* Creates a ProtocolFeeArgs instance from basis points
|
|
29
|
+
* @param bps - Fee in basis points (10000 bps = 100%)
|
|
30
|
+
* @param to - Address to receive the protocol fee
|
|
31
|
+
* @returns ProtocolFeeArgs instance
|
|
32
|
+
*/
|
|
33
|
+
static fromBps(bps: number, to: Address): ProtocolFeeArgs;
|
|
34
|
+
toJSON(): Record<string, unknown>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Address, HexString } from '@1inch/sdk-core';
|
|
2
|
+
import type { IArgsData } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Arguments for protocol fee instructions (protocolFeeAmountOutXD, aquaProtocolFeeAmountOutXD)
|
|
5
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/Fee.sol#L102
|
|
6
|
+
**/
|
|
7
|
+
export declare class ProtocolFeeArgs implements IArgsData {
|
|
8
|
+
readonly fee: bigint;
|
|
9
|
+
readonly to: Address;
|
|
10
|
+
static readonly CODER: any;
|
|
11
|
+
/**
|
|
12
|
+
* fee - 1e9 = 100% (uint32)
|
|
13
|
+
* to - address to send pulled tokens to (20 bytes)
|
|
14
|
+
**/
|
|
15
|
+
constructor(fee: bigint, to: Address);
|
|
16
|
+
/**
|
|
17
|
+
* Decodes hex data into ProtocolFeeArgs instance
|
|
18
|
+
**/
|
|
19
|
+
static decode(data: HexString): ProtocolFeeArgs;
|
|
20
|
+
/**
|
|
21
|
+
* Creates a ProtocolFeeArgs instance from percentage
|
|
22
|
+
* @param percent - Fee as percentage (e.g., 1 for 1%, 0.1 for 0.1%)
|
|
23
|
+
* @param to - Address to receive the protocol fee
|
|
24
|
+
* @returns ProtocolFeeArgs instance
|
|
25
|
+
*/
|
|
26
|
+
static fromPercent(percent: number, to: Address): ProtocolFeeArgs;
|
|
27
|
+
/**
|
|
28
|
+
* Creates a ProtocolFeeArgs instance from basis points
|
|
29
|
+
* @param bps - Fee in basis points (10000 bps = 100%)
|
|
30
|
+
* @param to - Address to receive the protocol fee
|
|
31
|
+
* @returns ProtocolFeeArgs instance
|
|
32
|
+
*/
|
|
33
|
+
static fromBps(bps: number, to: Address): ProtocolFeeArgs;
|
|
34
|
+
toJSON(): Record<string, unknown>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Opcode } from './opcode';
|
|
2
|
+
import type { IArgsData } from './types';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export { EMPTY_OPCODE } from './empty';
|
|
5
|
+
export * as balances from './balances';
|
|
6
|
+
export * as controls from './controls';
|
|
7
|
+
export * as invalidators from './invalidators';
|
|
8
|
+
export * as xycSwap from './xyc-swap';
|
|
9
|
+
export * as concentrate from './concentrate';
|
|
10
|
+
export * as decay from './decay';
|
|
11
|
+
export * as limitSwap from './limit-swap';
|
|
12
|
+
export * as minRate from './min-rate';
|
|
13
|
+
export * as dutchAuction from './dutch-auction';
|
|
14
|
+
export * as oraclePriceAdjuster from './oracle-price-adjuster';
|
|
15
|
+
export * as baseFeeAdjuster from './base-fee-adjuster';
|
|
16
|
+
export * as twapSwap from './twap-swap';
|
|
17
|
+
export * as stableSwap from './stable-swap';
|
|
18
|
+
export * as fee from './fee';
|
|
19
|
+
export * as extruction from './extruction';
|
|
20
|
+
/**
|
|
21
|
+
* Regular opcodes array - matching SwapVM contract exactly (44 opcodes)
|
|
22
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/opcodes/Opcodes.sol#L46
|
|
23
|
+
*/
|
|
24
|
+
export declare const _allInstructions: Opcode<IArgsData>[];
|
|
25
|
+
/**
|
|
26
|
+
* Aqua opcodes array - matching AquaSwapVM contract (29 opcodes)
|
|
27
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/opcodes/AquaOpcodes.sol#L28
|
|
28
|
+
*/
|
|
29
|
+
export declare const aquaInstructions: Opcode<IArgsData>[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Opcode } from './opcode';
|
|
2
|
+
import type { IArgsData } from './types';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export { EMPTY_OPCODE } from './empty';
|
|
5
|
+
export * as balances from './balances';
|
|
6
|
+
export * as controls from './controls';
|
|
7
|
+
export * as invalidators from './invalidators';
|
|
8
|
+
export * as xycSwap from './xyc-swap';
|
|
9
|
+
export * as concentrate from './concentrate';
|
|
10
|
+
export * as decay from './decay';
|
|
11
|
+
export * as limitSwap from './limit-swap';
|
|
12
|
+
export * as minRate from './min-rate';
|
|
13
|
+
export * as dutchAuction from './dutch-auction';
|
|
14
|
+
export * as oraclePriceAdjuster from './oracle-price-adjuster';
|
|
15
|
+
export * as baseFeeAdjuster from './base-fee-adjuster';
|
|
16
|
+
export * as twapSwap from './twap-swap';
|
|
17
|
+
export * as stableSwap from './stable-swap';
|
|
18
|
+
export * as fee from './fee';
|
|
19
|
+
export * as extruction from './extruction';
|
|
20
|
+
/**
|
|
21
|
+
* Regular opcodes array - matching SwapVM contract exactly (44 opcodes)
|
|
22
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/opcodes/Opcodes.sol#L46
|
|
23
|
+
*/
|
|
24
|
+
export declare const _allInstructions: Opcode<IArgsData>[];
|
|
25
|
+
/**
|
|
26
|
+
* Aqua opcodes array - matching AquaSwapVM contract (29 opcodes)
|
|
27
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/opcodes/AquaOpcodes.sol#L28
|
|
28
|
+
*/
|
|
29
|
+
export declare const aquaInstructions: Opcode<IArgsData>[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IArgsData, IInstruction, IOpcode } from './types';
|
|
2
|
+
export declare class Instruction<T extends IArgsData> implements IInstruction<T> {
|
|
3
|
+
readonly opcode: IOpcode<T>;
|
|
4
|
+
readonly args: T;
|
|
5
|
+
constructor(opcode: IOpcode<T>, args: T);
|
|
6
|
+
toJSON(): Record<string | number, unknown>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IArgsData, IInstruction, IOpcode } from './types';
|
|
2
|
+
export declare class Instruction<T extends IArgsData> implements IInstruction<T> {
|
|
3
|
+
readonly opcode: IOpcode<T>;
|
|
4
|
+
readonly args: T;
|
|
5
|
+
constructor(opcode: IOpcode<T>, args: T);
|
|
6
|
+
toJSON(): Record<string | number, unknown>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HexString } from '@1inch/sdk-core';
|
|
2
|
+
import { InvalidateBit1DArgs } from './invalidate-bit-1d-args';
|
|
3
|
+
import type { IArgsCoder } from '../types';
|
|
4
|
+
export declare class InvalidateBit1DArgsCoder implements IArgsCoder<InvalidateBit1DArgs> {
|
|
5
|
+
encode(args: InvalidateBit1DArgs): HexString;
|
|
6
|
+
decode(data: HexString): InvalidateBit1DArgs;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HexString } from '@1inch/sdk-core';
|
|
2
|
+
import { InvalidateBit1DArgs } from './invalidate-bit-1d-args';
|
|
3
|
+
import type { IArgsCoder } from '../types';
|
|
4
|
+
export declare class InvalidateBit1DArgsCoder implements IArgsCoder<InvalidateBit1DArgs> {
|
|
5
|
+
encode(args: InvalidateBit1DArgs): HexString;
|
|
6
|
+
decode(data: HexString): InvalidateBit1DArgs;
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { HexString } from '@1inch/sdk-core';
|
|
2
|
+
import type { IArgsData } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Arguments for invalidateBit1D instruction to invalidate a specific bit index
|
|
5
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/Invalidators.sol#L75
|
|
6
|
+
**/
|
|
7
|
+
export declare class InvalidateBit1DArgs implements IArgsData {
|
|
8
|
+
readonly bitIndex: bigint;
|
|
9
|
+
static readonly CODER: any;
|
|
10
|
+
constructor(bitIndex: bigint);
|
|
11
|
+
/**
|
|
12
|
+
* Decodes hex data into InvalidateBit1DArgs instance
|
|
13
|
+
**/
|
|
14
|
+
static decode(data: HexString): InvalidateBit1DArgs;
|
|
15
|
+
toJSON(): Record<string, unknown>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { HexString } from '@1inch/sdk-core';
|
|
2
|
+
import type { IArgsData } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Arguments for invalidateBit1D instruction to invalidate a specific bit index
|
|
5
|
+
* @see https://github.com/1inch/swap-vm/blob/main/src/instructions/Invalidators.sol#L75
|
|
6
|
+
**/
|
|
7
|
+
export declare class InvalidateBit1DArgs implements IArgsData {
|
|
8
|
+
readonly bitIndex: bigint;
|
|
9
|
+
static readonly CODER: any;
|
|
10
|
+
constructor(bitIndex: bigint);
|
|
11
|
+
/**
|
|
12
|
+
* Decodes hex data into InvalidateBit1DArgs instance
|
|
13
|
+
**/
|
|
14
|
+
static decode(data: HexString): InvalidateBit1DArgs;
|
|
15
|
+
toJSON(): Record<string, unknown>;
|
|
16
|
+
}
|