@orbs-network/twap 1.7.11 → 1.7.12

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.
@@ -74,6 +74,7 @@ export declare const ChainConfigs: {
74
74
  export declare const Configs: {
75
75
  SpiritSwap: Config;
76
76
  SpookySwap: Config;
77
+ Pangolin: Config;
77
78
  };
78
79
  export declare const nativeTokenAddresses: string[];
79
80
  export declare const isNativeAddress: (address: string) => boolean;
@@ -64,6 +64,7 @@ exports.ChainConfigs = {
64
64
  exports.Configs = {
65
65
  SpiritSwap: Object.assign(Object.assign({}, exports.ChainConfigs.ftm), { partner: "SpiritSwap", exchangeAddress: "0xAd19179201be5A51D1cBd3bB2fC651BB05822404", exchangeType: "ParaswapExchange", pathfinderKey: paraswap_1.Paraswap.OnlyDex.SpiritSwap }),
66
66
  SpookySwap: Object.assign(Object.assign({}, exports.ChainConfigs.ftm), { partner: "SpookySwap", exchangeAddress: "0x37F427DA0D12Fe2C80aCa09EE08e7e92A1B2B114", exchangeType: "UniswapV2Exchange", pathfinderKey: paraswap_1.Paraswap.OnlyDex.SpookySwap }),
67
+ Pangolin: Object.assign(Object.assign({}, exports.ChainConfigs.avax), { partner: "Pangolin", exchangeAddress: "", exchangeType: "UniswapV2Exchange", pathfinderKey: paraswap_1.Paraswap.OnlyDex.Pangolin }),
67
68
  };
68
69
  // export const UniswapV2Config: Config = {
69
70
  // ...ChainConfigs.eth,
package/dist/src/lib.js CHANGED
@@ -170,14 +170,9 @@ class TWAPLib {
170
170
  }
171
171
  sendTx(tx, priorityFeePerGas, maxFeePerGas, amount) {
172
172
  return __awaiter(this, void 0, void 0, function* () {
173
- let gas = 500000;
174
- try {
175
- gas = Math.max(gas, Math.floor((yield tx.estimateGas()) * 1.2));
176
- }
177
- catch (ignore) { }
178
173
  return yield tx.send({
179
174
  from: this.maker,
180
- gas,
175
+ gas: Math.floor((yield tx.estimateGas({ from: this.maker, value: amount ? (0, bignumber_js_1.default)(amount).toFixed(0) : undefined })) * 1.2),
181
176
  maxPriorityFeePerGas: priorityFeePerGas ? (0, bignumber_js_1.default)(priorityFeePerGas).toFixed(0) : undefined,
182
177
  maxFeePerGas: maxFeePerGas ? (0, bignumber_js_1.default)(maxFeePerGas).toFixed(0) : undefined,
183
178
  value: amount ? (0, bignumber_js_1.default)(amount).toFixed(0) : undefined,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbs-network/twap",
3
- "version": "1.7.11",
3
+ "version": "1.7.12",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/orbs-network/twap.git"
@@ -28,7 +28,8 @@
28
28
  "test": "for t in eth ftm poly; do npm run test:$t; done",
29
29
  "test:eth": "NETWORK=ETH BLOCK=14908980 hardhat test",
30
30
  "test:ftm": "NETWORK=FTM BLOCK=39838819 hardhat test",
31
- "test:poly": "NETWORK=POLY BLOCK=29194866 hardhat test"
31
+ "test:poly": "NETWORK=POLY BLOCK=29194866 hardhat test",
32
+ "prepublishOnly": "npm run build"
32
33
  },
33
34
  "prettier": {
34
35
  "printWidth": 120