@1inch/fusion-sdk 2.4.6 → 2.4.7
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/api/quoter/quote/quote.js +20 -6
- package/dist/cjs/api/quoter/quoter.api.spec.js +101 -5
- package/dist/cjs/api/quoter/quoter.request.js +1 -4
- package/dist/cjs/api/quoter/quoter.request.spec.js +2 -8
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/sdk/README.md +18 -14
- package/dist/esm/api/quoter/quote/quote.js +20 -6
- package/dist/esm/api/quoter/quote/types.js +15 -3
- package/dist/esm/api/quoter/quoter.api.spec.js +101 -5
- package/dist/esm/api/quoter/quoter.request.js +1 -4
- package/dist/esm/api/quoter/quoter.request.spec.js +2 -8
- package/dist/esm/index.js +1 -1
- package/dist/esm/package.json +1 -1
- package/dist/esm/sdk/README.md +18 -14
- package/dist/types/src/api/quoter/quote/quote.d.ts +3 -2
- package/dist/types/src/api/quoter/quote/types.d.ts +6 -1
- package/dist/types/src/api/quoter/quoter.request.d.ts +3 -3
- package/dist/types/src/api/quoter/types.d.ts +2 -2
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/sdk/types.d.ts +3 -3
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +4 -4
package/dist/esm/sdk/README.md
CHANGED
|
@@ -204,12 +204,11 @@ sdk.placeOrder({
|
|
|
204
204
|
toTokenAddress: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', // USDC
|
|
205
205
|
amount: '50000000000000000', // 0.05 ETH
|
|
206
206
|
walletAddress: makerAddress,
|
|
207
|
-
//
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
source: 'platform-name'
|
|
207
|
+
// integratorFee is an optional field
|
|
208
|
+
integratorFee: {
|
|
209
|
+
receiver: new Address('0x0000000000000000000000000000000000000000'), // fee receiver address
|
|
210
|
+
value: new Bps(100n) // 1% as we use bps format, 1% is equal to 100bps
|
|
211
|
+
}
|
|
213
212
|
}).then(console.log)
|
|
214
213
|
```
|
|
215
214
|
|
|
@@ -224,6 +223,15 @@ type PaginationParams = {
|
|
|
224
223
|
}
|
|
225
224
|
```
|
|
226
225
|
|
|
226
|
+
### IntegratorFeeRequest
|
|
227
|
+
|
|
228
|
+
```typescript
|
|
229
|
+
type IntegratorFeeRequest = {
|
|
230
|
+
receiver: Address // fee receiver address
|
|
231
|
+
value: Bps // 100 == 1%
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
227
235
|
### QuoteParams
|
|
228
236
|
|
|
229
237
|
```typescript
|
|
@@ -231,8 +239,9 @@ type QuoteParams = {
|
|
|
231
239
|
fromTokenAddress: string
|
|
232
240
|
toTokenAddress: string
|
|
233
241
|
amount: string
|
|
242
|
+
walletAddress?: string
|
|
234
243
|
permit?: string // a permit (EIP-2612) call data, user approval sign
|
|
235
|
-
|
|
244
|
+
integratorFee?: IntegratorFeeRequest
|
|
236
245
|
}
|
|
237
246
|
```
|
|
238
247
|
|
|
@@ -253,12 +262,7 @@ type OrderParams = {
|
|
|
253
262
|
permit?: string // a permit (EIP-2612) call data, user approval sign
|
|
254
263
|
receiver?: string // address
|
|
255
264
|
preset?: PresetEnum
|
|
256
|
-
nonce?:
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
export type TakingFeeInfo = {
|
|
261
|
-
takingFeeBps: number // 100 == 1%
|
|
262
|
-
takingFeeReceiver: string
|
|
265
|
+
nonce?: bigint // allows to batch cancel orders
|
|
266
|
+
integratorFee?: IntegratorFeeRequest
|
|
263
267
|
}
|
|
264
268
|
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Address, ProxyFactory } from '@1inch/limit-order-sdk';
|
|
2
|
-
import { FusionOrderParamsData,
|
|
2
|
+
import { FusionOrderParamsData, IntegratorFeeResponse, ResolverFeePreset } from './types.js';
|
|
3
3
|
import { Cost, PresetEnum, QuoterResponse } from '../types.js';
|
|
4
4
|
import { Preset } from '../preset.js';
|
|
5
5
|
import { FusionOrder } from '../../../fusion-order/index.js';
|
|
@@ -25,10 +25,11 @@ export declare class Quote {
|
|
|
25
25
|
readonly slippage: number;
|
|
26
26
|
readonly resolverFeePreset: ResolverFeePreset;
|
|
27
27
|
readonly surplusFee?: number;
|
|
28
|
-
readonly integratorFeeParams?:
|
|
28
|
+
readonly integratorFeeParams?: IntegratorFeeResponse;
|
|
29
29
|
constructor(params: QuoterRequest, response: QuoterResponse);
|
|
30
30
|
createFusionOrder(paramsData: Omit<FusionOrderParamsData, 'permit' | 'isPermit2'>): FusionOrder;
|
|
31
31
|
getPreset(type?: PresetEnum): Preset;
|
|
32
32
|
private getWhitelist;
|
|
33
33
|
private _createOrder;
|
|
34
|
+
private parseIntegratorFee;
|
|
34
35
|
}
|
|
@@ -13,11 +13,16 @@ export type FusionOrderParamsData = {
|
|
|
13
13
|
delayAuctionStartTimeBy?: bigint;
|
|
14
14
|
orderExpirationDelay?: bigint;
|
|
15
15
|
};
|
|
16
|
-
export type
|
|
16
|
+
export type IntegratorFeeRequest = {
|
|
17
|
+
receiver: Address;
|
|
18
|
+
value: Bps;
|
|
19
|
+
};
|
|
20
|
+
export type IntegratorFeeResponse = {
|
|
17
21
|
receiver: Address;
|
|
18
22
|
value: Bps;
|
|
19
23
|
share: Bps;
|
|
20
24
|
};
|
|
25
|
+
export type IntegratorFeeParams = IntegratorFeeResponse;
|
|
21
26
|
export type ResolverFeePreset = {
|
|
22
27
|
receiver: Address;
|
|
23
28
|
bps: Bps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Address } from '@1inch/limit-order-sdk';
|
|
2
2
|
import { QuoterRequestParams, QuoterRequestParamsRaw } from './types.js';
|
|
3
|
-
import {
|
|
3
|
+
import { IntegratorFeeRequest } from './quote/index.js';
|
|
4
4
|
export declare class QuoterRequest {
|
|
5
5
|
readonly fromTokenAddress: Address;
|
|
6
6
|
readonly toTokenAddress: Address;
|
|
@@ -8,8 +8,8 @@ export declare class QuoterRequest {
|
|
|
8
8
|
readonly walletAddress: Address;
|
|
9
9
|
readonly enableEstimate: boolean;
|
|
10
10
|
readonly permit: string | undefined;
|
|
11
|
-
readonly integratorFee?:
|
|
12
|
-
readonly source
|
|
11
|
+
readonly integratorFee?: IntegratorFeeRequest;
|
|
12
|
+
readonly source?: string;
|
|
13
13
|
readonly isPermit2: boolean;
|
|
14
14
|
readonly slippage?: number;
|
|
15
15
|
constructor(params: QuoterRequestParams);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IntegratorFeeRequest } from './quote/index.js';
|
|
2
2
|
import { NetworkEnum } from '../../constants.js';
|
|
3
3
|
export type QuoterRequestParams = {
|
|
4
4
|
fromTokenAddress: string;
|
|
@@ -7,7 +7,7 @@ export type QuoterRequestParams = {
|
|
|
7
7
|
walletAddress: string;
|
|
8
8
|
enableEstimate?: boolean;
|
|
9
9
|
permit?: string;
|
|
10
|
-
integratorFee?:
|
|
10
|
+
integratorFee?: IntegratorFeeRequest;
|
|
11
11
|
source?: string;
|
|
12
12
|
isPermit2?: boolean;
|
|
13
13
|
slippage?: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Address, type LimitOrderV4Struct, Extension, randBigInt, getLimitOrderContract, Interaction, TakerTraits, ExtensionBuilder, AmountMode, getLimitOrderV4Domain, LimitOrderContract, type OrderInfoData, type EIP712TypedData, MakerTraits, ProxyFactory, NativeOrdersFactory, NativeOrdersImpl } from '@1inch/limit-order-sdk';
|
|
1
|
+
export { Address, type LimitOrderV4Struct, Extension, randBigInt, getLimitOrderContract, Interaction, TakerTraits, ExtensionBuilder, AmountMode, getLimitOrderV4Domain, LimitOrderContract, type OrderInfoData, type EIP712TypedData, MakerTraits, ProxyFactory, NativeOrdersFactory, NativeOrdersImpl, Bps } from '@1inch/limit-order-sdk';
|
|
2
2
|
export * from './fusion-order/index.js';
|
|
3
3
|
export * from './amount-calculator//index.js';
|
|
4
4
|
export * from './connector/index.js';
|
|
@@ -10,4 +10,4 @@ export * from './utils/time.js';
|
|
|
10
10
|
export * from './validations.js';
|
|
11
11
|
export * from './ws-api/index.js';
|
|
12
12
|
export * from './errors.js';
|
|
13
|
-
export { QuoterRequest, type QuoterResponse, RelayerRequest, QuoterCustomPresetRequest, PresetEnum, Preset, Quote, type OrderStatusResponse, OrderStatus } from './api/index.js';
|
|
13
|
+
export { QuoterRequest, type QuoterResponse, RelayerRequest, QuoterCustomPresetRequest, PresetEnum, Preset, Quote, type OrderStatusResponse, OrderStatus, type IntegratorFeeRequest, type IntegratorFeeResponse } from './api/index.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Address, LimitOrderV4Struct } from '@1inch/limit-order-sdk';
|
|
2
2
|
import { BlockchainProviderConnector, HttpProviderConnector } from '../connector/index.js';
|
|
3
3
|
import { NetworkEnum } from '../constants.js';
|
|
4
|
-
import { CustomPreset,
|
|
4
|
+
import { CustomPreset, IntegratorFeeRequest, PresetEnum } from '../api/index.js';
|
|
5
5
|
import { FusionOrder } from '../fusion-order/index.js';
|
|
6
6
|
export type FusionSDKConfigParams = {
|
|
7
7
|
url: string;
|
|
@@ -17,7 +17,7 @@ export type QuoteParams = {
|
|
|
17
17
|
walletAddress?: string;
|
|
18
18
|
enableEstimate?: boolean;
|
|
19
19
|
permit?: string;
|
|
20
|
-
integratorFee?:
|
|
20
|
+
integratorFee?: IntegratorFeeRequest;
|
|
21
21
|
source?: string;
|
|
22
22
|
isPermit2?: boolean;
|
|
23
23
|
slippage?: number;
|
|
@@ -40,7 +40,7 @@ export type OrderParams = {
|
|
|
40
40
|
orderExpirationDelay?: bigint;
|
|
41
41
|
allowPartialFills?: boolean;
|
|
42
42
|
allowMultipleFills?: boolean;
|
|
43
|
-
integratorFee?:
|
|
43
|
+
integratorFee?: IntegratorFeeRequest;
|
|
44
44
|
slippage?: number;
|
|
45
45
|
};
|
|
46
46
|
export type OrderInfo = {
|