@thesingularitynetwork/darkswap-sdk 0.1.21 → 0.1.23

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.
@@ -4,6 +4,7 @@ export declare enum ChainId {
4
4
  HARDHAT_BASE = 31339,
5
5
  MAINNET = 1,
6
6
  SEPOLIA = 11155111,
7
+ HORIZEN_TESTNET = 845320009,
7
8
  ARBITRUM_ONE = 42161,
8
9
  BASE = 8453
9
10
  }
@@ -4176,6 +4176,7 @@ var ERC20_USDT = {
4176
4176
  ChainId[ChainId["HARDHAT_BASE"] = 31339] = "HARDHAT_BASE";
4177
4177
  ChainId[ChainId["MAINNET"] = 1] = "MAINNET";
4178
4178
  ChainId[ChainId["SEPOLIA"] = 11155111] = "SEPOLIA";
4179
+ ChainId[ChainId["HORIZEN_TESTNET"] = 845320009] = "HORIZEN_TESTNET";
4179
4180
  ChainId[ChainId["ARBITRUM_ONE"] = 42161] = "ARBITRUM_ONE";
4180
4181
  ChainId[ChainId["BASE"] = 8453] = "BASE";
4181
4182
  })(exports.ChainId || (exports.ChainId = {}));
@@ -8644,7 +8645,7 @@ var ProSwapService = /*#__PURE__*/function (_BaseContractService) {
8644
8645
  var _proto = ProSwapService.prototype;
8645
8646
  _proto.prepare = /*#__PURE__*/function () {
8646
8647
  var _prepare = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(address, orderNote, bobAddress, bobSwapMessage, signature) {
8647
- var _yield$generateKeyPai2, pubKey, swapOutAmount, swapInAmount, aliceFeeAmount, changeNote, swapInNote, context;
8648
+ var _yield$generateKeyPai2, pubKey, swapOutAmount, swapInAmount, aliceFeeAmount, changeAmount, changeNote, swapInNote, context;
8648
8649
  return _regenerator().w(function (_context2) {
8649
8650
  while (1) switch (_context2.n) {
8650
8651
  case 0:
@@ -8656,7 +8657,8 @@ var ProSwapService = /*#__PURE__*/function (_BaseContractService) {
8656
8657
  swapOutAmount = bobSwapMessage.feeAmount + bobSwapMessage.inNote.amount;
8657
8658
  swapInAmount = bobSwapMessage.orderNote.amount;
8658
8659
  aliceFeeAmount = calcFeeAmount(swapInAmount, orderNote.feeRatio);
8659
- changeNote = createNote(address, orderNote.asset, orderNote.amount - swapOutAmount, pubKey);
8660
+ changeAmount = orderNote.amount - swapOutAmount;
8661
+ changeNote = changeAmount == 0n ? EMPTY_NOTE : createNote(address, orderNote.asset, changeAmount, pubKey);
8660
8662
  swapInNote = createNote(address, bobSwapMessage.orderNote.asset, swapInAmount - aliceFeeAmount, pubKey);
8661
8663
  context = new ProSwapContext(signature);
8662
8664
  context.orderNote = orderNote;
@@ -9900,6 +9902,14 @@ var contractConfig = (_contractConfig = {}, _contractConfig[exports.ChainId.MAIN
9900
9902
  darkSwapAssetManager: '0x0',
9901
9903
  darkSwapFeeAssetManager: '0x0',
9902
9904
  drakSwapSubgraphUrl: ''
9905
+ }, _contractConfig[exports.ChainId.HORIZEN_TESTNET] = {
9906
+ priceOracle: '0x54c375f28ce4B0c2B986D6256E4Bc75d242A8793',
9907
+ ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
9908
+ nativeWrapper: '0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14',
9909
+ merkleTreeOperator: '0x8Cd4061C8b3743810B811E1F4A0B597D79225f4E',
9910
+ darkSwapAssetManager: '0xEBeD6c7C2189bf8ad6687D3A4cf4b83fB4D1a3D2',
9911
+ darkSwapFeeAssetManager: '0x8CF86856Bd7dE95b4ba33DCae4cd5Ec02542Bf5b',
9912
+ drakSwapSubgraphUrl: ''
9903
9913
  }, _contractConfig[exports.ChainId.HARDHAT] = {
9904
9914
  priceOracle: '0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8',
9905
9915
  ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',