@1inch/fusion-sdk 2.3.6 → 2.3.7-rc.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.
@@ -69,6 +69,7 @@ var Quote = /*#__PURE__*/ function() {
69
69
  _define_property(this, "slippage", void 0);
70
70
  _define_property(this, "resolverFeePreset", void 0);
71
71
  _define_property(this, "surplusFee", void 0);
72
+ _define_property(this, "integratorFeeParams", void 0);
72
73
  this.params = params;
73
74
  this.fromTokenAmount = BigInt(response.fromTokenAmount);
74
75
  var _obj;
@@ -90,6 +91,11 @@ var Quote = /*#__PURE__*/ function() {
90
91
  bps: new _limitordersdk.Bps(BigInt(response.fee.bps))
91
92
  };
92
93
  this.surplusFee = response.surplusFee;
94
+ this.integratorFeeParams = response.integratorFee && response.integratorFeeReceiver ? {
95
+ receiver: new _limitordersdk.Address(response.integratorFeeReceiver),
96
+ value: new _limitordersdk.Bps(BigInt(response.integratorFee)),
97
+ share: _limitordersdk.Bps.fromPercent(response.integratorFeeShare || 0)
98
+ } : undefined;
93
99
  }
94
100
  _create_class(Quote, [
95
101
  {
@@ -133,7 +139,7 @@ var Quote = /*#__PURE__*/ function() {
133
139
  orderExpirationDelay: paramsData === null || paramsData === void 0 ? void 0 : paramsData.orderExpirationDelay,
134
140
  source: this.params.source,
135
141
  enablePermit2: params.isPermit2,
136
- fees: buildFees(this.resolverFeePreset, this.params.integratorFee, this.surplusFee)
142
+ fees: buildFees(this.resolverFeePreset, this.params.integratorFee || this.integratorFeeParams, this.surplusFee)
137
143
  });
138
144
  }
139
145
  },
@@ -13,6 +13,10 @@ Object.defineProperty(exports, "PresetEnum", {
13
13
  */ /**
14
14
  * Optional slippage value in percent (e.g., 1 for 1%, max 50)
15
15
  * Must be between 1 and 50 inclusive
16
+ */ /**
17
+ * In bps
18
+ */ /**
19
+ * Percentage of the integrator fee that will be shared with the integrator.
16
20
  */ var PresetEnum = /*#__PURE__*/ function(PresetEnum) {
17
21
  PresetEnum["fast"] = "fast";
18
22
  PresetEnum["medium"] = "medium";
@@ -59,6 +59,7 @@ export var Quote = /*#__PURE__*/ function() {
59
59
  _define_property(this, "slippage", void 0);
60
60
  _define_property(this, "resolverFeePreset", void 0);
61
61
  _define_property(this, "surplusFee", void 0);
62
+ _define_property(this, "integratorFeeParams", void 0);
62
63
  this.params = params;
63
64
  this.fromTokenAmount = BigInt(response.fromTokenAmount);
64
65
  var _obj;
@@ -80,6 +81,11 @@ export var Quote = /*#__PURE__*/ function() {
80
81
  bps: new Bps(BigInt(response.fee.bps))
81
82
  };
82
83
  this.surplusFee = response.surplusFee;
84
+ this.integratorFeeParams = response.integratorFee && response.integratorFeeReceiver ? {
85
+ receiver: new Address(response.integratorFeeReceiver),
86
+ value: new Bps(BigInt(response.integratorFee)),
87
+ share: Bps.fromPercent(response.integratorFeeShare || 0)
88
+ } : undefined;
83
89
  }
84
90
  _create_class(Quote, [
85
91
  {
@@ -123,7 +129,7 @@ export var Quote = /*#__PURE__*/ function() {
123
129
  orderExpirationDelay: paramsData === null || paramsData === void 0 ? void 0 : paramsData.orderExpirationDelay,
124
130
  source: this.params.source,
125
131
  enablePermit2: params.isPermit2,
126
- fees: buildFees(this.resolverFeePreset, this.params.integratorFee, this.surplusFee)
132
+ fees: buildFees(this.resolverFeePreset, this.params.integratorFee || this.integratorFeeParams, this.surplusFee)
127
133
  });
128
134
  }
129
135
  },
@@ -3,6 +3,10 @@
3
3
  */ /**
4
4
  * Optional slippage value in percent (e.g., 1 for 1%, max 50)
5
5
  * Must be between 1 and 50 inclusive
6
+ */ /**
7
+ * In bps
8
+ */ /**
9
+ * Percentage of the integrator fee that will be shared with the integrator.
6
10
  */ export var PresetEnum = /*#__PURE__*/ function(PresetEnum) {
7
11
  PresetEnum["fast"] = "fast";
8
12
  PresetEnum["medium"] = "medium";
@@ -1 +1 @@
1
- {"name":"@1inch/fusion-sdk","version":"2.3.6","type":"module"}
1
+ {"name":"@1inch/fusion-sdk","version":"2.3.7-rc.0","type":"module"}
@@ -1,5 +1,5 @@
1
1
  import { Address } from '@1inch/limit-order-sdk';
2
- import { FusionOrderParamsData, ResolverFeePreset } from './types.js';
2
+ import { FusionOrderParamsData, IntegratorFeeParams, 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';
@@ -24,6 +24,7 @@ export declare class Quote {
24
24
  readonly slippage: number;
25
25
  readonly resolverFeePreset: ResolverFeePreset;
26
26
  readonly surplusFee?: number;
27
+ readonly integratorFeeParams?: IntegratorFeeParams;
27
28
  constructor(params: QuoterRequest, response: QuoterResponse);
28
29
  createFusionOrder(paramsData: Omit<FusionOrderParamsData, 'permit' | 'isPermit2'>): FusionOrder;
29
30
  getPreset(type?: PresetEnum): Preset;
@@ -39,6 +39,9 @@ export type QuoterResponse = {
39
39
  fee: ResolverFeePresetRaw;
40
40
  surplusFee?: number;
41
41
  marketAmount: string;
42
+ integratorFee: number;
43
+ integratorFeeReceiver?: string;
44
+ integratorFeeShare: number;
42
45
  };
43
46
  export type QuoterPresets = {
44
47
  fast: PresetData;