@1inch/fusion-sdk 2.2.4-rc.0 → 2.2.4-rc.2
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/dist/cjs/connector/ws/websocket-client.connector.js.map +1 -1
- package/dist/cjs/constants.js +2 -0
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/fusion-order/constants.js +3 -1
- package/dist/cjs/fusion-order/constants.js.map +1 -1
- package/dist/cjs/fusion-order/whitelist/index.js +1 -0
- package/dist/cjs/fusion-order/whitelist/index.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/amount-calculator/amount-calculator.js +1 -1
- package/dist/esm/amount-calculator/auction-calculator/index.js +1 -1
- package/dist/esm/amount-calculator/index.js +2 -2
- package/dist/esm/api/fusion-api.js +5 -5
- package/dist/esm/api/index.js +8 -8
- package/dist/esm/api/orders/index.js +3 -3
- package/dist/esm/api/orders/orders.api.js +2 -2
- package/dist/esm/api/orders/orders.request.js +2 -2
- package/dist/esm/api/params.js +1 -1
- package/dist/esm/api/quoter/index.js +6 -6
- package/dist/esm/api/quoter/preset.js +1 -1
- package/dist/esm/api/quoter/quote/index.js +3 -3
- package/dist/esm/api/quoter/quote/order-params.js +1 -1
- package/dist/esm/api/quoter/quote/quote.js +5 -5
- package/dist/esm/api/quoter/quoter-custom-preset.request.js +1 -1
- package/dist/esm/api/quoter/quoter.api.js +3 -3
- package/dist/esm/api/quoter/quoter.request.js +1 -1
- package/dist/esm/api/relayer/index.js +3 -3
- package/dist/esm/api/relayer/relayer.api.js +1 -1
- package/dist/esm/api-ext.js +1 -1
- package/dist/esm/connector/blockchain/index.js +3 -3
- package/dist/esm/connector/blockchain/private-key-provider.connector.js +1 -1
- package/dist/esm/connector/http/axios-provider.connector.js +1 -1
- package/dist/esm/connector/http/index.js +2 -2
- package/dist/esm/connector/index.js +3 -3
- package/dist/esm/connector/ws/index.js +3 -3
- package/dist/esm/connector/ws/websocket-client.connector.js.map +1 -1
- package/dist/esm/constants.js +2 -0
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/fusion-order/auction-details/auction-details.js +3 -3
- package/dist/esm/fusion-order/auction-details/index.js +2 -2
- package/dist/esm/fusion-order/constants.js +4 -2
- package/dist/esm/fusion-order/constants.js.map +1 -1
- package/dist/esm/fusion-order/fusion-extension.js +3 -3
- package/dist/esm/fusion-order/fusion-order.js +7 -7
- package/dist/esm/fusion-order/index.js +5 -5
- package/dist/esm/fusion-order/source-track.js +2 -2
- package/dist/esm/fusion-order/whitelist/index.js +2 -1
- package/dist/esm/fusion-order/whitelist/index.js.map +1 -1
- package/dist/esm/fusion-order/whitelist/whitelist.js +3 -3
- package/dist/esm/index.js +12 -12
- package/dist/esm/sdk/encoders/cancel-order.encoder.js +1 -1
- package/dist/esm/sdk/encoders/index.js +1 -1
- package/dist/esm/sdk/index.js +4 -4
- package/dist/esm/sdk/sdk.js +3 -3
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esm/ws-api/active-websocket-orders-api.js +1 -1
- package/dist/esm/ws-api/index.js +5 -5
- package/dist/esm/ws-api/rpc-websocket-api.js +1 -1
- package/dist/esm/ws-api/ws-api.js +4 -4
- package/dist/types/src/constants.d.ts +3 -1
- package/dist/types/src/fusion-order/constants.d.ts +2 -0
- package/dist/types/src/fusion-order/whitelist/index.d.ts +1 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +3 -4
- package/dist/esm/amount-calculator/amount-calculator.d.ts +0 -21
- package/dist/esm/amount-calculator/auction-calculator/auction-calculator.d.ts +0 -22
- package/dist/esm/amount-calculator/auction-calculator/index.d.ts +0 -1
- package/dist/esm/amount-calculator/index.d.ts +0 -3
- package/dist/esm/api/fusion-api.d.ts +0 -19
- package/dist/esm/api/index.d.ts +0 -8
- package/dist/esm/api/orders/index.d.ts +0 -3
- package/dist/esm/api/orders/orders.api.d.ts +0 -14
- package/dist/esm/api/orders/orders.request.d.ts +0 -24
- package/dist/esm/api/orders/types.d.ts +0 -79
- package/dist/esm/api/ordersVersion.d.ts +0 -5
- package/dist/esm/api/pagination.d.ts +0 -10
- package/dist/esm/api/params.d.ts +0 -2
- package/dist/esm/api/quoter/index.d.ts +0 -6
- package/dist/esm/api/quoter/preset.d.ts +0 -23
- package/dist/esm/api/quoter/quote/index.d.ts +0 -3
- package/dist/esm/api/quoter/quote/order-params.d.ts +0 -13
- package/dist/esm/api/quoter/quote/quote.d.ts +0 -29
- package/dist/esm/api/quoter/quote/types.d.ts +0 -25
- package/dist/esm/api/quoter/quoter-custom-preset.request.d.ts +0 -10
- package/dist/esm/api/quoter/quoter.api.d.ts +0 -14
- package/dist/esm/api/quoter/quoter.request.d.ts +0 -17
- package/dist/esm/api/quoter/types.d.ts +0 -91
- package/dist/esm/api/relayer/index.d.ts +0 -3
- package/dist/esm/api/relayer/relayer.api.d.ts +0 -12
- package/dist/esm/api/relayer/relayer.request.d.ts +0 -11
- package/dist/esm/api/relayer/types.d.ts +0 -13
- package/dist/esm/api/types.d.ts +0 -18
- package/dist/esm/api-ext.d.ts +0 -1
- package/dist/esm/connector/blockchain/blockchain-provider.connector.d.ts +0 -5
- package/dist/esm/connector/blockchain/index.d.ts +0 -3
- package/dist/esm/connector/blockchain/private-key-provider.connector.d.ts +0 -11
- package/dist/esm/connector/blockchain/web3-provider-connector.d.ts +0 -19
- package/dist/esm/connector/http/axios-provider.connector.d.ts +0 -7
- package/dist/esm/connector/http/http-provider.connector.d.ts +0 -4
- package/dist/esm/connector/http/index.d.ts +0 -2
- package/dist/esm/connector/index.d.ts +0 -3
- package/dist/esm/connector/ws/index.d.ts +0 -3
- package/dist/esm/connector/ws/types.d.ts +0 -10
- package/dist/esm/connector/ws/websocket-client.connector.d.ts +0 -22
- package/dist/esm/connector/ws/websocket-provider.connector.d.ts +0 -14
- package/dist/esm/constants.d.ts +0 -22
- package/dist/esm/errors.d.ts +0 -3
- package/dist/esm/fusion-order/auction-details/auction-details.d.ts +0 -25
- package/dist/esm/fusion-order/auction-details/index.d.ts +0 -2
- package/dist/esm/fusion-order/auction-details/types.d.ts +0 -8
- package/dist/esm/fusion-order/constants.d.ts +0 -14
- package/dist/esm/fusion-order/fusion-extension.d.ts +0 -26
- package/dist/esm/fusion-order/fusion-order.d.ts +0 -70
- package/dist/esm/fusion-order/index.d.ts +0 -6
- package/dist/esm/fusion-order/source-track.d.ts +0 -1
- package/dist/esm/fusion-order/whitelist/index.d.ts +0 -1
- package/dist/esm/fusion-order/whitelist/types.d.ts +0 -4
- package/dist/esm/fusion-order/whitelist/whitelist.d.ts +0 -26
- package/dist/esm/index.d.ts +0 -13
- package/dist/esm/sdk/encoders/cancel-order.encoder.d.ts +0 -2
- package/dist/esm/sdk/encoders/index.d.ts +0 -1
- package/dist/esm/sdk/index.d.ts +0 -4
- package/dist/esm/sdk/sdk.d.ts +0 -20
- package/dist/esm/sdk/types.d.ts +0 -55
- package/dist/esm/sdk/utils.d.ts +0 -2
- package/dist/esm/utils/amounts.d.ts +0 -2
- package/dist/esm/utils/time.d.ts +0 -1
- package/dist/esm/utils/types.d.ts +0 -3
- package/dist/esm/utils.d.ts +0 -2
- package/dist/esm/validations.d.ts +0 -4
- package/dist/esm/ws-api/active-websocket-orders-api.d.ts +0 -13
- package/dist/esm/ws-api/constants.d.ts +0 -2
- package/dist/esm/ws-api/index.d.ts +0 -5
- package/dist/esm/ws-api/rpc-websocket-api.d.ts +0 -13
- package/dist/esm/ws-api/types.d.ts +0 -62
- package/dist/esm/ws-api/url.d.ts +0 -1
- package/dist/esm/ws-api/ws-api.d.ts +0 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1inch/fusion-sdk",
|
|
3
|
-
"version": "2.2.4-rc.
|
|
3
|
+
"version": "2.2.4-rc.2",
|
|
4
4
|
"description": "1inch Fusion SDK",
|
|
5
5
|
"author": "@1inch",
|
|
6
6
|
"files": [
|
|
@@ -62,11 +62,10 @@
|
|
|
62
62
|
"generate-changelog": "^1.8.0",
|
|
63
63
|
"jest": "^29.7.0",
|
|
64
64
|
"prettier": "^3.3.3",
|
|
65
|
-
"testcontainers": "10.
|
|
65
|
+
"testcontainers": "10.27.0",
|
|
66
66
|
"ts-loader": "^9.5.1",
|
|
67
67
|
"ts-mockito": "^2.6.1",
|
|
68
68
|
"ts-node": "^10.9.2",
|
|
69
|
-
"tsc-alias": "1.8.13",
|
|
70
69
|
"tslib": "2.6.3",
|
|
71
70
|
"typescript": "5.7.3"
|
|
72
71
|
},
|
|
@@ -87,7 +86,7 @@
|
|
|
87
86
|
},
|
|
88
87
|
"scripts": {
|
|
89
88
|
"build": "npm run build:esm && npm run build:cjs && npm run build:types",
|
|
90
|
-
"build:esm": "tsc --project tsconfig.esm.json
|
|
89
|
+
"build:esm": "tsc --project tsconfig.esm.json",
|
|
91
90
|
"build:cjs": "tsc --project tsconfig.cjs.json",
|
|
92
91
|
"build:types": "tsc --project tsconfig.types.json",
|
|
93
92
|
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Address, Bps } from '@1inch/limit-order-sdk';
|
|
2
|
-
import { FeeCalculator } from '@1inch/limit-order-sdk/extensions/fee-taker';
|
|
3
|
-
import { AuctionCalculator } from './auction-calculator';
|
|
4
|
-
import { FusionExtension } from '../fusion-order';
|
|
5
|
-
export declare class AmountCalculator {
|
|
6
|
-
private readonly auctionCalculator;
|
|
7
|
-
private readonly feeCalculator?;
|
|
8
|
-
constructor(auctionCalculator: AuctionCalculator, feeCalculator?: FeeCalculator | undefined);
|
|
9
|
-
static fromExtension(ext: FusionExtension): AmountCalculator;
|
|
10
|
-
static calcAuctionTakingAmount(baseTakingAmount: bigint, rate: number, fee?: Bps): bigint;
|
|
11
|
-
static extractFeeAmount(requiredTakingAmount: bigint, fee: Bps): bigint;
|
|
12
|
-
getRequiredTakingAmount(taker: Address, takingAmount: bigint, time: bigint, blockBaseFee?: bigint): bigint;
|
|
13
|
-
getRequiredMakingAmount(taker: Address, makingAmount: bigint, time: bigint, blockBaseFee?: bigint): bigint;
|
|
14
|
-
getTotalFee(taker: Address, takingAmount: bigint, time: bigint, blockBaseFee?: bigint): bigint;
|
|
15
|
-
getUserTakingAmountAmount(taker: Address, takingAmount: bigint, time: bigint, blockBaseFee?: bigint): bigint;
|
|
16
|
-
getResolverFee(taker: Address, takingAmount: bigint, time: bigint, blockBaseFee?: bigint): bigint;
|
|
17
|
-
getIntegratorFee(taker: Address, takingAmount: bigint, time: bigint, blockBaseFee?: bigint): bigint;
|
|
18
|
-
getProtocolShareOfIntegratorFee(taker: Address, takingAmount: bigint, time: bigint, blockBaseFee?: bigint): bigint;
|
|
19
|
-
getProtocolFee(taker: Address, takingAmount: bigint, time: bigint, blockBaseFee?: bigint): bigint;
|
|
20
|
-
private getAuctionBumpedAmount;
|
|
21
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { AuctionDetails, AuctionPoint, AuctionGasCostInfo } from '../../fusion-order';
|
|
2
|
-
export declare class AuctionCalculator {
|
|
3
|
-
private readonly startTime;
|
|
4
|
-
private readonly duration;
|
|
5
|
-
private readonly initialRateBump;
|
|
6
|
-
private readonly points;
|
|
7
|
-
private readonly gasCost;
|
|
8
|
-
static RATE_BUMP_DENOMINATOR: bigint;
|
|
9
|
-
private static GAS_PRICE_BASE;
|
|
10
|
-
constructor(startTime: bigint, duration: bigint, initialRateBump: bigint, points: AuctionPoint[], gasCost?: AuctionGasCostInfo);
|
|
11
|
-
get finishTime(): bigint;
|
|
12
|
-
static fromAuctionData(details: AuctionDetails): AuctionCalculator;
|
|
13
|
-
static calcInitialRateBump(startAmount: bigint, endAmount: bigint): number;
|
|
14
|
-
static calcAuctionTakingAmount(takingAmount: bigint, rate: number): bigint;
|
|
15
|
-
static calcAuctionMakingAmount(makingAmount: bigint, rate: number): bigint;
|
|
16
|
-
static baseFeeToGasPriceEstimate(baseFee: bigint): bigint;
|
|
17
|
-
static calcGasBumpEstimate(endTakingAmount: bigint, gasCostInToToken: bigint): bigint;
|
|
18
|
-
calcAuctionTakingAmount(takingAmount: bigint, rate: number): bigint;
|
|
19
|
-
calcRateBump(time: bigint, blockBaseFee?: bigint): number;
|
|
20
|
-
private getGasPriceBump;
|
|
21
|
-
private getAuctionBump;
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './auction-calculator';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { FusionApiConfig } from './types';
|
|
2
|
-
import { QuoterRequest, QuoterCustomPresetRequest, Quote } from './quoter';
|
|
3
|
-
import { RelayerRequest } from './relayer';
|
|
4
|
-
import { ActiveOrdersRequest, ActiveOrdersResponse, OrdersByMakerRequest, OrderStatusRequest, OrderStatusResponse, OrdersByMakerResponse } from './orders';
|
|
5
|
-
import { OrdersVersion } from './ordersVersion';
|
|
6
|
-
export declare class FusionApi {
|
|
7
|
-
private readonly quoterApi;
|
|
8
|
-
private readonly relayerApi;
|
|
9
|
-
private readonly ordersApi;
|
|
10
|
-
constructor(config: FusionApiConfig);
|
|
11
|
-
static new(config: FusionApiConfig): FusionApi;
|
|
12
|
-
getQuote(params: QuoterRequest): Promise<Quote>;
|
|
13
|
-
getQuoteWithCustomPreset(params: QuoterRequest, body: QuoterCustomPresetRequest): Promise<Quote>;
|
|
14
|
-
getActiveOrders(params?: ActiveOrdersRequest, ordersVersion?: OrdersVersion): Promise<ActiveOrdersResponse>;
|
|
15
|
-
getOrderStatus(params: OrderStatusRequest): Promise<OrderStatusResponse>;
|
|
16
|
-
getOrdersByMaker(params: OrdersByMakerRequest, ordersVersion?: OrdersVersion): Promise<OrdersByMakerResponse>;
|
|
17
|
-
submitOrder(params: RelayerRequest): Promise<void>;
|
|
18
|
-
submitOrderBatch(params: RelayerRequest[]): Promise<void>;
|
|
19
|
-
}
|
package/dist/esm/api/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ActiveOrdersRequest, OrdersByMakerRequest, OrderStatusRequest } from './orders.request';
|
|
2
|
-
import { ActiveOrdersResponse, OrdersApiConfig, OrdersByMakerResponse, OrderStatusResponse } from './types';
|
|
3
|
-
import { HttpProviderConnector } from '../../connector';
|
|
4
|
-
import { OrdersVersion } from '../ordersVersion';
|
|
5
|
-
export declare class OrdersApi {
|
|
6
|
-
private readonly config;
|
|
7
|
-
private readonly httpClient;
|
|
8
|
-
private static Version;
|
|
9
|
-
constructor(config: OrdersApiConfig, httpClient: HttpProviderConnector);
|
|
10
|
-
static new(config: OrdersApiConfig, httpClient?: HttpProviderConnector): OrdersApi;
|
|
11
|
-
getActiveOrders(params: ActiveOrdersRequest, ordersVersion: OrdersVersion): Promise<ActiveOrdersResponse>;
|
|
12
|
-
getOrderStatus(params: OrderStatusRequest): Promise<OrderStatusResponse>;
|
|
13
|
-
getOrdersByMaker(params: OrdersByMakerRequest, ordersVersion: OrdersVersion): Promise<OrdersByMakerResponse>;
|
|
14
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ActiveOrdersRequestParams, OrdersByMakerParams, OrderStatusParams } from './types';
|
|
2
|
-
import { PaginationParams, PaginationRequest } from '../pagination';
|
|
3
|
-
export declare class ActiveOrdersRequest {
|
|
4
|
-
readonly pagination: PaginationRequest;
|
|
5
|
-
constructor(params?: ActiveOrdersRequestParams);
|
|
6
|
-
static new(params?: ActiveOrdersRequestParams): ActiveOrdersRequest;
|
|
7
|
-
validate(): string | null;
|
|
8
|
-
build(): ActiveOrdersRequestParams;
|
|
9
|
-
}
|
|
10
|
-
export declare class OrderStatusRequest {
|
|
11
|
-
readonly orderHash: string;
|
|
12
|
-
constructor(params: OrderStatusParams);
|
|
13
|
-
static new(params: OrderStatusParams): OrderStatusRequest;
|
|
14
|
-
validate(): string | null;
|
|
15
|
-
build(): OrderStatusParams;
|
|
16
|
-
}
|
|
17
|
-
export declare class OrdersByMakerRequest {
|
|
18
|
-
readonly address: string;
|
|
19
|
-
readonly pagination: PaginationRequest;
|
|
20
|
-
constructor(params: OrdersByMakerParams);
|
|
21
|
-
static new(params: OrdersByMakerParams): OrdersByMakerRequest;
|
|
22
|
-
validate(): string | null;
|
|
23
|
-
buildQueryParams(): PaginationParams;
|
|
24
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { LimitOrderV4Struct } from '@1inch/limit-order-sdk';
|
|
2
|
-
import { NetworkEnum } from '../../constants';
|
|
3
|
-
import { PaginationOutput } from '../types';
|
|
4
|
-
import { AuctionPoint } from '../quoter';
|
|
5
|
-
import { PaginationParams } from '../pagination';
|
|
6
|
-
export type OrdersApiConfig = {
|
|
7
|
-
network: NetworkEnum;
|
|
8
|
-
url: string;
|
|
9
|
-
authKey?: string;
|
|
10
|
-
};
|
|
11
|
-
export type ActiveOrdersRequestParams = PaginationParams;
|
|
12
|
-
export type ActiveOrder = {
|
|
13
|
-
quoteId: string;
|
|
14
|
-
orderHash: string;
|
|
15
|
-
signature: string;
|
|
16
|
-
deadline: string;
|
|
17
|
-
auctionStartDate: string;
|
|
18
|
-
auctionEndDate: string;
|
|
19
|
-
remainingMakerAmount: string;
|
|
20
|
-
order: LimitOrderV4Struct;
|
|
21
|
-
extension: string;
|
|
22
|
-
version: '2.0' | '2.1';
|
|
23
|
-
};
|
|
24
|
-
export type ActiveOrdersResponse = PaginationOutput<ActiveOrder>;
|
|
25
|
-
export type OrderStatusParams = {
|
|
26
|
-
orderHash: string;
|
|
27
|
-
};
|
|
28
|
-
export declare enum OrderStatus {
|
|
29
|
-
Pending = "pending",
|
|
30
|
-
Filled = "filled",
|
|
31
|
-
FalsePredicate = "false-predicate",
|
|
32
|
-
NotEnoughBalanceOrAllowance = "not-enough-balance-or-allowance",
|
|
33
|
-
Expired = "expired",
|
|
34
|
-
PartiallyFilled = "partially-filled",
|
|
35
|
-
WrongPermit = "wrong-permit",
|
|
36
|
-
Cancelled = "cancelled",
|
|
37
|
-
InvalidSignature = "invalid-signature"
|
|
38
|
-
}
|
|
39
|
-
export type Fill = {
|
|
40
|
-
txHash: string;
|
|
41
|
-
filledMakerAmount: string;
|
|
42
|
-
filledAuctionTakerAmount: string;
|
|
43
|
-
takerFeeAmount: string | null;
|
|
44
|
-
};
|
|
45
|
-
export type OrderStatusResponse = {
|
|
46
|
-
status: OrderStatus;
|
|
47
|
-
order: LimitOrderV4Struct;
|
|
48
|
-
extension: string;
|
|
49
|
-
points: AuctionPoint[] | null;
|
|
50
|
-
cancelTx: string | null;
|
|
51
|
-
fills: Fill[];
|
|
52
|
-
createdAt: string;
|
|
53
|
-
auctionStartDate: number;
|
|
54
|
-
auctionDuration: number;
|
|
55
|
-
initialRateBump: number;
|
|
56
|
-
isNativeCurrency: boolean;
|
|
57
|
-
fromTokenToUsdPrice: string;
|
|
58
|
-
toTokenToUsdPrice: string;
|
|
59
|
-
};
|
|
60
|
-
export type OrdersByMakerParams = {
|
|
61
|
-
address: string;
|
|
62
|
-
} & PaginationParams;
|
|
63
|
-
export type OrderFillsByMakerOutput = {
|
|
64
|
-
orderHash: string;
|
|
65
|
-
status: OrderStatus;
|
|
66
|
-
makerAsset: string;
|
|
67
|
-
makerAmount: string;
|
|
68
|
-
minTakerAmount: string;
|
|
69
|
-
takerAsset: string;
|
|
70
|
-
cancelTx: string | null;
|
|
71
|
-
fills: Fill[];
|
|
72
|
-
points: AuctionPoint[] | null;
|
|
73
|
-
auctionStartDate: number;
|
|
74
|
-
auctionDuration: number;
|
|
75
|
-
initialRateBump: number;
|
|
76
|
-
isNativeCurrency: boolean;
|
|
77
|
-
createdAt: string;
|
|
78
|
-
};
|
|
79
|
-
export type OrdersByMakerResponse = PaginationOutput<OrderFillsByMakerOutput>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type PaginationParams = {
|
|
2
|
-
page?: number;
|
|
3
|
-
limit?: number;
|
|
4
|
-
};
|
|
5
|
-
export declare class PaginationRequest {
|
|
6
|
-
page: number | undefined;
|
|
7
|
-
limit: number | undefined;
|
|
8
|
-
constructor(page: number | undefined, limit: number | undefined);
|
|
9
|
-
validate(): string | null;
|
|
10
|
-
}
|
package/dist/esm/api/params.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Address } from '@1inch/limit-order-sdk';
|
|
2
|
-
import { AuctionPoint, PresetData } from './types';
|
|
3
|
-
import { AuctionDetails } from '../../fusion-order';
|
|
4
|
-
export declare class Preset {
|
|
5
|
-
readonly auctionDuration: bigint;
|
|
6
|
-
readonly startAuctionIn: bigint;
|
|
7
|
-
readonly bankFee: bigint;
|
|
8
|
-
readonly initialRateBump: number;
|
|
9
|
-
readonly auctionStartAmount: bigint;
|
|
10
|
-
readonly auctionEndAmount: bigint;
|
|
11
|
-
readonly tokenFee: bigint;
|
|
12
|
-
readonly points: AuctionPoint[];
|
|
13
|
-
readonly gasCostInfo: {
|
|
14
|
-
gasBumpEstimate: bigint;
|
|
15
|
-
gasPriceEstimate: bigint;
|
|
16
|
-
};
|
|
17
|
-
readonly exclusiveResolver?: Address;
|
|
18
|
-
readonly allowPartialFills: boolean;
|
|
19
|
-
readonly allowMultipleFills: boolean;
|
|
20
|
-
constructor(preset: PresetData);
|
|
21
|
-
createAuctionDetails(additionalWaitPeriod?: bigint): AuctionDetails;
|
|
22
|
-
private calcAuctionStartTime;
|
|
23
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Address } from '@1inch/limit-order-sdk';
|
|
2
|
-
import { FusionOrderParamsData } from './types';
|
|
3
|
-
import { PresetEnum } from '../types';
|
|
4
|
-
export declare class FusionOrderParams {
|
|
5
|
-
readonly preset: PresetEnum;
|
|
6
|
-
readonly receiver: Address;
|
|
7
|
-
readonly permit: string | undefined;
|
|
8
|
-
readonly nonce: bigint | undefined;
|
|
9
|
-
readonly delayAuctionStartTimeBy: bigint;
|
|
10
|
-
readonly isPermit2?: boolean;
|
|
11
|
-
constructor(params: FusionOrderParamsData);
|
|
12
|
-
static new(params: FusionOrderParamsData): FusionOrderParams;
|
|
13
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Address } from '@1inch/limit-order-sdk';
|
|
2
|
-
import { FusionOrderParamsData, ResolverFeePreset } from './types';
|
|
3
|
-
import { Cost, PresetEnum, QuoterResponse } from '../types';
|
|
4
|
-
import { Preset } from '../preset';
|
|
5
|
-
import { FusionOrder } from '../../../fusion-order';
|
|
6
|
-
import { QuoterRequest } from '../quoter.request';
|
|
7
|
-
export declare class Quote {
|
|
8
|
-
private readonly params;
|
|
9
|
-
readonly settlementAddress: Address;
|
|
10
|
-
readonly fromTokenAmount: bigint;
|
|
11
|
-
readonly presets: {
|
|
12
|
-
[PresetEnum.fast]: Preset;
|
|
13
|
-
[PresetEnum.slow]: Preset;
|
|
14
|
-
[PresetEnum.medium]: Preset;
|
|
15
|
-
[PresetEnum.custom]?: Preset;
|
|
16
|
-
};
|
|
17
|
-
readonly recommendedPreset: PresetEnum;
|
|
18
|
-
readonly toTokenAmount: string;
|
|
19
|
-
readonly prices: Cost;
|
|
20
|
-
readonly volume: Cost;
|
|
21
|
-
readonly whitelist: Address[];
|
|
22
|
-
readonly quoteId: string | null;
|
|
23
|
-
readonly slippage: number;
|
|
24
|
-
readonly resolverFeePreset: ResolverFeePreset;
|
|
25
|
-
constructor(params: QuoterRequest, response: QuoterResponse);
|
|
26
|
-
createFusionOrder(paramsData: Omit<FusionOrderParamsData, 'permit' | 'isPermit2'>): FusionOrder;
|
|
27
|
-
getPreset(type?: PresetEnum): Preset;
|
|
28
|
-
private getWhitelist;
|
|
29
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Address, Bps } from '@1inch/limit-order-sdk';
|
|
2
|
-
import { PresetEnum } from '../types';
|
|
3
|
-
import { NetworkEnum } from '../../../constants';
|
|
4
|
-
export type FusionOrderParamsData = {
|
|
5
|
-
network: NetworkEnum;
|
|
6
|
-
preset?: PresetEnum;
|
|
7
|
-
receiver?: Address;
|
|
8
|
-
nonce?: bigint;
|
|
9
|
-
permit?: string;
|
|
10
|
-
isPermit2?: boolean;
|
|
11
|
-
allowPartialFills?: boolean;
|
|
12
|
-
allowMultipleFills?: boolean;
|
|
13
|
-
delayAuctionStartTimeBy?: bigint;
|
|
14
|
-
orderExpirationDelay?: bigint;
|
|
15
|
-
};
|
|
16
|
-
export type IntegratorFeeParams = {
|
|
17
|
-
receiver: Address;
|
|
18
|
-
value: Bps;
|
|
19
|
-
share: Bps;
|
|
20
|
-
};
|
|
21
|
-
export type ResolverFeePreset = {
|
|
22
|
-
receiver: Address;
|
|
23
|
-
bps: Bps;
|
|
24
|
-
whitelistDiscountPercent: Bps;
|
|
25
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CustomPreset, QuoterCustomPresetRequestParams } from './types';
|
|
2
|
-
export declare class QuoterCustomPresetRequest {
|
|
3
|
-
readonly customPreset: CustomPreset;
|
|
4
|
-
constructor(params: QuoterCustomPresetRequestParams);
|
|
5
|
-
static new(params: QuoterCustomPresetRequestParams): QuoterCustomPresetRequest;
|
|
6
|
-
build(): CustomPreset;
|
|
7
|
-
validate(): string | null;
|
|
8
|
-
private validateAuctionDuration;
|
|
9
|
-
private validatePoints;
|
|
10
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { QuoterRequest } from './quoter.request';
|
|
2
|
-
import { QuoterApiConfig } from './types';
|
|
3
|
-
import { Quote } from './quote';
|
|
4
|
-
import { QuoterCustomPresetRequest } from './quoter-custom-preset.request';
|
|
5
|
-
import { HttpProviderConnector } from '../../connector';
|
|
6
|
-
export declare class QuoterApi {
|
|
7
|
-
private readonly config;
|
|
8
|
-
private readonly httpClient;
|
|
9
|
-
private static Version;
|
|
10
|
-
constructor(config: QuoterApiConfig, httpClient: HttpProviderConnector);
|
|
11
|
-
static new(config: QuoterApiConfig, httpClient?: HttpProviderConnector): QuoterApi;
|
|
12
|
-
getQuote(params: QuoterRequest): Promise<Quote>;
|
|
13
|
-
getQuoteWithCustomPreset(params: QuoterRequest, body: QuoterCustomPresetRequest): Promise<Quote>;
|
|
14
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Address } from '@1inch/limit-order-sdk';
|
|
2
|
-
import { QuoterRequestParams, QuoterRequestParamsRaw } from './types';
|
|
3
|
-
import { IntegratorFeeParams } from './quote';
|
|
4
|
-
export declare class QuoterRequest {
|
|
5
|
-
readonly fromTokenAddress: Address;
|
|
6
|
-
readonly toTokenAddress: Address;
|
|
7
|
-
readonly amount: string;
|
|
8
|
-
readonly walletAddress: Address;
|
|
9
|
-
readonly enableEstimate: boolean;
|
|
10
|
-
readonly permit: string | undefined;
|
|
11
|
-
readonly integratorFee?: IntegratorFeeParams;
|
|
12
|
-
readonly source: string;
|
|
13
|
-
readonly isPermit2: boolean;
|
|
14
|
-
constructor(params: QuoterRequestParams);
|
|
15
|
-
static new(params: QuoterRequestParams): QuoterRequest;
|
|
16
|
-
build(): QuoterRequestParamsRaw;
|
|
17
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { IntegratorFeeParams } from './quote';
|
|
2
|
-
import { NetworkEnum } from '../../constants';
|
|
3
|
-
export type QuoterRequestParams = {
|
|
4
|
-
fromTokenAddress: string;
|
|
5
|
-
toTokenAddress: string;
|
|
6
|
-
amount: string;
|
|
7
|
-
walletAddress: string;
|
|
8
|
-
enableEstimate?: boolean;
|
|
9
|
-
permit?: string;
|
|
10
|
-
integratorFee?: IntegratorFeeParams;
|
|
11
|
-
source?: string;
|
|
12
|
-
isPermit2?: boolean;
|
|
13
|
-
};
|
|
14
|
-
export type QuoterRequestParamsRaw = Omit<QuoterRequestParams, 'integratorFee'> & {
|
|
15
|
-
fee?: number;
|
|
16
|
-
};
|
|
17
|
-
export type QuoterCustomPresetRequestParams = {
|
|
18
|
-
customPreset: CustomPreset;
|
|
19
|
-
};
|
|
20
|
-
export type QuoterApiConfig = {
|
|
21
|
-
network: NetworkEnum;
|
|
22
|
-
url: string;
|
|
23
|
-
authKey?: string;
|
|
24
|
-
};
|
|
25
|
-
export type QuoterResponse = {
|
|
26
|
-
fromTokenAmount: string;
|
|
27
|
-
presets: QuoterPresets;
|
|
28
|
-
recommended_preset: PresetEnum;
|
|
29
|
-
toTokenAmount: string;
|
|
30
|
-
prices: Cost;
|
|
31
|
-
volume: Cost;
|
|
32
|
-
settlementAddress: string;
|
|
33
|
-
whitelist: string[];
|
|
34
|
-
quoteId: string | null;
|
|
35
|
-
autoK: number;
|
|
36
|
-
fee: ResolverFeePresetRaw;
|
|
37
|
-
};
|
|
38
|
-
export type QuoterPresets = {
|
|
39
|
-
fast: PresetData;
|
|
40
|
-
medium: PresetData;
|
|
41
|
-
slow: PresetData;
|
|
42
|
-
custom?: PresetData;
|
|
43
|
-
};
|
|
44
|
-
export type PresetData = {
|
|
45
|
-
auctionDuration: number;
|
|
46
|
-
startAuctionIn: number;
|
|
47
|
-
bankFee: string;
|
|
48
|
-
initialRateBump: number;
|
|
49
|
-
auctionStartAmount: string;
|
|
50
|
-
auctionEndAmount: string;
|
|
51
|
-
tokenFee: string;
|
|
52
|
-
points: AuctionPoint[];
|
|
53
|
-
allowPartialFills: boolean;
|
|
54
|
-
allowMultipleFills: boolean;
|
|
55
|
-
gasCost: {
|
|
56
|
-
gasBumpEstimate: number;
|
|
57
|
-
gasPriceEstimate: string;
|
|
58
|
-
};
|
|
59
|
-
exclusiveResolver: string | null;
|
|
60
|
-
};
|
|
61
|
-
export type AuctionPoint = {
|
|
62
|
-
delay: number;
|
|
63
|
-
coefficient: number;
|
|
64
|
-
};
|
|
65
|
-
export type Cost = {
|
|
66
|
-
usd: {
|
|
67
|
-
fromToken: string;
|
|
68
|
-
toToken: string;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
export declare enum PresetEnum {
|
|
72
|
-
fast = "fast",
|
|
73
|
-
medium = "medium",
|
|
74
|
-
slow = "slow",
|
|
75
|
-
custom = "custom"
|
|
76
|
-
}
|
|
77
|
-
export type CustomPreset = {
|
|
78
|
-
auctionDuration: number;
|
|
79
|
-
auctionStartAmount: string;
|
|
80
|
-
auctionEndAmount: string;
|
|
81
|
-
points?: CustomPresetPoint[];
|
|
82
|
-
};
|
|
83
|
-
export type CustomPresetPoint = {
|
|
84
|
-
toTokenAmount: string;
|
|
85
|
-
delay: number;
|
|
86
|
-
};
|
|
87
|
-
export type ResolverFeePresetRaw = {
|
|
88
|
-
receiver: string;
|
|
89
|
-
bps: number;
|
|
90
|
-
whitelistDiscountPercent: number;
|
|
91
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { RelayerRequest } from './relayer.request';
|
|
2
|
-
import { RelayerApiConfig } from './types';
|
|
3
|
-
import { HttpProviderConnector } from '../../connector';
|
|
4
|
-
export declare class RelayerApi {
|
|
5
|
-
private readonly config;
|
|
6
|
-
private readonly httpClient;
|
|
7
|
-
private static Version;
|
|
8
|
-
constructor(config: RelayerApiConfig, httpClient: HttpProviderConnector);
|
|
9
|
-
static new(config: RelayerApiConfig, httpClient?: HttpProviderConnector): RelayerApi;
|
|
10
|
-
submit(params: RelayerRequest): Promise<void>;
|
|
11
|
-
submitBatch(params: RelayerRequest[]): Promise<void>;
|
|
12
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { LimitOrderV4Struct } from '@1inch/limit-order-sdk';
|
|
2
|
-
import { RelayerRequestParams } from './types';
|
|
3
|
-
export declare class RelayerRequest {
|
|
4
|
-
readonly order: LimitOrderV4Struct;
|
|
5
|
-
readonly signature: string;
|
|
6
|
-
readonly quoteId: string;
|
|
7
|
-
readonly extension: string;
|
|
8
|
-
constructor(params: RelayerRequestParams);
|
|
9
|
-
static new(params: RelayerRequestParams): RelayerRequest;
|
|
10
|
-
build(): RelayerRequestParams;
|
|
11
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { LimitOrderV4Struct } from '@1inch/limit-order-sdk';
|
|
2
|
-
import { NetworkEnum } from '../../constants';
|
|
3
|
-
export type RelayerRequestParams = {
|
|
4
|
-
order: LimitOrderV4Struct;
|
|
5
|
-
signature: string;
|
|
6
|
-
quoteId: string;
|
|
7
|
-
extension: string;
|
|
8
|
-
};
|
|
9
|
-
export type RelayerApiConfig = {
|
|
10
|
-
network: NetworkEnum;
|
|
11
|
-
url: string;
|
|
12
|
-
authKey?: string;
|
|
13
|
-
};
|
package/dist/esm/api/types.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { NetworkEnum } from '../constants';
|
|
2
|
-
import { HttpProviderConnector } from '../connector';
|
|
3
|
-
export type FusionApiConfig = {
|
|
4
|
-
url: string;
|
|
5
|
-
network: NetworkEnum;
|
|
6
|
-
authKey?: string;
|
|
7
|
-
httpProvider?: HttpProviderConnector;
|
|
8
|
-
};
|
|
9
|
-
export type PaginationMeta = {
|
|
10
|
-
totalItems: number;
|
|
11
|
-
itemsPerPage: number;
|
|
12
|
-
totalPages: number;
|
|
13
|
-
currentPage: number;
|
|
14
|
-
};
|
|
15
|
-
export type PaginationOutput<T extends Record<string, any> = Record<string, any>> = {
|
|
16
|
-
meta: PaginationMeta;
|
|
17
|
-
items: T[];
|
|
18
|
-
};
|
package/dist/esm/api-ext.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './api/index';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { EIP712TypedData } from '@1inch/limit-order-sdk';
|
|
2
|
-
import { BlockchainProviderConnector } from './blockchain-provider.connector';
|
|
3
|
-
import { Web3Like } from './web3-provider-connector';
|
|
4
|
-
export declare class PrivateKeyProviderConnector implements BlockchainProviderConnector {
|
|
5
|
-
readonly privateKey: string;
|
|
6
|
-
protected readonly web3Provider: Web3Like;
|
|
7
|
-
private readonly wallet;
|
|
8
|
-
constructor(privateKey: string, web3Provider: Web3Like);
|
|
9
|
-
signTypedData(_walletAddress: string, typedData: EIP712TypedData): Promise<string>;
|
|
10
|
-
ethCall(contractAddress: string, callData: string): Promise<string>;
|
|
11
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { EIP712TypedData } from '@1inch/limit-order-sdk';
|
|
2
|
-
import { BlockchainProviderConnector } from './blockchain-provider.connector';
|
|
3
|
-
interface TransactionConfig {
|
|
4
|
-
data?: string;
|
|
5
|
-
to?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface Web3Like {
|
|
8
|
-
eth: {
|
|
9
|
-
call(transactionConfig: TransactionConfig): Promise<string>;
|
|
10
|
-
};
|
|
11
|
-
extend(extension: unknown): any;
|
|
12
|
-
}
|
|
13
|
-
export declare class Web3ProviderConnector implements BlockchainProviderConnector {
|
|
14
|
-
protected readonly web3Provider: Web3Like;
|
|
15
|
-
constructor(web3Provider: Web3Like);
|
|
16
|
-
signTypedData(walletAddress: string, typedData: EIP712TypedData): Promise<string>;
|
|
17
|
-
ethCall(contractAddress: string, callData: string): Promise<string>;
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { HttpProviderConnector } from './http-provider.connector';
|
|
2
|
-
export declare class AxiosProviderConnector implements HttpProviderConnector {
|
|
3
|
-
private readonly authKey?;
|
|
4
|
-
constructor(authKey?: string | undefined);
|
|
5
|
-
get<T>(url: string): Promise<T>;
|
|
6
|
-
post<T>(url: string, data: unknown): Promise<T>;
|
|
7
|
-
}
|