@pioneer-platform/uniswap-client 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.
Files changed (2) hide show
  1. package/lib/index.js +8 -3
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -147,7 +147,7 @@ var ETH_UNIVERSIAL_ROUTER = {
147
147
  };
148
148
  var BASE_CONTRACTS = {
149
149
  Permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
150
- UniversalRouter: "0x198EF79F1F515F02dFE9e3115eD9fC07183f02fC",
150
+ UniversalRouter: "0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD",
151
151
  V3CoreFactory: "0x33128a8fC17869897dcE68Ed026d694621f6FDfD",
152
152
  Multicall: "0x091e99cb1C49331a94dD62755D168E941AbD0693",
153
153
  ProxyAdmin: "0x3334d83e224aF5ef9C2E7DDA7c7C98Efd9621fA9",
@@ -169,7 +169,9 @@ var EIP155_MAINNET_CHAINS = {
169
169
  logo: '/chain-logos/eip155-1.png',
170
170
  rgb: '99, 125, 234',
171
171
  permit2: universal_router_sdk_1.PERMIT2_ADDRESS,
172
+ universalRouter: universal_router_sdk_1.UNIVERSAL_ROUTER_ADDRESS,
172
173
  rpc: 'https://eth.llamarpc.com',
174
+ defaultGasLimit: 250000,
173
175
  namespace: 'eip155'
174
176
  },
175
177
  // 'eip155:43114': {
@@ -211,7 +213,9 @@ var EIP155_MAINNET_CHAINS = {
211
213
  logo: '/chain-logos/base.png',
212
214
  rgb: '242, 242, 242',
213
215
  permit2: BASE_CONTRACTS.Permit2,
216
+ universalRouter: BASE_CONTRACTS.UniversalRouter,
214
217
  rpc: 'https://mainnet.base.org',
218
+ defaultGasLimit: 135120,
215
219
  namespace: 'eip155'
216
220
  }
217
221
  };
@@ -335,7 +339,7 @@ var buildTx = function (_a) {
335
339
  _c.trys.push([2, 4, , 5]);
336
340
  return [4 /*yield*/, provider.estimateGas({
337
341
  from: from,
338
- to: (0, universal_router_sdk_1.UNIVERSAL_ROUTER_ADDRESS)(chainId), // Uniswap Router address
342
+ to: EIP155_MAINNET_CHAINS['eip155:' + chainId].universalRouter, // Uniswap Router address
339
343
  data: data,
340
344
  value: ethers.utils.parseEther("0"), // Value for token swaps
341
345
  })];
@@ -346,6 +350,7 @@ var buildTx = function (_a) {
346
350
  return [3 /*break*/, 5];
347
351
  case 4:
348
352
  e_2 = _c.sent();
353
+ console.error("Error in estimateGas: ", e_2);
349
354
  //@TODO get custom gas limit defaults per chain
350
355
  gas = "0x".concat(BigInt("135120").toString(16));
351
356
  return [3 /*break*/, 5];
@@ -353,7 +358,7 @@ var buildTx = function (_a) {
353
358
  case 6:
354
359
  gasPrice = _c.sent();
355
360
  adjustedGasPrice = gasPrice.mul(ethers.BigNumber.from(110)).div(ethers.BigNumber.from(100));
356
- tx = __assign(__assign({ from: from, to: (0, universal_router_sdk_1.UNIVERSAL_ROUTER_ADDRESS)(chainId), chainId: chainId, data: data }, (value && !isZero(value) ? { value: (0, v3_sdk_1.toHex)(value) } : {})), { gas: gas, gasPrice: (0, v3_sdk_1.toHex)(adjustedGasPrice), nonce: (0, v3_sdk_1.toHex)(nonce) });
361
+ tx = __assign(__assign({ from: from, to: EIP155_MAINNET_CHAINS['eip155:' + chainId].universalRouter, chainId: chainId, data: data }, (value && !isZero(value) ? { value: (0, v3_sdk_1.toHex)(value) } : {})), { gas: gas, gasPrice: (0, v3_sdk_1.toHex)(adjustedGasPrice), nonce: (0, v3_sdk_1.toHex)(nonce) });
357
362
  return [2 /*return*/, tx];
358
363
  case 7:
359
364
  e_3 = _c.sent();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/uniswap-client",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "dependencies": {