@rabby-wallet/rabby-swap 0.0.8 → 0.0.10

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.
@@ -72,7 +72,7 @@ export const getQuote = (options) => __awaiter(void 0, void 0, void 0, function*
72
72
  slippagePercentage: options.slippage / 100,
73
73
  skipValidation: true,
74
74
  };
75
- if (options.feeRate) {
75
+ if (options.feeRate !== null && options.feeRate !== undefined) {
76
76
  params.buyTokenPercentageFee = options.feeRate / 100;
77
77
  params.feeRecipient = options.feeAddress;
78
78
  params.affiliateAddress = options.feeAddress;
@@ -63,7 +63,7 @@ export const getQuote = (options) => __awaiter(void 0, void 0, void 0, function*
63
63
  slippage: options.slippage,
64
64
  disableEstimate: true,
65
65
  };
66
- if (options.feeRate) {
66
+ if (options.feeRate !== null && options.feeRate !== undefined) {
67
67
  params.fee = options.feeRate;
68
68
  params.referrerAddress = options.feeAddress;
69
69
  }
@@ -68,6 +68,7 @@ export const getQuote = (options) => __awaiter(void 0, void 0, void 0, function*
68
68
  userAddress: options.userAddress,
69
69
  network: chainId,
70
70
  includeContractMethods: "simpleSwap,multiSwap,megaSwap",
71
+ partner: "Rabby",
71
72
  });
72
73
  const params = {
73
74
  srcToken: options.fromToken === CHAINS[options.chain].nativeTokenAddress
@@ -83,7 +84,7 @@ export const getQuote = (options) => __awaiter(void 0, void 0, void 0, function*
83
84
  priceRoute: priceRoute,
84
85
  partner: 'Rabby',
85
86
  };
86
- if (options.feeRate) {
87
+ if (options.feeRate !== null && options.feeRate !== undefined) {
87
88
  params.partnerFeeBps = (options.feeRate * 100).toString();
88
89
  params.partnerAddress = options.feeAddress;
89
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/rabby-swap",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/dexs/0xapi.ts CHANGED
@@ -98,7 +98,7 @@ export const getQuote = async (options: QuoteParams): Promise<QuoteResult> => {
98
98
  skipValidation: true,
99
99
  };
100
100
 
101
- if (options.feeRate) {
101
+ if (options.feeRate !== null && options.feeRate !== undefined) {
102
102
  params.buyTokenPercentageFee = options.feeRate / 100;
103
103
  params.feeRecipient = options.feeAddress;
104
104
  params.affiliateAddress = options.feeAddress;
package/src/dexs/1inch.ts CHANGED
@@ -99,7 +99,7 @@ export const getQuote = async (options: QuoteParams): Promise<QuoteResult> => {
99
99
  disableEstimate: true,
100
100
  };
101
101
 
102
- if (options.feeRate) {
102
+ if (options.feeRate !== null && options.feeRate !== undefined) {
103
103
  params.fee = options.feeRate;
104
104
  params.referrerAddress = options.feeAddress;
105
105
  }
@@ -55,6 +55,7 @@ interface PriceParams {
55
55
  userAddress: string;
56
56
  network: number;
57
57
  includeContractMethods: string;
58
+ partner: string;
58
59
  }
59
60
 
60
61
  interface PriceResponse {
@@ -126,6 +127,7 @@ export const getQuote = async (options: QuoteParams): Promise<QuoteResult> => {
126
127
  userAddress: options.userAddress,
127
128
  network: chainId,
128
129
  includeContractMethods: "simpleSwap,multiSwap,megaSwap",
130
+ partner: "Rabby",
129
131
  });
130
132
 
131
133
  const params: SwapParams = {
@@ -145,7 +147,7 @@ export const getQuote = async (options: QuoteParams): Promise<QuoteResult> => {
145
147
  partner: 'Rabby',
146
148
  };
147
149
 
148
- if (options.feeRate) {
150
+ if (options.feeRate !== null && options.feeRate !== undefined) {
149
151
  params.partnerFeeBps = (options.feeRate * 100).toString();
150
152
  params.partnerAddress = options.feeAddress;
151
153
  }